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>
#define mMin(a, b) ((a) < (b))? (a) : (b)

int H, N;
int A[1010], B[1010];
int dp[10010], min;

int main()
{
    scanf("%d %d",&H,&N);
    for ( int i=0; i<N; i++ ) scanf("%d %d",&A[i],&B[i]);
    
    for (int h=1; h<=H; h++){
        min = 1e9;
        
        for (int n=0; n<N; n++){
            if (A[n] < h) min = mMin(min, B[n] + dp[h-A[n]]);
            else          min = mMin(min, B[n]);
        }
        dp[h] = min;
    }
    
    printf("%d\n",dp[H]);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	N(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	A(%rip), %r12
	xorl	%ebx, %ebx
	leaq	B(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jg	.L3
.L2:
	movslq	H(%rip), %r13
	leaq	dp(%rip), %r11
	testl	%r13d, %r13d
	jle	.L4
	leal	1(%r13), %r12d
	movl	$1, %edi
	movslq	%ebp, %r10
	leaq	A(%rip), %r9
	leaq	B(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %ebx
	testl	%ebp, %ebp
	jle	.L10
	xorl	%eax, %eax
	movl	$1000000000, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r14d
	subl	%esi, %r14d
	movslq	%r14d, %rsi
	addl	(%r11,%rsi,4), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	je	.L5
.L8:
	movl	(%r9,%rax,4), %esi
	movl	(%r8,%rax,4), %edx
	cmpl	%edi, %esi
	jl	.L17
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L8
.L5:
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
.L18:
	movl	%ecx, min(%rip)
.L4:
	movl	(%r11,%r13,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1000000000, %ecx
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
	jmp	.L18
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	min
	.bss
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 4040
B:
	.zero	4040
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 4040
A:
	.zero	4040
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

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 %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	N(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	A(%rip), %r12
	xorl	%ebx, %ebx
	leaq	B(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jg	.L3
.L2:
	movslq	H(%rip), %r13
	leaq	dp(%rip), %r11
	testl	%r13d, %r13d
	jle	.L4
	leal	1(%r13), %r12d
	movl	$1, %edi
	movslq	%ebp, %r10
	leaq	A(%rip), %r9
	leaq	B(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %ebx
	testl	%ebp, %ebp
	jle	.L10
	xorl	%eax, %eax
	movl	$1000000000, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r14d
	subl	%esi, %r14d
	movslq	%r14d, %rsi
	addl	(%r11,%rsi,4), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	je	.L5
.L8:
	movl	(%r9,%rax,4), %esi
	movl	(%r8,%rax,4), %edx
	cmpl	%edi, %esi
	jl	.L17
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L8
.L5:
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
.L18:
	movl	%ecx, min(%rip)
.L4:
	movl	(%r11,%r13,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1000000000, %ecx
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
	jmp	.L18
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	min
	.bss
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 4040
B:
	.zero	4040
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 4040
A:
	.zero	4040
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	N(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	A(%rip), %r12
	xorl	%ebx, %ebx
	leaq	B(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jg	.L3
.L2:
	movslq	H(%rip), %r13
	leaq	dp(%rip), %r11
	testl	%r13d, %r13d
	jle	.L4
	leal	1(%r13), %r12d
	movl	$1, %edi
	movslq	%ebp, %r10
	leaq	A(%rip), %r9
	leaq	B(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %ebx
	testl	%ebp, %ebp
	jle	.L10
	xorl	%eax, %eax
	movl	$1000000000, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r14d
	subl	%esi, %r14d
	movslq	%r14d, %rsi
	addl	(%r11,%rsi,4), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	je	.L5
.L8:
	movl	(%r9,%rax,4), %esi
	movl	(%r8,%rax,4), %edx
	cmpl	%edi, %esi
	jl	.L17
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L8
.L5:
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
.L18:
	movl	%ecx, min(%rip)
.L4:
	movl	(%r11,%r13,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1000000000, %ecx
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
	jmp	.L18
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	min
	.bss
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 4040
B:
	.zero	4040
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 4040
A:
	.zero	4040
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <stdio.h>
#define mMin(a, b) ((a) < (b))? (a) : (b)

int H, N;
int A[1010], B[1010];
int dp[10010], min;

int main()
{
    scanf("%d %d",&H,&N);
    for ( int i=0; i<N; i++ ) scanf("%d %d",&A[i],&B[i]);
    
    for (int h=1; h<=H; h++){
        min = 1e9;
        
        for (int n=0; n<N; n++){
            if (A[n] < h) min = mMin(min, B[n] + dp[h-A[n]]);
            else          min = mMin(min, B[n]);
        }
        dp[h] = min;
    }
    
    printf("%d\n",dp[H]);
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#define mMin(a, b) ((a) < (b))? (a) : (b)

int H, N;
int A[1010], B[1010];
int dp[10010], min;

int main()
{
    scanf("%d %d",&H,&N);
    for ( int i=0; i<N; i++ ) scanf("%d %d",&A[i],&B[i]);
    
    for (int h=1; h<=H; h++){
        min = 1e9;
        
        for (int n=0; n<N; n++){
            if (A[n] < h) min = mMin(min, B[n] + dp[h-A[n]]);
            else          min = mMin(min, B[n]);
        }
        dp[h] = min;
    }
    
    printf("%d\n",dp[H]);
}
```

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:

9999 10
540 7550
691 13640
700 9790
510 7150
415 5818
551 7712
587 8227
619 8671
588 8228
176 2461
 100 6
1 1
2 3
3 9
4 27
5 81
5 243
 110 6
1 1
2 3
3 9
4 27
5 81
5 243
 9999 10
540 7550
691 20670
700 9790
863 7150
415 5818
551 7712
587 8227
619 8671
588 8228
176 2461
 9999 10
540 7550
691 20670
700 9790
863 7150
415 1114
551 7712
587 8227
941 8671
588 10398
176 2461
 9999 5
540 4853
1222 7523
1778 16913
231 7150
415 769
118 7712
1118 8227
908 8671
94 4378
37 2120
 9999 5
289 4853
1222 12181
1778 16913
231 7150
415 1085
118 7712
1118 8227
1028 8975
94 5576
37 2120

139815
 100
 110
 85800
 27850
 19225
 27125

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>
#define mMin(a, b) ((a) < (b))? (a) : (b)

int H, N;
int A[1010], B[1010];
int dp[10010], min;

int main()
{
    scanf("%d %d",&H,&N);
    for ( int i=0; i<N; i++ ) scanf("%d %d",&A[i],&B[i]);
    
    for (int h=1; h<=H; h++){
        min = 1e9;
        
        for (int n=0; n<N; n++){
            if (A[n] < h) min = mMin(min, B[n] + dp[h-A[n]]);
            else          min = mMin(min, B[n]);
        }
        dp[h] = min;
    }
    
    printf("%d\n",dp[H]);
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	N(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	A(%rip), %r12
	xorl	%ebx, %ebx
	leaq	B(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jg	.L3
.L2:
	movslq	H(%rip), %r13
	leaq	dp(%rip), %r11
	testl	%r13d, %r13d
	jle	.L4
	leal	1(%r13), %r12d
	movl	$1, %edi
	movslq	%ebp, %r10
	leaq	A(%rip), %r9
	leaq	B(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %ebx
	testl	%ebp, %ebp
	jle	.L10
	xorl	%eax, %eax
	movl	$1000000000, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r14d
	subl	%esi, %r14d
	movslq	%r14d, %rsi
	addl	(%r11,%rsi,4), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	je	.L5
.L8:
	movl	(%r9,%rax,4), %esi
	movl	(%r8,%rax,4), %edx
	cmpl	%edi, %esi
	jl	.L17
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L8
.L5:
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
.L18:
	movl	%ecx, min(%rip)
.L4:
	movl	(%r11,%r13,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1000000000, %ecx
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
	jmp	.L18
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	min
	.bss
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 4040
B:
	.zero	4040
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 4040
A:
	.zero	4040
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

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 %d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	N(%rip), %rdx
	leaq	H(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	testl	%ebp, %ebp
	jle	.L2
	leaq	A(%rip), %r12
	xorl	%ebx, %ebx
	leaq	B(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r14,%rbx,4), %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	N(%rip), %ebp
	addq	$1, %rbx
	addq	$4, %r12
	cmpl	%ebx, %ebp
	jg	.L3
.L2:
	movslq	H(%rip), %r13
	leaq	dp(%rip), %r11
	testl	%r13d, %r13d
	jle	.L4
	leal	1(%r13), %r12d
	movl	$1, %edi
	movslq	%ebp, %r10
	leaq	A(%rip), %r9
	leaq	B(%rip), %r8
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, %ebx
	testl	%ebp, %ebp
	jle	.L10
	xorl	%eax, %eax
	movl	$1000000000, %ecx
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%ebx, %r14d
	subl	%esi, %r14d
	movslq	%r14d, %rsi
	addl	(%r11,%rsi,4), %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	je	.L5
.L8:
	movl	(%r9,%rax,4), %esi
	movl	(%r8,%rax,4), %edx
	cmpl	%edi, %esi
	jl	.L17
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	addq	$1, %rax
	cmpq	%rax, %r10
	jne	.L8
.L5:
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
.L18:
	movl	%ecx, min(%rip)
.L4:
	movl	(%r11,%r13,4), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	movl	$1000000000, %ecx
	movl	%ecx, (%r11,%rdi,4)
	addq	$1, %rdi
	cmpq	%rdi, %r12
	jne	.L9
	jmp	.L18
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	min
	.bss
	.align 4
	.type	min, @object
	.size	min, 4
min:
	.zero	4
	.globl	dp
	.align 32
	.type	dp, @object
	.size	dp, 40040
dp:
	.zero	40040
	.globl	B
	.align 32
	.type	B, @object
	.size	B, 4040
B:
	.zero	4040
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 4040
A:
	.zero	4040
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	H
	.align 4
	.type	H, @object
	.size	H, 4
H:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```