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 <stdlib.h>
#include <math.h>
int main(void){
    int n,k,count=0;
    scanf("%d%d",&n,&k);
    long long a[n],b[n*(n+1)/2],ans=0,max=0;
    for (int i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    for (int i=0; i<n; i++){
        long long sum=0;
        for (int j=i; j<n; j++){
            sum+=a[j];
            b[count]=sum;
            if (b[count]>max){
                max=b[count];
            }
            count++;
        }
    }
    
    int count2=0,p=0;
    for (p=0; pow(2,p)<max; p++){
    }
    p--;
    
    for (int i=p; i>=0; i--){
        count2=0;
        for (int j=0; j<count; j++){
            if (b[j]>=pow(2,i)){
                count2++;
            }
        }
        if (count2>=k){
            ans+=pow(2,i);
            for (int j=0; j<count; j++){
                if (b[j]<pow(2,i)){
                    b[j]=0;
                } else {
                    b[j]-=pow(2,i);
                }
            }
        } else {
            for (int j=0; j<count; j++){
                if (b[j]<pow(2,i)){
                } else {
                    b[j]-=pow(2,i);
                }
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$152, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -152(%rbp)
	leaq	-156(%rbp), %rdx
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-160(%rbp), %eax
	leal	1(%rax), %edx
	movl	-160(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movl	$0, -148(%rbp)
	jmp	.L8
.L9:
	movl	-148(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L8:
	movl	-160(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L9
	movl	$0, -144(%rbp)
	jmp	.L10
.L14:
	movq	$0, -96(%rbp)
	movl	-144(%rbp), %eax
	movl	%eax, -140(%rbp)
	jmp	.L11
.L13:
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	-96(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -104(%rbp)
	jge	.L12
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -104(%rbp)
.L12:
	addl	$1, -152(%rbp)
	addl	$1, -140(%rbp)
.L11:
	movl	-160(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L13
	addl	$1, -144(%rbp)
.L10:
	movl	-160(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jl	.L14
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L15
.L16:
	addl	$1, -132(%rbp)
.L15:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-132(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-104(%rbp), %xmm1
	comisd	%xmm0, %xmm1
	ja	.L16
	subl	$1, -132(%rbp)
	movl	-132(%rbp), %eax
	movl	%eax, -128(%rbp)
	jmp	.L17
.L32:
	movl	$0, -136(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L18
.L21:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movsd	%xmm2, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-176(%rbp), %xmm2
	comisd	%xmm0, %xmm2
	jb	.L19
	addl	$1, -136(%rbp)
.L19:
	addl	$1, -124(%rbp)
.L18:
	movl	-124(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L21
	movl	-156(%rbp), %eax
	cmpl	%eax, -136(%rbp)
	jl	.L22
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-112(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -112(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L23
.L27:
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rax, %xmm3
	movsd	%xmm3, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm4
	comisd	-176(%rbp), %xmm4
	jbe	.L37
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	jmp	.L26
.L37:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	subsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rcx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L26:
	addl	$1, -120(%rbp)
.L23:
	movl	-120(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L27
	jmp	.L28
.L22:
	movl	$0, -116(%rbp)
	jmp	.L29
.L31:
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm5, %xmm5
	cvtsi2sdq	%rax, %xmm5
	movsd	%xmm5, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm6
	comisd	-176(%rbp), %xmm6
	ja	.L30
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	subsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rcx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L30:
	addl	$1, -116(%rbp)
.L29:
	movl	-116(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L31
.L28:
	subl	$1, -128(%rbp)
.L17:
	cmpl	$0, -128(%rbp)
	jns	.L32
	movq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.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%d"
.LC1:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L56:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L56
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L57
.L4:
	leal	1(%rdx), %ecx
	movq	%rsp, %rsi
	movq	%rsp, %rbx
	imull	%edx, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L57:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L58
.L7:
	movq	%rsp, -88(%rbp)
	testl	%edx, %edx
	jle	.L11
	movq	%rbx, %r14
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %esi
	addq	$8, %r14
	cmpl	%r12d, %esi
	jg	.L10
	testl	%esi, %esi
	jle	.L11
	leal	-1(%rsi), %r14d
	movl	%esi, %r12d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%r13d, %rax
	movl	%r8d, %r11d
	movl	%r8d, %r10d
	movq	%r8, %rdx
	leaq	(%r9,%rax,8), %rdi
	xorl	%eax, %eax
	addq	-88(%rbp), %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	addq	(%rbx,%rdx,8), %rax
	cmpq	%rax, %rcx
	movq	%rax, (%rdi,%rdx,8)
	cmovl	%rax, %rcx
	addq	$1, %rdx
	cmpl	%edx, %esi
	jg	.L12
	movl	%r14d, %eax
	xorl	%edi, %edi
	subl	%r11d, %eax
	cmpl	%r10d, %esi
	cmovle	%edi, %eax
	addq	$1, %r8
	subq	$8, %r9
	leal	1(%r13,%rax), %r13d
	cmpq	%r12, %r8
	jne	.L13
.L9:
	pxor	%xmm6, %xmm6
	xorl	%ebx, %ebx
	cvtsi2sdq	%rcx, %xmm6
	movq	%xmm6, %r12
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %ebx
.L14:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%r12, %xmm5
	comisd	%xmm0, %xmm5
	ja	.L15
	leal	-1(%rbx), %r14d
	testl	%ebx, %ebx
	je	.L34
	movl	-60(%rbp), %eax
	movq	-88(%rbp), %rsi
	movq	$0, -104(%rbp)
	movl	%eax, -92(%rbp)
	leal	-1(%r13), %eax
	leaq	8(%rsi,%rax,8), %r12
	.p2align 4,,10
	.p2align 3
.L17:
	testl	%r13d, %r13d
	je	.L59
	pxor	%xmm1, %xmm1
	movq	-88(%rbp), %r15
	xorl	%ebx, %ebx
	cvtsi2sdl	%r14d, %xmm1
	.p2align 4,,10
	.p2align 3
.L20:
	pxor	%xmm2, %xmm2
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -72(%rbp)
	cvtsi2sdq	(%r15), %xmm2
	movq	%rax, %xmm0
	movsd	%xmm2, -80(%rbp)
	call	pow@PLT
	movsd	-80(%rbp), %xmm2
	movsd	-72(%rbp), %xmm1
	comisd	%xmm0, %xmm2
	sbbl	$-1, %ebx
	addq	$8, %r15
	cmpq	%r12, %r15
	jne	.L20
	cmpl	-92(%rbp), %ebx
	jge	.L60
	movq	-88(%rbp), %rbx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	addq	$8, %rbx
	cmpq	%r12, %rbx
	je	.L24
.L26:
	pxor	%xmm3, %xmm3
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -80(%rbp)
	cvtsi2sdq	(%rbx), %xmm3
	movq	%rax, %xmm0
	movsd	%xmm3, -72(%rbp)
	call	pow@PLT
	comisd	-72(%rbp), %xmm0
	movsd	-80(%rbp), %xmm1
	ja	.L25
	movq	.LC2(%rip), %rax
	addq	$8, %rbx
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-80(%rbp), %xmm1
	movapd	%xmm0, %xmm2
	movsd	-72(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbx)
	cmpq	%r12, %rbx
	jne	.L26
	.p2align 4,,10
	.p2align 3
.L24:
	subl	$1, %r14d
	jnb	.L17
.L16:
	movq	-104(%rbp), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L61
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L60:
	.cfi_restore_state
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -72(%rbp)
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-88(%rbp), %rbx
	movsd	-72(%rbp), %xmm1
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-104(%rbp), %xmm0
	addsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -104(%rbp)
	.p2align 4,,10
	.p2align 3
.L29:
	pxor	%xmm4, %xmm4
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -80(%rbp)
	cvtsi2sdq	(%rbx), %xmm4
	movq	%rax, %xmm0
	movsd	%xmm4, -72(%rbp)
	call	pow@PLT
	comisd	-72(%rbp), %xmm0
	movsd	-80(%rbp), %xmm1
	jbe	.L62
	movq	$0, (%rbx)
	addq	$8, %rbx
	cmpq	%r12, %rbx
	jne	.L29
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L62:
	movq	.LC2(%rip), %rax
	addq	$8, %rbx
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-80(%rbp), %xmm1
	movapd	%xmm0, %xmm2
	movsd	-72(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbx)
	cmpq	%r12, %rbx
	jne	.L29
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L59:
	movl	-92(%rbp), %eax
	testl	%eax, %eax
	jg	.L24
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	cvtsi2sdl	%r14d, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-104(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -104(%rbp)
	jmp	.L24
.L34:
	movq	$0, -104(%rbp)
	jmp	.L16
.L11:
	xorl	%ecx, %ecx
	xorl	%r13d, %r13d
	jmp	.L9
.L58:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L7
.L61:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.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%d"
.LC1:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$72, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rdx
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L56:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L56
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L57
.L4:
	leal	1(%rdx), %ecx
	movq	%rsp, %rsi
	movq	%rsp, %rbx
	imull	%edx, %ecx
	movl	%ecx, %eax
	shrl	$31, %eax
	addl	%ecx, %eax
	sarl	%eax
	cltq
	leaq	15(,%rax,8), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	andq	$-16, %rcx
	subq	%rax, %rsi
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L57:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L58
.L7:
	movq	%rsp, -88(%rbp)
	testl	%edx, %edx
	jle	.L11
	movq	%rbx, %r14
	xorl	%r12d, %r12d
	leaq	.LC1(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r12d
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %esi
	addq	$8, %r14
	cmpl	%r12d, %esi
	jg	.L10
	testl	%esi, %esi
	jle	.L11
	leal	-1(%rsi), %r14d
	movl	%esi, %r12d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	xorl	%ecx, %ecx
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%r13d, %rax
	movl	%r8d, %r11d
	movl	%r8d, %r10d
	movq	%r8, %rdx
	leaq	(%r9,%rax,8), %rdi
	xorl	%eax, %eax
	addq	-88(%rbp), %rdi
	.p2align 4,,10
	.p2align 3
.L12:
	addq	(%rbx,%rdx,8), %rax
	cmpq	%rax, %rcx
	movq	%rax, (%rdi,%rdx,8)
	cmovl	%rax, %rcx
	addq	$1, %rdx
	cmpl	%edx, %esi
	jg	.L12
	movl	%r14d, %eax
	xorl	%edi, %edi
	subl	%r11d, %eax
	cmpl	%r10d, %esi
	cmovle	%edi, %eax
	addq	$1, %r8
	subq	$8, %r9
	leal	1(%r13,%rax), %r13d
	cmpq	%r12, %r8
	jne	.L13
.L9:
	pxor	%xmm6, %xmm6
	xorl	%ebx, %ebx
	cvtsi2sdq	%rcx, %xmm6
	movq	%xmm6, %r12
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %ebx
.L14:
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	cvtsi2sdl	%ebx, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%r12, %xmm5
	comisd	%xmm0, %xmm5
	ja	.L15
	leal	-1(%rbx), %r14d
	testl	%ebx, %ebx
	je	.L34
	movl	-60(%rbp), %eax
	movq	-88(%rbp), %rsi
	movq	$0, -104(%rbp)
	movl	%eax, -92(%rbp)
	leal	-1(%r13), %eax
	leaq	8(%rsi,%rax,8), %r12
	.p2align 4,,10
	.p2align 3
.L17:
	testl	%r13d, %r13d
	je	.L59
	pxor	%xmm1, %xmm1
	movq	-88(%rbp), %r15
	xorl	%ebx, %ebx
	cvtsi2sdl	%r14d, %xmm1
	.p2align 4,,10
	.p2align 3
.L20:
	pxor	%xmm2, %xmm2
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -72(%rbp)
	cvtsi2sdq	(%r15), %xmm2
	movq	%rax, %xmm0
	movsd	%xmm2, -80(%rbp)
	call	pow@PLT
	movsd	-80(%rbp), %xmm2
	movsd	-72(%rbp), %xmm1
	comisd	%xmm0, %xmm2
	sbbl	$-1, %ebx
	addq	$8, %r15
	cmpq	%r12, %r15
	jne	.L20
	cmpl	-92(%rbp), %ebx
	jge	.L60
	movq	-88(%rbp), %rbx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	addq	$8, %rbx
	cmpq	%r12, %rbx
	je	.L24
.L26:
	pxor	%xmm3, %xmm3
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -80(%rbp)
	cvtsi2sdq	(%rbx), %xmm3
	movq	%rax, %xmm0
	movsd	%xmm3, -72(%rbp)
	call	pow@PLT
	comisd	-72(%rbp), %xmm0
	movsd	-80(%rbp), %xmm1
	ja	.L25
	movq	.LC2(%rip), %rax
	addq	$8, %rbx
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-80(%rbp), %xmm1
	movapd	%xmm0, %xmm2
	movsd	-72(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbx)
	cmpq	%r12, %rbx
	jne	.L26
	.p2align 4,,10
	.p2align 3
.L24:
	subl	$1, %r14d
	jnb	.L17
.L16:
	movq	-104(%rbp), %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC3(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L61
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L60:
	.cfi_restore_state
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -72(%rbp)
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-88(%rbp), %rbx
	movsd	-72(%rbp), %xmm1
	movapd	%xmm0, %xmm2
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-104(%rbp), %xmm0
	addsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -104(%rbp)
	.p2align 4,,10
	.p2align 3
.L29:
	pxor	%xmm4, %xmm4
	movq	.LC2(%rip), %rax
	movsd	%xmm1, -80(%rbp)
	cvtsi2sdq	(%rbx), %xmm4
	movq	%rax, %xmm0
	movsd	%xmm4, -72(%rbp)
	call	pow@PLT
	comisd	-72(%rbp), %xmm0
	movsd	-80(%rbp), %xmm1
	jbe	.L62
	movq	$0, (%rbx)
	addq	$8, %rbx
	cmpq	%r12, %rbx
	jne	.L29
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L62:
	movq	.LC2(%rip), %rax
	addq	$8, %rbx
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-80(%rbp), %xmm1
	movapd	%xmm0, %xmm2
	movsd	-72(%rbp), %xmm0
	subsd	%xmm2, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -8(%rbx)
	cmpq	%r12, %rbx
	jne	.L29
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L59:
	movl	-92(%rbp), %eax
	testl	%eax, %eax
	jg	.L24
	pxor	%xmm1, %xmm1
	movq	.LC2(%rip), %rax
	cvtsi2sdl	%r14d, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movapd	%xmm0, %xmm1
	pxor	%xmm0, %xmm0
	cvtsi2sdq	-104(%rbp), %xmm0
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -104(%rbp)
	jmp	.L24
.L34:
	movq	$0, -104(%rbp)
	jmp	.L16
.L11:
	xorl	%ecx, %ecx
	xorl	%r13d, %r13d
	jmp	.L9
.L58:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L7
.L61:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.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 <stdlib.h>
#include <math.h>
int main(void){
    int n,k,count=0;
    scanf("%d%d",&n,&k);
    long long a[n],b[n*(n+1)/2],ans=0,max=0;
    for (int i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    for (int i=0; i<n; i++){
        long long sum=0;
        for (int j=i; j<n; j++){
            sum+=a[j];
            b[count]=sum;
            if (b[count]>max){
                max=b[count];
            }
            count++;
        }
    }
    
    int count2=0,p=0;
    for (p=0; pow(2,p)<max; p++){
    }
    p--;
    
    for (int i=p; i>=0; i--){
        count2=0;
        for (int j=0; j<count; j++){
            if (b[j]>=pow(2,i)){
                count2++;
            }
        }
        if (count2>=k){
            ans+=pow(2,i);
            for (int j=0; j<count; j++){
                if (b[j]<pow(2,i)){
                    b[j]=0;
                } else {
                    b[j]-=pow(2,i);
                }
            }
        } else {
            for (int j=0; j<count; j++){
                if (b[j]<pow(2,i)){
                } else {
                    b[j]-=pow(2,i);
                }
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}
8 4
9 1 8 2 7 5 6 6
 8 4
9 1 8 2 7 8 6 6
 4 4
2 5 2 5
 8 8
9 1 8 2 7 5 6 4
 8 8
9 1 11 2 7 5 6 4
 8 4
8 1 15 2 7 8 6 6
 8 6
8 1 15 2 7 8 6 6
 8 6
8 1 27 2 7 8 6 6
 8 7
7 1 11 2 14 5 6 4
 8 6
8 1 27 2 7 8 7 2

32
 33
 6
 16
 20
 40
 36
 48
 34
 52

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 <stdlib.h>
#include <math.h>
int main(void){
    int n,k,count=0;
    scanf("%d%d",&n,&k);
    long long a[n],b[n*(n+1)/2],ans=0,max=0;
    for (int i=0; i<n; i++){
        scanf("%lld",&a[i]);
    }
    for (int i=0; i<n; i++){
        long long sum=0;
        for (int j=i; j<n; j++){
            sum+=a[j];
            b[count]=sum;
            if (b[count]>max){
                max=b[count];
            }
            count++;
        }
    }
    
    int count2=0,p=0;
    for (p=0; pow(2,p)<max; p++){
    }
    p--;
    
    for (int i=p; i>=0; i--){
        count2=0;
        for (int j=0; j<count; j++){
            if (b[j]>=pow(2,i)){
                count2++;
            }
        }
        if (count2>=k){
            ans+=pow(2,i);
            for (int j=0; j<count; j++){
                if (b[j]<pow(2,i)){
                    b[j]=0;
                } else {
                    b[j]-=pow(2,i);
                }
            }
        } else {
            for (int j=0; j<count; j++){
                if (b[j]<pow(2,i)){
                } else {
                    b[j]-=pow(2,i);
                }
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$152, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -152(%rbp)
	leaq	-156(%rbp), %rdx
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-160(%rbp), %eax
	leal	1(%rax), %edx
	movl	-160(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movl	$0, -148(%rbp)
	jmp	.L8
.L9:
	movl	-148(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L8:
	movl	-160(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L9
	movl	$0, -144(%rbp)
	jmp	.L10
.L14:
	movq	$0, -96(%rbp)
	movl	-144(%rbp), %eax
	movl	%eax, -140(%rbp)
	jmp	.L11
.L13:
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	-96(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -104(%rbp)
	jge	.L12
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -104(%rbp)
.L12:
	addl	$1, -152(%rbp)
	addl	$1, -140(%rbp)
.L11:
	movl	-160(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L13
	addl	$1, -144(%rbp)
.L10:
	movl	-160(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jl	.L14
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L15
.L16:
	addl	$1, -132(%rbp)
.L15:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-132(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-104(%rbp), %xmm1
	comisd	%xmm0, %xmm1
	ja	.L16
	subl	$1, -132(%rbp)
	movl	-132(%rbp), %eax
	movl	%eax, -128(%rbp)
	jmp	.L17
.L32:
	movl	$0, -136(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L18
.L21:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movsd	%xmm2, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-176(%rbp), %xmm2
	comisd	%xmm0, %xmm2
	jb	.L19
	addl	$1, -136(%rbp)
.L19:
	addl	$1, -124(%rbp)
.L18:
	movl	-124(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L21
	movl	-156(%rbp), %eax
	cmpl	%eax, -136(%rbp)
	jl	.L22
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-112(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -112(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L23
.L27:
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rax, %xmm3
	movsd	%xmm3, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm4
	comisd	-176(%rbp), %xmm4
	jbe	.L37
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	jmp	.L26
.L37:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	subsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rcx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L26:
	addl	$1, -120(%rbp)
.L23:
	movl	-120(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L27
	jmp	.L28
.L22:
	movl	$0, -116(%rbp)
	jmp	.L29
.L31:
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm5, %xmm5
	cvtsi2sdq	%rax, %xmm5
	movsd	%xmm5, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm6
	comisd	-176(%rbp), %xmm6
	ja	.L30
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	subsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rcx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L30:
	addl	$1, -116(%rbp)
.L29:
	movl	-116(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L31
.L28:
	subl	$1, -128(%rbp)
.L17:
	cmpl	$0, -128(%rbp)
	jns	.L32
	movq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.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%d"
.LC1:
	.string	"%lld"
.LC3:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$152, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$0, -152(%rbp)
	leaq	-156(%rbp), %rdx
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -88(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -176(%rbp)
	movq	$0, -168(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, -192(%rbp)
	movq	$0, -184(%rbp)
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movl	-160(%rbp), %eax
	leal	1(%rax), %edx
	movl	-160(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -112(%rbp)
	movq	$0, -104(%rbp)
	movl	$0, -148(%rbp)
	jmp	.L8
.L9:
	movl	-148(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -148(%rbp)
.L8:
	movl	-160(%rbp), %eax
	cmpl	%eax, -148(%rbp)
	jl	.L9
	movl	$0, -144(%rbp)
	jmp	.L10
.L14:
	movq	$0, -96(%rbp)
	movl	-144(%rbp), %eax
	movl	%eax, -140(%rbp)
	jmp	.L11
.L13:
	movq	-80(%rbp), %rax
	movl	-140(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	addq	%rax, -96(%rbp)
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	-96(%rbp), %rcx
	movq	%rcx, (%rax,%rdx,8)
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	cmpq	%rax, -104(%rbp)
	jge	.L12
	movq	-64(%rbp), %rax
	movl	-152(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	movq	%rax, -104(%rbp)
.L12:
	addl	$1, -152(%rbp)
	addl	$1, -140(%rbp)
.L11:
	movl	-160(%rbp), %eax
	cmpl	%eax, -140(%rbp)
	jl	.L13
	addl	$1, -144(%rbp)
.L10:
	movl	-160(%rbp), %eax
	cmpl	%eax, -144(%rbp)
	jl	.L14
	movl	$0, -136(%rbp)
	movl	$0, -132(%rbp)
	movl	$0, -132(%rbp)
	jmp	.L15
.L16:
	addl	$1, -132(%rbp)
.L15:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-132(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-104(%rbp), %xmm1
	comisd	%xmm0, %xmm1
	ja	.L16
	subl	$1, -132(%rbp)
	movl	-132(%rbp), %eax
	movl	%eax, -128(%rbp)
	jmp	.L17
.L32:
	movl	$0, -136(%rbp)
	movl	$0, -124(%rbp)
	jmp	.L18
.L21:
	movq	-64(%rbp), %rax
	movl	-124(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm2, %xmm2
	cvtsi2sdq	%rax, %xmm2
	movsd	%xmm2, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movsd	-176(%rbp), %xmm2
	comisd	%xmm0, %xmm2
	jb	.L19
	addl	$1, -136(%rbp)
.L19:
	addl	$1, -124(%rbp)
.L18:
	movl	-124(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L21
	movl	-156(%rbp), %eax
	cmpl	%eax, -136(%rbp)
	jl	.L22
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	pxor	%xmm1, %xmm1
	cvtsi2sdq	-112(%rbp), %xmm1
	addsd	%xmm1, %xmm0
	cvttsd2siq	%xmm0, %rax
	movq	%rax, -112(%rbp)
	movl	$0, -120(%rbp)
	jmp	.L23
.L27:
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm3, %xmm3
	cvtsi2sdq	%rax, %xmm3
	movsd	%xmm3, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm4
	comisd	-176(%rbp), %xmm4
	jbe	.L37
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	$0, (%rax,%rdx,8)
	jmp	.L26
.L37:
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	subsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rcx
	movq	-64(%rbp), %rax
	movl	-120(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L26:
	addl	$1, -120(%rbp)
.L23:
	movl	-120(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L27
	jmp	.L28
.L22:
	movl	$0, -116(%rbp)
	jmp	.L29
.L31:
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm5, %xmm5
	cvtsi2sdq	%rax, %xmm5
	movsd	%xmm5, -176(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	%xmm0, %rax
	movq	%rax, %xmm6
	comisd	-176(%rbp), %xmm6
	ja	.L30
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-128(%rbp), %xmm0
	movq	.LC2(%rip), %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	pow@PLT
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	(%rax,%rdx,8), %rax
	pxor	%xmm1, %xmm1
	cvtsi2sdq	%rax, %xmm1
	subsd	%xmm0, %xmm1
	cvttsd2siq	%xmm1, %rcx
	movq	-64(%rbp), %rax
	movl	-116(%rbp), %edx
	movslq	%edx, %rdx
	movq	%rcx, (%rax,%rdx,8)
.L30:
	addl	$1, -116(%rbp)
.L29:
	movl	-116(%rbp), %eax
	cmpl	-152(%rbp), %eax
	jl	.L31
.L28:
	subl	$1, -128(%rbp)
.L17:
	cmpl	$0, -128(%rbp)
	jns	.L32
	movq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC2:
	.long	0
	.long	1073741824
	.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:
