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

```c
c[6<<17];a;m;main(i){for(;~scanf("%d",&a);)i?i--:++c[a];for(a=2e5;a;m=i>m?i:m)i+=c[--a]-c[a+3];printf("%d",m);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %ebx
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L4
	testl	%ebx, %ebx
	jne	.L12
	leaq	c(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	addl	$1, 0(%r13,%rax,4)
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L3
.L4:
	movl	m(%rip), %esi
	movl	800008+c(%rip), %r10d
	leaq	799984+c(%rip), %rdx
	movl	$200000, %edi
	movl	800004+c(%rip), %r9d
	movl	800000+c(%rip), %r8d
.L6:
	movl	12(%rdx), %r12d
	subl	$4, %edi
	movl	%r12d, %eax
	subl	%r10d, %eax
	movl	8(%rdx), %r10d
	addl	%ebx, %eax
	movl	%r10d, %r11d
	subl	%r9d, %r11d
	movl	4(%rdx), %r9d
	addl	%eax, %r11d
	movl	%r9d, %ecx
	subl	%r8d, %ecx
	movl	(%rdx), %r8d
	addl	%r11d, %ecx
	movl	%r8d, %ebx
	subl	%r12d, %ebx
	addl	%ecx, %ebx
	cmpl	%r11d, %eax
	cmovl	%r11d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	cmpl	%ebx, %eax
	cmovl	%ebx, %eax
	cmpl	%eax, %esi
	cmovl	%eax, %esi
	subq	$16, %rdx
	cmpl	$4, %edi
	jne	.L6
	leaq	24+c(%rip), %rax
	leaq	-16(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	addl	-12(%rax), %ebx
	subl	(%rax), %ebx
	cmpl	%ebx, %esi
	cmovl	%ebx, %esi
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L7
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movl	%esi, m(%rip)
	movl	$0, a(%rip)
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 3145728
c:
	.zero	3145728
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %ebx
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L4
	testl	%ebx, %ebx
	jne	.L12
	leaq	c(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	addl	$1, 0(%r13,%rax,4)
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L3
.L4:
	movl	m(%rip), %esi
	movl	800008+c(%rip), %r10d
	leaq	799984+c(%rip), %rdx
	movl	$200000, %edi
	movl	800004+c(%rip), %r9d
	movl	800000+c(%rip), %r8d
.L6:
	movl	12(%rdx), %r12d
	subl	$4, %edi
	movl	%r12d, %eax
	subl	%r10d, %eax
	movl	8(%rdx), %r10d
	addl	%ebx, %eax
	movl	%r10d, %r11d
	subl	%r9d, %r11d
	movl	4(%rdx), %r9d
	addl	%eax, %r11d
	movl	%r9d, %ecx
	subl	%r8d, %ecx
	movl	(%rdx), %r8d
	addl	%r11d, %ecx
	movl	%r8d, %ebx
	subl	%r12d, %ebx
	addl	%ecx, %ebx
	cmpl	%r11d, %eax
	cmovl	%r11d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	cmpl	%ebx, %eax
	cmovl	%ebx, %eax
	cmpl	%eax, %esi
	cmovl	%eax, %esi
	subq	$16, %rdx
	cmpl	$4, %edi
	jne	.L6
	leaq	24+c(%rip), %rax
	leaq	-16(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	addl	-12(%rax), %ebx
	subl	(%rax), %ebx
	cmpl	%ebx, %esi
	cmovl	%ebx, %esi
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L7
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movl	%esi, m(%rip)
	movl	$0, a(%rip)
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 3145728
c:
	.zero	3145728
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %ebx
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L4
	testl	%ebx, %ebx
	jne	.L12
	leaq	c(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	addl	$1, 0(%r13,%rax,4)
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L3
.L4:
	movl	m(%rip), %esi
	movl	800008+c(%rip), %r10d
	leaq	799984+c(%rip), %rdx
	movl	$200000, %edi
	movl	800004+c(%rip), %r9d
	movl	800000+c(%rip), %r8d
.L6:
	movl	12(%rdx), %r12d
	subl	$4, %edi
	movl	%r12d, %eax
	subl	%r10d, %eax
	movl	8(%rdx), %r10d
	addl	%ebx, %eax
	movl	%r10d, %r11d
	subl	%r9d, %r11d
	movl	4(%rdx), %r9d
	addl	%eax, %r11d
	movl	%r9d, %ecx
	subl	%r8d, %ecx
	movl	(%rdx), %r8d
	addl	%r11d, %ecx
	movl	%r8d, %ebx
	subl	%r12d, %ebx
	addl	%ecx, %ebx
	cmpl	%r11d, %eax
	cmovl	%r11d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	cmpl	%ebx, %eax
	cmovl	%ebx, %eax
	cmpl	%eax, %esi
	cmovl	%eax, %esi
	subq	$16, %rdx
	cmpl	$4, %edi
	jne	.L6
	leaq	24+c(%rip), %rax
	leaq	-16(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	addl	-12(%rax), %ebx
	subl	(%rax), %ebx
	cmpl	%ebx, %esi
	cmovl	%ebx, %esi
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L7
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movl	%esi, m(%rip)
	movl	$0, a(%rip)
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 3145728
c:
	.zero	3145728
	.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
c[6<<17];a;m;main(i){for(;~scanf("%d",&a);)i?i--:++c[a];for(a=2e5;a;m=i>m?i:m)i+=c[--a]-c[a+3];printf("%d",m);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
c[6<<17];a;m;main(i){for(;~scanf("%d",&a);)i?i--:++c[a];for(a=2e5;a;m=i>m?i:m)i+=c[--a]-c[a+3];printf("%d",m);}```

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:

7
3 1 7 1 5 9 2
 7
3 1 7 1 5 9 0
 7
3 1 2 1 5 9 1
 7
3 2 2 -2 1 3 1
 7
1 2 2 0 1 2 1
 10
0 1 1 0 2 1 4 2 2 10
 10
0 1 1 0 2 1 2 2 1 10
 1
68972
 10
0 1 2 3 4 5 6 7 8 4
 10
-1 1 2 3 4 5 6 7 8 4

4 3 5 6 7 8 9 1 4 4
Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
c[6<<17];a;m;main(i){for(;~scanf("%d",&a);)i?i--:++c[a];for(a=2e5;a;m=i>m?i:m)i+=c[--a]-c[a+3];printf("%d",m);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %ebx
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L4
	testl	%ebx, %ebx
	jne	.L12
	leaq	c(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	addl	$1, 0(%r13,%rax,4)
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L3
.L4:
	movl	m(%rip), %esi
	movl	800008+c(%rip), %r10d
	leaq	799984+c(%rip), %rdx
	movl	$200000, %edi
	movl	800004+c(%rip), %r9d
	movl	800000+c(%rip), %r8d
.L6:
	movl	12(%rdx), %r12d
	subl	$4, %edi
	movl	%r12d, %eax
	subl	%r10d, %eax
	movl	8(%rdx), %r10d
	addl	%ebx, %eax
	movl	%r10d, %r11d
	subl	%r9d, %r11d
	movl	4(%rdx), %r9d
	addl	%eax, %r11d
	movl	%r9d, %ecx
	subl	%r8d, %ecx
	movl	(%rdx), %r8d
	addl	%r11d, %ecx
	movl	%r8d, %ebx
	subl	%r12d, %ebx
	addl	%ecx, %ebx
	cmpl	%r11d, %eax
	cmovl	%r11d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	cmpl	%ebx, %eax
	cmovl	%ebx, %eax
	cmpl	%eax, %esi
	cmovl	%eax, %esi
	subq	$16, %rdx
	cmpl	$4, %edi
	jne	.L6
	leaq	24+c(%rip), %rax
	leaq	-16(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	addl	-12(%rax), %ebx
	subl	(%rax), %ebx
	cmpl	%ebx, %esi
	cmovl	%ebx, %esi
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L7
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movl	%esi, m(%rip)
	movl	$0, a(%rip)
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 3145728
c:
	.zero	3145728
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	%edi, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %ebx
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L4
	testl	%ebx, %ebx
	jne	.L12
	leaq	c(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	addl	$1, 0(%r13,%rax,4)
	xorl	%eax, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L3
.L4:
	movl	m(%rip), %esi
	movl	800008+c(%rip), %r10d
	leaq	799984+c(%rip), %rdx
	movl	$200000, %edi
	movl	800004+c(%rip), %r9d
	movl	800000+c(%rip), %r8d
.L6:
	movl	12(%rdx), %r12d
	subl	$4, %edi
	movl	%r12d, %eax
	subl	%r10d, %eax
	movl	8(%rdx), %r10d
	addl	%ebx, %eax
	movl	%r10d, %r11d
	subl	%r9d, %r11d
	movl	4(%rdx), %r9d
	addl	%eax, %r11d
	movl	%r9d, %ecx
	subl	%r8d, %ecx
	movl	(%rdx), %r8d
	addl	%r11d, %ecx
	movl	%r8d, %ebx
	subl	%r12d, %ebx
	addl	%ecx, %ebx
	cmpl	%r11d, %eax
	cmovl	%r11d, %eax
	cmpl	%ecx, %eax
	cmovl	%ecx, %eax
	cmpl	%ebx, %eax
	cmovl	%ebx, %eax
	cmpl	%eax, %esi
	cmovl	%eax, %esi
	subq	$16, %rdx
	cmpl	$4, %edi
	jne	.L6
	leaq	24+c(%rip), %rax
	leaq	-16(%rax), %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	addl	-12(%rax), %ebx
	subl	(%rax), %ebx
	cmpl	%ebx, %esi
	cmovl	%ebx, %esi
	subq	$4, %rax
	cmpq	%rax, %rdx
	jne	.L7
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movl	%esi, m(%rip)
	movl	$0, a(%rip)
	call	printf@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	c
	.align 32
	.type	c, @object
	.size	c, 3145728
c:
	.zero	3145728
	.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:
```