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>
int main()
{
	int n, ma, mb;
	scanf("%d %d %d", &n, &ma, &mb);
	int i, j, k;
	int a[44], b[44], c[44];
	for (i = 0; i < n; i++)
		scanf("%d %d %d", &a[i], &b[i], &c[i]);
	int dp[2][402][402];
	for (j = 0; j < 402; j++)
		for (k = 0; k < 402; k++)
			dp[0][j][k] = dp[1][j][k] = 1000000009;
	dp[0][0][0] = dp[1][0][0] = 0;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < 402 - a[i]; j++)
			for (k = 0; k < 402 - b[i]; k++)
				if (dp[1][j + a[i]][k + b[i]] > dp[0][j][k] + c[i])
					dp[1][j + a[i]][k + b[i]] = dp[0][j][k] + c[i];
		for (j = 0; j < 402; j++)
			for (k = 0; k < 402; k++)
				dp[0][j][k] = dp[1][j][k];
	}
	int ans = 1000000009;
	for (i = 1; (ma * i < 402) && (mb * i < 402); i++)
		if (ans > dp[0][ma * i][mb * i])
			ans = dp[0][ma * i][mb * i];
	if (ans < 1000006)
		printf("%d\n", ans);
	else
		printf("-1\n");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
	.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
	leaq	-1290240(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3168, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1293396(%rbp), %rcx
	leaq	-1293400(%rbp), %rdx
	leaq	-1293404(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1293392(%rbp)
	jmp	.L2
.L3:
	leaq	-1293024(%rbp), %rdx
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-1293200(%rbp), %rdx
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1293376(%rbp), %rsi
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1293392(%rbp)
.L2:
	movl	-1293404(%rbp), %eax
	cmpl	%eax, -1293392(%rbp)
	jl	.L3
	movl	$0, -1293388(%rbp)
	jmp	.L4
.L7:
	movl	$0, -1293384(%rbp)
	jmp	.L5
.L6:
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	$1000000009, -1292848(%rbp,%rax,4)
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	-1293384(%rbp), %edx
	movslq	%edx, %rcx
	movl	-1293388(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$402, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -1292848(%rbp,%rdx,4)
	addl	$1, -1293384(%rbp)
.L5:
	cmpl	$401, -1293384(%rbp)
	jle	.L6
	addl	$1, -1293388(%rbp)
.L4:
	cmpl	$401, -1293388(%rbp)
	jle	.L7
	movl	$0, -646432(%rbp)
	movl	-646432(%rbp), %eax
	movl	%eax, -1292848(%rbp)
	movl	$0, -1293392(%rbp)
	jmp	.L8
.L18:
	movl	$0, -1293388(%rbp)
	jmp	.L9
.L13:
	movl	$0, -1293384(%rbp)
	jmp	.L10
.L12:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %edx
	movl	-1293388(%rbp), %eax
	addl	%eax, %edx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %ecx
	movl	-1293384(%rbp), %eax
	addl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %edx
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %ecx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293024(%rbp,%rax,4), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	movl	-1292848(%rbp,%rax,4), %esi
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293024(%rbp,%rax,4), %edx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %ecx
	movl	-1293388(%rbp), %eax
	addl	%eax, %ecx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %edi
	movl	-1293384(%rbp), %eax
	addl	%edi, %eax
	addl	%esi, %edx
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	addq	%rsi, %rax
	addq	$161604, %rax
	movl	%edx, -1292848(%rbp,%rax,4)
.L11:
	addl	$1, -1293384(%rbp)
.L10:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %edx
	movl	$402, %eax
	subl	%edx, %eax
	cmpl	%eax, -1293384(%rbp)
	jl	.L12
	addl	$1, -1293388(%rbp)
.L9:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %edx
	movl	$402, %eax
	subl	%edx, %eax
	cmpl	%eax, -1293388(%rbp)
	jl	.L13
	movl	$0, -1293388(%rbp)
	jmp	.L14
.L17:
	movl	$0, -1293384(%rbp)
	jmp	.L15
.L16:
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	-1293384(%rbp), %edx
	movslq	%edx, %rcx
	movl	-1293388(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$402, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -1292848(%rbp,%rdx,4)
	addl	$1, -1293384(%rbp)
.L15:
	cmpl	$401, -1293384(%rbp)
	jle	.L16
	addl	$1, -1293388(%rbp)
.L14:
	cmpl	$401, -1293388(%rbp)
	jle	.L17
	addl	$1, -1293392(%rbp)
.L8:
	movl	-1293404(%rbp), %eax
	cmpl	%eax, -1293392(%rbp)
	jl	.L18
	movl	$1000000009, -1293380(%rbp)
	movl	$1, -1293392(%rbp)
	jmp	.L19
.L22:
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movl	%eax, %edx
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	cmpl	%eax, -1293380(%rbp)
	jle	.L20
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movl	%eax, %edx
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	%eax, -1293380(%rbp)
.L20:
	addl	$1, -1293392(%rbp)
.L19:
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	cmpl	$401, %eax
	jg	.L21
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	cmpl	$401, %eax
	jle	.L22
.L21:
	cmpl	$1000005, -1293380(%rbp)
	jg	.L23
	movl	-1293380(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L24:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	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 %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"-1"
	.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
	leaq	-1290240(%rsp), %r11
	.cfi_def_cfa 11, 1290296
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3224, %rsp
	.cfi_def_cfa_offset 1293520
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1293448(%rsp)
	xorl	%eax, %eax
	leaq	68(%rsp), %rsi
	leaq	76(%rsp), %rcx
	leaq	72(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %esi
	testl	%esi, %esi
	jle	.L2
	leaq	80(%rsp), %rax
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movq	%rax, 8(%rsp)
	leaq	432(%rsp), %r14
	leaq	256(%rsp), %r13
.L3:
	movq	8(%rsp), %rax
	leaq	(%r14,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %ebp
	leaq	0(%r13,%rbx), %rdx
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %esi
	cmpl	%ebp, %esi
	jg	.L3
.L2:
	leaq	608(%rsp), %r15
	movq	.LC1(%rip), %rdi
	movdqa	.LC2(%rip), %xmm0
	leaq	647024(%rsp), %r13
	movq	%r15, %rdx
.L4:
	leaq	646416(%rdx), %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rcx,%rax)
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	$1600, %rax
	jne	.L6
	movq	%rdi, 648016(%rdx)
	addq	$1608, %rdx
	movq	%rdi, -8(%rdx)
	cmpq	%r13, %rdx
	jne	.L4
	movl	$0, 647024(%rsp)
	movl	$0, 608(%rsp)
	testl	%esi, %esi
	jle	.L8
	movslq	%esi, %rax
	xorl	%r12d, %r12d
	movq	%rax, 40(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
.L9:
	movq	8(%rsp), %rax
	movl	(%rax,%r12,4), %ebx
	movl	$402, %eax
	subl	%ebx, %eax
	movl	%eax, 28(%rsp)
	testl	%eax, %eax
	jle	.L14
	movl	256(%rsp,%r12,4), %r9d
	movl	$402, %r8d
	subl	%r9d, %r8d
	testl	%r8d, %r8d
	jle	.L14
	movl	$401, %eax
	movslq	%r9d, %rdx
	movl	%r8d, %edi
	xorl	%r10d, %r10d
	subl	%r9d, %eax
	leaq	432(%rsp), %rsi
	andl	$-4, %edi
	movl	%eax, 32(%rsp)
	movslq	%ebx, %rax
	imulq	$402, %rax, %rax
	movq	%rsi, 56(%rsp)
	movl	%edi, 36(%rsp)
	movq	%r15, %rdi
	addq	%rdx, %rax
	movl	%r8d, %edx
	shrl	$2, %edx
	leaq	646416(,%rax,4), %rax
	subl	$1, %edx
	movq	%rax, 48(%rsp)
	addq	$1, %rdx
	salq	$4, %rdx
	movq	%rdx, 16(%rsp)
.L13:
	movq	56(%rsp), %rax
	cmpl	$2, 32(%rsp)
	leal	(%rbx,%r10), %esi
	movl	(%rax,%r12,4), %edx
	jbe	.L25
	movq	48(%rsp), %rax
	movd	%edx, %xmm5
	movq	16(%rsp), %r14
	pshufd	$0, %xmm5, %xmm3
	leaq	(%rax,%rdi), %rcx
	xorl	%eax, %eax
.L11:
	movdqu	(%rdi,%rax), %xmm2
	movdqu	(%rcx,%rax), %xmm4
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%rax, %r14
	jne	.L11
	movl	36(%rsp), %eax
	movq	%r14, 16(%rsp)
	cmpl	%eax, %r8d
	je	.L12
.L10:
	movslq	%esi, %rsi
	leal	(%r9,%rax), %ecx
	movslq	%eax, %r11
	imulq	$402, %rsi, %rsi
	movslq	%ecx, %rcx
	leaq	161604(%rcx,%rsi), %rbp
	movslq	%r10d, %rcx
	imulq	$402, %rcx, %rcx
	addq	%rcx, %r11
	movl	608(%rsp,%r11,4), %r14d
	addl	%edx, %r14d
	cmpl	608(%rsp,%rbp,4), %r14d
	movl	%r14d, %r11d
	cmovg	608(%rsp,%rbp,4), %r11d
	movl	%r11d, 608(%rsp,%rbp,4)
	leal	1(%rax), %r11d
	cmpl	%r11d, %r8d
	jle	.L12
	leal	(%r9,%r11), %ebp
	movslq	%r11d, %r11
	addq	%rcx, %r11
	movslq	%ebp, %rbp
	movl	608(%rsp,%r11,4), %r14d
	leaq	161604(%rsi,%rbp), %rbp
	addl	%edx, %r14d
	cmpl	608(%rsp,%rbp,4), %r14d
	movl	%r14d, %r11d
	cmovg	608(%rsp,%rbp,4), %r11d
	addl	$2, %eax
	movl	%r11d, 608(%rsp,%rbp,4)
	cmpl	%eax, %r8d
	jle	.L12
	leal	(%r9,%rax), %r11d
	cltq
	movslq	%r11d, %r11
	addq	%rax, %rcx
	leaq	161604(%rsi,%r11), %rsi
	addl	608(%rsp,%rcx,4), %edx
	movl	608(%rsp,%rsi,4), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	%edx, 608(%rsp,%rsi,4)
.L12:
	addl	$1, %r10d
	addq	$1608, %rdi
	cmpl	%r10d, 28(%rsp)
	jne	.L13
.L14:
	movl	$646416, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	addq	$1, %r12
	call	memcpy@PLT
	cmpq	40(%rsp), %r12
	jne	.L9
.L8:
	movl	72(%rsp), %eax
	cmpl	$401, %eax
	jg	.L16
	movslq	76(%rsp), %rcx
	cmpl	$401, %ecx
	jg	.L16
	cmpl	$1, %ecx
	jne	.L40
	movslq	%eax, %r8
	addl	%eax, %eax
	movl	$401, %edi
	movl	$1000000009, %edx
	imulq	$1608, %r8, %rsi
	cltq
	addq	$4, %rsi
	leaq	(%r15,%rsi), %rcx
	jmp	.L21
.L41:
	addq	%r8, %rax
	addq	%rsi, %rcx
	subl	$1, %edi
	je	.L20
.L21:
	movl	(%rcx), %r9d
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	cmpl	$401, %eax
	jle	.L41
.L20:
	cmpl	$1000005, %edx
	jg	.L16
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L25:
	xorl	%eax, %eax
	jmp	.L10
.L16:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
.L23:
	movq	1293448(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$1293464, %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
.L40:
	.cfi_restore_state
	movslq	%eax, %r9
	addl	%eax, %eax
	movq	%rcx, %rdi
	movl	$1000000009, %edx
	imulq	$402, %r9, %rsi
	cltq
	addq	%rcx, %rsi
	salq	$2, %rsi
	leaq	(%r15,%rsi), %r8
	jmp	.L19
.L43:
	addq	%rcx, %rdi
	addq	%r9, %rax
	addq	%rsi, %r8
	cmpl	$401, %edi
	jg	.L20
.L19:
	movl	(%r8), %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	cmpl	$401, %eax
	jle	.L43
	jmp	.L20
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.set	.LC1,.LC2
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1000000009
	.long	1000000009
	.long	1000000009
	.long	1000000009
	.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 %d"
.LC3:
	.string	"%d\n"
.LC4:
	.string	"-1"
	.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
	leaq	-1290240(%rsp), %r11
	.cfi_def_cfa 11, 1290296
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3224, %rsp
	.cfi_def_cfa_offset 1293520
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 1293448(%rsp)
	xorl	%eax, %eax
	leaq	68(%rsp), %rsi
	leaq	76(%rsp), %rcx
	leaq	72(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %esi
	testl	%esi, %esi
	jle	.L2
	leaq	80(%rsp), %rax
	xorl	%ebx, %ebx
	xorl	%ebp, %ebp
	movq	%rax, 8(%rsp)
	leaq	432(%rsp), %r14
	leaq	256(%rsp), %r13
.L3:
	movq	8(%rsp), %rax
	leaq	(%r14,%rbx), %rcx
	movq	%r12, %rdi
	addl	$1, %ebp
	leaq	0(%r13,%rbx), %rdx
	leaq	(%rax,%rbx), %rsi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__isoc99_scanf@PLT
	movl	68(%rsp), %esi
	cmpl	%ebp, %esi
	jg	.L3
.L2:
	leaq	608(%rsp), %r15
	movq	.LC1(%rip), %rdi
	movdqa	.LC2(%rip), %xmm0
	leaq	647024(%rsp), %r13
	movq	%r15, %rdx
.L4:
	leaq	646416(%rdx), %rcx
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L6:
	movups	%xmm0, (%rcx,%rax)
	movups	%xmm0, (%rdx,%rax)
	addq	$16, %rax
	cmpq	$1600, %rax
	jne	.L6
	movq	%rdi, 648016(%rdx)
	addq	$1608, %rdx
	movq	%rdi, -8(%rdx)
	cmpq	%r13, %rdx
	jne	.L4
	movl	$0, 647024(%rsp)
	movl	$0, 608(%rsp)
	testl	%esi, %esi
	jle	.L8
	movslq	%esi, %rax
	xorl	%r12d, %r12d
	movq	%rax, 40(%rsp)
	leaq	80(%rsp), %rax
	movq	%rax, 8(%rsp)
.L9:
	movq	8(%rsp), %rax
	movl	(%rax,%r12,4), %ebx
	movl	$402, %eax
	subl	%ebx, %eax
	movl	%eax, 28(%rsp)
	testl	%eax, %eax
	jle	.L14
	movl	256(%rsp,%r12,4), %r9d
	movl	$402, %r8d
	subl	%r9d, %r8d
	testl	%r8d, %r8d
	jle	.L14
	movl	$401, %eax
	movslq	%r9d, %rdx
	movl	%r8d, %edi
	xorl	%r10d, %r10d
	subl	%r9d, %eax
	leaq	432(%rsp), %rsi
	andl	$-4, %edi
	movl	%eax, 32(%rsp)
	movslq	%ebx, %rax
	imulq	$402, %rax, %rax
	movq	%rsi, 56(%rsp)
	movl	%edi, 36(%rsp)
	movq	%r15, %rdi
	addq	%rdx, %rax
	movl	%r8d, %edx
	shrl	$2, %edx
	leaq	646416(,%rax,4), %rax
	subl	$1, %edx
	movq	%rax, 48(%rsp)
	addq	$1, %rdx
	salq	$4, %rdx
	movq	%rdx, 16(%rsp)
.L13:
	movq	56(%rsp), %rax
	cmpl	$2, 32(%rsp)
	leal	(%rbx,%r10), %esi
	movl	(%rax,%r12,4), %edx
	jbe	.L25
	movq	48(%rsp), %rax
	movd	%edx, %xmm5
	movq	16(%rsp), %r14
	pshufd	$0, %xmm5, %xmm3
	leaq	(%rax,%rdi), %rcx
	xorl	%eax, %eax
.L11:
	movdqu	(%rdi,%rax), %xmm2
	movdqu	(%rcx,%rax), %xmm4
	paddd	%xmm3, %xmm2
	movdqa	%xmm4, %xmm1
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm4, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movups	%xmm0, (%rcx,%rax)
	addq	$16, %rax
	cmpq	%rax, %r14
	jne	.L11
	movl	36(%rsp), %eax
	movq	%r14, 16(%rsp)
	cmpl	%eax, %r8d
	je	.L12
.L10:
	movslq	%esi, %rsi
	leal	(%r9,%rax), %ecx
	movslq	%eax, %r11
	imulq	$402, %rsi, %rsi
	movslq	%ecx, %rcx
	leaq	161604(%rcx,%rsi), %rbp
	movslq	%r10d, %rcx
	imulq	$402, %rcx, %rcx
	addq	%rcx, %r11
	movl	608(%rsp,%r11,4), %r14d
	addl	%edx, %r14d
	cmpl	608(%rsp,%rbp,4), %r14d
	movl	%r14d, %r11d
	cmovg	608(%rsp,%rbp,4), %r11d
	movl	%r11d, 608(%rsp,%rbp,4)
	leal	1(%rax), %r11d
	cmpl	%r11d, %r8d
	jle	.L12
	leal	(%r9,%r11), %ebp
	movslq	%r11d, %r11
	addq	%rcx, %r11
	movslq	%ebp, %rbp
	movl	608(%rsp,%r11,4), %r14d
	leaq	161604(%rsi,%rbp), %rbp
	addl	%edx, %r14d
	cmpl	608(%rsp,%rbp,4), %r14d
	movl	%r14d, %r11d
	cmovg	608(%rsp,%rbp,4), %r11d
	addl	$2, %eax
	movl	%r11d, 608(%rsp,%rbp,4)
	cmpl	%eax, %r8d
	jle	.L12
	leal	(%r9,%rax), %r11d
	cltq
	movslq	%r11d, %r11
	addq	%rax, %rcx
	leaq	161604(%rsi,%r11), %rsi
	addl	608(%rsp,%rcx,4), %edx
	movl	608(%rsp,%rsi,4), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	%edx, 608(%rsp,%rsi,4)
.L12:
	addl	$1, %r10d
	addq	$1608, %rdi
	cmpl	%r10d, 28(%rsp)
	jne	.L13
.L14:
	movl	$646416, %edx
	movq	%r13, %rsi
	movq	%r15, %rdi
	addq	$1, %r12
	call	memcpy@PLT
	cmpq	40(%rsp), %r12
	jne	.L9
.L8:
	movl	72(%rsp), %eax
	cmpl	$401, %eax
	jg	.L16
	movslq	76(%rsp), %rcx
	cmpl	$401, %ecx
	jg	.L16
	cmpl	$1, %ecx
	jne	.L40
	movslq	%eax, %r8
	addl	%eax, %eax
	movl	$401, %edi
	movl	$1000000009, %edx
	imulq	$1608, %r8, %rsi
	cltq
	addq	$4, %rsi
	leaq	(%r15,%rsi), %rcx
	jmp	.L21
.L41:
	addq	%r8, %rax
	addq	%rsi, %rcx
	subl	$1, %edi
	je	.L20
.L21:
	movl	(%rcx), %r9d
	cmpl	%r9d, %edx
	cmovg	%r9d, %edx
	cmpl	$401, %eax
	jle	.L41
.L20:
	cmpl	$1000005, %edx
	jg	.L16
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L25:
	xorl	%eax, %eax
	jmp	.L10
.L16:
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
.L23:
	movq	1293448(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$1293464, %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
.L40:
	.cfi_restore_state
	movslq	%eax, %r9
	addl	%eax, %eax
	movq	%rcx, %rdi
	movl	$1000000009, %edx
	imulq	$402, %r9, %rsi
	cltq
	addq	%rcx, %rsi
	salq	$2, %rsi
	leaq	(%r15,%rsi), %r8
	jmp	.L19
.L43:
	addq	%rcx, %rdi
	addq	%r9, %rax
	addq	%rsi, %r8
	cmpl	$401, %edi
	jg	.L20
.L19:
	movl	(%r8), %r10d
	cmpl	%r10d, %edx
	cmovg	%r10d, %edx
	cmpl	$401, %eax
	jle	.L43
	jmp	.L20
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.set	.LC1,.LC2
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1000000009
	.long	1000000009
	.long	1000000009
	.long	1000000009
	.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>
int main()
{
	int n, ma, mb;
	scanf("%d %d %d", &n, &ma, &mb);
	int i, j, k;
	int a[44], b[44], c[44];
	for (i = 0; i < n; i++)
		scanf("%d %d %d", &a[i], &b[i], &c[i]);
	int dp[2][402][402];
	for (j = 0; j < 402; j++)
		for (k = 0; k < 402; k++)
			dp[0][j][k] = dp[1][j][k] = 1000000009;
	dp[0][0][0] = dp[1][0][0] = 0;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < 402 - a[i]; j++)
			for (k = 0; k < 402 - b[i]; k++)
				if (dp[1][j + a[i]][k + b[i]] > dp[0][j][k] + c[i])
					dp[1][j + a[i]][k + b[i]] = dp[0][j][k] + c[i];
		for (j = 0; j < 402; j++)
			for (k = 0; k < 402; k++)
				dp[0][j][k] = dp[1][j][k];
	}
	int ans = 1000000009;
	for (i = 1; (ma * i < 402) && (mb * i < 402); i++)
		if (ans > dp[0][ma * i][mb * i])
			ans = dp[0][ma * i][mb * i];
	if (ans < 1000006)
		printf("%d\n", ans);
	else
		printf("-1\n");
	return 0;
}
1 0 10
10 10 10
 3 1 1
1 2 2
2 1 2
3 3 10
 3 1 1
1 2 2
2 1 4
0 3 16
 3 1 1
1 2 1
2 0 2
3 3 10
 3 1 2
0 2 2
2 1 2
0 3 16
 3 1 1
1 2 2
2 1 5
0 3 16
 3 1 1
1 2 1
2 0 2
3 5 10
 3 2 1
1 2 4
2 1 2
3 3 10
 3 1 1
2 0 2
2 1 2
0 3 10
 3 1 1
1 2 1
3 0 2
3 5 10

-1
 4
 6
 10
 18
 7
 12
 2
 14
 13

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>
int main()
{
	int n, ma, mb;
	scanf("%d %d %d", &n, &ma, &mb);
	int i, j, k;
	int a[44], b[44], c[44];
	for (i = 0; i < n; i++)
		scanf("%d %d %d", &a[i], &b[i], &c[i]);
	int dp[2][402][402];
	for (j = 0; j < 402; j++)
		for (k = 0; k < 402; k++)
			dp[0][j][k] = dp[1][j][k] = 1000000009;
	dp[0][0][0] = dp[1][0][0] = 0;
	for (i = 0; i < n; i++)
	{
		for (j = 0; j < 402 - a[i]; j++)
			for (k = 0; k < 402 - b[i]; k++)
				if (dp[1][j + a[i]][k + b[i]] > dp[0][j][k] + c[i])
					dp[1][j + a[i]][k + b[i]] = dp[0][j][k] + c[i];
		for (j = 0; j < 402; j++)
			for (k = 0; k < 402; k++)
				dp[0][j][k] = dp[1][j][k];
	}
	int ans = 1000000009;
	for (i = 1; (ma * i < 402) && (mb * i < 402); i++)
		if (ans > dp[0][ma * i][mb * i])
			ans = dp[0][ma * i][mb * i];
	if (ans < 1000006)
		printf("%d\n", ans);
	else
		printf("-1\n");
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
	.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
	leaq	-1290240(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3168, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1293396(%rbp), %rcx
	leaq	-1293400(%rbp), %rdx
	leaq	-1293404(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1293392(%rbp)
	jmp	.L2
.L3:
	leaq	-1293024(%rbp), %rdx
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-1293200(%rbp), %rdx
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1293376(%rbp), %rsi
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1293392(%rbp)
.L2:
	movl	-1293404(%rbp), %eax
	cmpl	%eax, -1293392(%rbp)
	jl	.L3
	movl	$0, -1293388(%rbp)
	jmp	.L4
.L7:
	movl	$0, -1293384(%rbp)
	jmp	.L5
.L6:
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	$1000000009, -1292848(%rbp,%rax,4)
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	-1293384(%rbp), %edx
	movslq	%edx, %rcx
	movl	-1293388(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$402, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -1292848(%rbp,%rdx,4)
	addl	$1, -1293384(%rbp)
.L5:
	cmpl	$401, -1293384(%rbp)
	jle	.L6
	addl	$1, -1293388(%rbp)
.L4:
	cmpl	$401, -1293388(%rbp)
	jle	.L7
	movl	$0, -646432(%rbp)
	movl	-646432(%rbp), %eax
	movl	%eax, -1292848(%rbp)
	movl	$0, -1293392(%rbp)
	jmp	.L8
.L18:
	movl	$0, -1293388(%rbp)
	jmp	.L9
.L13:
	movl	$0, -1293384(%rbp)
	jmp	.L10
.L12:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %edx
	movl	-1293388(%rbp), %eax
	addl	%eax, %edx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %ecx
	movl	-1293384(%rbp), %eax
	addl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %edx
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %ecx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293024(%rbp,%rax,4), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	movl	-1292848(%rbp,%rax,4), %esi
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293024(%rbp,%rax,4), %edx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %ecx
	movl	-1293388(%rbp), %eax
	addl	%eax, %ecx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %edi
	movl	-1293384(%rbp), %eax
	addl	%edi, %eax
	addl	%esi, %edx
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	addq	%rsi, %rax
	addq	$161604, %rax
	movl	%edx, -1292848(%rbp,%rax,4)
.L11:
	addl	$1, -1293384(%rbp)
.L10:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %edx
	movl	$402, %eax
	subl	%edx, %eax
	cmpl	%eax, -1293384(%rbp)
	jl	.L12
	addl	$1, -1293388(%rbp)
.L9:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %edx
	movl	$402, %eax
	subl	%edx, %eax
	cmpl	%eax, -1293388(%rbp)
	jl	.L13
	movl	$0, -1293388(%rbp)
	jmp	.L14
.L17:
	movl	$0, -1293384(%rbp)
	jmp	.L15
.L16:
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	-1293384(%rbp), %edx
	movslq	%edx, %rcx
	movl	-1293388(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$402, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -1292848(%rbp,%rdx,4)
	addl	$1, -1293384(%rbp)
.L15:
	cmpl	$401, -1293384(%rbp)
	jle	.L16
	addl	$1, -1293388(%rbp)
.L14:
	cmpl	$401, -1293388(%rbp)
	jle	.L17
	addl	$1, -1293392(%rbp)
.L8:
	movl	-1293404(%rbp), %eax
	cmpl	%eax, -1293392(%rbp)
	jl	.L18
	movl	$1000000009, -1293380(%rbp)
	movl	$1, -1293392(%rbp)
	jmp	.L19
.L22:
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movl	%eax, %edx
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	cmpl	%eax, -1293380(%rbp)
	jle	.L20
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movl	%eax, %edx
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	%eax, -1293380(%rbp)
.L20:
	addl	$1, -1293392(%rbp)
.L19:
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	cmpl	$401, %eax
	jg	.L21
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	cmpl	$401, %eax
	jle	.L22
.L21:
	cmpl	$1000005, -1293380(%rbp)
	jg	.L23
	movl	-1293380(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L24:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	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
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
.LC2:
	.string	"-1"
	.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
	leaq	-1290240(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3168, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1293396(%rbp), %rcx
	leaq	-1293400(%rbp), %rdx
	leaq	-1293404(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1293392(%rbp)
	jmp	.L2
.L3:
	leaq	-1293024(%rbp), %rdx
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-1293200(%rbp), %rdx
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1293376(%rbp), %rsi
	movl	-1293392(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -1293392(%rbp)
.L2:
	movl	-1293404(%rbp), %eax
	cmpl	%eax, -1293392(%rbp)
	jl	.L3
	movl	$0, -1293388(%rbp)
	jmp	.L4
.L7:
	movl	$0, -1293384(%rbp)
	jmp	.L5
.L6:
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	$1000000009, -1292848(%rbp,%rax,4)
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	-1293384(%rbp), %edx
	movslq	%edx, %rcx
	movl	-1293388(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$402, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -1292848(%rbp,%rdx,4)
	addl	$1, -1293384(%rbp)
.L5:
	cmpl	$401, -1293384(%rbp)
	jle	.L6
	addl	$1, -1293388(%rbp)
.L4:
	cmpl	$401, -1293388(%rbp)
	jle	.L7
	movl	$0, -646432(%rbp)
	movl	-646432(%rbp), %eax
	movl	%eax, -1292848(%rbp)
	movl	$0, -1293392(%rbp)
	jmp	.L8
.L18:
	movl	$0, -1293388(%rbp)
	jmp	.L9
.L13:
	movl	$0, -1293384(%rbp)
	jmp	.L10
.L12:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %edx
	movl	-1293388(%rbp), %eax
	addl	%eax, %edx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %ecx
	movl	-1293384(%rbp), %eax
	addl	%ecx, %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %edx
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rcx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %ecx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293024(%rbp,%rax,4), %eax
	addl	%ecx, %eax
	cmpl	%eax, %edx
	jle	.L11
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	movl	-1292848(%rbp,%rax,4), %esi
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293024(%rbp,%rax,4), %edx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %ecx
	movl	-1293388(%rbp), %eax
	addl	%eax, %ecx
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %edi
	movl	-1293384(%rbp), %eax
	addl	%edi, %eax
	addl	%esi, %edx
	movslq	%eax, %rsi
	movslq	%ecx, %rax
	imulq	$402, %rax, %rax
	addq	%rsi, %rax
	addq	$161604, %rax
	movl	%edx, -1292848(%rbp,%rax,4)
.L11:
	addl	$1, -1293384(%rbp)
.L10:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293200(%rbp,%rax,4), %edx
	movl	$402, %eax
	subl	%edx, %eax
	cmpl	%eax, -1293384(%rbp)
	jl	.L12
	addl	$1, -1293388(%rbp)
.L9:
	movl	-1293392(%rbp), %eax
	cltq
	movl	-1293376(%rbp,%rax,4), %edx
	movl	$402, %eax
	subl	%edx, %eax
	cmpl	%eax, -1293388(%rbp)
	jl	.L13
	movl	$0, -1293388(%rbp)
	jmp	.L14
.L17:
	movl	$0, -1293384(%rbp)
	jmp	.L15
.L16:
	movl	-1293384(%rbp), %eax
	movslq	%eax, %rdx
	movl	-1293388(%rbp), %eax
	cltq
	imulq	$402, %rax, %rax
	addq	%rdx, %rax
	addq	$161604, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	-1293384(%rbp), %edx
	movslq	%edx, %rcx
	movl	-1293388(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$402, %rdx, %rdx
	addq	%rcx, %rdx
	movl	%eax, -1292848(%rbp,%rdx,4)
	addl	$1, -1293384(%rbp)
.L15:
	cmpl	$401, -1293384(%rbp)
	jle	.L16
	addl	$1, -1293388(%rbp)
.L14:
	cmpl	$401, -1293388(%rbp)
	jle	.L17
	addl	$1, -1293392(%rbp)
.L8:
	movl	-1293404(%rbp), %eax
	cmpl	%eax, -1293392(%rbp)
	jl	.L18
	movl	$1000000009, -1293380(%rbp)
	movl	$1, -1293392(%rbp)
	jmp	.L19
.L22:
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movl	%eax, %edx
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	cmpl	%eax, -1293380(%rbp)
	jle	.L20
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movl	%eax, %edx
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rax
	imulq	$402, %rax, %rax
	addq	%rcx, %rax
	movl	-1292848(%rbp,%rax,4), %eax
	movl	%eax, -1293380(%rbp)
.L20:
	addl	$1, -1293392(%rbp)
.L19:
	movl	-1293400(%rbp), %eax
	imull	-1293392(%rbp), %eax
	cmpl	$401, %eax
	jg	.L21
	movl	-1293396(%rbp), %eax
	imull	-1293392(%rbp), %eax
	cmpl	$401, %eax
	jle	.L22
.L21:
	cmpl	$1000005, -1293380(%rbp)
	jg	.L23
	movl	-1293380(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L24
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L24:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	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:
