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(){
  long long h,w,i,min;
  scanf("%lld%lld",&h,&w);
  min=h*w;
  if(h>=3){
    if(h%3==0)
      min=0;
    else
      min=w;
  }
  if(w>=3){
    if(w%3==0)
      min=0;
    else if(min>h)
      min=h;
  }
  for(i=1;i<=w/2;i++){
    long long a,b,c;
    a=i*h;
    b=(w-i)*(h/2+h%2);
    c=(w-i)*(h/2);
    if(a<c){
      if(b-a<min)
        min=b-a;
    }
    else if(b<a){
      if(a-c<min)
        min=a-c;
    }
    else{
      if(b-c<min)
        min=b-c;
    }
  }
  for(i=1;i<=h/2;i++){
    long long a,b,c;
    a=i*w;
    b=(h-i)*(w/2+w%2);
    c=(h-i)*(w/2);
    if(a<c){
      if(b-a<min)
        min=b-a;
    }
    else if(b<a){
      if(a-c<min)
        min=a-c;
    }
    else{
      if(b-c<min)
        min=b-c;
    }
  }
  printf("%lld\n",min);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -64(%rbp)
	movq	-88(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-88(%rbp), %rcx
	movabsq	$6148914691236517206, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rsi
	sarq	$63, %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	movq	%rax, %rdx
	addq	%rdx, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	$0, -64(%rbp)
	jmp	.L2
.L3:
	movq	-80(%rbp), %rax
	movq	%rax, -64(%rbp)
.L2:
	movq	-80(%rbp), %rax
	cmpq	$2, %rax
	jle	.L4
	movq	-80(%rbp), %rcx
	movabsq	$6148914691236517206, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rsi
	sarq	$63, %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	movq	%rax, %rdx
	addq	%rdx, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jne	.L5
	movq	$0, -64(%rbp)
	jmp	.L4
.L5:
	movq	-88(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L4
	movq	-88(%rbp), %rax
	movq	%rax, -64(%rbp)
.L4:
	movq	$1, -72(%rbp)
	jmp	.L6
.L10:
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	sarq	$63, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	andl	$1, %eax
	subq	%rcx, %rax
	addq	%rsi, %rax
	imulq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jge	.L7
	movq	-24(%rbp), %rax
	subq	-32(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-24(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L8
.L7:
	movq	-24(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jge	.L9
	movq	-32(%rbp), %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-32(%rbp), %rax
	subq	-16(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L8
.L9:
	movq	-24(%rbp), %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-24(%rbp), %rax
	subq	-16(%rbp), %rax
	movq	%rax, -64(%rbp)
.L8:
	addq	$1, -72(%rbp)
.L6:
	movq	-80(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -72(%rbp)
	jle	.L10
	movq	$1, -72(%rbp)
	jmp	.L11
.L15:
	movq	-80(%rbp), %rax
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -56(%rbp)
	movq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	sarq	$63, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	andl	$1, %eax
	subq	%rcx, %rax
	addq	%rsi, %rax
	imulq	%rdx, %rax
	movq	%rax, -48(%rbp)
	movq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	imulq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jge	.L12
	movq	-48(%rbp), %rax
	subq	-56(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-48(%rbp), %rax
	subq	-56(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L13
.L12:
	movq	-48(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jge	.L14
	movq	-56(%rbp), %rax
	subq	-40(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-56(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L13
.L14:
	movq	-48(%rbp), %rax
	subq	-40(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-48(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
.L13:
	addq	$1, -72(%rbp)
.L11:
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -72(%rbp)
	jle	.L15
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"%lld%lld"
.LC1:
	.string	"%lld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %r12
	movq	32(%rsp), %rbx
	cmpq	$2, %r12
	jg	.L2
	movq	%r12, %r8
	imulq	%rbx, %r8
.L3:
	movq	%r12, %rax
	movq	%rbx, %r11
	shrq	$63, %rax
	shrq	$63, %r11
	addq	%r12, %rax
	addq	%rbx, %r11
	sarq	%rax
	sarq	%r11
	movq	%rax, %r14
	cmpq	$2, %rbx
	jle	.L4
	movq	%rbx, %rax
	movl	$3, %ecx
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L28
.L5:
	movq	%rdx, %r8
.L16:
	movq	%r12, %rax
	leaq	-1(%rbx), %rsi
	movq	%r14, %rcx
	movq	%r12, %r10
	shrq	$63, %rax
	imulq	%rsi, %rcx
	movq	%rbx, 8(%rsp)
	leaq	(%r14,%r12), %r15
	leaq	(%r12,%rax), %rbp
	movl	$1, %edi
	andl	$1, %ebp
	subq	%rax, %rbp
	subq	%rcx, %r10
	leaq	0(%rbp,%r14), %r13
	imulq	%r13, %rsi
	movq	%r13, %rdx
	negq	%rdx
	subq	%r12, %rdx
	movq	%rsi, %rax
	movq	%rsi, %r9
	movq	%rdx, (%rsp)
	movq	%r12, %rdx
	subq	%rcx, %rax
	subq	%r12, %r9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	cmpq	%r9, %r8
	cmovg	%r9, %r8
.L8:
	addq	$1, %rdi
	addq	%r12, %rdx
	subq	%r14, %rcx
	subq	%rbp, %rax
	addq	%r15, %r10
	addq	(%rsp), %r9
	subq	%r13, %rsi
	cmpq	%rdi, %r11
	jl	.L29
.L10:
	cmpq	%rcx, %rdx
	jl	.L30
	cmpq	%r10, %r8
	movq	%r10, %rbx
	cmovle	%r8, %rbx
	cmpq	%rax, %r8
	cmovg	%rax, %r8
	cmpq	%rsi, %rdx
	cmovg	%rbx, %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L29:
	movq	8(%rsp), %rbx
.L6:
	cmpq	$1, %r12
	jle	.L11
	movq	%rbx, %rax
	movq	%rbx, %r9
	movq	%r11, (%rsp)
	leaq	(%r11,%rbx), %r15
	shrq	$63, %rax
	movq	%rbx, %rdx
	movl	$1, %esi
	leaq	(%rbx,%rax), %rbp
	andl	$1, %ebp
	subq	%rax, %rbp
	leaq	-1(%r12), %rax
	leaq	0(%rbp,%r11), %r13
	movq	%rax, %rcx
	imulq	%r13, %rax
	movq	%r13, %r12
	imulq	%r11, %rcx
	negq	%r12
	subq	%rbx, %r12
	movq	%rax, %r10
	movq	%rax, %rdi
	subq	%rcx, %r10
	subq	%rcx, %r9
	subq	%rbx, %rdi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L31:
	cmpq	%rdi, %r8
	cmovg	%rdi, %r8
.L13:
	addq	$1, %rsi
	addq	%rbx, %rdx
	subq	(%rsp), %rcx
	subq	%rbp, %r10
	addq	%r15, %r9
	addq	%r12, %rdi
	subq	%r13, %rax
	cmpq	%rsi, %r14
	jl	.L11
.L15:
	cmpq	%rcx, %rdx
	jl	.L31
	cmpq	%r9, %r8
	movq	%r9, %r11
	cmovle	%r8, %r11
	cmpq	%r10, %r8
	cmovg	%r10, %r8
	cmpq	%rax, %rdx
	cmovg	%r11, %r8
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$56, %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
.L4:
	.cfi_restore_state
	je	.L16
	jmp	.L6
.L2:
	movq	%r12, %rax
	movl	$3, %ecx
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmovne	%rbx, %rdx
	movq	%rdx, %r8
	jmp	.L3
.L28:
	cmpq	%r8, %r12
	movq	%r8, %rdx
	cmovle	%r12, %rdx
	jmp	.L5
.L32:
	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	"%lld%lld"
.LC1:
	.string	"%lld\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
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	32(%rsp), %rdx
	leaq	24(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %r12
	movq	32(%rsp), %rbx
	cmpq	$2, %r12
	jg	.L2
	movq	%r12, %r8
	imulq	%rbx, %r8
.L3:
	movq	%r12, %rax
	movq	%rbx, %r11
	shrq	$63, %rax
	shrq	$63, %r11
	addq	%r12, %rax
	addq	%rbx, %r11
	sarq	%rax
	sarq	%r11
	movq	%rax, %r14
	cmpq	$2, %rbx
	jle	.L4
	movq	%rbx, %rax
	movl	$3, %ecx
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	jne	.L28
.L5:
	movq	%rdx, %r8
.L16:
	movq	%r12, %rax
	leaq	-1(%rbx), %rsi
	movq	%r14, %rcx
	movq	%r12, %r10
	shrq	$63, %rax
	imulq	%rsi, %rcx
	movq	%rbx, 8(%rsp)
	leaq	(%r14,%r12), %r15
	leaq	(%r12,%rax), %rbp
	movl	$1, %edi
	andl	$1, %ebp
	subq	%rax, %rbp
	subq	%rcx, %r10
	leaq	0(%rbp,%r14), %r13
	imulq	%r13, %rsi
	movq	%r13, %rdx
	negq	%rdx
	subq	%r12, %rdx
	movq	%rsi, %rax
	movq	%rsi, %r9
	movq	%rdx, (%rsp)
	movq	%r12, %rdx
	subq	%rcx, %rax
	subq	%r12, %r9
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	cmpq	%r9, %r8
	cmovg	%r9, %r8
.L8:
	addq	$1, %rdi
	addq	%r12, %rdx
	subq	%r14, %rcx
	subq	%rbp, %rax
	addq	%r15, %r10
	addq	(%rsp), %r9
	subq	%r13, %rsi
	cmpq	%rdi, %r11
	jl	.L29
.L10:
	cmpq	%rcx, %rdx
	jl	.L30
	cmpq	%r10, %r8
	movq	%r10, %rbx
	cmovle	%r8, %rbx
	cmpq	%rax, %r8
	cmovg	%rax, %r8
	cmpq	%rsi, %rdx
	cmovg	%rbx, %r8
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L29:
	movq	8(%rsp), %rbx
.L6:
	cmpq	$1, %r12
	jle	.L11
	movq	%rbx, %rax
	movq	%rbx, %r9
	movq	%r11, (%rsp)
	leaq	(%r11,%rbx), %r15
	shrq	$63, %rax
	movq	%rbx, %rdx
	movl	$1, %esi
	leaq	(%rbx,%rax), %rbp
	andl	$1, %ebp
	subq	%rax, %rbp
	leaq	-1(%r12), %rax
	leaq	0(%rbp,%r11), %r13
	movq	%rax, %rcx
	imulq	%r13, %rax
	movq	%r13, %r12
	imulq	%r11, %rcx
	negq	%r12
	subq	%rbx, %r12
	movq	%rax, %r10
	movq	%rax, %rdi
	subq	%rcx, %r10
	subq	%rcx, %r9
	subq	%rbx, %rdi
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L31:
	cmpq	%rdi, %r8
	cmovg	%rdi, %r8
.L13:
	addq	$1, %rsi
	addq	%rbx, %rdx
	subq	(%rsp), %rcx
	subq	%rbp, %r10
	addq	%r15, %r9
	addq	%r12, %rdi
	subq	%r13, %rax
	cmpq	%rsi, %r14
	jl	.L11
.L15:
	cmpq	%rcx, %rdx
	jl	.L31
	cmpq	%r9, %r8
	movq	%r9, %r11
	cmovle	%r8, %r11
	cmpq	%r10, %r8
	cmovg	%r10, %r8
	cmpq	%rax, %rdx
	cmovg	%r11, %r8
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$56, %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
.L4:
	.cfi_restore_state
	je	.L16
	jmp	.L6
.L2:
	movq	%r12, %rax
	movl	$3, %ecx
	cqto
	idivq	%rcx
	testq	%rdx, %rdx
	cmovne	%rbx, %rdx
	movq	%rdx, %r8
	jmp	.L3
.L28:
	cmpq	%r8, %r12
	movq	%r8, %rdx
	cmovle	%r12, %rdx
	jmp	.L5
.L32:
	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>
int main(){
  long long h,w,i,min;
  scanf("%lld%lld",&h,&w);
  min=h*w;
  if(h>=3){
    if(h%3==0)
      min=0;
    else
      min=w;
  }
  if(w>=3){
    if(w%3==0)
      min=0;
    else if(min>h)
      min=h;
  }
  for(i=1;i<=w/2;i++){
    long long a,b,c;
    a=i*h;
    b=(w-i)*(h/2+h%2);
    c=(w-i)*(h/2);
    if(a<c){
      if(b-a<min)
        min=b-a;
    }
    else if(b<a){
      if(a-c<min)
        min=a-c;
    }
    else{
      if(b-c<min)
        min=b-c;
    }
  }
  for(i=1;i<=h/2;i++){
    long long a,b,c;
    a=i*w;
    b=(h-i)*(w/2+w%2);
    c=(h-i)*(w/2);
    if(a<c){
      if(b-a<min)
        min=b-a;
    }
    else if(b<a){
      if(a-c<min)
        min=a-c;
    }
    else{
      if(b-c<min)
        min=b-c;
    }
  }
  printf("%lld\n",min);
  return 0;
}
100100 100000
 000000 2
 5 1
 100100 110000
 100111 100001
 100111 000101
 000011 001100
 000010 011000
 010010 011110
 011000 110111

50000
 0
 1
 50050
 83371
 101
 11
 5
 5005
 5500

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(){
  long long h,w,i,min;
  scanf("%lld%lld",&h,&w);
  min=h*w;
  if(h>=3){
    if(h%3==0)
      min=0;
    else
      min=w;
  }
  if(w>=3){
    if(w%3==0)
      min=0;
    else if(min>h)
      min=h;
  }
  for(i=1;i<=w/2;i++){
    long long a,b,c;
    a=i*h;
    b=(w-i)*(h/2+h%2);
    c=(w-i)*(h/2);
    if(a<c){
      if(b-a<min)
        min=b-a;
    }
    else if(b<a){
      if(a-c<min)
        min=a-c;
    }
    else{
      if(b-c<min)
        min=b-c;
    }
  }
  for(i=1;i<=h/2;i++){
    long long a,b,c;
    a=i*w;
    b=(h-i)*(w/2+w%2);
    c=(h-i)*(w/2);
    if(a<c){
      if(b-a<min)
        min=b-a;
    }
    else if(b<a){
      if(a-c<min)
        min=a-c;
    }
    else{
      if(b-c<min)
        min=b-c;
    }
  }
  printf("%lld\n",min);
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld%lld"
.LC1:
	.string	"%lld\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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -64(%rbp)
	movq	-88(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-88(%rbp), %rcx
	movabsq	$6148914691236517206, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rsi
	sarq	$63, %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	movq	%rax, %rdx
	addq	%rdx, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	$0, -64(%rbp)
	jmp	.L2
.L3:
	movq	-80(%rbp), %rax
	movq	%rax, -64(%rbp)
.L2:
	movq	-80(%rbp), %rax
	cmpq	$2, %rax
	jle	.L4
	movq	-80(%rbp), %rcx
	movabsq	$6148914691236517206, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rsi
	sarq	$63, %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	movq	%rax, %rdx
	addq	%rdx, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jne	.L5
	movq	$0, -64(%rbp)
	jmp	.L4
.L5:
	movq	-88(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L4
	movq	-88(%rbp), %rax
	movq	%rax, -64(%rbp)
.L4:
	movq	$1, -72(%rbp)
	jmp	.L6
.L10:
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	sarq	$63, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	andl	$1, %eax
	subq	%rcx, %rax
	addq	%rsi, %rax
	imulq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jge	.L7
	movq	-24(%rbp), %rax
	subq	-32(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-24(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L8
.L7:
	movq	-24(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jge	.L9
	movq	-32(%rbp), %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-32(%rbp), %rax
	subq	-16(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L8
.L9:
	movq	-24(%rbp), %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-24(%rbp), %rax
	subq	-16(%rbp), %rax
	movq	%rax, -64(%rbp)
.L8:
	addq	$1, -72(%rbp)
.L6:
	movq	-80(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -72(%rbp)
	jle	.L10
	movq	$1, -72(%rbp)
	jmp	.L11
.L15:
	movq	-80(%rbp), %rax
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -56(%rbp)
	movq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	sarq	$63, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	andl	$1, %eax
	subq	%rcx, %rax
	addq	%rsi, %rax
	imulq	%rdx, %rax
	movq	%rax, -48(%rbp)
	movq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	imulq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jge	.L12
	movq	-48(%rbp), %rax
	subq	-56(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-48(%rbp), %rax
	subq	-56(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L13
.L12:
	movq	-48(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jge	.L14
	movq	-56(%rbp), %rax
	subq	-40(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-56(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L13
.L14:
	movq	-48(%rbp), %rax
	subq	-40(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-48(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
.L13:
	addq	$1, -72(%rbp)
.L11:
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -72(%rbp)
	jle	.L15
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"%lld%lld"
.LC1:
	.string	"%lld\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	$96, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-80(%rbp), %rdx
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-88(%rbp), %rdx
	movq	-80(%rbp), %rax
	imulq	%rdx, %rax
	movq	%rax, -64(%rbp)
	movq	-88(%rbp), %rax
	cmpq	$2, %rax
	jle	.L2
	movq	-88(%rbp), %rcx
	movabsq	$6148914691236517206, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rsi
	sarq	$63, %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	movq	%rax, %rdx
	addq	%rdx, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jne	.L3
	movq	$0, -64(%rbp)
	jmp	.L2
.L3:
	movq	-80(%rbp), %rax
	movq	%rax, -64(%rbp)
.L2:
	movq	-80(%rbp), %rax
	cmpq	$2, %rax
	jle	.L4
	movq	-80(%rbp), %rcx
	movabsq	$6148914691236517206, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rcx, %rsi
	sarq	$63, %rsi
	movq	%rdx, %rax
	subq	%rsi, %rax
	movq	%rax, %rdx
	addq	%rdx, %rdx
	addq	%rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	testq	%rax, %rax
	jne	.L5
	movq	$0, -64(%rbp)
	jmp	.L4
.L5:
	movq	-88(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L4
	movq	-88(%rbp), %rax
	movq	%rax, -64(%rbp)
.L4:
	movq	$1, -72(%rbp)
	jmp	.L6
.L10:
	movq	-88(%rbp), %rax
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -32(%rbp)
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	sarq	$63, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	andl	$1, %eax
	subq	%rcx, %rax
	addq	%rsi, %rax
	imulq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-80(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-88(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	imulq	%rdx, %rax
	movq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	cmpq	-16(%rbp), %rax
	jge	.L7
	movq	-24(%rbp), %rax
	subq	-32(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-24(%rbp), %rax
	subq	-32(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L8
.L7:
	movq	-24(%rbp), %rax
	cmpq	-32(%rbp), %rax
	jge	.L9
	movq	-32(%rbp), %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-32(%rbp), %rax
	subq	-16(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L8
.L9:
	movq	-24(%rbp), %rax
	subq	-16(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L8
	movq	-24(%rbp), %rax
	subq	-16(%rbp), %rax
	movq	%rax, -64(%rbp)
.L8:
	addq	$1, -72(%rbp)
.L6:
	movq	-80(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -72(%rbp)
	jle	.L10
	movq	$1, -72(%rbp)
	jmp	.L11
.L15:
	movq	-80(%rbp), %rax
	movq	-72(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -56(%rbp)
	movq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	movq	%rax, %rsi
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	sarq	$63, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	andl	$1, %eax
	subq	%rcx, %rax
	addq	%rsi, %rax
	imulq	%rdx, %rax
	movq	%rax, -48(%rbp)
	movq	-88(%rbp), %rax
	subq	-72(%rbp), %rax
	movq	%rax, %rdx
	movq	-80(%rbp), %rax
	movq	%rax, %rcx
	shrq	$63, %rcx
	addq	%rcx, %rax
	sarq	%rax
	imulq	%rdx, %rax
	movq	%rax, -40(%rbp)
	movq	-56(%rbp), %rax
	cmpq	-40(%rbp), %rax
	jge	.L12
	movq	-48(%rbp), %rax
	subq	-56(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-48(%rbp), %rax
	subq	-56(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L13
.L12:
	movq	-48(%rbp), %rax
	cmpq	-56(%rbp), %rax
	jge	.L14
	movq	-56(%rbp), %rax
	subq	-40(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-56(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
	jmp	.L13
.L14:
	movq	-48(%rbp), %rax
	subq	-40(%rbp), %rax
	cmpq	%rax, -64(%rbp)
	jle	.L13
	movq	-48(%rbp), %rax
	subq	-40(%rbp), %rax
	movq	%rax, -64(%rbp)
.L13:
	addq	$1, -72(%rbp)
.L11:
	movq	-88(%rbp), %rax
	movq	%rax, %rdx
	shrq	$63, %rdx
	addq	%rdx, %rax
	sarq	%rax
	cmpq	%rax, -72(%rbp)
	jle	.L15
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
