Given the following C code and 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);}}```

Assembly Code:

```assembly
	.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:
```

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"
.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
```assembly
	.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
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);}}```
Given the following C 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);}}```

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:

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 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);}}```

Assembly Code:

```assembly
	.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:
```

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"
.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:
```