Given the following C code and 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;}```

Assembly Code:

```assembly
	.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:
```

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\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
```assembly
	.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
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;}```
Given the following C 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;}```

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:

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 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;}```

Assembly Code:

```assembly
	.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:
```

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\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:
```