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 maxmin(int a, int b, int c){
	int max = a;
	int min = a;
	if(b > max){
		max = b;
	}else if(b < min){
		min = b;
	}
	if(c > max){
		max = c;
	}else if(c < min){
		min = c;
	}
	return max - min;
}

int T(int H, int W){
	int case1, case2, upperHeight, leftWidth;
	upperHeight = H / 3;
	leftWidth = W / 2;
	int S1 = upperHeight * W;
	int S2 = (H - upperHeight) * leftWidth;
	int S3 = (H - upperHeight) * (W - leftWidth);
	case1 = maxmin(S1, S2, S3);
	
	upperHeight = H / 3 + 1;
	S1 = upperHeight * W;
	S2 = (H - upperHeight) * leftWidth;
	S3 = (H - upperHeight) * (W - leftWidth);
	case2 = maxmin(S1, S2, S3);
	
	if(case1 < case2){
		return case1;
	}else{
		return case2;
	}
}

int rotatedT(int H, int W){
	return T(W, H);
}


int main(void) {
	// your code goes here
	int H, W;
	scanf("%d", &H);
	scanf("%d", &W);
	
	if(H % 3 == 0 || W % 3 == 0){
		printf("0\n");
	}else{
		int min = T(H, W);
		if(min > rotatedT(H, W)){
			min = rotatedT(H, W);
		}
		if(min > H){
			min = H;
		}
		if(min > W){
			min = W;
		}
		printf("%d\n", min);
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	maxmin
	.type	maxmin, @function
maxmin:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-24(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L2:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L3
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
.L3:
	movl	-28(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L4
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L4:
	movl	-28(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L5
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
.L5:
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	maxmin, .-maxmin
	.globl	T
	.type	T, @function
T:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %eax
	imull	-40(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	-24(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	maxmin
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	imull	-40(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	-24(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	maxmin
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L8
	movl	-8(%rbp), %eax
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	T, .-T
	.globl	rotatedT
	.type	rotatedT, @function
rotatedT:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	T
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	rotatedT, .-rotatedT
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L13
	movl	-16(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	T
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rotatedT
	cmpl	%eax, -12(%rbp)
	jle	.L16
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rotatedT
	movl	%eax, -12(%rbp)
.L16:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L17
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L18
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	maxmin
	.type	maxmin, @function
maxmin:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %eax
	cmpl	%esi, %edi
	jge	.L2
	movl	%edi, %edx
	movl	%esi, %edi
	movl	%edx, %esi
.L2:
	cmpl	%eax, %edi
	jl	.L3
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	movl	%edi, %eax
.L3:
	subl	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	maxmin, .-maxmin
	.p2align 4
	.globl	T
	.type	T, @function
T:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movslq	%edi, %rsi
	movl	%edi, %eax
	movl	%edi, %r8d
	imulq	$1431655766, %rsi, %rsi
	sarl	$31, %eax
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%edx, %ecx
	shrq	$32, %rsi
	sarl	%ecx
	subl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %edi
	movl	%esi, %r9d
	subl	%ecx, %eax
	movl	%edi, %r10d
	imull	%edx, %r9d
	imull	%ecx, %r10d
	imull	%eax, %edi
	movl	%r9d, %r11d
	cmpl	%r10d, %r9d
	jl	.L6
	movl	%r10d, %r11d
	movl	%r9d, %r10d
.L6:
	cmpl	%r10d, %edi
	jg	.L7
	cmpl	%edi, %r11d
	cmovg	%edi, %r11d
	movl	%r10d, %edi
.L7:
	addl	$1, %esi
	addl	%r9d, %edx
	subl	%r11d, %edi
	subl	%esi, %r8d
	imull	%r8d, %ecx
	imull	%r8d, %eax
	cmpl	%ecx, %edx
	jl	.L8
	movl	%ecx, %esi
	movl	%edx, %ecx
	movl	%esi, %edx
.L8:
	cmpl	%eax, %ecx
	jl	.L9
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	%ecx, %eax
.L9:
	subl	%edx, %eax
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	T, .-T
	.p2align 4
	.globl	rotatedT
	.type	rotatedT, @function
rotatedT:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movl	%edi, %ecx
	movl	%edi, %edx
	movl	%edi, %r9d
	movq	%rsi, %r8
	imulq	$1431655766, %rsi, %rsi
	shrl	$31, %ecx
	movl	%r8d, %eax
	addl	%edi, %ecx
	movl	%r8d, %edi
	sarl	$31, %eax
	sarl	%ecx
	shrq	$32, %rsi
	movl	%ecx, %r10d
	subl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %edi
	imull	%esi, %r9d
	subl	%ecx, %eax
	imull	%edi, %r10d
	imull	%eax, %edi
	movl	%r9d, %r11d
	cmpl	%r10d, %r9d
	jl	.L12
	movl	%r10d, %r11d
	movl	%r9d, %r10d
.L12:
	cmpl	%r10d, %edi
	jg	.L13
	cmpl	%edi, %r11d
	cmovg	%edi, %r11d
	movl	%r10d, %edi
.L13:
	addl	$1, %esi
	addl	%r9d, %edx
	subl	%r11d, %edi
	subl	%esi, %r8d
	imull	%r8d, %ecx
	imull	%r8d, %eax
	cmpl	%ecx, %edx
	jl	.L14
	movl	%ecx, %esi
	movl	%edx, %ecx
	movl	%esi, %edx
.L14:
	cmpl	%ecx, %eax
	jg	.L15
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	%ecx, %eax
.L15:
	subl	%edx, %eax
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	rotatedT, .-rotatedT
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	leaq	4(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebx
	imull	$-1431655765, %ebx, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	jbe	.L18
	movl	4(%rsp), %ebp
	imull	$-1431655765, %ebp, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	ja	.L19
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L20:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L19:
	.cfi_restore_state
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	T
	movl	%ebx, %esi
	movl	%ebp, %edi
	movl	%eax, %r12d
	call	T
	cmpl	%ebp, %ebx
	movl	%ebp, %edx
	leaq	.LC2(%rip), %rsi
	cmovle	%ebx, %edx
	movl	$1, %edi
	cmpl	%r12d, %edx
	cmovg	%r12d, %edx
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.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	maxmin
	.type	maxmin, @function
maxmin:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edx, %eax
	cmpl	%esi, %edi
	jge	.L2
	movl	%edi, %edx
	movl	%esi, %edi
	movl	%edx, %esi
.L2:
	cmpl	%eax, %edi
	jl	.L3
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	movl	%edi, %eax
.L3:
	subl	%esi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	maxmin, .-maxmin
	.p2align 4
	.globl	T
	.type	T, @function
T:
.LFB24:
	.cfi_startproc
	endbr64
	movl	%esi, %edx
	movslq	%edi, %rsi
	movl	%edi, %eax
	movl	%edi, %r8d
	imulq	$1431655766, %rsi, %rsi
	sarl	$31, %eax
	movl	%edx, %ecx
	shrl	$31, %ecx
	addl	%edx, %ecx
	shrq	$32, %rsi
	sarl	%ecx
	subl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %edi
	movl	%esi, %r9d
	subl	%ecx, %eax
	movl	%edi, %r10d
	imull	%edx, %r9d
	imull	%ecx, %r10d
	imull	%eax, %edi
	movl	%r9d, %r11d
	cmpl	%r10d, %r9d
	jl	.L6
	movl	%r10d, %r11d
	movl	%r9d, %r10d
.L6:
	cmpl	%r10d, %edi
	jg	.L7
	cmpl	%edi, %r11d
	cmovg	%edi, %r11d
	movl	%r10d, %edi
.L7:
	addl	$1, %esi
	addl	%r9d, %edx
	subl	%r11d, %edi
	subl	%esi, %r8d
	imull	%r8d, %ecx
	imull	%r8d, %eax
	cmpl	%ecx, %edx
	jl	.L8
	movl	%ecx, %esi
	movl	%edx, %ecx
	movl	%esi, %edx
.L8:
	cmpl	%eax, %ecx
	jl	.L9
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	%ecx, %eax
.L9:
	subl	%edx, %eax
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	T, .-T
	.p2align 4
	.globl	rotatedT
	.type	rotatedT, @function
rotatedT:
.LFB25:
	.cfi_startproc
	endbr64
	movslq	%esi, %rsi
	movl	%edi, %ecx
	movl	%edi, %edx
	movl	%edi, %r9d
	movq	%rsi, %r8
	imulq	$1431655766, %rsi, %rsi
	shrl	$31, %ecx
	movl	%r8d, %eax
	addl	%edi, %ecx
	movl	%r8d, %edi
	sarl	$31, %eax
	sarl	%ecx
	shrq	$32, %rsi
	movl	%ecx, %r10d
	subl	%eax, %esi
	movl	%edx, %eax
	subl	%esi, %edi
	imull	%esi, %r9d
	subl	%ecx, %eax
	imull	%edi, %r10d
	imull	%eax, %edi
	movl	%r9d, %r11d
	cmpl	%r10d, %r9d
	jl	.L12
	movl	%r10d, %r11d
	movl	%r9d, %r10d
.L12:
	cmpl	%r10d, %edi
	jg	.L13
	cmpl	%edi, %r11d
	cmovg	%edi, %r11d
	movl	%r10d, %edi
.L13:
	addl	$1, %esi
	addl	%r9d, %edx
	subl	%r11d, %edi
	subl	%esi, %r8d
	imull	%r8d, %ecx
	imull	%r8d, %eax
	cmpl	%ecx, %edx
	jl	.L14
	movl	%ecx, %esi
	movl	%edx, %ecx
	movl	%esi, %edx
.L14:
	cmpl	%ecx, %eax
	jg	.L15
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	movl	%ecx, %eax
.L15:
	subl	%edx, %eax
	cmpl	%edi, %eax
	cmovg	%edi, %eax
	ret
	.cfi_endproc
.LFE25:
	.size	rotatedT, .-rotatedT
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC0(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 48
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	call	__isoc99_scanf@PLT
	leaq	4(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %ebx
	imull	$-1431655765, %ebx, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	jbe	.L18
	movl	4(%rsp), %ebp
	imull	$-1431655765, %ebp, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	ja	.L19
.L18:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
.L20:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L23
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L19:
	.cfi_restore_state
	movl	%ebp, %esi
	movl	%ebx, %edi
	call	T
	movl	%ebx, %esi
	movl	%ebp, %edi
	movl	%eax, %r12d
	call	T
	cmpl	%ebp, %ebx
	movl	%ebp, %edx
	leaq	.LC2(%rip), %rsi
	cmovle	%ebx, %edx
	movl	$1, %edi
	cmpl	%r12d, %edx
	cmovg	%r12d, %edx
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L20
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.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 maxmin(int a, int b, int c){
	int max = a;
	int min = a;
	if(b > max){
		max = b;
	}else if(b < min){
		min = b;
	}
	if(c > max){
		max = c;
	}else if(c < min){
		min = c;
	}
	return max - min;
}

int T(int H, int W){
	int case1, case2, upperHeight, leftWidth;
	upperHeight = H / 3;
	leftWidth = W / 2;
	int S1 = upperHeight * W;
	int S2 = (H - upperHeight) * leftWidth;
	int S3 = (H - upperHeight) * (W - leftWidth);
	case1 = maxmin(S1, S2, S3);
	
	upperHeight = H / 3 + 1;
	S1 = upperHeight * W;
	S2 = (H - upperHeight) * leftWidth;
	S3 = (H - upperHeight) * (W - leftWidth);
	case2 = maxmin(S1, S2, S3);
	
	if(case1 < case2){
		return case1;
	}else{
		return case2;
	}
}

int rotatedT(int H, int W){
	return T(W, H);
}


int main(void) {
	// your code goes here
	int H, W;
	scanf("%d", &H);
	scanf("%d", &W);
	
	if(H % 3 == 0 || W % 3 == 0){
		printf("0\n");
	}else{
		int min = T(H, W);
		if(min > rotatedT(H, W)){
			min = rotatedT(H, W);
		}
		if(min > H){
			min = H;
		}
		if(min > W){
			min = W;
		}
		printf("%d\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 maxmin(int a, int b, int c){
	int max = a;
	int min = a;
	if(b > max){
		max = b;
	}else if(b < min){
		min = b;
	}
	if(c > max){
		max = c;
	}else if(c < min){
		min = c;
	}
	return max - min;
}

int T(int H, int W){
	int case1, case2, upperHeight, leftWidth;
	upperHeight = H / 3;
	leftWidth = W / 2;
	int S1 = upperHeight * W;
	int S2 = (H - upperHeight) * leftWidth;
	int S3 = (H - upperHeight) * (W - leftWidth);
	case1 = maxmin(S1, S2, S3);
	
	upperHeight = H / 3 + 1;
	S1 = upperHeight * W;
	S2 = (H - upperHeight) * leftWidth;
	S3 = (H - upperHeight) * (W - leftWidth);
	case2 = maxmin(S1, S2, S3);
	
	if(case1 < case2){
		return case1;
	}else{
		return case2;
	}
}

int rotatedT(int H, int W){
	return T(W, H);
}


int main(void) {
	// your code goes here
	int H, W;
	scanf("%d", &H);
	scanf("%d", &W);
	
	if(H % 3 == 0 || W % 3 == 0){
		printf("0\n");
	}else{
		int min = T(H, W);
		if(min > rotatedT(H, W)){
			min = rotatedT(H, W);
		}
		if(min > H){
			min = H;
		}
		if(min > W){
			min = W;
		}
		printf("%d\n", min);
	}
	return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	maxmin
	.type	maxmin, @function
maxmin:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-24(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L2:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L3
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
.L3:
	movl	-28(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L4
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L4:
	movl	-28(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L5
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
.L5:
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	maxmin, .-maxmin
	.globl	T
	.type	T, @function
T:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %eax
	imull	-40(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	-24(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	maxmin
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	imull	-40(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	-24(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	maxmin
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L8
	movl	-8(%rbp), %eax
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	T, .-T
	.globl	rotatedT
	.type	rotatedT, @function
rotatedT:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	T
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	rotatedT, .-rotatedT
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L13
	movl	-16(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	T
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rotatedT
	cmpl	%eax, -12(%rbp)
	jle	.L16
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rotatedT
	movl	%eax, -12(%rbp)
.L16:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L17
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L18
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	maxmin
	.type	maxmin, @function
maxmin:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	movl	-24(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L2
	movl	-24(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L3
.L2:
	movl	-24(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L3
	movl	-24(%rbp), %eax
	movl	%eax, -4(%rbp)
.L3:
	movl	-28(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L4
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L5
.L4:
	movl	-28(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L5
	movl	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
.L5:
	movl	-8(%rbp), %eax
	subl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	maxmin, .-maxmin
	.globl	T
	.type	T, @function
T:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$40, %rsp
	movl	%edi, -36(%rbp)
	movl	%esi, -40(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	%eax, -28(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -24(%rbp)
	movl	-28(%rbp), %eax
	imull	-40(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	-24(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	maxmin
	movl	%eax, -8(%rbp)
	movl	-36(%rbp), %eax
	movslq	%eax, %rdx
	imulq	$1431655766, %rdx, %rdx
	shrq	$32, %rdx
	sarl	$31, %eax
	movl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	addl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-28(%rbp), %eax
	imull	-40(%rbp), %eax
	movl	%eax, -20(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	-24(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -16(%rbp)
	movl	-36(%rbp), %eax
	subl	-28(%rbp), %eax
	movl	%eax, %edx
	movl	-40(%rbp), %eax
	subl	-24(%rbp), %eax
	imull	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %edx
	movl	-16(%rbp), %ecx
	movl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	maxmin
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L8
	movl	-8(%rbp), %eax
	jmp	.L9
.L8:
	movl	-4(%rbp), %eax
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	T, .-T
	.globl	rotatedT
	.type	rotatedT, @function
rotatedT:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$8, %rsp
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	T
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	rotatedT, .-rotatedT
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"0"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L13
	movl	-16(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	jne	.L14
.L13:
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	T
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rotatedT
	cmpl	%eax, -12(%rbp)
	jle	.L16
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	rotatedT
	movl	%eax, -12(%rbp)
.L16:
	movl	-20(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L17
	movl	-20(%rbp), %eax
	movl	%eax, -12(%rbp)
.L17:
	movl	-16(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L18
	movl	-16(%rbp), %eax
	movl	%eax, -12(%rbp)
.L18:
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
