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<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007
//#define DEBUG

//qsort用、昇順
int compare_int(const void *a, const void *b)
{
	return *(int*)a-*(int*)b;
}
//qsort(array, 10, sizeof(int), compare_int)

int main(){
	int n, y;
	scanf("%d%d", &n, &y);

	int tt, ft, s, tmp, syo;
	tt = -1;
	ft = -1;
	s = -1;

	if(y%1000 != 0) printf("%d %d %d\n", tt, ft, s);
	else{
		for(int i=0;i<=n; i++){
			tmp = i*10000;
			if(tmp>y) break;
			for(int j=0;j<=n;j++){
				if(i+j>n) break;
				tmp = i*10000+j*5000;

				syo = (y-tmp)/1000;
				if(i+j+syo == n){
					tt = i;
					ft = j;
					s = syo;

					i = n+1;
					j = n+1;
				}
			
			}
		}
	
		printf("%d %d %d\n", tt, ft, s);
	}
	
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.text
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$-1, -36(%rbp)
	movl	$-1, -32(%rbp)
	movl	$-1, -28(%rbp)
	movl	-40(%rbp), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$6, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L4
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movl	$0, -24(%rbp)
	jmp	.L6
.L14:
	movl	-24(%rbp), %eax
	imull	$10000, %eax, %eax
	movl	%eax, -16(%rbp)
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jg	.L17
	movl	$0, -20(%rbp)
	jmp	.L9
.L13:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L18
	movl	-24(%rbp), %eax
	imull	$10000, %eax, %edx
	movl	-20(%rbp), %eax
	imull	$5000, %eax, %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-40(%rbp), %eax
	subl	-16(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-24(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L12:
	addl	$1, -20(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -24(%rbp)
.L6:
	movl	-44(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L14
	jmp	.L8
.L17:
	nop
.L8:
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.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
	.p2align 4
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	compare_int, .-compare_int
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	movq	%rax, %r10
	imulq	$274877907, %rax, %rax
	movl	%r10d, %edx
	sarl	$31, %edx
	sarq	$38, %rax
	subl	%edx, %eax
	imull	$1000, %eax, %eax
	cmpl	%eax, %r10d
	jne	.L4
	movl	(%rsp), %edi
	movl	%r10d, %eax
	xorl	%r9d, %r9d
	orl	%edi, %eax
	js	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	imull	$10000, %r9d, %r11d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%r9,%rcx), %eax
	cmpl	%edi, %eax
	jg	.L8
	imull	$5000, %ecx, %esi
	movl	%r10d, %edx
	addl	%r11d, %esi
	subl	%esi, %edx
	movslq	%edx, %r8
	sarl	$31, %edx
	imulq	$274877907, %r8, %r8
	sarq	$38, %r8
	subl	%edx, %r8d
	addl	%r8d, %eax
	cmpl	%edi, %eax
	je	.L6
	addl	$1, %ecx
	cmpl	%edi, %ecx
	jle	.L9
.L8:
	addl	$1, %r9d
	cmpl	%edi, %r9d
	jg	.L13
	imull	$10000, %r9d, %eax
	cmpl	%eax, %r10d
	jge	.L5
.L13:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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
	.p2align 4
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	compare_int, .-compare_int
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	movq	%rax, %r10
	imulq	$274877907, %rax, %rax
	movl	%r10d, %edx
	sarl	$31, %edx
	sarq	$38, %rax
	subl	%edx, %eax
	imull	$1000, %eax, %eax
	cmpl	%eax, %r10d
	jne	.L4
	movl	(%rsp), %edi
	movl	%r10d, %eax
	xorl	%r9d, %r9d
	orl	%edi, %eax
	js	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	imull	$10000, %r9d, %r11d
	xorl	%ecx, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	leal	(%r9,%rcx), %eax
	cmpl	%edi, %eax
	jg	.L8
	imull	$5000, %ecx, %esi
	movl	%r10d, %edx
	addl	%r11d, %esi
	subl	%esi, %edx
	movslq	%edx, %r8
	sarl	$31, %edx
	imulq	$274877907, %r8, %r8
	sarq	$38, %r8
	subl	%edx, %r8d
	addl	%r8d, %eax
	cmpl	%edi, %eax
	je	.L6
	addl	$1, %ecx
	cmpl	%edi, %ecx
	jle	.L9
.L8:
	addl	$1, %r9d
	cmpl	%edi, %r9d
	jg	.L13
	imull	$10000, %r9d, %eax
	cmpl	%eax, %r10d
	jge	.L5
.L13:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %r9d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%r9d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007
//#define DEBUG

//qsort用、昇順
int compare_int(const void *a, const void *b)
{
	return *(int*)a-*(int*)b;
}
//qsort(array, 10, sizeof(int), compare_int)

int main(){
	int n, y;
	scanf("%d%d", &n, &y);

	int tt, ft, s, tmp, syo;
	tt = -1;
	ft = -1;
	s = -1;

	if(y%1000 != 0) printf("%d %d %d\n", tt, ft, s);
	else{
		for(int i=0;i<=n; i++){
			tmp = i*10000;
			if(tmp>y) break;
			for(int j=0;j<=n;j++){
				if(i+j>n) break;
				tmp = i*10000+j*5000;

				syo = (y-tmp)/1000;
				if(i+j+syo == n){
					tt = i;
					ft = j;
					s = syo;

					i = n+1;
					j = n+1;
				}
			
			}
		}
	
		printf("%d %d %d\n", tt, ft, s);
	}
	
	return 0;
}

0000 1234000
 6 45000
 0000 0
 20 318832
 2000 25743705
 0000 841858
 6 3463
 20 93731
 2000 40151179
 0000 383974

-1 -1 -1
 3 3 0
 0 0 0
 -1 -1 -1
 -1 -1 -1
 -1 -1 -1
 -1 -1 -1
 -1 -1 -1
 -1 -1 -1
 -1 -1 -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>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#define PI 3.141592653589793
#define MOD 1000000007
//#define DEBUG

//qsort用、昇順
int compare_int(const void *a, const void *b)
{
	return *(int*)a-*(int*)b;
}
//qsort(array, 10, sizeof(int), compare_int)

int main(){
	int n, y;
	scanf("%d%d", &n, &y);

	int tt, ft, s, tmp, syo;
	tt = -1;
	ft = -1;
	s = -1;

	if(y%1000 != 0) printf("%d %d %d\n", tt, ft, s);
	else{
		for(int i=0;i<=n; i++){
			tmp = i*10000;
			if(tmp>y) break;
			for(int j=0;j<=n;j++){
				if(i+j>n) break;
				tmp = i*10000+j*5000;

				syo = (y-tmp)/1000;
				if(i+j+syo == n){
					tt = i;
					ft = j;
					s = syo;

					i = n+1;
					j = n+1;
				}
			
			}
		}
	
		printf("%d %d %d\n", tt, ft, s);
	}
	
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.text
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$-1, -36(%rbp)
	movl	$-1, -32(%rbp)
	movl	$-1, -28(%rbp)
	movl	-40(%rbp), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$6, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L4
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movl	$0, -24(%rbp)
	jmp	.L6
.L14:
	movl	-24(%rbp), %eax
	imull	$10000, %eax, %eax
	movl	%eax, -16(%rbp)
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jg	.L17
	movl	$0, -20(%rbp)
	jmp	.L9
.L13:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L18
	movl	-24(%rbp), %eax
	imull	$10000, %eax, %edx
	movl	-20(%rbp), %eax
	imull	$5000, %eax, %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-40(%rbp), %eax
	subl	-16(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-24(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L12:
	addl	$1, -20(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -24(%rbp)
.L6:
	movl	-44(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L14
	jmp	.L8
.L17:
	nop
.L8:
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.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
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d %d %d\n"
	.text
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-40(%rbp), %rdx
	leaq	-44(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$-1, -36(%rbp)
	movl	$-1, -32(%rbp)
	movl	$-1, -28(%rbp)
	movl	-40(%rbp), %edx
	movslq	%edx, %rax
	imulq	$274877907, %rax, %rax
	shrq	$32, %rax
	sarl	$6, %eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	imull	$1000, %eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L4
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L5
.L4:
	movl	$0, -24(%rbp)
	jmp	.L6
.L14:
	movl	-24(%rbp), %eax
	imull	$10000, %eax, %eax
	movl	%eax, -16(%rbp)
	movl	-40(%rbp), %eax
	cmpl	%eax, -16(%rbp)
	jg	.L17
	movl	$0, -20(%rbp)
	jmp	.L9
.L13:
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jg	.L18
	movl	-24(%rbp), %eax
	imull	$10000, %eax, %edx
	movl	-20(%rbp), %eax
	imull	$5000, %eax, %eax
	addl	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-40(%rbp), %eax
	subl	-16(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$274877907, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$6, %edx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -12(%rbp)
	movl	-24(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-12(%rbp), %eax
	addl	%eax, %edx
	movl	-44(%rbp), %eax
	cmpl	%eax, %edx
	jne	.L12
	movl	-24(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -32(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, -28(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -24(%rbp)
	movl	-44(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -20(%rbp)
.L12:
	addl	$1, -20(%rbp)
.L9:
	movl	-44(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L13
	jmp	.L11
.L18:
	nop
.L11:
	addl	$1, -24(%rbp)
.L6:
	movl	-44(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jle	.L14
	jmp	.L8
.L17:
	nop
.L8:
	movl	-28(%rbp), %ecx
	movl	-32(%rbp), %edx
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L5:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leave
	.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:
