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

Assembly Code:

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

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

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:

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

Assembly Code:

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

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%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:
```