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>

typedef long long int int64;

#define POS(i,j) ((i)*(2*50*n+1)+(j)+50*n)

void run(void){
  int n,a;
  scanf("%d%d",&n,&a);
  int64 *dp=(int64 *)calloc(2*50*n+1,sizeof(int64));
  int now=0;
  dp[POS(0,0)]=1;
  int l,r;
  l=r=0;
  int i,j;
  for(i=0;i<n;i++){
    int x;
    scanf("%d",&x);
    x-=a;
    int next=now^1;
    for(j=l;j<=r;j++) dp[POS(next,j)]=dp[POS(now,j)];
    for(j=l;j<=r;j++) dp[POS(next,j+x)]+=dp[POS(now,j)];
    if(x<0){
      l+=x;
    } else {
      r+=x;
    }
    now=next;
  }
  printf("%lld\n",dp[POS(now,0)]-1);
  return;
}

int main(void){
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -40(%rbp)
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, (%rax)
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L9:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	movl	-48(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	xorl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L3
.L4:
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %edx
	imull	$100, %edx, %edx
	addl	$1, %edx
	movl	%edx, %ecx
	imull	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	movl	-52(%rbp), %edx
	imull	$50, %edx, %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	addl	$1, -24(%rbp)
.L3:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L5
.L6:
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-20(%rbp), %eax
	movl	-44(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%ecx, %edx
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-20(%rbp), %eax
	movl	-44(%rbp), %edi
	movl	-24(%rbp), %esi
	addl	%edi, %esi
	addl	%eax, %esi
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L6
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jns	.L7
	movl	-44(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L8
.L7:
	movl	-44(%rbp), %eax
	addl	%eax, -32(%rbp)
.L8:
	movl	-20(%rbp), %eax
	movl	%eax, -40(%rbp)
	addl	$1, -28(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L9
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"%lld\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	80(%rsp), %rdx
	leaq	76(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %ebx
	movl	$8, %esi
	imull	$100, %ebx, %edi
	addl	$1, %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	%rax, %r15
	imull	$50, %ebx, %eax
	cltq
	movq	$1, (%r15,%rax,8)
	testl	%ebx, %ebx
	jle	.L19
	leaq	84(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movq	%rax, 48(%rsp)
	leaq	8(%r15), %rax
	movl	$0, 32(%rsp)
	movq	%rax, 56(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	48(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	76(%rsp), %rdx
	movl	80(%rsp), %ebx
	movl	84(%rsp), %eax
	movl	32(%rsp), %r8d
	imull	$100, %edx, %esi
	movq	%rdx, %r14
	movl	%ebx, 28(%rsp)
	movl	%eax, 24(%rsp)
	subl	%ebx, %eax
	imull	$50, %edx, %ecx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, %r10d
	movl	%r12d, %eax
	xorl	$1, %r12d
	movslq	%r13d, %rbx
	addl	$1, %esi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rbx, 8(%rsp)
	subl	%r13d, %r8d
	imull	%esi, %eax
	leaq	(%rdx,%rdx), %rdi
	imull	%r12d, %esi
	addq	%rdi, %rbx
	movq	%rdi, 16(%rsp)
	movq	%rbx, %r9
	movslq	%esi, %rbp
	leaq	(%rbx,%rbp), %rdi
	movslq	%eax, %rbx
	addq	%rbx, %r9
	movq	%rbx, 40(%rsp)
	salq	$3, %rdi
	leaq	8(,%r9,8), %rbx
	cmpl	$2, %r8d
	jbe	.L3
	cmpq	%rbx, %rdi
	je	.L3
	leal	1(%r8), %edx
	leaq	-8(%r15,%rbx), %r11
	addq	%r15, %rdi
	movl	%edx, 36(%rsp)
	shrl	%edx
	movl	%edx, %r9d
	xorl	%edx, %edx
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	(%r11,%rdx), %xmm1
	movups	%xmm1, (%rdi,%rdx)
	addq	$16, %rdx
	cmpq	%r9, %rdx
	jne	.L4
	movl	36(%rsp), %r11d
	movl	%r11d, %edi
	andl	$-2, %edi
	leal	(%rdi,%r13), %edx
	cmpl	%edi, %r11d
	je	.L7
	leal	(%rax,%rdx), %edi
	addl	%esi, %edx
	addl	%ecx, %edi
	addl	%ecx, %edx
	movslq	%edi, %rdi
	movslq	%edx, %rdx
	movq	(%r15,%rdi,8), %rdi
	movq	%rdi, (%r15,%rdx,8)
.L7:
	movslq	28(%rsp), %rdi
	movq	16(%rsp), %rdx
	subq	%rdi, %rdx
	movslq	24(%rsp), %rdi
	addq	%rdi, %rdx
	addq	8(%rsp), %rdx
	addq	%rbp, %rdx
	salq	$3, %rdx
	cmpq	%rbx, %rdx
	je	.L8
	cmpl	$1, %r8d
	jbe	.L8
	addl	$1, %r8d
	addq	%r15, %rdx
	leaq	-8(%r15,%rbx), %r11
	xorl	%edi, %edi
	movl	%r8d, %r9d
	shrl	%r9d
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rdx,%rdi), %xmm0
	movdqu	(%r11,%rdi), %xmm2
	paddq	%xmm2, %xmm0
	movups	%xmm0, (%rdx,%rdi)
	addq	$16, %rdi
	cmpq	%rdi, %r9
	jne	.L9
	movl	%r8d, %edx
	andl	$-2, %edx
	leal	(%rdx,%r13), %edi
	cmpl	%edx, %r8d
	je	.L15
	leal	(%r10,%rdi), %edx
	addl	%edi, %eax
	addl	%esi, %edx
	addl	%ecx, %eax
	addl	%ecx, %edx
	cltq
	movslq	%edx, %rdx
	movq	(%r15,%rax,8), %rax
	addq	%rax, (%r15,%rdx,8)
.L15:
	testl	%r10d, %r10d
	js	.L41
	addl	%r10d, 32(%rsp)
.L16:
	addl	$1, 4(%rsp)
	movl	4(%rsp), %eax
	cmpl	%eax, %r14d
	jg	.L17
	imull	$100, %r14d, %eax
	movl	%r12d, %edx
	addl	$1, %eax
	imull	%eax, %edx
	imull	$50, %r14d, %eax
	addl	%edx, %eax
	cltq
	movq	(%r15,%rax,8), %rdx
	subq	$1, %rdx
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L41:
	.cfi_restore_state
	addl	%r10d, %r13d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	movq	16(%rsp), %rcx
	movslq	%r10d, %rax
	movq	40(%rsp), %rsi
	movl	%r8d, %r8d
	movq	56(%rsp), %rbx
	addq	%rax, %rcx
	addq	8(%rsp), %rcx
	subq	%rax, %rsi
	addq	%rbp, %rcx
	movq	%rsi, %rax
	addq	%rcx, %r8
	leaq	(%r15,%rcx,8), %rdx
	subq	%rbp, %rax
	leaq	(%rbx,%r8,8), %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rdx,%rax,8), %rsi
	addq	%rsi, (%rdx)
	addq	$8, %rdx
	cmpq	%rdx, %rcx
	jne	.L14
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	56(%rsp), %r11
	movl	%r8d, %edi
	leaq	(%r15,%r9,8), %rdx
	addq	%r9, %rdi
	leaq	(%r11,%rdi,8), %r9
	movq	%rbp, %rdi
	subq	40(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rdx), %r11
	movq	%r11, (%rdx,%rdi,8)
	addq	$8, %rdx
	cmpq	%rdx, %r9
	jne	.L6
	jmp	.L7
.L19:
	xorl	%edx, %edx
	jmp	.L2
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.p2align 4
	.globl	run
	.type	run, @function
run:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	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	$104, %rsp
	.cfi_def_cfa_offset 160
	movq	%fs:40, %rax
	movq	%rax, 88(%rsp)
	xorl	%eax, %eax
	leaq	80(%rsp), %rdx
	leaq	76(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %ebx
	movl	$8, %esi
	imull	$100, %ebx, %edi
	addl	$1, %edi
	movslq	%edi, %rdi
	call	calloc@PLT
	movq	%rax, %r15
	imull	$50, %ebx, %eax
	cltq
	movq	$1, (%r15,%rax,8)
	testl	%ebx, %ebx
	jle	.L19
	leaq	84(%rsp), %rax
	movl	$0, 4(%rsp)
	xorl	%r13d, %r13d
	xorl	%r12d, %r12d
	movq	%rax, 48(%rsp)
	leaq	8(%r15), %rax
	movl	$0, 32(%rsp)
	movq	%rax, 56(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	48(%rsp), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	76(%rsp), %rdx
	movl	80(%rsp), %ebx
	movl	84(%rsp), %eax
	movl	32(%rsp), %r8d
	imull	$100, %edx, %esi
	movq	%rdx, %r14
	movl	%ebx, 28(%rsp)
	movl	%eax, 24(%rsp)
	subl	%ebx, %eax
	imull	$50, %edx, %ecx
	leaq	(%rdx,%rdx,4), %rdx
	movl	%eax, %r10d
	movl	%r12d, %eax
	xorl	$1, %r12d
	movslq	%r13d, %rbx
	addl	$1, %esi
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rbx, 8(%rsp)
	subl	%r13d, %r8d
	imull	%esi, %eax
	leaq	(%rdx,%rdx), %rdi
	imull	%r12d, %esi
	addq	%rdi, %rbx
	movq	%rdi, 16(%rsp)
	movq	%rbx, %r9
	movslq	%esi, %rbp
	leaq	(%rbx,%rbp), %rdi
	movslq	%eax, %rbx
	addq	%rbx, %r9
	movq	%rbx, 40(%rsp)
	salq	$3, %rdi
	leaq	8(,%r9,8), %rbx
	cmpl	$2, %r8d
	jbe	.L3
	cmpq	%rbx, %rdi
	je	.L3
	leal	1(%r8), %edx
	leaq	-8(%r15,%rbx), %r11
	addq	%r15, %rdi
	movl	%edx, 36(%rsp)
	shrl	%edx
	movl	%edx, %r9d
	xorl	%edx, %edx
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	(%r11,%rdx), %xmm1
	movups	%xmm1, (%rdi,%rdx)
	addq	$16, %rdx
	cmpq	%r9, %rdx
	jne	.L4
	movl	36(%rsp), %r11d
	movl	%r11d, %edi
	andl	$-2, %edi
	leal	(%rdi,%r13), %edx
	cmpl	%edi, %r11d
	je	.L7
	leal	(%rax,%rdx), %edi
	addl	%esi, %edx
	addl	%ecx, %edi
	addl	%ecx, %edx
	movslq	%edi, %rdi
	movslq	%edx, %rdx
	movq	(%r15,%rdi,8), %rdi
	movq	%rdi, (%r15,%rdx,8)
.L7:
	movslq	28(%rsp), %rdi
	movq	16(%rsp), %rdx
	subq	%rdi, %rdx
	movslq	24(%rsp), %rdi
	addq	%rdi, %rdx
	addq	8(%rsp), %rdx
	addq	%rbp, %rdx
	salq	$3, %rdx
	cmpq	%rbx, %rdx
	je	.L8
	cmpl	$1, %r8d
	jbe	.L8
	addl	$1, %r8d
	addq	%r15, %rdx
	leaq	-8(%r15,%rbx), %r11
	xorl	%edi, %edi
	movl	%r8d, %r9d
	shrl	%r9d
	salq	$4, %r9
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	(%rdx,%rdi), %xmm0
	movdqu	(%r11,%rdi), %xmm2
	paddq	%xmm2, %xmm0
	movups	%xmm0, (%rdx,%rdi)
	addq	$16, %rdi
	cmpq	%rdi, %r9
	jne	.L9
	movl	%r8d, %edx
	andl	$-2, %edx
	leal	(%rdx,%r13), %edi
	cmpl	%edx, %r8d
	je	.L15
	leal	(%r10,%rdi), %edx
	addl	%edi, %eax
	addl	%esi, %edx
	addl	%ecx, %eax
	addl	%ecx, %edx
	cltq
	movslq	%edx, %rdx
	movq	(%r15,%rax,8), %rax
	addq	%rax, (%r15,%rdx,8)
.L15:
	testl	%r10d, %r10d
	js	.L41
	addl	%r10d, 32(%rsp)
.L16:
	addl	$1, 4(%rsp)
	movl	4(%rsp), %eax
	cmpl	%eax, %r14d
	jg	.L17
	imull	$100, %r14d, %eax
	movl	%r12d, %edx
	addl	$1, %eax
	imull	%eax, %edx
	imull	$50, %r14d, %eax
	addl	%edx, %eax
	cltq
	movq	(%r15,%rax,8), %rdx
	subq	$1, %rdx
.L2:
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	88(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$104, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
	.p2align 4,,10
	.p2align 3
.L41:
	.cfi_restore_state
	addl	%r10d, %r13d
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L8:
	movq	16(%rsp), %rcx
	movslq	%r10d, %rax
	movq	40(%rsp), %rsi
	movl	%r8d, %r8d
	movq	56(%rsp), %rbx
	addq	%rax, %rcx
	addq	8(%rsp), %rcx
	subq	%rax, %rsi
	addq	%rbp, %rcx
	movq	%rsi, %rax
	addq	%rcx, %r8
	leaq	(%r15,%rcx,8), %rdx
	subq	%rbp, %rax
	leaq	(%rbx,%r8,8), %rcx
	.p2align 4,,10
	.p2align 3
.L14:
	movq	(%rdx,%rax,8), %rsi
	addq	%rsi, (%rdx)
	addq	$8, %rdx
	cmpq	%rdx, %rcx
	jne	.L14
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L3:
	movq	56(%rsp), %r11
	movl	%r8d, %edi
	leaq	(%r15,%r9,8), %rdx
	addq	%r9, %rdi
	leaq	(%r11,%rdi,8), %r9
	movq	%rbp, %rdi
	subq	40(%rsp), %rdi
	.p2align 4,,10
	.p2align 3
.L6:
	movq	(%rdx), %r11
	movq	%r11, (%rdx,%rdi,8)
	addq	$8, %rdx
	cmpq	%rdx, %r9
	jne	.L6
	jmp	.L7
.L19:
	xorl	%edx, %edx
	jmp	.L2
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.size	run, .-run
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	call	run
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE40:
	.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:

#include<stdio.h>
#include<stdlib.h>

typedef long long int int64;

#define POS(i,j) ((i)*(2*50*n+1)+(j)+50*n)

void run(void){
  int n,a;
  scanf("%d%d",&n,&a);
  int64 *dp=(int64 *)calloc(2*50*n+1,sizeof(int64));
  int now=0;
  dp[POS(0,0)]=1;
  int l,r;
  l=r=0;
  int i,j;
  for(i=0;i<n;i++){
    int x;
    scanf("%d",&x);
    x-=a;
    int next=now^1;
    for(j=l;j<=r;j++) dp[POS(next,j)]=dp[POS(now,j)];
    for(j=l;j<=r;j++) dp[POS(next,j+x)]+=dp[POS(now,j)];
    if(x<0){
      l+=x;
    } else {
      r+=x;
    }
    now=next;
  }
  printf("%lld\n",dp[POS(now,0)]-1);
  return;
}

int main(void){
  run();
  return 0;
}

4 8
7 12 8 9
 3 8
9 6 9
 33 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3
 8 5
3 6 2 8 7 2 5 9
 3 8
15 6 9
 33 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3
 8 5
3 6 2 8 7 2 5 16
 33 3
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 1 0 3 3 3 3 3 3 3 3 3 3 1 3 3 3 3
 8 5
3 6 2 8 3 2 5 16
 8 8
3 6 2 8 3 2 5 16

3
 1
 4294967295
 25
 0
 2147483647
 17
 1073741823
 7
 9

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>

typedef long long int int64;

#define POS(i,j) ((i)*(2*50*n+1)+(j)+50*n)

void run(void){
  int n,a;
  scanf("%d%d",&n,&a);
  int64 *dp=(int64 *)calloc(2*50*n+1,sizeof(int64));
  int now=0;
  dp[POS(0,0)]=1;
  int l,r;
  l=r=0;
  int i,j;
  for(i=0;i<n;i++){
    int x;
    scanf("%d",&x);
    x-=a;
    int next=now^1;
    for(j=l;j<=r;j++) dp[POS(next,j)]=dp[POS(now,j)];
    for(j=l;j<=r;j++) dp[POS(next,j+x)]+=dp[POS(now,j)];
    if(x<0){
      l+=x;
    } else {
      r+=x;
    }
    now=next;
  }
  printf("%lld\n",dp[POS(now,0)]-1);
  return;
}

int main(void){
  run();
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -40(%rbp)
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, (%rax)
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L9:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	movl	-48(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	xorl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L3
.L4:
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %edx
	imull	$100, %edx, %edx
	addl	$1, %edx
	movl	%edx, %ecx
	imull	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	movl	-52(%rbp), %edx
	imull	$50, %edx, %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	addl	$1, -24(%rbp)
.L3:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L5
.L6:
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-20(%rbp), %eax
	movl	-44(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%ecx, %edx
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-20(%rbp), %eax
	movl	-44(%rbp), %edi
	movl	-24(%rbp), %esi
	addl	%edi, %esi
	addl	%eax, %esi
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L6
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jns	.L7
	movl	-44(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L8
.L7:
	movl	-44(%rbp), %eax
	addl	%eax, -32(%rbp)
.L8:
	movl	-20(%rbp), %eax
	movl	%eax, -40(%rbp)
	addl	$1, -28(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L9
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.text
	.globl	run
	.type	run, @function
run:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-48(%rbp), %rdx
	leaq	-52(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	cltq
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, -16(%rbp)
	movl	$0, -40(%rbp)
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	$1, (%rax)
	movl	$0, -32(%rbp)
	movl	-32(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	$0, -28(%rbp)
	jmp	.L2
.L9:
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	movl	-48(%rbp), %edx
	subl	%edx, %eax
	movl	%eax, -44(%rbp)
	movl	-40(%rbp), %eax
	xorl	$1, %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L3
.L4:
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movl	-52(%rbp), %edx
	imull	$100, %edx, %edx
	addl	$1, %edx
	movl	%edx, %ecx
	imull	-20(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%edx, %ecx
	movl	-52(%rbp), %edx
	imull	$50, %edx, %edx
	addl	%ecx, %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,8), %rcx
	movq	-16(%rbp), %rdx
	addq	%rcx, %rdx
	movq	(%rax), %rax
	movq	%rax, (%rdx)
	addl	$1, -24(%rbp)
.L3:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-36(%rbp), %eax
	movl	%eax, -24(%rbp)
	jmp	.L5
.L6:
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-20(%rbp), %eax
	movl	-44(%rbp), %ecx
	movl	-24(%rbp), %edx
	addl	%ecx, %edx
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rcx
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rdx
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-20(%rbp), %eax
	movl	-44(%rbp), %edi
	movl	-24(%rbp), %esi
	addl	%edi, %esi
	addl	%eax, %esi
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%esi, %eax
	cltq
	leaq	0(,%rax,8), %rsi
	movq	-16(%rbp), %rax
	addq	%rsi, %rax
	addq	%rcx, %rdx
	movq	%rdx, (%rax)
	addl	$1, -24(%rbp)
.L5:
	movl	-24(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L6
	movl	-44(%rbp), %eax
	testl	%eax, %eax
	jns	.L7
	movl	-44(%rbp), %eax
	addl	%eax, -36(%rbp)
	jmp	.L8
.L7:
	movl	-44(%rbp), %eax
	addl	%eax, -32(%rbp)
.L8:
	movl	-20(%rbp), %eax
	movl	%eax, -40(%rbp)
	addl	$1, -28(%rbp)
.L2:
	movl	-52(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L9
	movl	-52(%rbp), %eax
	imull	$100, %eax, %eax
	addl	$1, %eax
	imull	-40(%rbp), %eax
	movl	%eax, %edx
	movl	-52(%rbp), %eax
	imull	$50, %eax, %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	movq	-16(%rbp), %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	subq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	movq	-8(%rbp), %rax
	subq	%fs:40, %rax
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	run, .-run
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	call	run
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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:
