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 find_min(int a[], int start, int end)
{
    int min = a[start];
    for(int i=start; i<=end; i++){
        if(a[i] <= min)
            min = a[i];
    }
    return min;
}

int find_max(int a[], int start, int end)
{
    int max = a[start];
    for(int i=start; i<=end; i++){
        if(a[i] >= max)
            max = a[i];
    }
    return max;
}

int max_of(int a, int b){
    return (a>=b) ? a:b;
}

int min_of(int a, int b){
    return (a<=b) ? a:b;
}

int find_max_diff(int a[], int start, int end, int left_min[], int right_max[])
{
    int i,j;
    int max = -1000000000;
    if((end - start) == 2){
        max = max_of(max_of(a[end-1]-a[end-2], a[end]-a[end-2]), a[end]-a[end-1]);
        left_min[end] = find_min(a, start, end);
        right_max[end] = find_max(a, start, end);
        return max;
    }
    else if((end-start)==1){
        if((a[end]-a[start]) <= 0){
            left_min[end] = a[end]; 
            right_max[end] = a[start];
        }
        else{
            left_min[end] = a[start]; 
            right_max[end] = a[end];
        }
        return a[end] - a[start];
    }
    else{
        int mid = (start+end)/2;
        int left_diff = find_max_diff(a, start, mid, left_min, right_max);
        int right_diff = find_max_diff(a, mid+1, end, left_min, right_max);
        int all_diff = right_max[end] - left_min[mid];
        right_max[end] = max_of(right_max[mid], right_max[end]);
        left_min[end] = min_of(left_min[mid], left_min[end]);
        return max_of(max_of(left_diff, right_diff), all_diff);
    }
}

int main(){
    
    int data_num, arr[250000];
    scanf("%d", &data_num);
    
    for(int i=0; i<data_num; i++){
        scanf("%d", &arr[i]);
    }

    int left_min[250000], right_max[250000];
    int ans = find_max_diff(arr, 0, data_num-1, left_min, right_max);
    printf("%d\n", ans);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	find_min
	.type	find_min, @function
find_min:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find_min, .-find_min
	.globl	find_max
	.type	find_max, @function
find_max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L8
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
.L8:
	addl	$1, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L9
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find_max, .-find_max
	.globl	max_of
	.type	max_of, @function
max_of:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	max_of, .-max_of
	.globl	min_of
	.type	min_of, @function
min_of:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	min_of, .-min_of
	.globl	find_max_diff
	.type	find_max_diff, @function
find_max_diff:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	%edx, -64(%rbp)
	movq	%rcx, -72(%rbp)
	movq	%r8, -80(%rbp)
	movl	$-1000000000, -36(%rbp)
	movl	-64(%rbp), %eax
	subl	-60(%rbp), %eax
	cmpl	$2, %eax
	jne	.L16
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	-4(%rdx), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	-8(%rdx), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	salq	$2, %rcx
	leaq	-8(%rcx), %rsi
	movq	-56(%rbp), %rcx
	addq	%rsi, %rcx
	movl	(%rcx), %ecx
	subl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%ebx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, -36(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-72(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find_min
	movl	%eax, (%rbx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find_max
	movl	%eax, (%rbx)
	movl	-36(%rbp), %eax
	jmp	.L17
.L16:
	movl	-64(%rbp), %eax
	subl	-60(%rbp), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jg	.L19
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-80(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L20
.L19:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-80(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
.L20:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	jmp	.L17
.L18:
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -32(%rbp)
	movq	-80(%rbp), %rdi
	movq	-72(%rbp), %rcx
	movl	-32(%rbp), %edx
	movl	-60(%rbp), %esi
	movq	-56(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movq	-80(%rbp), %rdi
	movq	-72(%rbp), %rcx
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -24(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	movq	-80(%rbp), %rcx
	leaq	(%rsi,%rcx), %rbx
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, (%rbx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	movq	-72(%rbp), %rcx
	leaq	(%rsi,%rcx), %rbx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min_of
	movl	%eax, (%rbx)
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	max_of
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	find_max_diff, .-find_max_diff
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2998272(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1760, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-3000028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3000024(%rbp)
	jmp	.L22
.L23:
	leaq	-3000016(%rbp), %rdx
	movl	-3000024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -3000024(%rbp)
.L22:
	movl	-3000028(%rbp), %eax
	cmpl	%eax, -3000024(%rbp)
	jl	.L23
	movl	-3000028(%rbp), %eax
	leal	-1(%rax), %esi
	leaq	-1000016(%rbp), %rcx
	leaq	-2000016(%rbp), %rdx
	leaq	-3000016(%rbp), %rax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%esi, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -3000020(%rbp)
	movl	-3000020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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	find_min
	.type	find_min, @function
find_min:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%esi, %r8
	movl	%edx, %esi
	leaq	(%rdi,%r8,4), %rdx
	movq	%r8, %rcx
	movl	(%rdx), %eax
	cmpl	%esi, %r8d
	jg	.L1
	movl	%esi, %r10d
	subl	%r8d, %r10d
	leal	1(%r10), %r9d
	cmpl	$2, %r10d
	jbe	.L3
	movd	%eax, %xmm4
	movq	%rdx, %rax
	movl	%r9d, %edx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm0
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rax,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L4
	movdqa	%xmm0, %xmm2
	movl	%r9d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	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, %eax
	cmpl	%edx, %r9d
	je	.L1
	movslq	%ecx, %r8
.L3:
	movl	(%rdi,%r8,4), %edx
	leaq	0(,%r8,4), %r9
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %esi
	jl	.L1
	movl	4(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	addl	$2, %ecx
	cmpl	%ecx, %esi
	jl	.L1
	movl	8(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	find_min, .-find_min
	.p2align 4
	.globl	find_max
	.type	find_max, @function
find_max:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	%esi, %r8
	movl	%edx, %esi
	leaq	(%rdi,%r8,4), %rdx
	movq	%r8, %rcx
	movl	(%rdx), %eax
	cmpl	%esi, %r8d
	jg	.L9
	movl	%esi, %r10d
	subl	%r8d, %r10d
	leal	1(%r10), %r9d
	cmpl	$2, %r10d
	jbe	.L11
	movd	%eax, %xmm3
	movq	%rdx, %rax
	movl	%r9d, %edx
	shrl	$2, %edx
	pshufd	$0, %xmm3, %xmm0
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rax,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L12
	movdqa	%xmm0, %xmm2
	movl	%r9d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %eax
	cmpl	%edx, %r9d
	je	.L9
	movslq	%ecx, %r8
.L11:
	movl	(%rdi,%r8,4), %edx
	leaq	0(,%r8,4), %r9
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %esi
	jl	.L9
	movl	4(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	addl	$2, %ecx
	cmpl	%ecx, %esi
	jl	.L9
	movl	8(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
.L9:
	ret
	.cfi_endproc
.LFE24:
	.size	find_max, .-find_max
	.p2align 4
	.globl	max_of
	.type	max_of, @function
max_of:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	max_of, .-max_of
	.p2align 4
	.globl	min_of
	.type	min_of, @function
min_of:
.LFB26:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE26:
	.size	min_of, .-min_of
	.p2align 4
	.globl	find_max_diff
	.type	find_max_diff, @function
find_max_diff:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	movslq	%edx, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %edx
	leaq	0(,%rdi,4), %rax
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	subl	%esi, %edx
	movq	%rdi, %r12
	leaq	(%rcx,%rax), %r13
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	(%r8,%rax), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$2, %edx
	je	.L39
	cmpl	$1, %edx
	jne	.L29
	movslq	%esi, %rsi
	addq	%r14, %rax
	leaq	(%r14,%rsi,4), %rdx
	movl	(%rax), %edi
	movl	(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L40
	movl	%ecx, 0(%r13)
	movl	(%rax), %ecx
.L31:
	movl	%ecx, 0(%rbp)
	movl	(%rax), %eax
	subl	(%rdx), %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	leal	(%rdi,%rsi), %edx
	movq	%r14, %rdi
	movq	%rcx, %rbx
	movq	%r8, %r15
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	%eax, 8(%rsp)
	call	find_max_diff
	movl	8(%rsp), %r9d
	movq	%r15, %r8
	movq	%rbx, %rcx
	movl	%r12d, %edx
	movq	%r14, %rdi
	movl	%eax, 12(%rsp)
	leal	1(%r9), %esi
	call	find_max_diff
	movl	0(%rbp), %edx
	movl	12(%rsp), %r10d
	movl	%eax, %r8d
	movslq	8(%rsp), %rax
	movl	%edx, %ecx
	leaq	(%rbx,%rax,4), %rsi
	movl	(%r15,%rax,4), %eax
	subl	(%rsi), %ecx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	movl	%eax, 0(%rbp)
	movl	0(%r13), %eax
	movl	(%rsi), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	cmpl	%r8d, %r10d
	movl	%eax, 0(%r13)
	movl	%r8d, %eax
	cmovge	%r10d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	movl	(%r14,%rdi,4), %ecx
	movl	-4(%r14,%rax), %edx
	movl	-8(%r14,%rax), %edi
	movl	%ecx, %eax
	subl	%edx, %eax
	subl	%edi, %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	subl	%edi, %edx
	movslq	%esi, %rdi
	leaq	0(,%rdi,4), %r8
	cmpl	%edx, %eax
	leaq	(%r14,%r8), %r9
	cmovl	%edx, %eax
	movl	(%r9), %edx
	cmpl	%esi, %r12d
	jl	.L20
	movl	(%r14,%rdi,4), %ecx
	cmpl	%ecx, %edx
	cmovg	%ecx, %edx
	leal	1(%rsi), %ecx
	cmpl	%ecx, %r12d
	jl	.L24
	movl	4(%r14,%r8), %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	leal	2(%rsi), %r10d
	cmpl	%r10d, %r12d
	jl	.L24
	movl	8(%r14,%r8), %r8d
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
.L24:
	movl	%edx, 0(%r13)
	leaq	0(,%rdi,4), %r8
	movl	(%r9), %edx
	movl	(%r14,%rdi,4), %edi
	cmpl	%edi, %edx
	cmovl	%edi, %edx
	cmpl	%ecx, %r12d
	jl	.L32
	movl	4(%r14,%r8), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addl	$2, %esi
	cmpl	%esi, %r12d
	jl	.L32
	movl	8(%r14,%r8), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
.L32:
	movl	%edx, 0(%rbp)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	movl	%edi, 0(%r13)
	movl	(%rdx), %ecx
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, 0(%r13)
	jmp	.L32
	.cfi_endproc
.LFE27:
	.size	find_max_diff, .-find_max_diff
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-2998272(%rsp), %r11
	.cfi_def_cfa 11, 2998312
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1768, %rsp
	.cfi_def_cfa_offset 3000080
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 3000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L42
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L43
.L42:
	subl	$1, %edx
	xorl	%esi, %esi
	leaq	1000016(%rsp), %rcx
	movq	%r13, %rdi
	leaq	2000016(%rsp), %r8
	call	find_max_diff
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	3000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$3000040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L49:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE28:
	.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
	.p2align 4
	.globl	find_min
	.type	find_min, @function
find_min:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%esi, %r8
	movl	%edx, %esi
	leaq	(%rdi,%r8,4), %rdx
	movq	%r8, %rcx
	movl	(%rdx), %eax
	cmpl	%esi, %r8d
	jg	.L1
	movl	%esi, %r10d
	subl	%r8d, %r10d
	leal	1(%r10), %r9d
	cmpl	$2, %r10d
	jbe	.L3
	movd	%eax, %xmm4
	movq	%rdx, %rax
	movl	%r9d, %edx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm0
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rax,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	(%rax), %xmm1
	movdqu	(%rax), %xmm3
	addq	$16, %rax
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L4
	movdqa	%xmm0, %xmm2
	movl	%r9d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	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, %eax
	cmpl	%edx, %r9d
	je	.L1
	movslq	%ecx, %r8
.L3:
	movl	(%rdi,%r8,4), %edx
	leaq	0(,%r8,4), %r9
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %esi
	jl	.L1
	movl	4(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	addl	$2, %ecx
	cmpl	%ecx, %esi
	jl	.L1
	movl	8(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
.L1:
	ret
	.cfi_endproc
.LFE23:
	.size	find_min, .-find_min
	.p2align 4
	.globl	find_max
	.type	find_max, @function
find_max:
.LFB24:
	.cfi_startproc
	endbr64
	movslq	%esi, %r8
	movl	%edx, %esi
	leaq	(%rdi,%r8,4), %rdx
	movq	%r8, %rcx
	movl	(%rdx), %eax
	cmpl	%esi, %r8d
	jg	.L9
	movl	%esi, %r10d
	subl	%r8d, %r10d
	leal	1(%r10), %r9d
	cmpl	$2, %r10d
	jbe	.L11
	movd	%eax, %xmm3
	movq	%rdx, %rax
	movl	%r9d, %edx
	shrl	$2, %edx
	pshufd	$0, %xmm3, %xmm0
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rax,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L12:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm0, %xmm2
	pand	%xmm2, %xmm1
	pandn	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	por	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L12
	movdqa	%xmm0, %xmm2
	movl	%r9d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm1, %xmm0
	por	%xmm2, %xmm0
	movd	%xmm0, %eax
	cmpl	%edx, %r9d
	je	.L9
	movslq	%ecx, %r8
.L11:
	movl	(%rdi,%r8,4), %edx
	leaq	0(,%r8,4), %r9
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %esi
	jl	.L9
	movl	4(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	addl	$2, %ecx
	cmpl	%ecx, %esi
	jl	.L9
	movl	8(%rdi,%r9), %edx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
.L9:
	ret
	.cfi_endproc
.LFE24:
	.size	find_max, .-find_max
	.p2align 4
	.globl	max_of
	.type	max_of, @function
max_of:
.LFB25:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	max_of, .-max_of
	.p2align 4
	.globl	min_of
	.type	min_of, @function
min_of:
.LFB26:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE26:
	.size	min_of, .-min_of
	.p2align 4
	.globl	find_max_diff
	.type	find_max_diff, @function
find_max_diff:
.LFB27:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdi, %r14
	movslq	%edx, %rdi
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %edx
	leaq	0(,%rdi,4), %rax
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	subl	%esi, %edx
	movq	%rdi, %r12
	leaq	(%rcx,%rax), %r13
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	(%r8,%rax), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$2, %edx
	je	.L39
	cmpl	$1, %edx
	jne	.L29
	movslq	%esi, %rsi
	addq	%r14, %rax
	leaq	(%r14,%rsi,4), %rdx
	movl	(%rax), %edi
	movl	(%rdx), %ecx
	cmpl	%ecx, %edi
	jle	.L40
	movl	%ecx, 0(%r13)
	movl	(%rax), %ecx
.L31:
	movl	%ecx, 0(%rbp)
	movl	(%rax), %eax
	subl	(%rdx), %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L29:
	.cfi_restore_state
	leal	(%rdi,%rsi), %edx
	movq	%r14, %rdi
	movq	%rcx, %rbx
	movq	%r8, %r15
	movl	%edx, %eax
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, %edx
	movl	%eax, 8(%rsp)
	call	find_max_diff
	movl	8(%rsp), %r9d
	movq	%r15, %r8
	movq	%rbx, %rcx
	movl	%r12d, %edx
	movq	%r14, %rdi
	movl	%eax, 12(%rsp)
	leal	1(%r9), %esi
	call	find_max_diff
	movl	0(%rbp), %edx
	movl	12(%rsp), %r10d
	movl	%eax, %r8d
	movslq	8(%rsp), %rax
	movl	%edx, %ecx
	leaq	(%rbx,%rax,4), %rsi
	movl	(%r15,%rax,4), %eax
	subl	(%rsi), %ecx
	cmpl	%edx, %eax
	cmovl	%edx, %eax
	movl	%eax, 0(%rbp)
	movl	0(%r13), %eax
	movl	(%rsi), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	cmpl	%r8d, %r10d
	movl	%eax, 0(%r13)
	movl	%r8d, %eax
	cmovge	%r10d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	movl	(%r14,%rdi,4), %ecx
	movl	-4(%r14,%rax), %edx
	movl	-8(%r14,%rax), %edi
	movl	%ecx, %eax
	subl	%edx, %eax
	subl	%edi, %ecx
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	subl	%edi, %edx
	movslq	%esi, %rdi
	leaq	0(,%rdi,4), %r8
	cmpl	%edx, %eax
	leaq	(%r14,%r8), %r9
	cmovl	%edx, %eax
	movl	(%r9), %edx
	cmpl	%esi, %r12d
	jl	.L20
	movl	(%r14,%rdi,4), %ecx
	cmpl	%ecx, %edx
	cmovg	%ecx, %edx
	leal	1(%rsi), %ecx
	cmpl	%ecx, %r12d
	jl	.L24
	movl	4(%r14,%r8), %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	leal	2(%rsi), %r10d
	cmpl	%r10d, %r12d
	jl	.L24
	movl	8(%r14,%r8), %r8d
	cmpl	%r8d, %edx
	cmovg	%r8d, %edx
.L24:
	movl	%edx, 0(%r13)
	leaq	0(,%rdi,4), %r8
	movl	(%r9), %edx
	movl	(%r14,%rdi,4), %edi
	cmpl	%edi, %edx
	cmovl	%edi, %edx
	cmpl	%ecx, %r12d
	jl	.L32
	movl	4(%r14,%r8), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addl	$2, %esi
	cmpl	%esi, %r12d
	jl	.L32
	movl	8(%r14,%r8), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
.L32:
	movl	%edx, 0(%rbp)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L40:
	.cfi_restore_state
	movl	%edi, 0(%r13)
	movl	(%rdx), %ecx
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, 0(%r13)
	jmp	.L32
	.cfi_endproc
.LFE27:
	.size	find_max_diff, .-find_max_diff
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB28:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-2998272(%rsp), %r11
	.cfi_def_cfa 11, 2998312
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1768, %rsp
	.cfi_def_cfa_offset 3000080
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 3000024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %r13
	movq	%r13, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L42
	.p2align 4,,10
	.p2align 3
.L43:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	addq	$4, %rbp
	cmpl	%ebx, %edx
	jg	.L43
.L42:
	subl	$1, %edx
	xorl	%esi, %esi
	leaq	1000016(%rsp), %rcx
	movq	%r13, %rdi
	leaq	2000016(%rsp), %r8
	call	find_max_diff
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	3000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L49
	addq	$3000040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L49:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE28:
	.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 find_min(int a[], int start, int end)
{
    int min = a[start];
    for(int i=start; i<=end; i++){
        if(a[i] <= min)
            min = a[i];
    }
    return min;
}

int find_max(int a[], int start, int end)
{
    int max = a[start];
    for(int i=start; i<=end; i++){
        if(a[i] >= max)
            max = a[i];
    }
    return max;
}

int max_of(int a, int b){
    return (a>=b) ? a:b;
}

int min_of(int a, int b){
    return (a<=b) ? a:b;
}

int find_max_diff(int a[], int start, int end, int left_min[], int right_max[])
{
    int i,j;
    int max = -1000000000;
    if((end - start) == 2){
        max = max_of(max_of(a[end-1]-a[end-2], a[end]-a[end-2]), a[end]-a[end-1]);
        left_min[end] = find_min(a, start, end);
        right_max[end] = find_max(a, start, end);
        return max;
    }
    else if((end-start)==1){
        if((a[end]-a[start]) <= 0){
            left_min[end] = a[end]; 
            right_max[end] = a[start];
        }
        else{
            left_min[end] = a[start]; 
            right_max[end] = a[end];
        }
        return a[end] - a[start];
    }
    else{
        int mid = (start+end)/2;
        int left_diff = find_max_diff(a, start, mid, left_min, right_max);
        int right_diff = find_max_diff(a, mid+1, end, left_min, right_max);
        int all_diff = right_max[end] - left_min[mid];
        right_max[end] = max_of(right_max[mid], right_max[end]);
        left_min[end] = min_of(left_min[mid], left_min[end]);
        return max_of(max_of(left_diff, right_diff), all_diff);
    }
}

int main(){
    
    int data_num, arr[250000];
    scanf("%d", &data_num);
    
    for(int i=0; i<data_num; i++){
        scanf("%d", &arr[i]);
    }

    int left_min[250000], right_max[250000];
    int ans = find_max_diff(arr, 0, data_num-1, left_min, right_max);
    printf("%d\n", ans);
}


3
4
1
2
 6
5
3
0
3
4
3
 3
4
1
3
 6
5
3
0
2
0
3
 3
5
0
6
 3
5
0
10
 6
5
2
-1
4
1
3
 6
5
2
-1
7
1
3
 3
3
0
9
 6
5
2
-1
14
1
3

1
 4
 2
 3
 6
 10
 5
 8
 9
 15

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 find_min(int a[], int start, int end)
{
    int min = a[start];
    for(int i=start; i<=end; i++){
        if(a[i] <= min)
            min = a[i];
    }
    return min;
}

int find_max(int a[], int start, int end)
{
    int max = a[start];
    for(int i=start; i<=end; i++){
        if(a[i] >= max)
            max = a[i];
    }
    return max;
}

int max_of(int a, int b){
    return (a>=b) ? a:b;
}

int min_of(int a, int b){
    return (a<=b) ? a:b;
}

int find_max_diff(int a[], int start, int end, int left_min[], int right_max[])
{
    int i,j;
    int max = -1000000000;
    if((end - start) == 2){
        max = max_of(max_of(a[end-1]-a[end-2], a[end]-a[end-2]), a[end]-a[end-1]);
        left_min[end] = find_min(a, start, end);
        right_max[end] = find_max(a, start, end);
        return max;
    }
    else if((end-start)==1){
        if((a[end]-a[start]) <= 0){
            left_min[end] = a[end]; 
            right_max[end] = a[start];
        }
        else{
            left_min[end] = a[start]; 
            right_max[end] = a[end];
        }
        return a[end] - a[start];
    }
    else{
        int mid = (start+end)/2;
        int left_diff = find_max_diff(a, start, mid, left_min, right_max);
        int right_diff = find_max_diff(a, mid+1, end, left_min, right_max);
        int all_diff = right_max[end] - left_min[mid];
        right_max[end] = max_of(right_max[mid], right_max[end]);
        left_min[end] = min_of(left_min[mid], left_min[end]);
        return max_of(max_of(left_diff, right_diff), all_diff);
    }
}

int main(){
    
    int data_num, arr[250000];
    scanf("%d", &data_num);
    
    for(int i=0; i<data_num; i++){
        scanf("%d", &arr[i]);
    }

    int left_min[250000], right_max[250000];
    int ans = find_max_diff(arr, 0, data_num-1, left_min, right_max);
    printf("%d\n", ans);
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	find_min
	.type	find_min, @function
find_min:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find_min, .-find_min
	.globl	find_max
	.type	find_max, @function
find_max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L8
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
.L8:
	addl	$1, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L9
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find_max, .-find_max
	.globl	max_of
	.type	max_of, @function
max_of:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	max_of, .-max_of
	.globl	min_of
	.type	min_of, @function
min_of:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	min_of, .-min_of
	.globl	find_max_diff
	.type	find_max_diff, @function
find_max_diff:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	%edx, -64(%rbp)
	movq	%rcx, -72(%rbp)
	movq	%r8, -80(%rbp)
	movl	$-1000000000, -36(%rbp)
	movl	-64(%rbp), %eax
	subl	-60(%rbp), %eax
	cmpl	$2, %eax
	jne	.L16
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	-4(%rdx), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	-8(%rdx), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	salq	$2, %rcx
	leaq	-8(%rcx), %rsi
	movq	-56(%rbp), %rcx
	addq	%rsi, %rcx
	movl	(%rcx), %ecx
	subl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%ebx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, -36(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-72(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find_min
	movl	%eax, (%rbx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find_max
	movl	%eax, (%rbx)
	movl	-36(%rbp), %eax
	jmp	.L17
.L16:
	movl	-64(%rbp), %eax
	subl	-60(%rbp), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jg	.L19
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-80(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L20
.L19:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-80(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
.L20:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	jmp	.L17
.L18:
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -32(%rbp)
	movq	-80(%rbp), %rdi
	movq	-72(%rbp), %rcx
	movl	-32(%rbp), %edx
	movl	-60(%rbp), %esi
	movq	-56(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movq	-80(%rbp), %rdi
	movq	-72(%rbp), %rcx
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -24(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	movq	-80(%rbp), %rcx
	leaq	(%rsi,%rcx), %rbx
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, (%rbx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	movq	-72(%rbp), %rcx
	leaq	(%rsi,%rcx), %rbx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min_of
	movl	%eax, (%rbx)
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	max_of
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	find_max_diff, .-find_max_diff
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2998272(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1760, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-3000028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3000024(%rbp)
	jmp	.L22
.L23:
	leaq	-3000016(%rbp), %rdx
	movl	-3000024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -3000024(%rbp)
.L22:
	movl	-3000028(%rbp), %eax
	cmpl	%eax, -3000024(%rbp)
	jl	.L23
	movl	-3000028(%rbp), %eax
	leal	-1(%rax), %esi
	leaq	-1000016(%rbp), %rcx
	leaq	-2000016(%rbp), %rdx
	leaq	-3000016(%rbp), %rax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%esi, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -3000020(%rbp)
	movl	-3000020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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	find_min
	.type	find_min, @function
find_min:
.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, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L4:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L3
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
.L3:
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find_min, .-find_min
	.globl	find_max
	.type	find_max, @function
find_max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L9:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jg	.L8
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
.L8:
	addl	$1, -4(%rbp)
.L7:
	movl	-4(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L9
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	find_max, .-find_max
	.globl	max_of
	.type	max_of, @function
max_of:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	max_of, .-max_of
	.globl	min_of
	.type	min_of, @function
min_of:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	min_of, .-min_of
	.globl	find_max_diff
	.type	find_max_diff, @function
find_max_diff:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -56(%rbp)
	movl	%esi, -60(%rbp)
	movl	%edx, -64(%rbp)
	movq	%rcx, -72(%rbp)
	movq	%r8, -80(%rbp)
	movl	$-1000000000, -36(%rbp)
	movl	-64(%rbp), %eax
	subl	-60(%rbp), %eax
	cmpl	$2, %eax
	jne	.L16
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	-4(%rdx), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, %ebx
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	leaq	-8(%rdx), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	-4(%rax), %rcx
	movq	-56(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	salq	$2, %rcx
	leaq	-8(%rcx), %rsi
	movq	-56(%rbp), %rcx
	addq	%rsi, %rcx
	movl	(%rcx), %ecx
	subl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%ebx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, -36(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-72(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find_min
	movl	%eax, (%rbx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	leaq	(%rdx,%rax), %rbx
	movl	-64(%rbp), %edx
	movl	-60(%rbp), %ecx
	movq	-56(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find_max
	movl	%eax, (%rbx)
	movl	-36(%rbp), %eax
	jmp	.L17
.L16:
	movl	-64(%rbp), %eax
	subl	-60(%rbp), %eax
	cmpl	$1, %eax
	jne	.L18
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	jg	.L19
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-80(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	jmp	.L20
.L19:
	movl	-60(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	-64(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-80(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
.L20:
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-60(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-56(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	jmp	.L17
.L18:
	movl	-60(%rbp), %edx
	movl	-64(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -32(%rbp)
	movq	-80(%rbp), %rdi
	movq	-72(%rbp), %rcx
	movl	-32(%rbp), %edx
	movl	-60(%rbp), %esi
	movq	-56(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -28(%rbp)
	movl	-32(%rbp), %eax
	leal	1(%rax), %esi
	movq	-80(%rbp), %rdi
	movq	-72(%rbp), %rcx
	movl	-64(%rbp), %edx
	movq	-56(%rbp), %rax
	movq	%rdi, %r8
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -24(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-32(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-72(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rdx), %edx
	subl	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	movq	-80(%rbp), %rcx
	leaq	(%rsi,%rcx), %rbx
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, (%rbx)
	movl	-64(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-72(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-72(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	movl	-64(%rbp), %ecx
	movslq	%ecx, %rcx
	leaq	0(,%rcx,4), %rsi
	movq	-72(%rbp), %rcx
	leaq	(%rsi,%rcx), %rbx
	movl	%edx, %esi
	movl	%eax, %edi
	call	min_of
	movl	%eax, (%rbx)
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	max_of
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	movl	%edx, %edi
	call	max_of
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	find_max_diff, .-find_max_diff
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-2998272(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1760, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-3000028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -3000024(%rbp)
	jmp	.L22
.L23:
	leaq	-3000016(%rbp), %rdx
	movl	-3000024(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -3000024(%rbp)
.L22:
	movl	-3000028(%rbp), %eax
	cmpl	%eax, -3000024(%rbp)
	jl	.L23
	movl	-3000028(%rbp), %eax
	leal	-1(%rax), %esi
	leaq	-1000016(%rbp), %rcx
	leaq	-2000016(%rbp), %rdx
	leaq	-3000016(%rbp), %rax
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%esi, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	find_max_diff
	movl	%eax, -3000020(%rbp)
	movl	-3000020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L25
	call	__stack_chk_fail@PLT
.L25:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.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:
