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

```c
S[9999];main(F,I,s,f){for(;scanf("%d,%d",&I,&s)*I;S[I]=s)F|=1<<s;for(;~scanf("%d",&I);printf("%d\n",s))for(f=F&-1<<S[I],s=1;f&=f-1;)s++;}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d,%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%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
	leaq	S(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%esi, 12(%rsp)
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %rbp
	movl	%edx, 8(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rsp), %ecx
	movl	$1, %eax
	movl	%ecx, (%r14,%rdx,4)
	sall	%cl, %eax
	orl	%eax, %ebx
.L2:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	leaq	.LC2(%rip), %r12
	leaq	S(%rip), %r15
	movl	$-1, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movslq	12(%rsp), %rax
	movl	$1, 8(%rsp)
	movl	(%r15,%rax,4), %ecx
	movl	%r14d, %eax
	sall	%cl, %eax
	andl	%ebx, %eax
	leal	-1(%rax), %edx
	andl	%edx, %eax
	je	.L8
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-1(%rax), %edx
	movl	%ecx, %esi
	leal	1(%rcx), %ecx
	andl	%edx, %eax
	jne	.L6
	movl	%esi, 8(%rsp)
.L5:
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$24, %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
.L8:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 39996
S:
	.zero	39996
	.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"
.LC2:
	.string	"%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
	leaq	S(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%esi, 12(%rsp)
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %rbp
	movl	%edx, 8(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rsp), %ecx
	movl	$1, %eax
	movl	%ecx, (%r14,%rdx,4)
	sall	%cl, %eax
	orl	%eax, %ebx
.L2:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	leaq	.LC2(%rip), %r12
	leaq	S(%rip), %r15
	movl	$-1, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movslq	12(%rsp), %rax
	movl	$1, 8(%rsp)
	movl	(%r15,%rax,4), %ecx
	movl	%r14d, %eax
	sall	%cl, %eax
	andl	%ebx, %eax
	leal	-1(%rax), %edx
	andl	%edx, %eax
	je	.L8
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-1(%rax), %edx
	movl	%ecx, %esi
	leal	1(%rcx), %ecx
	andl	%edx, %eax
	jne	.L6
	movl	%esi, 8(%rsp)
.L5:
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$24, %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
.L8:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 39996
S:
	.zero	39996
	.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"
.LC2:
	.string	"%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
	leaq	S(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%esi, 12(%rsp)
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %rbp
	movl	%edx, 8(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rsp), %ecx
	movl	$1, %eax
	movl	%ecx, (%r14,%rdx,4)
	sall	%cl, %eax
	orl	%eax, %ebx
.L2:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	leaq	.LC2(%rip), %r12
	leaq	S(%rip), %r15
	movl	$-1, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movslq	12(%rsp), %rax
	movl	$1, 8(%rsp)
	movl	(%r15,%rax,4), %ecx
	movl	%r14d, %eax
	sall	%cl, %eax
	andl	%ebx, %eax
	leal	-1(%rax), %edx
	andl	%edx, %eax
	je	.L8
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-1(%rax), %edx
	movl	%ecx, %esi
	leal	1(%rcx), %ecx
	andl	%edx, %eax
	jne	.L6
	movl	%esi, 8(%rsp)
.L5:
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$24, %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
.L8:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 39996
S:
	.zero	39996
	.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
S[9999];main(F,I,s,f){for(;scanf("%d,%d",&I,&s)*I;S[I]=s)F|=1<<s;for(;~scanf("%d",&I);printf("%d\n",s))for(f=F&-1<<S[I],s=1;f&=f-1;)s++;}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
S[9999];main(F,I,s,f){for(;scanf("%d,%d",&I,&s)*I;S[I]=s)F|=1<<s;for(;~scanf("%d",&I);printf("%d\n",s))for(f=F&-1<<S[I],s=1;f&=f-1;)s++;}```

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:

1,20
2,20
3,30
4,10
5,10
6,20
0,0
1
2
4
1

2
2
3
2

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

```c
S[9999];main(F,I,s,f){for(;scanf("%d,%d",&I,&s)*I;S[I]=s)F|=1<<s;for(;~scanf("%d",&I);printf("%d\n",s))for(f=F&-1<<S[I],s=1;f&=f-1;)s++;}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d,%d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%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
	leaq	S(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%esi, 12(%rsp)
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %rbp
	movl	%edx, 8(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rsp), %ecx
	movl	$1, %eax
	movl	%ecx, (%r14,%rdx,4)
	sall	%cl, %eax
	orl	%eax, %ebx
.L2:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	leaq	.LC2(%rip), %r12
	leaq	S(%rip), %r15
	movl	$-1, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movslq	12(%rsp), %rax
	movl	$1, 8(%rsp)
	movl	(%r15,%rax,4), %ecx
	movl	%r14d, %eax
	sall	%cl, %eax
	andl	%ebx, %eax
	leal	-1(%rax), %edx
	andl	%edx, %eax
	je	.L8
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-1(%rax), %edx
	movl	%ecx, %esi
	leal	1(%rcx), %ecx
	andl	%edx, %eax
	jne	.L6
	movl	%esi, 8(%rsp)
.L5:
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$24, %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
.L8:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 39996
S:
	.zero	39996
	.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"
.LC2:
	.string	"%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
	leaq	S(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edi, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%esi, 12(%rsp)
	leaq	8(%rsp), %r13
	leaq	12(%rsp), %rbp
	movl	%edx, 8(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rsp), %ecx
	movl	$1, %eax
	movl	%ecx, (%r14,%rdx,4)
	sall	%cl, %eax
	orl	%eax, %ebx
.L2:
	movq	%r13, %rdx
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movslq	12(%rsp), %rdx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L3
	leaq	.LC2(%rip), %r12
	leaq	S(%rip), %r15
	movl	$-1, %r14d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L4:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movslq	12(%rsp), %rax
	movl	$1, 8(%rsp)
	movl	(%r15,%rax,4), %ecx
	movl	%r14d, %eax
	sall	%cl, %eax
	andl	%ebx, %eax
	leal	-1(%rax), %edx
	andl	%edx, %eax
	je	.L8
	movl	$2, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-1(%rax), %edx
	movl	%ecx, %esi
	leal	1(%rcx), %ecx
	andl	%edx, %eax
	jne	.L6
	movl	%esi, 8(%rsp)
.L5:
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$24, %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
.L8:
	.cfi_restore_state
	movl	$1, %esi
	jmp	.L5
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	S
	.bss
	.align 32
	.type	S, @object
	.size	S, 39996
S:
	.zero	39996
	.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:
```