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

```c
// Aizu Vol-5 0522: JOI and IOI
// 2017.8.30 bal4u@uu

#include <stdio.h>

char s[10005];

int main()
{
	int joi, ioi;
	char *p;

	while (scanf("%s", s) != EOF) {
		p = s, joi = ioi = 0;
		while (*p) {
			if (*(p+1) == 'O' && *(p+2) == 'I') {
				if      (*p == 'J') joi++, p++;
				else if (*p == 'I') ioi++, p++;
			}
			p++;
		}
		printf("%d\n%d\n", joi, ioi);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n%d\n"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movzbl	(%rbx), %esi
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	testb	%sil, %sil
	je	.L6
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	je	.L18
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rdx
	testb	%al, %al
	je	.L6
	movl	%eax, %esi
.L20:
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	jne	.L3
.L18:
	cmpb	$73, 2(%rdx)
	je	.L19
.L4:
	movq	%rcx, %rdx
	movl	%eax, %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$74, %sil
	je	.L21
	cmpb	$73, %sil
	jne	.L4
	addl	$1, %r9d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	addl	$1, %r8d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10005
s:
	.zero	10005
	.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%d\n"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movzbl	(%rbx), %esi
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	testb	%sil, %sil
	je	.L6
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	je	.L18
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rdx
	testb	%al, %al
	je	.L6
	movl	%eax, %esi
.L20:
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	jne	.L3
.L18:
	cmpb	$73, 2(%rdx)
	je	.L19
.L4:
	movq	%rcx, %rdx
	movl	%eax, %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$74, %sil
	je	.L21
	cmpb	$73, %sil
	jne	.L4
	addl	$1, %r9d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	addl	$1, %r8d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10005
s:
	.zero	10005
	.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%d\n"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movzbl	(%rbx), %esi
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	testb	%sil, %sil
	je	.L6
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	je	.L18
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rdx
	testb	%al, %al
	je	.L6
	movl	%eax, %esi
.L20:
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	jne	.L3
.L18:
	cmpb	$73, 2(%rdx)
	je	.L19
.L4:
	movq	%rcx, %rdx
	movl	%eax, %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$74, %sil
	je	.L21
	cmpb	$73, %sil
	jne	.L4
	addl	$1, %r9d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	addl	$1, %r8d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10005
s:
	.zero	10005
	.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
// Aizu Vol-5 0522: JOI and IOI
// 2017.8.30 bal4u@uu

#include <stdio.h>

char s[10005];

int main()
{
	int joi, ioi;
	char *p;

	while (scanf("%s", s) != EOF) {
		p = s, joi = ioi = 0;
		while (*p) {
			if (*(p+1) == 'O' && *(p+2) == 'I') {
				if      (*p == 'J') joi++, p++;
				else if (*p == 'I') ioi++, p++;
			}
			p++;
		}
		printf("%d\n%d\n", joi, ioi);
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// Aizu Vol-5 0522: JOI and IOI
// 2017.8.30 bal4u@uu

#include <stdio.h>

char s[10005];

int main()
{
	int joi, ioi;
	char *p;

	while (scanf("%s", s) != EOF) {
		p = s, joi = ioi = 0;
		while (*p) {
			if (*(p+1) == 'O' && *(p+2) == 'I') {
				if      (*p == 'J') joi++, p++;
				else if (*p == 'I') ioi++, p++;
			}
			p++;
		}
		printf("%d\n%d\n", joi, ioi);
	}
	return 0;
}```

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:

JOIJOI
JOIOIOIOI
JOIOIOIJXNXNIOJIOIOJ
 eonN
 JOIJOI
JOIOINIOI
JOIOIOIJXNXNIOJIOIOJ
 JOIJOI
JOIOINIOI
JOIOIJOINXNXJIOIOIOJ
 JOIJOI
JOIOINIOI
JOIPIJOINXNXJIOIOIOJ
 JOIJOH
JOIOINIOI
JOIPIJOINXNXJIOIOIOJ
 JOIJOG
JOIOINIOI
JOIPIJOINXOXJINIOIOJ
 GOJIOJ
JOIOINIOI
JOIPIJOINXOXJINIOIOJ
 GOJIOJ
JOIOINJOI
JOIPIJOINXOXJINIOIOJ
 GOJIOJ
JOIOINJOJ
JOIPIJOINXOXJINIOIOJ

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

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

```c
// Aizu Vol-5 0522: JOI and IOI
// 2017.8.30 bal4u@uu

#include <stdio.h>

char s[10005];

int main()
{
	int joi, ioi;
	char *p;

	while (scanf("%s", s) != EOF) {
		p = s, joi = ioi = 0;
		while (*p) {
			if (*(p+1) == 'O' && *(p+2) == 'I') {
				if      (*p == 'J') joi++, p++;
				else if (*p == 'I') ioi++, p++;
			}
			p++;
		}
		printf("%d\n%d\n", joi, ioi);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n%d\n"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movzbl	(%rbx), %esi
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	testb	%sil, %sil
	je	.L6
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	je	.L18
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rdx
	testb	%al, %al
	je	.L6
	movl	%eax, %esi
.L20:
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	jne	.L3
.L18:
	cmpb	$73, 2(%rdx)
	je	.L19
.L4:
	movq	%rcx, %rdx
	movl	%eax, %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$74, %sil
	je	.L21
	cmpb	$73, %sil
	jne	.L4
	addl	$1, %r9d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	addl	$1, %r8d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10005
s:
	.zero	10005
	.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%d\n"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	s(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L12
	movzbl	(%rbx), %esi
	movq	%rbx, %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	testb	%sil, %sil
	je	.L6
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	je	.L18
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rcx, %rdx
	testb	%al, %al
	je	.L6
	movl	%eax, %esi
.L20:
	movzbl	1(%rdx), %eax
	leaq	1(%rdx), %rcx
	cmpb	$79, %al
	jne	.L3
.L18:
	cmpb	$73, 2(%rdx)
	je	.L19
.L4:
	movq	%rcx, %rdx
	movl	%eax, %esi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L19:
	cmpb	$74, %sil
	je	.L21
	cmpb	$73, %sil
	jne	.L4
	addl	$1, %r9d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L21:
	addl	$1, %r8d
	movl	$73, %eax
	leaq	2(%rdx), %rcx
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10005
s:
	.zero	10005
	.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:
```