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

```c
#include <stdio.h>
#include <string.h>
#define S_MAX 10000

char s[S_MAX + 1];

void solve(const int l){
	int j = 0, i = 0;
	int n = 1;
	while(n + 1 < l){
		if(s[n] == 'O' && s[n + 1] == 'I'){
			switch(s[n - 1]){
			case 'J':
				j++;
				break;
			case 'I':
				i++;
				break;
			}
		}
		n++;
	}
	printf("%d\n%d\n", j, i);
	return;
}

int main(void){
	while(scanf("%s",s) != EOF){
		solve(strlen(s));
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n%d\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	jle	.L6
	leaq	s(%rip), %rax
	leal	-3(%rdi), %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rax), %rcx
	addq	%rcx, %rdx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L2
.L5:
	cmpb	$79, 1(%rax)
	jne	.L3
	cmpb	$73, 2(%rax)
	jne	.L3
	movzbl	(%rax), %ecx
	cmpb	$73, %cl
	je	.L4
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rdx, %rax
	jne	.L5
.L2:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE35:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%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
	leaq	s(%rip), %rbx
	leaq	1(%rbx), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L16
	subl	$3, %eax
	leaq	s(%rip), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%r13, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rdx
	cmpq	%rax, %rdx
	je	.L11
.L14:
	cmpb	$79, 1(%rdx)
	jne	.L12
	cmpb	$73, 2(%rdx)
	jne	.L12
	movzbl	(%rdx), %ecx
	cmpb	$73, %cl
	je	.L13
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rdx
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rax, %rdx
	jne	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %r9d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$8, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L11
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10001
s:
	.zero	10001
	.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"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	jle	.L6
	leaq	s(%rip), %rax
	leal	-3(%rdi), %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rax), %rcx
	addq	%rcx, %rdx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L2
.L5:
	cmpb	$79, 1(%rax)
	jne	.L3
	cmpb	$73, 2(%rax)
	jne	.L3
	movzbl	(%rax), %ecx
	cmpb	$73, %cl
	je	.L4
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rdx, %rax
	jne	.L5
.L2:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE35:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%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
	leaq	s(%rip), %rbx
	leaq	1(%rbx), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L16
	subl	$3, %eax
	leaq	s(%rip), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%r13, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rdx
	cmpq	%rax, %rdx
	je	.L11
.L14:
	cmpb	$79, 1(%rdx)
	jne	.L12
	cmpb	$73, 2(%rdx)
	jne	.L12
	movzbl	(%rdx), %ecx
	cmpb	$73, %cl
	je	.L13
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rdx
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rax, %rdx
	jne	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %r9d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$8, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L11
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10001
s:
	.zero	10001
	.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"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	jle	.L6
	leaq	s(%rip), %rax
	leal	-3(%rdi), %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rax), %rcx
	addq	%rcx, %rdx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L2
.L5:
	cmpb	$79, 1(%rax)
	jne	.L3
	cmpb	$73, 2(%rax)
	jne	.L3
	movzbl	(%rax), %ecx
	cmpb	$73, %cl
	je	.L4
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rdx, %rax
	jne	.L5
.L2:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE35:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%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
	leaq	s(%rip), %rbx
	leaq	1(%rbx), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L16
	subl	$3, %eax
	leaq	s(%rip), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%r13, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rdx
	cmpq	%rax, %rdx
	je	.L11
.L14:
	cmpb	$79, 1(%rdx)
	jne	.L12
	cmpb	$73, 2(%rdx)
	jne	.L12
	movzbl	(%rdx), %ecx
	cmpb	$73, %cl
	je	.L13
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rdx
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rax, %rdx
	jne	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %r9d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$8, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L11
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10001
s:
	.zero	10001
	.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
#include <stdio.h>
#include <string.h>
#define S_MAX 10000

char s[S_MAX + 1];

void solve(const int l){
	int j = 0, i = 0;
	int n = 1;
	while(n + 1 < l){
		if(s[n] == 'O' && s[n + 1] == 'I'){
			switch(s[n - 1]){
			case 'J':
				j++;
				break;
			case 'I':
				i++;
				break;
			}
		}
		n++;
	}
	printf("%d\n%d\n", j, i);
	return;
}

int main(void){
	while(scanf("%s",s) != EOF){
		solve(strlen(s));
	}
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
#define S_MAX 10000

char s[S_MAX + 1];

void solve(const int l){
	int j = 0, i = 0;
	int n = 1;
	while(n + 1 < l){
		if(s[n] == 'O' && s[n + 1] == 'I'){
			switch(s[n - 1]){
			case 'J':
				j++;
				break;
			case 'I':
				i++;
				break;
			}
		}
		n++;
	}
	printf("%d\n%d\n", j, i);
	return;
}

int main(void){
	while(scanf("%s",s) != EOF){
		solve(strlen(s));
	}
	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
#include <stdio.h>
#include <string.h>
#define S_MAX 10000

char s[S_MAX + 1];

void solve(const int l){
	int j = 0, i = 0;
	int n = 1;
	while(n + 1 < l){
		if(s[n] == 'O' && s[n + 1] == 'I'){
			switch(s[n - 1]){
			case 'J':
				j++;
				break;
			case 'I':
				i++;
				break;
			}
		}
		n++;
	}
	printf("%d\n%d\n", j, i);
	return;
}

int main(void){
	while(scanf("%s",s) != EOF){
		solve(strlen(s));
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n%d\n"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	jle	.L6
	leaq	s(%rip), %rax
	leal	-3(%rdi), %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rax), %rcx
	addq	%rcx, %rdx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L2
.L5:
	cmpb	$79, 1(%rax)
	jne	.L3
	cmpb	$73, 2(%rax)
	jne	.L3
	movzbl	(%rax), %ecx
	cmpb	$73, %cl
	je	.L4
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rdx, %rax
	jne	.L5
.L2:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE35:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%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
	leaq	s(%rip), %rbx
	leaq	1(%rbx), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L16
	subl	$3, %eax
	leaq	s(%rip), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%r13, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rdx
	cmpq	%rax, %rdx
	je	.L11
.L14:
	cmpb	$79, 1(%rdx)
	jne	.L12
	cmpb	$73, 2(%rdx)
	jne	.L12
	movzbl	(%rdx), %ecx
	cmpb	$73, %cl
	je	.L13
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rdx
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rax, %rdx
	jne	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %r9d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$8, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L11
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10001
s:
	.zero	10001
	.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"
	.text
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB35:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	jle	.L6
	leaq	s(%rip), %rax
	leal	-3(%rdi), %edx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	leaq	1(%rax), %rcx
	addq	%rcx, %rdx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	cmpq	%rdx, %rax
	je	.L2
.L5:
	cmpb	$79, 1(%rax)
	jne	.L3
	cmpb	$73, 2(%rax)
	jne	.L3
	movzbl	(%rax), %ecx
	cmpb	$73, %cl
	je	.L4
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rax
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rdx, %rax
	jne	.L5
.L2:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L4:
	addl	$1, %r9d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L2
	.cfi_endproc
.LFE35:
	.size	solve, .-solve
	.section	.rodata.str1.1
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%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
	leaq	s(%rip), %rbx
	leaq	1(%rbx), %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %eax
	je	.L19
	movq	%rbx, %rdi
	call	strlen@PLT
	cmpq	$2, %rax
	jbe	.L16
	subl	$3, %eax
	leaq	s(%rip), %rdx
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	addq	%r13, %rax
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rdx
	cmpq	%rax, %rdx
	je	.L11
.L14:
	cmpb	$79, 1(%rdx)
	jne	.L12
	cmpb	$73, 2(%rdx)
	jne	.L12
	movzbl	(%rdx), %ecx
	cmpb	$73, %cl
	je	.L13
	cmpb	$74, %cl
	sete	%cl
	addq	$1, %rdx
	movzbl	%cl, %ecx
	addl	%ecx, %r8d
	cmpq	%rax, %rdx
	jne	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%r9d, %ecx
	movl	%r8d, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L13:
	addl	$1, %r9d
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L19:
	addq	$8, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	jmp	.L11
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 10001
s:
	.zero	10001
	.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:
```