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>
#include <string.h>
#include <stdbool.h>

#define N_MAX 100000
#define M_MAX 1000
#define INF 10000000
#define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b))))

typedef unsigned long long ull;
typedef   signed long long dll;

dll a[N_MAX];
int n, m;

int i, j, k;

void deb(){
	return;
}

ull abs(dll n){
	return (ull)((n > 0) ? n : -n);
}

void solve(){
	dll result = 0;
	dll total = 0;
	dll rangetot = 0;
	for (i = 0; i < n; i++) {
		if (a[i] >= 0) total += a[i];
	}
	for (i = 0; i < k; i++) {
		if (a[i] >= 0) total -= a[i];
		rangetot += a[i];
	}

	// puts("deb line B");

	while (i <= n) {
		ull candid;
		candid = total;
		if (rangetot > 0) candid += rangetot;
		if (result < candid) result = candid;

		if (a[i-k] >= 0) total += a[i-k];
		rangetot -= a[i-k];
		if (a[i] >= 0) total -= a[i];
		rangetot += a[i];
		i++;
	}

	printf("%lld\n", result);
	return;
}

int main (void) {
	scanf("%d%d", &n, &k);
	for (i = 0; i < n; i++) scanf("%lld", &a[i]);

		// puts("deb line A");

	solve();
	return 0;
}


```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.text
	.globl	deb
	.type	deb, @function
deb:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	deb, .-deb
	.globl	abs
	.type	abs, @function
abs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, i(%rip)
	jmp	.L6
.L8:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L7
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -24(%rbp)
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L8
	movl	$0, i(%rip)
	jmp	.L9
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L10
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -24(%rbp)
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	k(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	jmp	.L12
.L17:
	movq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L13
	movq	-16(%rbp), %rax
	addq	%rax, -8(%rbp)
.L13:
	movq	-32(%rbp), %rax
	cmpq	%rax, -8(%rbp)
	jbe	.L14
	movq	-8(%rbp), %rax
	movq	%rax, -32(%rbp)
.L14:
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L15
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -24(%rbp)
.L15:
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L16
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -24(%rbp)
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L17
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	solve, .-solve
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	k(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L20
.L21:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L20:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L21
	movl	$0, %eax
	call	solve
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.p2align 4
	.globl	deb
	.type	deb, @function
deb:
.LFB35:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE35:
	.size	deb, .-deb
	.p2align 4
	.globl	abs
	.type	abs, @function
abs:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	negq	%rax
	cmovs	%rdi, %rax
	ret
	.cfi_endproc
.LFE36:
	.size	abs, .-abs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB37:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	testl	%r8d, %r8d
	jle	.L5
	leaq	a(%rip), %r9
	leal	-1(%r8), %eax
	leaq	8(%r9), %r10
	movq	%r9, %rdx
	leaq	(%r10,%rax,8), %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %rcx
	testq	%rcx, %rcx
	leaq	(%rax,%rcx), %rsi
	cmovns	%rsi, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rdi
	jne	.L7
	movl	k(%rip), %edi
	testl	%edi, %edi
	jle	.L25
.L8:
	leal	-1(%rdi), %edx
	leaq	a(%rip), %rcx
	leaq	(%r10,%rdx,8), %r10
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movq	(%rcx), %rsi
	movq	%rax, %r9
	subq	%rsi, %r9
	testq	%rsi, %rsi
	cmovns	%r9, %rax
	addq	$8, %rcx
	addq	%rsi, %rdx
	cmpq	%rcx, %r10
	jne	.L12
	movl	%edi, i(%rip)
	movl	%edi, %ebx
.L10:
	cmpl	%edi, %r8d
	jl	.L20
	leaq	a(%rip), %r9
	leaq	8(%r9), %r10
.L9:
	movl	%r8d, %esi
	movslq	%edi, %rcx
	subl	%edi, %esi
	subl	%ebx, %edi
	leaq	(%r9,%rcx,8), %r9
	addq	%rcx, %rsi
	leaq	(%r10,%rsi,8), %r11
	movslq	%edi, %rsi
	xorl	%r10d, %r10d
	subq	%rcx, %rsi
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	(%rax,%rdx), %rcx
	testq	%rdx, %rdx
	cmovle	%rax, %rcx
	cmpq	%rcx, %r10
	cmovb	%rcx, %r10
	movq	(%r9,%rsi,8), %rcx
	testq	%rcx, %rcx
	leaq	(%rax,%rcx), %rdi
	cmovns	%rdi, %rax
	subq	%rcx, %rdx
	movq	(%r9), %rcx
	movq	%rax, %rdi
	subq	%rcx, %rdi
	testq	%rcx, %rcx
	cmovns	%rdi, %rax
	addq	$8, %r9
	addq	%rcx, %rdx
	cmpq	%r9, %r11
	jne	.L18
	addl	$1, %r8d
	movl	%r8d, i(%rip)
.L13:
	movq	%r10, %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$0, i(%rip)
	movl	k(%rip), %edi
	testl	%edi, %edi
	jle	.L19
	xorl	%eax, %eax
	leaq	8+a(%rip), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%r10d, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%edi, %ebx
	xorl	%edx, %edx
	xorl	%edi, %edi
	jmp	.L9
.L19:
	movl	%edi, %ebx
	xorl	%edx, %edx
	xorl	%edi, %edi
	xorl	%eax, %eax
	jmp	.L10
	.cfi_endproc
.LFE37:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	k(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L27
	xorl	%eax, %eax
	leaq	a(%rip), %rbp
	leaq	.LC2(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L28:
	cltq
	movq	%rbx, %rdi
	leaq	0(%rbp,%rax,8), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	n(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L28
.L27:
	xorl	%eax, %eax
	call	solve
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE38:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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
	.p2align 4
	.globl	deb
	.type	deb, @function
deb:
.LFB35:
	.cfi_startproc
	endbr64
	ret
	.cfi_endproc
.LFE35:
	.size	deb, .-deb
	.p2align 4
	.globl	abs
	.type	abs, @function
abs:
.LFB36:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	negq	%rax
	cmovs	%rdi, %rax
	ret
	.cfi_endproc
.LFE36:
	.size	abs, .-abs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB37:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r8d
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	testl	%r8d, %r8d
	jle	.L5
	leaq	a(%rip), %r9
	leal	-1(%r8), %eax
	leaq	8(%r9), %r10
	movq	%r9, %rdx
	leaq	(%r10,%rax,8), %rdi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	movq	(%rdx), %rcx
	testq	%rcx, %rcx
	leaq	(%rax,%rcx), %rsi
	cmovns	%rsi, %rax
	addq	$8, %rdx
	cmpq	%rdx, %rdi
	jne	.L7
	movl	k(%rip), %edi
	testl	%edi, %edi
	jle	.L25
.L8:
	leal	-1(%rdi), %edx
	leaq	a(%rip), %rcx
	leaq	(%r10,%rdx,8), %r10
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L12:
	movq	(%rcx), %rsi
	movq	%rax, %r9
	subq	%rsi, %r9
	testq	%rsi, %rsi
	cmovns	%r9, %rax
	addq	$8, %rcx
	addq	%rsi, %rdx
	cmpq	%rcx, %r10
	jne	.L12
	movl	%edi, i(%rip)
	movl	%edi, %ebx
.L10:
	cmpl	%edi, %r8d
	jl	.L20
	leaq	a(%rip), %r9
	leaq	8(%r9), %r10
.L9:
	movl	%r8d, %esi
	movslq	%edi, %rcx
	subl	%edi, %esi
	subl	%ebx, %edi
	leaq	(%r9,%rcx,8), %r9
	addq	%rcx, %rsi
	leaq	(%r10,%rsi,8), %r11
	movslq	%edi, %rsi
	xorl	%r10d, %r10d
	subq	%rcx, %rsi
	.p2align 4,,10
	.p2align 3
.L18:
	leaq	(%rax,%rdx), %rcx
	testq	%rdx, %rdx
	cmovle	%rax, %rcx
	cmpq	%rcx, %r10
	cmovb	%rcx, %r10
	movq	(%r9,%rsi,8), %rcx
	testq	%rcx, %rcx
	leaq	(%rax,%rcx), %rdi
	cmovns	%rdi, %rax
	subq	%rcx, %rdx
	movq	(%r9), %rcx
	movq	%rax, %rdi
	subq	%rcx, %rdi
	testq	%rcx, %rcx
	cmovns	%rdi, %rax
	addq	$8, %r9
	addq	%rcx, %rdx
	cmpq	%r9, %r11
	jne	.L18
	addl	$1, %r8d
	movl	%r8d, i(%rip)
.L13:
	movq	%r10, %rdx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	movl	$0, i(%rip)
	movl	k(%rip), %edi
	testl	%edi, %edi
	jle	.L19
	xorl	%eax, %eax
	leaq	8+a(%rip), %r10
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L20:
	xorl	%r10d, %r10d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%edi, %ebx
	xorl	%edx, %edx
	xorl	%edi, %edi
	jmp	.L9
.L19:
	movl	%edi, %ebx
	xorl	%edx, %edx
	xorl	%edi, %edi
	xorl	%eax, %eax
	jmp	.L10
	.cfi_endproc
.LFE37:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB38:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	k(%rip), %rdx
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC1(%rip), %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	movl	$0, i(%rip)
	testl	%eax, %eax
	jle	.L27
	xorl	%eax, %eax
	leaq	a(%rip), %rbp
	leaq	.LC2(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L28:
	cltq
	movq	%rbx, %rdi
	leaq	0(%rbp,%rax,8), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	cmpl	n(%rip), %eax
	movl	%eax, i(%rip)
	jl	.L28
.L27:
	xorl	%eax, %eax
	call	solve
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE38:
	.size	main, .-main
	.globl	k
	.bss
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.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>
#include <string.h>
#include <stdbool.h>

#define N_MAX 100000
#define M_MAX 1000
#define INF 10000000
#define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b))))

typedef unsigned long long ull;
typedef   signed long long dll;

dll a[N_MAX];
int n, m;

int i, j, k;

void deb(){
	return;
}

ull abs(dll n){
	return (ull)((n > 0) ? n : -n);
}

void solve(){
	dll result = 0;
	dll total = 0;
	dll rangetot = 0;
	for (i = 0; i < n; i++) {
		if (a[i] >= 0) total += a[i];
	}
	for (i = 0; i < k; i++) {
		if (a[i] >= 0) total -= a[i];
		rangetot += a[i];
	}

	// puts("deb line B");

	while (i <= n) {
		ull candid;
		candid = total;
		if (rangetot > 0) candid += rangetot;
		if (result < candid) result = candid;

		if (a[i-k] >= 0) total += a[i-k];
		rangetot -= a[i-k];
		if (a[i] >= 0) total -= a[i];
		rangetot += a[i];
		i++;
	}

	printf("%lld\n", result);
	return;
}

int main (void) {
	scanf("%d%d", &n, &k);
	for (i = 0; i < n; i++) scanf("%lld", &a[i]);

		// puts("deb line A");

	solve();
	return 0;
}



1 1
-16
 5 3
-10 10 -18 10 -10
 4 2
7 -10 -10 10
 4 2
7 -6 -10 12
 4 2
7 -6 -10 20
 4 2
9 -1 -10 20
 4 2
13 -1 -10 20
 4 2
3 -1 -10 20
 4 3
3 -1 -10 20
 4 3
3 -1 -1 20

0
 10
 17
 19
 27
 29
 33
 23
 20
 21

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>
#include <string.h>
#include <stdbool.h>

#define N_MAX 100000
#define M_MAX 1000
#define INF 10000000
#define SMAP(a, b) ((a)!=(b))&&((a)^=((b)^=((a)^= (b))))

typedef unsigned long long ull;
typedef   signed long long dll;

dll a[N_MAX];
int n, m;

int i, j, k;

void deb(){
	return;
}

ull abs(dll n){
	return (ull)((n > 0) ? n : -n);
}

void solve(){
	dll result = 0;
	dll total = 0;
	dll rangetot = 0;
	for (i = 0; i < n; i++) {
		if (a[i] >= 0) total += a[i];
	}
	for (i = 0; i < k; i++) {
		if (a[i] >= 0) total -= a[i];
		rangetot += a[i];
	}

	// puts("deb line B");

	while (i <= n) {
		ull candid;
		candid = total;
		if (rangetot > 0) candid += rangetot;
		if (result < candid) result = candid;

		if (a[i-k] >= 0) total += a[i-k];
		rangetot -= a[i-k];
		if (a[i] >= 0) total -= a[i];
		rangetot += a[i];
		i++;
	}

	printf("%lld\n", result);
	return;
}

int main (void) {
	scanf("%d%d", &n, &k);
	for (i = 0; i < n; i++) scanf("%lld", &a[i]);

		// puts("deb line A");

	solve();
	return 0;
}


```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.text
	.globl	deb
	.type	deb, @function
deb:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	deb, .-deb
	.globl	abs
	.type	abs, @function
abs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, i(%rip)
	jmp	.L6
.L8:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L7
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -24(%rbp)
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L8
	movl	$0, i(%rip)
	jmp	.L9
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L10
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -24(%rbp)
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	k(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	jmp	.L12
.L17:
	movq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L13
	movq	-16(%rbp), %rax
	addq	%rax, -8(%rbp)
.L13:
	movq	-32(%rbp), %rax
	cmpq	%rax, -8(%rbp)
	jbe	.L14
	movq	-8(%rbp), %rax
	movq	%rax, -32(%rbp)
.L14:
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L15
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -24(%rbp)
.L15:
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L16
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -24(%rbp)
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L17
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	solve, .-solve
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	k(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L20
.L21:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L20:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L21
	movl	$0, %eax
	call	solve
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 800000
a:
	.zero	800000
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.text
	.globl	deb
	.type	deb, @function
deb:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	deb, .-deb
	.globl	abs
	.type	abs, @function
abs:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%lld\n"
	.text
	.globl	solve
	.type	solve, @function
solve:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	$0, -32(%rbp)
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, i(%rip)
	jmp	.L6
.L8:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L7
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -24(%rbp)
.L7:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L6:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L8
	movl	$0, i(%rip)
	jmp	.L9
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L10
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -24(%rbp)
.L10:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L9:
	movl	i(%rip), %edx
	movl	k(%rip), %eax
	cmpl	%eax, %edx
	jl	.L11
	jmp	.L12
.L17:
	movq	-24(%rbp), %rax
	movq	%rax, -8(%rbp)
	cmpq	$0, -16(%rbp)
	jle	.L13
	movq	-16(%rbp), %rax
	addq	%rax, -8(%rbp)
.L13:
	movq	-32(%rbp), %rax
	cmpq	%rax, -8(%rbp)
	jbe	.L14
	movq	-8(%rbp), %rax
	movq	%rax, -32(%rbp)
.L14:
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L15
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -24(%rbp)
.L15:
	movl	i(%rip), %eax
	movl	k(%rip), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	testq	%rax, %rax
	js	.L16
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	%rax, -24(%rbp)
.L16:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -16(%rbp)
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L12:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L17
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	solve, .-solve
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	k(%rip), %rax
	movq	%rax, %rdx
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, i(%rip)
	jmp	.L20
.L21:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L20:
	movl	i(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jl	.L21
	movl	$0, %eax
	call	solve
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
