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 di[100000];
int hi[100000];

#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(){
  int n, h; scanf("%d%d", &n, &h);
  int i;
  int pos = 0;
  int hp  = h;
  int cnt = 0;

  for(i = 0; i < n - 1; i++)
    scanf("%d%d", di+i, hi+i);

  while(1){
    int mxv = -1;
    int memohp  = 0;
    int memopos = 0;

    // printf("pos: %d, hp: %d\n", pos, hp);

    while(1){
      if(mxv <= MIN(h - hp, hi[pos])){
        mxv     = MIN(h - hp, hi[pos]);
        memohp  = hp;
        memopos = pos;
      }

      if((hp -= di[pos]) > 0){
        ++pos;
      }else{
        break;
      }

      if(pos == n - 1){
        printf("%d\n", cnt);
        return 0;
      }
    }

    pos = memopos;
    hp  = MIN(memohp + hi[pos], h);
    cnt++;
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	di
	.bss
	.align 32
	.type	di, @object
	.size	di, 400000
di:
	.zero	400000
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 400000
hi:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	di(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L2:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
.L11:
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L4
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	di(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -28(%rbp)
	cmpl	$0, -28(%rbp)
	jle	.L14
	addl	$1, -32(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jne	.L10
	movl	-24(%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	.L12
	jmp	.L13
.L14:
	nop
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -28(%rbp)
	addl	$1, -24(%rbp)
	jmp	.L11
.L13:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.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	%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
	leaq	di(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	hi(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	4(%rsp), %ebx
	leal	-1(%rax), %esi
	testl	%esi, %esi
	jle	.L13
	movq	%r13, %r15
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	leaq	(%r12,%rbp,4), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	addq	$1, %rbp
	addq	$4, %r15
	leal	-1(%rax), %esi
	cmpl	%ebp, %esi
	jg	.L3
	movl	4(%rsp), %r8d
.L2:
	xorl	%r11d, %r11d
	xorl	%eax, %eax
.L7:
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	movl	$-1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	cmpl	%eax, %esi
	je	.L16
.L6:
	movl	(%r12,%rax,4), %ecx
	movl	%r8d, %edx
	subl	%ebx, %edx
	cmpl	%ecx, %edx
	cmovg	%ecx, %edx
	cmpl	%edi, %edx
	jl	.L4
	movl	%eax, %r10d
	movl	%ebx, %r9d
	movl	%edx, %edi
.L4:
	subl	0(%r13,%rax,4), %ebx
	testl	%ebx, %ebx
	jg	.L17
	movslq	%r10d, %rax
	addl	(%r12,%rax,4), %r9d
	cmpl	%r8d, %r9d
	movl	%r9d, %ebx
	cmovg	%r8d, %ebx
	addl	$1, %r11d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$24, %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
.L13:
	.cfi_restore_state
	movl	%ebx, %r8d
	jmp	.L2
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	hi
	.bss
	.align 32
	.type	hi, @object
	.size	hi, 400000
hi:
	.zero	400000
	.globl	di
	.align 32
	.type	di, @object
	.size	di, 400000
di:
	.zero	400000
	.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
	.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	%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
	leaq	di(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	hi(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	movl	4(%rsp), %ebx
	leal	-1(%rax), %esi
	testl	%esi, %esi
	jle	.L13
	movq	%r13, %r15
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r15, %rsi
	leaq	(%r12,%rbp,4), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %eax
	addq	$1, %rbp
	addq	$4, %r15
	leal	-1(%rax), %esi
	cmpl	%ebp, %esi
	jg	.L3
	movl	4(%rsp), %r8d
.L2:
	xorl	%r11d, %r11d
	xorl	%eax, %eax
.L7:
	xorl	%r10d, %r10d
	xorl	%r9d, %r9d
	movl	$-1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L17:
	addq	$1, %rax
	cmpl	%eax, %esi
	je	.L16
.L6:
	movl	(%r12,%rax,4), %ecx
	movl	%r8d, %edx
	subl	%ebx, %edx
	cmpl	%ecx, %edx
	cmovg	%ecx, %edx
	cmpl	%edi, %edx
	jl	.L4
	movl	%eax, %r10d
	movl	%ebx, %r9d
	movl	%edx, %edi
.L4:
	subl	0(%r13,%rax,4), %ebx
	testl	%ebx, %ebx
	jg	.L17
	movslq	%r10d, %rax
	addl	(%r12,%rax,4), %r9d
	cmpl	%r8d, %r9d
	movl	%r9d, %ebx
	cmovg	%r8d, %ebx
	addl	$1, %r11d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L18
	addq	$24, %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
.L13:
	.cfi_restore_state
	movl	%ebx, %r8d
	jmp	.L2
.L18:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	hi
	.bss
	.align 32
	.type	hi, @object
	.size	hi, 400000
hi:
	.zero	400000
	.globl	di
	.align 32
	.type	di, @object
	.size	di, 400000
di:
	.zero	400000
	.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 di[100000];
int hi[100000];

#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(){
  int n, h; scanf("%d%d", &n, &h);
  int i;
  int pos = 0;
  int hp  = h;
  int cnt = 0;

  for(i = 0; i < n - 1; i++)
    scanf("%d%d", di+i, hi+i);

  while(1){
    int mxv = -1;
    int memohp  = 0;
    int memopos = 0;

    // printf("pos: %d, hp: %d\n", pos, hp);

    while(1){
      if(mxv <= MIN(h - hp, hi[pos])){
        mxv     = MIN(h - hp, hi[pos]);
        memohp  = hp;
        memopos = pos;
      }

      if((hp -= di[pos]) > 0){
        ++pos;
      }else{
        break;
      }

      if(pos == n - 1){
        printf("%d\n", cnt);
        return 0;
      }
    }

    pos = memopos;
    hp  = MIN(memohp + hi[pos], h);
    cnt++;
  }
}
10 10
4 3
2 5
6 1
7 3
6 4
9 6
0 8
4 1
9 4
 10 10
4 3
2 5
6 1
6 3
6 4
9 6
0 8
4 1
9 4
 10 10
4 3
2 3
6 1
3 3
6 4
9 6
0 8
2 1
9 4
 5 10
4 3
2 3
6 1
6 3
6 4
9 6
0 8
4 1
9 4
 10 10
4 3
2 3
1 1
6 3
6 4
9 9
0 8
4 1
9 4
 10 19
4 3
2 3
1 1
6 3
6 4
9 9
0 8
4 1
9 4
 10 19
4 3
2 3
1 1
6 3
3 4
4 13
0 8
4 1
9 4
 10 10
2 3
2 3
6 1
3 4
6 4
9 6
0 10
0 1
9 8
 10 19
4 3
2 3
1 1
6 3
3 4
4 13
0 8
7 1
1 4
 8 19
4 4
0 3
1 1
6 3
3 4
4 13
0 8
1 1
1 4

10
 9
 8
 3
 7
 4
 2
 6
 1
 0

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 di[100000];
int hi[100000];

#define MIN(a, b) ((a) < (b) ? (a) : (b))

int main(){
  int n, h; scanf("%d%d", &n, &h);
  int i;
  int pos = 0;
  int hp  = h;
  int cnt = 0;

  for(i = 0; i < n - 1; i++)
    scanf("%d%d", di+i, hi+i);

  while(1){
    int mxv = -1;
    int memohp  = 0;
    int memopos = 0;

    // printf("pos: %d, hp: %d\n", pos, hp);

    while(1){
      if(mxv <= MIN(h - hp, hi[pos])){
        mxv     = MIN(h - hp, hi[pos]);
        memohp  = hp;
        memopos = pos;
      }

      if((hp -= di[pos]) > 0){
        ++pos;
      }else{
        break;
      }

      if(pos == n - 1){
        printf("%d\n", cnt);
        return 0;
      }
    }

    pos = memopos;
    hp  = MIN(memohp + hi[pos], h);
    cnt++;
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	di
	.bss
	.align 32
	.type	di, @object
	.size	di, 400000
di:
	.zero	400000
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 400000
hi:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	di(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L2:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
.L11:
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L4
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	di(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -28(%rbp)
	cmpl	$0, -28(%rbp)
	jle	.L14
	addl	$1, -32(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jne	.L10
	movl	-24(%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	.L12
	jmp	.L13
.L14:
	nop
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -28(%rbp)
	addl	$1, -24(%rbp)
	jmp	.L11
.L13:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	di
	.bss
	.align 32
	.type	di, @object
	.size	di, 400000
di:
	.zero	400000
	.globl	hi
	.align 32
	.type	hi, @object
	.size	hi, 400000
hi:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -32(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	$0, -24(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L2
.L3:
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	addq	%rax, %rdx
	movl	-36(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	di(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -36(%rbp)
.L2:
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jl	.L3
.L11:
	movl	$-1, -20(%rbp)
	movl	$0, -16(%rbp)
	movl	$0, -12(%rbp)
.L10:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L4
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-40(%rbp), %eax
	subl	-28(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -16(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -12(%rbp)
.L4:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	di(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	%eax, -28(%rbp)
	cmpl	$0, -28(%rbp)
	jle	.L14
	addl	$1, -32(%rbp)
	movl	-44(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -32(%rbp)
	jne	.L10
	movl	-24(%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	.L12
	jmp	.L13
.L14:
	nop
	movl	-12(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	hi(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	addl	%eax, %edx
	movl	-40(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -28(%rbp)
	addl	$1, -24(%rbp)
	jmp	.L11
.L13:
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
