Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main()
{
	int N;
	scanf("%d", &N);
	
	const int bit[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
	int i, j, k;
	for (i = 0; i < N - 1; i++) {
		for (j = i + 1; j < N - 1; j++) {
			for (k = 0; k < 10; k++) if ((i & bit[k]) != (j & bit[k])) break;
			printf("%d ", k + 1);
		}
		for (k = 0; k < 10; k++) if ((i & bit[k]) != ((N - 1) & bit[k])) break;
		printf("%d\n", k + 1);
	}
	
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -48(%rbp)
	movl	$2, -44(%rbp)
	movl	$4, -40(%rbp)
	movl	$8, -36(%rbp)
	movl	$16, -32(%rbp)
	movl	$32, -28(%rbp)
	movl	$64, -24(%rbp)
	movl	$128, -20(%rbp)
	movl	$256, -16(%rbp)
	movl	$512, -12(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L2
.L13:
	movl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -56(%rbp)
	jmp	.L3
.L8:
	movl	$0, -52(%rbp)
	jmp	.L4
.L7:
	movl	-60(%rbp), %eax
	xorl	-56(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	%edx, %eax
	testl	%eax, %eax
	jne	.L16
	addl	$1, -52(%rbp)
.L4:
	cmpl	$9, -52(%rbp)
	jle	.L7
	jmp	.L6
.L16:
	nop
.L6:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -56(%rbp)
.L3:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -56(%rbp)
	jl	.L8
	movl	$0, -52(%rbp)
	jmp	.L9
.L12:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	xorl	-60(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	addl	$1, -52(%rbp)
.L9:
	cmpl	$9, -52(%rbp)
	jle	.L12
	jmp	.L11
.L17:
	nop
.L11:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -60(%rbp)
.L2:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -60(%rbp)
	jl	.L13
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	leal	-1(%rdx), %eax
	cmpl	$1, %edx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebp, %r13d
	addl	$1, %ebp
	movl	%ebp, %r14d
	cmpl	%ebp, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %eax
	xorl	%r14d, %eax
	movl	%eax, %edx
	andl	$1, %edx
	jne	.L5
	testb	$2, %al
	jne	.L11
	testb	$4, %al
	jne	.L12
	testb	$8, %al
	jne	.L13
	testb	$16, %al
	jne	.L14
	testb	$32, %al
	jne	.L15
	testb	$64, %al
	jne	.L16
	testb	$-128, %al
	jne	.L17
	testb	$1, %ah
	jne	.L18
	xorl	%edx, %edx
	testb	$2, %ah
	sete	%dl
	addl	$10, %edx
.L5:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__printf_chk@PLT
	movl	4(%rsp), %eax
	subl	$1, %eax
	cmpl	%r14d, %eax
	jg	.L3
.L4:
	xorl	%r13d, %eax
	movl	%eax, %edx
	andl	$1, %edx
	jne	.L6
	testb	$2, %al
	jne	.L20
	testb	$4, %al
	jne	.L21
	testb	$8, %al
	jne	.L22
	testb	$16, %al
	jne	.L23
	testb	$32, %al
	jne	.L24
	testb	$64, %al
	jne	.L25
	testb	$-128, %al
	jne	.L26
	testb	$1, %ah
	jne	.L27
	xorl	%edx, %edx
	testb	$2, %ah
	sete	%dl
	addl	$10, %edx
.L6:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rsp), %edx
	leal	-1(%rdx), %eax
	cmpl	%ebp, %eax
	jg	.L2
.L7:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	movl	$2, %edx
	jmp	.L5
.L12:
	movl	$3, %edx
	jmp	.L5
.L13:
	movl	$4, %edx
	jmp	.L5
.L14:
	movl	$5, %edx
	jmp	.L5
.L15:
	movl	$6, %edx
	jmp	.L5
.L16:
	movl	$7, %edx
	jmp	.L5
.L17:
	movl	$8, %edx
	jmp	.L5
.L18:
	movl	$9, %edx
	jmp	.L5
.L20:
	movl	$2, %edx
	jmp	.L6
.L21:
	movl	$3, %edx
	jmp	.L6
.L22:
	movl	$4, %edx
	jmp	.L6
.L23:
	movl	$5, %edx
	jmp	.L6
.L24:
	movl	$6, %edx
	jmp	.L6
.L26:
	movl	$8, %edx
	jmp	.L6
.L25:
	movl	$7, %edx
	jmp	.L6
.L27:
	movl	$9, %edx
	jmp	.L6
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	leal	-1(%rdx), %eax
	cmpl	$1, %edx
	jle	.L7
	.p2align 4,,10
	.p2align 3
.L2:
	movl	%ebp, %r13d
	addl	$1, %ebp
	movl	%ebp, %r14d
	cmpl	%ebp, %eax
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%r13d, %eax
	xorl	%r14d, %eax
	movl	%eax, %edx
	andl	$1, %edx
	jne	.L5
	testb	$2, %al
	jne	.L11
	testb	$4, %al
	jne	.L12
	testb	$8, %al
	jne	.L13
	testb	$16, %al
	jne	.L14
	testb	$32, %al
	jne	.L15
	testb	$64, %al
	jne	.L16
	testb	$-128, %al
	jne	.L17
	testb	$1, %ah
	jne	.L18
	xorl	%edx, %edx
	testb	$2, %ah
	sete	%dl
	addl	$10, %edx
.L5:
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__printf_chk@PLT
	movl	4(%rsp), %eax
	subl	$1, %eax
	cmpl	%r14d, %eax
	jg	.L3
.L4:
	xorl	%r13d, %eax
	movl	%eax, %edx
	andl	$1, %edx
	jne	.L6
	testb	$2, %al
	jne	.L20
	testb	$4, %al
	jne	.L21
	testb	$8, %al
	jne	.L22
	testb	$16, %al
	jne	.L23
	testb	$32, %al
	jne	.L24
	testb	$64, %al
	jne	.L25
	testb	$-128, %al
	jne	.L26
	testb	$1, %ah
	jne	.L27
	xorl	%edx, %edx
	testb	$2, %ah
	sete	%dl
	addl	$10, %edx
.L6:
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rsp), %edx
	leal	-1(%rdx), %eax
	cmpl	%ebp, %eax
	jg	.L2
.L7:
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L36
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	movl	$2, %edx
	jmp	.L5
.L12:
	movl	$3, %edx
	jmp	.L5
.L13:
	movl	$4, %edx
	jmp	.L5
.L14:
	movl	$5, %edx
	jmp	.L5
.L15:
	movl	$6, %edx
	jmp	.L5
.L16:
	movl	$7, %edx
	jmp	.L5
.L17:
	movl	$8, %edx
	jmp	.L5
.L18:
	movl	$9, %edx
	jmp	.L5
.L20:
	movl	$2, %edx
	jmp	.L6
.L21:
	movl	$3, %edx
	jmp	.L6
.L22:
	movl	$4, %edx
	jmp	.L6
.L23:
	movl	$5, %edx
	jmp	.L6
.L24:
	movl	$6, %edx
	jmp	.L6
.L26:
	movl	$8, %edx
	jmp	.L6
.L25:
	movl	$7, %edx
	jmp	.L6
.L27:
	movl	$9, %edx
	jmp	.L6
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>

int main()
{
	int N;
	scanf("%d", &N);
	
	const int bit[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
	int i, j, k;
	for (i = 0; i < N - 1; i++) {
		for (j = i + 1; j < N - 1; j++) {
			for (k = 0; k < 10; k++) if ((i & bit[k]) != (j & bit[k])) break;
			printf("%d ", k + 1);
		}
		for (k = 0; k < 10; k++) if ((i & bit[k]) != ((N - 1) & bit[k])) break;
		printf("%d\n", k + 1);
	}
	
	fflush(stdout);
	return 0;
}
5
 10
 11
 17
 2
 28
 4
 56
 7
 18

1 2 1 3
1 2 1
1 2
1
 1 2 1 3 1 2 1 4 1
1 2 1 3 1 2 1 4
1 2 1 3 1 2 1
1 2 1 3 1 2
1 2 1 3 1
1 2 1 3
1 2 1
1 2
1
 1 2 1 3 1 2 1 4 1 2
1 2 1 3 1 2 1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2 1 3 1 2 1 4 1 2
1 2 1 3 1 2 1 4 1
1 2 1 3 1 2 1 4
1 2 1 3 1 2 1
1 2 1 3 1 2
1 2 1 3 1
1 2 1 3
1 2 1
1 2
1
 1 2 1 3 1 2
1 2 1 3 1
1 2 1 3
1 2 1
1 2
1
 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 5 1
1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 5
1 2 1 3 1 2 1 4 1 2 1 3 1 2 1
1 2 1 3 1 2 1 4 1 2 1 3 1 2
1 2 1 3 1 2 1 4 1 2 1 3 1
1 2 1 3 1 2 1 4 1 2 1 3
1 2 1 3 1 2 1 4 1 2 1
1 2 1 3 1 2 1 4 1 2
1 2 1 3 1 2 1 4 1
1 2 1 3 1 2 1 4
1 2 1 3 1 2 1
1 2 1 3 1 2
1 2 1 3 1
1 2 1 3
1 2 1
1 2
1

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main()
{
	int N;
	scanf("%d", &N);
	
	const int bit[10] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
	int i, j, k;
	for (i = 0; i < N - 1; i++) {
		for (j = i + 1; j < N - 1; j++) {
			for (k = 0; k < 10; k++) if ((i & bit[k]) != (j & bit[k])) break;
			printf("%d ", k + 1);
		}
		for (k = 0; k < 10; k++) if ((i & bit[k]) != ((N - 1) & bit[k])) break;
		printf("%d\n", k + 1);
	}
	
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -48(%rbp)
	movl	$2, -44(%rbp)
	movl	$4, -40(%rbp)
	movl	$8, -36(%rbp)
	movl	$16, -32(%rbp)
	movl	$32, -28(%rbp)
	movl	$64, -24(%rbp)
	movl	$128, -20(%rbp)
	movl	$256, -16(%rbp)
	movl	$512, -12(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L2
.L13:
	movl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -56(%rbp)
	jmp	.L3
.L8:
	movl	$0, -52(%rbp)
	jmp	.L4
.L7:
	movl	-60(%rbp), %eax
	xorl	-56(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	%edx, %eax
	testl	%eax, %eax
	jne	.L16
	addl	$1, -52(%rbp)
.L4:
	cmpl	$9, -52(%rbp)
	jle	.L7
	jmp	.L6
.L16:
	nop
.L6:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -56(%rbp)
.L3:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -56(%rbp)
	jl	.L8
	movl	$0, -52(%rbp)
	jmp	.L9
.L12:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	xorl	-60(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	addl	$1, -52(%rbp)
.L9:
	cmpl	$9, -52(%rbp)
	jle	.L12
	jmp	.L11
.L17:
	nop
.L11:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -60(%rbp)
.L2:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -60(%rbp)
	jl	.L13
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -48(%rbp)
	movl	$2, -44(%rbp)
	movl	$4, -40(%rbp)
	movl	$8, -36(%rbp)
	movl	$16, -32(%rbp)
	movl	$32, -28(%rbp)
	movl	$64, -24(%rbp)
	movl	$128, -20(%rbp)
	movl	$256, -16(%rbp)
	movl	$512, -12(%rbp)
	movl	$0, -60(%rbp)
	jmp	.L2
.L13:
	movl	-60(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -56(%rbp)
	jmp	.L3
.L8:
	movl	$0, -52(%rbp)
	jmp	.L4
.L7:
	movl	-60(%rbp), %eax
	xorl	-56(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	%edx, %eax
	testl	%eax, %eax
	jne	.L16
	addl	$1, -52(%rbp)
.L4:
	cmpl	$9, -52(%rbp)
	jle	.L7
	jmp	.L6
.L16:
	nop
.L6:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -56(%rbp)
.L3:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -56(%rbp)
	jl	.L8
	movl	$0, -52(%rbp)
	jmp	.L9
.L12:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	xorl	-60(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	andl	%edx, %eax
	testl	%eax, %eax
	jne	.L17
	addl	$1, -52(%rbp)
.L9:
	cmpl	$9, -52(%rbp)
	jle	.L12
	jmp	.L11
.L17:
	nop
.L11:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -60(%rbp)
.L2:
	movl	-64(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -60(%rbp)
	jl	.L13
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
