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

```c
#include <stdio.h>

#define MAX 500

int main(void){
  int i,j,x,y,num;

  int n;
  scanf("%d",&n);

  int arr[MAX][MAX]={};
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      x=i; y=j; num=1;
      while(1){
        if(x%2!=y%2){
          arr[i][j]=num;
          break;
        }else{
          x/=2; y/=2;
          num++;
        }
      }
    }
  }

  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      printf("%d ",arr[i][j]);
    }
    printf("\n");
  }

  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999472
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$608, %rsp
	.cfi_def_cfa_offset 1000080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	$1000000, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movl	12(%rsp), %r10d
	cmpl	$1, %r10d
	jle	.L11
	leal	-2(%r10), %r14d
	movq	%rbx, %r11
	movl	$1, %r13d
	addq	$2, %r14
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%r13), %r12d
	movq	%r13, %r9
	movl	%r12d, %ebp
	andl	$1, %ebp
	cmpl	%r13d, %r10d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	movl	%r9d, %ecx
	shrl	$31, %edx
	leal	(%rdx,%r9), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebp
	jne	.L14
	movl	%r12d, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %eax
	sarl	%esi
	addl	$1, %edi
	shrl	$31, %eax
	movl	%esi, %r8d
	addl	%ecx, %eax
	andl	$1, %r8d
	movl	%eax, %ecx
	shrl	$31, %eax
	sarl	%ecx
	leal	(%rcx,%rax), %edx
	andl	$1, %edx
	subl	%eax, %edx
	cmpl	%edx, %r8d
	je	.L7
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
.L4:
	addq	$1, %r13
	addq	$2000, %r11
	cmpq	%r14, %r13
	jne	.L8
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rbp
	cmpl	%r13d, %r10d
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L9
.L12:
	movl	$10, %edi
	addq	$1, %r13
	addq	$2000, %rbx
	call	putchar@PLT
	movl	12(%rsp), %r10d
	leal	-1(%r13), %eax
	leal	-1(%r10), %edx
	cmpl	%eax, %edx
	jg	.L10
.L11:
	movq	1000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1000032, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edi
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
	jmp	.L4
.L25:
	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999472
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$608, %rsp
	.cfi_def_cfa_offset 1000080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	$1000000, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movl	12(%rsp), %r10d
	cmpl	$1, %r10d
	jle	.L11
	leal	-2(%r10), %r14d
	movq	%rbx, %r11
	movl	$1, %r13d
	addq	$2, %r14
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%r13), %r12d
	movq	%r13, %r9
	movl	%r12d, %ebp
	andl	$1, %ebp
	cmpl	%r13d, %r10d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	movl	%r9d, %ecx
	shrl	$31, %edx
	leal	(%rdx,%r9), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebp
	jne	.L14
	movl	%r12d, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %eax
	sarl	%esi
	addl	$1, %edi
	shrl	$31, %eax
	movl	%esi, %r8d
	addl	%ecx, %eax
	andl	$1, %r8d
	movl	%eax, %ecx
	shrl	$31, %eax
	sarl	%ecx
	leal	(%rcx,%rax), %edx
	andl	$1, %edx
	subl	%eax, %edx
	cmpl	%edx, %r8d
	je	.L7
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
.L4:
	addq	$1, %r13
	addq	$2000, %r11
	cmpq	%r14, %r13
	jne	.L8
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rbp
	cmpl	%r13d, %r10d
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L9
.L12:
	movl	$10, %edi
	addq	$1, %r13
	addq	$2000, %rbx
	call	putchar@PLT
	movl	12(%rsp), %r10d
	leal	-1(%r13), %eax
	leal	-1(%r10), %edx
	cmpl	%eax, %edx
	jg	.L10
.L11:
	movq	1000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1000032, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edi
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
	jmp	.L4
.L25:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999472
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$608, %rsp
	.cfi_def_cfa_offset 1000080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	$1000000, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movl	12(%rsp), %r10d
	cmpl	$1, %r10d
	jle	.L11
	leal	-2(%r10), %r14d
	movq	%rbx, %r11
	movl	$1, %r13d
	addq	$2, %r14
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%r13), %r12d
	movq	%r13, %r9
	movl	%r12d, %ebp
	andl	$1, %ebp
	cmpl	%r13d, %r10d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	movl	%r9d, %ecx
	shrl	$31, %edx
	leal	(%rdx,%r9), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebp
	jne	.L14
	movl	%r12d, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %eax
	sarl	%esi
	addl	$1, %edi
	shrl	$31, %eax
	movl	%esi, %r8d
	addl	%ecx, %eax
	andl	$1, %r8d
	movl	%eax, %ecx
	shrl	$31, %eax
	sarl	%ecx
	leal	(%rcx,%rax), %edx
	andl	$1, %edx
	subl	%eax, %edx
	cmpl	%edx, %r8d
	je	.L7
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
.L4:
	addq	$1, %r13
	addq	$2000, %r11
	cmpq	%r14, %r13
	jne	.L8
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rbp
	cmpl	%r13d, %r10d
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L9
.L12:
	movl	$10, %edi
	addq	$1, %r13
	addq	$2000, %rbx
	call	putchar@PLT
	movl	12(%rsp), %r10d
	leal	-1(%r13), %eax
	leal	-1(%r10), %edx
	cmpl	%eax, %edx
	jg	.L10
.L11:
	movq	1000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1000032, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edi
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
	jmp	.L4
.L25:
	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:
```
```c
#include <stdio.h>

#define MAX 500

int main(void){
  int i,j,x,y,num;

  int n;
  scanf("%d",&n);

  int arr[MAX][MAX]={};
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      x=i; y=j; num=1;
      while(1){
        if(x%2!=y%2){
          arr[i][j]=num;
          break;
        }else{
          x/=2; y/=2;
          num++;
        }
      }
    }
  }

  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      printf("%d ",arr[i][j]);
    }
    printf("\n");
  }

  return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

#define MAX 500

int main(void){
  int i,j,x,y,num;

  int n;
  scanf("%d",&n);

  int arr[MAX][MAX]={};
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      x=i; y=j; num=1;
      while(1){
        if(x%2!=y%2){
          arr[i][j]=num;
          break;
        }else{
          x/=2; y/=2;
          num++;
        }
      }
    }
  }

  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      printf("%d ",arr[i][j]);
    }
    printf("\n");
  }

  return 0;
}
```

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.
Optimized Assembly Code:

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 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 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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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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

#define MAX 500

int main(void){
  int i,j,x,y,num;

  int n;
  scanf("%d",&n);

  int arr[MAX][MAX]={};
  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      x=i; y=j; num=1;
      while(1){
        if(x%2!=y%2){
          arr[i][j]=num;
          break;
        }else{
          x/=2; y/=2;
          num++;
        }
      }
    }
  }

  for(i=0;i<n-1;i++){
    for(j=i+1;j<n;j++){
      printf("%d ",arr[i][j]);
    }
    printf("\n");
  }

  return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999472
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$608, %rsp
	.cfi_def_cfa_offset 1000080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	$1000000, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movl	12(%rsp), %r10d
	cmpl	$1, %r10d
	jle	.L11
	leal	-2(%r10), %r14d
	movq	%rbx, %r11
	movl	$1, %r13d
	addq	$2, %r14
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%r13), %r12d
	movq	%r13, %r9
	movl	%r12d, %ebp
	andl	$1, %ebp
	cmpl	%r13d, %r10d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	movl	%r9d, %ecx
	shrl	$31, %edx
	leal	(%rdx,%r9), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebp
	jne	.L14
	movl	%r12d, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %eax
	sarl	%esi
	addl	$1, %edi
	shrl	$31, %eax
	movl	%esi, %r8d
	addl	%ecx, %eax
	andl	$1, %r8d
	movl	%eax, %ecx
	shrl	$31, %eax
	sarl	%ecx
	leal	(%rcx,%rax), %edx
	andl	$1, %edx
	subl	%eax, %edx
	cmpl	%edx, %r8d
	je	.L7
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
.L4:
	addq	$1, %r13
	addq	$2000, %r11
	cmpq	%r14, %r13
	jne	.L8
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rbp
	cmpl	%r13d, %r10d
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L9
.L12:
	movl	$10, %edi
	addq	$1, %r13
	addq	$2000, %rbx
	call	putchar@PLT
	movl	12(%rsp), %r10d
	leal	-1(%r13), %eax
	leal	-1(%r10), %edx
	cmpl	%eax, %edx
	jg	.L10
.L11:
	movq	1000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1000032, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edi
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
	jmp	.L4
.L25:
	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d "
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-999424(%rsp), %r11
	.cfi_def_cfa 11, 999472
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$608, %rsp
	.cfi_def_cfa_offset 1000080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 1000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movl	$1000000, %edx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	movl	12(%rsp), %r10d
	cmpl	$1, %r10d
	jle	.L11
	leal	-2(%r10), %r14d
	movq	%rbx, %r11
	movl	$1, %r13d
	addq	$2, %r14
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-1(%r13), %r12d
	movq	%r13, %r9
	movl	%r12d, %ebp
	andl	$1, %ebp
	cmpl	%r13d, %r10d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%r9d, %edx
	movl	%r9d, %ecx
	shrl	$31, %edx
	leal	(%rdx,%r9), %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	%eax, %ebp
	jne	.L14
	movl	%r12d, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %eax
	sarl	%esi
	addl	$1, %edi
	shrl	$31, %eax
	movl	%esi, %r8d
	addl	%ecx, %eax
	andl	$1, %r8d
	movl	%eax, %ecx
	shrl	$31, %eax
	sarl	%ecx
	leal	(%rcx,%rax), %edx
	andl	$1, %edx
	subl	%eax, %edx
	cmpl	%edx, %r8d
	je	.L7
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
.L4:
	addq	$1, %r13
	addq	$2000, %r11
	cmpq	%r14, %r13
	jne	.L8
	movl	$1, %r13d
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r13, %rbp
	cmpl	%r13d, %r10d
	jle	.L12
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rbx,%rbp,4), %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	cmpl	%ebp, 12(%rsp)
	jg	.L9
.L12:
	movl	$10, %edi
	addq	$1, %r13
	addq	$2000, %rbx
	call	putchar@PLT
	movl	12(%rsp), %r10d
	leal	-1(%r13), %eax
	leal	-1(%r10), %edx
	cmpl	%eax, %edx
	jg	.L10
.L11:
	movq	1000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$1000032, %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
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	movl	$1, %edi
	movl	%edi, (%r11,%r9,4)
	addq	$1, %r9
	cmpl	%r9d, %r10d
	jg	.L5
	jmp	.L4
.L25:
	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:
```