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 MAX 100
int main(){
  int i,j,h,h1,w,w1,l,l1,l2;
  while(1){
      scanf("%d %d",&h,&w);
      if(h==0 & w==0){
        break;
      }

      l=h*h+w*w;
      l1=150*150;
        for(h1=1;h1<150;h1++){
          for(w1 =150;w1 >=h1+1;w1--){
            l2=h1 *h1 +w1 *w1 ;
            if(l<l2 && l1>l2 || l==l2 && h<h1 && l1>l2)
            {
              l1=l2;
              i=h1;
              j=w1;
            }
      }
    }
        printf("%d %d\n",i,j);
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	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	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L15
	movl	-44(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	-40(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	$22500, -20(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L4
.L10:
	movl	$150, -24(%rbp)
	jmp	.L5
.L9:
	movl	-28(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L6
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jg	.L7
.L6:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jne	.L8
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L8
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L8
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -32(%rbp)
.L8:
	subl	$1, -24(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	addl	$1, -28(%rbp)
.L4:
	cmpl	$149, -28(%rbp)
	jle	.L10
	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	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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"
.LC1:
	.string	"%d %d\n"
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r13
	movq	%rsp, %r12
.L8:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r10d
	movl	4(%rsp), %eax
	movl	%r10d, %edi
	orl	%eax, %edi
	je	.L2
	movl	%r10d, %r8d
	imull	%eax, %eax
	movl	$1, %ecx
	imull	%r10d, %r8d
	addl	%eax, %r8d
	movl	$22500, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %r9d
	movl	%eax, %edi
	movl	$150, %edx
	imull	%ecx, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edx, %r15d
	subl	$1, %edx
	movl	%ecx, %r14d
	cmpl	%edx, %ecx
	jge	.L24
.L12:
	movl	%eax, %edi
.L6:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	%r9d, %eax
	cmpl	%eax, %edi
	setg	%sil
	cmpl	%eax, %r8d
	jge	.L13
	testb	%sil, %sil
	jne	.L11
.L13:
	cmpl	%eax, %r8d
	sete	%r11b
	testb	%sil, %r11b
	je	.L14
	cmpl	%ecx, %r10d
	jl	.L11
.L14:
	subl	$1, %edx
	movl	%edi, %eax
	cmpl	%edx, %ecx
	jl	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %ecx
	cmpl	$150, %ecx
	jne	.L7
	movl	%r15d, %ecx
	movl	%r14d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$24, %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
.L25:
	.cfi_restore_state
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.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
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %r13
	movq	%rsp, %r12
.L8:
	movq	%rbp, %rdi
	xorl	%eax, %eax
	movq	%r13, %rdx
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movl	(%rsp), %r10d
	movl	4(%rsp), %eax
	movl	%r10d, %edi
	orl	%eax, %edi
	je	.L2
	movl	%r10d, %r8d
	imull	%eax, %eax
	movl	$1, %ecx
	imull	%r10d, %r8d
	addl	%eax, %r8d
	movl	$22500, %eax
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%ecx, %r9d
	movl	%eax, %edi
	movl	$150, %edx
	imull	%ecx, %r9d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L11:
	movl	%edx, %r15d
	subl	$1, %edx
	movl	%ecx, %r14d
	cmpl	%edx, %ecx
	jge	.L24
.L12:
	movl	%eax, %edi
.L6:
	movl	%edx, %eax
	imull	%edx, %eax
	addl	%r9d, %eax
	cmpl	%eax, %edi
	setg	%sil
	cmpl	%eax, %r8d
	jge	.L13
	testb	%sil, %sil
	jne	.L11
.L13:
	cmpl	%eax, %r8d
	sete	%r11b
	testb	%sil, %r11b
	je	.L14
	cmpl	%ecx, %r10d
	jl	.L11
.L14:
	subl	$1, %edx
	movl	%edi, %eax
	cmpl	%edx, %ecx
	jl	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	addl	$1, %ecx
	cmpl	$150, %ecx
	jne	.L7
	movl	%r15d, %ecx
	movl	%r14d, %edx
	movq	%rbx, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
.L2:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L25
	addq	$24, %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
.L25:
	.cfi_restore_state
	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:

#include <stdio.h>
#define MAX 100
int main(){
  int i,j,h,h1,w,w1,l,l1,l2;
  while(1){
      scanf("%d %d",&h,&w);
      if(h==0 & w==0){
        break;
      }

      l=h*h+w*w;
      l1=150*150;
        for(h1=1;h1<150;h1++){
          for(w1 =150;w1 >=h1+1;w1--){
            l2=h1 *h1 +w1 *w1 ;
            if(l<l2 && l1>l2 || l==l2 && h<h1 && l1>l2)
            {
              l1=l2;
              i=h1;
              j=w1;
            }
      }
    }
        printf("%d %d\n",i,j);
  }

  return 0;
}
1 2
1 3
2 3
1 4
2 4
5 6
1 8
4 7
98 100
99 100
0 0

1 3
2 3
1 4
2 4
3 4
1 8
4 7
2 8
3 140
89 109

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 MAX 100
int main(){
  int i,j,h,h1,w,w1,l,l1,l2;
  while(1){
      scanf("%d %d",&h,&w);
      if(h==0 & w==0){
        break;
      }

      l=h*h+w*w;
      l1=150*150;
        for(h1=1;h1<150;h1++){
          for(w1 =150;w1 >=h1+1;w1--){
            l2=h1 *h1 +w1 *w1 ;
            if(l<l2 && l1>l2 || l==l2 && h<h1 && l1>l2)
            {
              l1=l2;
              i=h1;
              j=w1;
            }
      }
    }
        printf("%d %d\n",i,j);
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	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	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L15
	movl	-44(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	-40(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	$22500, -20(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L4
.L10:
	movl	$150, -24(%rbp)
	jmp	.L5
.L9:
	movl	-28(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L6
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jg	.L7
.L6:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jne	.L8
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L8
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L8
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -32(%rbp)
.L8:
	subl	$1, -24(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	addl	$1, -28(%rbp)
.L4:
	cmpl	$149, -28(%rbp)
	jle	.L10
	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	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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"
.LC1:
	.string	"%d %d\n"
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L11:
	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	-44(%rbp), %edx
	movl	-40(%rbp), %eax
	orl	%edx, %eax
	testl	%eax, %eax
	je	.L15
	movl	-44(%rbp), %edx
	movl	-44(%rbp), %eax
	movl	%edx, %ecx
	imull	%eax, %ecx
	movl	-40(%rbp), %edx
	movl	-40(%rbp), %eax
	imull	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -16(%rbp)
	movl	$22500, -20(%rbp)
	movl	$1, -28(%rbp)
	jmp	.L4
.L10:
	movl	$150, -24(%rbp)
	jmp	.L5
.L9:
	movl	-28(%rbp), %eax
	imull	%eax, %eax
	movl	%eax, %edx
	movl	-24(%rbp), %eax
	imull	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L6
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jg	.L7
.L6:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jne	.L8
	movl	-44(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jle	.L8
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jle	.L8
.L7:
	movl	-12(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -36(%rbp)
	movl	-24(%rbp), %eax
	movl	%eax, -32(%rbp)
.L8:
	subl	$1, -24(%rbp)
.L5:
	movl	-28(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L9
	addl	$1, -28(%rbp)
.L4:
	cmpl	$149, -28(%rbp)
	jle	.L10
	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	.L11
.L15:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	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:
