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

```c
i,f,d[5],*p;main(n){for(;i>4||~scanf("%d",p=d+i);i=++i%10,f*=!!i)n=!(d[i%5]*2&f)+49|(f/2^f/4^f/8)&3,i<5?f|=*p=9<<*p:puts(&n);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	movl	$9, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movl	i(%rip), %eax
	movl	%edi, 12(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	movq	%rsi, p(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movslq	i(%rip), %rax
	movl	f(%rip), %ecx
	movq	%rax, %rsi
	imulq	$1717986919, %rax, %rax
	leal	3(%rcx), %edi
	movl	%esi, %edx
	sarl	$31, %edx
	sarq	$33, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	movl	(%rbx,%rax,4), %edx
	movl	%ecx, %eax
	addl	%edx, %edx
	andl	%ecx, %edx
	cmpl	$1, %edx
	movl	$49, %edx
	adcl	$0, %edx
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	cmovns	%ecx, %edi
	sarl	$2, %edi
	xorl	%edi, %eax
	testl	%ecx, %ecx
	leal	7(%rcx), %edi
	cmovs	%edi, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	andl	$3, %eax
	orl	%edx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %esi
	jg	.L4
	movq	p(%rip), %rdx
	movl	%ebp, %eax
	movl	(%rdx), %ecx
	sall	%cl, %eax
	movl	%eax, (%rdx)
	orl	f(%rip), %eax
	movl	%eax, %ecx
.L5:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	movl	%edx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	movl	%edx, %eax
	addl	%esi, %esi
	subl	%esi, %eax
	setne	%dl
	movl	%eax, i(%rip)
	movzbl	%dl, %edx
	imull	%ecx, %edx
	movl	%edx, f(%rip)
.L2:
	cmpl	$4, %eax
	jle	.L14
	movslq	%eax, %rcx
	movl	%eax, %esi
	movl	f(%rip), %edx
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %esi
	sarq	$33, %rcx
	subl	%esi, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movl	(%rbx,%rax,4), %eax
	addl	%eax, %eax
	testl	%edx, %eax
	je	.L8
	testl	%edx, %edx
	leal	3(%rdx), %eax
	movl	%edx, %ecx
	cmovns	%edx, %eax
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	sarl	$2, %eax
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	7(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$3, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$49, %eax
	movl	%eax, 12(%rsp)
.L4:
	leaq	12(%rsp), %rdi
	call	puts@PLT
	movl	f(%rip), %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, %eax
	leal	7(%rdx), %ecx
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	testl	%edx, %edx
	cmovns	%edx, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	3(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$2, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$50, %eax
	movl	%eax, 12(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	d
	.align 16
	.type	d, @object
	.size	d, 20
d:
	.zero	20
	.globl	f
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	movl	$9, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movl	i(%rip), %eax
	movl	%edi, 12(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	movq	%rsi, p(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movslq	i(%rip), %rax
	movl	f(%rip), %ecx
	movq	%rax, %rsi
	imulq	$1717986919, %rax, %rax
	leal	3(%rcx), %edi
	movl	%esi, %edx
	sarl	$31, %edx
	sarq	$33, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	movl	(%rbx,%rax,4), %edx
	movl	%ecx, %eax
	addl	%edx, %edx
	andl	%ecx, %edx
	cmpl	$1, %edx
	movl	$49, %edx
	adcl	$0, %edx
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	cmovns	%ecx, %edi
	sarl	$2, %edi
	xorl	%edi, %eax
	testl	%ecx, %ecx
	leal	7(%rcx), %edi
	cmovs	%edi, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	andl	$3, %eax
	orl	%edx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %esi
	jg	.L4
	movq	p(%rip), %rdx
	movl	%ebp, %eax
	movl	(%rdx), %ecx
	sall	%cl, %eax
	movl	%eax, (%rdx)
	orl	f(%rip), %eax
	movl	%eax, %ecx
.L5:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	movl	%edx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	movl	%edx, %eax
	addl	%esi, %esi
	subl	%esi, %eax
	setne	%dl
	movl	%eax, i(%rip)
	movzbl	%dl, %edx
	imull	%ecx, %edx
	movl	%edx, f(%rip)
.L2:
	cmpl	$4, %eax
	jle	.L14
	movslq	%eax, %rcx
	movl	%eax, %esi
	movl	f(%rip), %edx
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %esi
	sarq	$33, %rcx
	subl	%esi, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movl	(%rbx,%rax,4), %eax
	addl	%eax, %eax
	testl	%edx, %eax
	je	.L8
	testl	%edx, %edx
	leal	3(%rdx), %eax
	movl	%edx, %ecx
	cmovns	%edx, %eax
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	sarl	$2, %eax
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	7(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$3, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$49, %eax
	movl	%eax, 12(%rsp)
.L4:
	leaq	12(%rsp), %rdi
	call	puts@PLT
	movl	f(%rip), %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, %eax
	leal	7(%rdx), %ecx
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	testl	%edx, %edx
	cmovns	%edx, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	3(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$2, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$50, %eax
	movl	%eax, 12(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	d
	.align 16
	.type	d, @object
	.size	d, 20
d:
	.zero	20
	.globl	f
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	movl	$9, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movl	i(%rip), %eax
	movl	%edi, 12(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	movq	%rsi, p(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movslq	i(%rip), %rax
	movl	f(%rip), %ecx
	movq	%rax, %rsi
	imulq	$1717986919, %rax, %rax
	leal	3(%rcx), %edi
	movl	%esi, %edx
	sarl	$31, %edx
	sarq	$33, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	movl	(%rbx,%rax,4), %edx
	movl	%ecx, %eax
	addl	%edx, %edx
	andl	%ecx, %edx
	cmpl	$1, %edx
	movl	$49, %edx
	adcl	$0, %edx
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	cmovns	%ecx, %edi
	sarl	$2, %edi
	xorl	%edi, %eax
	testl	%ecx, %ecx
	leal	7(%rcx), %edi
	cmovs	%edi, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	andl	$3, %eax
	orl	%edx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %esi
	jg	.L4
	movq	p(%rip), %rdx
	movl	%ebp, %eax
	movl	(%rdx), %ecx
	sall	%cl, %eax
	movl	%eax, (%rdx)
	orl	f(%rip), %eax
	movl	%eax, %ecx
.L5:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	movl	%edx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	movl	%edx, %eax
	addl	%esi, %esi
	subl	%esi, %eax
	setne	%dl
	movl	%eax, i(%rip)
	movzbl	%dl, %edx
	imull	%ecx, %edx
	movl	%edx, f(%rip)
.L2:
	cmpl	$4, %eax
	jle	.L14
	movslq	%eax, %rcx
	movl	%eax, %esi
	movl	f(%rip), %edx
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %esi
	sarq	$33, %rcx
	subl	%esi, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movl	(%rbx,%rax,4), %eax
	addl	%eax, %eax
	testl	%edx, %eax
	je	.L8
	testl	%edx, %edx
	leal	3(%rdx), %eax
	movl	%edx, %ecx
	cmovns	%edx, %eax
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	sarl	$2, %eax
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	7(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$3, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$49, %eax
	movl	%eax, 12(%rsp)
.L4:
	leaq	12(%rsp), %rdi
	call	puts@PLT
	movl	f(%rip), %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, %eax
	leal	7(%rdx), %ecx
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	testl	%edx, %edx
	cmovns	%edx, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	3(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$2, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$50, %eax
	movl	%eax, 12(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	d
	.align 16
	.type	d, @object
	.size	d, 20
d:
	.zero	20
	.globl	f
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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
i,f,d[5],*p;main(n){for(;i>4||~scanf("%d",p=d+i);i=++i%10,f*=!!i)n=!(d[i%5]*2&f)+49|(f/2^f/4^f/8)&3,i<5?f|=*p=9<<*p:puts(&n);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
i,f,d[5],*p;main(n){for(;i>4||~scanf("%d",p=d+i);i=++i%10,f*=!!i)n=!(d[i%5]*2&f)+49|(f/2^f/4^f/8)&3,i<5?f|=*p=9<<*p:puts(&n);}```

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
3
3
2
1
1
2
2
2
1
0
 1
1
1
2
1
1
2
2
2
1
0
 1
2
3
2
1
1
1
2
2
1
0
 1
2
2
2
1
1
1
2
2
1
0
 1
2
3
2
1
1
2
2
2
2
0
 1
3
1
2
1
1
2
1
2
1
0
 1
2
3
2
1
1
2
3
2
2
0
 1
2
2
2
1
1
2
3
2
2
0
 1
1
2
2
1
1
2
3
2
2
0
 1
3
3
1
1
1
2
3
2
2
0

3
3
3
3
3
1
2
2
2
1
 1
1
1
2
1
1
2
2
2
1
 3
3
3
3
3
1
1
2
2
1
 1
2
2
2
1
1
1
2
2
1
 3
3
3
3
3
1
2
2
2
2
 3
3
3
3
3
1
2
1
2
1
 3
3
3
3
3
3
3
3
3
3
 1
2
2
2
1
3
3
3
3
3
 1
1
2
2
1
3
3
3
3
3
 2
1
1
2
2
3
3
3
3
3

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

```c
i,f,d[5],*p;main(n){for(;i>4||~scanf("%d",p=d+i);i=++i%10,f*=!!i)n=!(d[i%5]*2&f)+49|(f/2^f/4^f/8)&3,i<5?f|=*p=9<<*p:puts(&n);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	movl	$9, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movl	i(%rip), %eax
	movl	%edi, 12(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	movq	%rsi, p(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movslq	i(%rip), %rax
	movl	f(%rip), %ecx
	movq	%rax, %rsi
	imulq	$1717986919, %rax, %rax
	leal	3(%rcx), %edi
	movl	%esi, %edx
	sarl	$31, %edx
	sarq	$33, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	movl	(%rbx,%rax,4), %edx
	movl	%ecx, %eax
	addl	%edx, %edx
	andl	%ecx, %edx
	cmpl	$1, %edx
	movl	$49, %edx
	adcl	$0, %edx
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	cmovns	%ecx, %edi
	sarl	$2, %edi
	xorl	%edi, %eax
	testl	%ecx, %ecx
	leal	7(%rcx), %edi
	cmovs	%edi, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	andl	$3, %eax
	orl	%edx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %esi
	jg	.L4
	movq	p(%rip), %rdx
	movl	%ebp, %eax
	movl	(%rdx), %ecx
	sall	%cl, %eax
	movl	%eax, (%rdx)
	orl	f(%rip), %eax
	movl	%eax, %ecx
.L5:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	movl	%edx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	movl	%edx, %eax
	addl	%esi, %esi
	subl	%esi, %eax
	setne	%dl
	movl	%eax, i(%rip)
	movzbl	%dl, %edx
	imull	%ecx, %edx
	movl	%edx, f(%rip)
.L2:
	cmpl	$4, %eax
	jle	.L14
	movslq	%eax, %rcx
	movl	%eax, %esi
	movl	f(%rip), %edx
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %esi
	sarq	$33, %rcx
	subl	%esi, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movl	(%rbx,%rax,4), %eax
	addl	%eax, %eax
	testl	%edx, %eax
	je	.L8
	testl	%edx, %edx
	leal	3(%rdx), %eax
	movl	%edx, %ecx
	cmovns	%edx, %eax
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	sarl	$2, %eax
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	7(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$3, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$49, %eax
	movl	%eax, 12(%rsp)
.L4:
	leaq	12(%rsp), %rdi
	call	puts@PLT
	movl	f(%rip), %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, %eax
	leal	7(%rdx), %ecx
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	testl	%edx, %edx
	cmovns	%edx, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	3(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$2, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$50, %eax
	movl	%eax, 12(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	d
	.align 16
	.type	d, @object
	.size	d, 20
d:
	.zero	20
	.globl	f
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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
	movl	$9, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movl	i(%rip), %eax
	movl	%edi, 12(%rsp)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	cltq
	movq	%r12, %rdi
	leaq	(%rbx,%rax,4), %rsi
	xorl	%eax, %eax
	movq	%rsi, p(%rip)
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L13
	movslq	i(%rip), %rax
	movl	f(%rip), %ecx
	movq	%rax, %rsi
	imulq	$1717986919, %rax, %rax
	leal	3(%rcx), %edi
	movl	%esi, %edx
	sarl	$31, %edx
	sarq	$33, %rax
	subl	%edx, %eax
	leal	(%rax,%rax,4), %edx
	movl	%esi, %eax
	subl	%edx, %eax
	cltq
	movl	(%rbx,%rax,4), %edx
	movl	%ecx, %eax
	addl	%edx, %edx
	andl	%ecx, %edx
	cmpl	$1, %edx
	movl	$49, %edx
	adcl	$0, %edx
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	testl	%ecx, %ecx
	cmovns	%ecx, %edi
	sarl	$2, %edi
	xorl	%edi, %eax
	testl	%ecx, %ecx
	leal	7(%rcx), %edi
	cmovs	%edi, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	andl	$3, %eax
	orl	%edx, %eax
	movl	%eax, 12(%rsp)
	cmpl	$4, %esi
	jg	.L4
	movq	p(%rip), %rdx
	movl	%ebp, %eax
	movl	(%rdx), %ecx
	sall	%cl, %eax
	movl	%eax, (%rdx)
	orl	f(%rip), %eax
	movl	%eax, %ecx
.L5:
	movl	i(%rip), %eax
	leal	1(%rax), %edx
	movslq	%edx, %rax
	movl	%edx, %esi
	imulq	$1717986919, %rax, %rax
	sarl	$31, %esi
	sarq	$34, %rax
	subl	%esi, %eax
	leal	(%rax,%rax,4), %esi
	movl	%edx, %eax
	addl	%esi, %esi
	subl	%esi, %eax
	setne	%dl
	movl	%eax, i(%rip)
	movzbl	%dl, %edx
	imull	%ecx, %edx
	movl	%edx, f(%rip)
.L2:
	cmpl	$4, %eax
	jle	.L14
	movslq	%eax, %rcx
	movl	%eax, %esi
	movl	f(%rip), %edx
	imulq	$1717986919, %rcx, %rcx
	sarl	$31, %esi
	sarq	$33, %rcx
	subl	%esi, %ecx
	leal	(%rcx,%rcx,4), %ecx
	subl	%ecx, %eax
	cltq
	movl	(%rbx,%rax,4), %eax
	addl	%eax, %eax
	testl	%edx, %eax
	je	.L8
	testl	%edx, %edx
	leal	3(%rdx), %eax
	movl	%edx, %ecx
	cmovns	%edx, %eax
	shrl	$31, %ecx
	addl	%edx, %ecx
	sarl	%ecx
	sarl	$2, %eax
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	7(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$3, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$49, %eax
	movl	%eax, 12(%rsp)
.L4:
	leaq	12(%rsp), %rdi
	call	puts@PLT
	movl	f(%rip), %ecx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%edx, %eax
	leal	7(%rdx), %ecx
	shrl	$31, %eax
	addl	%edx, %eax
	sarl	%eax
	testl	%edx, %edx
	cmovns	%edx, %ecx
	sarl	$3, %ecx
	xorl	%ecx, %eax
	testl	%edx, %edx
	leal	3(%rdx), %ecx
	cmovs	%ecx, %edx
	sarl	$2, %edx
	xorl	%edx, %eax
	andl	$3, %eax
	orl	$50, %eax
	movl	%eax, 12(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$16, %rsp
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	p
	.bss
	.align 8
	.type	p, @object
	.size	p, 8
p:
	.zero	8
	.globl	d
	.align 16
	.type	d, @object
	.size	d, 20
d:
	.zero	20
	.globl	f
	.align 4
	.type	f, @object
	.size	f, 4
f:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.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:
```