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,a[60],b[60],c[60],i,r=0,d[20],l;
  scanf("%d",&n);
  for(i=n;i;i/=2)r++;
  l=r;//printf("%d\n",r);
  for(i=n;i;i/=2)d[--r]=i%2;
  //for(i=0;i<l;i++)printf("%d",d[i]);printf("\n");
  r=0;
  for(i=1;i<l;i++){
    a[r  ]=a[r+1]=i+0;
    b[r  ]=b[r+1]=i+1;
    c[r++]=1<<(l-i-1);
    c[r++]=0;
  }
  n=1<<(l-1);
  for(i=1;i<l;i++){
    if(d[i]){
      a[r  ]=1;
      b[r  ]=i+1;
      c[r++]=n;
      n+=1<<(l-i-1);
    }
  }
  printf("%d %d\n",l,r);
  for(i=0;i<r;i++)printf("%d %d %d\n",a[i],b[i],c[i]);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d %d %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	$832, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -824(%rbp)
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	movl	%eax, -828(%rbp)
	jmp	.L2
.L3:
	addl	$1, -824(%rbp)
	movl	-828(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -828(%rbp)
.L2:
	cmpl	$0, -828(%rbp)
	jne	.L3
	movl	-824(%rbp), %eax
	movl	%eax, -820(%rbp)
	movl	-832(%rbp), %eax
	movl	%eax, -828(%rbp)
	jmp	.L4
.L5:
	subl	$1, -824(%rbp)
	movl	-828(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-828(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -828(%rbp)
.L4:
	cmpl	$0, -828(%rbp)
	jne	.L5
	movl	$0, -824(%rbp)
	movl	$1, -828(%rbp)
	jmp	.L6
.L7:
	movl	-824(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-828(%rbp), %ecx
	movl	%ecx, -736(%rbp,%rdx,4)
	cltq
	movl	-736(%rbp,%rax,4), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -736(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	addl	$1, %eax
	movl	-828(%rbp), %edx
	leal	1(%rdx), %ecx
	movslq	%eax, %rdx
	movl	%ecx, -496(%rbp,%rdx,4)
	cltq
	movl	-496(%rbp,%rax,4), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -496(%rbp,%rax,4)
	movl	-820(%rbp), %eax
	subl	-828(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	movl	$1, %edx
	sall	%cl, %edx
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	cltq
	movl	$0, -256(%rbp,%rax,4)
	addl	$1, -828(%rbp)
.L6:
	movl	-828(%rbp), %eax
	cmpl	-820(%rbp), %eax
	jl	.L7
	movl	-820(%rbp), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -832(%rbp)
	movl	$1, -828(%rbp)
	jmp	.L8
.L10:
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L9
	movl	-824(%rbp), %eax
	cltq
	movl	$1, -736(%rbp,%rax,4)
	movl	-828(%rbp), %eax
	leal	1(%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -496(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	movl	-832(%rbp), %edx
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-820(%rbp), %eax
	subl	-828(%rbp), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	-832(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -832(%rbp)
.L9:
	addl	$1, -828(%rbp)
.L8:
	movl	-828(%rbp), %eax
	cmpl	-820(%rbp), %eax
	jl	.L10
	movl	-824(%rbp), %edx
	movl	-820(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -828(%rbp)
	jmp	.L11
.L12:
	movl	-828(%rbp), %eax
	cltq
	movl	-256(%rbp,%rax,4), %ecx
	movl	-828(%rbp), %eax
	cltq
	movl	-496(%rbp,%rax,4), %edx
	movl	-828(%rbp), %eax
	cltq
	movl	-736(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -828(%rbp)
.L11:
	movl	-828(%rbp), %eax
	cmpl	-824(%rbp), %eax
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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 %d %d\n"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$840, %rsp
	.cfi_def_cfa_offset 896
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	%edx, %eax
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%eax, %ecx
	movl	%r8d, %esi
	addl	$1, %r8d
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	jne	.L3
	leaq	16(%rsp), %rdi
	movslq	%r8d, %rax
	leaq	(%rdi,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r9d
	subq	$4, %rcx
	shrl	$31, %r9d
	leal	(%rdx,%r9), %eax
	addl	%r9d, %edx
	andl	$1, %eax
	subl	%r9d, %eax
	movl	%eax, (%rcx)
	sarl	%edx
	jne	.L4
	cmpl	$1, %r8d
	je	.L13
	movl	$1, %edx
	xorl	%eax, %eax
	leaq	96(%rsp), %r13
	movl	$1, %r10d
	movd	%edx, %xmm2
	leaq	336(%rsp), %r12
	leaq	576(%rsp), %rbp
	pshufd	$0xe0, %xmm2, %xmm0
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r9d
	movl	%esi, %ecx
	addl	$1, %edx
	movl	%r10d, %ebx
	movd	%edx, %xmm1
	subl	%r9d, %ecx
	movq	%xmm0, 0(%r13,%rax,8)
	sall	%cl, %ebx
	pshufd	$0xe0, %xmm1, %xmm0
	movl	$0, 4(%rbp,%rax,8)
	movl	%ebx, 0(%rbp,%rax,8)
	movq	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L5
	testl	%esi, %esi
	movl	$2, %eax
	movl	%r10d, %edx
	movl	%esi, %ecx
	leal	(%rsi,%rsi), %ebx
	leal	-1(%rsi), %r11d
	movl	$1, %r10d
	cmovle	%eax, %ebx
	sall	%cl, %edx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movl	%edx, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rdi,%rax,4), %r14d
	leal	2(%rax), %r9d
	testl	%r14d, %r14d
	je	.L7
	movslq	%ebx, %rcx
	movl	%r10d, %r14d
	addl	$1, %ebx
	movl	%edx, 576(%rsp,%rcx,4)
	movl	$1, 96(%rsp,%rcx,4)
	movl	%r9d, 336(%rsp,%rcx,4)
	movl	%r11d, %ecx
	subl	%eax, %ecx
	sall	%cl, %r14d
	movl	$1, %ecx
	addl	%r14d, %edx
.L7:
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L8
	testb	%cl, %cl
	je	.L9
	movl	%edx, 12(%rsp)
.L9:
	movl	%ebx, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	movslq	%ebx, %r14
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r12,%rbx,4), %ecx
	movl	0(%r13,%rbx,4), %edx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movl	0(%rbp,%rbx,4), %r8d
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L10
.L11:
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$840, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %edx
.L2:
	xorl	%ecx, %ecx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1, 12(%rsp)
	call	__printf_chk@PLT
	jmp	.L11
.L29:
	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 %d %d\n"
.LC2:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$840, %rsp
	.cfi_def_cfa_offset 896
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	je	.L2
	movl	%edx, %eax
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%eax, %ecx
	movl	%r8d, %esi
	addl	$1, %r8d
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	jne	.L3
	leaq	16(%rsp), %rdi
	movslq	%r8d, %rax
	leaq	(%rdi,%rax,4), %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	%edx, %r9d
	subq	$4, %rcx
	shrl	$31, %r9d
	leal	(%rdx,%r9), %eax
	addl	%r9d, %edx
	andl	$1, %eax
	subl	%r9d, %eax
	movl	%eax, (%rcx)
	sarl	%edx
	jne	.L4
	cmpl	$1, %r8d
	je	.L13
	movl	$1, %edx
	xorl	%eax, %eax
	leaq	96(%rsp), %r13
	movl	$1, %r10d
	movd	%edx, %xmm2
	leaq	336(%rsp), %r12
	leaq	576(%rsp), %rbp
	pshufd	$0xe0, %xmm2, %xmm0
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r9d
	movl	%esi, %ecx
	addl	$1, %edx
	movl	%r10d, %ebx
	movd	%edx, %xmm1
	subl	%r9d, %ecx
	movq	%xmm0, 0(%r13,%rax,8)
	sall	%cl, %ebx
	pshufd	$0xe0, %xmm1, %xmm0
	movl	$0, 4(%rbp,%rax,8)
	movl	%ebx, 0(%rbp,%rax,8)
	movq	%xmm0, (%r12,%rax,8)
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L5
	testl	%esi, %esi
	movl	$2, %eax
	movl	%r10d, %edx
	movl	%esi, %ecx
	leal	(%rsi,%rsi), %ebx
	leal	-1(%rsi), %r11d
	movl	$1, %r10d
	cmovle	%eax, %ebx
	sall	%cl, %edx
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	movl	%edx, 12(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movl	4(%rdi,%rax,4), %r14d
	leal	2(%rax), %r9d
	testl	%r14d, %r14d
	je	.L7
	movslq	%ebx, %rcx
	movl	%r10d, %r14d
	addl	$1, %ebx
	movl	%edx, 576(%rsp,%rcx,4)
	movl	$1, 96(%rsp,%rcx,4)
	movl	%r9d, 336(%rsp,%rcx,4)
	movl	%r11d, %ecx
	subl	%eax, %ecx
	sall	%cl, %r14d
	movl	$1, %ecx
	addl	%r14d, %edx
.L7:
	addq	$1, %rax
	cmpl	%eax, %esi
	jg	.L8
	testb	%cl, %cl
	je	.L9
	movl	%edx, 12(%rsp)
.L9:
	movl	%ebx, %ecx
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	movslq	%ebx, %r14
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	call	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%r12,%rbx,4), %ecx
	movl	0(%r13,%rbx,4), %edx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movl	0(%rbp,%rbx,4), %r8d
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r14
	jne	.L10
.L11:
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$840, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	movl	$1, %edx
.L2:
	xorl	%ecx, %ecx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1, 12(%rsp)
	call	__printf_chk@PLT
	jmp	.L11
.L29:
	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,a[60],b[60],c[60],i,r=0,d[20],l;
  scanf("%d",&n);
  for(i=n;i;i/=2)r++;
  l=r;//printf("%d\n",r);
  for(i=n;i;i/=2)d[--r]=i%2;
  //for(i=0;i<l;i++)printf("%d",d[i]);printf("\n");
  r=0;
  for(i=1;i<l;i++){
    a[r  ]=a[r+1]=i+0;
    b[r  ]=b[r+1]=i+1;
    c[r++]=1<<(l-i-1);
    c[r++]=0;
  }
  n=1<<(l-1);
  for(i=1;i<l;i++){
    if(d[i]){
      a[r  ]=1;
      b[r  ]=i+1;
      c[r++]=n;
      n+=1<<(l-i-1);
    }
  }
  printf("%d %d\n",l,r);
  for(i=0;i<r;i++)printf("%d %d %d\n",a[i],b[i],c[i]);
  return 0;
}

4

3 4
1 2 2
1 2 0
2 3 1
2 3 0

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,a[60],b[60],c[60],i,r=0,d[20],l;
  scanf("%d",&n);
  for(i=n;i;i/=2)r++;
  l=r;//printf("%d\n",r);
  for(i=n;i;i/=2)d[--r]=i%2;
  //for(i=0;i<l;i++)printf("%d",d[i]);printf("\n");
  r=0;
  for(i=1;i<l;i++){
    a[r  ]=a[r+1]=i+0;
    b[r  ]=b[r+1]=i+1;
    c[r++]=1<<(l-i-1);
    c[r++]=0;
  }
  n=1<<(l-1);
  for(i=1;i<l;i++){
    if(d[i]){
      a[r  ]=1;
      b[r  ]=i+1;
      c[r++]=n;
      n+=1<<(l-i-1);
    }
  }
  printf("%d %d\n",l,r);
  for(i=0;i<r;i++)printf("%d %d %d\n",a[i],b[i],c[i]);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
.LC2:
	.string	"%d %d %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	$832, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -824(%rbp)
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	movl	%eax, -828(%rbp)
	jmp	.L2
.L3:
	addl	$1, -824(%rbp)
	movl	-828(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -828(%rbp)
.L2:
	cmpl	$0, -828(%rbp)
	jne	.L3
	movl	-824(%rbp), %eax
	movl	%eax, -820(%rbp)
	movl	-832(%rbp), %eax
	movl	%eax, -828(%rbp)
	jmp	.L4
.L5:
	subl	$1, -824(%rbp)
	movl	-828(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-828(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -828(%rbp)
.L4:
	cmpl	$0, -828(%rbp)
	jne	.L5
	movl	$0, -824(%rbp)
	movl	$1, -828(%rbp)
	jmp	.L6
.L7:
	movl	-824(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-828(%rbp), %ecx
	movl	%ecx, -736(%rbp,%rdx,4)
	cltq
	movl	-736(%rbp,%rax,4), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -736(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	addl	$1, %eax
	movl	-828(%rbp), %edx
	leal	1(%rdx), %ecx
	movslq	%eax, %rdx
	movl	%ecx, -496(%rbp,%rdx,4)
	cltq
	movl	-496(%rbp,%rax,4), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -496(%rbp,%rax,4)
	movl	-820(%rbp), %eax
	subl	-828(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	movl	$1, %edx
	sall	%cl, %edx
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	cltq
	movl	$0, -256(%rbp,%rax,4)
	addl	$1, -828(%rbp)
.L6:
	movl	-828(%rbp), %eax
	cmpl	-820(%rbp), %eax
	jl	.L7
	movl	-820(%rbp), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -832(%rbp)
	movl	$1, -828(%rbp)
	jmp	.L8
.L10:
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L9
	movl	-824(%rbp), %eax
	cltq
	movl	$1, -736(%rbp,%rax,4)
	movl	-828(%rbp), %eax
	leal	1(%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -496(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	movl	-832(%rbp), %edx
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-820(%rbp), %eax
	subl	-828(%rbp), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	-832(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -832(%rbp)
.L9:
	addl	$1, -828(%rbp)
.L8:
	movl	-828(%rbp), %eax
	cmpl	-820(%rbp), %eax
	jl	.L10
	movl	-824(%rbp), %edx
	movl	-820(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -828(%rbp)
	jmp	.L11
.L12:
	movl	-828(%rbp), %eax
	cltq
	movl	-256(%rbp,%rax,4), %ecx
	movl	-828(%rbp), %eax
	cltq
	movl	-496(%rbp,%rax,4), %edx
	movl	-828(%rbp), %eax
	cltq
	movl	-736(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -828(%rbp)
.L11:
	movl	-828(%rbp), %eax
	cmpl	-824(%rbp), %eax
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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 %d\n"
.LC2:
	.string	"%d %d %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	$832, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -824(%rbp)
	leaq	-832(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-832(%rbp), %eax
	movl	%eax, -828(%rbp)
	jmp	.L2
.L3:
	addl	$1, -824(%rbp)
	movl	-828(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -828(%rbp)
.L2:
	cmpl	$0, -828(%rbp)
	jne	.L3
	movl	-824(%rbp), %eax
	movl	%eax, -820(%rbp)
	movl	-832(%rbp), %eax
	movl	%eax, -828(%rbp)
	jmp	.L4
.L5:
	subl	$1, -824(%rbp)
	movl	-828(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-828(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -828(%rbp)
.L4:
	cmpl	$0, -828(%rbp)
	jne	.L5
	movl	$0, -824(%rbp)
	movl	$1, -828(%rbp)
	jmp	.L6
.L7:
	movl	-824(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rdx
	movl	-828(%rbp), %ecx
	movl	%ecx, -736(%rbp,%rdx,4)
	cltq
	movl	-736(%rbp,%rax,4), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -736(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	addl	$1, %eax
	movl	-828(%rbp), %edx
	leal	1(%rdx), %ecx
	movslq	%eax, %rdx
	movl	%ecx, -496(%rbp,%rdx,4)
	cltq
	movl	-496(%rbp,%rax,4), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -496(%rbp,%rax,4)
	movl	-820(%rbp), %eax
	subl	-828(%rbp), %eax
	leal	-1(%rax), %ecx
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	movl	$1, %edx
	sall	%cl, %edx
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	cltq
	movl	$0, -256(%rbp,%rax,4)
	addl	$1, -828(%rbp)
.L6:
	movl	-828(%rbp), %eax
	cmpl	-820(%rbp), %eax
	jl	.L7
	movl	-820(%rbp), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	movl	%eax, -832(%rbp)
	movl	$1, -828(%rbp)
	jmp	.L8
.L10:
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L9
	movl	-824(%rbp), %eax
	cltq
	movl	$1, -736(%rbp,%rax,4)
	movl	-828(%rbp), %eax
	leal	1(%rax), %edx
	movl	-824(%rbp), %eax
	cltq
	movl	%edx, -496(%rbp,%rax,4)
	movl	-824(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -824(%rbp)
	movl	-832(%rbp), %edx
	cltq
	movl	%edx, -256(%rbp,%rax,4)
	movl	-820(%rbp), %eax
	subl	-828(%rbp), %eax
	subl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	-832(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -832(%rbp)
.L9:
	addl	$1, -828(%rbp)
.L8:
	movl	-828(%rbp), %eax
	cmpl	-820(%rbp), %eax
	jl	.L10
	movl	-824(%rbp), %edx
	movl	-820(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -828(%rbp)
	jmp	.L11
.L12:
	movl	-828(%rbp), %eax
	cltq
	movl	-256(%rbp,%rax,4), %ecx
	movl	-828(%rbp), %eax
	cltq
	movl	-496(%rbp,%rax,4), %edx
	movl	-828(%rbp), %eax
	cltq
	movl	-736(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -828(%rbp)
.L11:
	movl	-828(%rbp), %eax
	cmpl	-824(%rbp), %eax
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	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:
