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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int max(int a, int b){
    if(a > b){
        return a;
    }else{
        return b;
    }
}

int main(void){

    int N, Z, W;

    scanf("%d%d%d", &N, &Z, &W);

    int a[N];

    for(int i = 0; i < N; i++){
        scanf("%d", &a[i]);
    }

    if(N == 1){
        printf("%d\n", abs(a[0] - W));
    }else{
        printf("%d\n", max(abs(a[N-1] - W), abs(a[N-1] - a[N-2])));
    }

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$40, %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	-68(%rbp), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rax
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L5
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L18
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L19
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %r15
	andq	$-4, %r14
	shrq	$2, %r15
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	movl	-60(%rbp), %esi
	cmpl	$1, %eax
	je	.L20
.L9:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movslq	%edx, %rdx
	cltq
	movl	(%r14,%rdx,4), %ecx
	movl	%ecx, %edi
	subl	(%r14,%rax,4), %edi
	movl	%ecx, %eax
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	$1, %edi
	movl	%eax, %ecx
	leaq	.LC2(%rip), %rsi
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L20:
	.cfi_restore_state
	movl	0(,%r15,4), %eax
	movl	$1, %edi
	subl	%esi, %eax
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L19:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L7:
	movl	-60(%rbp), %esi
	jmp	.L9
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$40, %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	-68(%rbp), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rax
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L5
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L18
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L19
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %r15
	andq	$-4, %r14
	shrq	$2, %r15
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	movl	-60(%rbp), %esi
	cmpl	$1, %eax
	je	.L20
.L9:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movslq	%edx, %rdx
	cltq
	movl	(%r14,%rdx,4), %ecx
	movl	%ecx, %edi
	subl	(%r14,%rax,4), %edi
	movl	%ecx, %eax
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	$1, %edi
	movl	%eax, %ecx
	leaq	.LC2(%rip), %rsi
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L20:
	.cfi_restore_state
	movl	0(,%r15,4), %eax
	movl	$1, %edi
	subl	%esi, %eax
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L19:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L7:
	movl	-60(%rbp), %esi
	jmp	.L9
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$40, %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	-68(%rbp), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rax
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L5
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L18
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L19
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %r15
	andq	$-4, %r14
	shrq	$2, %r15
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	movl	-60(%rbp), %esi
	cmpl	$1, %eax
	je	.L20
.L9:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movslq	%edx, %rdx
	cltq
	movl	(%r14,%rdx,4), %ecx
	movl	%ecx, %edi
	subl	(%r14,%rax,4), %edi
	movl	%ecx, %eax
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	$1, %edi
	movl	%eax, %ecx
	leaq	.LC2(%rip), %rsi
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L20:
	.cfi_restore_state
	movl	0(,%r15,4), %eax
	movl	$1, %edi
	subl	%esi, %eax
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L19:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L7:
	movl	-60(%rbp), %esi
	jmp	.L9
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```
```c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int max(int a, int b){
    if(a > b){
        return a;
    }else{
        return b;
    }
}

int main(void){

    int N, Z, W;

    scanf("%d%d%d", &N, &Z, &W);

    int a[N];

    for(int i = 0; i < N; i++){
        scanf("%d", &a[i]);
    }

    if(N == 1){
        printf("%d\n", abs(a[0] - W));
    }else{
        printf("%d\n", max(abs(a[N-1] - W), abs(a[N-1] - a[N-2])));
    }

    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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int max(int a, int b){
    if(a > b){
        return a;
    }else{
        return b;
    }
}

int main(void){

    int N, Z, W;

    scanf("%d%d%d", &N, &Z, &W);

    int a[N];

    for(int i = 0; i < N; i++){
        scanf("%d", &a[i]);
    }

    if(N == 1){
        printf("%d\n", abs(a[0] - W));
    }else{
        printf("%d\n", max(abs(a[N-1] - W), abs(a[N-1] - a[N-2])));
    }

    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 100 100
10 1000 100

900

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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int max(int a, int b){
    if(a > b){
        return a;
    }else{
        return b;
    }
}

int main(void){

    int N, Z, W;

    scanf("%d%d%d", &N, &Z, &W);

    int a[N];

    for(int i = 0; i < N; i++){
        scanf("%d", &a[i]);
    }

    if(N == 1){
        printf("%d\n", abs(a[0] - W));
    }else{
        printf("%d\n", max(abs(a[N-1] - W), abs(a[N-1] - a[N-2])));
    }

    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$40, %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	-68(%rbp), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rax
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L5
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L18
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L19
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %r15
	andq	$-4, %r14
	shrq	$2, %r15
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	movl	-60(%rbp), %esi
	cmpl	$1, %eax
	je	.L20
.L9:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movslq	%edx, %rdx
	cltq
	movl	(%r14,%rdx,4), %ecx
	movl	%ecx, %edi
	subl	(%r14,%rax,4), %edi
	movl	%ecx, %eax
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	$1, %edi
	movl	%eax, %ecx
	leaq	.LC2(%rip), %rsi
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L20:
	.cfi_restore_state
	movl	0(,%r15,4), %eax
	movl	$1, %edi
	subl	%esi, %eax
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L19:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L7:
	movl	-60(%rbp), %esi
	jmp	.L9
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB51:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE51:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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), %rcx
	leaq	-64(%rbp), %rdx
	pushq	%r13
	leaq	-68(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$40, %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	-68(%rbp), %rdx
	movq	%rsp, %rsi
	movq	%rdx, %rax
	leaq	15(,%rdx,4), %rdx
	movq	%rdx, %rcx
	andq	$-4096, %rdx
	subq	%rdx, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L5
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L18
.L5:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L19
.L6:
	leaq	3(%rsp), %r14
	movq	%r14, %r15
	andq	$-4, %r14
	shrq	$2, %r15
	testl	%eax, %eax
	jle	.L7
	movq	%r14, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-68(%rbp), %eax
	addq	$4, %r12
	cmpl	%ebx, %eax
	jg	.L8
	movl	-60(%rbp), %esi
	cmpl	$1, %eax
	je	.L20
.L9:
	leal	-1(%rax), %edx
	subl	$2, %eax
	movslq	%edx, %rdx
	cltq
	movl	(%r14,%rdx,4), %ecx
	movl	%ecx, %edi
	subl	(%r14,%rax,4), %edi
	movl	%ecx, %eax
	movl	%edi, %edx
	negl	%edx
	cmovs	%edi, %edx
	subl	%esi, %eax
	movl	$1, %edi
	movl	%eax, %ecx
	leaq	.LC2(%rip), %rsi
	negl	%ecx
	cmovns	%ecx, %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L10:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L21
	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
.L20:
	.cfi_restore_state
	movl	0(,%r15,4), %eax
	movl	$1, %edi
	subl	%esi, %eax
	leaq	.LC2(%rip), %rsi
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
.L19:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L6
.L7:
	movl	-60(%rbp), %esi
	jmp	.L9
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```