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

```c
j,o,i,m;main(c){for(;c=~getchar();c&1?o|i?o=i=0,j=1:++j:c&2?++i:i?j=0:++o)m=o>j|o>i|o<m?m:o;m=!printf("%d\n",m);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
.L12:
	movl	j(%rip), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	o(%rip), %eax
	cmpl	%eax, %edx
	setl	%cl
	movl	o(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	setl	%al
	orl	%ecx, %eax
	testb	%al, %al
	je	.L3
	movl	m(%rip), %eax
	jmp	.L4
.L3:
	movl	o(%rip), %eax
.L4:
	movl	%eax, m(%rip)
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	o(%rip), %edx
	movl	i(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	movl	$0, i(%rip)
	movl	i(%rip), %eax
	movl	%eax, o(%rip)
	movl	$1, j(%rip)
	jmp	.L2
.L6:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L8
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	jmp	.L2
.L8:
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L10
	movl	$0, j(%rip)
	jmp	.L2
.L10:
	movl	o(%rip), %eax
	addl	$1, %eax
	movl	%eax, o(%rip)
.L2:
	movl	$0, %eax
	call	getchar@PLT
	notl	%eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L12
	movl	m(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, m(%rip)
	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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	call	getchar@PLT
	xorl	$-1, %eax
	je	.L14
.L10:
	movl	j(%rip), %edi
	movl	i(%rip), %esi
	movl	m(%rip), %edx
	movl	o(%rip), %ecx
	cmpl	%esi, %edi
	movl	%esi, %r8d
	cmovle	%edi, %r8d
	cmpl	%edx, %ecx
	movl	%edx, %r9d
	cmovge	%ecx, %edx
	cmpl	%ecx, %r8d
	cmovl	%r9d, %edx
	movl	%edx, m(%rip)
	testb	$1, %al
	je	.L5
	orl	%ecx, %esi
	je	.L6
	movl	$0, i(%rip)
	xorl	%eax, %eax
	movl	$0, o(%rip)
	movl	$1, j(%rip)
	call	getchar@PLT
	xorl	$-1, %eax
	jne	.L10
.L14:
	movl	m(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, m(%rip)
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	testb	$2, %al
	je	.L8
	addl	$1, %esi
	movl	%esi, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %edi
	movl	%edi, j(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%esi, %esi
	je	.L9
	movl	$0, j(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %ecx
	movl	%ecx, o(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	call	getchar@PLT
	xorl	$-1, %eax
	je	.L14
.L10:
	movl	j(%rip), %edi
	movl	i(%rip), %esi
	movl	m(%rip), %edx
	movl	o(%rip), %ecx
	cmpl	%esi, %edi
	movl	%esi, %r8d
	cmovle	%edi, %r8d
	cmpl	%edx, %ecx
	movl	%edx, %r9d
	cmovge	%ecx, %edx
	cmpl	%ecx, %r8d
	cmovl	%r9d, %edx
	movl	%edx, m(%rip)
	testb	$1, %al
	je	.L5
	orl	%ecx, %esi
	je	.L6
	movl	$0, i(%rip)
	xorl	%eax, %eax
	movl	$0, o(%rip)
	movl	$1, j(%rip)
	call	getchar@PLT
	xorl	$-1, %eax
	jne	.L10
.L14:
	movl	m(%rip), %esi
	xorl	%eax, %eax
	leaq	.LC0(%rip), %rdi
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, m(%rip)
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	testb	$2, %al
	je	.L8
	addl	$1, %esi
	movl	%esi, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %edi
	movl	%edi, j(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L8:
	testl	%esi, %esi
	je	.L9
	movl	$0, j(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %ecx
	movl	%ecx, o(%rip)
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	m
	.bss
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.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:

j,o,i,m;main(c){for(;c=~getchar();c&1?o|i?o=i=0,j=1:++j:c&2?++i:i?j=0:++o)m=o>j|o>i|o<m?m:o;m=!printf("%d\n",m);}
OJJOOIIOJOI

2

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

```c
j,o,i,m;main(c){for(;c=~getchar();c&1?o|i?o=i=0,j=1:++j:c&2?++i:i?j=0:++o)m=o>j|o>i|o<m?m:o;m=!printf("%d\n",m);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
.L12:
	movl	j(%rip), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	o(%rip), %eax
	cmpl	%eax, %edx
	setl	%cl
	movl	o(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	setl	%al
	orl	%ecx, %eax
	testb	%al, %al
	je	.L3
	movl	m(%rip), %eax
	jmp	.L4
.L3:
	movl	o(%rip), %eax
.L4:
	movl	%eax, m(%rip)
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	o(%rip), %edx
	movl	i(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	movl	$0, i(%rip)
	movl	i(%rip), %eax
	movl	%eax, o(%rip)
	movl	$1, j(%rip)
	jmp	.L2
.L6:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L8
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	jmp	.L2
.L8:
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L10
	movl	$0, j(%rip)
	jmp	.L2
.L10:
	movl	o(%rip), %eax
	addl	$1, %eax
	movl	%eax, o(%rip)
.L2:
	movl	$0, %eax
	call	getchar@PLT
	notl	%eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L12
	movl	m(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, m(%rip)
	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	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	o
	.align 4
	.type	o, @object
	.size	o, 4
o:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d\n"
	.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
.L12:
	movl	j(%rip), %edx
	movl	i(%rip), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	o(%rip), %eax
	cmpl	%eax, %edx
	setl	%cl
	movl	o(%rip), %edx
	movl	m(%rip), %eax
	cmpl	%eax, %edx
	setl	%al
	orl	%ecx, %eax
	testb	%al, %al
	je	.L3
	movl	m(%rip), %eax
	jmp	.L4
.L3:
	movl	o(%rip), %eax
.L4:
	movl	%eax, m(%rip)
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L5
	movl	o(%rip), %edx
	movl	i(%rip), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L6
	movl	$0, i(%rip)
	movl	i(%rip), %eax
	movl	%eax, o(%rip)
	movl	$1, j(%rip)
	jmp	.L2
.L6:
	movl	j(%rip), %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L2
.L5:
	movl	-4(%rbp), %eax
	andl	$2, %eax
	testl	%eax, %eax
	je	.L8
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
	jmp	.L2
.L8:
	movl	i(%rip), %eax
	testl	%eax, %eax
	je	.L10
	movl	$0, j(%rip)
	jmp	.L2
.L10:
	movl	o(%rip), %eax
	addl	$1, %eax
	movl	%eax, o(%rip)
.L2:
	movl	$0, %eax
	call	getchar@PLT
	notl	%eax
	movl	%eax, -4(%rbp)
	cmpl	$0, -4(%rbp)
	jne	.L12
	movl	m(%rip), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, m(%rip)
	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:
