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

uint64_t isihasu(uint64_t a, uint64_t b) {
	return a <= b ? b - a : a - b;
}

int N;
uint64_t A[271828];

int main(void) {
	int i;
	uint64_t zensum = 0, sum = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%" SCNu64, &A[i]) != 1) return 1;
		zensum += A[i];
	}
	for (i = 0; i < N; i++) {
		sum += A[i];
		if (sum * 2 == zensum) {
			puts("0");
			return 0;
		} else if (sum * 2 > zensum) {
			uint64_t left = sum - A[i];
			uint64_t right = zensum - sum;
			uint64_t middle = A[i];
			uint64_t c1 = isihasu(left + middle, right);
			uint64_t c2 = isihasu(left, middle + right);
			printf("%" PRIu64 "\n", c1 <= c2 ? c1 : c2);
			return 0;
		}
	}
	puts("error!");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	isihasu
	.type	isihasu, @function
isihasu:
.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)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	ja	.L2
	movq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
	subq	-16(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isihasu, .-isihasu
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 2174624
A:
	.zero	2174624
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu"
.LC2:
	.string	"0"
.LC3:
	.string	"%lu\n"
.LC4:
	.string	"error!"
	.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
	subq	$64, %rsp
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, -60(%rbp)
	jmp	.L8
.L10:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L7
.L9:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	addl	$1, -60(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L10
	movl	$0, -60(%rbp)
	jmp	.L11
.L14:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	cmpq	%rax, -56(%rbp)
	jne	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L7
.L12:
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	cmpq	%rax, -56(%rbp)
	jnb	.L13
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-48(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	subq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	isihasu
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isihasu
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	cmovbe	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L7
.L13:
	addl	$1, -60(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L14
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L7:
	leave
	.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	isihasu
	.type	isihasu, @function
isihasu:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rax
	subq	%rdi, %rdx
	subq	%rsi, %rax
	cmpq	%rsi, %rdi
	cmovbe	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	isihasu, .-isihasu
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"error!"
.LC2:
	.string	"%lu"
.LC3:
	.string	"0"
.LC4:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L9
	cmpl	$0, N(%rip)
	jle	.L11
	leaq	A(%rip), %rbx
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L28:
	movq	(%rbx), %rax
	movl	N(%rip), %edx
	addl	$1, %ebp
	addq	$8, %rbx
	addq	%r12, %rax
	movq	%rax, %r12
	cmpl	%ebp, %edx
	jle	.L27
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L28
.L9:
	movl	$1, %eax
.L5:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	testl	%edx, %edx
	jle	.L11
	movq	A(%rip), %rdi
	leaq	(%rdi,%rdi), %rcx
	cmpq	%rax, %rcx
	je	.L12
	ja	.L29
	leaq	8+A(%rip), %rcx
	subl	$1, %edx
	movq	%rdi, %r8
	leaq	(%rcx,%rdx,8), %r9
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rcx), %rdi
	leaq	(%rdi,%r8), %rdx
	leaq	(%rdx,%rdx), %rsi
	cmpq	%rax, %rsi
	je	.L12
	addq	$8, %rcx
	cmpq	%rax, %rsi
	ja	.L13
	movq	%rdx, %r8
.L16:
	cmpq	%r9, %rcx
	jne	.L21
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L5
.L12:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L5
.L29:
	movq	%rdi, %rdx
	xorl	%r8d, %r8d
.L13:
	movq	%rax, %rcx
	subq	%rdx, %rcx
	cmpq	%rdx, %rcx
	jnb	.L30
	leaq	(%rdx,%rdx), %rsi
	subq	%rax, %rsi
.L18:
	leaq	(%rcx,%rdi), %rax
	movq	%r8, %rdx
	subq	%rax, %rdx
	cmpq	%r8, %rax
	jb	.L20
	subq	%r8, %rax
	movq	%rax, %rdx
.L20:
	cmpq	%rsi, %rdx
	movl	$1, %edi
	cmova	%rsi, %rdx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L5
.L30:
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	jmp	.L18
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 2174624
A:
	.zero	2174624
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	isihasu
	.type	isihasu, @function
isihasu:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rsi, %rdx
	movq	%rdi, %rax
	subq	%rdi, %rdx
	subq	%rsi, %rax
	cmpq	%rsi, %rdi
	cmovbe	%rdx, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	isihasu, .-isihasu
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"error!"
.LC2:
	.string	"%lu"
.LC3:
	.string	"0"
.LC4:
	.string	"%lu\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	xorl	%eax, %eax
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L9
	cmpl	$0, N(%rip)
	jle	.L11
	leaq	A(%rip), %rbx
	xorl	%r12d, %r12d
	xorl	%ebp, %ebp
	leaq	.LC2(%rip), %r13
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L28:
	movq	(%rbx), %rax
	movl	N(%rip), %edx
	addl	$1, %ebp
	addq	$8, %rbx
	addq	%r12, %rax
	movq	%rax, %r12
	cmpl	%ebp, %edx
	jle	.L27
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L28
.L9:
	movl	$1, %eax
.L5:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	testl	%edx, %edx
	jle	.L11
	movq	A(%rip), %rdi
	leaq	(%rdi,%rdi), %rcx
	cmpq	%rax, %rcx
	je	.L12
	ja	.L29
	leaq	8+A(%rip), %rcx
	subl	$1, %edx
	movq	%rdi, %r8
	leaq	(%rcx,%rdx,8), %r9
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L21:
	movq	(%rcx), %rdi
	leaq	(%rdi,%r8), %rdx
	leaq	(%rdx,%rdx), %rsi
	cmpq	%rax, %rsi
	je	.L12
	addq	$8, %rcx
	cmpq	%rax, %rsi
	ja	.L13
	movq	%rdx, %r8
.L16:
	cmpq	%r9, %rcx
	jne	.L21
.L11:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L5
.L12:
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
	xorl	%eax, %eax
	jmp	.L5
.L29:
	movq	%rdi, %rdx
	xorl	%r8d, %r8d
.L13:
	movq	%rax, %rcx
	subq	%rdx, %rcx
	cmpq	%rdx, %rcx
	jnb	.L30
	leaq	(%rdx,%rdx), %rsi
	subq	%rax, %rsi
.L18:
	leaq	(%rcx,%rdi), %rax
	movq	%r8, %rdx
	subq	%rax, %rdx
	cmpq	%r8, %rax
	jb	.L20
	subq	%r8, %rax
	movq	%rax, %rdx
.L20:
	cmpq	%rsi, %rdx
	movl	$1, %edi
	cmova	%rsi, %rdx
	leaq	.LC4(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	jmp	.L5
.L30:
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	jmp	.L18
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 2174624
A:
	.zero	2174624
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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 <inttypes.h>

uint64_t isihasu(uint64_t a, uint64_t b) {
	return a <= b ? b - a : a - b;
}

int N;
uint64_t A[271828];

int main(void) {
	int i;
	uint64_t zensum = 0, sum = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%" SCNu64, &A[i]) != 1) return 1;
		zensum += A[i];
	}
	for (i = 0; i < N; i++) {
		sum += A[i];
		if (sum * 2 == zensum) {
			puts("0");
			return 0;
		} else if (sum * 2 > zensum) {
			uint64_t left = sum - A[i];
			uint64_t right = zensum - sum;
			uint64_t middle = A[i];
			uint64_t c1 = isihasu(left + middle, right);
			uint64_t c2 = isihasu(left, middle + right);
			printf("%" PRIu64 "\n", c1 <= c2 ? c1 : c2);
			return 0;
		}
	}
	puts("error!");
	return 0;
}

3
2 5 3
 12
100 104 102 105 103 103 100 105 104 102 104 101
 3
2 8 3
 12
100 104 102 105 103 103 100 117 104 102 104 101
 3
2 8 2
 12
101 104 102 105 103 103 100 117 104 102 104 101
 12
101 104 102 105 103 103 100 117 104 102 104 111
 3
2 0 4
 12
101 104 102 187 103 103 100 117 104 102 104 111
 12
101 104 102 187 103 103 110 117 104 102 104 111

4
 1
 7
 11
 8
 10
 20
 2
 62
 52

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

uint64_t isihasu(uint64_t a, uint64_t b) {
	return a <= b ? b - a : a - b;
}

int N;
uint64_t A[271828];

int main(void) {
	int i;
	uint64_t zensum = 0, sum = 0;
	if (scanf("%d", &N) != 1) return 1;
	for (i = 0; i < N; i++) {
		if (scanf("%" SCNu64, &A[i]) != 1) return 1;
		zensum += A[i];
	}
	for (i = 0; i < N; i++) {
		sum += A[i];
		if (sum * 2 == zensum) {
			puts("0");
			return 0;
		} else if (sum * 2 > zensum) {
			uint64_t left = sum - A[i];
			uint64_t right = zensum - sum;
			uint64_t middle = A[i];
			uint64_t c1 = isihasu(left + middle, right);
			uint64_t c2 = isihasu(left, middle + right);
			printf("%" PRIu64 "\n", c1 <= c2 ? c1 : c2);
			return 0;
		}
	}
	puts("error!");
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	isihasu
	.type	isihasu, @function
isihasu:
.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)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	ja	.L2
	movq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
	subq	-16(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isihasu, .-isihasu
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 2174624
A:
	.zero	2174624
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu"
.LC2:
	.string	"0"
.LC3:
	.string	"%lu\n"
.LC4:
	.string	"error!"
	.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
	subq	$64, %rsp
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, -60(%rbp)
	jmp	.L8
.L10:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L7
.L9:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	addl	$1, -60(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L10
	movl	$0, -60(%rbp)
	jmp	.L11
.L14:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	cmpq	%rax, -56(%rbp)
	jne	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L7
.L12:
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	cmpq	%rax, -56(%rbp)
	jnb	.L13
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-48(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	subq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	isihasu
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isihasu
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	cmovbe	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L7
.L13:
	addl	$1, -60(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L14
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L7:
	leave
	.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	isihasu
	.type	isihasu, @function
isihasu:
.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)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	cmpq	-16(%rbp), %rax
	ja	.L2
	movq	-16(%rbp), %rax
	subq	-8(%rbp), %rax
	jmp	.L4
.L2:
	movq	-8(%rbp), %rax
	subq	-16(%rbp), %rax
.L4:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	isihasu, .-isihasu
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 2174624
A:
	.zero	2174624
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lu"
.LC2:
	.string	"0"
.LC3:
	.string	"%lu\n"
.LC4:
	.string	"error!"
	.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
	subq	$64, %rsp
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L6
	movl	$1, %eax
	jmp	.L7
.L6:
	movl	$0, -60(%rbp)
	jmp	.L8
.L10:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L9
	movl	$1, %eax
	jmp	.L7
.L9:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -56(%rbp)
	addl	$1, -60(%rbp)
.L8:
	movl	N(%rip), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L10
	movl	$0, -60(%rbp)
	jmp	.L11
.L14:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -48(%rbp)
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	cmpq	%rax, -56(%rbp)
	jne	.L12
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L7
.L12:
	movq	-48(%rbp), %rax
	addq	%rax, %rax
	cmpq	%rax, -56(%rbp)
	jnb	.L13
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-48(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	subq	-48(%rbp), %rax
	movq	%rax, -32(%rbp)
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	A(%rip), %rax
	movq	(%rdx,%rax), %rax
	movq	%rax, -24(%rbp)
	movq	-40(%rbp), %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movq	-32(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	isihasu
	movq	%rax, -16(%rbp)
	movq	-24(%rbp), %rdx
	movq	-32(%rbp), %rax
	addq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	isihasu
	movq	%rax, -8(%rbp)
	movq	-16(%rbp), %rdx
	movq	-8(%rbp), %rax
	cmpq	%rax, %rdx
	cmovbe	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L7
.L13:
	addl	$1, -60(%rbp)
.L11:
	movl	N(%rip), %eax
	cmpl	%eax, -60(%rbp)
	jl	.L14
	leaq	.LC4(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L7:
	leave
	.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:
