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

```c
int N,M;
int A[1<<17];
main()
{
	scanf("%d%d",&N,&M);
	for(int i=0;i<N;i++)scanf("%d",&A[i]);
	int L=1,R=1<<30;
	long X=0;
	while(R-L>1)
	{
		int i=L+R>>1;
		int d=M;
		long k=0;
		for(int j=0;j<N;j++)
		{
			int a=A[j];
			while(i<=a)
			{
				a/=2;
				d--;
			}
			k+=a;
		}
		if(d>=0)
		{
			R=i;
			X=k-i/2*d;
		}
		else L=i;
	}
	printf("%ld\n",X>0?X:0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 524288
A:
	.zero	524288
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.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	$48, %rsp
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L3
	movl	$1, -40(%rbp)
	movl	$1073741824, -36(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L4
.L10:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	movl	M(%rip), %eax
	movl	%eax, -32(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L5
.L8:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	subl	$1, -32(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L7
	movl	-24(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
	addl	$1, -28(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	cmpl	$0, -32(%rbp)
	js	.L9
	movl	-20(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	imull	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	jmp	.L4
.L9:
	movl	-20(%rbp), %eax
	movl	%eax, -40(%rbp)
.L4:
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	cmpl	$1, %eax
	jg	.L10
	movq	-16(%rbp), %rax
	movl	$0, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.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	"%d"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	M(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	A(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	scanf@PLT
	movl	N(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L2
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	scanf@PLT
	movl	N(%rip), %r11d
	addq	$4, %r12
	cmpl	%ebp, %r11d
	jg	.L3
.L2:
	leal	-1(%r11), %eax
	leaq	4+A(%rip), %rdx
	movl	M(%rip), %ebp
	xorl	%r12d, %r12d
	leaq	(%rdx,%rax,4), %r8
	movl	$1073741824, %r10d
	movl	$1, %r9d
.L9:
	movl	%r10d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r9,%r10), %esi
	sarl	%esi
	testl	%r11d, %r11d
	jle	.L11
	movq	%rbx, %rdi
	movl	%ebp, %edx
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rdi), %eax
	cmpl	%eax, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%eax, %ecx
	subl	$1, %edx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cmpl	%eax, %esi
	jle	.L7
.L6:
	cltq
	addq	$4, %rdi
	addq	%rax, %r13
	cmpq	%r8, %rdi
	jne	.L8
	testl	%edx, %edx
	jns	.L20
.L12:
	movl	%esi, %r9d
	movl	%r10d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jg	.L10
.L19:
	xorl	%eax, %eax
	testq	%r12, %r12
	leaq	.LC2(%rip), %rdi
	cmovns	%r12, %rax
	movq	%rax, %rsi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	movl	%ebp, %edx
	xorl	%r13d, %r13d
	testl	%edx, %edx
	js	.L12
.L20:
	movl	%esi, %eax
	movq	%r13, %r12
	movl	%esi, %r10d
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	imull	%edx, %eax
	cltq
	subq	%rax, %r12
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 524288
A:
	.zero	524288
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	M(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	A(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	call	scanf@PLT
	movl	N(%rip), %r11d
	testl	%r11d, %r11d
	jle	.L2
	movq	%rbx, %r12
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r13
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	scanf@PLT
	movl	N(%rip), %r11d
	addq	$4, %r12
	cmpl	%ebp, %r11d
	jg	.L3
.L2:
	leal	-1(%r11), %eax
	leaq	4+A(%rip), %rdx
	movl	M(%rip), %ebp
	xorl	%r12d, %r12d
	leaq	(%rdx,%rax,4), %r8
	movl	$1073741824, %r10d
	movl	$1, %r9d
.L9:
	movl	%r10d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jle	.L19
	.p2align 4,,10
	.p2align 3
.L10:
	leal	(%r9,%r10), %esi
	sarl	%esi
	testl	%r11d, %r11d
	jle	.L11
	movq	%rbx, %rdi
	movl	%ebp, %edx
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rdi), %eax
	cmpl	%eax, %esi
	jg	.L6
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%eax, %ecx
	subl	$1, %edx
	shrl	$31, %ecx
	addl	%ecx, %eax
	sarl	%eax
	cmpl	%eax, %esi
	jle	.L7
.L6:
	cltq
	addq	$4, %rdi
	addq	%rax, %r13
	cmpq	%r8, %rdi
	jne	.L8
	testl	%edx, %edx
	jns	.L20
.L12:
	movl	%esi, %r9d
	movl	%r10d, %eax
	subl	%r9d, %eax
	cmpl	$1, %eax
	jg	.L10
.L19:
	xorl	%eax, %eax
	testq	%r12, %r12
	leaq	.LC2(%rip), %rdi
	cmovns	%r12, %rax
	movq	%rax, %rsi
	xorl	%eax, %eax
	call	printf@PLT
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	movl	%ebp, %edx
	xorl	%r13d, %r13d
	testl	%edx, %edx
	js	.L12
.L20:
	movl	%esi, %eax
	movq	%r13, %r12
	movl	%esi, %r10d
	shrl	$31, %eax
	addl	%esi, %eax
	sarl	%eax
	imull	%edx, %eax
	cltq
	subq	%rax, %r12
	jmp	.L9
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	A
	.bss
	.align 32
	.type	A, @object
	.size	A, 524288
A:
	.zero	524288
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

int N,M;
int A[1<<17];
main()
{
	scanf("%d%d",&N,&M);
	for(int i=0;i<N;i++)scanf("%d",&A[i]);
	int L=1,R=1<<30;
	long X=0;
	while(R-L>1)
	{
		int i=L+R>>1;
		int d=M;
		long k=0;
		for(int j=0;j<N;j++)
		{
			int a=A[j];
			while(i<=a)
			{
				a/=2;
				d--;
			}
			k+=a;
		}
		if(d>=0)
		{
			R=i;
			X=k-i/2*d;
		}
		else L=i;
	}
	printf("%ld\n",X>0?X:0);
}

1 101000
1000000000
 10 1
1000000000 1001000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
 3 3
2 13 3
 10 1
1000000000 1001000000 1000000000 1000000000 1000000000 1000000000 1000000000 1010000000 1000000000 1000000000
 3 2
2 13 3
 10 1
1000000000 1001000000 1000000000 1000000000 1000000000 1000000000 1000000000 1010010000 1000000000 1000000000
 3 2
2 13 2
 10 1
1000000000 1001000000 1010000000 1000000000 1000000000 1000000000 1000000000 1010010000 1000000000 1000000000
 10 1
1000000000 1001000000 1010000000 1000000000 1000000000 1000000000 1000000000 1010010000 1000000000 1100000000
 10 1
1000000000 1001000000 1010000000 1100000000 1000000000 1000000000 1000000000 1010010000 1000000000 1100000000

0
 9500500000
 6
 9506000000
 8
 9506005000
 7
 9516005000
 9571010000
 0

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

```c
int N,M;
int A[1<<17];
main()
{
	scanf("%d%d",&N,&M);
	for(int i=0;i<N;i++)scanf("%d",&A[i]);
	int L=1,R=1<<30;
	long X=0;
	while(R-L>1)
	{
		int i=L+R>>1;
		int d=M;
		long k=0;
		for(int j=0;j<N;j++)
		{
			int a=A[j];
			while(i<=a)
			{
				a/=2;
				d--;
			}
			k+=a;
		}
		if(d>=0)
		{
			R=i;
			X=k-i/2*d;
		}
		else L=i;
	}
	printf("%ld\n",X>0?X:0);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 524288
A:
	.zero	524288
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.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	$48, %rsp
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L3
	movl	$1, -40(%rbp)
	movl	$1073741824, -36(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L4
.L10:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	movl	M(%rip), %eax
	movl	%eax, -32(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L5
.L8:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	subl	$1, -32(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L7
	movl	-24(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
	addl	$1, -28(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	cmpl	$0, -32(%rbp)
	js	.L9
	movl	-20(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	imull	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	jmp	.L4
.L9:
	movl	-20(%rbp), %eax
	movl	%eax, -40(%rbp)
.L4:
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	cmpl	$1, %eax
	jg	.L10
	movq	-16(%rbp), %rax
	movl	$0, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	A
	.align 32
	.type	A, @object
	.size	A, 524288
A:
	.zero	524288
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld\n"
	.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	$48, %rsp
	leaq	M(%rip), %rax
	movq	%rax, %rdx
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L3:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	N(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L3
	movl	$1, -40(%rbp)
	movl	$1073741824, -36(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L4
.L10:
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %eax
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -20(%rbp)
	movl	M(%rip), %eax
	movl	%eax, -32(%rbp)
	movq	$0, -8(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L5
.L8:
	movl	-28(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	A(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -24(%rbp)
	jmp	.L6
.L7:
	movl	-24(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	subl	$1, -32(%rbp)
.L6:
	movl	-20(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L7
	movl	-24(%rbp), %eax
	cltq
	addq	%rax, -8(%rbp)
	addl	$1, -28(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L8
	cmpl	$0, -32(%rbp)
	js	.L9
	movl	-20(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	imull	-32(%rbp), %eax
	movslq	%eax, %rdx
	movq	-8(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, -16(%rbp)
	jmp	.L4
.L9:
	movl	-20(%rbp), %eax
	movl	%eax, -40(%rbp)
.L4:
	movl	-36(%rbp), %eax
	subl	-40(%rbp), %eax
	cmpl	$1, %eax
	jg	.L10
	movq	-16(%rbp), %rax
	movl	$0, %edx
	testq	%rax, %rax
	cmovs	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.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:
