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

```c
#define z(m,n)for(;m;m--)scanf("%d",&s),x[s+n]++
x[41];main(m,n,s){for(;scanf("%d%d",&m,&n),m;printf("%d\n",s)){memset(x,0,164);z(m,0);z(n,20);for(m=21,s=0;m--;s+=m*(x[m]>x[m+20]?x[m]:x[m+20]));}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 164
x:
	.zero	164
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	jmp	.L2
.L9:
	movl	$164, %edx
	movl	$0, %esi
	leaq	x(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	jmp	.L3
.L4:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	jmp	.L5
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-12(%rbp), %eax
	addl	$20, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$21, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	addl	$20, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	x(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	movl	-4(%rbp), %eax
	imull	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
.L7:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	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	"%d"
.LC6:
	.string	"%d\n"
.LC7:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	.LC7(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movdqa	.LC2(%rip), %xmm6
	movl	%edi, 28(%rsp)
	leaq	24(%rsp), %r13
	leaq	28(%rsp), %r12
	movl	%esi, 24(%rsp)
	psrlq	$32, %xmm6
	movl	%edx, 20(%rsp)
	movaps	%xmm6, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L12
	leaq	x(%rip), %r15
	movl	$20, %ecx
	xorl	%eax, %eax
	movq	%r15, %rdi
	leaq	20(%rsp), %r14
	leaq	.LC0(%rip), %rbx
	rep stosq
	movl	$0, (%rdi)
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movslq	20(%rsp), %rax
	addl	$1, (%r15,%rax,4)
	subl	$1, 28(%rsp)
	jne	.L3
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	20(%rsp), %eax
	addl	$20, %eax
	cltq
	addl	$1, (%r15,%rax,4)
	subl	$1, 24(%rsp)
	jne	.L4
.L5:
	movdqu	148+x(%rip), %xmm4
	movdqu	68+x(%rip), %xmm5
	leaq	.LC6(%rip), %rdi
	xorl	%eax, %eax
	movdqu	132+x(%rip), %xmm6
	movdqu	52+x(%rip), %xmm7
	movl	$-1, 28(%rsp)
	pshufd	$27, %xmm4, %xmm1
	pshufd	$27, %xmm5, %xmm2
	movdqu	116+x(%rip), %xmm4
	movdqu	36+x(%rip), %xmm5
	movdqa	%xmm1, %xmm0
	pshufd	$27, %xmm7, %xmm3
	movdqu	20+x(%rip), %xmm7
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	.LC1(%rip), %xmm1
	movdqa	%xmm0, %xmm2
	psrlq	$32, %xmm0
	pmuludq	.LC1(%rip), %xmm2
	pshufd	$8, %xmm2, %xmm2
	psrlq	$32, %xmm1
	pmuludq	%xmm1, %xmm0
	pshufd	$27, %xmm6, %xmm1
	movdqu	100+x(%rip), %xmm6
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	pshufd	$27, %xmm5, %xmm3
	movdqu	84+x(%rip), %xmm5
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	.LC2(%rip), %xmm1
	pmuludq	(%rsp), %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm1, %xmm2
	pshufd	$27, %xmm4, %xmm1
	movdqu	4+x(%rip), %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	movdqa	.LC3(%rip), %xmm3
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm3
	pmuludq	.LC3(%rip), %xmm1
	pshufd	$8, %xmm1, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm3, %xmm0
	pshufd	$27, %xmm7, %xmm3
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm2, %xmm1
	pshufd	$27, %xmm6, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm3, %xmm0
	movdqa	.LC4(%rip), %xmm3
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm3, %xmm2
	psrlq	$32, %xmm3
	pmuludq	%xmm3, %xmm0
	pshufd	$27, %xmm5, %xmm3
	pshufd	$8, %xmm2, %xmm2
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm2
	pshufd	$27, %xmm4, %xmm0
	paddd	%xmm1, %xmm2
	movdqa	%xmm0, %xmm1
	pcmpgtd	%xmm3, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	movdqa	.LC5(%rip), %xmm3
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrlq	$32, %xmm1
	pmuludq	%xmm3, %xmm0
	psrlq	$32, %xmm3
	pmuludq	%xmm3, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %esi
	movd	%xmm0, 20(%rsp)
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$40, %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
.LFE0:
	.size	main, .-main
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 164
x:
	.zero	164
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	20
	.long	19
	.long	18
	.long	17
	.align 16
.LC2:
	.long	16
	.long	15
	.long	14
	.long	13
	.align 16
.LC3:
	.long	12
	.long	11
	.long	10
	.long	9
	.align 16
.LC4:
	.long	8
	.long	7
	.long	6
	.long	5
	.align 16
.LC5:
	.long	4
	.long	3
	.long	2
	.long	1
	.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"
.LC6:
	.string	"%d\n"
.LC7:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	leaq	.LC7(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movdqa	.LC2(%rip), %xmm6
	movl	%edi, 28(%rsp)
	leaq	24(%rsp), %r13
	leaq	28(%rsp), %r12
	movl	%esi, 24(%rsp)
	psrlq	$32, %xmm6
	movl	%edx, 20(%rsp)
	movaps	%xmm6, (%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	je	.L12
	leaq	x(%rip), %r15
	movl	$20, %ecx
	xorl	%eax, %eax
	movq	%r15, %rdi
	leaq	20(%rsp), %r14
	leaq	.LC0(%rip), %rbx
	rep stosq
	movl	$0, (%rdi)
	.p2align 4,,10
	.p2align 3
.L3:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movslq	20(%rsp), %rax
	addl	$1, (%r15,%rax,4)
	subl	$1, 28(%rsp)
	jne	.L3
	movl	24(%rsp), %edx
	testl	%edx, %edx
	je	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	20(%rsp), %eax
	addl	$20, %eax
	cltq
	addl	$1, (%r15,%rax,4)
	subl	$1, 24(%rsp)
	jne	.L4
.L5:
	movdqu	148+x(%rip), %xmm4
	movdqu	68+x(%rip), %xmm5
	leaq	.LC6(%rip), %rdi
	xorl	%eax, %eax
	movdqu	132+x(%rip), %xmm6
	movdqu	52+x(%rip), %xmm7
	movl	$-1, 28(%rsp)
	pshufd	$27, %xmm4, %xmm1
	pshufd	$27, %xmm5, %xmm2
	movdqu	116+x(%rip), %xmm4
	movdqu	36+x(%rip), %xmm5
	movdqa	%xmm1, %xmm0
	pshufd	$27, %xmm7, %xmm3
	movdqu	20+x(%rip), %xmm7
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	.LC1(%rip), %xmm1
	movdqa	%xmm0, %xmm2
	psrlq	$32, %xmm0
	pmuludq	.LC1(%rip), %xmm2
	pshufd	$8, %xmm2, %xmm2
	psrlq	$32, %xmm1
	pmuludq	%xmm1, %xmm0
	pshufd	$27, %xmm6, %xmm1
	movdqu	100+x(%rip), %xmm6
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	pshufd	$27, %xmm5, %xmm3
	movdqu	84+x(%rip), %xmm5
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm0
	pmuludq	.LC2(%rip), %xmm1
	pmuludq	(%rsp), %xmm0
	pshufd	$8, %xmm1, %xmm1
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm1, %xmm2
	pshufd	$27, %xmm4, %xmm1
	movdqu	4+x(%rip), %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	movdqa	.LC3(%rip), %xmm3
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrlq	$32, %xmm3
	pmuludq	.LC3(%rip), %xmm1
	pshufd	$8, %xmm1, %xmm1
	psrlq	$32, %xmm0
	pmuludq	%xmm3, %xmm0
	pshufd	$27, %xmm7, %xmm3
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm1
	paddd	%xmm2, %xmm1
	pshufd	$27, %xmm6, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm2
	pandn	%xmm3, %xmm0
	movdqa	.LC4(%rip), %xmm3
	por	%xmm2, %xmm0
	movdqa	%xmm0, %xmm2
	psrlq	$32, %xmm0
	pmuludq	%xmm3, %xmm2
	psrlq	$32, %xmm3
	pmuludq	%xmm3, %xmm0
	pshufd	$27, %xmm5, %xmm3
	pshufd	$8, %xmm2, %xmm2
	pshufd	$8, %xmm0, %xmm0
	punpckldq	%xmm0, %xmm2
	pshufd	$27, %xmm4, %xmm0
	paddd	%xmm1, %xmm2
	movdqa	%xmm0, %xmm1
	pcmpgtd	%xmm3, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm3, %xmm1
	movdqa	.LC5(%rip), %xmm3
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrlq	$32, %xmm1
	pmuludq	%xmm3, %xmm0
	psrlq	$32, %xmm3
	pmuludq	%xmm3, %xmm1
	pshufd	$8, %xmm0, %xmm0
	pshufd	$8, %xmm1, %xmm1
	punpckldq	%xmm1, %xmm0
	paddd	%xmm2, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$8, %xmm1
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %esi
	movd	%xmm0, 20(%rsp)
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$40, %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
.LFE0:
	.size	main, .-main
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 164
x:
	.zero	164
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	20
	.long	19
	.long	18
	.long	17
	.align 16
.LC2:
	.long	16
	.long	15
	.long	14
	.long	13
	.align 16
.LC3:
	.long	12
	.long	11
	.long	10
	.long	9
	.align 16
.LC4:
	.long	8
	.long	7
	.long	6
	.long	5
	.align 16
.LC5:
	.long	4
	.long	3
	.long	2
	.long	1
	.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:

#define z(m,n)for(;m;m--)scanf("%d",&s),x[s+n]++
x[41];main(m,n,s){for(;scanf("%d%d",&m,&n),m;printf("%d\n",s)){memset(x,0,164);z(m,0);z(n,20);for(m=21,s=0;m--;s+=m*(x[m]>x[m+20]?x[m]:x[m+20]));}}
5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 4
4 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 20 20 20 20
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 1
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 4
4 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 20 20 20 20
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 4
4 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 20 20 20 4
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 1
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 4
4 2 1
4 4
2 8 16 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 20 20 20 20
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 1
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 4
4 2 1
4 4
2 8 16 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
16 20 20 20 7 20 20 20 20
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 5
0 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 20 20 20 4
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 5
0 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 17 20 20 4
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 5
0 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 16 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 17 20 20 4
0 0
 5 5
1 2 3 4 5
1 2 1 4 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
2 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 5
0 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 16 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 17 20 20 4
0 0
 5 5
1 2 3 4 5
1 2 1 2 5
5 5
2 5 4 1 3
4 1 5 3 2
5 5
1 2 3 4 5
3 3 3 4 5
3 3
7 7 7
7 7 7
3 3
4 4 4
4 3 4
4 3
4 2 2 4
4 2 1
4 4
2 8 8 8
2 3 8 3
10 10
9 9 9 9 9 9 9 9 9 9
9 9 9 9 9 9 9 9 9 9
10 9
20 1 20 20 20 20 20 18 20 20
20 20 20 20 7 20 20 20 20
0 0

16
15
21
21
15
13
32
90
186
 16
16
21
21
15
13
32
90
186
 16
15
21
21
15
13
32
90
190
 16
16
21
21
15
13
40
90
186
 16
16
21
21
15
13
40
90
202
 16
15
21
21
15
34
32
90
190
 16
15
21
21
15
34
32
90
207
 16
15
21
21
15
34
32
106
207
 16
15
22
21
15
34
32
106
207
 18
15
21
21
15
13
32
90
186

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

```c
#define z(m,n)for(;m;m--)scanf("%d",&s),x[s+n]++
x[41];main(m,n,s){for(;scanf("%d%d",&m,&n),m;printf("%d\n",s)){memset(x,0,164);z(m,0);z(n,20);for(m=21,s=0;m--;s+=m*(x[m]>x[m+20]?x[m]:x[m+20]));}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 164
x:
	.zero	164
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	jmp	.L2
.L9:
	movl	$164, %edx
	movl	$0, %esi
	leaq	x(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	jmp	.L3
.L4:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	jmp	.L5
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-12(%rbp), %eax
	addl	$20, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$21, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	addl	$20, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	x(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	movl	-4(%rbp), %eax
	imull	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
.L7:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	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
	.globl	x
	.bss
	.align 32
	.type	x, @object
	.size	x, 164
x:
	.zero	164
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d%d"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	jmp	.L2
.L9:
	movl	$164, %edx
	movl	$0, %esi
	leaq	x(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	jmp	.L3
.L4:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-4(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
.L3:
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L4
	jmp	.L5
.L6:
	leaq	-12(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-12(%rbp), %eax
	addl	$20, %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	x(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-8(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
.L5:
	movl	-8(%rbp), %eax
	testl	%eax, %eax
	jne	.L6
	movl	$21, -4(%rbp)
	movl	$0, -12(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	addl	$20, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	x(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	x(%rip), %rax
	movl	(%rcx,%rax), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
	movl	-4(%rbp), %eax
	imull	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
.L7:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L8
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	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:
