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

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

void _mode(int a, int b, int max, int *A, int *mode, int *count){
  int *num;
  num=(int*)malloc((max+1)*sizeof(int));
  for(int i=0;i<=max;i++) num[i]=0;
  for(int i=a;i<=b;i++){
    num[A[i]]++;
  }
  for(int i=0;i<=max;i++){
    if(*count<num[i]){
      *count=num[i];
      *mode=i;
    }
  }
  free(num);
  return;
}

void _mode2(int a, int b, int max, int *A, int mode, int *count){
  int *num;
  num=(int*)malloc((max+1)*sizeof(int));
  for(int i=0;i<=max;i++) num[i]=0;
  for(int i=a;i<=b;i++){
    num[A[i]]++;
  }
  for(int i=0;i<=max;i++){
    if(i!=mode){
      if(*count<num[i]){
        *count=num[i];
      }
    }
  }
  free(num);
  return;
}

int main(){
  int n;
  int *v;
  scanf("%d",&n);
  v=(int*)malloc(n*sizeof(int));
  for(int i=0;i<n;i++) scanf("%d",&v[i]);

  int *odd;
  int *even;
  int odd_max=0;
  int even_max=0;
  odd=(int*)malloc((n/2)*sizeof(int));
  even=(int*)malloc((n/2)*sizeof(int));
  for(int i=0;i<(n/2);i++){
    odd[i]=v[2*i];
    if(odd[i]>odd_max) odd_max=odd[i];
    even[i]=v[2*i+1];
    if(even[i]>even_max) even_max=even[i];
  }
  /*for(int i=0;i<(n/2);i++){
    printf("odd[%d]=%d\neven[%d]=%d\n",i,odd[i],i,even[i]);
  }*/
  int mode_odd=-1;
  int mode_even=-1;
  int count_odd=0;
  int count_even=0;
  _mode(0,n/2-1,odd_max,odd,&mode_odd,&count_odd);
  _mode(0,n/2-1,even_max,even,&mode_even,&count_even);

  //printf("mode_odd=%d count_odd=%d\n",mode_odd,count_odd);
  //printf("mode_even=%d count_even=%d\n",mode_even,count_even);

  int count_odd2=0;
  int count_even2=0;
  _mode2(0,n/2-1,odd_max,odd,mode_odd,&count_odd2);
  _mode2(0,n/2-1,even_max,even,mode_even,&count_even2);

  //printf("count_odd2=%d count_even2=%d\n",count_odd2,count_even2);

  int times;
  if(mode_odd!=mode_even){
    times=n-count_odd-count_even;
  }else{
    times=min(n-count_odd-count_even2,n-count_odd2-count_even);
  }

  printf("%d\n",times);

  free(v);
  free(odd);
  free(even);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB6:
	.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), %eax
	cmpl	-8(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	min, .-min
	.globl	_mode
	.type	_mode, @function
_mode:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	%rcx, -56(%rbp)
	movq	%r8, -64(%rbp)
	movq	%r9, -72(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L6
	movl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -16(%rbp)
.L7:
	movl	-16(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L8
	movl	$0, -12(%rbp)
	jmp	.L9
.L11:
	movq	-72(%rbp), %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-8(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
.L10:
	addl	$1, -12(%rbp)
.L9:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L11
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_mode, .-_mode
	.globl	_mode2
	.type	_mode2, @function
_mode2:
.LFB8:
	.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
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	%rcx, -56(%rbp)
	movl	%r8d, -48(%rbp)
	movq	%r9, -64(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L15
	movl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L17
	movl	$0, -12(%rbp)
	jmp	.L18
.L20:
	movl	-12(%rbp), %eax
	cmpl	-48(%rbp), %eax
	je	.L19
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-8(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L19
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
.L19:
	addl	$1, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L20
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	_mode2, .-_mode2
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L23
.L24:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -52(%rbp)
.L23:
	movl	-80(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L24
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L25
.L28:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -48(%rbp)
	jge	.L26
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
.L26:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	jge	.L27
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
.L27:
	addl	$1, -40(%rbp)
.L25:
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40(%rbp)
	jl	.L28
	movl	$-1, -76(%rbp)
	movl	$-1, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-68(%rbp), %rdi
	leaq	-76(%rbp), %rcx
	movq	-24(%rbp), %rdx
	movl	-48(%rbp), %eax
	movq	%rdi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-64(%rbp), %rdi
	leaq	-72(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movl	-44(%rbp), %eax
	movq	%rdi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode
	movl	$0, -60(%rbp)
	movl	$0, -56(%rbp)
	movl	-76(%rbp), %ecx
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-60(%rbp), %rdi
	movq	-24(%rbp), %rdx
	movl	-48(%rbp), %eax
	movq	%rdi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode2
	movl	-72(%rbp), %ecx
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-56(%rbp), %rdi
	movq	-16(%rbp), %rdx
	movl	-44(%rbp), %eax
	movq	%rdi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode2
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %eax
	cmpl	%eax, %edx
	je	.L29
	movl	-80(%rbp), %eax
	movl	-68(%rbp), %edx
	subl	%edx, %eax
	movl	-64(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L30
.L29:
	movl	-80(%rbp), %eax
	movl	-60(%rbp), %edx
	subl	%edx, %eax
	movl	-64(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-80(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%ecx, %eax
	movl	-56(%rbp), %ecx
	subl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -36(%rbp)
.L30:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	min
	.type	min, @function
min:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	min, .-min
	.p2align 4
	.globl	_mode
	.type	_mode, @function
_mode:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r9, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	leal	1(%rdx), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	malloc@PLT
	movq	%rax, %rdi
	testl	%r12d, %r12d
	js	.L4
	movslq	%r12d, %rax
	xorl	%esi, %esi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rdi
	cmpl	%r13d, %ebx
	jg	.L5
.L10:
	movslq	%ebx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%r15,%rax,4), %rdx
	addq	$1, %rax
	addl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %r13d
	jge	.L6
	testl	%r12d, %r12d
	js	.L7
.L5:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdi,%rax,4), %edx
	cmpl	%edx, 0(%rbp)
	jge	.L8
	movl	%edx, 0(%rbp)
	movl	%eax, (%r14)
.L8:
	addq	$1, %rax
	cmpl	%eax, %r12d
	jge	.L9
.L7:
	addq	$8, %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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	%r13d, %ebx
	jle	.L10
	jmp	.L7
	.cfi_endproc
.LFE40:
	.size	_mode, .-_mode
	.p2align 4
	.globl	_mode2
	.type	_mode2, @function
_mode2:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%r8d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r9, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	leal	1(%rdx), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	malloc@PLT
	movq	%rax, %rdi
	testl	%ebp, %ebp
	js	.L15
	movslq	%ebp, %rax
	xorl	%esi, %esi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rdi
	cmpl	%r13d, %ebx
	jg	.L16
.L21:
	movslq	%ebx, %rax
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	(%r15,%rax,4), %rdx
	addq	$1, %rax
	addl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %r13d
	jge	.L17
	testl	%ebp, %ebp
	js	.L18
.L16:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%eax, %r14d
	je	.L19
	movl	(%rdi,%rax,4), %edx
	cmpl	%edx, (%r12)
	jge	.L19
	movl	%edx, (%r12)
.L19:
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L20
.L18:
	addq	$8, %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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	cmpl	%r13d, %ebx
	jle	.L21
	jmp	.L18
	.cfi_endproc
.LFE41:
	.size	_mode2, .-_mode2
	.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:
.LFB42:
	.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
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r13
	testl	%ebx, %ebx
	jle	.L26
	movq	%rax, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r12
	cmpl	%ebp, %ebx
	jg	.L27
	movl	%ebx, %esi
	shrl	$31, %esi
	addl	%ebx, %esi
	sarl	%esi
	movslq	%esi, %r12
	movl	%esi, 8(%rsp)
	movl	%esi, %ebp
	salq	$2, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%rax, %r12
	cmpl	$1, %ebx
	jle	.L28
	cmpl	$7, %ebx
	movl	8(%rsp), %esi
	jle	.L37
	movl	%esi, %eax
	pxor	%xmm3, %xmm3
	xorl	%ecx, %ecx
	shrl	$2, %eax
	movdqa	%xmm3, %xmm4
	salq	$4, %rax
	.p2align 4,,10
	.p2align 3
.L30:
	movdqu	0(%r13,%rcx,2), %xmm0
	movdqu	16(%r13,%rcx,2), %xmm1
	movdqa	%xmm0, %xmm2
	movdqa	%xmm0, %xmm5
	pcmpgtd	%xmm4, %xmm2
	pand	%xmm2, %xmm5
	pandn	%xmm4, %xmm2
	movdqa	%xmm2, %xmm4
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm3, %xmm2
	por	%xmm5, %xmm4
	movdqa	%xmm1, %xmm5
	pand	%xmm2, %xmm5
	pandn	%xmm3, %xmm2
	movdqa	%xmm2, %xmm3
	movdqa	%xmm0, %xmm2
	shufps	$221, %xmm1, %xmm0
	movups	%xmm0, (%r12,%rcx)
	shufps	$136, %xmm1, %xmm2
	movups	%xmm2, (%r14,%rcx)
	addq	$16, %rcx
	por	%xmm5, %xmm3
	cmpq	%rax, %rcx
	jne	.L30
	movdqa	%xmm4, %xmm0
	movd	%xmm4, %r10d
	punpckhdq	%xmm4, %xmm0
	movd	%xmm0, %eax
	movdqa	%xmm3, %xmm0
	cmpl	%eax, %r10d
	punpckhdq	%xmm3, %xmm0
	cmovl	%eax, %r10d
	movd	%xmm3, %eax
	cmpl	%eax, %r10d
	cmovl	%eax, %r10d
	movd	%xmm0, %eax
	pshufd	$85, %xmm4, %xmm0
	pshufd	$255, %xmm4, %xmm4
	movd	%xmm0, %r15d
	cmpl	%eax, %r10d
	movd	%xmm4, %edx
	pshufd	$85, %xmm3, %xmm0
	cmovl	%eax, %r10d
	movd	%xmm0, %eax
	pshufd	$255, %xmm3, %xmm3
	cmpl	%edx, %r15d
	cmovl	%edx, %r15d
	movd	%xmm3, %edx
	cmpl	%eax, %r15d
	cmovl	%eax, %r15d
	movl	%esi, %eax
	cmpl	%edx, %r15d
	cmovl	%edx, %r15d
	andl	$-4, %eax
	testb	$3, %sil
	je	.L32
.L29:
	leal	(%rax,%rax), %edx
	movslq	%eax, %r11
	movslq	%edx, %rcx
	leaq	0(,%r11,4), %rdi
	movl	0(%r13,%rcx,4), %r9d
	leaq	0(,%rcx,4), %r8
	cmpl	%r9d, %r10d
	movl	%r9d, (%r14,%r11,4)
	cmovl	%r9d, %r10d
	movl	4(%r13,%rcx,4), %r9d
	cmpl	%r9d, %r15d
	movl	%r9d, (%r12,%r11,4)
	cmovl	%r9d, %r15d
	leal	1(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L32
	movl	8(%r13,%r8), %r9d
	cmpl	%r9d, %r10d
	movl	%r9d, 4(%r14,%rdi)
	cmovl	%r9d, %r10d
	addl	$3, %edx
	movslq	%edx, %rdx
	movl	0(%r13,%rdx,4), %edx
	cmpl	%edx, %r15d
	movl	%edx, 4(%r12,%rdi)
	cmovl	%edx, %r15d
	addl	$2, %eax
	cmpl	%eax, %esi
	jle	.L32
	movl	16(%r13,%r8), %eax
	cmpl	%eax, %r10d
	movl	%eax, 8(%r14,%rdi)
	cmovl	%eax, %r10d
	movl	20(%r13,%rcx,4), %eax
	cmpl	%eax, %r15d
	movl	%eax, 8(%r12,%rdi)
	cmovl	%eax, %r15d
.L32:
	subl	$1, %ebp
	movl	%r10d, %edx
	movq	%r14, %rcx
	movl	%r10d, 8(%rsp)
	leaq	40(%rsp), %r9
	leaq	32(%rsp), %r8
	movl	%ebp, %esi
	xorl	%edi, %edi
	movl	$-1, 32(%rsp)
	movl	$-1, 36(%rsp)
	movl	$0, 40(%rsp)
	movl	$0, 44(%rsp)
	call	_mode
	leaq	44(%rsp), %r9
	movq	%r12, %rcx
	movl	%r15d, %edx
	leaq	36(%rsp), %r8
	movl	%ebp, %esi
	xorl	%edi, %edi
	call	_mode
	movl	32(%rsp), %eax
	movl	8(%rsp), %edx
	movq	%r14, %rcx
	leaq	48(%rsp), %r9
	movl	%ebp, %esi
	xorl	%edi, %edi
	movl	$0, 48(%rsp)
	movl	%eax, %r8d
	movl	%eax, 12(%rsp)
	movl	$0, 52(%rsp)
	call	_mode2
	movl	36(%rsp), %r8d
	movl	%r15d, %edx
	movq	%r12, %rcx
	leaq	52(%rsp), %r9
	movl	%ebp, %esi
	xorl	%edi, %edi
	movl	%r8d, 8(%rsp)
	call	_mode2
	movl	8(%rsp), %r8d
	movl	12(%rsp), %eax
	movl	%ebx, %edx
	cmpl	%r8d, %eax
	je	.L34
	subl	40(%rsp), %edx
	subl	44(%rsp), %edx
.L35:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	%r14, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$72, %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
.L34:
	.cfi_restore_state
	subl	48(%rsp), %edx
	subl	40(%rsp), %ebx
	subl	44(%rsp), %edx
	subl	52(%rsp), %ebx
	cmpl	%ebx, %edx
	cmovg	%ebx, %edx
	jmp	.L35
.L26:
	movl	%ebx, %eax
	movl	$2, %ecx
	cltd
	idivl	%ecx
	movslq	%eax, %r12
	movq	%r12, %rbp
	salq	$2, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%rax, %r12
.L28:
	xorl	%r15d, %r15d
	xorl	%r10d, %r10d
	jmp	.L32
.L37:
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	xorl	%r10d, %r10d
	jmp	.L29
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.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	min
	.type	min, @function
min:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE39:
	.size	min, .-min
	.p2align 4
	.globl	_mode
	.type	_mode, @function
_mode:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%r8, %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movl	%edx, %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movq	%r9, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	leal	1(%rdx), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	malloc@PLT
	movq	%rax, %rdi
	testl	%r12d, %r12d
	js	.L4
	movslq	%r12d, %rax
	xorl	%esi, %esi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rdi
	cmpl	%r13d, %ebx
	jg	.L5
.L10:
	movslq	%ebx, %rax
	.p2align 4,,10
	.p2align 3
.L6:
	movslq	(%r15,%rax,4), %rdx
	addq	$1, %rax
	addl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %r13d
	jge	.L6
	testl	%r12d, %r12d
	js	.L7
.L5:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L9:
	movl	(%rdi,%rax,4), %edx
	cmpl	%edx, 0(%rbp)
	jge	.L8
	movl	%edx, 0(%rbp)
	movl	%eax, (%r14)
.L8:
	addq	$1, %rax
	cmpl	%eax, %r12d
	jge	.L9
.L7:
	addq	$8, %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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	cmpl	%r13d, %ebx
	jle	.L10
	jmp	.L7
	.cfi_endproc
.LFE40:
	.size	_mode, .-_mode
	.p2align 4
	.globl	_mode2
	.type	_mode2, @function
_mode2:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movq	%rcx, %r15
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movl	%r8d, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r9, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%edx, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	leal	1(%rdx), %edi
	movslq	%edi, %rdi
	salq	$2, %rdi
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	call	malloc@PLT
	movq	%rax, %rdi
	testl	%ebp, %ebp
	js	.L15
	movslq	%ebp, %rax
	xorl	%esi, %esi
	leaq	4(,%rax,4), %rdx
	call	memset@PLT
	movq	%rax, %rdi
	cmpl	%r13d, %ebx
	jg	.L16
.L21:
	movslq	%ebx, %rax
	.p2align 4,,10
	.p2align 3
.L17:
	movslq	(%r15,%rax,4), %rdx
	addq	$1, %rax
	addl	$1, (%rdi,%rdx,4)
	cmpl	%eax, %r13d
	jge	.L17
	testl	%ebp, %ebp
	js	.L18
.L16:
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%eax, %r14d
	je	.L19
	movl	(%rdi,%rax,4), %edx
	cmpl	%edx, (%r12)
	jge	.L19
	movl	%edx, (%r12)
.L19:
	addq	$1, %rax
	cmpl	%eax, %ebp
	jge	.L20
.L18:
	addq	$8, %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
	jmp	free@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	cmpl	%r13d, %ebx
	jle	.L21
	jmp	.L18
	.cfi_endproc
.LFE41:
	.size	_mode2, .-_mode2
	.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:
.LFB42:
	.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
	leaq	.LC0(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	28(%rsp), %rdi
	movq	%rdi, %rbx
	salq	$2, %rdi
	call	malloc@PLT
	movq	%rax, %r13
	testl	%ebx, %ebx
	jle	.L26
	movq	%rax, %r12
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$4, %r12
	cmpl	%ebp, %ebx
	jg	.L27
	movl	%ebx, %esi
	shrl	$31, %esi
	addl	%ebx, %esi
	sarl	%esi
	movslq	%esi, %r12
	movl	%esi, 8(%rsp)
	movl	%esi, %ebp
	salq	$2, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%rax, %r12
	cmpl	$1, %ebx
	jle	.L28
	cmpl	$7, %ebx
	movl	8(%rsp), %esi
	jle	.L37
	movl	%esi, %eax
	pxor	%xmm3, %xmm3
	xorl	%ecx, %ecx
	shrl	$2, %eax
	movdqa	%xmm3, %xmm4
	salq	$4, %rax
	.p2align 4,,10
	.p2align 3
.L30:
	movdqu	0(%r13,%rcx,2), %xmm0
	movdqu	16(%r13,%rcx,2), %xmm1
	movdqa	%xmm0, %xmm2
	movdqa	%xmm0, %xmm5
	pcmpgtd	%xmm4, %xmm2
	pand	%xmm2, %xmm5
	pandn	%xmm4, %xmm2
	movdqa	%xmm2, %xmm4
	movdqa	%xmm1, %xmm2
	pcmpgtd	%xmm3, %xmm2
	por	%xmm5, %xmm4
	movdqa	%xmm1, %xmm5
	pand	%xmm2, %xmm5
	pandn	%xmm3, %xmm2
	movdqa	%xmm2, %xmm3
	movdqa	%xmm0, %xmm2
	shufps	$221, %xmm1, %xmm0
	movups	%xmm0, (%r12,%rcx)
	shufps	$136, %xmm1, %xmm2
	movups	%xmm2, (%r14,%rcx)
	addq	$16, %rcx
	por	%xmm5, %xmm3
	cmpq	%rax, %rcx
	jne	.L30
	movdqa	%xmm4, %xmm0
	movd	%xmm4, %r10d
	punpckhdq	%xmm4, %xmm0
	movd	%xmm0, %eax
	movdqa	%xmm3, %xmm0
	cmpl	%eax, %r10d
	punpckhdq	%xmm3, %xmm0
	cmovl	%eax, %r10d
	movd	%xmm3, %eax
	cmpl	%eax, %r10d
	cmovl	%eax, %r10d
	movd	%xmm0, %eax
	pshufd	$85, %xmm4, %xmm0
	pshufd	$255, %xmm4, %xmm4
	movd	%xmm0, %r15d
	cmpl	%eax, %r10d
	movd	%xmm4, %edx
	pshufd	$85, %xmm3, %xmm0
	cmovl	%eax, %r10d
	movd	%xmm0, %eax
	pshufd	$255, %xmm3, %xmm3
	cmpl	%edx, %r15d
	cmovl	%edx, %r15d
	movd	%xmm3, %edx
	cmpl	%eax, %r15d
	cmovl	%eax, %r15d
	movl	%esi, %eax
	cmpl	%edx, %r15d
	cmovl	%edx, %r15d
	andl	$-4, %eax
	testb	$3, %sil
	je	.L32
.L29:
	leal	(%rax,%rax), %edx
	movslq	%eax, %r11
	movslq	%edx, %rcx
	leaq	0(,%r11,4), %rdi
	movl	0(%r13,%rcx,4), %r9d
	leaq	0(,%rcx,4), %r8
	cmpl	%r9d, %r10d
	movl	%r9d, (%r14,%r11,4)
	cmovl	%r9d, %r10d
	movl	4(%r13,%rcx,4), %r9d
	cmpl	%r9d, %r15d
	movl	%r9d, (%r12,%r11,4)
	cmovl	%r9d, %r15d
	leal	1(%rax), %r9d
	cmpl	%r9d, %esi
	jle	.L32
	movl	8(%r13,%r8), %r9d
	cmpl	%r9d, %r10d
	movl	%r9d, 4(%r14,%rdi)
	cmovl	%r9d, %r10d
	addl	$3, %edx
	movslq	%edx, %rdx
	movl	0(%r13,%rdx,4), %edx
	cmpl	%edx, %r15d
	movl	%edx, 4(%r12,%rdi)
	cmovl	%edx, %r15d
	addl	$2, %eax
	cmpl	%eax, %esi
	jle	.L32
	movl	16(%r13,%r8), %eax
	cmpl	%eax, %r10d
	movl	%eax, 8(%r14,%rdi)
	cmovl	%eax, %r10d
	movl	20(%r13,%rcx,4), %eax
	cmpl	%eax, %r15d
	movl	%eax, 8(%r12,%rdi)
	cmovl	%eax, %r15d
.L32:
	subl	$1, %ebp
	movl	%r10d, %edx
	movq	%r14, %rcx
	movl	%r10d, 8(%rsp)
	leaq	40(%rsp), %r9
	leaq	32(%rsp), %r8
	movl	%ebp, %esi
	xorl	%edi, %edi
	movl	$-1, 32(%rsp)
	movl	$-1, 36(%rsp)
	movl	$0, 40(%rsp)
	movl	$0, 44(%rsp)
	call	_mode
	leaq	44(%rsp), %r9
	movq	%r12, %rcx
	movl	%r15d, %edx
	leaq	36(%rsp), %r8
	movl	%ebp, %esi
	xorl	%edi, %edi
	call	_mode
	movl	32(%rsp), %eax
	movl	8(%rsp), %edx
	movq	%r14, %rcx
	leaq	48(%rsp), %r9
	movl	%ebp, %esi
	xorl	%edi, %edi
	movl	$0, 48(%rsp)
	movl	%eax, %r8d
	movl	%eax, 12(%rsp)
	movl	$0, 52(%rsp)
	call	_mode2
	movl	36(%rsp), %r8d
	movl	%r15d, %edx
	movq	%r12, %rcx
	leaq	52(%rsp), %r9
	movl	%ebp, %esi
	xorl	%edi, %edi
	movl	%r8d, 8(%rsp)
	call	_mode2
	movl	8(%rsp), %r8d
	movl	12(%rsp), %eax
	movl	%ebx, %edx
	cmpl	%r8d, %eax
	je	.L34
	subl	40(%rsp), %edx
	subl	44(%rsp), %edx
.L35:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r13, %rdi
	call	free@PLT
	movq	%r14, %rdi
	call	free@PLT
	movq	%r12, %rdi
	call	free@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$72, %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
.L34:
	.cfi_restore_state
	subl	48(%rsp), %edx
	subl	40(%rsp), %ebx
	subl	44(%rsp), %edx
	subl	52(%rsp), %ebx
	cmpl	%ebx, %edx
	cmovg	%ebx, %edx
	jmp	.L35
.L26:
	movl	%ebx, %eax
	movl	$2, %ecx
	cltd
	idivl	%ecx
	movslq	%eax, %r12
	movq	%r12, %rbp
	salq	$2, %r12
	movq	%r12, %rdi
	call	malloc@PLT
	movq	%r12, %rdi
	movq	%rax, %r14
	call	malloc@PLT
	movq	%rax, %r12
.L28:
	xorl	%r15d, %r15d
	xorl	%r10d, %r10d
	jmp	.L32
.L37:
	xorl	%eax, %eax
	xorl	%r15d, %r15d
	xorl	%r10d, %r10d
	jmp	.L29
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE42:
	.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>
#include <stdlib.h>

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

void _mode(int a, int b, int max, int *A, int *mode, int *count){
  int *num;
  num=(int*)malloc((max+1)*sizeof(int));
  for(int i=0;i<=max;i++) num[i]=0;
  for(int i=a;i<=b;i++){
    num[A[i]]++;
  }
  for(int i=0;i<=max;i++){
    if(*count<num[i]){
      *count=num[i];
      *mode=i;
    }
  }
  free(num);
  return;
}

void _mode2(int a, int b, int max, int *A, int mode, int *count){
  int *num;
  num=(int*)malloc((max+1)*sizeof(int));
  for(int i=0;i<=max;i++) num[i]=0;
  for(int i=a;i<=b;i++){
    num[A[i]]++;
  }
  for(int i=0;i<=max;i++){
    if(i!=mode){
      if(*count<num[i]){
        *count=num[i];
      }
    }
  }
  free(num);
  return;
}

int main(){
  int n;
  int *v;
  scanf("%d",&n);
  v=(int*)malloc(n*sizeof(int));
  for(int i=0;i<n;i++) scanf("%d",&v[i]);

  int *odd;
  int *even;
  int odd_max=0;
  int even_max=0;
  odd=(int*)malloc((n/2)*sizeof(int));
  even=(int*)malloc((n/2)*sizeof(int));
  for(int i=0;i<(n/2);i++){
    odd[i]=v[2*i];
    if(odd[i]>odd_max) odd_max=odd[i];
    even[i]=v[2*i+1];
    if(even[i]>even_max) even_max=even[i];
  }
  /*for(int i=0;i<(n/2);i++){
    printf("odd[%d]=%d\neven[%d]=%d\n",i,odd[i],i,even[i]);
  }*/
  int mode_odd=-1;
  int mode_even=-1;
  int count_odd=0;
  int count_even=0;
  _mode(0,n/2-1,odd_max,odd,&mode_odd,&count_odd);
  _mode(0,n/2-1,even_max,even,&mode_even,&count_even);

  //printf("mode_odd=%d count_odd=%d\n",mode_odd,count_odd);
  //printf("mode_even=%d count_even=%d\n",mode_even,count_even);

  int count_odd2=0;
  int count_even2=0;
  _mode2(0,n/2-1,odd_max,odd,mode_odd,&count_odd2);
  _mode2(0,n/2-1,even_max,even,mode_even,&count_even2);

  //printf("count_odd2=%d count_even2=%d\n",count_odd2,count_even2);

  int times;
  if(mode_odd!=mode_even){
    times=n-count_odd-count_even;
  }else{
    times=min(n-count_odd-count_even2,n-count_odd2-count_even);
  }

  printf("%d\n",times);

  free(v);
  free(odd);
  free(even);
  return 0;
}
4
3 2 3 2
 6
105 119 204 119 105 119
 4
4 1 3 2
 6
105 120 54 119 105 78
 6
105 120 54 119 190 78
 6
105 119 204 119 105 78
 4
4 1 3 0
 6
105 119 54 119 105 78
 4
4 1 3 1
 4
4 1 6 1

0
 1
 2
 3
 4
 2
 2
 2
 1
 1

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

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

void _mode(int a, int b, int max, int *A, int *mode, int *count){
  int *num;
  num=(int*)malloc((max+1)*sizeof(int));
  for(int i=0;i<=max;i++) num[i]=0;
  for(int i=a;i<=b;i++){
    num[A[i]]++;
  }
  for(int i=0;i<=max;i++){
    if(*count<num[i]){
      *count=num[i];
      *mode=i;
    }
  }
  free(num);
  return;
}

void _mode2(int a, int b, int max, int *A, int mode, int *count){
  int *num;
  num=(int*)malloc((max+1)*sizeof(int));
  for(int i=0;i<=max;i++) num[i]=0;
  for(int i=a;i<=b;i++){
    num[A[i]]++;
  }
  for(int i=0;i<=max;i++){
    if(i!=mode){
      if(*count<num[i]){
        *count=num[i];
      }
    }
  }
  free(num);
  return;
}

int main(){
  int n;
  int *v;
  scanf("%d",&n);
  v=(int*)malloc(n*sizeof(int));
  for(int i=0;i<n;i++) scanf("%d",&v[i]);

  int *odd;
  int *even;
  int odd_max=0;
  int even_max=0;
  odd=(int*)malloc((n/2)*sizeof(int));
  even=(int*)malloc((n/2)*sizeof(int));
  for(int i=0;i<(n/2);i++){
    odd[i]=v[2*i];
    if(odd[i]>odd_max) odd_max=odd[i];
    even[i]=v[2*i+1];
    if(even[i]>even_max) even_max=even[i];
  }
  /*for(int i=0;i<(n/2);i++){
    printf("odd[%d]=%d\neven[%d]=%d\n",i,odd[i],i,even[i]);
  }*/
  int mode_odd=-1;
  int mode_even=-1;
  int count_odd=0;
  int count_even=0;
  _mode(0,n/2-1,odd_max,odd,&mode_odd,&count_odd);
  _mode(0,n/2-1,even_max,even,&mode_even,&count_even);

  //printf("mode_odd=%d count_odd=%d\n",mode_odd,count_odd);
  //printf("mode_even=%d count_even=%d\n",mode_even,count_even);

  int count_odd2=0;
  int count_even2=0;
  _mode2(0,n/2-1,odd_max,odd,mode_odd,&count_odd2);
  _mode2(0,n/2-1,even_max,even,mode_even,&count_even2);

  //printf("count_odd2=%d count_even2=%d\n",count_odd2,count_even2);

  int times;
  if(mode_odd!=mode_even){
    times=n-count_odd-count_even;
  }else{
    times=min(n-count_odd-count_even2,n-count_odd2-count_even);
  }

  printf("%d\n",times);

  free(v);
  free(odd);
  free(even);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.LFB6:
	.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), %eax
	cmpl	-8(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	min, .-min
	.globl	_mode
	.type	_mode, @function
_mode:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	%rcx, -56(%rbp)
	movq	%r8, -64(%rbp)
	movq	%r9, -72(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L6
	movl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -16(%rbp)
.L7:
	movl	-16(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L8
	movl	$0, -12(%rbp)
	jmp	.L9
.L11:
	movq	-72(%rbp), %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-8(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
.L10:
	addl	$1, -12(%rbp)
.L9:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L11
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_mode, .-_mode
	.globl	_mode2
	.type	_mode2, @function
_mode2:
.LFB8:
	.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
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	%rcx, -56(%rbp)
	movl	%r8d, -48(%rbp)
	movq	%r9, -64(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L15
	movl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L17
	movl	$0, -12(%rbp)
	jmp	.L18
.L20:
	movl	-12(%rbp), %eax
	cmpl	-48(%rbp), %eax
	je	.L19
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-8(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L19
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
.L19:
	addl	$1, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L20
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	_mode2, .-_mode2
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L23
.L24:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -52(%rbp)
.L23:
	movl	-80(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L24
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L25
.L28:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -48(%rbp)
	jge	.L26
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
.L26:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	jge	.L27
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
.L27:
	addl	$1, -40(%rbp)
.L25:
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40(%rbp)
	jl	.L28
	movl	$-1, -76(%rbp)
	movl	$-1, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-68(%rbp), %rdi
	leaq	-76(%rbp), %rcx
	movq	-24(%rbp), %rdx
	movl	-48(%rbp), %eax
	movq	%rdi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-64(%rbp), %rdi
	leaq	-72(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movl	-44(%rbp), %eax
	movq	%rdi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode
	movl	$0, -60(%rbp)
	movl	$0, -56(%rbp)
	movl	-76(%rbp), %ecx
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-60(%rbp), %rdi
	movq	-24(%rbp), %rdx
	movl	-48(%rbp), %eax
	movq	%rdi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode2
	movl	-72(%rbp), %ecx
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-56(%rbp), %rdi
	movq	-16(%rbp), %rdx
	movl	-44(%rbp), %eax
	movq	%rdi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode2
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %eax
	cmpl	%eax, %edx
	je	.L29
	movl	-80(%rbp), %eax
	movl	-68(%rbp), %edx
	subl	%edx, %eax
	movl	-64(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L30
.L29:
	movl	-80(%rbp), %eax
	movl	-60(%rbp), %edx
	subl	%edx, %eax
	movl	-64(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-80(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%ecx, %eax
	movl	-56(%rbp), %ecx
	subl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -36(%rbp)
.L30:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	min
	.type	min, @function
min:
.LFB6:
	.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), %eax
	cmpl	-8(%rbp), %eax
	jl	.L2
	movl	-8(%rbp), %eax
	jmp	.L3
.L2:
	movl	-4(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	min, .-min
	.globl	_mode
	.type	_mode, @function
_mode:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	%rcx, -56(%rbp)
	movq	%r8, -64(%rbp)
	movq	%r9, -72(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L5
.L6:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -20(%rbp)
.L5:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L6
	movl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -16(%rbp)
.L7:
	movl	-16(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L8
	movl	$0, -12(%rbp)
	jmp	.L9
.L11:
	movq	-72(%rbp), %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-8(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L10
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rax
	movl	%edx, (%rax)
	movq	-64(%rbp), %rax
	movl	-12(%rbp), %edx
	movl	%edx, (%rax)
.L10:
	addl	$1, -12(%rbp)
.L9:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L11
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	_mode, .-_mode
	.globl	_mode2
	.type	_mode2, @function
_mode2:
.LFB8:
	.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
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	%edx, -44(%rbp)
	movq	%rcx, -56(%rbp)
	movl	%r8d, -48(%rbp)
	movq	%r9, -64(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movl	$0, -20(%rbp)
	jmp	.L14
.L15:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
	addl	$1, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L15
	movl	-36(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L16
.L17:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-56(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	addl	$1, %edx
	movl	%edx, (%rax)
	addl	$1, -16(%rbp)
.L16:
	movl	-16(%rbp), %eax
	cmpl	-40(%rbp), %eax
	jle	.L17
	movl	$0, -12(%rbp)
	jmp	.L18
.L20:
	movl	-12(%rbp), %eax
	cmpl	-48(%rbp), %eax
	je	.L19
	movq	-64(%rbp), %rax
	movl	(%rax), %edx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	movq	-8(%rbp), %rax
	addq	%rcx, %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	jge	.L19
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-8(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %edx
	movq	-64(%rbp), %rax
	movl	%edx, (%rax)
.L19:
	addl	$1, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	cmpl	-44(%rbp), %eax
	jle	.L20
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	_mode2, .-_mode2
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-80(%rbp), %eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -32(%rbp)
	movl	$0, -52(%rbp)
	jmp	.L23
.L24:
	movl	-52(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -52(%rbp)
.L23:
	movl	-80(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L24
	movl	$0, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -24(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cltq
	salq	$2, %rax
	movq	%rax, %rdi
	call	malloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L25
.L28:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -48(%rbp)
	jge	.L26
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
.L26:
	movl	-40(%rbp), %eax
	addl	%eax, %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movl	-40(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -44(%rbp)
	jge	.L27
	movl	-40(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
.L27:
	addl	$1, -40(%rbp)
.L25:
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40(%rbp)
	jl	.L28
	movl	$-1, -76(%rbp)
	movl	$-1, -72(%rbp)
	movl	$0, -68(%rbp)
	movl	$0, -64(%rbp)
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-68(%rbp), %rdi
	leaq	-76(%rbp), %rcx
	movq	-24(%rbp), %rdx
	movl	-48(%rbp), %eax
	movq	%rdi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-64(%rbp), %rdi
	leaq	-72(%rbp), %rcx
	movq	-16(%rbp), %rdx
	movl	-44(%rbp), %eax
	movq	%rdi, %r9
	movq	%rcx, %r8
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode
	movl	$0, -60(%rbp)
	movl	$0, -56(%rbp)
	movl	-76(%rbp), %ecx
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-60(%rbp), %rdi
	movq	-24(%rbp), %rdx
	movl	-48(%rbp), %eax
	movq	%rdi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode2
	movl	-72(%rbp), %ecx
	movl	-80(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	-1(%rax), %esi
	leaq	-56(%rbp), %rdi
	movq	-16(%rbp), %rdx
	movl	-44(%rbp), %eax
	movq	%rdi, %r9
	movl	%ecx, %r8d
	movq	%rdx, %rcx
	movl	%eax, %edx
	movl	$0, %edi
	call	_mode2
	movl	-76(%rbp), %edx
	movl	-72(%rbp), %eax
	cmpl	%eax, %edx
	je	.L29
	movl	-80(%rbp), %eax
	movl	-68(%rbp), %edx
	subl	%edx, %eax
	movl	-64(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -36(%rbp)
	jmp	.L30
.L29:
	movl	-80(%rbp), %eax
	movl	-60(%rbp), %edx
	subl	%edx, %eax
	movl	-64(%rbp), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-80(%rbp), %eax
	movl	-68(%rbp), %ecx
	subl	%ecx, %eax
	movl	-56(%rbp), %ecx
	subl	%ecx, %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	min
	movl	%eax, -36(%rbp)
.L30:
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
