Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

int N;
int W[128];

int mikisinn[128];

int main(void) {
	int i;
	int asumikana = 999999999;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &W[i]) != 1) return 1;
		mikisinn[i] = mikisinn[i - 1] + W[i];
	}
	for (i = 1; i < N; i++) {
		int mizuhasu = abs((mikisinn[i] - mikisinn[0]) - (mikisinn[N] - mikisinn[i]));
		if (mizuhasu < asumikana) asumikana = mizuhasu;
	}
	printf("%d\n", asumikana);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L5
	cmpl	$0, N(%rip)
	jle	.L12
	leaq	mikisinn(%rip), %r13
	leaq	4+W(%rip), %rbp
	movl	$1, %ebx
	leaq	-4(%r13), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	movl	0(%rbp), %edx
	addl	(%r14,%rbx,4), %edx
	addq	$4, %rbp
	movl	%edx, 0(%r13,%rbx,4)
	movl	N(%rip), %edx
	addq	$1, %rbx
	cmpl	%ebx, %edx
	jl	.L18
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
.L5:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$1, %edx
	jle	.L12
	movslq	%edx, %rcx
	movl	0(%r13), %edi
	leal	-1(%rdx), %r9d
	movl	0(%r13,%rcx,4), %esi
	leal	-2(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L13
	movl	%r9d, %ecx
	leaq	4+mikisinn(%rip), %rax
	movd	%edi, %xmm6
	movdqa	.LC0(%rip), %xmm1
	movd	%esi, %xmm7
	shrl	$2, %ecx
	leaq	16(%rax), %r8
	pshufd	$0, %xmm6, %xmm4
	subl	$1, %ecx
	pshufd	$0, %xmm7, %xmm3
	salq	$4, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	psubd	%xmm5, %xmm2
	psubd	%xmm4, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm0
	leal	1(%rcx), %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %r8d
	cmpl	%r9d, %ecx
	je	.L4
.L7:
	movslq	%eax, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L4
	movslq	%ecx, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	addl	$2, %eax
	cmpl	%eax, %edx
	jle	.L4
	cltq
	movl	0(%r13,%rax,4), %edx
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%edi, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
.L4:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
.L12:
	movl	$999999999, %r8d
	jmp	.L4
.L13:
	movl	$999999999, %r8d
	jmp	.L7
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	mikisinn
	.bss
	.align 32
	.type	mikisinn, @object
	.size	mikisinn, 512
mikisinn:
	.zero	512
	.globl	W
	.align 32
	.type	W, @object
	.size	W, 512
W:
	.zero	512
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999999
	.long	999999999
	.long	999999999
	.long	999999999
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L5
	cmpl	$0, N(%rip)
	jle	.L12
	leaq	mikisinn(%rip), %r13
	leaq	4+W(%rip), %rbp
	movl	$1, %ebx
	leaq	-4(%r13), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	movl	0(%rbp), %edx
	addl	(%r14,%rbx,4), %edx
	addq	$4, %rbp
	movl	%edx, 0(%r13,%rbx,4)
	movl	N(%rip), %edx
	addq	$1, %rbx
	cmpl	%ebx, %edx
	jl	.L18
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
.L5:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$1, %edx
	jle	.L12
	movslq	%edx, %rcx
	movl	0(%r13), %edi
	leal	-1(%rdx), %r9d
	movl	0(%r13,%rcx,4), %esi
	leal	-2(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L13
	movl	%r9d, %ecx
	leaq	4+mikisinn(%rip), %rax
	movd	%edi, %xmm6
	movdqa	.LC0(%rip), %xmm1
	movd	%esi, %xmm7
	shrl	$2, %ecx
	leaq	16(%rax), %r8
	pshufd	$0, %xmm6, %xmm4
	subl	$1, %ecx
	pshufd	$0, %xmm7, %xmm3
	salq	$4, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	psubd	%xmm5, %xmm2
	psubd	%xmm4, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm0
	leal	1(%rcx), %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %r8d
	cmpl	%r9d, %ecx
	je	.L4
.L7:
	movslq	%eax, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L4
	movslq	%ecx, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	addl	$2, %eax
	cmpl	%eax, %edx
	jle	.L4
	cltq
	movl	0(%r13,%rax,4), %edx
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%edi, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
.L4:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
.L12:
	movl	$999999999, %r8d
	jmp	.L4
.L13:
	movl	$999999999, %r8d
	jmp	.L7
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	mikisinn
	.bss
	.align 32
	.type	mikisinn, @object
	.size	mikisinn, 512
mikisinn:
	.zero	512
	.globl	W
	.align 32
	.type	W, @object
	.size	W, 512
W:
	.zero	512
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999999
	.long	999999999
	.long	999999999
	.long	999999999
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L5
	cmpl	$0, N(%rip)
	jle	.L12
	leaq	mikisinn(%rip), %r13
	leaq	4+W(%rip), %rbp
	movl	$1, %ebx
	leaq	-4(%r13), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	movl	0(%rbp), %edx
	addl	(%r14,%rbx,4), %edx
	addq	$4, %rbp
	movl	%edx, 0(%r13,%rbx,4)
	movl	N(%rip), %edx
	addq	$1, %rbx
	cmpl	%ebx, %edx
	jl	.L18
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
.L5:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$1, %edx
	jle	.L12
	movslq	%edx, %rcx
	movl	0(%r13), %edi
	leal	-1(%rdx), %r9d
	movl	0(%r13,%rcx,4), %esi
	leal	-2(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L13
	movl	%r9d, %ecx
	leaq	4+mikisinn(%rip), %rax
	movd	%edi, %xmm6
	movdqa	.LC0(%rip), %xmm1
	movd	%esi, %xmm7
	shrl	$2, %ecx
	leaq	16(%rax), %r8
	pshufd	$0, %xmm6, %xmm4
	subl	$1, %ecx
	pshufd	$0, %xmm7, %xmm3
	salq	$4, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	psubd	%xmm5, %xmm2
	psubd	%xmm4, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm0
	leal	1(%rcx), %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %r8d
	cmpl	%r9d, %ecx
	je	.L4
.L7:
	movslq	%eax, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L4
	movslq	%ecx, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	addl	$2, %eax
	cmpl	%eax, %edx
	jle	.L4
	cltq
	movl	0(%r13,%rax,4), %edx
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%edi, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
.L4:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
.L12:
	movl	$999999999, %r8d
	jmp	.L4
.L13:
	movl	$999999999, %r8d
	jmp	.L7
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	mikisinn
	.bss
	.align 32
	.type	mikisinn, @object
	.size	mikisinn, 512
mikisinn:
	.zero	512
	.globl	W
	.align 32
	.type	W, @object
	.size	W, 512
W:
	.zero	512
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999999
	.long	999999999
	.long	999999999
	.long	999999999
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <stdio.h>
#include <stdlib.h>

int N;
int W[128];

int mikisinn[128];

int main(void) {
	int i;
	int asumikana = 999999999;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &W[i]) != 1) return 1;
		mikisinn[i] = mikisinn[i - 1] + W[i];
	}
	for (i = 1; i < N; i++) {
		int mizuhasu = abs((mikisinn[i] - mikisinn[0]) - (mikisinn[N] - mikisinn[i]));
		if (mizuhasu < asumikana) asumikana = mizuhasu;
	}
	printf("%d\n", asumikana);
	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

int N;
int W[128];

int mikisinn[128];

int main(void) {
	int i;
	int asumikana = 999999999;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &W[i]) != 1) return 1;
		mikisinn[i] = mikisinn[i - 1] + W[i];
	}
	for (i = 1; i < N; i++) {
		int mizuhasu = abs((mikisinn[i] - mikisinn[0]) - (mikisinn[N] - mikisinn[i]));
		if (mizuhasu < asumikana) asumikana = mizuhasu;
	}
	printf("%d\n", asumikana);
	return 0;
}
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

3
1 2 2
 4
2 3 1 1
 8
27 23 76 2 3 5 62 14
 3
1 1 2
 4
2 3 1 0
 8
27 30 76 2 3 5 62 14
 8
27 30 76 2 3 5 62 5
 8
27 30 76 2 3 2 62 5
 8
27 30 76 2 3 2 102 5
 8
27 30 99 2 3 2 102 5

1
 3
 40
 0
 2
 47
 56
 59
 19
 42

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

int N;
int W[128];

int mikisinn[128];

int main(void) {
	int i;
	int asumikana = 999999999;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 1; i <= N; i++) {
		if (scanf("%d", &W[i]) != 1) return 1;
		mikisinn[i] = mikisinn[i - 1] + W[i];
	}
	for (i = 1; i < N; i++) {
		int mizuhasu = abs((mikisinn[i] - mikisinn[0]) - (mikisinn[N] - mikisinn[i]));
		if (mizuhasu < asumikana) asumikana = mizuhasu;
	}
	printf("%d\n", asumikana);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L5
	cmpl	$0, N(%rip)
	jle	.L12
	leaq	mikisinn(%rip), %r13
	leaq	4+W(%rip), %rbp
	movl	$1, %ebx
	leaq	-4(%r13), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	movl	0(%rbp), %edx
	addl	(%r14,%rbx,4), %edx
	addq	$4, %rbp
	movl	%edx, 0(%r13,%rbx,4)
	movl	N(%rip), %edx
	addq	$1, %rbx
	cmpl	%ebx, %edx
	jl	.L18
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
.L5:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$1, %edx
	jle	.L12
	movslq	%edx, %rcx
	movl	0(%r13), %edi
	leal	-1(%rdx), %r9d
	movl	0(%r13,%rcx,4), %esi
	leal	-2(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L13
	movl	%r9d, %ecx
	leaq	4+mikisinn(%rip), %rax
	movd	%edi, %xmm6
	movdqa	.LC0(%rip), %xmm1
	movd	%esi, %xmm7
	shrl	$2, %ecx
	leaq	16(%rax), %r8
	pshufd	$0, %xmm6, %xmm4
	subl	$1, %ecx
	pshufd	$0, %xmm7, %xmm3
	salq	$4, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	psubd	%xmm5, %xmm2
	psubd	%xmm4, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm0
	leal	1(%rcx), %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %r8d
	cmpl	%r9d, %ecx
	je	.L4
.L7:
	movslq	%eax, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L4
	movslq	%ecx, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	addl	$2, %eax
	cmpl	%eax, %edx
	jle	.L4
	cltq
	movl	0(%r13,%rax,4), %edx
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%edi, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
.L4:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
.L12:
	movl	$999999999, %r8d
	jmp	.L4
.L13:
	movl	$999999999, %r8d
	jmp	.L7
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	mikisinn
	.bss
	.align 32
	.type	mikisinn, @object
	.size	mikisinn, 512
mikisinn:
	.zero	512
	.globl	W
	.align 32
	.type	W, @object
	.size	W, 512
W:
	.zero	512
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999999
	.long	999999999
	.long	999999999
	.long	999999999
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC1(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L5
	cmpl	$0, N(%rip)
	jle	.L12
	leaq	mikisinn(%rip), %r13
	leaq	4+W(%rip), %rbp
	movl	$1, %ebx
	leaq	-4(%r13), %r14
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L19:
	movl	0(%rbp), %edx
	addl	(%r14,%rbx,4), %edx
	addq	$4, %rbp
	movl	%edx, 0(%r13,%rbx,4)
	movl	N(%rip), %edx
	addq	$1, %rbx
	cmpl	%ebx, %edx
	jl	.L18
.L6:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L19
.L5:
	movl	$1, %eax
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L18:
	.cfi_restore_state
	cmpl	$1, %edx
	jle	.L12
	movslq	%edx, %rcx
	movl	0(%r13), %edi
	leal	-1(%rdx), %r9d
	movl	0(%r13,%rcx,4), %esi
	leal	-2(%rdx), %ecx
	cmpl	$2, %ecx
	jbe	.L13
	movl	%r9d, %ecx
	leaq	4+mikisinn(%rip), %rax
	movd	%edi, %xmm6
	movdqa	.LC0(%rip), %xmm1
	movd	%esi, %xmm7
	shrl	$2, %ecx
	leaq	16(%rax), %r8
	pshufd	$0, %xmm6, %xmm4
	subl	$1, %ecx
	pshufd	$0, %xmm7, %xmm3
	salq	$4, %rcx
	addq	%r8, %rcx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqu	(%rax), %xmm0
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm2
	addq	$16, %rax
	psubd	%xmm5, %xmm2
	psubd	%xmm4, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrad	$31, %xmm2
	pxor	%xmm2, %xmm0
	psubd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	pcmpgtd	%xmm1, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	por	%xmm2, %xmm1
	cmpq	%rcx, %rax
	jne	.L8
	movdqa	%xmm1, %xmm2
	movl	%r9d, %ecx
	psrldq	$8, %xmm2
	andl	$-4, %ecx
	movdqa	%xmm2, %xmm0
	leal	1(%rcx), %eax
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %r8d
	cmpl	%r9d, %ecx
	je	.L4
.L7:
	movslq	%eax, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L4
	movslq	%ecx, %rcx
	movl	%esi, %r10d
	movl	0(%r13,%rcx,4), %r9d
	movl	%r9d, %ecx
	subl	%r9d, %r10d
	subl	%edi, %ecx
	subl	%r10d, %ecx
	movl	%ecx, %r9d
	negl	%r9d
	cmovns	%r9d, %ecx
	cmpl	%ecx, %r8d
	cmovg	%ecx, %r8d
	addl	$2, %eax
	cmpl	%eax, %edx
	jle	.L4
	cltq
	movl	0(%r13,%rax,4), %edx
	movl	%edx, %eax
	subl	%edx, %esi
	subl	%edi, %eax
	subl	%esi, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	cmpl	%eax, %r8d
	cmovg	%eax, %r8d
.L4:
	movl	%r8d, %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L1
.L12:
	movl	$999999999, %r8d
	jmp	.L4
.L13:
	movl	$999999999, %r8d
	jmp	.L7
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	mikisinn
	.bss
	.align 32
	.type	mikisinn, @object
	.size	mikisinn, 512
mikisinn:
	.zero	512
	.globl	W
	.align 32
	.type	W, @object
	.size	W, 512
W:
	.zero	512
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	999999999
	.long	999999999
	.long	999999999
	.long	999999999
	.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:
```