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

```c
c[];main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf("%d\n",j>m?i:j)){for(i=3;i--;)for(scanf("%d",&j);j--;c[n-k]=i)scanf("%d",&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.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	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	jmp	.L2
.L11:
	movl	$3, -12(%rbp)
	jmp	.L3
.L6:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L4
.L5:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L5
.L3:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L7
.L8:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-12(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm0, %xmm1
	movl	-16(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	subsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
.L7:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	testl	%eax, %eax
	jne	.L8
	movl	-4(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movl	-16(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm1, %xmm0
	movl	-16(%rbp), %eax
	notl	%eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	-12(%rbp), %eax
	jmp	.L10
.L9:
	movl	-16(%rbp), %eax
.L10:
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	c(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	leaq	44(%rsp), %rax
	movl	%edi, 44(%rsp)
	leaq	40(%rsp), %r15
	movl	%esi, 40(%rsp)
	movl	%ecx, 36(%rsp)
	movl	%r8d, 32(%rsp)
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rsi
	movq	%r15, %rdx
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	imull	44(%rsp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$2, %ebp
	leaq	36(%rsp), %r14
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	32(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	44(%rsp), %eax
	subl	32(%rsp), %eax
	cltq
	movl	%ebp, 0(%r13,%rax,4)
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L4
.L3:
	subl	$1, %ebp
	jnb	.L5
	movl	44(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L9
	leal	-1(%rcx), %r14d
	movl	32(%rsp), %edx
	movsd	.LC1(%rip), %xmm2
	movl	$-1, %r12d
	movslq	%r14d, %r14
.L7:
	pxor	%xmm1, %xmm1
	movapd	%xmm2, %xmm0
	movl	%ecx, 20(%rsp)
	cvtsi2sdl	%r14d, %xmm1
	movl	%edx, 16(%rsp)
	movsd	%xmm2, 8(%rsp)
	call	pow@PLT
	movl	16(%rsp), %edx
	pxor	%xmm1, %xmm1
	movsd	8(%rsp), %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %ecx
	cvtsi2sdl	%r12d, %xmm0
	leal	(%rdx,%rdx), %eax
	movl	%eax, %esi
	sarl	$31, %esi
	shrl	$30, %esi
	addl	%esi, %eax
	andl	$3, %eax
	subl	%esi, %eax
	subl	0(%r13,%r14,4), %eax
	movl	%eax, %esi
	negl	%esi
	cmovns	%esi, %eax
	addl	0(%r13,%r14,4), %edx
	subq	$1, %r14
	cmpl	$-1, %r14d
	movl	%edx, 32(%rsp)
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm3, %xmm1
	subsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %r12d
	movl	%r12d, 36(%rsp)
	jne	.L7
.L6:
	pxor	%xmm1, %xmm1
	movapd	%xmm2, %xmm0
	cvtsi2sdl	%ecx, %xmm1
	call	pow@PLT
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%r12d, %xmm2
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	notl	%r12d
	cvtsi2sdl	%r12d, %xmm0
	addsd	%xmm2, %xmm1
	call	fmin@PLT
	leaq	.LC2(%rip), %rdi
	cvttsd2sil	%xmm0, %eax
	cmpl	40(%rsp), %eax
	cmovle	%eax, %ebp
	movl	%eax, 36(%rsp)
	xorl	%eax, %eax
	movl	%ebp, %esi
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	movq	.LC1(%rip), %rax
	movl	$-1, %r12d
	movq	%rax, %xmm2
	jmp	.L6
.L19:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	c(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	leaq	44(%rsp), %rax
	movl	%edi, 44(%rsp)
	leaq	40(%rsp), %r15
	movl	%esi, 40(%rsp)
	movl	%ecx, 36(%rsp)
	movl	%r8d, 32(%rsp)
	movq	%rax, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	24(%rsp), %rsi
	movq	%r15, %rdx
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	imull	44(%rsp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$2, %ebp
	leaq	36(%rsp), %r14
.L5:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	je	.L3
	leaq	32(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	44(%rsp), %eax
	subl	32(%rsp), %eax
	cltq
	movl	%ebp, 0(%r13,%rax,4)
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L4
.L3:
	subl	$1, %ebp
	jnb	.L5
	movl	44(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L9
	leal	-1(%rcx), %r14d
	movl	32(%rsp), %edx
	movsd	.LC1(%rip), %xmm2
	movl	$-1, %r12d
	movslq	%r14d, %r14
.L7:
	pxor	%xmm1, %xmm1
	movapd	%xmm2, %xmm0
	movl	%ecx, 20(%rsp)
	cvtsi2sdl	%r14d, %xmm1
	movl	%edx, 16(%rsp)
	movsd	%xmm2, 8(%rsp)
	call	pow@PLT
	movl	16(%rsp), %edx
	pxor	%xmm1, %xmm1
	movsd	8(%rsp), %xmm2
	movapd	%xmm0, %xmm3
	pxor	%xmm0, %xmm0
	movl	20(%rsp), %ecx
	cvtsi2sdl	%r12d, %xmm0
	leal	(%rdx,%rdx), %eax
	movl	%eax, %esi
	sarl	$31, %esi
	shrl	$30, %esi
	addl	%esi, %eax
	andl	$3, %eax
	subl	%esi, %eax
	subl	0(%r13,%r14,4), %eax
	movl	%eax, %esi
	negl	%esi
	cmovns	%esi, %eax
	addl	0(%r13,%r14,4), %edx
	subq	$1, %r14
	cmpl	$-1, %r14d
	movl	%edx, 32(%rsp)
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm3, %xmm1
	subsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %r12d
	movl	%r12d, 36(%rsp)
	jne	.L7
.L6:
	pxor	%xmm1, %xmm1
	movapd	%xmm2, %xmm0
	cvtsi2sdl	%ecx, %xmm1
	call	pow@PLT
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%r12d, %xmm2
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	notl	%r12d
	cvtsi2sdl	%r12d, %xmm0
	addsd	%xmm2, %xmm1
	call	fmin@PLT
	leaq	.LC2(%rip), %rdi
	cvttsd2sil	%xmm0, %eax
	cmpl	40(%rsp), %eax
	cmovle	%eax, %ebp
	movl	%eax, 36(%rsp)
	xorl	%eax, %eax
	movl	%ebp, %esi
	call	printf@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L9:
	movq	.LC1(%rip), %rax
	movl	$-1, %r12d
	movq	%rax, %xmm2
	jmp	.L6
.L19:
	addq	$56, %rsp
	.cfi_def_cfa_offset 56
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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[];main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf("%d\n",j>m?i:j)){for(i=3;i--;)for(scanf("%d",&j);j--;c[n-k]=i)scanf("%d",&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}}
3 10
0
1 1
2 2 3
4 20
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 3
0
1 1
2 2 3
0 0
 3 8
0
1 1
2 2 3
4 7
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 6
0
1 1
2 2 3
0 0
 3 10
0
1 1
2 2 3
4 7
2 1 2
1 2
1 4
1 5
2 1 2
0
0
3 6
0
1 1
2 2 3
0 0
 3 10
0
1 1
2 2 3
4 13
2 1 2
1 3
1 4
2 5
2 1 2
0
0
3 10
0
1 1
2 2 3
0 0
 3 10
0
1 1
2 2 3
4 7
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 3
0
1 1
2 2 3
0 0
 3 10
0
1 1
2 2 3
4 7
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 6
0
1 1
2 2 3
0 0
 3 18
0
1 1
2 2 3
4 7
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 6
0
1 1
2 2 3
0 0
 3 10
0
1 1
2 2 3
4 13
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 6
0
1 1
2 2 3
0 0
 3 18
0
1 1
2 2 3
4 20
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 3
0
1 1
2 2 3
0 0
 3 18
0
1 1
2 2 3
4 20
2 1 2
1 3
1 4
1 5
2 1 2
0
0
3 3
0
1 1
2 2 6
0 0

9
3
0
-1
 -1
3
0
-1
 9
-1
0
-1
 9
3
0
9
 9
3
0
-1
 9
3
0
-1
 9
3
0
-1
 9
3
0
-1
 9
3
0
-1
 9
3
0
-1

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

```c
c[];main(n,m,i,j,k){for(;scanf("%d%d",&n,&m)*n;printf("%d\n",j>m?i:j)){for(i=3;i--;)for(scanf("%d",&j);j--;c[n-k]=i)scanf("%d",&k);for(i=n;i--;k+=c[i])j-=pow(3,i)*abs(k*2%4-c[i]);j=fmin(~j,pow(3,n)+j);}}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.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	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	jmp	.L2
.L11:
	movl	$3, -12(%rbp)
	jmp	.L3
.L6:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L4
.L5:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L5
.L3:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L7
.L8:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-12(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm0, %xmm1
	movl	-16(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	subsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
.L7:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	testl	%eax, %eax
	jne	.L8
	movl	-4(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movl	-16(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm1, %xmm0
	movl	-16(%rbp), %eax
	notl	%eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	-12(%rbp), %eax
	jmp	.L10
.L9:
	movl	-16(%rbp), %eax
.L10:
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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	c
	.bss
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
.LC3:
	.string	"%d%d"
	.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	$32, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	%edx, -12(%rbp)
	movl	%ecx, -16(%rbp)
	movl	%r8d, -20(%rbp)
	jmp	.L2
.L11:
	movl	$3, -12(%rbp)
	jmp	.L3
.L6:
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	jmp	.L4
.L5:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %eax
	movl	-20(%rbp), %edx
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	c(%rip), %rdx
	movl	-12(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L4:
	movl	-16(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -16(%rbp)
	testl	%eax, %eax
	jne	.L5
.L3:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	testl	%eax, %eax
	jne	.L6
	movl	-4(%rbp), %eax
	movl	%eax, -12(%rbp)
	jmp	.L7
.L8:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-12(%rbp), %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	%ecx, %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	mulsd	%xmm0, %xmm1
	movl	-16(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	subsd	%xmm1, %xmm0
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	c(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -20(%rbp)
.L7:
	movl	-12(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -12(%rbp)
	testl	%eax, %eax
	jne	.L8
	movl	-4(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movl	-16(%rbp), %eax
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%eax, %xmm1
	addsd	%xmm1, %xmm0
	movl	-16(%rbp), %eax
	notl	%eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	jle	.L9
	movl	-12(%rbp), %eax
	jmp	.L10
.L9:
	movl	-16(%rbp), %eax
.L10:
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-8(%rbp), %rdx
	leaq	-4(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	imull	%edx, %eax
	testl	%eax, %eax
	jne	.L11
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1074266112
	.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:
