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>

long long abs(long long a){
  if(a >= 0){
    return a;
  }
  else{
    return -a;
  }
}

int main(void){
  int n , k;
  scanf("%d %d",&n ,&k);

  long long x[n];
  int zero = -1;
  for(int i = 0;i < n;i ++){
    scanf("%lld",&x[i]);
    if(x[i-1] < 0 && x[i] >= 0){
      zero = i;
    }
  }
  
  if(zero == -1){
    if(x[n-1] < 0){
      zero = n;
    }
    else{
      zero = 0;
    }
  }

  int start , end;
  long long time , min = 1000000000000;
  for(int i = 0;i < n - k + 1;i ++){
    start = i;
    end = i + k - 1;
    if(i < zero && zero <= i + k ){
      time =  - x[start] + x[end];
      if(abs(x[start]) < abs(x[end])){
        time += abs(x[start]);
      }
      else{
        time += abs(x[end]);
      }
    }
    else if(i < zero){
      time = abs(x[start]);
    }
    
    else if(i >= zero){
      time = abs(x[end]);
    }
    //printf("%lld\n",time);
    if(min > time){
      min = time;
    }
  }

  printf("%lld\n",min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	abs
	.type	abs, @function
abs:
.LFB0:
	.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)
	cmpq	$0, -8(%rbp)
	js	.L2
	movq	-8(%rbp), %rax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	negq	%rax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	%r12
	pushq	%rbx
	subq	$96, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movl	$-1, -92(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L8
.L10:
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L9
	movq	-48(%rbp), %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	js	.L9
	movl	-88(%rbp), %eax
	movl	%eax, -92(%rbp)
.L9:
	addl	$1, -88(%rbp)
.L8:
	movl	-100(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L10
	cmpl	$-1, -92(%rbp)
	jne	.L11
	movl	-100(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L12
	movl	-100(%rbp), %eax
	movl	%eax, -92(%rbp)
	jmp	.L11
.L12:
	movl	$0, -92(%rbp)
.L11:
	movabsq	$1000000000000, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L13
.L20:
	movl	-84(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	-96(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -76(%rbp)
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jge	.L14
	movl	-96(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -92(%rbp)
	jg	.L14
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -72(%rbp)
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, %rbx
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	cmpq	%rax, %rbx
	jge	.L15
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	addq	%rax, -72(%rbp)
	jmp	.L17
.L15:
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	addq	%rax, -72(%rbp)
	jmp	.L17
.L14:
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jge	.L18
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, -72(%rbp)
	jmp	.L17
.L18:
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L17
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, -72(%rbp)
.L17:
	movq	-64(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jle	.L19
	movq	-72(%rbp), %rax
	movq	%rax, -64(%rbp)
.L19:
	addl	$1, -84(%rbp)
.L13:
	movl	-100(%rbp), %eax
	movl	-96(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -84(%rbp)
	jle	.L20
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	abs
	.type	abs, @function
abs:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	negq	%rax
	cmovs	%rdi, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	abs, .-abs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %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
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %r15
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L5
.L32:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L32
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L33
.L6:
	movq	%rsp, %r12
	testl	%r15d, %r15d
	jle	.L7
	movq	%r12, %rbx
	xorl	%r13d, %r13d
	movl	$-1, %r15d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, -8(%rbx)
	jns	.L8
	cmpq	$0, (%rbx)
	cmovns	%r13d, %r15d
.L8:
	movl	-64(%rbp), %eax
	addl	$1, %r13d
	addq	$8, %rbx
	cmpl	%r13d, %eax
	jg	.L9
	cmpl	$-1, %r15d
	je	.L34
.L10:
	movabsq	$1000000000000, %rdx
	movl	-60(%rbp), %r10d
	subl	%r10d, %eax
	movl	%eax, %r8d
	js	.L12
	testl	%r15d, %r15d
	jg	.L35
	xorl	%edi, %edi
.L13:
	movslq	%edi, %rcx
	addl	%r10d, %edi
	movslq	%edi, %rdi
	subq	%rcx, %rdi
	leaq	(%r12,%rdi,8), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	movq	-8(%rdi,%rcx,8), %rsi
	movq	%rsi, %rax
	negq	%rax
	cmovs	%rsi, %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jge	.L17
.L12:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	leal	1(%rax), %r11d
	movq	%r12, %r9
	movslq	%r10d, %rbx
	cmpl	%r15d, %r11d
	cmovg	%r15d, %r11d
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L16:
	movq	(%r9), %rcx
	leal	(%rdi,%r10), %esi
	movq	%rcx, %rax
	negq	%rax
	cmovs	%rcx, %rax
	cmpl	%esi, %r15d
	jg	.L14
	movq	-8(%r9,%rbx,8), %r13
	movq	%r13, %rsi
	subq	%rcx, %rsi
	movq	%r13, %rcx
	negq	%rcx
	cmovs	%r13, %rcx
	leaq	(%rax,%rsi), %r13
	addq	%rcx, %rsi
	cmpq	%rax, %rcx
	movq	%r13, %rax
	cmovle	%rsi, %rax
.L14:
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	addl	$1, %edi
	addq	$8, %r9
	cmpl	%r11d, %edi
	jl	.L16
	cmpl	%r8d, %edi
	jle	.L13
	jmp	.L12
.L34:
	movl	%eax, %r15d
.L7:
	leal	-1(%r15), %eax
	cltq
	cmpq	$0, (%r12,%rax,8)
	js	.L37
	movl	-60(%rbp), %r10d
	movl	$244140625, %edx
	movl	%r15d, %r8d
	xorl	%edi, %edi
	salq	$12, %rdx
	subl	%r10d, %r8d
	jns	.L13
	jmp	.L12
.L33:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L37:
	movl	%r15d, %eax
	jmp	.L10
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	abs
	.type	abs, @function
abs:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %rax
	negq	%rax
	cmovs	%rdi, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	abs, .-abs
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %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
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rcx
	movq	%rax, %r15
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L5
.L32:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L32
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L33
.L6:
	movq	%rsp, %r12
	testl	%r15d, %r15d
	jle	.L7
	movq	%r12, %rbx
	xorl	%r13d, %r13d
	movl	$-1, %r15d
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, -8(%rbx)
	jns	.L8
	cmpq	$0, (%rbx)
	cmovns	%r13d, %r15d
.L8:
	movl	-64(%rbp), %eax
	addl	$1, %r13d
	addq	$8, %rbx
	cmpl	%r13d, %eax
	jg	.L9
	cmpl	$-1, %r15d
	je	.L34
.L10:
	movabsq	$1000000000000, %rdx
	movl	-60(%rbp), %r10d
	subl	%r10d, %eax
	movl	%eax, %r8d
	js	.L12
	testl	%r15d, %r15d
	jg	.L35
	xorl	%edi, %edi
.L13:
	movslq	%edi, %rcx
	addl	%r10d, %edi
	movslq	%edi, %rdi
	subq	%rcx, %rdi
	leaq	(%r12,%rdi,8), %rdi
	.p2align 4,,10
	.p2align 3
.L17:
	movq	-8(%rdi,%rcx,8), %rsi
	movq	%rsi, %rax
	negq	%rax
	cmovs	%rsi, %rax
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jge	.L17
.L12:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	leal	1(%rax), %r11d
	movq	%r12, %r9
	movslq	%r10d, %rbx
	cmpl	%r15d, %r11d
	cmovg	%r15d, %r11d
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L16:
	movq	(%r9), %rcx
	leal	(%rdi,%r10), %esi
	movq	%rcx, %rax
	negq	%rax
	cmovs	%rcx, %rax
	cmpl	%esi, %r15d
	jg	.L14
	movq	-8(%r9,%rbx,8), %r13
	movq	%r13, %rsi
	subq	%rcx, %rsi
	movq	%r13, %rcx
	negq	%rcx
	cmovs	%r13, %rcx
	leaq	(%rax,%rsi), %r13
	addq	%rcx, %rsi
	cmpq	%rax, %rcx
	movq	%r13, %rax
	cmovle	%rsi, %rax
.L14:
	cmpq	%rax, %rdx
	cmovg	%rax, %rdx
	addl	$1, %edi
	addq	$8, %r9
	cmpl	%r11d, %edi
	jl	.L16
	cmpl	%r8d, %edi
	jle	.L13
	jmp	.L12
.L34:
	movl	%eax, %r15d
.L7:
	leal	-1(%r15), %eax
	cltq
	cmpq	$0, (%r12,%rax,8)
	js	.L37
	movl	-60(%rbp), %r10d
	movl	$244140625, %edx
	movl	%r15d, %r8d
	xorl	%edi, %edi
	salq	$12, %rdx
	subl	%r10d, %r8d
	jns	.L13
	jmp	.L12
.L33:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L37:
	movl	%r15d, %eax
	jmp	.L10
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>

long long abs(long long a){
  if(a >= 0){
    return a;
  }
  else{
    return -a;
  }
}

int main(void){
  int n , k;
  scanf("%d %d",&n ,&k);

  long long x[n];
  int zero = -1;
  for(int i = 0;i < n;i ++){
    scanf("%lld",&x[i]);
    if(x[i-1] < 0 && x[i] >= 0){
      zero = i;
    }
  }
  
  if(zero == -1){
    if(x[n-1] < 0){
      zero = n;
    }
    else{
      zero = 0;
    }
  }

  int start , end;
  long long time , min = 1000000000000;
  for(int i = 0;i < n - k + 1;i ++){
    start = i;
    end = i + k - 1;
    if(i < zero && zero <= i + k ){
      time =  - x[start] + x[end];
      if(abs(x[start]) < abs(x[end])){
        time += abs(x[start]);
      }
      else{
        time += abs(x[end]);
      }
    }
    else if(i < zero){
      time = abs(x[start]);
    }
    
    else if(i >= zero){
      time = abs(x[end]);
    }
    //printf("%lld\n",time);
    if(min > time){
      min = time;
    }
  }

  printf("%lld\n",min);

  return 0;
}
5 3
-30 -10 10 20 50

40

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>

long long abs(long long a){
  if(a >= 0){
    return a;
  }
  else{
    return -a;
  }
}

int main(void){
  int n , k;
  scanf("%d %d",&n ,&k);

  long long x[n];
  int zero = -1;
  for(int i = 0;i < n;i ++){
    scanf("%lld",&x[i]);
    if(x[i-1] < 0 && x[i] >= 0){
      zero = i;
    }
  }
  
  if(zero == -1){
    if(x[n-1] < 0){
      zero = n;
    }
    else{
      zero = 0;
    }
  }

  int start , end;
  long long time , min = 1000000000000;
  for(int i = 0;i < n - k + 1;i ++){
    start = i;
    end = i + k - 1;
    if(i < zero && zero <= i + k ){
      time =  - x[start] + x[end];
      if(abs(x[start]) < abs(x[end])){
        time += abs(x[start]);
      }
      else{
        time += abs(x[end]);
      }
    }
    else if(i < zero){
      time = abs(x[start]);
    }
    
    else if(i >= zero){
      time = abs(x[end]);
    }
    //printf("%lld\n",time);
    if(min > time){
      min = time;
    }
  }

  printf("%lld\n",min);

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	abs
	.type	abs, @function
abs:
.LFB0:
	.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)
	cmpq	$0, -8(%rbp)
	js	.L2
	movq	-8(%rbp), %rax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	negq	%rax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	%r12
	pushq	%rbx
	subq	$96, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movl	$-1, -92(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L8
.L10:
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L9
	movq	-48(%rbp), %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	js	.L9
	movl	-88(%rbp), %eax
	movl	%eax, -92(%rbp)
.L9:
	addl	$1, -88(%rbp)
.L8:
	movl	-100(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L10
	cmpl	$-1, -92(%rbp)
	jne	.L11
	movl	-100(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L12
	movl	-100(%rbp), %eax
	movl	%eax, -92(%rbp)
	jmp	.L11
.L12:
	movl	$0, -92(%rbp)
.L11:
	movabsq	$1000000000000, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L13
.L20:
	movl	-84(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	-96(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -76(%rbp)
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jge	.L14
	movl	-96(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -92(%rbp)
	jg	.L14
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -72(%rbp)
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, %rbx
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	cmpq	%rax, %rbx
	jge	.L15
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	addq	%rax, -72(%rbp)
	jmp	.L17
.L15:
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	addq	%rax, -72(%rbp)
	jmp	.L17
.L14:
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jge	.L18
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, -72(%rbp)
	jmp	.L17
.L18:
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L17
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, -72(%rbp)
.L17:
	movq	-64(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jle	.L19
	movq	-72(%rbp), %rax
	movq	%rax, -64(%rbp)
.L19:
	addl	$1, -84(%rbp)
.L13:
	movl	-100(%rbp), %eax
	movl	-96(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -84(%rbp)
	jle	.L20
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	abs
	.type	abs, @function
abs:
.LFB0:
	.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)
	cmpq	$0, -8(%rbp)
	js	.L2
	movq	-8(%rbp), %rax
	jmp	.L3
.L2:
	movq	-8(%rbp), %rax
	negq	%rax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	abs, .-abs
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	%r12
	pushq	%rbx
	subq	$96, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %r12
	leaq	-96(%rbp), %rdx
	leaq	-100(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-100(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -56(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %ebx
	movl	$0, %edx
	divq	%rbx
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -48(%rbp)
	movl	$-1, -92(%rbp)
	movl	$0, -88(%rbp)
	jmp	.L8
.L10:
	movl	-88(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-48(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L9
	movq	-48(%rbp), %rax
	movl	-88(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	js	.L9
	movl	-88(%rbp), %eax
	movl	%eax, -92(%rbp)
.L9:
	addl	$1, -88(%rbp)
.L8:
	movl	-100(%rbp), %eax
	cmpl	%eax, -88(%rbp)
	jl	.L10
	cmpl	$-1, -92(%rbp)
	jne	.L11
	movl	-100(%rbp), %eax
	leal	-1(%rax), %edx
	movq	-48(%rbp), %rax
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jns	.L12
	movl	-100(%rbp), %eax
	movl	%eax, -92(%rbp)
	jmp	.L11
.L12:
	movl	$0, -92(%rbp)
.L11:
	movabsq	$1000000000000, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -84(%rbp)
	jmp	.L13
.L20:
	movl	-84(%rbp), %eax
	movl	%eax, -80(%rbp)
	movl	-96(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -76(%rbp)
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jge	.L14
	movl	-96(%rbp), %edx
	movl	-84(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, -92(%rbp)
	jg	.L14
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -72(%rbp)
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, %rbx
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	cmpq	%rax, %rbx
	jge	.L15
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	addq	%rax, -72(%rbp)
	jmp	.L17
.L15:
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	addq	%rax, -72(%rbp)
	jmp	.L17
.L14:
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jge	.L18
	movq	-48(%rbp), %rax
	movl	-80(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, -72(%rbp)
	jmp	.L17
.L18:
	movl	-84(%rbp), %eax
	cmpl	-92(%rbp), %eax
	jl	.L17
	movq	-48(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	abs
	movq	%rax, -72(%rbp)
.L17:
	movq	-64(%rbp), %rax
	cmpq	-72(%rbp), %rax
	jle	.L19
	movq	-72(%rbp), %rax
	movq	%rax, -64(%rbp)
.L19:
	addl	$1, -84(%rbp)
.L13:
	movl	-100(%rbp), %eax
	movl	-96(%rbp), %edx
	subl	%edx, %eax
	cmpl	%eax, -84(%rbp)
	jle	.L20
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%r12, %rsp
	movq	-40(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leaq	-32(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
