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

```c
long d[2][5001];A,x,i,j;main(n){for(scanf("%d%d",&n,&A),d[0][n*=A]=1;~scanf("%d",&x);i=!i)for(x-=A,j=2*n+1;j--;)d[!i][j]=d[i][j]+(j<x|j-x>2*n?0:d[i][j-x]);printf("%ld",d[i][n]-1);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80016
d:
	.zero	80016
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	-4(%rbp), %rax
	leaq	A(%rip), %rdx
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	$1, (%rdx,%rax)
	jmp	.L2
.L7:
	movl	x(%rip), %eax
	movl	A(%rip), %edx
	subl	%edx, %eax
	movl	%eax, x(%rip)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L3
.L6:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	j(%rip), %edx
	movl	x(%rip), %eax
	cmpl	%eax, %edx
	setge	%dil
	movl	j(%rip), %eax
	movl	x(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, %edx
	setle	%al
	andl	%edi, %eax
	testb	%al, %al
	je	.L4
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	x(%rip), %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rcx
	jmp	.L5
.L4:
	movl	$0, %ecx
.L5:
	movl	i(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	j(%rip), %edx
	addq	%rsi, %rcx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L3:
	movl	j(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, j(%rip)
	testl	%eax, %eax
	jne	.L6
	movl	i(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	x(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L7
	movl	i(%rip), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	$1, %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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	A(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	x(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	12(%rsp), %eax
	imull	A(%rip), %eax
	movl	%eax, 12(%rsp)
	cltq
	movq	$1, (%rbx,%rax,8)
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L16
	movslq	i(%rip), %r8
	movl	12(%rsp), %eax
	movl	x(%rip), %esi
	subl	A(%rip), %esi
	testl	%r8d, %r8d
	leal	(%rax,%rax), %r10d
	movl	%esi, x(%rip)
	movl	%esi, %r11d
	sete	%r9b
	sete	%r14b
	movslq	%r10d, %rcx
	notl	%r11d
	imulq	$5001, %r8, %rax
	movzbl	%r9b, %r9d
	movzbl	%r14b, %r14d
	imulq	$-40008, %r8, %r8
	imulq	$40008, %r9, %r9
	addq	%rcx, %rax
	leaq	(%rbx,%rax,8), %rdx
	movl	%r10d, %eax
	subl	%esi, %eax
	movslq	%eax, %r13
	subq	%rcx, %r13
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rax,%rsi), %edi
	movq	(%rdx), %rcx
	cmpl	%edi, %esi
	leaq	(%r8,%rdx), %rdi
	jg	.L3
	cmpl	%eax, %r10d
	jl	.L3
	addq	(%rdx,%r13,8), %rcx
	subl	$1, %eax
	subq	$8, %rdx
	movq	%rcx, (%rdi,%r9)
	cmpl	%eax, %r11d
	jne	.L6
.L5:
	movl	$-1, j(%rip)
	movl	%r14d, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	movq	%rcx, (%rdi,%r9)
	subq	$8, %rdx
	cmpl	%r11d, %eax
	jne	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	i(%rip), %rax
	movslq	12(%rsp), %rdx
	leaq	.LC2(%rip), %rdi
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	movq	(%rbx,%rax,8), %rsi
	xorl	%eax, %eax
	subq	$1, %rsi
	call	printf@PLT
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 80016
d:
	.zero	80016
	.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"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	A(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	x(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	d(%rip), %rbx
	subq	$16, %rsp
	.cfi_def_cfa_offset 64
	movl	%edi, 12(%rsp)
	leaq	12(%rsp), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	12(%rsp), %eax
	imull	A(%rip), %eax
	movl	%eax, 12(%rsp)
	cltq
	movq	$1, (%rbx,%rax,8)
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	scanf@PLT
	cmpl	$-1, %eax
	je	.L16
	movslq	i(%rip), %r8
	movl	12(%rsp), %eax
	movl	x(%rip), %esi
	subl	A(%rip), %esi
	testl	%r8d, %r8d
	leal	(%rax,%rax), %r10d
	movl	%esi, x(%rip)
	movl	%esi, %r11d
	sete	%r9b
	sete	%r14b
	movslq	%r10d, %rcx
	notl	%r11d
	imulq	$5001, %r8, %rax
	movzbl	%r9b, %r9d
	movzbl	%r14b, %r14d
	imulq	$-40008, %r8, %r8
	imulq	$40008, %r9, %r9
	addq	%rcx, %rax
	leaq	(%rbx,%rax,8), %rdx
	movl	%r10d, %eax
	subl	%esi, %eax
	movslq	%eax, %r13
	subq	%rcx, %r13
	.p2align 4,,10
	.p2align 3
.L6:
	leal	(%rax,%rsi), %edi
	movq	(%rdx), %rcx
	cmpl	%edi, %esi
	leaq	(%r8,%rdx), %rdi
	jg	.L3
	cmpl	%eax, %r10d
	jl	.L3
	addq	(%rdx,%r13,8), %rcx
	subl	$1, %eax
	subq	$8, %rdx
	movq	%rcx, (%rdi,%r9)
	cmpl	%eax, %r11d
	jne	.L6
.L5:
	movl	$-1, j(%rip)
	movl	%r14d, i(%rip)
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	subl	$1, %eax
	movq	%rcx, (%rdi,%r9)
	subq	$8, %rdx
	cmpl	%r11d, %eax
	jne	.L6
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L16:
	movslq	i(%rip), %rax
	movslq	12(%rsp), %rdx
	leaq	.LC2(%rip), %rdi
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	movq	(%rbx,%rax,8), %rsi
	xorl	%eax, %eax
	subq	$1, %rsi
	call	printf@PLT
	addq	$16, %rsp
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	j
	.bss
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 80016
d:
	.zero	80016
	.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:

long d[2][5001];A,x,i,j;main(n){for(scanf("%d%d",&n,&A),d[0][n*=A]=1;~scanf("%d",&x);i=!i)for(x-=A,j=2*n+1;j--;)d[!i][j]=d[i][j]+(j<x|j-x>2*n?0:d[i][j-x]);printf("%ld",d[i][n]-1);}
4 8
7 9 8 9

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

```c
long d[2][5001];A,x,i,j;main(n){for(scanf("%d%d",&n,&A),d[0][n*=A]=1;~scanf("%d",&x);i=!i)for(x-=A,j=2*n+1;j--;)d[!i][j]=d[i][j]+(j<x|j-x>2*n?0:d[i][j-x]);printf("%ld",d[i][n]-1);}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80016
d:
	.zero	80016
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	-4(%rbp), %rax
	leaq	A(%rip), %rdx
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	$1, (%rdx,%rax)
	jmp	.L2
.L7:
	movl	x(%rip), %eax
	movl	A(%rip), %edx
	subl	%edx, %eax
	movl	%eax, x(%rip)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L3
.L6:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	j(%rip), %edx
	movl	x(%rip), %eax
	cmpl	%eax, %edx
	setge	%dil
	movl	j(%rip), %eax
	movl	x(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, %edx
	setle	%al
	andl	%edi, %eax
	testb	%al, %al
	je	.L4
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	x(%rip), %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rcx
	jmp	.L5
.L4:
	movl	$0, %ecx
.L5:
	movl	i(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	j(%rip), %edx
	addq	%rsi, %rcx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L3:
	movl	j(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, j(%rip)
	testl	%eax, %eax
	jne	.L6
	movl	i(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	x(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L7
	movl	i(%rip), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	$1, %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	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 80016
d:
	.zero	80016
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	j
	.align 4
	.type	j, @object
	.size	j, 4
j:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%ld"
	.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	$16, %rsp
	movl	%edi, -4(%rbp)
	leaq	-4(%rbp), %rax
	leaq	A(%rip), %rdx
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-4(%rbp), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	$1, (%rdx,%rax)
	jmp	.L2
.L7:
	movl	x(%rip), %eax
	movl	A(%rip), %edx
	subl	%edx, %eax
	movl	%eax, x(%rip)
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	addl	$1, %eax
	movl	%eax, j(%rip)
	jmp	.L3
.L6:
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rsi
	movl	j(%rip), %edx
	movl	x(%rip), %eax
	cmpl	%eax, %edx
	setge	%dil
	movl	j(%rip), %eax
	movl	x(%rip), %ecx
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%eax, %eax
	cmpl	%eax, %edx
	setle	%al
	andl	%edi, %eax
	testb	%al, %al
	je	.L4
	movl	i(%rip), %eax
	movl	j(%rip), %edx
	movl	x(%rip), %ecx
	subl	%ecx, %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rcx
	jmp	.L5
.L4:
	movl	$0, %ecx
.L5:
	movl	i(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	j(%rip), %edx
	addq	%rsi, %rcx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	%rcx, (%rdx,%rax)
.L3:
	movl	j(%rip), %eax
	leal	-1(%rax), %edx
	movl	%edx, j(%rip)
	testl	%eax, %eax
	jne	.L6
	movl	i(%rip), %eax
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, i(%rip)
.L2:
	leaq	x(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	cmpl	$-1, %eax
	jne	.L7
	movl	i(%rip), %eax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	cltq
	imulq	$5001, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,8), %rdx
	leaq	d(%rip), %rax
	movq	(%rdx,%rax), %rax
	subq	$1, %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:
