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>

int main(int argc, char** argv)
{
	int n;
	short a[100000+2]={0};
	int total = 0;
	int i;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%hd", a+(i+1));
		total += (a[i]>a[i+1]?a[i]-a[i+1]:a[i+1]-a[i]);
	}
	total += (a[n]>a[n+1]?a[n]-a[n+1]:a[n+1]-a[n]);
	for(i=0;i<n;++i){
		int x, y, z;
		x=(a[i+0]>a[i+1]?a[i+0]-a[i+1]:a[i+1]-a[i+0]);
		y=(a[i+1]>a[i+2]?a[i+1]-a[i+2]:a[i+2]-a[i+1]);
		z=(a[i+0]>a[i+2]?a[i+0]-a[i+2]:a[i+2]-a[i+0]);
		printf("%d\n", total - x - y + z);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%hd"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3456, %rsp
	movl	%edi, -200052(%rbp)
	movq	%rsi, -200064(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200016(%rbp), %rax
	movl	$200004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -200036(%rbp)
	leaq	-200040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -200032(%rbp)
	jmp	.L2
.L5:
	movl	-200032(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	(%rax,%rax), %rdx
	leaq	-200016(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L3
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L3:
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L4:
	addl	%eax, -200036(%rbp)
	addl	$1, -200032(%rbp)
.L2:
	movl	-200040(%rbp), %eax
	cmpl	%eax, -200032(%rbp)
	jl	.L5
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L6
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L7
.L6:
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	addl	%eax, -200036(%rbp)
	movl	$0, -200032(%rbp)
	jmp	.L8
.L15:
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L9
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L10
.L9:
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L10:
	movl	%eax, -200028(%rbp)
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L11
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L12
.L11:
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L12:
	movl	%eax, -200024(%rbp)
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L13
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L14
.L13:
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L14:
	movl	%eax, -200020(%rbp)
	movl	-200036(%rbp), %eax
	subl	-200028(%rbp), %eax
	subl	-200024(%rbp), %eax
	movl	%eax, %edx
	movl	-200020(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -200032(%rbp)
.L8:
	movl	-200040(%rbp), %eax
	cmpl	%eax, -200032(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC1:
	.string	"%hd"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196656
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200080
	movl	$200004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	leaq	18(%rsp), %r14
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movswl	-2(%r14), %edx
	movswl	(%r14), %eax
	cmpw	%ax, %dx
	jle	.L3
	subl	%eax, %edx
	movl	12(%rsp), %eax
	addq	$2, %r14
	addl	%edx, %ebx
	cmpl	%eax, %r12d
	jl	.L5
.L2:
	movslq	%eax, %rdx
	leaq	.LC2(%rip), %r12
	movswl	16(%rsp,%rdx,2), %esi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	movswl	16(%rsp,%rdx,2), %ebp
	movl	%esi, %edi
	movl	%ebp, %edx
	subl	%ebp, %edi
	subl	%esi, %ebp
	cmpw	%dx, %si
	cmovg	%edi, %ebp
	addl	%ebx, %ebp
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L8:
	movswl	0(%r13,%rbx,2), %edx
	movswl	2(%r13,%rbx,2), %ecx
	movl	%edx, %eax
	movl	%ecx, %edi
	movl	%ecx, %r11d
	subl	%ecx, %eax
	subl	%edx, %edi
	cmpw	%cx, %dx
	cmovg	%eax, %edi
	movswl	4(%r13,%rbx,2), %eax
	subl	%eax, %r11d
	movl	%eax, %esi
	movl	%eax, %r8d
	subl	%ecx, %esi
	cmpw	%ax, %cx
	movl	%r11d, %ecx
	cmovle	%esi, %ecx
	movl	%edx, %esi
	subl	%eax, %esi
	subl	%edx, %eax
	cmpw	%r8w, %dx
	movl	%ebp, %edx
	cmovg	%esi, %eax
	movq	%r12, %rsi
	addq	$1, %rbx
	subl	%edi, %edx
	movl	$1, %edi
	subl	%ecx, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L8
.L15:
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	subl	%edx, %eax
	addq	$2, %r14
	addl	%eax, %ebx
	movl	12(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L5
	jmp	.L2
.L17:
	xorl	%ebx, %ebx
	jmp	.L2
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
.LC1:
	.string	"%hd"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-196608(%rsp), %r11
	.cfi_def_cfa 11, 196656
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3424, %rsp
	.cfi_def_cfa_offset 200080
	movl	$200004, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 200024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L17
	leaq	18(%rsp), %r14
	xorl	%r12d, %r12d
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movswl	-2(%r14), %edx
	movswl	(%r14), %eax
	cmpw	%ax, %dx
	jle	.L3
	subl	%eax, %edx
	movl	12(%rsp), %eax
	addq	$2, %r14
	addl	%edx, %ebx
	cmpl	%eax, %r12d
	jl	.L5
.L2:
	movslq	%eax, %rdx
	leaq	.LC2(%rip), %r12
	movswl	16(%rsp,%rdx,2), %esi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	movswl	16(%rsp,%rdx,2), %ebp
	movl	%esi, %edi
	movl	%ebp, %edx
	subl	%ebp, %edi
	subl	%esi, %ebp
	cmpw	%dx, %si
	cmovg	%edi, %ebp
	addl	%ebx, %ebp
	xorl	%ebx, %ebx
	testl	%eax, %eax
	jle	.L15
	.p2align 4,,10
	.p2align 3
.L8:
	movswl	0(%r13,%rbx,2), %edx
	movswl	2(%r13,%rbx,2), %ecx
	movl	%edx, %eax
	movl	%ecx, %edi
	movl	%ecx, %r11d
	subl	%ecx, %eax
	subl	%edx, %edi
	cmpw	%cx, %dx
	cmovg	%eax, %edi
	movswl	4(%r13,%rbx,2), %eax
	subl	%eax, %r11d
	movl	%eax, %esi
	movl	%eax, %r8d
	subl	%ecx, %esi
	cmpw	%ax, %cx
	movl	%r11d, %ecx
	cmovle	%esi, %ecx
	movl	%edx, %esi
	subl	%eax, %esi
	subl	%edx, %eax
	cmpw	%r8w, %dx
	movl	%ebp, %edx
	cmovg	%esi, %eax
	movq	%r12, %rsi
	addq	$1, %rbx
	subl	%edi, %edx
	movl	$1, %edi
	subl	%ecx, %edx
	addl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jg	.L8
.L15:
	movq	200024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$200032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.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
	.p2align 4,,10
	.p2align 3
.L3:
	.cfi_restore_state
	subl	%edx, %eax
	addq	$2, %r14
	addl	%eax, %ebx
	movl	12(%rsp), %eax
	cmpl	%r12d, %eax
	jg	.L5
	jmp	.L2
.L17:
	xorl	%ebx, %ebx
	jmp	.L2
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main(int argc, char** argv)
{
	int n;
	short a[100000+2]={0};
	int total = 0;
	int i;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%hd", a+(i+1));
		total += (a[i]>a[i+1]?a[i]-a[i+1]:a[i+1]-a[i]);
	}
	total += (a[n]>a[n+1]?a[n]-a[n+1]:a[n+1]-a[n]);
	for(i=0;i<n;++i){
		int x, y, z;
		x=(a[i+0]>a[i+1]?a[i+0]-a[i+1]:a[i+1]-a[i+0]);
		y=(a[i+1]>a[i+2]?a[i+1]-a[i+2]:a[i+2]-a[i+1]);
		z=(a[i+0]>a[i+2]?a[i+0]-a[i+2]:a[i+2]-a[i+0]);
		printf("%d\n", total - x - y + z);
	}
	return 0;
}
6
-679 -3431 -3258 3095 -3291 -4462
 5
1 1 0 2 0
 3
2 5 -1
 6
-679 -3431 -3258 3095 -3291 -2101
 5
1 0 0 2 0
 3
2 5 -2
 6
-679 -3431 -3258 3095 -4122 -2101
 5
1 0 0 2 1
 3
3 5 -2
 6
-679 -52 -3258 3095 -4122 -2101

21976
21630
21976
9270
21976
19634
 6
6
4
2
6
 12
6
10
 19634
19288
19634
6928
17254
19634
 4
6
6
2
6
 14
8
10
 21296
20950
21296
8590
17254
21296
 4
6
6
4
6
 14
10
10
 20950
20950
15792
9498
18162
22204

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>

int main(int argc, char** argv)
{
	int n;
	short a[100000+2]={0};
	int total = 0;
	int i;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%hd", a+(i+1));
		total += (a[i]>a[i+1]?a[i]-a[i+1]:a[i+1]-a[i]);
	}
	total += (a[n]>a[n+1]?a[n]-a[n+1]:a[n+1]-a[n]);
	for(i=0;i<n;++i){
		int x, y, z;
		x=(a[i+0]>a[i+1]?a[i+0]-a[i+1]:a[i+1]-a[i+0]);
		y=(a[i+1]>a[i+2]?a[i+1]-a[i+2]:a[i+2]-a[i+1]);
		z=(a[i+0]>a[i+2]?a[i+0]-a[i+2]:a[i+2]-a[i+0]);
		printf("%d\n", total - x - y + z);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%hd"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3456, %rsp
	movl	%edi, -200052(%rbp)
	movq	%rsi, -200064(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200016(%rbp), %rax
	movl	$200004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -200036(%rbp)
	leaq	-200040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -200032(%rbp)
	jmp	.L2
.L5:
	movl	-200032(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	(%rax,%rax), %rdx
	leaq	-200016(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L3
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L3:
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L4:
	addl	%eax, -200036(%rbp)
	addl	$1, -200032(%rbp)
.L2:
	movl	-200040(%rbp), %eax
	cmpl	%eax, -200032(%rbp)
	jl	.L5
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L6
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L7
.L6:
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	addl	%eax, -200036(%rbp)
	movl	$0, -200032(%rbp)
	jmp	.L8
.L15:
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L9
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L10
.L9:
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L10:
	movl	%eax, -200028(%rbp)
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L11
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L12
.L11:
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L12:
	movl	%eax, -200024(%rbp)
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L13
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L14
.L13:
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L14:
	movl	%eax, -200020(%rbp)
	movl	-200036(%rbp), %eax
	subl	-200028(%rbp), %eax
	subl	-200024(%rbp), %eax
	movl	%eax, %edx
	movl	-200020(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -200032(%rbp)
.L8:
	movl	-200040(%rbp), %eax
	cmpl	%eax, -200032(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC1:
	.string	"%hd"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-196608(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3456, %rsp
	movl	%edi, -200052(%rbp)
	movq	%rsi, -200064(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-200016(%rbp), %rax
	movl	$200004, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -200036(%rbp)
	leaq	-200040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -200032(%rbp)
	jmp	.L2
.L5:
	movl	-200032(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	(%rax,%rax), %rdx
	leaq	-200016(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L3
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L4
.L3:
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L4:
	addl	%eax, -200036(%rbp)
	addl	$1, -200032(%rbp)
.L2:
	movl	-200040(%rbp), %eax
	cmpl	%eax, -200032(%rbp)
	jl	.L5
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L6
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L7
.L6:
	movl	-200040(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200040(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L7:
	addl	%eax, -200036(%rbp)
	movl	$0, -200032(%rbp)
	jmp	.L8
.L15:
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L9
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L10
.L9:
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L10:
	movl	%eax, -200028(%rbp)
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L11
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L12
.L11:
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$1, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L12:
	movl	%eax, -200024(%rbp)
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	cmpw	%ax, %dx
	jle	.L13
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	jmp	.L14
.L13:
	movl	-200032(%rbp), %eax
	addl	$2, %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %edx
	movl	-200032(%rbp), %eax
	cltq
	movzwl	-200016(%rbp,%rax,2), %eax
	movswl	%ax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
.L14:
	movl	%eax, -200020(%rbp)
	movl	-200036(%rbp), %eax
	subl	-200028(%rbp), %eax
	subl	-200024(%rbp), %eax
	movl	%eax, %edx
	movl	-200020(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -200032(%rbp)
.L8:
	movl	-200040(%rbp), %eax
	cmpl	%eax, -200032(%rbp)
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
