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>
#define m(a,b)(a<b?a:b)
#define INF 999999999
int A,B,D,i,j;

int main()
{
	
	for(;scanf("%d%d%d",&A,&B,&D),A+B+D;)
	{
		int b1=INF,b2=INF,b3=INF,Ra=INF,Rb=INF,x;
		for(i=0;i<10000;i++)
		{
			b1=(i*A+D)%B==0?m((i*A+D)/B,b1):b1;
			b2=i*A-D>=0&&(i*A-D)%B==0?m((i*A-D)/B,b2):b2;
			b3=D-i*A>=0&&(D-A*i)%B==0?m((D-A*i)/B,b3):b3;
			x=m(b1,m(b2,b3));
			if(Ra+Rb>x+i||(Ra+Rb==x+i&&Ra*A+Rb*B>i*A+x*B))
			{
				Ra=i;
				Rb=x;
			}
		}
		printf("%d %d\n",Ra,Rb);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	A
	.bss
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.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\n"
.LC1:
	.string	"%d%d%d"
	.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	$32, %rsp
	jmp	.L2
.L13:
	movl	$999999999, -24(%rbp)
	movl	$999999999, -20(%rbp)
	movl	$999999999, -16(%rbp)
	movl	$999999999, -12(%rbp)
	movl	$999999999, -8(%rbp)
	movl	$0, i(%rip)
	jmp	.L3
.L12:
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L4
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	movl	B(%rip), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
.L5:
	movl	%eax, -24(%rbp)
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L6
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	movl	B(%rip), %edi
	cltd
	idivl	%edi
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
.L7:
	movl	%eax, -20(%rbp)
	movl	D(%rip), %eax
	movl	i(%rip), %ecx
	movl	A(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L8
	movl	D(%rip), %eax
	movl	A(%rip), %ecx
	movl	i(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	movl	D(%rip), %eax
	movl	A(%rip), %ecx
	movl	i(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	B(%rip), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L9
.L8:
	movl	-16(%rbp), %eax
.L9:
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	i(%rip), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jg	.L10
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	i(%rip), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jne	.L11
	movl	A(%rip), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %edx
	movl	B(%rip), %eax
	imull	-8(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	B(%rip), %eax
	imull	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L11
.L10:
	movl	i(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %eax
	cmpl	$9999, %eax
	jle	.L12
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	D(%rip), %rax
	movq	%rax, %rcx
	leaq	B(%rip), %rax
	movq	%rax, %rdx
	leaq	A(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	A(%rip), %edx
	movl	B(%rip), %eax
	addl	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L13
	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\n"
.LC1:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	D(%rip), %rcx
	leaq	B(%rip), %rdx
	leaq	A(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	A(%rip), %ebp
	movl	B(%rip), %edi
	movl	D(%rip), %ebx
	leal	0(%rbp,%rdi), %eax
	addl	%ebx, %eax
	je	.L14
	movl	%ebx, %esi
	movl	%ebx, %r11d
	xorl	%r8d, %r8d
	movl	$999999999, %r13d
	negl	%esi
	movl	$999999999, %r12d
	movl	$999999999, %ecx
	movl	$999999999, %r10d
	movl	$999999999, %r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	jne	.L6
	movl	%ebp, %r15d
	movl	%edi, %edx
	imull	%r13d, %edx
	imull	%r12d, %r15d
	addl	%edx, %r15d
	movl	%edi, %edx
	imull	%eax, %edx
	addl	%r14d, %edx
	cmpl	%edx, %r15d
	cmovg	%eax, %r13d
	cmovg	%r8d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %r8d
	subl	%ebp, %r11d
	addl	%ebp, %esi
	cmpl	$10000, %r8d
	je	.L15
.L7:
	leal	(%rsi,%rbx), %r14d
	leal	(%r14,%rbx), %eax
	cltd
	idivl	%edi
	cmpl	%eax, %ecx
	cmovle	%ecx, %eax
	testl	%edx, %edx
	cmove	%eax, %ecx
	testl	%esi, %esi
	js	.L4
	movl	%esi, %eax
	cltd
	idivl	%edi
	cmpl	%eax, %r9d
	cmovle	%r9d, %eax
	testl	%edx, %edx
	cmove	%eax, %r9d
.L4:
	testl	%r11d, %r11d
	js	.L5
	movl	%r11d, %eax
	cltd
	idivl	%edi
	cmpl	%eax, %r10d
	cmovle	%r10d, %eax
	testl	%edx, %edx
	cmove	%eax, %r10d
.L5:
	cmpl	%r9d, %ecx
	leal	(%r12,%r13), %r15d
	movl	%r9d, %eax
	cmovle	%ecx, %eax
	cmpl	%r10d, %eax
	cmovg	%r10d, %eax
	leal	(%rax,%r8), %edx
	cmpl	%edx, %r15d
	jle	.L16
	movl	%eax, %r13d
	movl	%r8d, %r12d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$10000, i(%rip)
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.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	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d\n"
.LC1:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	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	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L2:
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	D(%rip), %rcx
	leaq	B(%rip), %rdx
	leaq	A(%rip), %rsi
	call	__isoc99_scanf@PLT
	movl	A(%rip), %ebp
	movl	B(%rip), %edi
	movl	D(%rip), %ebx
	leal	0(%rbp,%rdi), %eax
	addl	%ebx, %eax
	je	.L14
	movl	%ebx, %esi
	movl	%ebx, %r11d
	xorl	%r8d, %r8d
	movl	$999999999, %r13d
	negl	%esi
	movl	$999999999, %r12d
	movl	$999999999, %ecx
	movl	$999999999, %r10d
	movl	$999999999, %r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	jne	.L6
	movl	%ebp, %r15d
	movl	%edi, %edx
	imull	%r13d, %edx
	imull	%r12d, %r15d
	addl	%edx, %r15d
	movl	%edi, %edx
	imull	%eax, %edx
	addl	%r14d, %edx
	cmpl	%edx, %r15d
	cmovg	%eax, %r13d
	cmovg	%r8d, %r12d
	.p2align 4,,10
	.p2align 3
.L6:
	addl	$1, %r8d
	subl	%ebp, %r11d
	addl	%ebp, %esi
	cmpl	$10000, %r8d
	je	.L15
.L7:
	leal	(%rsi,%rbx), %r14d
	leal	(%r14,%rbx), %eax
	cltd
	idivl	%edi
	cmpl	%eax, %ecx
	cmovle	%ecx, %eax
	testl	%edx, %edx
	cmove	%eax, %ecx
	testl	%esi, %esi
	js	.L4
	movl	%esi, %eax
	cltd
	idivl	%edi
	cmpl	%eax, %r9d
	cmovle	%r9d, %eax
	testl	%edx, %edx
	cmove	%eax, %r9d
.L4:
	testl	%r11d, %r11d
	js	.L5
	movl	%r11d, %eax
	cltd
	idivl	%edi
	cmpl	%eax, %r10d
	cmovle	%r10d, %eax
	testl	%edx, %edx
	cmove	%eax, %r10d
.L5:
	cmpl	%r9d, %ecx
	leal	(%r12,%r13), %r15d
	movl	%r9d, %eax
	cmovle	%ecx, %eax
	cmpl	%r10d, %eax
	cmovg	%r10d, %eax
	leal	(%rax,%r8), %edx
	cmpl	%edx, %r15d
	jle	.L16
	movl	%eax, %r13d
	movl	%r8d, %r12d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L15:
	movl	%r13d, %ecx
	movl	%r12d, %edx
	leaq	.LC0(%rip), %rsi
	xorl	%eax, %eax
	movl	$10000, i(%rip)
	movl	$1, %edi
	call	__printf_chk@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.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	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	A
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.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:

#include<stdio.h>
#define m(a,b)(a<b?a:b)
#define INF 999999999
int A,B,D,i,j;

int main()
{
	
	for(;scanf("%d%d%d",&A,&B,&D),A+B+D;)
	{
		int b1=INF,b2=INF,b3=INF,Ra=INF,Rb=INF,x;
		for(i=0;i<10000;i++)
		{
			b1=(i*A+D)%B==0?m((i*A+D)/B,b1):b1;
			b2=i*A-D>=0&&(i*A-D)%B==0?m((i*A-D)/B,b2):b2;
			b3=D-i*A>=0&&(D-A*i)%B==0?m((D-A*i)/B,b3):b3;
			x=m(b1,m(b2,b3));
			if(Ra+Rb>x+i||(Ra+Rb==x+i&&Ra*A+Rb*B>i*A+x*B))
			{
				Ra=i;
				Rb=x;
			}
		}
		printf("%d %d\n",Ra,Rb);
	}
	return 0;
}
700 300 200
500 200 300
500 200 500
275 110 330
275 010 385
648 375 4002
3 1 10000
0 0 0
 700 300 200
500 200 300
500 200 500
275 110 330
275 010 385
1067 375 4002
3 1 10000
0 0 0
 700 300 200
993 200 300
500 200 500
275 110 330
275 010 385
1067 375 4002
3 1 10000
0 0 0
 700 300 200
993 200 300
500 200 500
275 110 330
275 010 385
1067 375 4002
3 1 10010
0 0 0
 700 300 200
500 200 300
500 200 500
275 110 330
83 010 385
648 375 4002
3 1 10000
0 0 0
 700 300 200
500 200 300
908 200 500
275 110 330
275 010 385
1067 375 4002
3 1 10000
0 0 0
 700 300 200
500 200 300
908 200 500
275 110 330
275 010 385
1067 375 3628
3 1 10000
0 0 0
 700 300 200
500 200 300
908 200 500
275 110 330
275 010 385
1757 375 3628
3 1 10000
0 0 0
 700 188 200
500 200 300
500 200 500
275 110 330
275 110 385
648 375 4002
3 1 10000
0 0 0
 700 300 200
500 311 300
500 200 500
275 110 330
275 010 385
648 375 4002
3 1 10000
0 0 0

1 3
1 1
1 0
0 3
1 11
49 74
3333 1
 1 3
1 1
1 0
0 3
1 11
69 207
3333 1
 1 3
100 495
1 0
0 3
1 11
69 207
3333 1
 1 3
100 495
1 0
0 3
1 11
69 207
3336 2
 1 3
1 1
1 0
0 3
5 3
49 74
3333 1
 1 3
1 1
25 111
0 3
1 11
69 207
3333 1
 1 3
1 1
25 111
0 3
1 11
166 482
3333 1
 1 3
1 1
25 111
0 3
1 11
179 829
3333 1
 7 25
1 1
1 0
0 3
1 1
49 74
3333 1
 1 3
125 200
1 0
0 3
1 11
49 74
3333 1

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>
#define m(a,b)(a<b?a:b)
#define INF 999999999
int A,B,D,i,j;

int main()
{
	
	for(;scanf("%d%d%d",&A,&B,&D),A+B+D;)
	{
		int b1=INF,b2=INF,b3=INF,Ra=INF,Rb=INF,x;
		for(i=0;i<10000;i++)
		{
			b1=(i*A+D)%B==0?m((i*A+D)/B,b1):b1;
			b2=i*A-D>=0&&(i*A-D)%B==0?m((i*A-D)/B,b2):b2;
			b3=D-i*A>=0&&(D-A*i)%B==0?m((D-A*i)/B,b3):b3;
			x=m(b1,m(b2,b3));
			if(Ra+Rb>x+i||(Ra+Rb==x+i&&Ra*A+Rb*B>i*A+x*B))
			{
				Ra=i;
				Rb=x;
			}
		}
		printf("%d %d\n",Ra,Rb);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	A
	.bss
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.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\n"
.LC1:
	.string	"%d%d%d"
	.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	$32, %rsp
	jmp	.L2
.L13:
	movl	$999999999, -24(%rbp)
	movl	$999999999, -20(%rbp)
	movl	$999999999, -16(%rbp)
	movl	$999999999, -12(%rbp)
	movl	$999999999, -8(%rbp)
	movl	$0, i(%rip)
	jmp	.L3
.L12:
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L4
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	movl	B(%rip), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
.L5:
	movl	%eax, -24(%rbp)
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L6
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	movl	B(%rip), %edi
	cltd
	idivl	%edi
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
.L7:
	movl	%eax, -20(%rbp)
	movl	D(%rip), %eax
	movl	i(%rip), %ecx
	movl	A(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L8
	movl	D(%rip), %eax
	movl	A(%rip), %ecx
	movl	i(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	movl	D(%rip), %eax
	movl	A(%rip), %ecx
	movl	i(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	B(%rip), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L9
.L8:
	movl	-16(%rbp), %eax
.L9:
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	i(%rip), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jg	.L10
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	i(%rip), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jne	.L11
	movl	A(%rip), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %edx
	movl	B(%rip), %eax
	imull	-8(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	B(%rip), %eax
	imull	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L11
.L10:
	movl	i(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %eax
	cmpl	$9999, %eax
	jle	.L12
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	D(%rip), %rax
	movq	%rax, %rcx
	leaq	B(%rip), %rax
	movq	%rax, %rdx
	leaq	A(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	A(%rip), %edx
	movl	B(%rip), %eax
	addl	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L13
	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	A
	.bss
	.align 4
	.type	A, @object
	.size	A, 4
A:
	.zero	4
	.globl	B
	.align 4
	.type	B, @object
	.size	B, 4
B:
	.zero	4
	.globl	D
	.align 4
	.type	D, @object
	.size	D, 4
D:
	.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\n"
.LC1:
	.string	"%d%d%d"
	.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	$32, %rsp
	jmp	.L2
.L13:
	movl	$999999999, -24(%rbp)
	movl	$999999999, -20(%rbp)
	movl	$999999999, -16(%rbp)
	movl	$999999999, -12(%rbp)
	movl	$999999999, -8(%rbp)
	movl	$0, i(%rip)
	jmp	.L3
.L12:
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L4
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	movl	B(%rip), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L5
.L4:
	movl	-24(%rbp), %eax
.L5:
	movl	%eax, -24(%rbp)
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L6
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L6
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%edx, %eax
	movl	D(%rip), %edx
	subl	%edx, %eax
	movl	B(%rip), %edi
	cltd
	idivl	%edi
	movl	%eax, %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L7
.L6:
	movl	-20(%rbp), %eax
.L7:
	movl	%eax, -20(%rbp)
	movl	D(%rip), %eax
	movl	i(%rip), %ecx
	movl	A(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	testl	%eax, %eax
	js	.L8
	movl	D(%rip), %eax
	movl	A(%rip), %ecx
	movl	i(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	B(%rip), %ecx
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	jne	.L8
	movl	D(%rip), %eax
	movl	A(%rip), %ecx
	movl	i(%rip), %edx
	imull	%ecx, %edx
	subl	%edx, %eax
	movl	B(%rip), %esi
	cltd
	idivl	%esi
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	jmp	.L9
.L8:
	movl	-16(%rbp), %eax
.L9:
	movl	%eax, -16(%rbp)
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	-24(%rbp), %edx
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%eax, -4(%rbp)
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	i(%rip), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jg	.L10
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	i(%rip), %ecx
	movl	-4(%rbp), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jne	.L11
	movl	A(%rip), %eax
	imull	-12(%rbp), %eax
	movl	%eax, %edx
	movl	B(%rip), %eax
	imull	-8(%rbp), %eax
	leal	(%rdx,%rax), %ecx
	movl	i(%rip), %edx
	movl	A(%rip), %eax
	imull	%eax, %edx
	movl	B(%rip), %eax
	imull	-4(%rbp), %eax
	addl	%edx, %eax
	cmpl	%eax, %ecx
	jle	.L11
.L10:
	movl	i(%rip), %eax
	movl	%eax, -12(%rbp)
	movl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
.L11:
	movl	i(%rip), %eax
	addl	$1, %eax
	movl	%eax, i(%rip)
.L3:
	movl	i(%rip), %eax
	cmpl	$9999, %eax
	jle	.L12
	movl	-8(%rbp), %edx
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	D(%rip), %rax
	movq	%rax, %rcx
	leaq	B(%rip), %rax
	movq	%rax, %rdx
	leaq	A(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	A(%rip), %edx
	movl	B(%rip), %eax
	addl	%eax, %edx
	movl	D(%rip), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	jne	.L13
	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:
