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,m,max,s,i;
  int d[100001];
  while(1){
    scanf("%d %d",&n,&m);
    if(!(n||m))break;
    s=0;
    for(i=0;i<n;i++){
      scanf("%d",&d[i]);
      if(i<m)s+=d[i];
    }
    max=s;
    for(i=m;i<n;i++){
      s-=d[i-m];
      s+=d[i];
      if(max<s)max=s;
    }
    printf("%d\n",max);
  }
  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	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-400032(%rbp), %rdx
	leaq	-400036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400036(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-400032(%rbp), %eax
	testl	%eax, %eax
	je	.L14
.L2:
	movl	$0, -400024(%rbp)
	movl	$0, -400020(%rbp)
	jmp	.L4
.L6:
	leaq	-400016(%rbp), %rdx
	movl	-400020(%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
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jge	.L5
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400024(%rbp)
.L5:
	addl	$1, -400020(%rbp)
.L4:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jl	.L6
	movl	-400024(%rbp), %eax
	movl	%eax, -400028(%rbp)
	movl	-400032(%rbp), %eax
	movl	%eax, -400020(%rbp)
	jmp	.L7
.L9:
	movl	-400032(%rbp), %edx
	movl	-400020(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	subl	%eax, -400024(%rbp)
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400024(%rbp)
	movl	-400028(%rbp), %eax
	cmpl	-400024(%rbp), %eax
	jge	.L8
	movl	-400024(%rbp), %eax
	movl	%eax, -400028(%rbp)
.L8:
	addl	$1, -400020(%rbp)
.L7:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jl	.L9
	movl	-400028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %r13
	leaq	16(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	.LC0(%rip), %rdi
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jne	.L20
	movslq	12(%rsp), %rsi
	testl	%esi, %esi
	je	.L5
.L18:
	xorl	%r15d, %r15d
	cmpl	%esi, %edi
	jle	.L13
.L22:
	subl	$1, %edi
	movq	%rbx, %rax
	movl	%r15d, %r8d
	subl	%esi, %edi
	leaq	20(%rsp,%rdi,4), %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r15d, %edx
	subl	(%rax), %edx
	addl	(%rax,%rsi,4), %edx
	cmpl	%edx, %r8d
	movl	%edx, %r15d
	cmovl	%edx, %r8d
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	.L9
.L8:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	jle	.L21
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%rbx,%r12,4), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	cmpl	%r12d, %esi
	jle	.L7
	addl	(%rbx,%r12,4), %r15d
.L7:
	movl	8(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L3
	cmpl	%esi, %edi
	jg	.L22
.L13:
	movl	%r15d, %r8d
	jmp	.L8
.L5:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$400040, %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
.L21:
	.cfi_restore_state
	movslq	12(%rsp), %rsi
	jmp	.L18
.L23:
	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	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	leaq	.LC1(%rip), %rbp
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %r13
	leaq	16(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	.LC0(%rip), %rdi
	movq	%r14, %rdx
	movq	%r13, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edi
	testl	%edi, %edi
	jne	.L20
	movslq	12(%rsp), %rsi
	testl	%esi, %esi
	je	.L5
.L18:
	xorl	%r15d, %r15d
	cmpl	%esi, %edi
	jle	.L13
.L22:
	subl	$1, %edi
	movq	%rbx, %rax
	movl	%r15d, %r8d
	subl	%esi, %edi
	leaq	20(%rsp,%rdi,4), %rcx
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r15d, %edx
	subl	(%rax), %edx
	addl	(%rax,%rsi,4), %edx
	cmpl	%edx, %r8d
	movl	%edx, %r15d
	cmovl	%edx, %r8d
	addq	$4, %rax
	cmpq	%rax, %rcx
	jne	.L9
.L8:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	jle	.L21
	xorl	%r12d, %r12d
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%rbx,%r12,4), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rsi
	cmpl	%r12d, %esi
	jle	.L7
	addl	(%rbx,%r12,4), %r15d
.L7:
	movl	8(%rsp), %edi
	addq	$1, %r12
	cmpl	%r12d, %edi
	jg	.L3
	cmpl	%esi, %edi
	jg	.L22
.L13:
	movl	%r15d, %r8d
	jmp	.L8
.L5:
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$400040, %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
.L21:
	.cfi_restore_state
	movslq	12(%rsp), %rsi
	jmp	.L18
.L23:
	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,m,max,s,i;
  int d[100001];
  while(1){
    scanf("%d %d",&n,&m);
    if(!(n||m))break;
    s=0;
    for(i=0;i<n;i++){
      scanf("%d",&d[i]);
      if(i<m)s+=d[i];
    }
    max=s;
    for(i=m;i<n;i++){
      s-=d[i-m];
      s+=d[i];
      if(max<s)max=s;
    }
    printf("%d\n",max);
  }
  return 0;
}
5 3
2
5
-4
8
3
0 0
 5 3
2
5
-4
12
3
0 0
 5 3
2
5
-4
14
3
0 0
 5 3
2
9
-4
14
1
0 0
 5 3
1
9
-4
2
1
0 0
 5 3
2
8
-4
12
3
0 0
 5 1
2
9
-4
14
1
0 0
 5 3
1
9
-4
13
1
0 0
 5 3
1
2
-4
13
1
0 0
 5 3
2
5
-4
5
3
0 0

9
 13
 15
 19
 7
 16
 14
 18
 11
 6

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,m,max,s,i;
  int d[100001];
  while(1){
    scanf("%d %d",&n,&m);
    if(!(n||m))break;
    s=0;
    for(i=0;i<n;i++){
      scanf("%d",&d[i]);
      if(i<m)s+=d[i];
    }
    max=s;
    for(i=m;i<n;i++){
      s-=d[i-m];
      s+=d[i];
      if(max<s)max=s;
    }
    printf("%d\n",max);
  }
  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	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-400032(%rbp), %rdx
	leaq	-400036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400036(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-400032(%rbp), %eax
	testl	%eax, %eax
	je	.L14
.L2:
	movl	$0, -400024(%rbp)
	movl	$0, -400020(%rbp)
	jmp	.L4
.L6:
	leaq	-400016(%rbp), %rdx
	movl	-400020(%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
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jge	.L5
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400024(%rbp)
.L5:
	addl	$1, -400020(%rbp)
.L4:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jl	.L6
	movl	-400024(%rbp), %eax
	movl	%eax, -400028(%rbp)
	movl	-400032(%rbp), %eax
	movl	%eax, -400020(%rbp)
	jmp	.L7
.L9:
	movl	-400032(%rbp), %edx
	movl	-400020(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	subl	%eax, -400024(%rbp)
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400024(%rbp)
	movl	-400028(%rbp), %eax
	cmpl	-400024(%rbp), %eax
	jge	.L8
	movl	-400024(%rbp), %eax
	movl	%eax, -400028(%rbp)
.L8:
	addl	$1, -400020(%rbp)
.L7:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jl	.L9
	movl	-400028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2736, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L10:
	leaq	-400032(%rbp), %rdx
	leaq	-400036(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-400036(%rbp), %eax
	testl	%eax, %eax
	jne	.L2
	movl	-400032(%rbp), %eax
	testl	%eax, %eax
	je	.L14
.L2:
	movl	$0, -400024(%rbp)
	movl	$0, -400020(%rbp)
	jmp	.L4
.L6:
	leaq	-400016(%rbp), %rdx
	movl	-400020(%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
	movl	-400032(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jge	.L5
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400024(%rbp)
.L5:
	addl	$1, -400020(%rbp)
.L4:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jl	.L6
	movl	-400024(%rbp), %eax
	movl	%eax, -400028(%rbp)
	movl	-400032(%rbp), %eax
	movl	%eax, -400020(%rbp)
	jmp	.L7
.L9:
	movl	-400032(%rbp), %edx
	movl	-400020(%rbp), %eax
	subl	%edx, %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	subl	%eax, -400024(%rbp)
	movl	-400020(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	addl	%eax, -400024(%rbp)
	movl	-400028(%rbp), %eax
	cmpl	-400024(%rbp), %eax
	jge	.L8
	movl	-400024(%rbp), %eax
	movl	%eax, -400028(%rbp)
.L8:
	addl	$1, -400020(%rbp)
.L7:
	movl	-400036(%rbp), %eax
	cmpl	%eax, -400020(%rbp)
	jl	.L9
	movl	-400028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L10
.L14:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	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:
