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

int main()
{
    long long n,i,q,j,b,c,input;
    long long out = 0;
    scanf("%lld",&n);
    int a[200000]={0};
    for(i=0;i<n;i++){
        scanf("%lld",&input);
        a[input]++;
        out = out+input;
    }
    scanf("%lld",&q);
    for(i=0;i<q;i++){
        scanf("%lld %lld",&b,&c);
        if(a[b]==0) out = out;
        else{
            out = out+(c-b)*a[b];
            a[c] = a[c]+a[b];
            a[b] = 0;
        }
        printf("%lld\n",out);
    }
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$800000, %edx
	call	memset@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	addl	$1, 48(%rsp,%rax,4)
	addq	%rax, %rbx
	cmpq	%rbp, 8(%rsp)
	jg	.L3
.L2:
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	jle	.L4
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	je	.L5
	movq	32(%rsp), %rcx
	movslq	%edx, %rdi
	movq	%rcx, %rsi
	addl	%edx, 48(%rsp,%rcx,4)
	subq	%rax, %rsi
	movl	$0, 48(%rsp,%rax,4)
	imulq	%rdi, %rsi
	addq	%rsi, %rbx
.L5:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbp
	cmpq	%rbp, 16(%rsp)
	jg	.L7
.L4:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$800072, %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
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$800000, %edx
	call	memset@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	addl	$1, 48(%rsp,%rax,4)
	addq	%rax, %rbx
	cmpq	%rbp, 8(%rsp)
	jg	.L3
.L2:
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	jle	.L4
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	je	.L5
	movq	32(%rsp), %rcx
	movslq	%edx, %rdi
	movq	%rcx, %rsi
	addl	%edx, 48(%rsp,%rcx,4)
	subq	%rax, %rsi
	movl	$0, 48(%rsp,%rax,4)
	imulq	%rdi, %rsi
	addq	%rsi, %rbx
.L5:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbp
	cmpq	%rbp, 16(%rsp)
	jg	.L7
.L4:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$800072, %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
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$800000, %edx
	call	memset@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	addl	$1, 48(%rsp,%rax,4)
	addq	%rax, %rbx
	cmpq	%rbp, 8(%rsp)
	jg	.L3
.L2:
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	jle	.L4
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	je	.L5
	movq	32(%rsp), %rcx
	movslq	%edx, %rdi
	movq	%rcx, %rsi
	addl	%edx, 48(%rsp,%rcx,4)
	subq	%rax, %rsi
	movl	$0, 48(%rsp,%rax,4)
	imulq	%rdi, %rsi
	addq	%rsi, %rbx
.L5:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbp
	cmpq	%rbp, 16(%rsp)
	jg	.L7
.L4:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$800072, %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
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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>
#include <stdlib.h>

int main()
{
    long long n,i,q,j,b,c,input;
    long long out = 0;
    scanf("%lld",&n);
    int a[200000]={0};
    for(i=0;i<n;i++){
        scanf("%lld",&input);
        a[input]++;
        out = out+input;
    }
    scanf("%lld",&q);
    for(i=0;i<q;i++){
        scanf("%lld %lld",&b,&c);
        if(a[b]==0) out = out;
        else{
            out = out+(c-b)*a[b];
            a[c] = a[c]+a[b];
            a[b] = 0;
        }
        printf("%lld\n",out);
    }
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>

int main()
{
    long long n,i,q,j,b,c,input;
    long long out = 0;
    scanf("%lld",&n);
    int a[200000]={0};
    for(i=0;i<n;i++){
        scanf("%lld",&input);
        a[input]++;
        out = out+input;
    }
    scanf("%lld",&q);
    for(i=0;i<q;i++){
        scanf("%lld %lld",&b,&c);
        if(a[b]==0) out = out;
        else{
            out = out+(c-b)*a[b];
            a[c] = a[c]+a[b];
            a[b] = 0;
        }
        printf("%lld\n",out);
    }
    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:

4
1 2 3 3
3
1 2
3 4
2 4
 4
2 1 1 1
3
1 2
2 1
3 5
 4
1 2 3 3
3
1 2
3 4
0 4
 4
0 1 1 1
3
1 2
2 1
3 5
 4
1 3 3 3
3
1 2
3 4
0 4
 4
1 3 4 3
3
1 2
3 4
0 4
 4
0 1 1 1
3
1 4
2 1
5 10
 4
0 2 4 3
3
1 2
3 4
0 4
 4
0 1 1 1
3
1 0
2 1
5 10
 4
0 2 1 1
3
1 0
2 1
5 10

10
12
16
 8
4
4
 10
12
12
 6
3
3
 11
14
14
 12
14
14
 12
12
12
 9
10
14
 0
0
0
 2
1
1

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

int main()
{
    long long n,i,q,j,b,c,input;
    long long out = 0;
    scanf("%lld",&n);
    int a[200000]={0};
    for(i=0;i<n;i++){
        scanf("%lld",&input);
        a[input]++;
        out = out+input;
    }
    scanf("%lld",&q);
    for(i=0;i<q;i++){
        scanf("%lld %lld",&b,&c);
        if(a[b]==0) out = out;
        else{
            out = out+(c-b)*a[b];
            a[c] = a[c]+a[b];
            a[b] = 0;
        }
        printf("%lld\n",out);
    }
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$800000, %edx
	call	memset@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	addl	$1, 48(%rsp,%rax,4)
	addq	%rax, %rbx
	cmpq	%rbp, 8(%rsp)
	jg	.L3
.L2:
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	jle	.L4
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	je	.L5
	movq	32(%rsp), %rcx
	movslq	%edx, %rdi
	movq	%rcx, %rsi
	addl	%edx, 48(%rsp,%rcx,4)
	subq	%rax, %rsi
	movl	$0, 48(%rsp,%rax,4)
	imulq	%rdi, %rsi
	addq	%rsi, %rbx
.L5:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbp
	cmpq	%rbp, 16(%rsp)
	jg	.L7
.L4:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$800072, %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
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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	"%lld"
.LC1:
	.string	"%lld %lld"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC0(%rip), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%esi, %esi
	leaq	48(%rsp), %rdi
	movl	$800000, %edx
	call	memset@PLT
	cmpq	$0, 8(%rsp)
	jle	.L2
	xorl	%ebp, %ebp
	leaq	40(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movq	40(%rsp), %rax
	addl	$1, 48(%rsp,%rax,4)
	addq	%rax, %rbx
	cmpq	%rbp, 8(%rsp)
	jg	.L3
.L2:
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpq	$0, 16(%rsp)
	jle	.L4
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r15
	leaq	24(%rsp), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movl	48(%rsp,%rax,4), %edx
	testl	%edx, %edx
	je	.L5
	movq	32(%rsp), %rcx
	movslq	%edx, %rdi
	movq	%rcx, %rsi
	addl	%edx, 48(%rsp,%rcx,4)
	subq	%rax, %rsi
	movl	$0, 48(%rsp,%rax,4)
	imulq	%rdi, %rsi
	addq	%rsi, %rbx
.L5:
	movq	%rbx, %rdx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addq	$1, %rbp
	cmpq	%rbp, 16(%rsp)
	jg	.L7
.L4:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L13
	addq	$800072, %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
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:
```