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 <string.h>

int main() {
    int n = 0;
    scanf("%d\n", &n);
    int min_abs = 1000000001;
    long long int ans = 0;
    int count = 0;
    int buf = 0;
    for (int i=0; i<n; i++) {
        scanf("%d", &buf);
        if (buf < 0) count++;
        int ab = abs(buf);
        ans += ab;
        if (ab < min_abs) min_abs = ab;
    }
    if (count%2 == 1) ans -= 2*min_abs;
    printf("%lld\n", ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -40(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1000000001, -32(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -36(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L5:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jns	.L3
	addl	$1, -28(%rbp)
.L3:
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	addq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L4
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
.L4:
	addl	$1, -24(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L5
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L6
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	cltq
	subq	%rax, -16(%rbp)
.L6:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	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	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	movl	$0, (%rsp)
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	$0, 4(%rsp)
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movl	$1000000001, %r13d
	leaq	4(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	cmpl	$-2147483648, %edx
	movl	%edx, %eax
	sbbl	$-1, %ebx
	negl	%eax
	cmovs	%edx, %eax
	movslq	%eax, %rdx
	addq	%rdx, %r15
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	addl	$1, %r14d
	cmpl	%r14d, (%rsp)
	jg	.L4
	andl	$1, %ebx
	je	.L2
	addl	%r13d, %r13d
	movslq	%r13d, %r13
	subq	%r13, %r15
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$24, %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
.L6:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L2
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	movl	$0, (%rsp)
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	$0, 4(%rsp)
	testl	%eax, %eax
	jle	.L6
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	movl	$1000000001, %r13d
	leaq	4(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	cmpl	$-2147483648, %edx
	movl	%edx, %eax
	sbbl	$-1, %ebx
	negl	%eax
	cmovs	%edx, %eax
	movslq	%eax, %rdx
	addq	%rdx, %r15
	cmpl	%eax, %r13d
	cmovg	%eax, %r13d
	addl	$1, %r14d
	cmpl	%r14d, (%rsp)
	jg	.L4
	andl	$1, %ebx
	je	.L2
	addl	%r13d, %r13d
	movslq	%r13d, %r13
	subq	%r13, %r15
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$24, %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
.L6:
	.cfi_restore_state
	xorl	%r15d, %r15d
	jmp	.L2
.L13:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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>
#include <stdlib.h>
#include <string.h>

int main() {
    int n = 0;
    scanf("%d\n", &n);
    int min_abs = 1000000001;
    long long int ans = 0;
    int count = 0;
    int buf = 0;
    for (int i=0; i<n; i++) {
        scanf("%d", &buf);
        if (buf < 0) count++;
        int ab = abs(buf);
        ans += ab;
        if (ab < min_abs) min_abs = ab;
    }
    if (count%2 == 1) ans -= 2*min_abs;
    printf("%lld\n", ans);
    return 0;
}

11
-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000000
 5
10 -4 -8 -11 5
 3
-10 5 0
 11
-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000000 -1000000000 1000000100
 5
10 -4 -4 -11 5
 3
-14 5 0
 11
-1000000000 1000000000 -364513171 1000000000 -1000000000 0 1000000000 -1000000000 1000000100 -1000000000 1000000100
 5
10 -4 -4 -14 5
 3
-14 5 1
 11
-1000000000 1000000000 -364513171 1000000000 -1382285407 0 1000000000 -1000000000 1000000000 -1000000000 1000000100

9364513171
 30
 15
 9364513271
 26
 19
 9364513371
 29
 18
 9746798678

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 <string.h>

int main() {
    int n = 0;
    scanf("%d\n", &n);
    int min_abs = 1000000001;
    long long int ans = 0;
    int count = 0;
    int buf = 0;
    for (int i=0; i<n; i++) {
        scanf("%d", &buf);
        if (buf < 0) count++;
        int ab = abs(buf);
        ans += ab;
        if (ab < min_abs) min_abs = ab;
    }
    if (count%2 == 1) ans -= 2*min_abs;
    printf("%lld\n", ans);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -40(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1000000001, -32(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -36(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L5:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jns	.L3
	addl	$1, -28(%rbp)
.L3:
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	addq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L4
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
.L4:
	addl	$1, -24(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L5
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L6
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	cltq
	subq	%rax, -16(%rbp)
.L6:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	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	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -40(%rbp)
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1000000001, -32(%rbp)
	movq	$0, -16(%rbp)
	movl	$0, -28(%rbp)
	movl	$0, -36(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L2
.L5:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	jns	.L3
	addl	$1, -28(%rbp)
.L3:
	movl	-36(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-20(%rbp), %eax
	cltq
	addq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jge	.L4
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
.L4:
	addl	$1, -24(%rbp)
.L2:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L5
	movl	-28(%rbp), %eax
	cltd
	shrl	$31, %edx
	addl	%edx, %eax
	andl	$1, %eax
	subl	%edx, %eax
	cmpl	$1, %eax
	jne	.L6
	movl	-32(%rbp), %eax
	addl	%eax, %eax
	cltq
	subq	%rax, -16(%rbp)
.L6:
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	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	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
