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

```c
#include <stdio.h>

int main (void){
  
  long long N;
  
  long long Y;
  
  scanf("%lld %lld", &N, &Y);
  
  long long i, j, k;
  long long p=0, a, b;
  
  for (i=0; i<= N; i++){
    for (j=0; j<= N-i; j++){
      if (10000*i + 5000*j + 1000*(N-i-j) == Y)
      {p=1; a=i; b=j;}
    }
  }
  
  if (p==1) {printf("%lld %lld %lld", a, b, N-a-b);}
  else {printf("%d %d %d", -1, -1, -1);}
  
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld %lld"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rbx
	testq	%rbx, %rbx
	js	.L2
	imulq	$1000, %rbx, %r8
	leaq	1(%rbx), %rsi
	movq	%rbx, %r11
	xorl	%ecx, %ecx
	movq	16(%rsp), %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdi
	movq	%r8, %rdx
	xorl	%eax, %eax
	subq	%r11, %rdi
	testq	%r11, %r11
	js	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r10, %rdx
	cmove	%rax, %r13
	cmove	%rdi, %r12
	cmove	%r9, %rcx
	addq	$1, %rax
	addq	$4000, %rdx
	cmpq	%rsi, %rax
	jne	.L5
.L7:
	subq	$1, %r11
	addq	$9000, %r8
	subq	$1, %rsi
	jne	.L3
	cmpq	$1, %rcx
	je	.L15
.L2:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	subq	%r12, %rbx
	movq	%r13, %rcx
	movq	%r12, %rdx
	movl	$1, %edi
	movq	%rbx, %r8
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	subq	%r13, %r8
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld %lld"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rbx
	testq	%rbx, %rbx
	js	.L2
	imulq	$1000, %rbx, %r8
	leaq	1(%rbx), %rsi
	movq	%rbx, %r11
	xorl	%ecx, %ecx
	movq	16(%rsp), %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdi
	movq	%r8, %rdx
	xorl	%eax, %eax
	subq	%r11, %rdi
	testq	%r11, %r11
	js	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r10, %rdx
	cmove	%rax, %r13
	cmove	%rdi, %r12
	cmove	%r9, %rcx
	addq	$1, %rax
	addq	$4000, %rdx
	cmpq	%rsi, %rax
	jne	.L5
.L7:
	subq	$1, %r11
	addq	$9000, %r8
	subq	$1, %rsi
	jne	.L3
	cmpq	$1, %rcx
	je	.L15
.L2:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	subq	%r12, %rbx
	movq	%r13, %rcx
	movq	%r12, %rdx
	movl	$1, %edi
	movq	%rbx, %r8
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	subq	%r13, %r8
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld %lld"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rbx
	testq	%rbx, %rbx
	js	.L2
	imulq	$1000, %rbx, %r8
	leaq	1(%rbx), %rsi
	movq	%rbx, %r11
	xorl	%ecx, %ecx
	movq	16(%rsp), %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdi
	movq	%r8, %rdx
	xorl	%eax, %eax
	subq	%r11, %rdi
	testq	%r11, %r11
	js	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r10, %rdx
	cmove	%rax, %r13
	cmove	%rdi, %r12
	cmove	%r9, %rcx
	addq	$1, %rax
	addq	$4000, %rdx
	cmpq	%rsi, %rax
	jne	.L5
.L7:
	subq	$1, %r11
	addq	$9000, %r8
	subq	$1, %rsi
	jne	.L3
	cmpq	$1, %rcx
	je	.L15
.L2:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	subq	%r12, %rbx
	movq	%r13, %rcx
	movq	%r12, %rdx
	movl	$1, %edi
	movq	%rbx, %r8
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	subq	%r13, %r8
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```
```c
#include <stdio.h>

int main (void){
  
  long long N;
  
  long long Y;
  
  scanf("%lld %lld", &N, &Y);
  
  long long i, j, k;
  long long p=0, a, b;
  
  for (i=0; i<= N; i++){
    for (j=0; j<= N-i; j++){
      if (10000*i + 5000*j + 1000*(N-i-j) == Y)
      {p=1; a=i; b=j;}
    }
  }
  
  if (p==1) {printf("%lld %lld %lld", a, b, N-a-b);}
  else {printf("%d %d %d", -1, -1, -1);}
  
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main (void){
  
  long long N;
  
  long long Y;
  
  scanf("%lld %lld", &N, &Y);
  
  long long i, j, k;
  long long p=0, a, b;
  
  for (i=0; i<= N; i++){
    for (j=0; j<= N-i; j++){
      if (10000*i + 5000*j + 1000*(N-i-j) == Y)
      {p=1; a=i; b=j;}
    }
  }
  
  if (p==1) {printf("%lld %lld %lld", a, b, N-a-b);}
  else {printf("%d %d %d", -1, -1, -1);}
  
  return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main (void){
  
  long long N;
  
  long long Y;
  
  scanf("%lld %lld", &N, &Y);
  
  long long i, j, k;
  long long p=0, a, b;
  
  for (i=0; i<= N; i++){
    for (j=0; j<= N-i; j++){
      if (10000*i + 5000*j + 1000*(N-i-j) == Y)
      {p=1; a=i; b=j;}
    }
  }
  
  if (p==1) {printf("%lld %lld %lld", a, b, N-a-b);}
  else {printf("%d %d %d", -1, -1, -1);}
  
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld %lld"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rbx
	testq	%rbx, %rbx
	js	.L2
	imulq	$1000, %rbx, %r8
	leaq	1(%rbx), %rsi
	movq	%rbx, %r11
	xorl	%ecx, %ecx
	movq	16(%rsp), %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdi
	movq	%r8, %rdx
	xorl	%eax, %eax
	subq	%r11, %rdi
	testq	%r11, %r11
	js	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r10, %rdx
	cmove	%rax, %r13
	cmove	%rdi, %r12
	cmove	%r9, %rcx
	addq	$1, %rax
	addq	$4000, %rdx
	cmpq	%rsi, %rax
	jne	.L5
.L7:
	subq	$1, %r11
	addq	$9000, %r8
	subq	$1, %rsi
	jne	.L3
	cmpq	$1, %rcx
	je	.L15
.L2:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	subq	%r12, %rbx
	movq	%r13, %rcx
	movq	%r12, %rdx
	movl	$1, %edi
	movq	%rbx, %r8
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	subq	%r13, %r8
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld %lld"
.LC1:
	.string	"%lld %lld %lld"
.LC2:
	.string	"%d %d %d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rbx
	testq	%rbx, %rbx
	js	.L2
	imulq	$1000, %rbx, %r8
	leaq	1(%rbx), %rsi
	movq	%rbx, %r11
	xorl	%ecx, %ecx
	movq	16(%rsp), %r10
	movl	$1, %r9d
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbx, %rdi
	movq	%r8, %rdx
	xorl	%eax, %eax
	subq	%r11, %rdi
	testq	%r11, %r11
	js	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	cmpq	%r10, %rdx
	cmove	%rax, %r13
	cmove	%rdi, %r12
	cmove	%r9, %rcx
	addq	$1, %rax
	addq	$4000, %rdx
	cmpq	%rsi, %rax
	jne	.L5
.L7:
	subq	$1, %r11
	addq	$9000, %r8
	subq	$1, %rsi
	jne	.L3
	cmpq	$1, %rcx
	je	.L15
.L2:
	orl	$-1, %r8d
	orl	$-1, %ecx
	orl	$-1, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L8:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L16
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	subq	%r12, %rbx
	movq	%r13, %rcx
	movq	%r12, %rdx
	movl	$1, %edi
	movq	%rbx, %r8
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	subq	%r13, %r8
	call	__printf_chk@PLT
	jmp	.L8
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```