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(){
int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {
    for(j=0;j<=N;j++)
    {
      k=N-(i+j);
      if(k>=0&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      {
	   MAN=k;
	   GOSEN=j;
        SEN=i;
        BOOL=1;
     	break;
      }
    }    
   }
  
  if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
  else printf("-1 -1 -1");
return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"-1 -1 -1"
	.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	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	movl	4(%rsp), %edi
	leal	1(%rsi), %r11d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	imull	$10000, %esi, %r10d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	%r10d, %ecx
	xorl	%edx, %edx
	subl	%r9d, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%eax, %eax
	js	.L3
	cmpl	%ecx, %edi
	je	.L9
.L3:
	addl	$1, %edx
	subl	$1, %eax
	subl	$5000, %ecx
	cmpl	%edx, %esi
	jge	.L5
	addl	$1, %r9d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
.L16:
	cmpl	$1, %r8d
	je	.L14
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	%r9d, %ebx
	addl	$1, %r9d
	movl	%eax, %r12d
	movl	%edx, %r13d
	movl	$1, %r8d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
	jmp	.L16
.L14:
	movl	%ebx, %r8d
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L15:
	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	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"-1 -1 -1"
	.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	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	movl	4(%rsp), %edi
	leal	1(%rsi), %r11d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	imull	$10000, %esi, %r10d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	%r10d, %ecx
	xorl	%edx, %edx
	subl	%r9d, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%eax, %eax
	js	.L3
	cmpl	%ecx, %edi
	je	.L9
.L3:
	addl	$1, %edx
	subl	$1, %eax
	subl	$5000, %ecx
	cmpl	%edx, %esi
	jge	.L5
	addl	$1, %r9d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
.L16:
	cmpl	$1, %r8d
	je	.L14
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	%r9d, %ebx
	addl	$1, %r9d
	movl	%eax, %r12d
	movl	%edx, %r13d
	movl	$1, %r8d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
	jmp	.L16
.L14:
	movl	%ebx, %r8d
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L15:
	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	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"-1 -1 -1"
	.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	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	movl	4(%rsp), %edi
	leal	1(%rsi), %r11d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	imull	$10000, %esi, %r10d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	%r10d, %ecx
	xorl	%edx, %edx
	subl	%r9d, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%eax, %eax
	js	.L3
	cmpl	%ecx, %edi
	je	.L9
.L3:
	addl	$1, %edx
	subl	$1, %eax
	subl	$5000, %ecx
	cmpl	%edx, %esi
	jge	.L5
	addl	$1, %r9d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
.L16:
	cmpl	$1, %r8d
	je	.L14
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	%r9d, %ebx
	addl	$1, %r9d
	movl	%eax, %r12d
	movl	%edx, %r13d
	movl	$1, %r8d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
	jmp	.L16
.L14:
	movl	%ebx, %r8d
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L15:
	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(){
int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {
    for(j=0;j<=N;j++)
    {
      k=N-(i+j);
      if(k>=0&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      {
	   MAN=k;
	   GOSEN=j;
        SEN=i;
        BOOL=1;
     	break;
      }
    }    
   }
  
  if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
  else printf("-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(){
int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {
    for(j=0;j<=N;j++)
    {
      k=N-(i+j);
      if(k>=0&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      {
	   MAN=k;
	   GOSEN=j;
        SEN=i;
        BOOL=1;
     	break;
      }
    }    
   }
  
  if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
  else printf("-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(){
int N,Y,SEN,GOSEN,MAN,BOOL=0,i,j,k;
  scanf("%d %d",&N,&Y);
  for(i=0;i<=N;i++)
  {
    for(j=0;j<=N;j++)
    {
      k=N-(i+j);
      if(k>=0&&i+j+k==N&&10000*k+5000*j+1000*i==Y)
      {
	   MAN=k;
	   GOSEN=j;
        SEN=i;
        BOOL=1;
     	break;
      }
    }    
   }
  
  if(BOOL==1){printf("%d %d %d",MAN,GOSEN,SEN);}
  else printf("-1 -1 -1");
return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"-1 -1 -1"
	.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	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	movl	4(%rsp), %edi
	leal	1(%rsi), %r11d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	imull	$10000, %esi, %r10d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	%r10d, %ecx
	xorl	%edx, %edx
	subl	%r9d, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%eax, %eax
	js	.L3
	cmpl	%ecx, %edi
	je	.L9
.L3:
	addl	$1, %edx
	subl	$1, %eax
	subl	$5000, %ecx
	cmpl	%edx, %esi
	jge	.L5
	addl	$1, %r9d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
.L16:
	cmpl	$1, %r8d
	je	.L14
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	%r9d, %ebx
	addl	$1, %r9d
	movl	%eax, %r12d
	movl	%edx, %r13d
	movl	$1, %r8d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
	jmp	.L16
.L14:
	movl	%ebx, %r8d
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L15:
	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	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"-1 -1 -1"
	.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	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	leaq	4(%rsp), %rdx
	call	__isoc99_scanf@PLT
	movl	(%rsp), %esi
	testl	%esi, %esi
	js	.L2
	movl	4(%rsp), %edi
	leal	1(%rsi), %r11d
	xorl	%r9d, %r9d
	xorl	%r8d, %r8d
	imull	$10000, %esi, %r10d
	.p2align 4,,10
	.p2align 3
.L6:
	movl	%esi, %eax
	movl	%r10d, %ecx
	xorl	%edx, %edx
	subl	%r9d, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	testl	%eax, %eax
	js	.L3
	cmpl	%ecx, %edi
	je	.L9
.L3:
	addl	$1, %edx
	subl	$1, %eax
	subl	$5000, %ecx
	cmpl	%edx, %esi
	jge	.L5
	addl	$1, %r9d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
.L16:
	cmpl	$1, %r8d
	je	.L14
.L2:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L7:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$16, %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
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	movl	%r9d, %ebx
	addl	$1, %r9d
	movl	%eax, %r12d
	movl	%edx, %r13d
	movl	$1, %r8d
	subl	$9000, %r10d
	cmpl	%r11d, %r9d
	jne	.L6
	jmp	.L16
.L14:
	movl	%ebx, %r8d
	movl	%r13d, %ecx
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L7
.L15:
	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:
```