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 Max(x,y) ((x>y)?x:y)
typedef struct str{
	int n;
	char s;
}STR;
STR d[1000005];
char s[1000005];
int main(){
	int i,j,n,k,l,ans=0;;
	scanf("%s",s);
	l=strlen(s);
	k=0;n=-1;
	for(i=0;i<l;i++){
		if(k!=s[i]){
			n++;
			k=s[i];
			d[n].s=s[i];
			d[n].n=1;
		}else d[n].n++;
	}
	for(i=1;i<n;i++){
		if(d[i].s=='O' && d[i-1].s=='J' && d[i+1].s=='I' 
		   && d[i].n<=d[i-1].n && d[i].n<=d[i+1].n)
		   ans=Max(ans,d[i].n);
	}
	printf("%d\n",ans);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L8
	leal	-1(%rax), %r9d
	leaq	1(%rbx), %rax
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	addq	%rax, %r9
	movl	$-1, %ecx
	leaq	d(%rip), %rdi
.L7:
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	je	.L4
.L15:
	addl	$1, %ecx
	addq	$1, %rdx
	movslq	%ecx, %r8
	movb	%sil, 4(%rdi,%r8,8)
	movl	$1, (%rdi,%r8,8)
	cmpq	%r9, %rdx
	je	.L6
	movl	%esi, %r8d
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	jne	.L15
.L4:
	movslq	%ecx, %rax
	addq	$1, %rdx
	addl	$1, (%rdi,%rax,8)
	cmpq	%r9, %rdx
	jne	.L7
.L6:
	cmpl	$1, %ecx
	jle	.L8
	leaq	d(%rip), %rax
	subl	$2, %ecx
	xorl	%r8d, %r8d
	leaq	8(%rax), %rdx
	leaq	(%rdx,%rcx,8), %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$8, %rax
	cmpq	%rdx, %rax
	je	.L3
.L10:
	cmpb	$79, 12(%rax)
	jne	.L9
	cmpb	$74, 4(%rax)
	jne	.L9
	cmpb	$73, 20(%rax)
	jne	.L9
	movl	8(%rax), %ecx
	cmpl	(%rax), %ecx
	jg	.L9
	cmpl	16(%rax), %ecx
	jg	.L9
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	jmp	.L9
.L8:
	xorl	%r8d, %r8d
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1000005
s:
	.zero	1000005
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 8000040
d:
	.zero	8000040
	.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	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L8
	leal	-1(%rax), %r9d
	leaq	1(%rbx), %rax
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	addq	%rax, %r9
	movl	$-1, %ecx
	leaq	d(%rip), %rdi
.L7:
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	je	.L4
.L15:
	addl	$1, %ecx
	addq	$1, %rdx
	movslq	%ecx, %r8
	movb	%sil, 4(%rdi,%r8,8)
	movl	$1, (%rdi,%r8,8)
	cmpq	%r9, %rdx
	je	.L6
	movl	%esi, %r8d
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	jne	.L15
.L4:
	movslq	%ecx, %rax
	addq	$1, %rdx
	addl	$1, (%rdi,%rax,8)
	cmpq	%r9, %rdx
	jne	.L7
.L6:
	cmpl	$1, %ecx
	jle	.L8
	leaq	d(%rip), %rax
	subl	$2, %ecx
	xorl	%r8d, %r8d
	leaq	8(%rax), %rdx
	leaq	(%rdx,%rcx,8), %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$8, %rax
	cmpq	%rdx, %rax
	je	.L3
.L10:
	cmpb	$79, 12(%rax)
	jne	.L9
	cmpb	$74, 4(%rax)
	jne	.L9
	cmpb	$73, 20(%rax)
	jne	.L9
	movl	8(%rax), %ecx
	cmpl	(%rax), %ecx
	jg	.L9
	cmpl	16(%rax), %ecx
	jg	.L9
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	jmp	.L9
.L8:
	xorl	%r8d, %r8d
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1000005
s:
	.zero	1000005
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 8000040
d:
	.zero	8000040
	.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	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L8
	leal	-1(%rax), %r9d
	leaq	1(%rbx), %rax
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	addq	%rax, %r9
	movl	$-1, %ecx
	leaq	d(%rip), %rdi
.L7:
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	je	.L4
.L15:
	addl	$1, %ecx
	addq	$1, %rdx
	movslq	%ecx, %r8
	movb	%sil, 4(%rdi,%r8,8)
	movl	$1, (%rdi,%r8,8)
	cmpq	%r9, %rdx
	je	.L6
	movl	%esi, %r8d
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	jne	.L15
.L4:
	movslq	%ecx, %rax
	addq	$1, %rdx
	addl	$1, (%rdi,%rax,8)
	cmpq	%r9, %rdx
	jne	.L7
.L6:
	cmpl	$1, %ecx
	jle	.L8
	leaq	d(%rip), %rax
	subl	$2, %ecx
	xorl	%r8d, %r8d
	leaq	8(%rax), %rdx
	leaq	(%rdx,%rcx,8), %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$8, %rax
	cmpq	%rdx, %rax
	je	.L3
.L10:
	cmpb	$79, 12(%rax)
	jne	.L9
	cmpb	$74, 4(%rax)
	jne	.L9
	cmpb	$73, 20(%rax)
	jne	.L9
	movl	8(%rax), %ecx
	cmpl	(%rax), %ecx
	jg	.L9
	cmpl	16(%rax), %ecx
	jg	.L9
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	jmp	.L9
.L8:
	xorl	%r8d, %r8d
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1000005
s:
	.zero	1000005
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 8000040
d:
	.zero	8000040
	.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 Max(x,y) ((x>y)?x:y)
typedef struct str{
	int n;
	char s;
}STR;
STR d[1000005];
char s[1000005];
int main(){
	int i,j,n,k,l,ans=0;;
	scanf("%s",s);
	l=strlen(s);
	k=0;n=-1;
	for(i=0;i<l;i++){
		if(k!=s[i]){
			n++;
			k=s[i];
			d[n].s=s[i];
			d[n].n=1;
		}else d[n].n++;
	}
	for(i=1;i<n;i++){
		if(d[i].s=='O' && d[i-1].s=='J' && d[i+1].s=='I' 
		   && d[i].n<=d[i-1].n && d[i].n<=d[i+1].n)
		   ans=Max(ans,d[i].n);
	}
	printf("%d\n",ans);
	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 Max(x,y) ((x>y)?x:y)
typedef struct str{
	int n;
	char s;
}STR;
STR d[1000005];
char s[1000005];
int main(){
	int i,j,n,k,l,ans=0;;
	scanf("%s",s);
	l=strlen(s);
	k=0;n=-1;
	for(i=0;i<l;i++){
		if(k!=s[i]){
			n++;
			k=s[i];
			d[n].s=s[i];
			d[n].n=1;
		}else d[n].n++;
	}
	for(i=1;i<n;i++){
		if(d[i].s=='O' && d[i-1].s=='J' && d[i+1].s=='I' 
		   && d[i].n<=d[i-1].n && d[i].n<=d[i+1].n)
		   ans=Max(ans,d[i].n);
	}
	printf("%d\n",ans);
	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:

OJJOOIIOJOI

2

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 Max(x,y) ((x>y)?x:y)
typedef struct str{
	int n;
	char s;
}STR;
STR d[1000005];
char s[1000005];
int main(){
	int i,j,n,k,l,ans=0;;
	scanf("%s",s);
	l=strlen(s);
	k=0;n=-1;
	for(i=0;i<l;i++){
		if(k!=s[i]){
			n++;
			k=s[i];
			d[n].s=s[i];
			d[n].n=1;
		}else d[n].n++;
	}
	for(i=1;i<n;i++){
		if(d[i].s=='O' && d[i-1].s=='J' && d[i+1].s=='I' 
		   && d[i].n<=d[i-1].n && d[i].n<=d[i+1].n)
		   ans=Max(ans,d[i].n);
	}
	printf("%d\n",ans);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L8
	leal	-1(%rax), %r9d
	leaq	1(%rbx), %rax
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	addq	%rax, %r9
	movl	$-1, %ecx
	leaq	d(%rip), %rdi
.L7:
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	je	.L4
.L15:
	addl	$1, %ecx
	addq	$1, %rdx
	movslq	%ecx, %r8
	movb	%sil, 4(%rdi,%r8,8)
	movl	$1, (%rdi,%r8,8)
	cmpq	%r9, %rdx
	je	.L6
	movl	%esi, %r8d
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	jne	.L15
.L4:
	movslq	%ecx, %rax
	addq	$1, %rdx
	addl	$1, (%rdi,%rax,8)
	cmpq	%r9, %rdx
	jne	.L7
.L6:
	cmpl	$1, %ecx
	jle	.L8
	leaq	d(%rip), %rax
	subl	$2, %ecx
	xorl	%r8d, %r8d
	leaq	8(%rax), %rdx
	leaq	(%rdx,%rcx,8), %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$8, %rax
	cmpq	%rdx, %rax
	je	.L3
.L10:
	cmpb	$79, 12(%rax)
	jne	.L9
	cmpb	$74, 4(%rax)
	jne	.L9
	cmpb	$73, 20(%rax)
	jne	.L9
	movl	8(%rax), %ecx
	cmpl	(%rax), %ecx
	jg	.L9
	cmpl	16(%rax), %ecx
	jg	.L9
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	jmp	.L9
.L8:
	xorl	%r8d, %r8d
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1000005
s:
	.zero	1000005
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 8000040
d:
	.zero	8000040
	.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	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	s(%rip), %rbx
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L8
	leal	-1(%rax), %r9d
	leaq	1(%rbx), %rax
	movq	%rbx, %rdx
	xorl	%r8d, %r8d
	addq	%rax, %r9
	movl	$-1, %ecx
	leaq	d(%rip), %rdi
.L7:
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	je	.L4
.L15:
	addl	$1, %ecx
	addq	$1, %rdx
	movslq	%ecx, %r8
	movb	%sil, 4(%rdi,%r8,8)
	movl	$1, (%rdi,%r8,8)
	cmpq	%r9, %rdx
	je	.L6
	movl	%esi, %r8d
	movsbl	(%rdx), %esi
	cmpl	%r8d, %esi
	jne	.L15
.L4:
	movslq	%ecx, %rax
	addq	$1, %rdx
	addl	$1, (%rdi,%rax,8)
	cmpq	%r9, %rdx
	jne	.L7
.L6:
	cmpl	$1, %ecx
	jle	.L8
	leaq	d(%rip), %rax
	subl	$2, %ecx
	xorl	%r8d, %r8d
	leaq	8(%rax), %rdx
	leaq	(%rdx,%rcx,8), %rdx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L9:
	addq	$8, %rax
	cmpq	%rdx, %rax
	je	.L3
.L10:
	cmpb	$79, 12(%rax)
	jne	.L9
	cmpb	$74, 4(%rax)
	jne	.L9
	cmpb	$73, 20(%rax)
	jne	.L9
	movl	8(%rax), %ecx
	cmpl	(%rax), %ecx
	jg	.L9
	cmpl	16(%rax), %ecx
	jg	.L9
	cmpl	%ecx, %r8d
	cmovl	%ecx, %r8d
	jmp	.L9
.L8:
	xorl	%r8d, %r8d
.L3:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 1000005
s:
	.zero	1000005
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 8000040
d:
	.zero	8000040
	.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:
```