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>

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;
}```

Assembly Code:

```assembly
	.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:
```

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
.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
```assembly
	.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:
```
```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;
}```
Given the following C 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;
}```

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:

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 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;
}```

Assembly Code:

```assembly
	.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:
```

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
.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:
```