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(void){

  long n;
  scanf("%ld", &n);
  long k;
  scanf("%ld", &k);
  double p[n];
  for (long i = 0; i < n; i++) {
    scanf("%lf", &p[i]);
  }

  double ex = 0;
  for (long i = 0; i < k; i++) {
    ex += p[i]+1;
  }
  double max = ex;
  for (long i = k; i < n; i++) {
    ex += p[i];
    ex -= p[i-k];
    if (ex > max) {
      max = ex;
    }
  }

  printf("%lf\n", max/2);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%lf"
.LC5:
	.string	"%lf\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-128(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L5
.L6:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -112(%rbp)
.L5:
	movq	-128(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jl	.L6
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -104(%rbp)
	movq	$0, -96(%rbp)
	jmp	.L7
.L8:
	movq	-64(%rbp), %rax
	movq	-96(%rbp), %rdx
	movsd	(%rax,%rdx,8), %xmm1
	movsd	.LC3(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	-104(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	addq	$1, -96(%rbp)
.L7:
	movq	-120(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movsd	-104(%rbp), %xmm0
	movsd	%xmm0, -88(%rbp)
	movq	-120(%rbp), %rax
	movq	%rax, -80(%rbp)
	jmp	.L9
.L12:
	movq	-64(%rbp), %rax
	movq	-80(%rbp), %rdx
	movsd	(%rax,%rdx,8), %xmm0
	movsd	-104(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	movq	-120(%rbp), %rcx
	movq	-80(%rbp), %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	movsd	(%rax,%rdx,8), %xmm1
	movsd	-104(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	movsd	-104(%rbp), %xmm0
	comisd	-88(%rbp), %xmm0
	jbe	.L10
	movsd	-104(%rbp), %xmm0
	movsd	%xmm0, -88(%rbp)
.L10:
	addq	$1, -80(%rbp)
.L9:
	movq	-128(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L12
	movsd	-88(%rbp), %xmm0
	movsd	.LC4(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.align 8
.LC4:
	.long	0
	.long	1073741824
	.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
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lf"
.LC6:
	.string	"%lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-56(%rbp), %rsi
	pushq	%r12
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbx
	movq	%r12, %rdi
	subq	$32, %rsp
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rdx
	movq	%rsp, %rsi
	leaq	15(,%rdx,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %r13
	testq	%rdx, %rdx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rdx
	addq	$8, %r12
	cmpq	%rbx, %rdx
	jg	.L6
.L5:
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	jle	.L16
	cmpq	$1, %rax
	je	.L17
	movq	%rax, %rdi
	movapd	.LC3(%rip), %xmm3
	xorl	%ecx, %ecx
	pxor	%xmm1, %xmm1
	shrq	%rdi
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rcx, %rsi
	addq	$1, %rcx
	salq	$4, %rsi
	movupd	0(%r13,%rsi), %xmm0
	addpd	%xmm3, %xmm0
	addsd	%xmm0, %xmm1
	unpckhpd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cmpq	%rcx, %rdi
	jne	.L9
	movq	%rax, %rcx
	andq	$-2, %rcx
	testb	$1, %al
	je	.L7
.L8:
	movsd	.LC4(%rip), %xmm0
	addsd	0(%r13,%rcx,8), %xmm0
	addsd	%xmm0, %xmm1
.L7:
	cmpq	%rax, %rdx
	jle	.L18
	movq	%rax, %rcx
	movapd	%xmm1, %xmm0
	negq	%rcx
	leaq	0(%r13,%rcx,8), %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	addsd	0(%r13,%rax,8), %xmm1
	subsd	(%rcx,%rax,8), %xmm1
	addq	$1, %rax
	movapd	%xmm1, %xmm4
	maxsd	%xmm0, %xmm4
	movapd	%xmm4, %xmm0
	cmpq	%rdx, %rax
	jne	.L14
.L12:
	mulsd	.LC5(%rip), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L18:
	movapd	%xmm1, %xmm0
	jmp	.L12
.L16:
	pxor	%xmm1, %xmm1
	jmp	.L7
.L17:
	xorl	%ecx, %ecx
	pxor	%xmm1, %xmm1
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.long	0
	.long	1072693248
	.long	0
	.long	1072693248
	.set	.LC4,.LC3
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	0
	.long	1071644672
	.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
.LC1:
	.string	"%ld"
.LC2:
	.string	"%lf"
.LC6:
	.string	"%lf\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-56(%rbp), %rsi
	pushq	%r12
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	leaq	.LC1(%rip), %r12
	pushq	%rbx
	movq	%r12, %rdi
	subq	$32, %rsp
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rdx
	movq	%rsp, %rsi
	leaq	15(,%rdx,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	movq	%rsp, %r13
	testq	%rdx, %rdx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	-56(%rbp), %rdx
	addq	$8, %r12
	cmpq	%rbx, %rdx
	jg	.L6
.L5:
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	jle	.L16
	cmpq	$1, %rax
	je	.L17
	movq	%rax, %rdi
	movapd	.LC3(%rip), %xmm3
	xorl	%ecx, %ecx
	pxor	%xmm1, %xmm1
	shrq	%rdi
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rcx, %rsi
	addq	$1, %rcx
	salq	$4, %rsi
	movupd	0(%r13,%rsi), %xmm0
	addpd	%xmm3, %xmm0
	addsd	%xmm0, %xmm1
	unpckhpd	%xmm0, %xmm0
	addsd	%xmm0, %xmm1
	cmpq	%rcx, %rdi
	jne	.L9
	movq	%rax, %rcx
	andq	$-2, %rcx
	testb	$1, %al
	je	.L7
.L8:
	movsd	.LC4(%rip), %xmm0
	addsd	0(%r13,%rcx,8), %xmm0
	addsd	%xmm0, %xmm1
.L7:
	cmpq	%rax, %rdx
	jle	.L18
	movq	%rax, %rcx
	movapd	%xmm1, %xmm0
	negq	%rcx
	leaq	0(%r13,%rcx,8), %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	addsd	0(%r13,%rax,8), %xmm1
	subsd	(%rcx,%rax,8), %xmm1
	addq	$1, %rax
	movapd	%xmm1, %xmm4
	maxsd	%xmm0, %xmm4
	movapd	%xmm4, %xmm0
	cmpq	%rdx, %rax
	jne	.L14
.L12:
	mulsd	.LC5(%rip), %xmm0
	movl	$1, %edi
	movl	$1, %eax
	leaq	.LC6(%rip), %rsi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L30
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L29:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L18:
	movapd	%xmm1, %xmm0
	jmp	.L12
.L16:
	pxor	%xmm1, %xmm1
	jmp	.L7
.L17:
	xorl	%ecx, %ecx
	pxor	%xmm1, %xmm1
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC3:
	.long	0
	.long	1072693248
	.long	0
	.long	1072693248
	.set	.LC4,.LC3
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC5:
	.long	0
	.long	1071644672
	.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(void){

  long n;
  scanf("%ld", &n);
  long k;
  scanf("%ld", &k);
  double p[n];
  for (long i = 0; i < n; i++) {
    scanf("%lf", &p[i]);
  }

  double ex = 0;
  for (long i = 0; i < k; i++) {
    ex += p[i]+1;
  }
  double max = ex;
  for (long i = k; i < n; i++) {
    ex += p[i];
    ex -= p[i-k];
    if (ex > max) {
      max = ex;
    }
  }

  printf("%lf\n", max/2);

  return 0;
}
10 4
17 21 13 12 15 20 10 13 17 11
 3 1
6 6 6 6
 10 4
15 21 13 12 15 20 10 13 17 11
 3 1
11 6 6 6
 1 1
15 6 6 6
 10 4
17 13 13 14 15 20 10 13 17 11
 3 0
6 6 6 6
 10 4
15 21 13 12 15 29 10 13 17 11
 10 4
27 13 13 14 15 20 10 13 17 11
 10 4
15 21 13 12 15 29 10 13 22 11

33.500000
 3.500000
 32.500000
 6.000000
 8.000000
 33.000000
 0.000000
 36.500000
 35.500000
 39.000000

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(void){

  long n;
  scanf("%ld", &n);
  long k;
  scanf("%ld", &k);
  double p[n];
  for (long i = 0; i < n; i++) {
    scanf("%lf", &p[i]);
  }

  double ex = 0;
  for (long i = 0; i < k; i++) {
    ex += p[i]+1;
  }
  double max = ex;
  for (long i = k; i < n; i++) {
    ex += p[i];
    ex -= p[i-k];
    if (ex > max) {
      max = ex;
    }
  }

  printf("%lf\n", max/2);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%lf"
.LC5:
	.string	"%lf\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-128(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L5
.L6:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -112(%rbp)
.L5:
	movq	-128(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jl	.L6
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -104(%rbp)
	movq	$0, -96(%rbp)
	jmp	.L7
.L8:
	movq	-64(%rbp), %rax
	movq	-96(%rbp), %rdx
	movsd	(%rax,%rdx,8), %xmm1
	movsd	.LC3(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	-104(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	addq	$1, -96(%rbp)
.L7:
	movq	-120(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movsd	-104(%rbp), %xmm0
	movsd	%xmm0, -88(%rbp)
	movq	-120(%rbp), %rax
	movq	%rax, -80(%rbp)
	jmp	.L9
.L12:
	movq	-64(%rbp), %rax
	movq	-80(%rbp), %rdx
	movsd	(%rax,%rdx,8), %xmm0
	movsd	-104(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	movq	-120(%rbp), %rcx
	movq	-80(%rbp), %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	movsd	(%rax,%rdx,8), %xmm1
	movsd	-104(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	movsd	-104(%rbp), %xmm0
	comisd	-88(%rbp), %xmm0
	jbe	.L10
	movsd	-104(%rbp), %xmm0
	movsd	%xmm0, -88(%rbp)
.L10:
	addq	$1, -80(%rbp)
.L9:
	movq	-128(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L12
	movsd	-88(%rbp), %xmm0
	movsd	.LC4(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.align 8
.LC4:
	.long	0
	.long	1073741824
	.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	"%ld"
.LC1:
	.string	"%lf"
.LC5:
	.string	"%lf\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
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$88, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-128(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-120(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-128(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	jmp	.L5
.L6:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -112(%rbp)
.L5:
	movq	-128(%rbp), %rax
	cmpq	%rax, -112(%rbp)
	jl	.L6
	pxor	%xmm0, %xmm0
	movsd	%xmm0, -104(%rbp)
	movq	$0, -96(%rbp)
	jmp	.L7
.L8:
	movq	-64(%rbp), %rax
	movq	-96(%rbp), %rdx
	movsd	(%rax,%rdx,8), %xmm1
	movsd	.LC3(%rip), %xmm0
	addsd	%xmm1, %xmm0
	movsd	-104(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	addq	$1, -96(%rbp)
.L7:
	movq	-120(%rbp), %rax
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movsd	-104(%rbp), %xmm0
	movsd	%xmm0, -88(%rbp)
	movq	-120(%rbp), %rax
	movq	%rax, -80(%rbp)
	jmp	.L9
.L12:
	movq	-64(%rbp), %rax
	movq	-80(%rbp), %rdx
	movsd	(%rax,%rdx,8), %xmm0
	movsd	-104(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	movq	-120(%rbp), %rcx
	movq	-80(%rbp), %rax
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-64(%rbp), %rax
	movsd	(%rax,%rdx,8), %xmm1
	movsd	-104(%rbp), %xmm0
	subsd	%xmm1, %xmm0
	movsd	%xmm0, -104(%rbp)
	movsd	-104(%rbp), %xmm0
	comisd	-88(%rbp), %xmm0
	jbe	.L10
	movsd	-104(%rbp), %xmm0
	movsd	%xmm0, -88(%rbp)
.L10:
	addq	$1, -80(%rbp)
.L9:
	movq	-128(%rbp), %rax
	cmpq	%rax, -80(%rbp)
	jl	.L12
	movsd	-88(%rbp), %xmm0
	movsd	.LC4(%rip), %xmm1
	divsd	%xmm1, %xmm0
	movq	%xmm0, %rax
	movq	%rax, %xmm0
	leaq	.LC5(%rip), %rax
	movq	%rax, %rdi
	movl	$1, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC3:
	.long	0
	.long	1072693248
	.align 8
.LC4:
	.long	0
	.long	1073741824
	.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:
