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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define bit(n,m)(((n)>>(m))&1)
#define min(p,q)((p)<(q)?(p):(q))

ll a[20];
ll s[110];
ll ans[1<<15];
int main(){
	int n,m;
	while(scanf("%d%d",&n,&m),n){
		rep(i,0,n)scanf("%lld",a+i);
		rep(i,0,m)scanf("%lld",s+i);
		rep(i,1,1<<n)ans[i]=1e9;
		rep(i,1,1<<n){
			//もらうDP
			ll sum=0;
			rep(k,0,n)if(bit(i,k))sum+=a[k];
			rep(k,0,n)if(bit(i,k)){
				int be=i^(1<<k);
				ll temp=0;
				rep(x,0,m)if(sum-a[k]<=s[x]&&s[x]<sum)temp+=min(llabs(s[x]-(sum-a[k])),llabs(s[x]-sum));
				ans[i]=min(ans[i],ans[be]+temp);
			}
		}
		ll sum=0;
		rep(k,0,n)sum+=a[k];
		ll temp=0;
		rep(x,0,m)if(sum<=s[x])temp+=llabs(s[x]-sum);
		printf("%lld\n",ans[(1<<n)-1]+temp);
	}
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 880
s:
	.zero	880
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 262144
ans:
	.zero	262144
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d%d"
	.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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L25:
	movq	$0, -112(%rbp)
	jmp	.L3
.L4:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -112(%rbp)
.L3:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -112(%rbp)
	jl	.L4
	movq	$0, -104(%rbp)
	jmp	.L5
.L6:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L5:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jl	.L6
	movq	$1, -96(%rbp)
	jmp	.L7
.L8:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	$1000000000, (%rdx,%rax)
	addq	$1, -96(%rbp)
.L7:
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movq	$1, -88(%rbp)
	jmp	.L9
.L19:
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	jmp	.L10
.L12:
	movq	-72(%rbp), %rax
	movl	%eax, %edx
	movq	-88(%rbp), %rax
	movl	%edx, %ecx
	sarq	%cl, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L11
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -80(%rbp)
.L11:
	addq	$1, -72(%rbp)
.L10:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -72(%rbp)
	jl	.L12
	movq	$0, -64(%rbp)
	jmp	.L13
.L18:
	movq	-64(%rbp), %rax
	movl	%eax, %edx
	movq	-88(%rbp), %rax
	movl	%edx, %ecx
	sarq	%cl, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L14
	movq	-64(%rbp), %rax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movq	-88(%rbp), %rax
	xorl	%edx, %eax
	movl	%eax, -116(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L15
.L17:
	movq	-64(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-80(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, %rcx
	jg	.L16
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L16
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	-80(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	s(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	-64(%rbp), %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	a(%rip), %rcx
	movq	(%rsi,%rcx), %rsi
	movq	-80(%rbp), %rcx
	subq	%rsi, %rcx
	subq	%rcx, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovns	%rcx, %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	addq	%rax, -56(%rbp)
.L16:
	addq	$1, -48(%rbp)
.L15:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -48(%rbp)
	jl	.L17
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	ans(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ans(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L14:
	addq	$1, -64(%rbp)
.L13:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -64(%rbp)
	jl	.L18
	addq	$1, -88(%rbp)
.L9:
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jl	.L19
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L20
.L21:
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -40(%rbp)
	addq	$1, -32(%rbp)
.L20:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jl	.L21
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L22
.L24:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -40(%rbp)
	jg	.L23
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	addq	%rax, -24(%rbp)
.L23:
	addq	$1, -16(%rbp)
.L22:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L24
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-120(%rbp), %rdx
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	testl	%eax, %eax
	jne	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%lld"
.LC2:
	.string	"%lld\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	leaq	a(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 32(%rsp)
.L2:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L26
	leaq	a(%rip), %r13
	movl	$0, %ebp
	leaq	.LC0(%rip), %rbx
	movslq	%ecx, %r12
	jle	.L28
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %r12
	addq	$8, %r13
	movq	%r12, %rcx
	cmpq	%rbp, %r12
	jg	.L3
.L28:
	movslq	52(%rsp), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jle	.L4
	leaq	s(%rip), %r12
	xorl	%ebp, %ebp
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movslq	52(%rsp), %rax
	addq	$8, %r12
	cmpq	%rbp, %rax
	jg	.L5
	movslq	48(%rsp), %r12
	movq	%rax, 8(%rsp)
	movq	%r12, %rcx
.L4:
	movl	$1, %eax
	leaq	ans(%rip), %rdi
	sall	%cl, %eax
	movq	%rdi, (%rsp)
	movslq	%eax, %rbx
	movl	%eax, 28(%rsp)
	movq	%rbx, 16(%rsp)
	cmpl	$1, %eax
	jle	.L6
	leaq	-1(%rbx), %rsi
	cmpl	$1, %ecx
	je	.L30
	movq	%rsi, %rdx
	leaq	8(%rdi), %rax
	shrq	%rdx
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	.LC1(%rip), %xmm2
	addq	$16, %rax
	movups	%xmm2, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L8
	movq	%rsi, %rax
	leaq	ans(%rip), %rbx
	orq	$1, %rax
	andl	$1, %esi
	movq	%rbx, (%rsp)
	je	.L9
.L7:
	leaq	ans(%rip), %rbx
	movq	%rbx, (%rsp)
	movq	$1000000000, (%rbx,%rax,8)
.L9:
	movq	8(%rsp), %rbx
	leaq	s(%rip), %rax
	leaq	8+ans(%rip), %r15
	movl	$1, %r11d
	leaq	(%rax,%rbx,8), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	testq	%r12, %r12
	jg	.L12
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rax, %rcx
.L12:
	btq	%rcx, %r11
	jnc	.L11
	addq	(%r14,%rcx,8), %rdi
.L11:
	leaq	1(%rcx), %rax
	cmpq	%rax, %r12
	jne	.L31
	xorl	%esi, %esi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rsi), %rax
	cmpq	%rsi, %rcx
	je	.L18
.L33:
	movq	%rax, %rsi
.L17:
	btq	%rsi, %r11
	jnc	.L13
	movl	%r11d, %r13d
	btcl	%esi, %r13d
	cmpq	$0, 8(%rsp)
	jle	.L32
	movq	%rdi, %r9
	leaq	s(%rip), %rax
	subq	(%r14,%rsi,8), %r9
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L16:
	movq	(%rax), %rdx
	cmpq	%rdx, %r9
	jg	.L15
	cmpq	%rdx, %rdi
	jle	.L15
	movq	%rdx, %r10
	movq	%rdi, %rbp
	subq	%r9, %r10
	subq	%rdx, %rbp
	cmpq	%rbp, %r10
	cmovg	%rbp, %r10
	addq	%r10, %r8
.L15:
	addq	$8, %rax
	cmpq	%rbx, %rax
	jne	.L16
.L14:
	movq	(%rsp), %rax
	movslq	%r13d, %r13
	addq	(%rax,%r13,8), %r8
	movq	(%r15), %rax
	cmpq	%rax, %r8
	cmovg	%rax, %r8
	leaq	1(%rsi), %rax
	movq	%r8, (%r15)
	cmpq	%rsi, %rcx
	jne	.L33
.L18:
	addq	$1, %r11
	addq	$8, %r15
	cmpq	16(%rsp), %r11
	jne	.L10
.L6:
	testq	%r12, %r12
	jle	.L35
	cmpq	$1, %r12
	je	.L36
	movq	%r12, %rax
	movdqa	(%r14), %xmm0
	shrq	%rax
	cmpq	$1, %rax
	je	.L21
	paddq	16+a(%rip), %xmm0
	cmpq	$2, %rax
	je	.L21
	paddq	32+a(%rip), %xmm0
	cmpq	$3, %rax
	je	.L21
	paddq	48+a(%rip), %xmm0
	cmpq	$4, %rax
	je	.L21
	paddq	64+a(%rip), %xmm0
	cmpq	$5, %rax
	je	.L21
	paddq	80+a(%rip), %xmm0
	cmpq	$6, %rax
	je	.L21
	paddq	96+a(%rip), %xmm0
	cmpq	$7, %rax
	je	.L21
	paddq	112+a(%rip), %xmm0
	cmpq	$8, %rax
	je	.L21
	paddq	128+a(%rip), %xmm0
	cmpq	$9, %rax
	je	.L21
	paddq	144+a(%rip), %xmm0
.L21:
	movdqa	%xmm0, %xmm1
	movq	%r12, %rax
	psrldq	$8, %xmm1
	andq	$-2, %rax
	andl	$1, %r12d
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rsi
	je	.L19
.L20:
	addq	(%r14,%rax,8), %rsi
.L19:
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	jle	.L37
.L92:
	leaq	s(%rip), %rax
	xorl	%edx, %edx
	leaq	(%rax,%rdi,8), %r8
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rax), %rdi
	movq	%rdi, %rcx
	subq	%rsi, %rcx
	addq	%rdx, %rcx
	cmpq	%rdi, %rsi
	cmovle	%rcx, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L25
.L23:
	movl	28(%rsp), %eax
	movq	(%rsp), %rbx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	subl	$1, %eax
	cltq
	addq	(%rbx,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L32:
	xorl	%r8d, %r8d
	jmp	.L14
.L26:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L91
	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
.L35:
	.cfi_restore_state
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	testq	%rdi, %rdi
	jg	.L92
.L37:
	xorl	%edx, %edx
	jmp	.L23
.L30:
	movl	$1, %eax
	jmp	.L7
.L36:
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L20
.L91:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 262144
ans:
	.zero	262144
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 880
s:
	.zero	880
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.quad	1000000000
	.quad	1000000000
	.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	"%lld"
.LC2:
	.string	"%lld\n"
.LC3:
	.string	"%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB39:
	.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
	leaq	a(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	52(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	48(%rsp), %rax
	movq	%rax, 32(%rsp)
.L2:
	movq	40(%rsp), %rdx
	movq	32(%rsp), %rsi
	leaq	.LC3(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L26
	leaq	a(%rip), %r13
	movl	$0, %ebp
	leaq	.LC0(%rip), %rbx
	movslq	%ecx, %r12
	jle	.L28
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movslq	48(%rsp), %r12
	addq	$8, %r13
	movq	%r12, %rcx
	cmpq	%rbp, %r12
	jg	.L3
.L28:
	movslq	52(%rsp), %rax
	movq	%rax, 8(%rsp)
	testq	%rax, %rax
	jle	.L4
	leaq	s(%rip), %r12
	xorl	%ebp, %ebp
	leaq	.LC0(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__isoc99_scanf@PLT
	movslq	52(%rsp), %rax
	addq	$8, %r12
	cmpq	%rbp, %rax
	jg	.L5
	movslq	48(%rsp), %r12
	movq	%rax, 8(%rsp)
	movq	%r12, %rcx
.L4:
	movl	$1, %eax
	leaq	ans(%rip), %rdi
	sall	%cl, %eax
	movq	%rdi, (%rsp)
	movslq	%eax, %rbx
	movl	%eax, 28(%rsp)
	movq	%rbx, 16(%rsp)
	cmpl	$1, %eax
	jle	.L6
	leaq	-1(%rbx), %rsi
	cmpl	$1, %ecx
	je	.L30
	movq	%rsi, %rdx
	leaq	8(%rdi), %rax
	shrq	%rdx
	salq	$4, %rdx
	addq	%rax, %rdx
	.p2align 4,,10
	.p2align 3
.L8:
	movdqa	.LC1(%rip), %xmm2
	addq	$16, %rax
	movups	%xmm2, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L8
	movq	%rsi, %rax
	leaq	ans(%rip), %rbx
	orq	$1, %rax
	andl	$1, %esi
	movq	%rbx, (%rsp)
	je	.L9
.L7:
	leaq	ans(%rip), %rbx
	movq	%rbx, (%rsp)
	movq	$1000000000, (%rbx,%rax,8)
.L9:
	movq	8(%rsp), %rbx
	leaq	s(%rip), %rax
	leaq	8+ans(%rip), %r15
	movl	$1, %r11d
	leaq	(%rax,%rbx,8), %rbx
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	testq	%r12, %r12
	jg	.L12
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%rax, %rcx
.L12:
	btq	%rcx, %r11
	jnc	.L11
	addq	(%r14,%rcx,8), %rdi
.L11:
	leaq	1(%rcx), %rax
	cmpq	%rax, %r12
	jne	.L31
	xorl	%esi, %esi
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L13:
	leaq	1(%rsi), %rax
	cmpq	%rsi, %rcx
	je	.L18
.L33:
	movq	%rax, %rsi
.L17:
	btq	%rsi, %r11
	jnc	.L13
	movl	%r11d, %r13d
	btcl	%esi, %r13d
	cmpq	$0, 8(%rsp)
	jle	.L32
	movq	%rdi, %r9
	leaq	s(%rip), %rax
	subq	(%r14,%rsi,8), %r9
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L16:
	movq	(%rax), %rdx
	cmpq	%rdx, %r9
	jg	.L15
	cmpq	%rdx, %rdi
	jle	.L15
	movq	%rdx, %r10
	movq	%rdi, %rbp
	subq	%r9, %r10
	subq	%rdx, %rbp
	cmpq	%rbp, %r10
	cmovg	%rbp, %r10
	addq	%r10, %r8
.L15:
	addq	$8, %rax
	cmpq	%rbx, %rax
	jne	.L16
.L14:
	movq	(%rsp), %rax
	movslq	%r13d, %r13
	addq	(%rax,%r13,8), %r8
	movq	(%r15), %rax
	cmpq	%rax, %r8
	cmovg	%rax, %r8
	leaq	1(%rsi), %rax
	movq	%r8, (%r15)
	cmpq	%rsi, %rcx
	jne	.L33
.L18:
	addq	$1, %r11
	addq	$8, %r15
	cmpq	16(%rsp), %r11
	jne	.L10
.L6:
	testq	%r12, %r12
	jle	.L35
	cmpq	$1, %r12
	je	.L36
	movq	%r12, %rax
	movdqa	(%r14), %xmm0
	shrq	%rax
	cmpq	$1, %rax
	je	.L21
	paddq	16+a(%rip), %xmm0
	cmpq	$2, %rax
	je	.L21
	paddq	32+a(%rip), %xmm0
	cmpq	$3, %rax
	je	.L21
	paddq	48+a(%rip), %xmm0
	cmpq	$4, %rax
	je	.L21
	paddq	64+a(%rip), %xmm0
	cmpq	$5, %rax
	je	.L21
	paddq	80+a(%rip), %xmm0
	cmpq	$6, %rax
	je	.L21
	paddq	96+a(%rip), %xmm0
	cmpq	$7, %rax
	je	.L21
	paddq	112+a(%rip), %xmm0
	cmpq	$8, %rax
	je	.L21
	paddq	128+a(%rip), %xmm0
	cmpq	$9, %rax
	je	.L21
	paddq	144+a(%rip), %xmm0
.L21:
	movdqa	%xmm0, %xmm1
	movq	%r12, %rax
	psrldq	$8, %xmm1
	andq	$-2, %rax
	andl	$1, %r12d
	paddq	%xmm1, %xmm0
	movq	%xmm0, %rsi
	je	.L19
.L20:
	addq	(%r14,%rax,8), %rsi
.L19:
	movq	8(%rsp), %rdi
	testq	%rdi, %rdi
	jle	.L37
.L92:
	leaq	s(%rip), %rax
	xorl	%edx, %edx
	leaq	(%rax,%rdi,8), %r8
	.p2align 4,,10
	.p2align 3
.L25:
	movq	(%rax), %rdi
	movq	%rdi, %rcx
	subq	%rsi, %rcx
	addq	%rdx, %rcx
	cmpq	%rdi, %rsi
	cmovle	%rcx, %rdx
	addq	$8, %rax
	cmpq	%rax, %r8
	jne	.L25
.L23:
	movl	28(%rsp), %eax
	movq	(%rsp), %rbx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	subl	$1, %eax
	cltq
	addq	(%rbx,%rax,8), %rdx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L32:
	xorl	%r8d, %r8d
	jmp	.L14
.L26:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L91
	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
.L35:
	.cfi_restore_state
	movq	8(%rsp), %rdi
	xorl	%esi, %esi
	testq	%rdi, %rdi
	jg	.L92
.L37:
	xorl	%edx, %edx
	jmp	.L23
.L30:
	movl	$1, %eax
	jmp	.L7
.L36:
	xorl	%eax, %eax
	xorl	%esi, %esi
	jmp	.L20
.L91:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	main, .-main
	.globl	ans
	.bss
	.align 32
	.type	ans, @object
	.size	ans, 262144
ans:
	.zero	262144
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 880
s:
	.zero	880
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.quad	1000000000
	.quad	1000000000
	.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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define bit(n,m)(((n)>>(m))&1)
#define min(p,q)((p)<(q)?(p):(q))

ll a[20];
ll s[110];
ll ans[1<<15];
int main(){
	int n,m;
	while(scanf("%d%d",&n,&m),n){
		rep(i,0,n)scanf("%lld",a+i);
		rep(i,0,m)scanf("%lld",s+i);
		rep(i,1,1<<n)ans[i]=1e9;
		rep(i,1,1<<n){
			//もらうDP
			ll sum=0;
			rep(k,0,n)if(bit(i,k))sum+=a[k];
			rep(k,0,n)if(bit(i,k)){
				int be=i^(1<<k);
				ll temp=0;
				rep(x,0,m)if(sum-a[k]<=s[x]&&s[x]<sum)temp+=min(llabs(s[x]-(sum-a[k])),llabs(s[x]-sum));
				ans[i]=min(ans[i],ans[be]+temp);
			}
		}
		ll sum=0;
		rep(k,0,n)sum+=a[k];
		ll temp=0;
		rep(x,0,m)if(sum<=s[x])temp+=llabs(s[x]-sum);
		printf("%lld\n",ans[(1<<n)-1]+temp);
	}
}

1 1
5
6
1 1
5
2
1 1
20
5
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
2 2 2 2 2
1 3 5 7 9
2 5
2 5
2 5 2 6 2
0 0
 1 1
5
6
1 1
5
2
1 1
20
5
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
2 2 2 2 2
2 3 5 7 9
2 5
2 5
2 5 2 6 2
0 0
 1 1
5
6
1 1
5
2
1 1
20
8
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
2 2 2 2 2
1 3 5 7 9
2 5
2 5
2 5 2 5 2
0 0
 1 1
5
6
1 1
5
2
1 1
20
8
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
2 2 2 2 2
2 3 5 7 9
2 5
2 5
2 5 2 5 2
0 0
 1 1
5
6
1 1
5
2
1 1
20
8
4 1
2 4 5 9
8
4 3
3 5 2 1
18 4 7
5 5
2 2 2 2 2
2 3 5 7 9
2 5
2 5
2 5 2 5 2
0 0
 1 1
5
5
1 1
5
2
1 1
20
5
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
2 2 4 2 2
2 1 5 7 9
2 5
2 5
2 5 2 6 2
0 0
 1 1
5
6
1 1
5
2
1 1
20
8
4 1
2 4 5 9
14
4 3
3 5 2 1
18 4 7
5 5
2 2 2 2 2
2 3 5 7 9
2 5
2 5
2 5 2 5 2
0 0
 1 1
5
5
1 1
5
2
1 1
20
5
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
2 3 4 2 2
2 1 5 7 9
2 5
2 5
2 5 2 6 2
0 0
 1 1
5
5
1 1
5
2
1 1
20
5
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
0 3 4 2 2
2 1 5 7 9
2 5
2 5
2 5 2 6 2
0 0
 1 1
5
6
1 1
5
2
1 1
20
5
4 1
2 4 5 9
8
4 3
3 5 2 1
10 4 7
5 5
3 2 2 2 2
2 3 5 7 9
2 5
2 5
2 5 2 6 2
0 0

1
2
5
1
1
5
3
 1
2
5
1
1
4
3
 1
2
8
1
1
5
4
 1
2
8
1
1
4
4
 1
2
8
1
8
4
4
 0
2
5
1
1
4
3
 1
2
8
0
8
4
4
 0
2
5
1
1
1
3
 0
2
5
1
1
3
3
 1
2
5
1
1
1
3

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>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define bit(n,m)(((n)>>(m))&1)
#define min(p,q)((p)<(q)?(p):(q))

ll a[20];
ll s[110];
ll ans[1<<15];
int main(){
	int n,m;
	while(scanf("%d%d",&n,&m),n){
		rep(i,0,n)scanf("%lld",a+i);
		rep(i,0,m)scanf("%lld",s+i);
		rep(i,1,1<<n)ans[i]=1e9;
		rep(i,1,1<<n){
			//もらうDP
			ll sum=0;
			rep(k,0,n)if(bit(i,k))sum+=a[k];
			rep(k,0,n)if(bit(i,k)){
				int be=i^(1<<k);
				ll temp=0;
				rep(x,0,m)if(sum-a[k]<=s[x]&&s[x]<sum)temp+=min(llabs(s[x]-(sum-a[k])),llabs(s[x]-sum));
				ans[i]=min(ans[i],ans[be]+temp);
			}
		}
		ll sum=0;
		rep(k,0,n)sum+=a[k];
		ll temp=0;
		rep(x,0,m)if(sum<=s[x])temp+=llabs(s[x]-sum);
		printf("%lld\n",ans[(1<<n)-1]+temp);
	}
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 880
s:
	.zero	880
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 262144
ans:
	.zero	262144
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d%d"
	.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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L25:
	movq	$0, -112(%rbp)
	jmp	.L3
.L4:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -112(%rbp)
.L3:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -112(%rbp)
	jl	.L4
	movq	$0, -104(%rbp)
	jmp	.L5
.L6:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L5:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jl	.L6
	movq	$1, -96(%rbp)
	jmp	.L7
.L8:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	$1000000000, (%rdx,%rax)
	addq	$1, -96(%rbp)
.L7:
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movq	$1, -88(%rbp)
	jmp	.L9
.L19:
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	jmp	.L10
.L12:
	movq	-72(%rbp), %rax
	movl	%eax, %edx
	movq	-88(%rbp), %rax
	movl	%edx, %ecx
	sarq	%cl, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L11
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -80(%rbp)
.L11:
	addq	$1, -72(%rbp)
.L10:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -72(%rbp)
	jl	.L12
	movq	$0, -64(%rbp)
	jmp	.L13
.L18:
	movq	-64(%rbp), %rax
	movl	%eax, %edx
	movq	-88(%rbp), %rax
	movl	%edx, %ecx
	sarq	%cl, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L14
	movq	-64(%rbp), %rax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movq	-88(%rbp), %rax
	xorl	%edx, %eax
	movl	%eax, -116(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L15
.L17:
	movq	-64(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-80(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, %rcx
	jg	.L16
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L16
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	-80(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	s(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	-64(%rbp), %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	a(%rip), %rcx
	movq	(%rsi,%rcx), %rsi
	movq	-80(%rbp), %rcx
	subq	%rsi, %rcx
	subq	%rcx, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovns	%rcx, %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	addq	%rax, -56(%rbp)
.L16:
	addq	$1, -48(%rbp)
.L15:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -48(%rbp)
	jl	.L17
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	ans(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ans(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L14:
	addq	$1, -64(%rbp)
.L13:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -64(%rbp)
	jl	.L18
	addq	$1, -88(%rbp)
.L9:
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jl	.L19
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L20
.L21:
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -40(%rbp)
	addq	$1, -32(%rbp)
.L20:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jl	.L21
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L22
.L24:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -40(%rbp)
	jg	.L23
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	addq	%rax, -24(%rbp)
.L23:
	addq	$1, -16(%rbp)
.L22:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L24
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-120(%rbp), %rdx
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	testl	%eax, %eax
	jne	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 160
a:
	.zero	160
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 880
s:
	.zero	880
	.globl	ans
	.align 32
	.type	ans, @object
	.size	ans, 262144
ans:
	.zero	262144
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
.LC2:
	.string	"%d%d"
	.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
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L25:
	movq	$0, -112(%rbp)
	jmp	.L3
.L4:
	movq	-112(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -112(%rbp)
.L3:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -112(%rbp)
	jl	.L4
	movq	$0, -104(%rbp)
	jmp	.L5
.L6:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addq	$1, -104(%rbp)
.L5:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -104(%rbp)
	jl	.L6
	movq	$1, -96(%rbp)
	jmp	.L7
.L8:
	movq	-96(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	$1000000000, (%rdx,%rax)
	addq	$1, -96(%rbp)
.L7:
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	cmpq	%rax, -96(%rbp)
	jl	.L8
	movq	$1, -88(%rbp)
	jmp	.L9
.L19:
	movq	$0, -80(%rbp)
	movq	$0, -72(%rbp)
	jmp	.L10
.L12:
	movq	-72(%rbp), %rax
	movl	%eax, %edx
	movq	-88(%rbp), %rax
	movl	%edx, %ecx
	sarq	%cl, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L11
	movq	-72(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -80(%rbp)
.L11:
	addq	$1, -72(%rbp)
.L10:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -72(%rbp)
	jl	.L12
	movq	$0, -64(%rbp)
	jmp	.L13
.L18:
	movq	-64(%rbp), %rax
	movl	%eax, %edx
	movq	-88(%rbp), %rax
	movl	%edx, %ecx
	sarq	%cl, %rax
	andl	$1, %eax
	testq	%rax, %rax
	je	.L14
	movq	-64(%rbp), %rax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movq	-88(%rbp), %rax
	xorl	%edx, %eax
	movl	%eax, -116(%rbp)
	movq	$0, -56(%rbp)
	movq	$0, -48(%rbp)
	jmp	.L15
.L17:
	movq	-64(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-80(%rbp), %rax
	subq	%rdx, %rax
	movq	%rax, %rcx
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, %rcx
	jg	.L16
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -80(%rbp)
	jle	.L16
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	-80(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovs	%rax, %rdx
	movq	-48(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	s(%rip), %rax
	movq	(%rcx,%rax), %rax
	movq	-64(%rbp), %rcx
	leaq	0(,%rcx,8), %rsi
	leaq	a(%rip), %rcx
	movq	(%rsi,%rcx), %rsi
	movq	-80(%rbp), %rcx
	subq	%rsi, %rcx
	subq	%rcx, %rax
	movq	%rax, %rcx
	negq	%rcx
	cmovns	%rcx, %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	addq	%rax, -56(%rbp)
.L16:
	addq	$1, -48(%rbp)
.L15:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -48(%rbp)
	jl	.L17
	movl	-116(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-56(%rbp), %rax
	addq	%rax, %rdx
	movq	-88(%rbp), %rax
	leaq	0(,%rax,8), %rcx
	leaq	ans(%rip), %rax
	movq	(%rcx,%rax), %rax
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	-88(%rbp), %rdx
	leaq	0(,%rdx,8), %rcx
	leaq	ans(%rip), %rdx
	movq	%rax, (%rcx,%rdx)
.L14:
	addq	$1, -64(%rbp)
.L13:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -64(%rbp)
	jl	.L18
	addq	$1, -88(%rbp)
.L9:
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	cltq
	cmpq	%rax, -88(%rbp)
	jl	.L19
	movq	$0, -40(%rbp)
	movq	$0, -32(%rbp)
	jmp	.L20
.L21:
	movq	-32(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	a(%rip), %rax
	movq	(%rdx,%rax), %rax
	addq	%rax, -40(%rbp)
	addq	$1, -32(%rbp)
.L20:
	movl	-124(%rbp), %eax
	cltq
	cmpq	%rax, -32(%rbp)
	jl	.L21
	movq	$0, -24(%rbp)
	movq	$0, -16(%rbp)
	jmp	.L22
.L24:
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	cmpq	%rax, -40(%rbp)
	jg	.L23
	movq	-16(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	leaq	s(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	-40(%rbp), %rax
	movq	%rax, %rdx
	negq	%rdx
	cmovns	%rdx, %rax
	addq	%rax, -24(%rbp)
.L23:
	addq	$1, -16(%rbp)
.L22:
	movl	-120(%rbp), %eax
	cltq
	cmpq	%rax, -16(%rbp)
	jl	.L24
	movl	-124(%rbp), %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	ans(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-120(%rbp), %rdx
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-124(%rbp), %eax
	testl	%eax, %eax
	jne	.L25
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L27
	call	__stack_chk_fail@PLT
.L27:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
