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

```c
a,b,c,d,s,x,y;main(n){for(scanf("%d",&n);d<n;){
scanf("%d",&x);
if(x==y)a=b,b=c,c=d;
else y=x;
if(s<++d-a)s=d-a;
}s=!printf("%d\n",s);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%eax, %eax
	leaq	x(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%eax, 12(%rsp)
	jle	.L10
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	x(%rip), %eax
	cmpl	y(%rip), %eax
	je	.L11
	movl	%eax, y(%rip)
	movl	d(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	subl	a(%rip), %edx
	cmpl	s(%rip), %edx
	movl	%eax, d(%rip)
	jle	.L6
.L4:
	movl	%edx, s(%rip)
	cmpl	%eax, 12(%rsp)
	jg	.L7
.L10:
	movl	s(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, s(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	c(%rip), %eax
	movl	b(%rip), %ecx
	movl	%eax, b(%rip)
	movl	d(%rip), %eax
	movl	%ecx, a(%rip)
	movl	%eax, c(%rip)
	addl	$1, %eax
	movl	%eax, %edx
	movl	%eax, d(%rip)
	subl	%ecx, %edx
	cmpl	s(%rip), %edx
	jle	.L6
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%eax, %eax
	leaq	x(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%eax, 12(%rsp)
	jle	.L10
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	x(%rip), %eax
	cmpl	y(%rip), %eax
	je	.L11
	movl	%eax, y(%rip)
	movl	d(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	subl	a(%rip), %edx
	cmpl	s(%rip), %edx
	movl	%eax, d(%rip)
	jle	.L6
.L4:
	movl	%edx, s(%rip)
	cmpl	%eax, 12(%rsp)
	jg	.L7
.L10:
	movl	s(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, s(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	c(%rip), %eax
	movl	b(%rip), %ecx
	movl	%eax, b(%rip)
	movl	d(%rip), %eax
	movl	%ecx, a(%rip)
	movl	%eax, c(%rip)
	addl	$1, %eax
	movl	%eax, %edx
	movl	%eax, d(%rip)
	subl	%ecx, %edx
	cmpl	s(%rip), %edx
	jle	.L6
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%eax, %eax
	leaq	x(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%eax, 12(%rsp)
	jle	.L10
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	x(%rip), %eax
	cmpl	y(%rip), %eax
	je	.L11
	movl	%eax, y(%rip)
	movl	d(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	subl	a(%rip), %edx
	cmpl	s(%rip), %edx
	movl	%eax, d(%rip)
	jle	.L6
.L4:
	movl	%edx, s(%rip)
	cmpl	%eax, 12(%rsp)
	jg	.L7
.L10:
	movl	s(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, s(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	c(%rip), %eax
	movl	b(%rip), %ecx
	movl	%eax, b(%rip)
	movl	d(%rip), %eax
	movl	%ecx, a(%rip)
	movl	%eax, c(%rip)
	addl	$1, %eax
	movl	%eax, %edx
	movl	%eax, d(%rip)
	subl	%ecx, %edx
	cmpl	s(%rip), %edx
	jle	.L6
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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
a,b,c,d,s,x,y;main(n){for(scanf("%d",&n);d<n;){
scanf("%d",&x);
if(x==y)a=b,b=c,c=d;
else y=x;
if(s<++d-a)s=d-a;
}s=!printf("%d\n",s);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
a,b,c,d,s,x,y;main(n){for(scanf("%d",&n);d<n;){
scanf("%d",&x);
if(x==y)a=b,b=c,c=d;
else y=x;
if(s<++d-a)s=d-a;
}s=!printf("%d\n",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:

10
1 1 0 0 0 0 1 1 1 0
 10
1 1 0 0 0 0 1 1 1 1
 10
1 1 0 0 0 0 1 2 1 1
 10
1 1 0 0 -1 0 1 2 1 1
 10
1 1 0 0 -1 1 1 2 1 1
 10
1 1 0 0 -1 2 1 2 1 2
 10
-1 1 1 1 1 -1 -21 1 1 15
 10
1 1 0 0 -1 1 1 2 1 2
 10
1 1 0 0 -1 2 1 4 1 2
 10
0 1 0 0 -1 2 1 4 1 2

5
 4
 6
 9
 8
 10
 7
 9
 10
 10

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

```c
a,b,c,d,s,x,y;main(n){for(scanf("%d",&n);d<n;){
scanf("%d",&x);
if(x==y)a=b,b=c,c=d;
else y=x;
if(s<++d-a)s=d-a;
}s=!printf("%d\n",s);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%eax, %eax
	leaq	x(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%eax, 12(%rsp)
	jle	.L10
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	x(%rip), %eax
	cmpl	y(%rip), %eax
	je	.L11
	movl	%eax, y(%rip)
	movl	d(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	subl	a(%rip), %edx
	cmpl	s(%rip), %edx
	movl	%eax, d(%rip)
	jle	.L6
.L4:
	movl	%edx, s(%rip)
	cmpl	%eax, 12(%rsp)
	jg	.L7
.L10:
	movl	s(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, s(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	c(%rip), %eax
	movl	b(%rip), %ecx
	movl	%eax, b(%rip)
	movl	d(%rip), %eax
	movl	%ecx, a(%rip)
	movl	%eax, c(%rip)
	addl	$1, %eax
	movl	%eax, %edx
	movl	%eax, d(%rip)
	subl	%ecx, %edx
	cmpl	s(%rip), %edx
	jle	.L6
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xorl	%eax, %eax
	leaq	x(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	.LC0(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 48
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	d(%rip), %eax
	.p2align 4,,10
	.p2align 3
.L6:
	cmpl	%eax, 12(%rsp)
	jle	.L10
.L7:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	x(%rip), %eax
	cmpl	y(%rip), %eax
	je	.L11
	movl	%eax, y(%rip)
	movl	d(%rip), %eax
	addl	$1, %eax
	movl	%eax, %edx
	subl	a(%rip), %edx
	cmpl	s(%rip), %edx
	movl	%eax, d(%rip)
	jle	.L6
.L4:
	movl	%edx, s(%rip)
	cmpl	%eax, 12(%rsp)
	jg	.L7
.L10:
	movl	s(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, s(%rip)
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	movl	c(%rip), %eax
	movl	b(%rip), %ecx
	movl	%eax, b(%rip)
	movl	d(%rip), %eax
	movl	%ecx, a(%rip)
	movl	%eax, c(%rip)
	addl	$1, %eax
	movl	%eax, %edx
	movl	%eax, d(%rip)
	subl	%ecx, %edx
	cmpl	s(%rip), %edx
	jle	.L6
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	s
	.align 4
	.type	s, @object
	.size	s, 4
s:
	.zero	4
	.globl	d
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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:
```