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

```c
a,b,s[104],n,i;main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,s);)c-*s?s[c>*s?a:b]+=3:++s[a]-++s[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=s[i]<s[a++];}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 416
s:
	.zero	416
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.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)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L2
.L8:
	movl	s(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	s(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	a(%rip), %eax
	jmp	.L5
.L4:
	movl	b(%rip), %eax
.L5:
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	s(%rip), %ecx
	movl	-4(%rbp), %eax
	cmpl	%eax, %ecx
	jge	.L6
	movl	a(%rip), %eax
	jmp	.L7
.L6:
	movl	b(%rip), %eax
.L7:
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L3:
	movl	a(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	s(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	s(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-4(%rbp), %rax
	leaq	s(%rip), %r8
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L8
	jmp	.L9
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	a(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, a(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %edx
	movl	b(%rip), %eax
	addl	%edx, %eax
	movl	%eax, b(%rip)
.L10:
	movl	a(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	b(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	movl	b(%rip), %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L10
	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"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	b(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	s(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	.LC0(%rip), %rdi
	leaq	12(%rsp), %r14
	call	scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	12(%rsp), %eax
	cmpl	%eax, (%rbx)
	je	.L3
	movl	a(%rip), %eax
	cmovge	b(%rip), %eax
	cltq
	addl	$3, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	addl	$1, (%rbx,%rax,4)
	movslq	b(%rip), %rax
	addl	$1, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	i(%rip), %ecx
	leaq	s(%rip), %r12
	movl	n(%rip), %edx
	leaq	.LC2(%rip), %rbx
	leaq	20(%r12), %rbp
	leal	1(%rcx), %eax
	movl	%eax, i(%rip)
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	setl	%cl
	movzbl	%cl, %ecx
	movl	%ecx, b(%rip)
	movl	%ecx, a(%rip)
	jge	.L9
	movl	$1, %esi
	testl	%edx, %edx
	jle	.L14
	cltq
	movl	(%r12,%rax,4), %edi
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edx, %ecx
	movd	%edi, %xmm3
	leaq	4+s(%rip), %rax
	shrl	$2, %ecx
	pshufd	$0, %xmm3, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rbp, %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rcx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%edx, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	leal	1(%rcx), %eax
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %esi
	addl	$1, %esi
	cmpl	%ecx, %edx
	je	.L12
.L10:
	movslq	%eax, %r8
	leal	1(%rax), %ecx
	cmpl	(%r12,%r8,4), %edi
	setl	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %esi
	cmpl	%edx, %ecx
	jg	.L12
	movslq	%ecx, %rcx
	addl	$2, %eax
	cmpl	(%r12,%rcx,4), %edi
	setl	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %esi
	cmpl	%eax, %edx
	jl	.L12
	cltq
	cmpl	(%r12,%rax,4), %edi
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L12:
	addl	$1, %edx
	movl	%esi, b(%rip)
	movl	%edx, a(%rip)
.L14:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %ecx
	movl	n(%rip), %edx
	leal	1(%rcx), %eax
	movl	%eax, i(%rip)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %eax
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 416
s:
	.zero	416
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	n(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	b(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	a(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	s(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	.LC0(%rip), %rdi
	leaq	12(%rsp), %r14
	call	scanf@PLT
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %r8
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L22
	movl	12(%rsp), %eax
	cmpl	%eax, (%rbx)
	je	.L3
	movl	a(%rip), %eax
	cmovge	b(%rip), %eax
	cltq
	addl	$3, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movslq	a(%rip), %rax
	addl	$1, (%rbx,%rax,4)
	movslq	b(%rip), %rax
	addl	$1, (%rbx,%rax,4)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L22:
	movl	i(%rip), %ecx
	leaq	s(%rip), %r12
	movl	n(%rip), %edx
	leaq	.LC2(%rip), %rbx
	leaq	20(%r12), %rbp
	leal	1(%rcx), %eax
	movl	%eax, i(%rip)
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	%edx, %ecx
	setl	%cl
	movzbl	%cl, %ecx
	movl	%ecx, b(%rip)
	movl	%ecx, a(%rip)
	jge	.L9
	movl	$1, %esi
	testl	%edx, %edx
	jle	.L14
	cltq
	movl	(%r12,%rax,4), %edi
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L15
	movl	%edx, %ecx
	movd	%edi, %xmm3
	leaq	4+s(%rip), %rax
	shrl	$2, %ecx
	pshufd	$0, %xmm3, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %ecx
	salq	$4, %rcx
	addq	%rbp, %rcx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm0
	addq	$16, %rax
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rcx
	jne	.L11
	movdqa	%xmm1, %xmm0
	movl	%edx, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	leal	1(%rcx), %eax
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %esi
	addl	$1, %esi
	cmpl	%ecx, %edx
	je	.L12
.L10:
	movslq	%eax, %r8
	leal	1(%rax), %ecx
	cmpl	(%r12,%r8,4), %edi
	setl	%r8b
	movzbl	%r8b, %r8d
	addl	%r8d, %esi
	cmpl	%edx, %ecx
	jg	.L12
	movslq	%ecx, %rcx
	addl	$2, %eax
	cmpl	(%r12,%rcx,4), %edi
	setl	%cl
	movzbl	%cl, %ecx
	addl	%ecx, %esi
	cmpl	%eax, %edx
	jl	.L12
	cltq
	cmpl	(%r12,%rax,4), %edi
	setl	%al
	movzbl	%al, %eax
	addl	%eax, %esi
.L12:
	addl	$1, %edx
	movl	%esi, b(%rip)
	movl	%edx, a(%rip)
.L14:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	movl	i(%rip), %ecx
	movl	n(%rip), %edx
	leal	1(%rcx), %eax
	movl	%eax, i(%rip)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %eax
	jmp	.L10
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	i
	.bss
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 416
s:
	.zero	416
	.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:

a,b,s[104],n,i;main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,s);)c-*s?s[c>*s?a:b]+=3:++s[a]-++s[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=s[i]<s[a++];}
4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 0 1
1 3 2 1
1 4 2 2
4 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 1 1
1 3 2 1
1 4 2 2
4 0 3 1
2 4 3 0
0 4 1 4
 4
1 1 1 1
1 3 2 1
1 4 2 0
4 0 3 1
2 4 3 0
0 4 1 4
 4
1 2 0 1
2 3 2 1
1 4 2 2
2 3 2 1
2 4 3 0
3 4 1 3
 4
1 2 0 1
1 3 2 1
1 4 2 2
4 0 2 1
3 4 3 0
0 4 1 4
 4
1 1 1 1
1 3 2 1
1 3 2 2
4 0 3 2
2 4 3 0
0 4 1 4
 4
1 4 0 1
1 3 2 1
1 4 2 2
4 0 2 1
3 4 3 0
-1 4 1 4
 4
1 1 1 1
1 3 2 1
2 4 2 0
4 0 3 1
2 4 3 0
0 4 2 8
 4
1 2 0 1
1 3 2 1
1 4 2 2
2 3 1 0
2 4 3 0
3 4 1 0

2
1
4
2
 3
2
4
1
 2
3
4
1
 1
3
4
2
 3
1
4
2
 2
3
3
1
 1
3
4
1
 2
4
3
1
 3
1
4
1
 2
1
3
4

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

```c
a,b,s[104],n,i;main(c){for(scanf("%d",&n);~scanf("%d%d%d%d",&a,&b,&c,s);)c-*s?s[c>*s?a:b]+=3:++s[a]-++s[b];for(;a=b=i++<n;printf("%d\n",b))for(;a<=n;)b+=s[i]<s[a++];}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 416
s:
	.zero	416
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.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)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L2
.L8:
	movl	s(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	s(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	a(%rip), %eax
	jmp	.L5
.L4:
	movl	b(%rip), %eax
.L5:
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	s(%rip), %ecx
	movl	-4(%rbp), %eax
	cmpl	%eax, %ecx
	jge	.L6
	movl	a(%rip), %eax
	jmp	.L7
.L6:
	movl	b(%rip), %eax
.L7:
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L3:
	movl	a(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	s(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	s(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-4(%rbp), %rax
	leaq	s(%rip), %r8
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L8
	jmp	.L9
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	a(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, a(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %edx
	movl	b(%rip), %eax
	addl	%edx, %eax
	movl	%eax, b(%rip)
.L10:
	movl	a(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	b(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	movl	b(%rip), %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L10
	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	a
	.bss
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.globl	b
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 416
s:
	.zero	416
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d\n"
	.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)
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L2
.L8:
	movl	s(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	je	.L3
	movl	s(%rip), %edx
	movl	-4(%rbp), %eax
	cmpl	%eax, %edx
	jge	.L4
	movl	a(%rip), %eax
	jmp	.L5
.L4:
	movl	b(%rip), %eax
.L5:
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	s(%rip), %ecx
	movl	-4(%rbp), %eax
	cmpl	%eax, %ecx
	jge	.L6
	movl	a(%rip), %eax
	jmp	.L7
.L6:
	movl	b(%rip), %eax
.L7:
	leal	3(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L2
.L3:
	movl	a(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	s(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	b(%rip), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	s(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	%ecx, (%rdx,%rax)
.L2:
	leaq	-4(%rbp), %rax
	leaq	s(%rip), %r8
	movq	%rax, %rcx
	leaq	b(%rip), %rax
	movq	%rax, %rdx
	leaq	a(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L8
	jmp	.L9
.L11:
	movl	i(%rip), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	a(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, a(%rip)
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	s(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %edx
	movl	b(%rip), %eax
	addl	%edx, %eax
	movl	%eax, b(%rip)
.L10:
	movl	a(%rip), %edx
	movl	n(%rip), %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	b(%rip), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L9:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movl	%edx, i(%rip)
	movl	n(%rip), %edx
	cmpl	%edx, %eax
	setl	%al
	movzbl	%al, %eax
	movl	%eax, b(%rip)
	movl	b(%rip), %eax
	movl	%eax, a(%rip)
	movl	a(%rip), %eax
	testl	%eax, %eax
	jne	.L10
	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:
