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

```c
// Aizu 2823: JAG Practice Contest
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <string.h>

int dmax[101];		// ?????£????????????????????????????????§??¨??????

int main()
{
	int n, m, i, d, v, ans;

	while (scanf("%d%d", &n, &m) && n > 0) {
		memset(dmax, 0, sizeof(int)*(m+1));
		while (n-- > 0) {
			scanf("%d%d", &d, &v);
			if (dmax[d] == 0 || v > dmax[d]) dmax[d] = v;
		}
		for (ans = 0, i = 1; i <= m; i++) ans += dmax[i];
		printf("%d\n", ans);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dmax(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r15
	leaq	8(%rsp), %r14
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L12
	movl	8(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L12
	movl	12(%rsp), %eax
	subl	$1, %r12d
	movl	$404, %ecx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	__memset_chk@PLT
	movl	%r12d, 8(%rsp)
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movl	20(%rsp), %ecx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	je	.L4
	cmpl	%ecx, %edx
	jge	.L5
.L4:
	movl	%ecx, (%rbx,%rax,4)
.L5:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jg	.L6
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L15
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L16
	movl	%ecx, %edx
	leaq	4+dmax(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L7
.L8:
	movslq	%eax, %rsi
	addl	(%rbx,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jg	.L7
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	(%rbx,%rsi,4), %edx
	cmpl	%eax, %ecx
	jl	.L7
	cltq
	addl	(%rbx,%rax,4), %edx
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dmax
	.bss
	.align 32
	.type	dmax, @object
	.size	dmax, 404
dmax:
	.zero	404
	.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	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dmax(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r15
	leaq	8(%rsp), %r14
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L12
	movl	8(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L12
	movl	12(%rsp), %eax
	subl	$1, %r12d
	movl	$404, %ecx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	__memset_chk@PLT
	movl	%r12d, 8(%rsp)
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movl	20(%rsp), %ecx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	je	.L4
	cmpl	%ecx, %edx
	jge	.L5
.L4:
	movl	%ecx, (%rbx,%rax,4)
.L5:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jg	.L6
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L15
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L16
	movl	%ecx, %edx
	leaq	4+dmax(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L7
.L8:
	movslq	%eax, %rsi
	addl	(%rbx,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jg	.L7
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	(%rbx,%rsi,4), %edx
	cmpl	%eax, %ecx
	jl	.L7
	cltq
	addl	(%rbx,%rax,4), %edx
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dmax
	.bss
	.align 32
	.type	dmax, @object
	.size	dmax, 404
dmax:
	.zero	404
	.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	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dmax(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r15
	leaq	8(%rsp), %r14
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L12
	movl	8(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L12
	movl	12(%rsp), %eax
	subl	$1, %r12d
	movl	$404, %ecx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	__memset_chk@PLT
	movl	%r12d, 8(%rsp)
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movl	20(%rsp), %ecx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	je	.L4
	cmpl	%ecx, %edx
	jge	.L5
.L4:
	movl	%ecx, (%rbx,%rax,4)
.L5:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jg	.L6
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L15
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L16
	movl	%ecx, %edx
	leaq	4+dmax(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L7
.L8:
	movslq	%eax, %rsi
	addl	(%rbx,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jg	.L7
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	(%rbx,%rsi,4), %edx
	cmpl	%eax, %ecx
	jl	.L7
	cltq
	addl	(%rbx,%rax,4), %edx
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dmax
	.bss
	.align 32
	.type	dmax, @object
	.size	dmax, 404
dmax:
	.zero	404
	.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
// Aizu 2823: JAG Practice Contest
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <string.h>

int dmax[101];		// ?????£????????????????????????????????§??¨??????

int main()
{
	int n, m, i, d, v, ans;

	while (scanf("%d%d", &n, &m) && n > 0) {
		memset(dmax, 0, sizeof(int)*(m+1));
		while (n-- > 0) {
			scanf("%d%d", &d, &v);
			if (dmax[d] == 0 || v > dmax[d]) dmax[d] = v;
		}
		for (ans = 0, i = 1; i <= m; i++) ans += dmax[i];
		printf("%d\n", ans);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// Aizu 2823: JAG Practice Contest
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <string.h>

int dmax[101];		// ?????£????????????????????????????????§??¨??????

int main()
{
	int n, m, i, d, v, ans;

	while (scanf("%d%d", &n, &m) && n > 0) {
		memset(dmax, 0, sizeof(int)*(m+1));
		while (n-- > 0) {
			scanf("%d%d", &d, &v);
			if (dmax[d] == 0 || v > dmax[d]) dmax[d] = v;
		}
		for (ans = 0, i = 1; i <= m; i++) ans += dmax[i];
		printf("%d\n", ans);
	}
	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:

5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 9
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 2
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 9
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 19
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 6
8 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 2
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 5
2 2
4 2
1 9
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 8
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 19
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 9
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 6
8 3
1 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 2
6 5
5 10
1 10
3 10
4 6
2 3
1 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 9
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 6
8 3
1 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 2
6 5
5 10
1 10
3 10
3 6
2 3
1 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 9
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 6
8 3
1 6
6 3
7 4
8 10
4 12
7 5
1 8
5 7
1 5
4 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 2
6 5
5 10
1 10
3 10
3 6
2 3
1 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 1
2 3
3 2
3 9
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
1 10
2 6
8 3
1 6
6 3
7 4
8 10
4 12
7 5
1 8
5 7
1 5
4 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 2
6 5
5 10
1 10
3 10
3 6
2 3
1 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0
 5 3
1 0
2 3
3 2
3 5
2 1
4 2
1 7
2 1
1 3
1 5
6 1
1 3
1 2
1 8
1 2
1 7
1 6
20 9
4 10
2 4
5 3
6 6
6 3
7 4
8 10
4 6
7 5
1 8
5 7
1 5
6 6
9 9
5 8
6 7
1 4
6 4
7 10
3 5
19 6
4 1
6 5
5 10
1 10
3 10
4 6
2 3
5 4
2 10
1 8
3 4
3 1
5 4
1 10
1 3
5 6
5 2
1 10
2 3
0 0

9
10
8
71
51
 9
8
8
71
51
 9
10
8
71
60
 9
8
8
73
51
 9
10
8
72
60
 13
8
8
73
51
 13
8
8
73
47
 13
8
8
75
47
 13
8
8
77
47
 8
8
8
71
51

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

```c
// Aizu 2823: JAG Practice Contest
// 2017.9.23 bal4u@uu

#include <stdio.h>
#include <string.h>

int dmax[101];		// ?????£????????????????????????????????§??¨??????

int main()
{
	int n, m, i, d, v, ans;

	while (scanf("%d%d", &n, &m) && n > 0) {
		memset(dmax, 0, sizeof(int)*(m+1));
		while (n-- > 0) {
			scanf("%d%d", &d, &v);
			if (dmax[d] == 0 || v > dmax[d]) dmax[d] = v;
		}
		for (ans = 0, i = 1; i <= m; i++) ans += dmax[i];
		printf("%d\n", ans);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dmax(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r15
	leaq	8(%rsp), %r14
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L12
	movl	8(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L12
	movl	12(%rsp), %eax
	subl	$1, %r12d
	movl	$404, %ecx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	__memset_chk@PLT
	movl	%r12d, 8(%rsp)
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movl	20(%rsp), %ecx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	je	.L4
	cmpl	%ecx, %edx
	jge	.L5
.L4:
	movl	%ecx, (%rbx,%rax,4)
.L5:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jg	.L6
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L15
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L16
	movl	%ecx, %edx
	leaq	4+dmax(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L7
.L8:
	movslq	%eax, %rsi
	addl	(%rbx,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jg	.L7
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	(%rbx,%rsi,4), %edx
	cmpl	%eax, %ecx
	jl	.L7
	cltq
	addl	(%rbx,%rax,4), %edx
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dmax
	.bss
	.align 32
	.type	dmax, @object
	.size	dmax, 404
dmax:
	.zero	404
	.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	"%d%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.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	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	dmax(%rip), %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r15
	leaq	8(%rsp), %r14
	leaq	20(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r15, %rdx
	movq	%r14, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L12
	movl	8(%rsp), %r12d
	testl	%r12d, %r12d
	jle	.L12
	movl	12(%rsp), %eax
	subl	$1, %r12d
	movl	$404, %ecx
	xorl	%esi, %esi
	movq	%rbx, %rdi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	salq	$2, %rdx
	call	__memset_chk@PLT
	movl	%r12d, 8(%rsp)
	leaq	16(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	16(%rsp), %rax
	movl	20(%rsp), %ecx
	movl	(%rbx,%rax,4), %edx
	testl	%edx, %edx
	je	.L4
	cmpl	%ecx, %edx
	jge	.L5
.L4:
	movl	%ecx, (%rbx,%rax,4)
.L5:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jg	.L6
	movl	12(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L15
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L16
	movl	%ecx, %edx
	leaq	4+dmax(%rip), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	leaq	16(%rax), %rdi
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rdi, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rax), %xmm2
	addq	$16, %rax
	paddd	%xmm2, %xmm0
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L7
.L8:
	movslq	%eax, %rsi
	addl	(%rbx,%rsi,4), %edx
	leal	1(%rax), %esi
	cmpl	%ecx, %esi
	jg	.L7
	movslq	%esi, %rsi
	addl	$2, %eax
	addl	(%rbx,%rsi,4), %edx
	cmpl	%eax, %ecx
	jl	.L7
	cltq
	addl	(%rbx,%rax,4), %edx
.L7:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L24
	addq	$40, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edx, %edx
	movl	$1, %eax
	jmp	.L8
.L24:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	dmax
	.bss
	.align 32
	.type	dmax, @object
	.size	dmax, 404
dmax:
	.zero	404
	.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:
```