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

```c
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>

void    chmin(int *left, int right)
{
        if (*left > right)
        {
                *left = right;
        }
}

int             main(void)
{
        int             n;
        int             height[100000];
        int             answer[100000];
        int             i;

        scanf("%d", &n);
        for (i = 0; i < n; i++)
        {
                scanf("%d", &height[i]);
                answer[i] = INT_MAX;
        }
        answer[0] = 0;
        for (i = 0; i < n - 1; i++)
        {
                chmin(&answer[i + 1], answer[i] + abs(height[i + 1] - height[i]));
                chmin(&answer[i + 2], answer[i] + abs(height[i + 2] - height[i]));
        }
        printf("%d\n", answer[n - 1]);
        return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L1
	movl	%esi, (%rdi)
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2147483647, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L6
.L5:
	movl	$0, 400016(%rsp)
	leal	-1(%rax), %r8d
	testl	%r8d, %r8d
	jle	.L11
	cmpl	$3, %eax
	jle	.L13
	subl	$4, %eax
	movl	16(%rsp), %r10d
	movl	20(%rsp), %r9d
	leaq	400020(%rsp), %rsi
	shrl	%eax
	movl	$2, %r11d
	leaq	16(%rsp), %rcx
	movl	400020(%rsp), %edx
	leal	2(%rax), %ebx
	xorl	%eax, %eax
	addq	%rbx, %rbx
.L9:
	movl	%r9d, %edi
	subl	%r10d, %edi
	movl	%edi, %ebp
	negl	%ebp
	cmovs	%edi, %ebp
	movl	%r11d, %edi
	addl	%eax, %ebp
	cmpl	%edx, %ebp
	cmovg	%edx, %ebp
	movl	%r10d, %edx
	movl	(%rcx,%r11,4), %r10d
	movl	%r10d, %r12d
	movl	%ebp, (%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r10d, %r12d
	addl	%eax, %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	subl	%r9d, %r12d
	movl	%r12d, %eax
	negl	%eax
	cmovs	%r12d, %eax
	addl	%ebp, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%r9d, %edx
	movl	4(%rcx,%r11,4), %r9d
	movl	%r9d, %r12d
	movl	%eax, 4(%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	addl	%ebp, %edx
	movl	8(%rsi), %ebp
	cmpl	%ebp, %edx
	cmovg	%ebp, %edx
	addq	$2, %r11
	addq	$8, %rsi
	movl	%edx, (%rsi)
	cmpq	%rbx, %r11
	jne	.L9
.L8:
	movslq	%edi, %rdx
	salq	$2, %rdx
	leaq	400016(%rsp,%rdx), %rax
	addq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %edx
	subl	(%rcx), %edx
	addl	$1, %edi
	movl	%edx, %esi
	movl	(%rax), %r9d
	negl	%esi
	cmovns	%esi, %edx
	movl	4(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	movl	%edx, 4(%rax)
	movl	8(%rcx), %edx
	subl	(%rcx), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	movl	8(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	addq	$4, %rcx
	movl	%edx, 4(%rax)
	cmpl	%r8d, %edi
	jl	.L10
.L11:
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	movl	400016(%rsp,%r8,4), %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edi, %edi
	leaq	16(%rsp), %rcx
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L1
	movl	%esi, (%rdi)
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2147483647, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L6
.L5:
	movl	$0, 400016(%rsp)
	leal	-1(%rax), %r8d
	testl	%r8d, %r8d
	jle	.L11
	cmpl	$3, %eax
	jle	.L13
	subl	$4, %eax
	movl	16(%rsp), %r10d
	movl	20(%rsp), %r9d
	leaq	400020(%rsp), %rsi
	shrl	%eax
	movl	$2, %r11d
	leaq	16(%rsp), %rcx
	movl	400020(%rsp), %edx
	leal	2(%rax), %ebx
	xorl	%eax, %eax
	addq	%rbx, %rbx
.L9:
	movl	%r9d, %edi
	subl	%r10d, %edi
	movl	%edi, %ebp
	negl	%ebp
	cmovs	%edi, %ebp
	movl	%r11d, %edi
	addl	%eax, %ebp
	cmpl	%edx, %ebp
	cmovg	%edx, %ebp
	movl	%r10d, %edx
	movl	(%rcx,%r11,4), %r10d
	movl	%r10d, %r12d
	movl	%ebp, (%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r10d, %r12d
	addl	%eax, %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	subl	%r9d, %r12d
	movl	%r12d, %eax
	negl	%eax
	cmovs	%r12d, %eax
	addl	%ebp, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%r9d, %edx
	movl	4(%rcx,%r11,4), %r9d
	movl	%r9d, %r12d
	movl	%eax, 4(%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	addl	%ebp, %edx
	movl	8(%rsi), %ebp
	cmpl	%ebp, %edx
	cmovg	%ebp, %edx
	addq	$2, %r11
	addq	$8, %rsi
	movl	%edx, (%rsi)
	cmpq	%rbx, %r11
	jne	.L9
.L8:
	movslq	%edi, %rdx
	salq	$2, %rdx
	leaq	400016(%rsp,%rdx), %rax
	addq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %edx
	subl	(%rcx), %edx
	addl	$1, %edi
	movl	%edx, %esi
	movl	(%rax), %r9d
	negl	%esi
	cmovns	%esi, %edx
	movl	4(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	movl	%edx, 4(%rax)
	movl	8(%rcx), %edx
	subl	(%rcx), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	movl	8(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	addq	$4, %rcx
	movl	%edx, 4(%rax)
	cmpl	%r8d, %edi
	jl	.L10
.L11:
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	movl	400016(%rsp,%r8,4), %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edi, %edi
	leaq	16(%rsp), %rcx
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L1
	movl	%esi, (%rdi)
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2147483647, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L6
.L5:
	movl	$0, 400016(%rsp)
	leal	-1(%rax), %r8d
	testl	%r8d, %r8d
	jle	.L11
	cmpl	$3, %eax
	jle	.L13
	subl	$4, %eax
	movl	16(%rsp), %r10d
	movl	20(%rsp), %r9d
	leaq	400020(%rsp), %rsi
	shrl	%eax
	movl	$2, %r11d
	leaq	16(%rsp), %rcx
	movl	400020(%rsp), %edx
	leal	2(%rax), %ebx
	xorl	%eax, %eax
	addq	%rbx, %rbx
.L9:
	movl	%r9d, %edi
	subl	%r10d, %edi
	movl	%edi, %ebp
	negl	%ebp
	cmovs	%edi, %ebp
	movl	%r11d, %edi
	addl	%eax, %ebp
	cmpl	%edx, %ebp
	cmovg	%edx, %ebp
	movl	%r10d, %edx
	movl	(%rcx,%r11,4), %r10d
	movl	%r10d, %r12d
	movl	%ebp, (%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r10d, %r12d
	addl	%eax, %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	subl	%r9d, %r12d
	movl	%r12d, %eax
	negl	%eax
	cmovs	%r12d, %eax
	addl	%ebp, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%r9d, %edx
	movl	4(%rcx,%r11,4), %r9d
	movl	%r9d, %r12d
	movl	%eax, 4(%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	addl	%ebp, %edx
	movl	8(%rsi), %ebp
	cmpl	%ebp, %edx
	cmovg	%ebp, %edx
	addq	$2, %r11
	addq	$8, %rsi
	movl	%edx, (%rsi)
	cmpq	%rbx, %r11
	jne	.L9
.L8:
	movslq	%edi, %rdx
	salq	$2, %rdx
	leaq	400016(%rsp,%rdx), %rax
	addq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %edx
	subl	(%rcx), %edx
	addl	$1, %edi
	movl	%edx, %esi
	movl	(%rax), %r9d
	negl	%esi
	cmovns	%esi, %edx
	movl	4(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	movl	%edx, 4(%rax)
	movl	8(%rcx), %edx
	subl	(%rcx), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	movl	8(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	addq	$4, %rcx
	movl	%edx, 4(%rax)
	cmpl	%r8d, %edi
	jl	.L10
.L11:
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	movl	400016(%rsp,%r8,4), %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edi, %edi
	leaq	16(%rsp), %rcx
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>

void    chmin(int *left, int right)
{
        if (*left > right)
        {
                *left = right;
        }
}

int             main(void)
{
        int             n;
        int             height[100000];
        int             answer[100000];
        int             i;

        scanf("%d", &n);
        for (i = 0; i < n; i++)
        {
                scanf("%d", &height[i]);
                answer[i] = INT_MAX;
        }
        answer[0] = 0;
        for (i = 0; i < n - 1; i++)
        {
                chmin(&answer[i + 1], answer[i] + abs(height[i + 1] - height[i]));
                chmin(&answer[i + 2], answer[i] + abs(height[i + 2] - height[i]));
        }
        printf("%d\n", answer[n - 1]);
        return (0);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>

void    chmin(int *left, int right)
{
        if (*left > right)
        {
                *left = right;
        }
}

int             main(void)
{
        int             n;
        int             height[100000];
        int             answer[100000];
        int             i;

        scanf("%d", &n);
        for (i = 0; i < n; i++)
        {
                scanf("%d", &height[i]);
                answer[i] = INT_MAX;
        }
        answer[0] = 0;
        for (i = 0; i < n - 1; i++)
        {
                chmin(&answer[i + 1], answer[i] + abs(height[i + 1] - height[i]));
                chmin(&answer[i + 2], answer[i] + abs(height[i + 2] - height[i]));
        }
        printf("%d\n", answer[n - 1]);
        return (0);
}```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

6
30 10 60 10 60 57
 4
10 14 40 20
 2
18 10
 4
5 14 40 20
 2
33 10
 6
30 12 60 10 60 9
 2
9 10
 6
30 12 60 17 60 9
 2
9 18
 6
30 12 60 33 60 9

33
 10
 8
 15
 23
 21
 1
 31
 9
 63

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

```c
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>

void    chmin(int *left, int right)
{
        if (*left > right)
        {
                *left = right;
        }
}

int             main(void)
{
        int             n;
        int             height[100000];
        int             answer[100000];
        int             i;

        scanf("%d", &n);
        for (i = 0; i < n; i++)
        {
                scanf("%d", &height[i]);
                answer[i] = INT_MAX;
        }
        answer[0] = 0;
        for (i = 0; i < n - 1; i++)
        {
                chmin(&answer[i + 1], answer[i] + abs(height[i + 1] - height[i]));
                chmin(&answer[i + 2], answer[i] + abs(height[i + 2] - height[i]));
        }
        printf("%d\n", answer[n - 1]);
        return (0);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L1
	movl	%esi, (%rdi)
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2147483647, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L6
.L5:
	movl	$0, 400016(%rsp)
	leal	-1(%rax), %r8d
	testl	%r8d, %r8d
	jle	.L11
	cmpl	$3, %eax
	jle	.L13
	subl	$4, %eax
	movl	16(%rsp), %r10d
	movl	20(%rsp), %r9d
	leaq	400020(%rsp), %rsi
	shrl	%eax
	movl	$2, %r11d
	leaq	16(%rsp), %rcx
	movl	400020(%rsp), %edx
	leal	2(%rax), %ebx
	xorl	%eax, %eax
	addq	%rbx, %rbx
.L9:
	movl	%r9d, %edi
	subl	%r10d, %edi
	movl	%edi, %ebp
	negl	%ebp
	cmovs	%edi, %ebp
	movl	%r11d, %edi
	addl	%eax, %ebp
	cmpl	%edx, %ebp
	cmovg	%edx, %ebp
	movl	%r10d, %edx
	movl	(%rcx,%r11,4), %r10d
	movl	%r10d, %r12d
	movl	%ebp, (%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r10d, %r12d
	addl	%eax, %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	subl	%r9d, %r12d
	movl	%r12d, %eax
	negl	%eax
	cmovs	%r12d, %eax
	addl	%ebp, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%r9d, %edx
	movl	4(%rcx,%r11,4), %r9d
	movl	%r9d, %r12d
	movl	%eax, 4(%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	addl	%ebp, %edx
	movl	8(%rsi), %ebp
	cmpl	%ebp, %edx
	cmovg	%ebp, %edx
	addq	$2, %r11
	addq	$8, %rsi
	movl	%edx, (%rsi)
	cmpq	%rbx, %r11
	jne	.L9
.L8:
	movslq	%edi, %rdx
	salq	$2, %rdx
	leaq	400016(%rsp,%rdx), %rax
	addq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %edx
	subl	(%rcx), %edx
	addl	$1, %edi
	movl	%edx, %esi
	movl	(%rax), %r9d
	negl	%esi
	cmovns	%esi, %edx
	movl	4(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	movl	%edx, 4(%rax)
	movl	8(%rcx), %edx
	subl	(%rcx), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	movl	8(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	addq	$4, %rcx
	movl	%edx, 4(%rax)
	cmpl	%r8d, %edi
	jl	.L10
.L11:
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	movl	400016(%rsp,%r8,4), %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edi, %edi
	leaq	16(%rsp), %rcx
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	chmin
	.type	chmin, @function
chmin:
.LFB39:
	.cfi_startproc
	endbr64
	cmpl	%esi, (%rdi)
	jle	.L1
	movl	%esi, (%rdi)
.L1:
	ret
	.cfi_endproc
.LFE39:
	.size	chmin, .-chmin
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB40:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798760
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1320, %rsp
	.cfi_def_cfa_offset 800080
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L5
	leaq	16(%rsp), %rbp
	xorl	%ebx, %ebx
	leaq	400016(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$4, %rbp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	movl	$2147483647, 0(%r13,%rbx,4)
	addq	$1, %rbx
	cmpl	%ebx, %eax
	jg	.L6
.L5:
	movl	$0, 400016(%rsp)
	leal	-1(%rax), %r8d
	testl	%r8d, %r8d
	jle	.L11
	cmpl	$3, %eax
	jle	.L13
	subl	$4, %eax
	movl	16(%rsp), %r10d
	movl	20(%rsp), %r9d
	leaq	400020(%rsp), %rsi
	shrl	%eax
	movl	$2, %r11d
	leaq	16(%rsp), %rcx
	movl	400020(%rsp), %edx
	leal	2(%rax), %ebx
	xorl	%eax, %eax
	addq	%rbx, %rbx
.L9:
	movl	%r9d, %edi
	subl	%r10d, %edi
	movl	%edi, %ebp
	negl	%ebp
	cmovs	%edi, %ebp
	movl	%r11d, %edi
	addl	%eax, %ebp
	cmpl	%edx, %ebp
	cmovg	%edx, %ebp
	movl	%r10d, %edx
	movl	(%rcx,%r11,4), %r10d
	movl	%r10d, %r12d
	movl	%ebp, (%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	movl	%r10d, %r12d
	addl	%eax, %edx
	movl	4(%rsi), %eax
	cmpl	%eax, %edx
	cmovg	%eax, %edx
	subl	%r9d, %r12d
	movl	%r12d, %eax
	negl	%eax
	cmovs	%r12d, %eax
	addl	%ebp, %eax
	cmpl	%eax, %edx
	cmovle	%edx, %eax
	movl	%r9d, %edx
	movl	4(%rcx,%r11,4), %r9d
	movl	%r9d, %r12d
	movl	%eax, 4(%rsi)
	subl	%edx, %r12d
	movl	%r12d, %edx
	negl	%edx
	cmovs	%r12d, %edx
	addl	%ebp, %edx
	movl	8(%rsi), %ebp
	cmpl	%ebp, %edx
	cmovg	%ebp, %edx
	addq	$2, %r11
	addq	$8, %rsi
	movl	%edx, (%rsi)
	cmpq	%rbx, %r11
	jne	.L9
.L8:
	movslq	%edi, %rdx
	salq	$2, %rdx
	leaq	400016(%rsp,%rdx), %rax
	addq	%rdx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	4(%rcx), %edx
	subl	(%rcx), %edx
	addl	$1, %edi
	movl	%edx, %esi
	movl	(%rax), %r9d
	negl	%esi
	cmovns	%esi, %edx
	movl	4(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	movl	%edx, 4(%rax)
	movl	8(%rcx), %edx
	subl	(%rcx), %edx
	movl	%edx, %esi
	negl	%esi
	cmovns	%esi, %edx
	movl	8(%rax), %esi
	addl	%r9d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$4, %rax
	addq	$4, %rcx
	movl	%edx, 4(%rax)
	cmpl	%r8d, %edi
	jl	.L10
.L11:
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	movl	400016(%rsp,%r8,4), %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$800040, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L13:
	.cfi_restore_state
	xorl	%edi, %edi
	leaq	16(%rsp), %rcx
	jmp	.L8
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE40:
	.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:
```