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>
#define N 100000
#define M 1010

int main(void){
  int i,num,j,k;
  int n,m;
  int p[M];
  int swp,sf;
  int ans[N];

  for(i=0;;i++){
    ans[i]=0;
    scanf("%d%d",&n,&m);
    if(n==0 && m==0)
      break;

    for(j=0;j<n;j++)
      scanf("%d",&p[j]);

    for(;;){
      sf=1;
      for(j=0;j<n-1;j++){
        if(p[j]<p[j+1]){
          sf=0;
          swp=p[j];
          p[j]=p[j+1];
          p[j+1]=swp;
        }
      }
      if(sf==1)
        break;
    }

    for(j=m-1;j<n;j+=m)
      p[j]=0;

    for(j=0;j<n;j++)
      if(p[j])
        ans[i]+=p[j];
  }

  num=i;

  for(i=0;i<num;i++)
    printf("%d\n",ans[i]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%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
	leaq	-401408(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -404084(%rbp)
.L17:
	movl	-404084(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	leaq	-404088(%rbp), %rdx
	leaq	-404092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-404092(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-404088(%rbp), %eax
	testl	%eax, %eax
	je	.L24
.L2:
	movl	$0, -404080(%rbp)
	jmp	.L4
.L5:
	leaq	-404064(%rbp), %rdx
	movl	-404080(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -404080(%rbp)
.L4:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L5
.L11:
	movl	$1, -404076(%rbp)
	movl	$0, -404080(%rbp)
	jmp	.L6
.L8:
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	$0, -404076(%rbp)
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	movl	%eax, -404068(%rbp)
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404064(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	cltq
	movl	%edx, -404064(%rbp,%rax,4)
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404068(%rbp), %edx
	movl	%edx, -404064(%rbp,%rax,4)
.L7:
	addl	$1, -404080(%rbp)
.L6:
	movl	-404092(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L8
	cmpl	$1, -404076(%rbp)
	je	.L25
	jmp	.L11
.L25:
	nop
	movl	-404088(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -404080(%rbp)
	jmp	.L12
.L13:
	movl	-404080(%rbp), %eax
	cltq
	movl	$0, -404064(%rbp,%rax,4)
	movl	-404088(%rbp), %eax
	addl	%eax, -404080(%rbp)
.L12:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L13
	movl	$0, -404080(%rbp)
	jmp	.L14
.L16:
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	movl	-404084(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-404084(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
.L15:
	addl	$1, -404080(%rbp)
.L14:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L16
	addl	$1, -404084(%rbp)
	jmp	.L17
.L24:
	nop
	movl	-404084(%rbp), %eax
	movl	%eax, -404072(%rbp)
	movl	$0, -404084(%rbp)
	jmp	.L18
.L19:
	movl	-404084(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -404084(%rbp)
.L18:
	movl	-404084(%rbp), %eax
	cmpl	-404072(%rbp), %eax
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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%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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-401408(%rsp), %r11
	.cfi_def_cfa 11, 401464
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 404192
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 404120(%rsp)
	xorl	%eax, %eax
	leaq	4112(%rsp), %rax
	movl	%r13d, 20(%rsp)
	movq	%rax, 40(%rsp)
	movq	%rax, %rbx
	leaq	60(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$0, (%rbx)
	movq	32(%rsp), %rdx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r15d
	testl	%r15d, %r15d
	jne	.L44
	movslq	60(%rsp), %r11
	testl	%r11d, %r11d
	je	.L39
.L42:
	leaq	64(%rsp), %rbp
.L5:
	leaq	68(%rsp), %r14
	leal	-2(%r15), %eax
	movq	%rbp, %r8
	leaq	(%r14,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	$1, %r15d
	jle	.L12
	movq	%rbp, %rdx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %ecx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L11
	movq	%xmm1, (%rdx)
	xorl	%esi, %esi
.L11:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L8
	cmpl	$1, %esi
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	leal	-1(%r11), %eax
	cmpl	%r15d, %eax
	jge	.L10
	cmpl	$1, %r11d
	jne	.L45
	leal	-1(%r15), %eax
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movq	%r8, 8(%rsp)
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	8(%rsp), %r8
.L10:
	testl	%r15d, %r15d
	jle	.L15
	leal	-1(%r15), %eax
	leaq	(%r14,%rax,4), %rdx
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%r8), %eax
	testl	%eax, %eax
	je	.L20
	addl	%eax, (%rbx)
.L20:
	addq	$4, %r8
	cmpq	%rdx, %r8
	jne	.L21
.L15:
	addl	$1, 20(%rsp)
	addq	$4, %rbx
	jmp	.L19
.L44:
	jle	.L46
	leaq	64(%rsp), %rbp
	xorl	%r14d, %r14d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r15d
	addq	$4, %r13
	cmpl	%r14d, %r15d
	jg	.L7
	movslq	60(%rsp), %r11
	jmp	.L5
.L45:
	cltq
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$0, 0(%rbp,%rax,4)
	addq	%r11, %rax
	cmpl	%eax, %r15d
	jg	.L17
	jmp	.L10
.L39:
	movl	20(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L23
	movq	40(%rsp), %rsi
	leal	-1(%r13), %eax
	leaq	.LC2(%rip), %rbp
	leaq	4(%rsi), %rbx
	leaq	(%rbx,%rax,4), %r12
	movq	%rsi, %rax
	jmp	.L22
.L47:
	addq	$4, %rbx
.L22:
	movl	(%rax), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rax
	cmpq	%r12, %rbx
	jne	.L47
.L23:
	movq	404120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$404136, %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
.L46:
	.cfi_restore_state
	movslq	60(%rsp), %r11
	jmp	.L42
.L48:
	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%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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	-401408(%rsp), %r11
	.cfi_def_cfa 11, 401464
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 404192
	xorl	%r13d, %r13d
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 404120(%rsp)
	xorl	%eax, %eax
	leaq	4112(%rsp), %rax
	movl	%r13d, 20(%rsp)
	movq	%rax, 40(%rsp)
	movq	%rax, %rbx
	leaq	60(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	56(%rsp), %rax
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L19:
	movl	$0, (%rbx)
	movq	32(%rsp), %rdx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r15d
	testl	%r15d, %r15d
	jne	.L44
	movslq	60(%rsp), %r11
	testl	%r11d, %r11d
	je	.L39
.L42:
	leaq	64(%rsp), %rbp
.L5:
	leaq	68(%rsp), %r14
	leal	-2(%r15), %eax
	movq	%rbp, %r8
	leaq	(%r14,%rax,4), %rdi
	.p2align 4,,10
	.p2align 3
.L13:
	cmpl	$1, %r15d
	jle	.L12
	movq	%rbp, %rdx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L8:
	movq	(%rdx), %xmm0
	pshufd	$0xe5, %xmm0, %xmm2
	movd	%xmm0, %ecx
	movd	%xmm2, %eax
	pshufd	$225, %xmm0, %xmm1
	cmpl	%eax, %ecx
	jge	.L11
	movq	%xmm1, (%rdx)
	xorl	%esi, %esi
.L11:
	addq	$4, %rdx
	cmpq	%rdi, %rdx
	jne	.L8
	cmpl	$1, %esi
	jne	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	leal	-1(%r11), %eax
	cmpl	%r15d, %eax
	jge	.L10
	cmpl	$1, %r11d
	jne	.L45
	leal	-1(%r15), %eax
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movq	%r8, 8(%rsp)
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	8(%rsp), %r8
.L10:
	testl	%r15d, %r15d
	jle	.L15
	leal	-1(%r15), %eax
	leaq	(%r14,%rax,4), %rdx
	.p2align 4,,10
	.p2align 3
.L21:
	movl	(%r8), %eax
	testl	%eax, %eax
	je	.L20
	addl	%eax, (%rbx)
.L20:
	addq	$4, %r8
	cmpq	%rdx, %r8
	jne	.L21
.L15:
	addl	$1, 20(%rsp)
	addq	$4, %rbx
	jmp	.L19
.L44:
	jle	.L46
	leaq	64(%rsp), %rbp
	xorl	%r14d, %r14d
	movq	%rbp, %r13
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	56(%rsp), %r15d
	addq	$4, %r13
	cmpl	%r14d, %r15d
	jg	.L7
	movslq	60(%rsp), %r11
	jmp	.L5
.L45:
	cltq
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$0, 0(%rbp,%rax,4)
	addq	%r11, %rax
	cmpl	%eax, %r15d
	jg	.L17
	jmp	.L10
.L39:
	movl	20(%rsp), %r13d
	testl	%r13d, %r13d
	je	.L23
	movq	40(%rsp), %rsi
	leal	-1(%r13), %eax
	leaq	.LC2(%rip), %rbp
	leaq	4(%rsi), %rbx
	leaq	(%rbx,%rax,4), %r12
	movq	%rsi, %rax
	jmp	.L22
.L47:
	addq	$4, %rbx
.L22:
	movl	(%rax), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%rbx, %rax
	cmpq	%r12, %rbx
	jne	.L47
.L23:
	movq	404120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L48
	addq	$404136, %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
.L46:
	.cfi_restore_state
	movslq	60(%rsp), %r11
	jmp	.L42
.L48:
	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>
#define N 100000
#define M 1010

int main(void){
  int i,num,j,k;
  int n,m;
  int p[M];
  int swp,sf;
  int ans[N];

  for(i=0;;i++){
    ans[i]=0;
    scanf("%d%d",&n,&m);
    if(n==0 && m==0)
      break;

    for(j=0;j<n;j++)
      scanf("%d",&p[j]);

    for(;;){
      sf=1;
      for(j=0;j<n-1;j++){
        if(p[j]<p[j+1]){
          sf=0;
          swp=p[j];
          p[j]=p[j+1];
          p[j+1]=swp;
        }
      }
      if(sf==1)
        break;
    }

    for(j=m-1;j<n;j+=m)
      p[j]=0;

    for(j=0;j<n;j++)
      if(p[j])
        ans[i]+=p[j];
  }

  num=i;

  for(i=0;i<num;i++)
    printf("%d\n",ans[i]);

  return 0;
}
4 2
50 40 100 80
7 3
400 300 100 700 200 600 57
0 0
 4 2
50 40 100 80
7 3
400 300 100 700 352 600 57
0 0
 4 3
50 40 100 80
7 3
400 300 100 700 352 600 57
0 0
 4 3
50 40 100 80
7 3
400 290 100 700 352 600 57
0 0
 4 3
50 40 100 80
7 3
400 290 000 700 352 600 57
0 0
 4 3
50 40 100 80
7 3
400 284 000 700 352 600 57
0 0
 4 3
50 40 100 80
7 4
400 284 000 700 352 600 57
0 0
 4 3
50 40 100 80
7 4
400 284 000 700 352 650 57
0 0
 4 2
50 40 100 80
7 4
400 284 000 700 352 650 57
0 0
 4 2
50 40 100 80
7 3
400 139 100 700 200 600 500
0 0

150
1857
 150
2009
 220
2009
 220
1999
 220
1942
 220
1936
 220
2041
 220
2091
 150
2091
 150
2000

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>
#define N 100000
#define M 1010

int main(void){
  int i,num,j,k;
  int n,m;
  int p[M];
  int swp,sf;
  int ans[N];

  for(i=0;;i++){
    ans[i]=0;
    scanf("%d%d",&n,&m);
    if(n==0 && m==0)
      break;

    for(j=0;j<n;j++)
      scanf("%d",&p[j]);

    for(;;){
      sf=1;
      for(j=0;j<n-1;j++){
        if(p[j]<p[j+1]){
          sf=0;
          swp=p[j];
          p[j]=p[j+1];
          p[j+1]=swp;
        }
      }
      if(sf==1)
        break;
    }

    for(j=m-1;j<n;j+=m)
      p[j]=0;

    for(j=0;j<n;j++)
      if(p[j])
        ans[i]+=p[j];
  }

  num=i;

  for(i=0;i<num;i++)
    printf("%d\n",ans[i]);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%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
	leaq	-401408(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -404084(%rbp)
.L17:
	movl	-404084(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	leaq	-404088(%rbp), %rdx
	leaq	-404092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-404092(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-404088(%rbp), %eax
	testl	%eax, %eax
	je	.L24
.L2:
	movl	$0, -404080(%rbp)
	jmp	.L4
.L5:
	leaq	-404064(%rbp), %rdx
	movl	-404080(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -404080(%rbp)
.L4:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L5
.L11:
	movl	$1, -404076(%rbp)
	movl	$0, -404080(%rbp)
	jmp	.L6
.L8:
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	$0, -404076(%rbp)
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	movl	%eax, -404068(%rbp)
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404064(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	cltq
	movl	%edx, -404064(%rbp,%rax,4)
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404068(%rbp), %edx
	movl	%edx, -404064(%rbp,%rax,4)
.L7:
	addl	$1, -404080(%rbp)
.L6:
	movl	-404092(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L8
	cmpl	$1, -404076(%rbp)
	je	.L25
	jmp	.L11
.L25:
	nop
	movl	-404088(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -404080(%rbp)
	jmp	.L12
.L13:
	movl	-404080(%rbp), %eax
	cltq
	movl	$0, -404064(%rbp,%rax,4)
	movl	-404088(%rbp), %eax
	addl	%eax, -404080(%rbp)
.L12:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L13
	movl	$0, -404080(%rbp)
	jmp	.L14
.L16:
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	movl	-404084(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-404084(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
.L15:
	addl	$1, -404080(%rbp)
.L14:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L16
	addl	$1, -404084(%rbp)
	jmp	.L17
.L24:
	nop
	movl	-404084(%rbp), %eax
	movl	%eax, -404072(%rbp)
	movl	$0, -404084(%rbp)
	jmp	.L18
.L19:
	movl	-404084(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -404084(%rbp)
.L18:
	movl	-404084(%rbp), %eax
	cmpl	-404072(%rbp), %eax
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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%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
	leaq	-401408(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2688, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -404084(%rbp)
.L17:
	movl	-404084(%rbp), %eax
	cltq
	movl	$0, -400016(%rbp,%rax,4)
	leaq	-404088(%rbp), %rdx
	leaq	-404092(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-404092(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-404088(%rbp), %eax
	testl	%eax, %eax
	je	.L24
.L2:
	movl	$0, -404080(%rbp)
	jmp	.L4
.L5:
	leaq	-404064(%rbp), %rdx
	movl	-404080(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -404080(%rbp)
.L4:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L5
.L11:
	movl	$1, -404076(%rbp)
	movl	$0, -404080(%rbp)
	jmp	.L6
.L8:
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jge	.L7
	movl	$0, -404076(%rbp)
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	movl	%eax, -404068(%rbp)
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404064(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	cltq
	movl	%edx, -404064(%rbp,%rax,4)
	movl	-404080(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-404068(%rbp), %edx
	movl	%edx, -404064(%rbp,%rax,4)
.L7:
	addl	$1, -404080(%rbp)
.L6:
	movl	-404092(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L8
	cmpl	$1, -404076(%rbp)
	je	.L25
	jmp	.L11
.L25:
	nop
	movl	-404088(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -404080(%rbp)
	jmp	.L12
.L13:
	movl	-404080(%rbp), %eax
	cltq
	movl	$0, -404064(%rbp,%rax,4)
	movl	-404088(%rbp), %eax
	addl	%eax, -404080(%rbp)
.L12:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L13
	movl	$0, -404080(%rbp)
	jmp	.L14
.L16:
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L15
	movl	-404084(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %edx
	movl	-404080(%rbp), %eax
	cltq
	movl	-404064(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movl	-404084(%rbp), %eax
	cltq
	movl	%edx, -400016(%rbp,%rax,4)
.L15:
	addl	$1, -404080(%rbp)
.L14:
	movl	-404092(%rbp), %eax
	cmpl	%eax, -404080(%rbp)
	jl	.L16
	addl	$1, -404084(%rbp)
	jmp	.L17
.L24:
	nop
	movl	-404084(%rbp), %eax
	movl	%eax, -404072(%rbp)
	movl	$0, -404084(%rbp)
	jmp	.L18
.L19:
	movl	-404084(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -404084(%rbp)
.L18:
	movl	-404084(%rbp), %eax
	cmpl	-404072(%rbp), %eax
	jl	.L19
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	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:
