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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int N;

    scanf("%d", &N);

    long long T[N], A[N];

    for(int i = 0; i < N; i++){
        scanf("%lld%lld", &T[i], &A[i]);
    }

    long long l = T[0], r = A[0];

    for(int i = 0; i < N; i++){
        long long t, a;
        if(l % T[i] == 0){
            t = l / T[i];
        }else{
            t = l / T[i] + 1;
        }

        if(r % A[i] == 0){
            a = r / A[i];
        }else{
            a = r / A[i] + 1;
        }

        if(t > a){
            l = T[i] * t, r = A[i] * t;
        }else{
            l = T[i] * a, r = A[i] * a;
        }
    }

    printf("%lld\n", l + r);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L8
.L9:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L8:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L9
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -112(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L17:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-120(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-120(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -104(%rbp)
	jmp	.L12
.L11:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	-120(%rbp), %rax
	cqto
	idivq	%rdi
	addq	$1, %rax
	movq	%rax, -104(%rbp)
.L12:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-112(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L13
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-112(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -96(%rbp)
	jmp	.L14
.L13:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	-112(%rbp), %rax
	cqto
	idivq	%rdi
	addq	$1, %rax
	movq	%rax, -96(%rbp)
.L14:
	movq	-104(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jle	.L15
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-104(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-104(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -112(%rbp)
	jmp	.L16
.L15:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-96(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-96(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -112(%rbp)
.L16:
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L17
	movq	-120(%rbp), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	leaq	7(%rsp), %rbx
	movq	%rax, %rdx
	andq	$-4096, %rax
	movq	%rbx, %rsi
	andq	$-16, %rdx
	andq	$-8, %rbx
	shrq	$3, %rsi
	movq	%rsi, -80(%rbp)
	movq	%rsp, %rsi
	subq	%rax, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L32:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L33
.L7:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	movq	%r12, %r15
	shrq	$3, %rax
	andq	$-8, %r15
	movq	%rax, -88(%rbp)
	movq	%r15, -72(%rbp)
	testl	%ecx, %ecx
	jle	.L8
	movq	%rbx, %r12
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r15, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addl	$1, %r14d
	addq	$8, %r12
	addq	$8, %r15
	cmpl	%r14d, %edi
	jg	.L9
	movq	-80(%rbp), %rax
	movq	-88(%rbp), %rsi
	movq	0(,%rax,8), %rax
	movq	0(,%rsi,8), %rcx
	testl	%edi, %edi
	jle	.L10
	movslq	%edi, %r10
	movq	%rcx, %r8
	movq	%rax, %rdi
	xorl	%esi, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%r9, %rcx
	imulq	%r9, %rax
	addq	$1, %rsi
	imulq	%r8, %rcx
	cmpq	%rsi, %r10
	je	.L10
.L35:
	movq	-72(%rbp), %rdx
	movq	(%rbx,%rsi,8), %rdi
	movq	(%rdx,%rsi,8), %r8
.L15:
	cqto
	idivq	%rdi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	movq	%rax, %r9
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rax, %rcx
	cmpq	$1, %rdx
	movq	%rdi, %rax
	sbbq	$-1, %rcx
	cmpq	%rcx, %r9
	jg	.L34
	addq	$1, %rsi
	imulq	%rcx, %rax
	imulq	%r8, %rcx
	cmpq	%rsi, %r10
	jne	.L35
.L10:
	leaq	(%rax,%rcx), %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L8:
	.cfi_restore_state
	movq	-80(%rbp), %rax
	movq	-88(%rbp), %rbx
	movq	0(,%rax,8), %rax
	movq	0(,%rbx,8), %rcx
	jmp	.L10
.L33:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rdi
	movq	%rax, %rdx
	andq	$-4096, %rdi
	andq	$-16, %rdx
	subq	%rdi, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	leaq	7(%rsp), %rbx
	movq	%rax, %rdx
	andq	$-4096, %rax
	movq	%rbx, %rsi
	andq	$-16, %rdx
	andq	$-8, %rbx
	shrq	$3, %rsi
	movq	%rsi, -80(%rbp)
	movq	%rsp, %rsi
	subq	%rax, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L32:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L6:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L33
.L7:
	leaq	7(%rsp), %r12
	movq	%r12, %rax
	movq	%r12, %r15
	shrq	$3, %rax
	andq	$-8, %r15
	movq	%rax, -88(%rbp)
	movq	%r15, -72(%rbp)
	testl	%ecx, %ecx
	jle	.L8
	movq	%rbx, %r12
	xorl	%r14d, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%r15, %rdx
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %edi
	addl	$1, %r14d
	addq	$8, %r12
	addq	$8, %r15
	cmpl	%r14d, %edi
	jg	.L9
	movq	-80(%rbp), %rax
	movq	-88(%rbp), %rsi
	movq	0(,%rax,8), %rax
	movq	0(,%rsi,8), %rcx
	testl	%edi, %edi
	jle	.L10
	movslq	%edi, %r10
	movq	%rcx, %r8
	movq	%rax, %rdi
	xorl	%esi, %esi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L34:
	movq	%r9, %rcx
	imulq	%r9, %rax
	addq	$1, %rsi
	imulq	%r8, %rcx
	cmpq	%rsi, %r10
	je	.L10
.L35:
	movq	-72(%rbp), %rdx
	movq	(%rbx,%rsi,8), %rdi
	movq	(%rdx,%rsi,8), %r8
.L15:
	cqto
	idivq	%rdi
	cmpq	$1, %rdx
	sbbq	$-1, %rax
	movq	%rax, %r9
	movq	%rcx, %rax
	cqto
	idivq	%r8
	movq	%rax, %rcx
	cmpq	$1, %rdx
	movq	%rdi, %rax
	sbbq	$-1, %rcx
	cmpq	%rcx, %r9
	jg	.L34
	addq	$1, %rsi
	imulq	%rcx, %rax
	imulq	%r8, %rcx
	cmpq	%rsi, %r10
	jne	.L35
.L10:
	leaq	(%rax,%rcx), %rdx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L8:
	.cfi_restore_state
	movq	-80(%rbp), %rax
	movq	-88(%rbp), %rbx
	movq	0(,%rax,8), %rax
	movq	0(,%rbx,8), %rcx
	jmp	.L10
.L33:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L7
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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 <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int N;

    scanf("%d", &N);

    long long T[N], A[N];

    for(int i = 0; i < N; i++){
        scanf("%lld%lld", &T[i], &A[i]);
    }

    long long l = T[0], r = A[0];

    for(int i = 0; i < N; i++){
        long long t, a;
        if(l % T[i] == 0){
            t = l / T[i];
        }else{
            t = l / T[i] + 1;
        }

        if(r % A[i] == 0){
            a = r / A[i];
        }else{
            a = r / A[i] + 1;
        }

        if(t > a){
            l = T[i] * t, r = A[i] * t;
        }else{
            l = T[i] * a, r = A[i] * a;
        }
    }

    printf("%lld\n", l + r);

    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>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    int N;

    scanf("%d", &N);

    long long T[N], A[N];

    for(int i = 0; i < N; i++){
        scanf("%lld%lld", &T[i], &A[i]);
    }

    long long l = T[0], r = A[0];

    for(int i = 0; i < N; i++){
        long long t, a;
        if(l % T[i] == 0){
            t = l / T[i];
        }else{
            t = l / T[i] + 1;
        }

        if(r % A[i] == 0){
            a = r / A[i];
        }else{
            a = r / A[i] + 1;
        }

        if(t > a){
            l = T[i] * t, r = A[i] * t;
        }else{
            l = T[i] * a, r = A[i] * a;
        }
    }

    printf("%lld\n", l + r);

    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L8
.L9:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L8:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L9
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -112(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L17:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-120(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-120(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -104(%rbp)
	jmp	.L12
.L11:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	-120(%rbp), %rax
	cqto
	idivq	%rdi
	addq	$1, %rax
	movq	%rax, -104(%rbp)
.L12:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-112(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L13
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-112(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -96(%rbp)
	jmp	.L14
.L13:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	-112(%rbp), %rax
	cqto
	idivq	%rdi
	addq	$1, %rax
	movq	%rax, -96(%rbp)
.L14:
	movq	-104(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jle	.L15
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-104(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-104(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -112(%rbp)
	jmp	.L16
.L15:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-96(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-96(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -112(%rbp)
.L16:
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L17
	movq	-120(%rbp), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%d"
.LC1:
	.string	"%lld%lld"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$136, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-132(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -160(%rbp)
	movq	$0, -152(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-132(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -128(%rbp)
	jmp	.L8
.L9:
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-64(%rbp), %rax
	addq	%rax, %rdx
	movl	-128(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rcx
	movq	-80(%rbp), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -128(%rbp)
.L8:
	movl	-132(%rbp), %eax
	cmpl	%eax, -128(%rbp)
	jl	.L9
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movq	(%rax), %rax
	movq	%rax, -112(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L10
.L17:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-120(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L11
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-120(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -104(%rbp)
	jmp	.L12
.L11:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	-120(%rbp), %rax
	cqto
	idivq	%rdi
	addq	$1, %rax
	movq	%rax, -104(%rbp)
.L12:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rcx
	movq	-112(%rbp), %rax
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	testq	%rax, %rax
	jne	.L13
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rsi
	movq	-112(%rbp), %rax
	cqto
	idivq	%rsi
	movq	%rax, -96(%rbp)
	jmp	.L14
.L13:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rdi
	movq	-112(%rbp), %rax
	cqto
	idivq	%rdi
	addq	$1, %rax
	movq	%rax, -96(%rbp)
.L14:
	movq	-104(%rbp), %rax
	cmpq	-96(%rbp), %rax
	jle	.L15
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-104(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-104(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -112(%rbp)
	jmp	.L16
.L15:
	movq	-80(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-96(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -120(%rbp)
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-96(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -112(%rbp)
.L16:
	addl	$1, -124(%rbp)
.L10:
	movl	-132(%rbp), %eax
	cmpl	%eax, -124(%rbp)
	jl	.L17
	movq	-120(%rbp), %rdx
	movq	-112(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
