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

```c
#include<stdio.h>
#include<math.h>
#define N 4
#define SUM 7
int main(){
    int num[N],keep,bit;
    scanf("%d",&keep);
    for(int i=0;i<N;i++){
        num[i] = keep/(int)pow(10,N-1-i);
        keep -= num[i]*(int)pow(10,N-1-i);
    }
    for(bit=0;bit<(1<<N-1);bit++){  //+は0-は1
        int ans = num[0];
        for(int i=1;i<=N-1;i++){
            if(bit & 1<<(N-1-i))
                ans -= num[i];
            else
                ans += num[i];
        }
        if(ans==SUM) break;
    }
    printf("%d",num[0]);
    for(int i=0;i<N-1;i++){
        if(bit & 1<<(N-2-i)) printf("-");
        else printf("+");
        printf("%d",num[i+1]);
    }
    printf("=%d",SUM);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"=%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
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -64(%rbp)
	jmp	.L2
.L3:
	movl	-72(%rbp), %ebx
	movl	$3, %eax
	subl	-64(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-64(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %ebx
	movl	$3, %eax
	subl	-64(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %eax
	imull	%eax, %ebx
	movl	%ebx, %edx
	movl	-72(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -72(%rbp)
	addl	$1, -64(%rbp)
.L2:
	cmpl	$3, -64(%rbp)
	jle	.L3
	movl	$0, -68(%rbp)
	jmp	.L4
.L11:
	movl	-48(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$1, -56(%rbp)
	jmp	.L5
.L8:
	movl	$3, %eax
	subl	-56(%rbp), %eax
	movl	-68(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L6
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	subl	%eax, -60(%rbp)
	jmp	.L7
.L6:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	addl	%eax, -60(%rbp)
.L7:
	addl	$1, -56(%rbp)
.L5:
	cmpl	$3, -56(%rbp)
	jle	.L8
	cmpl	$7, -60(%rbp)
	je	.L18
	addl	$1, -68(%rbp)
.L4:
	cmpl	$7, -68(%rbp)
	jle	.L11
	jmp	.L10
.L18:
	nop
.L10:
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -52(%rbp)
	jmp	.L12
.L15:
	movl	$2, %eax
	subl	-52(%rbp), %eax
	movl	-68(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L13
	movl	$45, %edi
	call	putchar@PLT
	jmp	.L14
.L13:
	movl	$43, %edi
	call	putchar@PLT
.L14:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -52(%rbp)
.L12:
	cmpl	$2, -52(%rbp)
	jle	.L15
	movl	$7, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	movl	$3, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	leaq	32(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebp
.L2:
	movl	%r14d, %eax
	pxor	%xmm1, %xmm1
	subl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm1
	movq	.LC1(%rip), %rax
	movq	%rax, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	pow@PLT
	movl	%ebp, %eax
	movsd	8(%rsp), %xmm1
	cvttsd2sil	%xmm0, %ecx
	cltd
	idivl	%ecx
	movl	%eax, (%r12,%rbx,4)
	movl	%eax, %r15d
	movq	.LC1(%rip), %rax
	addq	$1, %rbx
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	imull	%r15d, %edx
	subl	%edx, %ebp
	movl	%ebp, 28(%rsp)
	cmpq	$4, %rbx
	jne	.L2
	movl	32(%rsp), %r8d
	movl	36(%rsp), %edx
	movl	40(%rsp), %esi
	movl	44(%rsp), %eax
	addl	%r8d, %edx
	movl	%r8d, %ebp
	subl	36(%rsp), %ebp
	leal	(%rdx,%rsi), %ecx
	leal	(%rcx,%rax), %edi
	cmpl	$7, %edi
	je	.L10
	subl	%eax, %ecx
	cmpl	$7, %ecx
	je	.L11
	subl	%esi, %edx
	leal	(%rax,%rdx), %ecx
	cmpl	$7, %ecx
	je	.L12
	subl	%eax, %edx
	cmpl	$7, %edx
	je	.L13
	leal	0(%rbp,%rsi), %edx
	leal	(%rax,%rdx), %ecx
	cmpl	$7, %ecx
	je	.L14
	subl	%eax, %edx
	cmpl	$7, %edx
	je	.L15
	subl	%esi, %ebp
	leal	(%rax,%rbp), %edx
	cmpl	$7, %edx
	je	.L16
	subl	%eax, %ebp
	movl	$8, %eax
	cmpl	$7, %ebp
	cmovne	%eax, %ebp
.L4:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1, %ebx
	movl	$3, %r14d
	call	__printf_chk@PLT
.L8:
	movl	%r14d, %eax
	movl	$45, %edi
	subl	%ebx, %eax
	btl	%eax, %ebp
	jc	.L23
	movl	$43, %edi
.L23:
	call	putchar@PLT
	movl	(%r12,%rbx,4), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	$4, %rbx
	jne	.L8
	xorl	%eax, %eax
	movl	$7, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L10:
	.cfi_restore_state
	xorl	%ebp, %ebp
	jmp	.L4
.L11:
	movl	$1, %ebp
	jmp	.L4
.L12:
	movl	$2, %ebp
	jmp	.L4
.L13:
	movl	$3, %ebp
	jmp	.L4
.L14:
	movl	$4, %ebp
	jmp	.L4
.L15:
	movl	$5, %ebp
	jmp	.L4
.L16:
	movl	$6, %ebp
	jmp	.L4
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	movl	$3, %r14d
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	xorl	%ebx, %ebx
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	leaq	32(%rsp), %r12
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebp
.L2:
	movl	%r14d, %eax
	pxor	%xmm1, %xmm1
	subl	%ebx, %eax
	cvtsi2sdl	%eax, %xmm1
	movq	.LC1(%rip), %rax
	movq	%rax, %xmm0
	movsd	%xmm1, 8(%rsp)
	call	pow@PLT
	movl	%ebp, %eax
	movsd	8(%rsp), %xmm1
	cvttsd2sil	%xmm0, %ecx
	cltd
	idivl	%ecx
	movl	%eax, (%r12,%rbx,4)
	movl	%eax, %r15d
	movq	.LC1(%rip), %rax
	addq	$1, %rbx
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %edx
	imull	%r15d, %edx
	subl	%edx, %ebp
	movl	%ebp, 28(%rsp)
	cmpq	$4, %rbx
	jne	.L2
	movl	32(%rsp), %r8d
	movl	36(%rsp), %edx
	movl	40(%rsp), %esi
	movl	44(%rsp), %eax
	addl	%r8d, %edx
	movl	%r8d, %ebp
	subl	36(%rsp), %ebp
	leal	(%rdx,%rsi), %ecx
	leal	(%rcx,%rax), %edi
	cmpl	$7, %edi
	je	.L10
	subl	%eax, %ecx
	cmpl	$7, %ecx
	je	.L11
	subl	%esi, %edx
	leal	(%rax,%rdx), %ecx
	cmpl	$7, %ecx
	je	.L12
	subl	%eax, %edx
	cmpl	$7, %edx
	je	.L13
	leal	0(%rbp,%rsi), %edx
	leal	(%rax,%rdx), %ecx
	cmpl	$7, %ecx
	je	.L14
	subl	%eax, %edx
	cmpl	$7, %edx
	je	.L15
	subl	%esi, %ebp
	leal	(%rax,%rbp), %edx
	cmpl	$7, %edx
	je	.L16
	subl	%eax, %ebp
	movl	$8, %eax
	cmpl	$7, %ebp
	cmovne	%eax, %ebp
.L4:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	movl	$1, %ebx
	movl	$3, %r14d
	call	__printf_chk@PLT
.L8:
	movl	%r14d, %eax
	movl	$45, %edi
	subl	%ebx, %eax
	btl	%eax, %ebp
	jc	.L23
	movl	$43, %edi
.L23:
	call	putchar@PLT
	movl	(%r12,%rbx,4), %edx
	movq	%r13, %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	addq	$1, %rbx
	call	__printf_chk@PLT
	cmpq	$4, %rbx
	jne	.L8
	xorl	%eax, %eax
	movl	$7, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$72, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	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
.L10:
	.cfi_restore_state
	xorl	%ebp, %ebp
	jmp	.L4
.L11:
	movl	$1, %ebp
	jmp	.L4
.L12:
	movl	$2, %ebp
	jmp	.L4
.L13:
	movl	$3, %ebp
	jmp	.L4
.L14:
	movl	$4, %ebp
	jmp	.L4
.L15:
	movl	$5, %ebp
	jmp	.L4
.L16:
	movl	$6, %ebp
	jmp	.L4
.L25:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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:

#include<stdio.h>
#include<math.h>
#define N 4
#define SUM 7
int main(){
    int num[N],keep,bit;
    scanf("%d",&keep);
    for(int i=0;i<N;i++){
        num[i] = keep/(int)pow(10,N-1-i);
        keep -= num[i]*(int)pow(10,N-1-i);
    }
    for(bit=0;bit<(1<<N-1);bit++){  //+は0-は1
        int ans = num[0];
        for(int i=1;i<=N-1;i++){
            if(bit & 1<<(N-1-i))
                ans -= num[i];
            else
                ans += num[i];
        }
        if(ans==SUM) break;
    }
    printf("%d",num[0]);
    for(int i=0;i<N-1;i++){
        if(bit & 1<<(N-2-i)) printf("-");
        else printf("+");
        printf("%d",num[i+1]);
    }
    printf("=%d",SUM);
}

2364
 1114
 2005
 1455
 1152
 3246
 6120
 2768
 1183
 1024

2+3+6-4=7 1+1+1+4=7 2+0+0+5=7 1-4+5+5=7 1-1+5+2=7 3+2-4+6=7 6-1+2+0=7 2+7+6-8=7 1+1+8-3=7 1+0+2+4=7
Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>
#include<math.h>
#define N 4
#define SUM 7
int main(){
    int num[N],keep,bit;
    scanf("%d",&keep);
    for(int i=0;i<N;i++){
        num[i] = keep/(int)pow(10,N-1-i);
        keep -= num[i]*(int)pow(10,N-1-i);
    }
    for(bit=0;bit<(1<<N-1);bit++){  //+は0-は1
        int ans = num[0];
        for(int i=1;i<=N-1;i++){
            if(bit & 1<<(N-1-i))
                ans -= num[i];
            else
                ans += num[i];
        }
        if(ans==SUM) break;
    }
    printf("%d",num[0]);
    for(int i=0;i<N-1;i++){
        if(bit & 1<<(N-2-i)) printf("-");
        else printf("+");
        printf("%d",num[i+1]);
    }
    printf("=%d",SUM);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"=%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
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -64(%rbp)
	jmp	.L2
.L3:
	movl	-72(%rbp), %ebx
	movl	$3, %eax
	subl	-64(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-64(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %ebx
	movl	$3, %eax
	subl	-64(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %eax
	imull	%eax, %ebx
	movl	%ebx, %edx
	movl	-72(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -72(%rbp)
	addl	$1, -64(%rbp)
.L2:
	cmpl	$3, -64(%rbp)
	jle	.L3
	movl	$0, -68(%rbp)
	jmp	.L4
.L11:
	movl	-48(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$1, -56(%rbp)
	jmp	.L5
.L8:
	movl	$3, %eax
	subl	-56(%rbp), %eax
	movl	-68(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L6
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	subl	%eax, -60(%rbp)
	jmp	.L7
.L6:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	addl	%eax, -60(%rbp)
.L7:
	addl	$1, -56(%rbp)
.L5:
	cmpl	$3, -56(%rbp)
	jle	.L8
	cmpl	$7, -60(%rbp)
	je	.L18
	addl	$1, -68(%rbp)
.L4:
	cmpl	$7, -68(%rbp)
	jle	.L11
	jmp	.L10
.L18:
	nop
.L10:
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -52(%rbp)
	jmp	.L12
.L15:
	movl	$2, %eax
	subl	-52(%rbp), %eax
	movl	-68(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L13
	movl	$45, %edi
	call	putchar@PLT
	jmp	.L14
.L13:
	movl	$43, %edi
	call	putchar@PLT
.L14:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -52(%rbp)
.L12:
	cmpl	$2, -52(%rbp)
	jle	.L15
	movl	$7, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC2:
	.string	"=%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
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-72(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -64(%rbp)
	jmp	.L2
.L3:
	movl	-72(%rbp), %ebx
	movl	$3, %eax
	subl	-64(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-64(%rbp), %eax
	cltq
	movl	%edx, -48(%rbp,%rax,4)
	movl	-64(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %ebx
	movl	$3, %eax
	subl	-64(%rbp), %eax
	pxor	%xmm0, %xmm0
	cvtsi2sdl	%eax, %xmm0
	movq	.LC1(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	cvttsd2sil	%xmm0, %eax
	imull	%eax, %ebx
	movl	%ebx, %edx
	movl	-72(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, -72(%rbp)
	addl	$1, -64(%rbp)
.L2:
	cmpl	$3, -64(%rbp)
	jle	.L3
	movl	$0, -68(%rbp)
	jmp	.L4
.L11:
	movl	-48(%rbp), %eax
	movl	%eax, -60(%rbp)
	movl	$1, -56(%rbp)
	jmp	.L5
.L8:
	movl	$3, %eax
	subl	-56(%rbp), %eax
	movl	-68(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L6
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	subl	%eax, -60(%rbp)
	jmp	.L7
.L6:
	movl	-56(%rbp), %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	addl	%eax, -60(%rbp)
.L7:
	addl	$1, -56(%rbp)
.L5:
	cmpl	$3, -56(%rbp)
	jle	.L8
	cmpl	$7, -60(%rbp)
	je	.L18
	addl	$1, -68(%rbp)
.L4:
	cmpl	$7, -68(%rbp)
	jle	.L11
	jmp	.L10
.L18:
	nop
.L10:
	movl	-48(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, -52(%rbp)
	jmp	.L12
.L15:
	movl	$2, %eax
	subl	-52(%rbp), %eax
	movl	-68(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L13
	movl	$45, %edi
	call	putchar@PLT
	jmp	.L14
.L13:
	movl	$43, %edi
	call	putchar@PLT
.L14:
	movl	-52(%rbp), %eax
	addl	$1, %eax
	cltq
	movl	-48(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -52(%rbp)
.L12:
	cmpl	$2, -52(%rbp)
	jle	.L15
	movl	$7, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC1:
	.long	0
	.long	1076101120
	.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:
