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>

int main(void){
	int n;
	int t[1000] = {0}, a[1000] = {0};
	unsigned long x, y, p, q;

	scanf("%d", &n);
	for(int i=0; i < n; i++) {
		scanf("%d%d", &t[i], &a[i]);
	}

	x = y = 1;
	for(int i=0; i < n; i++) {
		if(x%t[i])
			x += t[i] - x%t[i];
		if(y%a[i])
			y += a[i] - y%a[i];
		p = x / t[i];
		q = y / a[i];
		if(p < q)
			p = q;

		x = p * t[i];
		y = p * a[i];
	}
	printf("%lu", x + y);

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lu"
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	leaq	4016(%rsp), %rbx
	movq	%rbp, %r13
	rep stosq
	movl	$500, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rbx,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r9
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L4
	testl	%r9d, %r9d
	jle	.L5
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %r10d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	addq	%rsi, %rcx
	subq	%rdx, %rcx
	xorl	%edx, %edx
	movq	%rcx, %rax
	divq	%rsi
	xorl	%edx, %edx
	movq	%rax, %rcx
	movq	%r10, %rax
	divq	%rdi
	cmpq	%rax, %rcx
	cmovb	%rax, %rcx
.L17:
	imulq	%rcx, %rdi
	addq	$1, %r8
	imulq	%rsi, %rcx
	movq	%rdi, %r10
	cmpq	%r8, %r9
	je	.L3
.L9:
	movslq	0(%rbp,%r8,4), %rdi
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%rdi
	leaq	(%rdi,%r10), %rsi
	movq	%rcx, %rax
	subq	%rdx, %rsi
	testq	%rdx, %rdx
	cmovne	%rsi, %r10
	movslq	(%rbx,%r8,4), %rsi
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r11
	testq	%rdx, %rdx
	jne	.L19
	xorl	%edx, %edx
	movq	%r10, %rax
	movq	%r11, %rcx
	divq	%rdi
	cmpq	%r11, %rax
	cmovnb	%rax, %rcx
	jmp	.L17
.L5:
	movl	$1, %ecx
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	leaq	(%r10,%rcx), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
.LC2:
	.string	"%lu"
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	leaq	4016(%rsp), %rbx
	movq	%rbp, %r13
	rep stosq
	movl	$500, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rbx,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r9
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L4
	testl	%r9d, %r9d
	jle	.L5
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %r10d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	addq	%rsi, %rcx
	subq	%rdx, %rcx
	xorl	%edx, %edx
	movq	%rcx, %rax
	divq	%rsi
	xorl	%edx, %edx
	movq	%rax, %rcx
	movq	%r10, %rax
	divq	%rdi
	cmpq	%rax, %rcx
	cmovb	%rax, %rcx
.L17:
	imulq	%rcx, %rdi
	addq	$1, %r8
	imulq	%rsi, %rcx
	movq	%rdi, %r10
	cmpq	%r8, %r9
	je	.L3
.L9:
	movslq	0(%rbp,%r8,4), %rdi
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%rdi
	leaq	(%rdi,%r10), %rsi
	movq	%rcx, %rax
	subq	%rdx, %rsi
	testq	%rdx, %rdx
	cmovne	%rsi, %r10
	movslq	(%rbx,%r8,4), %rsi
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r11
	testq	%rdx, %rdx
	jne	.L19
	xorl	%edx, %edx
	movq	%r10, %rax
	movq	%r11, %rcx
	divq	%rdi
	cmpq	%r11, %rax
	cmovnb	%rax, %rcx
	jmp	.L17
.L5:
	movl	$1, %ecx
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	leaq	(%r10,%rcx), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
.LC2:
	.string	"%lu"
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	leaq	4016(%rsp), %rbx
	movq	%rbp, %r13
	rep stosq
	movl	$500, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rbx,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r9
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L4
	testl	%r9d, %r9d
	jle	.L5
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %r10d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	addq	%rsi, %rcx
	subq	%rdx, %rcx
	xorl	%edx, %edx
	movq	%rcx, %rax
	divq	%rsi
	xorl	%edx, %edx
	movq	%rax, %rcx
	movq	%r10, %rax
	divq	%rdi
	cmpq	%rax, %rcx
	cmovb	%rax, %rcx
.L17:
	imulq	%rcx, %rdi
	addq	$1, %r8
	imulq	%rsi, %rcx
	movq	%rdi, %r10
	cmpq	%r8, %r9
	je	.L3
.L9:
	movslq	0(%rbp,%r8,4), %rdi
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%rdi
	leaq	(%rdi,%r10), %rsi
	movq	%rcx, %rax
	subq	%rdx, %rsi
	testq	%rdx, %rdx
	cmovne	%rsi, %r10
	movslq	(%rbx,%r8,4), %rsi
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r11
	testq	%rdx, %rdx
	jne	.L19
	xorl	%edx, %edx
	movq	%r10, %rax
	movq	%r11, %rcx
	divq	%rdi
	cmpq	%r11, %rax
	cmovnb	%rax, %rcx
	jmp	.L17
.L5:
	movl	$1, %ecx
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	leaq	(%r10,%rcx), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main(void){
	int n;
	int t[1000] = {0}, a[1000] = {0};
	unsigned long x, y, p, q;

	scanf("%d", &n);
	for(int i=0; i < n; i++) {
		scanf("%d%d", &t[i], &a[i]);
	}

	x = y = 1;
	for(int i=0; i < n; i++) {
		if(x%t[i])
			x += t[i] - x%t[i];
		if(y%a[i])
			y += a[i] - y%a[i];
		p = x / t[i];
		q = y / a[i];
		if(p < q)
			p = q;

		x = p * t[i];
		y = p * a[i];
	}
	printf("%lu", x + y);

	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(void){
	int n;
	int t[1000] = {0}, a[1000] = {0};
	unsigned long x, y, p, q;

	scanf("%d", &n);
	for(int i=0; i < n; i++) {
		scanf("%d%d", &t[i], &a[i]);
	}

	x = y = 1;
	for(int i=0; i < n; i++) {
		if(x%t[i])
			x += t[i] - x%t[i];
		if(y%a[i])
			y += a[i] - y%a[i];
		p = x / t[i];
		q = y / a[i];
		if(p < q)
			p = q;

		x = p * t[i];
		y = p * a[i];
	}
	printf("%lu", x + y);

	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
3 1
48 17
31 199
231 23
3 2
 4
1 1
1 1
1 9
1 100
 3
3 3
1 1
3 2
 3
4 3
1 1
3 1
 3
4 3
1 2
3 1
 3
2 3
1 1
1 2
 4
1 2
1 1
1 9
1 100
 5
3 10
48 28
31 199
319 23
3 2
 3
4 3
1 1
1 2
 5
3 10
48 28
31 199
300 23
3 2

6930 101 10 16 32 9 202 9570 12 9000
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>

int main(void){
	int n;
	int t[1000] = {0}, a[1000] = {0};
	unsigned long x, y, p, q;

	scanf("%d", &n);
	for(int i=0; i < n; i++) {
		scanf("%d%d", &t[i], &a[i]);
	}

	x = y = 1;
	for(int i=0; i < n; i++) {
		if(x%t[i])
			x += t[i] - x%t[i];
		if(y%a[i])
			y += a[i] - y%a[i];
		p = x / t[i];
		q = y / a[i];
		if(p < q)
			p = q;

		x = p * t[i];
		y = p * a[i];
	}
	printf("%lu", x + y);

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%lu"
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	leaq	4016(%rsp), %rbx
	movq	%rbp, %r13
	rep stosq
	movl	$500, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rbx,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r9
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L4
	testl	%r9d, %r9d
	jle	.L5
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %r10d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	addq	%rsi, %rcx
	subq	%rdx, %rcx
	xorl	%edx, %edx
	movq	%rcx, %rax
	divq	%rsi
	xorl	%edx, %edx
	movq	%rax, %rcx
	movq	%r10, %rax
	divq	%rdi
	cmpq	%rax, %rcx
	cmovb	%rax, %rcx
.L17:
	imulq	%rcx, %rdi
	addq	$1, %r8
	imulq	%rsi, %rcx
	movq	%rdi, %r10
	cmpq	%r8, %r9
	je	.L3
.L9:
	movslq	0(%rbp,%r8,4), %rdi
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%rdi
	leaq	(%rdi,%r10), %rsi
	movq	%rcx, %rax
	subq	%rdx, %rsi
	testq	%rdx, %rdx
	cmovne	%rsi, %r10
	movslq	(%rbx,%r8,4), %rsi
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r11
	testq	%rdx, %rdx
	jne	.L19
	xorl	%edx, %edx
	movq	%r10, %rax
	movq	%r11, %rcx
	divq	%rdi
	cmpq	%r11, %rax
	cmovnb	%rax, %rcx
	jmp	.L17
.L5:
	movl	$1, %ecx
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	leaq	(%r10,%rcx), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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"
.LC2:
	.string	"%lu"
	.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
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$3936, %rsp
	.cfi_def_cfa_offset 8080
	movl	$500, %ecx
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 8024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	12(%rsp), %rsi
	movq	%rbp, %rdi
	leaq	4016(%rsp), %rbx
	movq	%rbp, %r13
	rep stosq
	movl	$500, %ecx
	movq	%rbx, %rdi
	rep stosq
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	leaq	(%rbx,%r12,4), %rdx
	movq	%r13, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %r9
	addq	$1, %r12
	addq	$4, %r13
	cmpl	%r12d, %r9d
	jg	.L4
	testl	%r9d, %r9d
	jle	.L5
	xorl	%r8d, %r8d
	movl	$1, %ecx
	movl	$1, %r10d
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L19:
	addq	%rsi, %rcx
	subq	%rdx, %rcx
	xorl	%edx, %edx
	movq	%rcx, %rax
	divq	%rsi
	xorl	%edx, %edx
	movq	%rax, %rcx
	movq	%r10, %rax
	divq	%rdi
	cmpq	%rax, %rcx
	cmovb	%rax, %rcx
.L17:
	imulq	%rcx, %rdi
	addq	$1, %r8
	imulq	%rsi, %rcx
	movq	%rdi, %r10
	cmpq	%r8, %r9
	je	.L3
.L9:
	movslq	0(%rbp,%r8,4), %rdi
	movq	%r10, %rax
	xorl	%edx, %edx
	divq	%rdi
	leaq	(%rdi,%r10), %rsi
	movq	%rcx, %rax
	subq	%rdx, %rsi
	testq	%rdx, %rdx
	cmovne	%rsi, %r10
	movslq	(%rbx,%r8,4), %rsi
	xorl	%edx, %edx
	divq	%rsi
	movq	%rax, %r11
	testq	%rdx, %rdx
	jne	.L19
	xorl	%edx, %edx
	movq	%r10, %rax
	movq	%r11, %rcx
	divq	%rdi
	cmpq	%r11, %rax
	cmovnb	%rax, %rcx
	jmp	.L17
.L5:
	movl	$1, %ecx
	movl	$1, %r10d
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	leaq	(%r10,%rcx), %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	8024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$8032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	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
.L20:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```