Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
s[101][26],p[101];n,i,k,o,q;G(){scanf("%s",s[n]);for(i=0;strcmp(s[i],s[n]);i++);}main(m){for(;~scanf("%d",&n);n&&printf("%d\n",p[i])){for(m=n;m;scanf("%s%d",s[m],p+m))m--;for(scanf("%d",&m);G(q=0),m--;q<p[o]?p[o]=q:0)for(o=i,scanf("%d",&k);k--;q+=p[i])G();}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10504
s:
	.zero	10504
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 404
p:
	.zero	404
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	G
	.type	G, @function
G:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	leaq	(%rax,%rdx), %rcx
	movl	i(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	G, .-G
	.section	.rodata
.LC1:
	.string	"%s%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L5
.L14:
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L7:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
.L6:
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L8
.L12:
	movl	i(%rip), %eax
	movl	%eax, o(%rip)
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L9
.L10:
	movl	$0, %eax
	call	G
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	q(%rip), %eax
	addl	%edx, %eax
	movl	%eax, q(%rip)
.L9:
	movl	k(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, k(%rip)
	testl	%eax, %eax
	jne	.L10
	movl	o(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	q(%rip), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	o(%rip), %edx
	movl	q(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	$0, q(%rip)
	movl	q(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	G
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L12
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L5
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
.L5:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"%s"
	.text
	.p2align 4
	.globl	G
	.type	G, @function
G:
.LFB0:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	xorl	%ebp, %ebp
	leaq	(%rax,%rax,2), %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rbx,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	movl	$0, i(%rip)
	leaq	(%rax,%rax,2), %rdx
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rbx,%rax,8), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebp, i(%rip)
.L2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	addq	$1, %rbp
	addq	$104, %rbx
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	G, .-G
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	leaq	s(%rip), %r13
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
.L20:
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L30
	movl	n(%rip), %eax
	movq	%r13, (%rsp)
	leaq	p(%rip), %rbp
	leaq	.LC2(%rip), %rbx
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	je	.L10
.L8:
	subl	$1, %eax
	movq	%rbx, %rdi
	movl	%eax, 12(%rsp)
	cltq
	leaq	(%rax,%rax,2), %rcx
	leaq	0(%rbp,%rax,4), %rdx
	leaq	(%rax,%rcx,4), %rax
	leaq	0(%r13,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L8
.L10:
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L16:
	movq	(%rsp), %rbx
	leaq	(%r12,%r12,2), %rax
	leaq	.LC0(%rip), %rdi
	movl	$0, q(%rip)
	leaq	(%r12,%rax,4), %rax
	leaq	s(%rip), %r15
	xorl	%r12d, %r12d
	leaq	(%rbx,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	movq	%r13, (%rsp)
	movl	$0, i(%rip)
	leaq	(%rax,%rax,2), %rdx
	movq	%rax, %r14
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rbx,%rax,8), %rbp
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r12d, i(%rip)
.L17:
	movq	%r15, %rdi
	movq	%rbp, %rsi
	movslq	%r12d, %rbx
	addq	$104, %r15
	call	strcmp@PLT
	addl	$1, %r12d
	testl	%eax, %eax
	jne	.L18
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L31
	leaq	k(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movl	%ebx, o(%rip)
	call	scanf@PLT
	movl	k(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, k(%rip)
	testl	%eax, %eax
	je	.L11
	movslq	n(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	(%r12,%r12,2), %rax
	leaq	.LC0(%rip), %rdi
	movq	%r13, %r14
	xorl	%r15d, %r15d
	leaq	(%r12,%rax,4), %rax
	leaq	0(%r13,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %r12
	movl	$0, i(%rip)
	leaq	(%r12,%r12,2), %rax
	leaq	(%r12,%rax,4), %rax
	leaq	0(%r13,%rax,8), %rbp
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r15d, i(%rip)
.L12:
	movq	%r14, %rdi
	movq	%rbp, %rsi
	movslq	%r15d, %rbx
	addq	$104, %r14
	call	strcmp@PLT
	addl	$1, %r15d
	testl	%eax, %eax
	jne	.L13
	movl	k(%rip), %edx
	leaq	p(%rip), %rcx
	movl	q(%rip), %eax
	addl	(%rcx,%rbx,4), %eax
	leal	-1(%rdx), %ecx
	movl	%eax, q(%rip)
	movl	%ecx, k(%rip)
	testl	%edx, %edx
	jne	.L14
.L15:
	movslq	o(%rip), %rdx
	leaq	p(%rip), %rcx
	cmpl	%eax, (%rcx,%rdx,4)
	jle	.L16
	movl	%eax, (%rcx,%rdx,4)
	jmp	.L16
.L11:
	movl	q(%rip), %eax
	movslq	n(%rip), %r12
	jmp	.L15
.L31:
	testl	%r14d, %r14d
	je	.L20
	leaq	p(%rip), %rbp
	leaq	.LC3(%rip), %rdi
	movl	0(%rbp,%rbx,4), %esi
	call	printf@PLT
	jmp	.L20
.L30:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	q
	.bss
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 404
p:
	.zero	404
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 10504
s:
	.zero	10504
	.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	"%s"
	.text
	.p2align 4
	.globl	G
	.type	G, @function
G:
.LFB0:
	.cfi_startproc
	endbr64
	movslq	n(%rip), %rax
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	xorl	%ebp, %ebp
	leaq	(%rax,%rax,2), %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rbx,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	movl	$0, i(%rip)
	leaq	(%rax,%rax,2), %rdx
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rbx,%rax,8), %r12
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	%ebp, i(%rip)
.L2:
	movq	%rbx, %rdi
	movq	%r12, %rsi
	addq	$1, %rbp
	addq	$104, %rbx
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	G, .-G
	.section	.rodata.str1.1
.LC1:
	.string	"%d"
.LC2:
	.string	"%s%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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
	leaq	s(%rip), %r13
	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
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
.L20:
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L30
	movl	n(%rip), %eax
	movq	%r13, (%rsp)
	leaq	p(%rip), %rbp
	leaq	.LC2(%rip), %rbx
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	je	.L10
.L8:
	subl	$1, %eax
	movq	%rbx, %rdi
	movl	%eax, 12(%rsp)
	cltq
	leaq	(%rax,%rax,2), %rcx
	leaq	0(%rbp,%rax,4), %rdx
	leaq	(%rax,%rcx,4), %rax
	leaq	0(%r13,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jne	.L8
.L10:
	leaq	12(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L16:
	movq	(%rsp), %rbx
	leaq	(%r12,%r12,2), %rax
	leaq	.LC0(%rip), %rdi
	movl	$0, q(%rip)
	leaq	(%r12,%rax,4), %rax
	leaq	s(%rip), %r15
	xorl	%r12d, %r12d
	leaq	(%rbx,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %rax
	movq	%r13, (%rsp)
	movl	$0, i(%rip)
	leaq	(%rax,%rax,2), %rdx
	movq	%rax, %r14
	leaq	(%rax,%rdx,4), %rax
	leaq	(%rbx,%rax,8), %rbp
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r12d, i(%rip)
.L17:
	movq	%r15, %rdi
	movq	%rbp, %rsi
	movslq	%r12d, %rbx
	addq	$104, %r15
	call	strcmp@PLT
	addl	$1, %r12d
	testl	%eax, %eax
	jne	.L18
	movl	12(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	je	.L31
	leaq	k(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movl	%ebx, o(%rip)
	call	scanf@PLT
	movl	k(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, k(%rip)
	testl	%eax, %eax
	je	.L11
	movslq	n(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	(%r12,%r12,2), %rax
	leaq	.LC0(%rip), %rdi
	movq	%r13, %r14
	xorl	%r15d, %r15d
	leaq	(%r12,%rax,4), %rax
	leaq	0(%r13,%rax,8), %rsi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	n(%rip), %r12
	movl	$0, i(%rip)
	leaq	(%r12,%r12,2), %rax
	leaq	(%r12,%rax,4), %rax
	leaq	0(%r13,%rax,8), %rbp
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%r15d, i(%rip)
.L12:
	movq	%r14, %rdi
	movq	%rbp, %rsi
	movslq	%r15d, %rbx
	addq	$104, %r14
	call	strcmp@PLT
	addl	$1, %r15d
	testl	%eax, %eax
	jne	.L13
	movl	k(%rip), %edx
	leaq	p(%rip), %rcx
	movl	q(%rip), %eax
	addl	(%rcx,%rbx,4), %eax
	leal	-1(%rdx), %ecx
	movl	%eax, q(%rip)
	movl	%ecx, k(%rip)
	testl	%edx, %edx
	jne	.L14
.L15:
	movslq	o(%rip), %rdx
	leaq	p(%rip), %rcx
	cmpl	%eax, (%rcx,%rdx,4)
	jle	.L16
	movl	%eax, (%rcx,%rdx,4)
	jmp	.L16
.L11:
	movl	q(%rip), %eax
	movslq	n(%rip), %r12
	jmp	.L15
.L31:
	testl	%r14d, %r14d
	je	.L20
	leaq	p(%rip), %rbp
	leaq	.LC3(%rip), %rdi
	movl	0(%rbp,%rbx,4), %esi
	call	printf@PLT
	jmp	.L20
.L30:
	addq	$24, %rsp
	.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
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	q
	.bss
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 404
p:
	.zero	404
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 10504
s:
	.zero	10504
	.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:

s[101][26],p[101];n,i,k,o,q;G(){scanf("%s",s[n]);for(i=0;strcmp(s[i],s[n]);i++);}main(m){for(;~scanf("%d",&n);n&&printf("%d\n",p[i])){for(m=n;m;scanf("%s%d",s[m],p+m))m--;for(scanf("%d",&m);G(q=0),m--;q<p[o]?p[o]=q:0)for(o=i,scanf("%d",&k);k--;q+=p[i])G();}}
8
wood 3000
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 112750
0
computer
0
 8
wood 3000
string 800
rice 1
water 0
racket 5000
microphone 4961
onigiri 113
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 tekcar microphone onigiri
guitar
1
computer 112750
0
computer
0
 8
wood 3000
string 800
rice 1
water 0
racket 5000
enohporcim 4961
onigiri 113
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 tekcar enohporcim onigiri
guitar
1
computer 112750
0
computer
0

8797
300000
 9997
300000
 9997
112750
 8762
300000
 4997
112750
 3801
300000
 36
112750

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
s[101][26],p[101];n,i,k,o,q;G(){scanf("%s",s[n]);for(i=0;strcmp(s[i],s[n]);i++);}main(m){for(;~scanf("%d",&n);n&&printf("%d\n",p[i])){for(m=n;m;scanf("%s%d",s[m],p+m))m--;for(scanf("%d",&m);G(q=0),m--;q<p[o]?p[o]=q:0)for(o=i,scanf("%d",&k);k--;q+=p[i])G();}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10504
s:
	.zero	10504
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 404
p:
	.zero	404
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	G
	.type	G, @function
G:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	leaq	(%rax,%rdx), %rcx
	movl	i(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	G, .-G
	.section	.rodata
.LC1:
	.string	"%s%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L5
.L14:
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L7:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
.L6:
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L8
.L12:
	movl	i(%rip), %eax
	movl	%eax, o(%rip)
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L9
.L10:
	movl	$0, %eax
	call	G
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	q(%rip), %eax
	addl	%edx, %eax
	movl	%eax, q(%rip)
.L9:
	movl	k(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, k(%rip)
	testl	%eax, %eax
	jne	.L10
	movl	o(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	q(%rip), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	o(%rip), %edx
	movl	q(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	$0, q(%rip)
	movl	q(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	G
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L12
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L5
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
.L5:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10504
s:
	.zero	10504
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 404
p:
	.zero	404
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	k
	.align 4
	.type	k, @object
	.size	k, 4
k:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	q
	.align 4
	.type	q, @object
	.size	q, 4
q:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
	.text
	.globl	G
	.type	G, @function
G:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, i(%rip)
	jmp	.L2
.L3:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L2:
	movl	n(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	leaq	(%rax,%rdx), %rcx
	movl	i(%rip), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L3
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	G, .-G
	.section	.rodata
.LC1:
	.string	"%s%d"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, -4(%rbp)
	jmp	.L5
.L14:
	movl	n(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L6
.L7:
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	leaq	(%rdx,%rax), %rcx
	movl	-4(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	addq	%rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rcx, %rdx
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
.L6:
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L7
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L8
.L12:
	movl	i(%rip), %eax
	movl	%eax, o(%rip)
	leaq	k(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L9
.L10:
	movl	$0, %eax
	call	G
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	q(%rip), %eax
	addl	%edx, %eax
	movl	%eax, q(%rip)
.L9:
	movl	k(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, k(%rip)
	testl	%eax, %eax
	jne	.L10
	movl	o(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	q(%rip), %eax
	cmpl	%eax, %edx
	jle	.L8
	movl	o(%rip), %edx
	movl	q(%rip), %eax
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	p(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
.L8:
	movl	$0, q(%rip)
	movl	q(%rip), %eax
	movl	%eax, %edi
	movl	$0, %eax
	call	G
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L12
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L5
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
.L5:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L14
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
