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

```c
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
int min(int x, int y) {
	return x > y ? y : x;
}
int max(int x, int y) {
	return x < y ? y : x;
}
int main() {
	int n;
	int x[100], y[100], h[100];
	int epos;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d%d%d", &x[i], &y[i], &h[i]);
		if (h[i] != 0) {
			epos = i;
		}
	}
	for (int cx = 0; cx <= 100; cx++) {
		for (int cy = 0; cy <= 100; cy++) {
			for (int i = 0; i < 2; i++) {
				int ah;
				if (i == 0) {
					ah = h[epos] + abs(cx - x[epos]) + abs(cy - y[epos]);
				} else {
					ah =
						max(h[epos] - abs(cx - x[epos]) + abs(cy - y[epos]), 0);
				}
				bool isOK = true;
				for (int j = 0; j < n; j++) {
					if (max(ah - abs(x[j] - cx) - abs(y[j] - cy), 0) != h[j]) {
						isOK = false;
					}
				}
				if (isOK) {
					printf("%d %d %d\n", cx, cy, ah);
					return 0;
				}
			}
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1264, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1240(%rbp)
	jmp	.L6
.L8:
	leaq	-416(%rbp), %rdx
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-816(%rbp), %rdx
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1216(%rbp), %rsi
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1240(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L7
	movl	-1240(%rbp), %eax
	movl	%eax, -1244(%rbp)
.L7:
	addl	$1, -1240(%rbp)
.L6:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L8
	movl	$0, -1236(%rbp)
	jmp	.L9
.L21:
	movl	$0, -1232(%rbp)
	jmp	.L10
.L20:
	movl	$0, -1228(%rbp)
	jmp	.L11
.L19:
	cmpl	$0, -1228(%rbp)
	jne	.L12
	movl	-1244(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%eax, %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-1232(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -1224(%rbp)
	jmp	.L13
.L12:
	movl	-1244(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-1244(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1236(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-1232(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -1224(%rbp)
.L13:
	movb	$1, -1249(%rbp)
	movl	$0, -1220(%rbp)
	jmp	.L14
.L16:
	movl	-1220(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	subl	-1236(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-1224(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-1220(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-1232(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovs	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	max
	movl	-1220(%rbp), %edx
	movslq	%edx, %rdx
	movl	-416(%rbp,%rdx,4), %edx
	cmpl	%edx, %eax
	je	.L15
	movb	$0, -1249(%rbp)
.L15:
	addl	$1, -1220(%rbp)
.L14:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1220(%rbp)
	jl	.L16
	cmpb	$0, -1249(%rbp)
	je	.L17
	movl	-1224(%rbp), %ecx
	movl	-1232(%rbp), %edx
	movl	-1236(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L22
.L17:
	addl	$1, -1228(%rbp)
.L11:
	cmpl	$1, -1228(%rbp)
	jle	.L19
	addl	$1, -1232(%rbp)
.L10:
	cmpl	$100, -1232(%rbp)
	jle	.L20
	addl	$1, -1236(%rbp)
.L9:
	cmpl	$100, -1236(%rbp)
	jle	.L21
	movl	$0, %eax
.L22:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	$1272, %rsp
	.cfi_def_cfa_offset 1328
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	%eax, 8(%rsp)
	testl	%eax, %eax
	jle	.L5
	leaq	48(%rsp), %r15
	leaq	448(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	848(%rsp), %rbp
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rdx
	movq	%rbp, %rcx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	0(%rbp), %edx
	movl	44(%rsp), %eax
	testl	%edx, %edx
	cmovne	%ebx, %r13d
	addl	$1, %ebx
	addq	$4, %r15
	addq	$4, %r12
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L7
	movl	%eax, 8(%rsp)
.L5:
	movslq	%r13d, %r13
	xorl	%r12d, %r12d
	leaq	848(%rsp), %r14
	xorl	%r15d, %r15d
	movl	848(%rsp,%r13,4), %eax
	movl	%eax, 24(%rsp)
	movl	48(%rsp,%r13,4), %eax
	movl	%eax, 28(%rsp)
	movl	448(%rsp,%r13,4), %eax
	movslq	8(%rsp), %r13
	movl	%eax, 16(%rsp)
.L8:
	movl	%r12d, %edx
	subl	28(%rsp), %edx
	movl	24(%rsp), %ebx
	movl	%edx, %eax
	negl	%eax
	movl	%ebx, %esi
	cmovs	%edx, %eax
	xorl	%r9d, %r9d
	subl	%eax, %esi
	addl	%ebx, %eax
	movl	%esi, 12(%rsp)
	movl	%eax, 20(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r9d, %edx
	subl	16(%rsp), %edx
	movl	12(%rsp), %ebx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	movl	$0, %edx
	addl	%eax, %ebx
	cmovs	%edx, %ebx
	addl	20(%rsp), %eax
	xorl	%ebp, %ebp
	movl	%eax, 4(%rsp)
.L15:
	movl	4(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%ebp, %ebp
	cmovne	%ebx, %r8d
	testl	%eax, %eax
	jle	.L10
	xorl	%ecx, %ecx
	movl	$1, %esi
	leaq	48(%rsp), %r11
	leaq	448(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r11,%rcx,4), %eax
	subl	%r12d, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	movl	(%r10,%rcx,4), %edx
	subl	%r9d, %edx
	movl	%edx, %edi
	negl	%edi
	cmovns	%edi, %edx
	subl	%edx, %eax
	movl	$0, %edx
	cmovs	%edx, %eax
	cmpl	(%r14,%rcx,4), %eax
	cmovne	%r15d, %esi
	addq	$1, %rcx
	cmpq	%rcx, %r13
	jne	.L12
	testb	%sil, %sil
	jne	.L10
	cmpl	$1, %ebp
	jne	.L21
	addl	$1, %r9d
	cmpl	$101, %r9d
	jne	.L17
	addl	$1, %r12d
	cmpl	$101, %r12d
	jne	.L8
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, %ebp
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %ecx
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$1272, %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
.L28:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d %d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	$1272, %rsp
	.cfi_def_cfa_offset 1328
	movq	%fs:40, %rax
	movq	%rax, 1256(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	movl	%eax, 8(%rsp)
	testl	%eax, %eax
	jle	.L5
	leaq	48(%rsp), %r15
	leaq	448(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	848(%rsp), %rbp
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r12, %rdx
	movq	%rbp, %rcx
	movq	%r15, %rsi
	xorl	%eax, %eax
	movq	%r14, %rdi
	call	__isoc99_scanf@PLT
	movl	0(%rbp), %edx
	movl	44(%rsp), %eax
	testl	%edx, %edx
	cmovne	%ebx, %r13d
	addl	$1, %ebx
	addq	$4, %r15
	addq	$4, %r12
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L7
	movl	%eax, 8(%rsp)
.L5:
	movslq	%r13d, %r13
	xorl	%r12d, %r12d
	leaq	848(%rsp), %r14
	xorl	%r15d, %r15d
	movl	848(%rsp,%r13,4), %eax
	movl	%eax, 24(%rsp)
	movl	48(%rsp,%r13,4), %eax
	movl	%eax, 28(%rsp)
	movl	448(%rsp,%r13,4), %eax
	movslq	8(%rsp), %r13
	movl	%eax, 16(%rsp)
.L8:
	movl	%r12d, %edx
	subl	28(%rsp), %edx
	movl	24(%rsp), %ebx
	movl	%edx, %eax
	negl	%eax
	movl	%ebx, %esi
	cmovs	%edx, %eax
	xorl	%r9d, %r9d
	subl	%eax, %esi
	addl	%ebx, %eax
	movl	%esi, 12(%rsp)
	movl	%eax, 20(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movl	%r9d, %edx
	subl	16(%rsp), %edx
	movl	12(%rsp), %ebx
	movl	%edx, %eax
	negl	%eax
	cmovs	%edx, %eax
	movl	$0, %edx
	addl	%eax, %ebx
	cmovs	%edx, %ebx
	addl	20(%rsp), %eax
	xorl	%ebp, %ebp
	movl	%eax, 4(%rsp)
.L15:
	movl	4(%rsp), %r8d
	movl	8(%rsp), %eax
	testl	%ebp, %ebp
	cmovne	%ebx, %r8d
	testl	%eax, %eax
	jle	.L10
	xorl	%ecx, %ecx
	movl	$1, %esi
	leaq	48(%rsp), %r11
	leaq	448(%rsp), %r10
	.p2align 4,,10
	.p2align 3
.L12:
	movl	(%r11,%rcx,4), %eax
	subl	%r12d, %eax
	movl	%eax, %edx
	negl	%edx
	cmovs	%eax, %edx
	movl	%r8d, %eax
	subl	%edx, %eax
	movl	(%r10,%rcx,4), %edx
	subl	%r9d, %edx
	movl	%edx, %edi
	negl	%edi
	cmovns	%edi, %edx
	subl	%edx, %eax
	movl	$0, %edx
	cmovs	%edx, %eax
	cmpl	(%r14,%rcx,4), %eax
	cmovne	%r15d, %esi
	addq	$1, %rcx
	cmpq	%rcx, %r13
	jne	.L12
	testb	%sil, %sil
	jne	.L10
	cmpl	$1, %ebp
	jne	.L21
	addl	$1, %r9d
	cmpl	$101, %r9d
	jne	.L17
	addl	$1, %r12d
	cmpl	$101, %r12d
	jne	.L8
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L21:
	movl	$1, %ebp
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	movl	%r9d, %ecx
	movl	%r12d, %edx
	leaq	.LC2(%rip), %rsi
	xorl	%eax, %eax
	movl	$1, %edi
	call	__printf_chk@PLT
.L14:
	movq	1256(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L28
	addq	$1272, %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
.L28:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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 <math.h>
#include <stdbool.h>
#include <stdio.h>
int min(int x, int y) {
	return x > y ? y : x;
}
int max(int x, int y) {
	return x < y ? y : x;
}
int main() {
	int n;
	int x[100], y[100], h[100];
	int epos;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d%d%d", &x[i], &y[i], &h[i]);
		if (h[i] != 0) {
			epos = i;
		}
	}
	for (int cx = 0; cx <= 100; cx++) {
		for (int cy = 0; cy <= 100; cy++) {
			for (int i = 0; i < 2; i++) {
				int ah;
				if (i == 0) {
					ah = h[epos] + abs(cx - x[epos]) + abs(cy - y[epos]);
				} else {
					ah =
						max(h[epos] - abs(cx - x[epos]) + abs(cy - y[epos]), 0);
				}
				bool isOK = true;
				for (int j = 0; j < n; j++) {
					if (max(ah - abs(x[j] - cx) - abs(y[j] - cy), 0) != h[j]) {
						isOK = false;
					}
				}
				if (isOK) {
					printf("%d %d %d\n", cx, cy, ah);
					return 0;
				}
			}
		}
	}
	return 0;
}
2
-1 0 100
2 1 98
 3
99 1 191
000 1 192
99 0 192
 2
-2 0 100
2 2 98
 3
99 1 191
000 1 154
99 0 192
 3
99 1 191
000 1 210
99 0 192
 2
-1 -1 101
2 3 98
 3
99 1 191
000 1 180
99 0 192
 3
99 1 191
010 1 154
99 0 192
 3
99 1 191
000 1 236
99 0 192
 3
99 1 191
010 1 236
99 0 192

0 0 101
 49 0 242
 0 0 102
 68 0 223
 40 0 251
 0 0 103
 55 0 236
 73 0 218
 27 0 264
 32 0 259

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

```c
#include <math.h>
#include <stdbool.h>
#include <stdio.h>
int min(int x, int y) {
	return x > y ? y : x;
}
int max(int x, int y) {
	return x < y ? y : x;
}
int main() {
	int n;
	int x[100], y[100], h[100];
	int epos;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d%d%d", &x[i], &y[i], &h[i]);
		if (h[i] != 0) {
			epos = i;
		}
	}
	for (int cx = 0; cx <= 100; cx++) {
		for (int cy = 0; cy <= 100; cy++) {
			for (int i = 0; i < 2; i++) {
				int ah;
				if (i == 0) {
					ah = h[epos] + abs(cx - x[epos]) + abs(cy - y[epos]);
				} else {
					ah =
						max(h[epos] - abs(cx - x[epos]) + abs(cy - y[epos]), 0);
				}
				bool isOK = true;
				for (int j = 0; j < n; j++) {
					if (max(ah - abs(x[j] - cx) - abs(y[j] - cy), 0) != h[j]) {
						isOK = false;
					}
				}
				if (isOK) {
					printf("%d %d %d\n", cx, cy, ah);
					return 0;
				}
			}
		}
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	min
	.type	min, @function
min:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1264, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1240(%rbp)
	jmp	.L6
.L8:
	leaq	-416(%rbp), %rdx
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-816(%rbp), %rdx
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1216(%rbp), %rsi
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1240(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L7
	movl	-1240(%rbp), %eax
	movl	%eax, -1244(%rbp)
.L7:
	addl	$1, -1240(%rbp)
.L6:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L8
	movl	$0, -1236(%rbp)
	jmp	.L9
.L21:
	movl	$0, -1232(%rbp)
	jmp	.L10
.L20:
	movl	$0, -1228(%rbp)
	jmp	.L11
.L19:
	cmpl	$0, -1228(%rbp)
	jne	.L12
	movl	-1244(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%eax, %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-1232(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -1224(%rbp)
	jmp	.L13
.L12:
	movl	-1244(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-1244(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1236(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-1232(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -1224(%rbp)
.L13:
	movb	$1, -1249(%rbp)
	movl	$0, -1220(%rbp)
	jmp	.L14
.L16:
	movl	-1220(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	subl	-1236(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-1224(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-1220(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-1232(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovs	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	max
	movl	-1220(%rbp), %edx
	movslq	%edx, %rdx
	movl	-416(%rbp,%rdx,4), %edx
	cmpl	%edx, %eax
	je	.L15
	movb	$0, -1249(%rbp)
.L15:
	addl	$1, -1220(%rbp)
.L14:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1220(%rbp)
	jl	.L16
	cmpb	$0, -1249(%rbp)
	je	.L17
	movl	-1224(%rbp), %ecx
	movl	-1232(%rbp), %edx
	movl	-1236(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L22
.L17:
	addl	$1, -1228(%rbp)
.L11:
	cmpl	$1, -1228(%rbp)
	jle	.L19
	addl	$1, -1232(%rbp)
.L10:
	cmpl	$100, -1232(%rbp)
	jle	.L20
	addl	$1, -1236(%rbp)
.L9:
	cmpl	$100, -1236(%rbp)
	jle	.L21
	movl	$0, %eax
.L22:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	min
	.type	min, @function
min:
.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, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	min, .-min
	.globl	max
	.type	max, @function
max:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %eax
	cmpl	%eax, %edx
	cmovge	%edx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max, .-max
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d%d%d"
.LC2:
	.string	"%d %d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1264, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1248(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -1240(%rbp)
	jmp	.L6
.L8:
	leaq	-416(%rbp), %rdx
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-816(%rbp), %rdx
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-1216(%rbp), %rsi
	movl	-1240(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-1240(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L7
	movl	-1240(%rbp), %eax
	movl	%eax, -1244(%rbp)
.L7:
	addl	$1, -1240(%rbp)
.L6:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1240(%rbp)
	jl	.L8
	movl	$0, -1236(%rbp)
	jmp	.L9
.L21:
	movl	$0, -1232(%rbp)
	jmp	.L10
.L20:
	movl	$0, -1228(%rbp)
	jmp	.L11
.L19:
	cmpl	$0, -1228(%rbp)
	jne	.L12
	movl	-1244(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%eax, %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-1232(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	%eax, -1224(%rbp)
	jmp	.L13
.L12:
	movl	-1244(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-1244(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1236(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovns	%ecx, %eax
	movl	%edx, %ecx
	subl	%eax, %ecx
	movl	-1244(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %edx
	movl	-1232(%rbp), %eax
	subl	%edx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	addl	%ecx, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	max
	movl	%eax, -1224(%rbp)
.L13:
	movb	$1, -1249(%rbp)
	movl	$0, -1220(%rbp)
	jmp	.L14
.L16:
	movl	-1220(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	subl	-1236(%rbp), %eax
	movl	%eax, %edx
	negl	%edx
	cmovns	%edx, %eax
	movl	%eax, %ecx
	movl	-1224(%rbp), %eax
	subl	%ecx, %eax
	movl	%eax, %edx
	movl	-1220(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	subl	-1232(%rbp), %eax
	movl	%eax, %ecx
	negl	%ecx
	cmovs	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	movl	$0, %esi
	movl	%eax, %edi
	call	max
	movl	-1220(%rbp), %edx
	movslq	%edx, %rdx
	movl	-416(%rbp,%rdx,4), %edx
	cmpl	%edx, %eax
	je	.L15
	movb	$0, -1249(%rbp)
.L15:
	addl	$1, -1220(%rbp)
.L14:
	movl	-1248(%rbp), %eax
	cmpl	%eax, -1220(%rbp)
	jl	.L16
	cmpb	$0, -1249(%rbp)
	je	.L17
	movl	-1224(%rbp), %ecx
	movl	-1232(%rbp), %edx
	movl	-1236(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	jmp	.L22
.L17:
	addl	$1, -1228(%rbp)
.L11:
	cmpl	$1, -1228(%rbp)
	jle	.L19
	addl	$1, -1232(%rbp)
.L10:
	cmpl	$100, -1232(%rbp)
	jle	.L20
	addl	$1, -1236(%rbp)
.L9:
	cmpl	$100, -1236(%rbp)
	jle	.L21
	movl	$0, %eax
.L22:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
