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

```c
c,n,t;main(x){for(;t=scanf("%d%*d ",&n),n;printf("%d\n",c))for(c=0;x=getchar()%5;++t)t=x-4?t%2?c+=t>2*n,t:1:t%2?0:t;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%*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
.L11:
	movl	$0, c(%rip)
	jmp	.L3
.L10:
	cmpl	$4, -4(%rbp)
	je	.L4
	movl	t(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	n(%rip), %eax
	leal	(%rax,%rax), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %edx
	movl	c(%rip), %eax
	addl	%edx, %eax
	movl	%eax, c(%rip)
	movl	t(%rip), %eax
	jmp	.L7
.L5:
	movl	$1, %eax
	jmp	.L7
.L4:
	movl	t(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L8
	movl	t(%rip), %eax
	jmp	.L7
.L8:
	movl	$0, %eax
.L7:
	movl	%eax, t(%rip)
	movl	t(%rip), %eax
	addl	$1, %eax
	movl	%eax, t(%rip)
.L3:
	movl	$0, %eax
	call	getchar@PLT
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	%edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, -4(%rbp)
	movl	-4(%rbp), %ecx
	movl	%ecx, %edx
	sall	$2, %edx
	addl	%ecx, %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L10
	movl	c(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	%eax, t(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	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\n"
.LC1:
	.string	"%d%*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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	n(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	$1, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	%eax, t(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L13
	movl	$0, c(%rip)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movl	$2, %edx
	testl	%ecx, %ecx
	je	.L5
	movl	n(%rip), %esi
	leal	(%rsi,%rsi), %edx
	cmpl	%eax, %edx
	setl	%dl
	movzbl	%dl, %edx
	addl	%edx, c(%rip)
	leal	1(%rax), %edx
.L5:
	movl	%edx, t(%rip)
.L3:
	xorl	%eax, %eax
	call	getchar@PLT
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$33, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	je	.L14
	movl	t(%rip), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$4, %edx
	jne	.L15
	addl	$1, %eax
	testl	%ecx, %ecx
	cmovne	%ebx, %eax
	movl	%eax, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	movl	c(%rip), %esi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	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	t
	.bss
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.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\n"
.LC1:
	.string	"%d%*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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	n(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	$1, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	%eax, t(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L13
	movl	$0, c(%rip)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	movl	$2, %edx
	testl	%ecx, %ecx
	je	.L5
	movl	n(%rip), %esi
	leal	(%rsi,%rsi), %edx
	cmpl	%eax, %edx
	setl	%dl
	movzbl	%dl, %edx
	addl	%edx, c(%rip)
	leal	1(%rax), %edx
.L5:
	movl	%edx, t(%rip)
.L3:
	xorl	%eax, %eax
	call	getchar@PLT
	movslq	%eax, %rdx
	movl	%eax, %ecx
	imulq	$1717986919, %rdx, %rdx
	sarl	$31, %ecx
	sarq	$33, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	je	.L14
	movl	t(%rip), %eax
	movl	%eax, %ecx
	andl	$1, %ecx
	cmpl	$4, %edx
	jne	.L15
	addl	$1, %eax
	testl	%ecx, %ecx
	cmovne	%ebx, %eax
	movl	%eax, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L14:
	movl	c(%rip), %esi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L13:
	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	t
	.bss
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.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,n,t;main(x){for(;t=scanf("%d%*d ",&n),n;printf("%d\n",c))for(c=0;x=getchar()%5;++t)t=x-4?t%2?c+=t>2*n,t:1:t%2?0:t;}
1
13
OIIOIOIOIIOIO
2
13
OOIOIOIOIIOII
0
 1
13
OOIOIOIOIIOII
3
13
OOIOIOIOIIOII
0
 1
25
OOIOIOIOIIOII
3
13
OOJOIOIOIIOIJ
0
 1
25
OIIOIOIOIIOIO
0
13
OOJOIOIOIIOIJ
0
 1
25
OOIOIOIOIIOII
1
13
JIOIIOIOIOIOO
0
 1
25
OIIOIOIOIIOIO
1
13
OOJOIOIOIIOIJ
0
 1
25
OOIOIOIOIJOII
0
13
OOIOIOIOIIOIJ
0
 1
31
JIOHIOIOIOHOO
0
2
IOOOHPIOJHOIJ
-3
 1
25
OIIOIOHOIIOIO
3
25
OOJOIOIOIIOIJ
0
 1
31
OOIOIOHOIHOIJ
0
19
OOHOIOIOIIOIJ
-2

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

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

```c
c,n,t;main(x){for(;t=scanf("%d%*d ",&n),n;printf("%d\n",c))for(c=0;x=getchar()%5;++t)t=x-4?t%2?c+=t>2*n,t:1:t%2?0:t;}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%*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
.L11:
	movl	$0, c(%rip)
	jmp	.L3
.L10:
	cmpl	$4, -4(%rbp)
	je	.L4
	movl	t(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	n(%rip), %eax
	leal	(%rax,%rax), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %edx
	movl	c(%rip), %eax
	addl	%edx, %eax
	movl	%eax, c(%rip)
	movl	t(%rip), %eax
	jmp	.L7
.L5:
	movl	$1, %eax
	jmp	.L7
.L4:
	movl	t(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L8
	movl	t(%rip), %eax
	jmp	.L7
.L8:
	movl	$0, %eax
.L7:
	movl	%eax, t(%rip)
	movl	t(%rip), %eax
	addl	$1, %eax
	movl	%eax, t(%rip)
.L3:
	movl	$0, %eax
	call	getchar@PLT
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	%edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, -4(%rbp)
	movl	-4(%rbp), %ecx
	movl	%ecx, %edx
	sall	$2, %edx
	addl	%ecx, %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L10
	movl	c(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	%eax, t(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	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	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 4
	.type	t, @object
	.size	t, 4
t:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d%*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
.L11:
	movl	$0, c(%rip)
	jmp	.L3
.L10:
	cmpl	$4, -4(%rbp)
	je	.L4
	movl	t(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	n(%rip), %eax
	leal	(%rax,%rax), %edx
	movl	t(%rip), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %edx
	movl	c(%rip), %eax
	addl	%edx, %eax
	movl	%eax, c(%rip)
	movl	t(%rip), %eax
	jmp	.L7
.L5:
	movl	$1, %eax
	jmp	.L7
.L4:
	movl	t(%rip), %eax
	andl	$1, %eax
	testl	%eax, %eax
	jne	.L8
	movl	t(%rip), %eax
	jmp	.L7
.L8:
	movl	$0, %eax
.L7:
	movl	%eax, t(%rip)
	movl	t(%rip), %eax
	addl	$1, %eax
	movl	%eax, t(%rip)
.L3:
	movl	$0, %eax
	call	getchar@PLT
	movslq	%eax, %rdx
	imulq	$1717986919, %rdx, %rdx
	shrq	$32, %rdx
	sarl	%edx
	movl	%eax, %ecx
	sarl	$31, %ecx
	subl	%ecx, %edx
	movl	%edx, -4(%rbp)
	movl	-4(%rbp), %ecx
	movl	%ecx, %edx
	sall	$2, %edx
	addl	%ecx, %edx
	subl	%edx, %eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L10
	movl	c(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	%eax, t(%rip)
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L11
	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:
