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,c;main(n){for(;scanf("%d",&n)*n;printf("%d\n",c))for(a=c=0;n--;c+=(a^b)<31,a=b)scanf("%s",&b);}```

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	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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)
	jmp	.L2
.L5:
	movl	$0, c(%rip)
	movl	c(%rip), %eax
	movl	%eax, a(%rip)
	jmp	.L3
.L4:
	leaq	b(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	xorl	%edx, %eax
	cmpl	$30, %eax
	setle	%al
	movzbl	%al, %edx
	movl	c(%rip), %eax
	addl	%edx, %eax
	movl	%eax, c(%rip)
	movl	b(%rip), %eax
	movl	%eax, a(%rip)
.L3:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L4
	movl	c(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L5
	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	"%s"
.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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC1(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %esi
	imull	%esi, %eax
	testl	%eax, %eax
	je	.L12
	movl	$0, c(%rip)
	leal	-1(%rsi), %eax
	movl	$0, a(%rip)
	movl	%eax, 12(%rsp)
	testl	%esi, %esi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	b(%rip), %eax
	movl	a(%rip), %edx
	xorl	%esi, %esi
	xorl	%eax, %edx
	movl	%eax, a(%rip)
	movl	12(%rsp), %eax
	cmpl	$30, %edx
	setle	%sil
	leal	-1(%rax), %edx
	addl	c(%rip), %esi
	movl	%esi, c(%rip)
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L4
.L3:
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	c
	.bss
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.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	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	.LC1(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	b(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC0(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	12(%rsp), %esi
	imull	%esi, %eax
	testl	%eax, %eax
	je	.L12
	movl	$0, c(%rip)
	leal	-1(%rsi), %eax
	movl	$0, a(%rip)
	movl	%eax, 12(%rsp)
	testl	%esi, %esi
	je	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rbp, %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	scanf@PLT
	movl	b(%rip), %eax
	movl	a(%rip), %edx
	xorl	%esi, %esi
	xorl	%eax, %edx
	movl	%eax, a(%rip)
	movl	12(%rsp), %eax
	cmpl	$30, %edx
	setle	%sil
	leal	-1(%rax), %edx
	addl	c(%rip), %esi
	movl	%esi, c(%rip)
	movl	%edx, 12(%rsp)
	testl	%eax, %eax
	jne	.L4
.L3:
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	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
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	c
	.bss
	.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:

a,b,c;main(n){for(;scanf("%d",&n)*n;printf("%d\n",c))for(a=c=0;n--;c+=(a^b)<31,a=b)scanf("%s",&b);}
4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd ru rd ru lu rd ld
0
 4
lu ru ld rd
0
lu ld lu ru
0
ul
10
vr lu ld rd rv rd ru lu rc kd
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd ru rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd su rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt rd ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd su rd ru lu sd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt dr ru lu rd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld dr su rd ru lu sd ld
0
 4
lu ru ld rd
4
lu ld lu ru
0
ul
10
ru lu ld rd rt dr ru lu rd dl
0
 4
lu ru ld rd
4
lu ld lu ru
0
lu
10
ru lu ld rd ru rd ru lu rc ld
0

2
1
 2
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1
 2
1

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,c;main(n){for(;scanf("%d",&n)*n;printf("%d\n",c))for(a=c=0;n--;c+=(a^b)<31,a=b)scanf("%s",&b);}```

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	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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)
	jmp	.L2
.L5:
	movl	$0, c(%rip)
	movl	c(%rip), %eax
	movl	%eax, a(%rip)
	jmp	.L3
.L4:
	leaq	b(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	xorl	%edx, %eax
	cmpl	$30, %eax
	setle	%al
	movzbl	%al, %edx
	movl	c(%rip), %eax
	addl	%edx, %eax
	movl	%eax, c(%rip)
	movl	b(%rip), %eax
	movl	%eax, a(%rip)
.L3:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L4
	movl	c(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L5
	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	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"%d"
	.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)
	jmp	.L2
.L5:
	movl	$0, c(%rip)
	movl	c(%rip), %eax
	movl	%eax, a(%rip)
	jmp	.L3
.L4:
	leaq	b(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	a(%rip), %edx
	movl	b(%rip), %eax
	xorl	%edx, %eax
	cmpl	$30, %eax
	setle	%al
	movzbl	%al, %edx
	movl	c(%rip), %eax
	addl	%edx, %eax
	movl	%eax, c(%rip)
	movl	b(%rip), %eax
	movl	%eax, a(%rip)
.L3:
	movl	-4(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -4(%rbp)
	testl	%eax, %eax
	jne	.L4
	movl	c(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L5
	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:
