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

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

int main(int argc, char** argv)
{
	int n, i;
	int a[100000] = {0}, max = 0;
	int k = 0;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%d", a+i);
		a[i] = a[i] * 2;
		if( a[i] > max ) max = a[i];
	}
	for(i=0; i<n; ++i){
		int d1, d2;
		d1 = (max/2) < k ? (k-max/2) : (max/2-k);
		d2 = (max/2) < a[i] ? (a[i] - max/2) : (max/2 - a[i]);
		if( d2 < d1 ) k = a[i];
	}
	
	printf("%d %d\n", max/2, k/2);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	movq	%r13, %r12
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	addl	%eax, %eax
	cmpl	%eax, %ebp
	movl	%eax, (%rbx)
	cmovl	%eax, %ebp
	movl	12(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %rbx
	cmpl	%r15d, %eax
	jg	.L3
	movl	%ebp, %edx
	sarl	%edx
	testl	%eax, %eax
	jle	.L12
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %ecx
	movl	%edx, %edi
	movl	%edx, %esi
	subl	%edx, %ecx
	subl	%eax, %edi
	cmpl	%edx, %eax
	cmovg	%ecx, %edi
	movl	(%r12), %ecx
	movl	%ecx, %r8d
	subl	%ecx, %esi
	subl	%edx, %r8d
	cmpl	%edx, %ecx
	cmovg	%r8d, %esi
	cmpl	%esi, %edi
	cmovg	%ecx, %eax
	addq	$4, %r12
	cmpq	%r12, %r9
	jne	.L9
.L2:
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrl	$31, %ecx
	addl	%eax, %ecx
	xorl	%eax, %eax
	sarl	%ecx
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L11:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	movq	%r13, %r12
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	addl	%eax, %eax
	cmpl	%eax, %ebp
	movl	%eax, (%rbx)
	cmovl	%eax, %ebp
	movl	12(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %rbx
	cmpl	%r15d, %eax
	jg	.L3
	movl	%ebp, %edx
	sarl	%edx
	testl	%eax, %eax
	jle	.L12
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %ecx
	movl	%edx, %edi
	movl	%edx, %esi
	subl	%edx, %ecx
	subl	%eax, %edi
	cmpl	%edx, %eax
	cmovg	%ecx, %edi
	movl	(%r12), %ecx
	movl	%ecx, %r8d
	subl	%ecx, %esi
	subl	%edx, %r8d
	cmpl	%edx, %ecx
	cmovg	%r8d, %esi
	cmpl	%esi, %edi
	cmovg	%ecx, %eax
	addq	$4, %r12
	cmpq	%r12, %r9
	jne	.L9
.L2:
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrl	$31, %ecx
	addl	%eax, %ecx
	xorl	%eax, %eax
	sarl	%ecx
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L11:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	movq	%r13, %r12
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	addl	%eax, %eax
	cmpl	%eax, %ebp
	movl	%eax, (%rbx)
	cmovl	%eax, %ebp
	movl	12(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %rbx
	cmpl	%r15d, %eax
	jg	.L3
	movl	%ebp, %edx
	sarl	%edx
	testl	%eax, %eax
	jle	.L12
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %ecx
	movl	%edx, %edi
	movl	%edx, %esi
	subl	%edx, %ecx
	subl	%eax, %edi
	cmpl	%edx, %eax
	cmovg	%ecx, %edi
	movl	(%r12), %ecx
	movl	%ecx, %r8d
	subl	%ecx, %esi
	subl	%edx, %r8d
	cmpl	%edx, %ecx
	cmovg	%r8d, %esi
	cmpl	%esi, %edi
	cmovg	%ecx, %eax
	addq	$4, %r12
	cmpq	%r12, %r9
	jne	.L9
.L2:
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrl	$31, %ecx
	addl	%eax, %ecx
	xorl	%eax, %eax
	sarl	%ecx
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L11:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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 <stdlib.h>

int main(int argc, char** argv)
{
	int n, i;
	int a[100000] = {0}, max = 0;
	int k = 0;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%d", a+i);
		a[i] = a[i] * 2;
		if( a[i] > max ) max = a[i];
	}
	for(i=0; i<n; ++i){
		int d1, d2;
		d1 = (max/2) < k ? (k-max/2) : (max/2-k);
		d2 = (max/2) < a[i] ? (a[i] - max/2) : (max/2 - a[i]);
		if( d2 < d1 ) k = a[i];
	}
	
	printf("%d %d\n", max/2, k/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 <stdlib.h>

int main(int argc, char** argv)
{
	int n, i;
	int a[100000] = {0}, max = 0;
	int k = 0;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%d", a+i);
		a[i] = a[i] * 2;
		if( a[i] > max ) max = a[i];
	}
	for(i=0; i<n; ++i){
		int d1, d2;
		d1 = (max/2) < k ? (k-max/2) : (max/2-k);
		d2 = (max/2) < a[i] ? (a[i] - max/2) : (max/2 - a[i]);
		if( d2 < d1 ) k = a[i];
	}
	
	printf("%d %d\n", max/2, k/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:

5
6 9 4 2 11

11 6

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

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

int main(int argc, char** argv)
{
	int n, i;
	int a[100000] = {0}, max = 0;
	int k = 0;
	
	scanf("%d", &n);
	for(i=0;i<n;++i){
		scanf("%d", a+i);
		a[i] = a[i] * 2;
		if( a[i] > max ) max = a[i];
	}
	for(i=0; i<n; ++i){
		int d1, d2;
		d1 = (max/2) < k ? (k-max/2) : (max/2-k);
		d2 = (max/2) < a[i] ? (a[i] - max/2) : (max/2 - a[i]);
		if( d2 < d1 ) k = a[i];
	}
	
	printf("%d %d\n", max/2, k/2);
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	movq	%r13, %r12
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	addl	%eax, %eax
	cmpl	%eax, %ebp
	movl	%eax, (%rbx)
	cmovl	%eax, %ebp
	movl	12(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %rbx
	cmpl	%r15d, %eax
	jg	.L3
	movl	%ebp, %edx
	sarl	%edx
	testl	%eax, %eax
	jle	.L12
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %ecx
	movl	%edx, %edi
	movl	%edx, %esi
	subl	%edx, %ecx
	subl	%eax, %edi
	cmpl	%edx, %eax
	cmovg	%ecx, %edi
	movl	(%r12), %ecx
	movl	%ecx, %r8d
	subl	%ecx, %esi
	subl	%edx, %r8d
	cmpl	%edx, %ecx
	cmovg	%r8d, %esi
	cmpl	%esi, %edi
	cmovg	%ecx, %eax
	addq	$4, %r12
	cmpq	%r12, %r9
	jne	.L9
.L2:
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrl	$31, %ecx
	addl	%eax, %ecx
	xorl	%eax, %eax
	sarl	%ecx
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L11:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397368
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2728, %rsp
	.cfi_def_cfa_offset 400096
	movl	$400000, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r13
	movq	%r13, %rdi
	call	memset@PLT
	leaq	12(%rsp), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L11
	movq	%r13, %r12
	movq	%r13, %rbx
	xorl	%ebp, %ebp
	xorl	%r15d, %r15d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	(%rbx), %eax
	addl	%eax, %eax
	cmpl	%eax, %ebp
	movl	%eax, (%rbx)
	cmovl	%eax, %ebp
	movl	12(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %rbx
	cmpl	%r15d, %eax
	jg	.L3
	movl	%ebp, %edx
	sarl	%edx
	testl	%eax, %eax
	jle	.L12
	subl	$1, %eax
	leaq	4(%r13,%rax,4), %r9
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %ecx
	movl	%edx, %edi
	movl	%edx, %esi
	subl	%edx, %ecx
	subl	%eax, %edi
	cmpl	%edx, %eax
	cmovg	%ecx, %edi
	movl	(%r12), %ecx
	movl	%ecx, %r8d
	subl	%ecx, %esi
	subl	%edx, %r8d
	cmpl	%edx, %ecx
	cmovg	%r8d, %esi
	cmpl	%esi, %edi
	cmovg	%ecx, %eax
	addq	$4, %r12
	cmpq	%r12, %r9
	jne	.L9
.L2:
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	shrl	$31, %ecx
	addl	%eax, %ecx
	xorl	%eax, %eax
	sarl	%ecx
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L17
	addq	$400040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L11:
	.cfi_restore_state
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L2
.L12:
	xorl	%eax, %eax
	jmp	.L2
.L17:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```