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 main(){
    long N,min[2]={1,1},data[2],a,b,i;
    scanf("%ld",&N);
    for(i=0;i<N;i++){
        scanf("%ld",&data[0]);
        scanf("%ld",&data[1]);
        if(min[0]%data[0]==0){
            a=min[0]/data[0];
        }
        else{
            a=min[0]/data[0]+1;
        }
        if(min[1]%data[1]==0){
            b=min[1]/data[1];
    }
        else{
            b=min[1]/data[1]+1;
        }
        if(a<b){
            a=b;
        }
        min[0]=data[0]*a;
        min[1]=data[1]*a;
    }
    printf("%ld\n",min[0]+min[1]);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -48(%rbp)
	movq	$1, -40(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -56(%rbp)
	jmp	.L2
.L8:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-32(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rax, -72(%rbp)
	jmp	.L4
.L3:
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rsi
	cqto
	idivq	%rsi
	addq	$1, %rax
	movq	%rax, -72(%rbp)
.L4:
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L5
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdi
	cqto
	idivq	%rdi
	movq	%rax, -64(%rbp)
	jmp	.L6
.L5:
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rcx
	cqto
	idivq	%rcx
	addq	$1, %rax
	movq	%rax, -64(%rbp)
.L6:
	movq	-72(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	.L7
	movq	-64(%rbp), %rax
	movq	%rax, -72(%rbp)
.L7:
	movq	-32(%rbp), %rax
	imulq	-72(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-24(%rbp), %rax
	imulq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	addq	$1, -56(%rbp)
.L2:
	movq	-80(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jl	.L8
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	"%ld"
.LC1:
	.string	"%ld\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
	movl	$1, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	movl	$1, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r13
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rax
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rsi
	cqto
	idivq	%rdi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	cmpq	%rax, %rcx
	cmovge	%rcx, %rax
	addq	$1, %r15
	imulq	%rax, %rdi
	movq	%rax, %rbx
	imulq	%rsi, %rbx
	movq	%rdi, %r14
	cmpq	%r15, 8(%rsp)
	jg	.L6
.L2:
	xorl	%eax, %eax
	leaq	(%r14,%rbx), %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$56, %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
.L14:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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
	movl	$1, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movq	%rbp, %rdi
	movl	$1, %ebx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%r15d, %r15d
	leaq	16(%rsp), %r13
	leaq	24(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%r14, %rax
	movq	16(%rsp), %rdi
	movq	24(%rsp), %rsi
	cqto
	idivq	%rdi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	movq	%rax, %rcx
	movq	%rbx, %rax
	cqto
	idivq	%rsi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	cmpq	%rax, %rcx
	cmovge	%rcx, %rax
	addq	$1, %r15
	imulq	%rax, %rdi
	movq	%rax, %rbx
	imulq	%rsi, %rbx
	movq	%rdi, %r14
	cmpq	%r15, 8(%rsp)
	jg	.L6
.L2:
	xorl	%eax, %eax
	leaq	(%r14,%rbx), %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$56, %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
.L14:
	.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:

#include<stdio.h>

int main(){
    long N,min[2]={1,1},data[2],a,b,i;
    scanf("%ld",&N);
    for(i=0;i<N;i++){
        scanf("%ld",&data[0]);
        scanf("%ld",&data[1]);
        if(min[0]%data[0]==0){
            a=min[0]/data[0];
        }
        else{
            a=min[0]/data[0]+1;
        }
        if(min[1]%data[1]==0){
            b=min[1]/data[1];
    }
        else{
            b=min[1]/data[1]+1;
        }
        if(a<b){
            a=b;
        }
        min[0]=data[0]*a;
        min[1]=data[1]*a;
    }
    printf("%ld\n",min[0]+min[1]);
    return 0;
}

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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

int main(){
    long N,min[2]={1,1},data[2],a,b,i;
    scanf("%ld",&N);
    for(i=0;i<N;i++){
        scanf("%ld",&data[0]);
        scanf("%ld",&data[1]);
        if(min[0]%data[0]==0){
            a=min[0]/data[0];
        }
        else{
            a=min[0]/data[0]+1;
        }
        if(min[1]%data[1]==0){
            b=min[1]/data[1];
    }
        else{
            b=min[1]/data[1]+1;
        }
        if(a<b){
            a=b;
        }
        min[0]=data[0]*a;
        min[1]=data[1]*a;
    }
    printf("%ld\n",min[0]+min[1]);
    return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -48(%rbp)
	movq	$1, -40(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -56(%rbp)
	jmp	.L2
.L8:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-32(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rax, -72(%rbp)
	jmp	.L4
.L3:
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rsi
	cqto
	idivq	%rsi
	addq	$1, %rax
	movq	%rax, -72(%rbp)
.L4:
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L5
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdi
	cqto
	idivq	%rdi
	movq	%rax, -64(%rbp)
	jmp	.L6
.L5:
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rcx
	cqto
	idivq	%rcx
	addq	$1, %rax
	movq	%rax, -64(%rbp)
.L6:
	movq	-72(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	.L7
	movq	-64(%rbp), %rax
	movq	%rax, -72(%rbp)
.L7:
	movq	-32(%rbp), %rax
	imulq	-72(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-24(%rbp), %rax
	imulq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	addq	$1, -56(%rbp)
.L2:
	movq	-80(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jl	.L8
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
	.section	.rodata
.LC0:
	.string	"%ld"
.LC1:
	.string	"%ld\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	$80, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$1, -48(%rbp)
	movq	$1, -40(%rbp)
	leaq	-80(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	$0, -56(%rbp)
	jmp	.L2
.L8:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-32(%rbp), %rax
	addq	$8, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rax, -72(%rbp)
	jmp	.L4
.L3:
	movq	-48(%rbp), %rax
	movq	-32(%rbp), %rsi
	cqto
	idivq	%rsi
	addq	$1, %rax
	movq	%rax, -72(%rbp)
.L4:
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L5
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rdi
	cqto
	idivq	%rdi
	movq	%rax, -64(%rbp)
	jmp	.L6
.L5:
	movq	-40(%rbp), %rax
	movq	-24(%rbp), %rcx
	cqto
	idivq	%rcx
	addq	$1, %rax
	movq	%rax, -64(%rbp)
.L6:
	movq	-72(%rbp), %rax
	cmpq	-64(%rbp), %rax
	jge	.L7
	movq	-64(%rbp), %rax
	movq	%rax, -72(%rbp)
.L7:
	movq	-32(%rbp), %rax
	imulq	-72(%rbp), %rax
	movq	%rax, -48(%rbp)
	movq	-24(%rbp), %rax
	imulq	-72(%rbp), %rax
	movq	%rax, -40(%rbp)
	addq	$1, -56(%rbp)
.L2:
	movq	-80(%rbp), %rax
	cmpq	%rax, -56(%rbp)
	jl	.L8
	movq	-48(%rbp), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	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	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
