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 <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define MOD (ll)1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, n, m) for (int i = (n), i < (m); i++)

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int
main(int argc, char *argv[])
{
  int n, k, v[100];
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);

  int ans = 0;
  for (int i = 0; i <= k; i++) {
    if (k - i <= n) {
      for (int l = 0; l <= k - i; l++) {
	int minus = 0, ma[100];
	int sum = 0;
	for (int j = 0; j < l; j++) {
	  if (v[j] >= 0) sum += v[j];
	  else ma[minus++] = v[j];
	}
	for (int j = 0; j < k - i - l; j++) {
	  if (v[n - 1 - j] >= 0) sum += v[n - 1 - j];
	  else ma[minus++] = v[n - 1 - j];
	}
	qsort(ma, minus, sizeof(int), asc);
	for (int j = 0; j < minus; j++) {
	  if (j >= i) sum += ma[j];
	}
	ans = Max(ans, sum);
      }
    }
  }

  printf("%d\n", ans);

  return 0;
}
	
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	asc
	.type	asc, @function
asc:
.LFB6:
	.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$880, %rsp
	movl	%edi, -868(%rbp)
	movq	%rsi, -880(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-856(%rbp), %rdx
	leaq	-860(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -852(%rbp)
	jmp	.L4
.L5:
	leaq	-816(%rbp), %rdx
	movl	-852(%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, -852(%rbp)
.L4:
	movl	-860(%rbp), %eax
	cmpl	%eax, -852(%rbp)
	jl	.L5
	movl	$0, -848(%rbp)
	movl	$0, -844(%rbp)
	jmp	.L6
.L21:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	movl	%eax, %edx
	movl	-860(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	$0, -840(%rbp)
	jmp	.L8
.L20:
	movl	$0, -836(%rbp)
	movl	$0, -832(%rbp)
	movl	$0, -828(%rbp)
	jmp	.L9
.L12:
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L10
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
	jmp	.L11
.L10:
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -836(%rbp)
	movl	-828(%rbp), %edx
	movslq	%edx, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L11:
	addl	$1, -828(%rbp)
.L9:
	movl	-828(%rbp), %eax
	cmpl	-840(%rbp), %eax
	jl	.L12
	movl	$0, -824(%rbp)
	jmp	.L13
.L16:
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L14
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
	jmp	.L15
.L14:
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	movl	%eax, %ecx
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -836(%rbp)
	movslq	%ecx, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L15:
	addl	$1, -824(%rbp)
.L13:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	subl	-840(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L16
	movl	-836(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-416(%rbp), %rax
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -820(%rbp)
	jmp	.L17
.L19:
	movl	-820(%rbp), %eax
	cmpl	-844(%rbp), %eax
	jl	.L18
	movl	-820(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
.L18:
	addl	$1, -820(%rbp)
.L17:
	movl	-820(%rbp), %eax
	cmpl	-836(%rbp), %eax
	jl	.L19
	movl	-848(%rbp), %edx
	movl	-832(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -848(%rbp)
	addl	$1, -840(%rbp)
.L8:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	cmpl	%eax, -840(%rbp)
	jle	.L20
.L7:
	addl	$1, -844(%rbp)
.L6:
	movl	-856(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jle	.L21
	movl	-848(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	asc
	.type	asc, @function
asc:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	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
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L4
	leaq	32(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L5
.L4:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	js	.L33
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %r15d
	cmpl	%eax, %r15d
	jg	.L6
	movl	24(%rsp), %edx
.L29:
	movl	%eax, %esi
	subl	%r15d, %esi
	cmpl	%edx, %esi
	jg	.L7
	leaq	32(%rsp), %rdi
	xorl	%r14d, %r14d
	leaq	432(%rsp), %r12
	movq	%rdi, 8(%rsp)
	testl	%esi, %esi
	js	.L7
	subl	%r14d, %esi
	testl	%r14d, %r14d
	je	.L51
	.p2align 4,,10
	.p2align 3
.L27:
	leal	-1(%r14), %edx
	movq	8(%rsp), %rax
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	36(%rsp,%rdx,4), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L53:
	addq	$4, %rax
	addl	%edx, %ebp
	cmpq	%rcx, %rax
	je	.L52
.L11:
	movl	(%rax), %edx
	testl	%edx, %edx
	jns	.L53
	movslq	%ebx, %r9
	addq	$4, %rax
	addl	$1, %ebx
	movl	%edx, 432(%rsp,%r9,4)
	cmpq	%rcx, %rax
	jne	.L11
.L52:
	testl	%esi, %esi
	jle	.L12
.L30:
	movslq	24(%rsp), %rax
	movq	8(%rsp), %rdi
	leaq	(%rdi,%rax,4), %rdx
	xorl	%eax, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L54:
	addl	$1, %eax
	addl	%ecx, %ebp
	subq	$4, %rdx
	cmpl	%esi, %eax
	jge	.L12
.L15:
	movl	-4(%rdx), %ecx
	testl	%ecx, %ecx
	jns	.L54
	movslq	%ebx, %r9
	addl	$1, %eax
	addl	$1, %ebx
	subq	$4, %rdx
	movl	%ecx, 432(%rsp,%r9,4)
	cmpl	%esi, %eax
	jl	.L15
.L12:
	movslq	%ebx, %rsi
	leaq	asc(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	testl	%ebx, %ebx
	movdqa	.LC3(%rip), %xmm3
	movdqa	.LC4(%rip), %xmm2
	je	.L16
	testl	%r15d, %r15d
	je	.L35
	cmpl	%ebx, %r15d
	movl	%ebx, %esi
	movl	$1, %ecx
	cmovle	%r15d, %esi
	testl	%esi, %esi
	cmovg	%esi, %ecx
	cmpl	$3, %esi
	jle	.L36
	movl	%ecx, %edx
	movdqa	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	shrl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L20:
	movdqa	%xmm1, %xmm0
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%edx, %eax
	jne	.L20
	movl	%ecx, %edx
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %edx
	andl	$3, %ecx
	movd	%xmm0, %eax
	je	.L21
.L18:
	leal	1(%rdx), %eax
	cmpl	%eax, %esi
	jle	.L21
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%eax, %esi
	cmovg	%edx, %eax
.L21:
	cmpl	%eax, %ebx
	jle	.L16
.L17:
	movl	%ebx, %edx
	movl	$1, %r9d
	subl	%eax, %edx
	cmpl	%ebx, %eax
	cmovl	%edx, %r9d
	subl	$1, %edx
	cmpl	$2, %edx
	jbe	.L22
	cmpl	%ebx, %eax
	jge	.L22
	movslq	%eax, %rdx
	pxor	%xmm0, %xmm0
	leaq	(%r12,%rdx,4), %rcx
	movl	%r9d, %edx
	shrl	$2, %edx
	leal	-1(%rdx), %esi
	leaq	16(%rcx), %rdx
	salq	$4, %rsi
	addq	%rdx, %rsi
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L55:
	addq	$16, %rdx
.L23:
	movdqu	(%rcx), %xmm1
	movq	%rdx, %rcx
	paddd	%xmm1, %xmm0
	cmpq	%rdx, %rsi
	jne	.L55
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %ebp
	movl	%r9d, %edx
	andl	$-4, %edx
	addl	%edx, %eax
	cmpl	%edx, %r9d
	je	.L16
.L22:
	movslq	%eax, %rdx
	addl	432(%rsp,%rdx,4), %ebp
	leal	1(%rax), %edx
	cmpl	%ebx, %edx
	jge	.L16
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	432(%rsp,%rdx,4), %ebp
	cmpl	%ebx, %eax
	jge	.L16
	cltq
	addl	432(%rsp,%rax,4), %ebp
.L16:
	movl	28(%rsp), %eax
	cmpl	%ebp, %r13d
	cmovl	%ebp, %r13d
	addl	$1, %r14d
	movl	%eax, %esi
	subl	%r15d, %esi
	cmpl	%r14d, %esi
	jl	.L7
	subl	%r14d, %esi
	testl	%r14d, %r14d
	jne	.L27
.L51:
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	testl	%esi, %esi
	jg	.L30
	leaq	asc(%rip), %rcx
	movl	$4, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	qsort@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%eax, %eax
	jmp	.L17
.L36:
	xorl	%edx, %edx
	jmp	.L18
.L33:
	xorl	%r13d, %r13d
.L6:
	xorl	%eax, %eax
	movl	%r13d, %edx
	movl	$1, %edi
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$856, %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
.L56:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	asc
	.type	asc, @function
asc:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	asc, .-asc
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d"
.LC5:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	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
	subq	$856, %rsp
	.cfi_def_cfa_offset 912
	movq	%fs:40, %rax
	movq	%rax, 840(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	testl	%edx, %edx
	jle	.L4
	leaq	32(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	24(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L5
.L4:
	movl	28(%rsp), %eax
	testl	%eax, %eax
	js	.L33
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L7:
	addl	$1, %r15d
	cmpl	%eax, %r15d
	jg	.L6
	movl	24(%rsp), %edx
.L29:
	movl	%eax, %esi
	subl	%r15d, %esi
	cmpl	%edx, %esi
	jg	.L7
	leaq	32(%rsp), %rdi
	xorl	%r14d, %r14d
	leaq	432(%rsp), %r12
	movq	%rdi, 8(%rsp)
	testl	%esi, %esi
	js	.L7
	subl	%r14d, %esi
	testl	%r14d, %r14d
	je	.L51
	.p2align 4,,10
	.p2align 3
.L27:
	leal	-1(%r14), %edx
	movq	8(%rsp), %rax
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	leaq	36(%rsp,%rdx,4), %rcx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L53:
	addq	$4, %rax
	addl	%edx, %ebp
	cmpq	%rcx, %rax
	je	.L52
.L11:
	movl	(%rax), %edx
	testl	%edx, %edx
	jns	.L53
	movslq	%ebx, %r9
	addq	$4, %rax
	addl	$1, %ebx
	movl	%edx, 432(%rsp,%r9,4)
	cmpq	%rcx, %rax
	jne	.L11
.L52:
	testl	%esi, %esi
	jle	.L12
.L30:
	movslq	24(%rsp), %rax
	movq	8(%rsp), %rdi
	leaq	(%rdi,%rax,4), %rdx
	xorl	%eax, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L54:
	addl	$1, %eax
	addl	%ecx, %ebp
	subq	$4, %rdx
	cmpl	%esi, %eax
	jge	.L12
.L15:
	movl	-4(%rdx), %ecx
	testl	%ecx, %ecx
	jns	.L54
	movslq	%ebx, %r9
	addl	$1, %eax
	addl	$1, %ebx
	subq	$4, %rdx
	movl	%ecx, 432(%rsp,%r9,4)
	cmpl	%esi, %eax
	jl	.L15
.L12:
	movslq	%ebx, %rsi
	leaq	asc(%rip), %rcx
	movl	$4, %edx
	movq	%r12, %rdi
	call	qsort@PLT
	testl	%ebx, %ebx
	movdqa	.LC3(%rip), %xmm3
	movdqa	.LC4(%rip), %xmm2
	je	.L16
	testl	%r15d, %r15d
	je	.L35
	cmpl	%ebx, %r15d
	movl	%ebx, %esi
	movl	$1, %ecx
	cmovle	%r15d, %esi
	testl	%esi, %esi
	cmovg	%esi, %ecx
	cmpl	$3, %esi
	jle	.L36
	movl	%ecx, %edx
	movdqa	.LC0(%rip), %xmm1
	xorl	%eax, %eax
	shrl	$2, %edx
	.p2align 4,,10
	.p2align 3
.L20:
	movdqa	%xmm1, %xmm0
	addl	$1, %eax
	paddd	%xmm3, %xmm1
	paddd	%xmm2, %xmm0
	cmpl	%edx, %eax
	jne	.L20
	movl	%ecx, %edx
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %edx
	andl	$3, %ecx
	movd	%xmm0, %eax
	je	.L21
.L18:
	leal	1(%rdx), %eax
	cmpl	%eax, %esi
	jle	.L21
	leal	2(%rdx), %eax
	addl	$3, %edx
	cmpl	%eax, %esi
	cmovg	%edx, %eax
.L21:
	cmpl	%eax, %ebx
	jle	.L16
.L17:
	movl	%ebx, %edx
	movl	$1, %r9d
	subl	%eax, %edx
	cmpl	%ebx, %eax
	cmovl	%edx, %r9d
	subl	$1, %edx
	cmpl	$2, %edx
	jbe	.L22
	cmpl	%ebx, %eax
	jge	.L22
	movslq	%eax, %rdx
	pxor	%xmm0, %xmm0
	leaq	(%r12,%rdx,4), %rcx
	movl	%r9d, %edx
	shrl	$2, %edx
	leal	-1(%rdx), %esi
	leaq	16(%rcx), %rdx
	salq	$4, %rsi
	addq	%rdx, %rsi
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L55:
	addq	$16, %rdx
.L23:
	movdqu	(%rcx), %xmm1
	movq	%rdx, %rcx
	paddd	%xmm1, %xmm0
	cmpq	%rdx, %rsi
	jne	.L55
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	addl	%edx, %ebp
	movl	%r9d, %edx
	andl	$-4, %edx
	addl	%edx, %eax
	cmpl	%edx, %r9d
	je	.L16
.L22:
	movslq	%eax, %rdx
	addl	432(%rsp,%rdx,4), %ebp
	leal	1(%rax), %edx
	cmpl	%ebx, %edx
	jge	.L16
	movslq	%edx, %rdx
	addl	$2, %eax
	addl	432(%rsp,%rdx,4), %ebp
	cmpl	%ebx, %eax
	jge	.L16
	cltq
	addl	432(%rsp,%rax,4), %ebp
.L16:
	movl	28(%rsp), %eax
	cmpl	%ebp, %r13d
	cmovl	%ebp, %r13d
	addl	$1, %r14d
	movl	%eax, %esi
	subl	%r15d, %esi
	cmpl	%r14d, %esi
	jl	.L7
	subl	%r14d, %esi
	testl	%r14d, %r14d
	jne	.L27
.L51:
	xorl	%ebp, %ebp
	xorl	%ebx, %ebx
	testl	%esi, %esi
	jg	.L30
	leaq	asc(%rip), %rcx
	movl	$4, %edx
	xorl	%esi, %esi
	movq	%r12, %rdi
	call	qsort@PLT
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%eax, %eax
	jmp	.L17
.L36:
	xorl	%edx, %edx
	jmp	.L18
.L33:
	xorl	%r13d, %r13d
.L6:
	xorl	%eax, %eax
	movl	%r13d, %edx
	movl	$1, %edi
	leaq	.LC5(%rip), %rsi
	call	__printf_chk@PLT
	movq	840(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L56
	addq	$856, %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
.L56:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	1
	.long	1
	.long	1
	.long	1
	.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 <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define MOD (ll)1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, n, m) for (int i = (n), i < (m); i++)

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int
main(int argc, char *argv[])
{
  int n, k, v[100];
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);

  int ans = 0;
  for (int i = 0; i <= k; i++) {
    if (k - i <= n) {
      for (int l = 0; l <= k - i; l++) {
	int minus = 0, ma[100];
	int sum = 0;
	for (int j = 0; j < l; j++) {
	  if (v[j] >= 0) sum += v[j];
	  else ma[minus++] = v[j];
	}
	for (int j = 0; j < k - i - l; j++) {
	  if (v[n - 1 - j] >= 0) sum += v[n - 1 - j];
	  else ma[minus++] = v[n - 1 - j];
	}
	qsort(ma, minus, sizeof(int), asc);
	for (int j = 0; j < minus; j++) {
	  if (j >= i) sum += ma[j];
	}
	ans = Max(ans, sum);
      }
    }
  }

  printf("%d\n", ans);

  return 0;
}
	

6 4
-10 8 2 0 2 6
 6 4
-1 -100 50 -2 -5 -3
 6 3
-6 -100 50 -2 -9 -3
 6 4
-10 3 2 0 2 6
 6 4
-1 -100 78 -2 -5 -3
 6 4
-10 3 2 0 2 12
 6 4
-10 3 3 0 2 12
 6 7
-1 -100 78 0 -5 -3
 6 4
-15 3 0 0 2 12
 6 7
-1 -100 54 0 -1 -3

14
 49
 0
 10
 77
 16
 17
 78
 15
 54

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 <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define MOD (ll)1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, n, m) for (int i = (n), i < (m); i++)

int asc(const void *a, const void *b) {
  return *(int *)a - *(int *)b;
}

int
main(int argc, char *argv[])
{
  int n, k, v[100];
  scanf("%d %d", &n, &k);
  for (int i = 0; i < n; i++) scanf("%d", &v[i]);

  int ans = 0;
  for (int i = 0; i <= k; i++) {
    if (k - i <= n) {
      for (int l = 0; l <= k - i; l++) {
	int minus = 0, ma[100];
	int sum = 0;
	for (int j = 0; j < l; j++) {
	  if (v[j] >= 0) sum += v[j];
	  else ma[minus++] = v[j];
	}
	for (int j = 0; j < k - i - l; j++) {
	  if (v[n - 1 - j] >= 0) sum += v[n - 1 - j];
	  else ma[minus++] = v[n - 1 - j];
	}
	qsort(ma, minus, sizeof(int), asc);
	for (int j = 0; j < minus; j++) {
	  if (j >= i) sum += ma[j];
	}
	ans = Max(ans, sum);
      }
    }
  }

  printf("%d\n", ans);

  return 0;
}
	
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	asc
	.type	asc, @function
asc:
.LFB6:
	.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$880, %rsp
	movl	%edi, -868(%rbp)
	movq	%rsi, -880(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-856(%rbp), %rdx
	leaq	-860(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -852(%rbp)
	jmp	.L4
.L5:
	leaq	-816(%rbp), %rdx
	movl	-852(%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, -852(%rbp)
.L4:
	movl	-860(%rbp), %eax
	cmpl	%eax, -852(%rbp)
	jl	.L5
	movl	$0, -848(%rbp)
	movl	$0, -844(%rbp)
	jmp	.L6
.L21:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	movl	%eax, %edx
	movl	-860(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	$0, -840(%rbp)
	jmp	.L8
.L20:
	movl	$0, -836(%rbp)
	movl	$0, -832(%rbp)
	movl	$0, -828(%rbp)
	jmp	.L9
.L12:
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L10
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
	jmp	.L11
.L10:
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -836(%rbp)
	movl	-828(%rbp), %edx
	movslq	%edx, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L11:
	addl	$1, -828(%rbp)
.L9:
	movl	-828(%rbp), %eax
	cmpl	-840(%rbp), %eax
	jl	.L12
	movl	$0, -824(%rbp)
	jmp	.L13
.L16:
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L14
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
	jmp	.L15
.L14:
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	movl	%eax, %ecx
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -836(%rbp)
	movslq	%ecx, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L15:
	addl	$1, -824(%rbp)
.L13:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	subl	-840(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L16
	movl	-836(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-416(%rbp), %rax
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -820(%rbp)
	jmp	.L17
.L19:
	movl	-820(%rbp), %eax
	cmpl	-844(%rbp), %eax
	jl	.L18
	movl	-820(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
.L18:
	addl	$1, -820(%rbp)
.L17:
	movl	-820(%rbp), %eax
	cmpl	-836(%rbp), %eax
	jl	.L19
	movl	-848(%rbp), %edx
	movl	-832(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -848(%rbp)
	addl	$1, -840(%rbp)
.L8:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	cmpl	%eax, -840(%rbp)
	jle	.L20
.L7:
	addl	$1, -844(%rbp)
.L6:
	movl	-856(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jle	.L21
	movl	-848(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	asc
	.type	asc, @function
asc:
.LFB6:
	.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	asc, .-asc
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$880, %rsp
	movl	%edi, -868(%rbp)
	movq	%rsi, -880(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-856(%rbp), %rdx
	leaq	-860(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -852(%rbp)
	jmp	.L4
.L5:
	leaq	-816(%rbp), %rdx
	movl	-852(%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, -852(%rbp)
.L4:
	movl	-860(%rbp), %eax
	cmpl	%eax, -852(%rbp)
	jl	.L5
	movl	$0, -848(%rbp)
	movl	$0, -844(%rbp)
	jmp	.L6
.L21:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	movl	%eax, %edx
	movl	-860(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L7
	movl	$0, -840(%rbp)
	jmp	.L8
.L20:
	movl	$0, -836(%rbp)
	movl	$0, -832(%rbp)
	movl	$0, -828(%rbp)
	jmp	.L9
.L12:
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L10
	movl	-828(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
	jmp	.L11
.L10:
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -836(%rbp)
	movl	-828(%rbp), %edx
	movslq	%edx, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L11:
	addl	$1, -828(%rbp)
.L9:
	movl	-828(%rbp), %eax
	cmpl	-840(%rbp), %eax
	jl	.L12
	movl	$0, -824(%rbp)
	jmp	.L13
.L16:
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	testl	%eax, %eax
	js	.L14
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
	jmp	.L15
.L14:
	movl	-860(%rbp), %eax
	subl	$1, %eax
	subl	-824(%rbp), %eax
	movl	%eax, %ecx
	movl	-836(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -836(%rbp)
	movslq	%ecx, %rdx
	movl	-816(%rbp,%rdx,4), %edx
	cltq
	movl	%edx, -416(%rbp,%rax,4)
.L15:
	addl	$1, -824(%rbp)
.L13:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	subl	-840(%rbp), %eax
	cmpl	%eax, -824(%rbp)
	jl	.L16
	movl	-836(%rbp), %eax
	movslq	%eax, %rsi
	leaq	-416(%rbp), %rax
	leaq	asc(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -820(%rbp)
	jmp	.L17
.L19:
	movl	-820(%rbp), %eax
	cmpl	-844(%rbp), %eax
	jl	.L18
	movl	-820(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
.L18:
	addl	$1, -820(%rbp)
.L17:
	movl	-820(%rbp), %eax
	cmpl	-836(%rbp), %eax
	jl	.L19
	movl	-848(%rbp), %edx
	movl	-832(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	movl	%eax, -848(%rbp)
	addl	$1, -840(%rbp)
.L8:
	movl	-856(%rbp), %eax
	subl	-844(%rbp), %eax
	cmpl	%eax, -840(%rbp)
	jle	.L20
.L7:
	addl	$1, -844(%rbp)
.L6:
	movl	-856(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jle	.L21
	movl	-848(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
