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

```c
#include<stdio.h>
#define MAX 2147483647
#define NMAX 100001


int find(int A[],int x,int y){
int i;
int min=MAX;

for(i=x;i<=y;i++){
 if(A[i]<=min){min=A[i];}
}

return min;
}



int main(){
int n,q,i;
int com,x,y;
int A[NMAX];
int C[NMAX];
scanf("%d %d",&n,&q);

for(i=0;i<n;i++)A[i]=MAX;
for(i=0;i<q;i++)C[i]=-1;

for(i=0;i<q;i++){
 scanf("%d %d %d",&com,&x,&y);
 switch(com){
  case 0:A[x]=y;
         break;
  case 1:C[i]=find(A,x,y);
         break;
 }
}


for(i=0;i<q;i++){if(C[i]!=-1){printf("%d\n",C[i]);}}

return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$2147483647, -4(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L3
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L3:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800052(%rbp), %rdx
	leaq	-800056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800036(%rbp)
	jmp	.L7
.L8:
	movl	-800036(%rbp), %eax
	cltq
	movl	$2147483647, -800032(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L7:
	movl	-800056(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L8
	movl	$0, -800036(%rbp)
	jmp	.L9
.L10:
	movl	-800036(%rbp), %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L9:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L10
	movl	$0, -800036(%rbp)
	jmp	.L11
.L15:
	leaq	-800040(%rbp), %rcx
	leaq	-800044(%rbp), %rdx
	leaq	-800048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800048(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	cmpl	$1, %eax
	je	.L13
	jmp	.L14
.L12:
	movl	-800044(%rbp), %eax
	movl	-800040(%rbp), %edx
	cltq
	movl	%edx, -800032(%rbp,%rax,4)
	jmp	.L14
.L13:
	movl	-800040(%rbp), %edx
	movl	-800044(%rbp), %ecx
	leaq	-800032(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find
	movl	-800036(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	nop
.L14:
	addl	$1, -800036(%rbp)
.L11:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L15
	movl	$0, -800036(%rbp)
	jmp	.L16
.L18:
	movl	-800036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L17
	movl	-800036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -800036(%rbp)
.L16:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L18
	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
.LFE1:
	.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	find
	.type	find, @function
find:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movl	%esi, %ecx
	movl	%edx, %edi
	cmpl	%edx, %esi
	jg	.L7
	movl	%edx, %eax
	subl	%esi, %eax
	leal	1(%rax), %r9d
	cmpl	$2, %eax
	jbe	.L8
	movslq	%esi, %rax
	movdqa	.LC0(%rip), %xmm0
	leaq	(%r8,%rax,4), %rdx
	movl	%r9d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %esi
	leaq	16(%rdx), %rax
	salq	$4, %rsi
	addq	%rax, %rsi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$16, %rax
.L4:
	movdqu	(%rdx), %xmm2
	movq	%rax, %rdx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L12
	movdqa	%xmm0, %xmm2
	movl	%r9d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%edx, %r9d
	je	.L13
.L3:
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rsi
	movl	(%r8,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %edi
	jl	.L1
	movl	4(%r8,%rsi), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	addl	$2, %ecx
	cmpl	%ecx, %edi
	jl	.L1
	movl	8(%r8,%rsi), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$2147483647, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	ret
.L8:
	movl	$2147483647, %eax
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	find, .-find
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L21
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L36
	movl	%edx, %ecx
	movdqa	.LC0(%rip), %xmm0
	leaq	32(%rsp), %rax
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	48(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L19:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L19
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L21
.L18:
	movslq	%eax, %rcx
	movl	$2147483647, 32(%rsp,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L21
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	$2147483647, 32(%rsp,%rcx,4)
	cmpl	%eax, %edx
	jle	.L21
	cltq
	movl	$2147483647, 32(%rsp,%rax,4)
.L21:
	movslq	16(%rsp), %rax
	testl	%eax, %eax
	jle	.L17
	leaq	400048(%rsp), %rbx
	movl	$255, %esi
	leaq	28(%rsp), %r14
	xorl	%r15d, %r15d
	leaq	0(,%rax,4), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %r13
	call	memset@PLT
	leaq	20(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L23
	cmpl	$1, %eax
	jne	.L25
	movl	28(%rsp), %edi
	movl	24(%rsp), %esi
	cmpl	%esi, %edi
	jl	.L37
	movl	%edi, %eax
	subl	%esi, %eax
	leal	1(%rax), %r8d
	cmpl	$2, %eax
	jbe	.L38
	movslq	%esi, %rax
	movdqa	.LC0(%rip), %xmm0
	leaq	32(%rsp,%rax,4), %rdx
	movl	%r8d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %ecx
	leaq	16(%rdx), %rax
	salq	$4, %rcx
	addq	%rax, %rcx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L45:
	addq	$16, %rax
.L28:
	movdqu	(%rdx), %xmm2
	movq	%rax, %rdx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rcx
	jne	.L45
	movdqa	%xmm0, %xmm2
	movl	%r8d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edx, %r8d
	je	.L26
.L27:
	movslq	%esi, %rdx
	leaq	0(,%rdx,4), %rcx
	movl	32(%rsp,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	1(%rsi), %edx
	cmpl	%edx, %edi
	jl	.L26
	movl	36(%rsp,%rcx), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	2(%rsi), %edx
	cmpl	%edx, %edi
	jl	.L26
	movl	40(%rsp,%rcx), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
.L26:
	movl	%eax, (%rbx,%r15,4)
.L25:
	movl	16(%rsp), %eax
	addq	$1, %r15
	cmpl	%r15d, %eax
	jg	.L31
	testl	%eax, %eax
	jle	.L17
	xorl	%ebp, %ebp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rbx,%rbp,4), %edx
	cmpl	$-1, %edx
	je	.L32
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	movl	16(%rsp), %eax
	cmpl	%ebp, %eax
	jg	.L34
.L17:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$800072, %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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	addq	$1, %rbp
	cmpl	%ebp, %eax
	jg	.L34
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	24(%rsp), %rax
	movl	28(%rsp), %edx
	movl	%edx, 32(%rsp,%rax,4)
	jmp	.L25
.L37:
	movl	$2147483647, %eax
	jmp	.L26
.L38:
	movl	$2147483647, %eax
	jmp	.L27
.L36:
	xorl	%eax, %eax
	jmp	.L18
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.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	find
	.type	find, @function
find:
.LFB23:
	.cfi_startproc
	endbr64
	movq	%rdi, %r8
	movl	%esi, %ecx
	movl	%edx, %edi
	cmpl	%edx, %esi
	jg	.L7
	movl	%edx, %eax
	subl	%esi, %eax
	leal	1(%rax), %r9d
	cmpl	$2, %eax
	jbe	.L8
	movslq	%esi, %rax
	movdqa	.LC0(%rip), %xmm0
	leaq	(%r8,%rax,4), %rdx
	movl	%r9d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %esi
	leaq	16(%rdx), %rax
	salq	$4, %rsi
	addq	%rax, %rsi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$16, %rax
.L4:
	movdqu	(%rdx), %xmm2
	movq	%rax, %rdx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L12
	movdqa	%xmm0, %xmm2
	movl	%r9d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %ecx
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	cmpl	%edx, %r9d
	je	.L13
.L3:
	movslq	%ecx, %rdx
	leaq	0(,%rdx,4), %rsi
	movl	(%r8,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %edi
	jl	.L1
	movl	4(%r8,%rsi), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	addl	$2, %ecx
	cmpl	%ecx, %edi
	jl	.L1
	movl	8(%r8,%rsi), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$2147483647, %eax
.L1:
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	ret
.L8:
	movl	$2147483647, %eax
	jmp	.L3
	.cfi_endproc
.LFE23:
	.size	find, .-find
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d %d %d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798776
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1352, %rsp
	.cfi_def_cfa_offset 800128
	leaq	.LC1(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 800056(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edx
	testl	%edx, %edx
	jle	.L21
	leal	-1(%rdx), %eax
	cmpl	$2, %eax
	jbe	.L36
	movl	%edx, %ecx
	movdqa	.LC0(%rip), %xmm0
	leaq	32(%rsp), %rax
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	48(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L19:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L19
	movl	%edx, %eax
	andl	$-4, %eax
	testb	$3, %dl
	je	.L21
.L18:
	movslq	%eax, %rcx
	movl	$2147483647, 32(%rsp,%rcx,4)
	leal	1(%rax), %ecx
	cmpl	%ecx, %edx
	jle	.L21
	movslq	%ecx, %rcx
	addl	$2, %eax
	movl	$2147483647, 32(%rsp,%rcx,4)
	cmpl	%eax, %edx
	jle	.L21
	cltq
	movl	$2147483647, 32(%rsp,%rax,4)
.L21:
	movslq	16(%rsp), %rax
	testl	%eax, %eax
	jle	.L17
	leaq	400048(%rsp), %rbx
	movl	$255, %esi
	leaq	28(%rsp), %r14
	xorl	%r15d, %r15d
	leaq	0(,%rax,4), %rdx
	movq	%rbx, %rdi
	leaq	24(%rsp), %r13
	call	memset@PLT
	leaq	20(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L31:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	testl	%eax, %eax
	je	.L23
	cmpl	$1, %eax
	jne	.L25
	movl	28(%rsp), %edi
	movl	24(%rsp), %esi
	cmpl	%esi, %edi
	jl	.L37
	movl	%edi, %eax
	subl	%esi, %eax
	leal	1(%rax), %r8d
	cmpl	$2, %eax
	jbe	.L38
	movslq	%esi, %rax
	movdqa	.LC0(%rip), %xmm0
	leaq	32(%rsp,%rax,4), %rdx
	movl	%r8d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %ecx
	leaq	16(%rdx), %rax
	salq	$4, %rcx
	addq	%rax, %rcx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L45:
	addq	$16, %rax
.L28:
	movdqu	(%rdx), %xmm2
	movq	%rax, %rdx
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	cmpq	%rax, %rcx
	jne	.L45
	movdqa	%xmm0, %xmm2
	movl	%r8d, %edx
	psrldq	$8, %xmm2
	andl	$-4, %edx
	movdqa	%xmm2, %xmm1
	addl	%edx, %esi
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmpl	%edx, %r8d
	je	.L26
.L27:
	movslq	%esi, %rdx
	leaq	0(,%rdx,4), %rcx
	movl	32(%rsp,%rdx,4), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	1(%rsi), %edx
	cmpl	%edx, %edi
	jl	.L26
	movl	36(%rsp,%rcx), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	leal	2(%rsi), %edx
	cmpl	%edx, %edi
	jl	.L26
	movl	40(%rsp,%rcx), %edx
	cmpl	%edx, %eax
	cmovg	%edx, %eax
.L26:
	movl	%eax, (%rbx,%r15,4)
.L25:
	movl	16(%rsp), %eax
	addq	$1, %r15
	cmpl	%r15d, %eax
	jg	.L31
	testl	%eax, %eax
	jle	.L17
	xorl	%ebp, %ebp
	leaq	.LC3(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L34:
	movl	(%rbx,%rbp,4), %edx
	cmpl	$-1, %edx
	je	.L32
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$1, %rbp
	call	__printf_chk@PLT
	movl	16(%rsp), %eax
	cmpl	%ebp, %eax
	jg	.L34
.L17:
	movq	800056(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L46
	addq	$800072, %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
	.p2align 4,,10
	.p2align 3
.L32:
	.cfi_restore_state
	addq	$1, %rbp
	cmpl	%ebp, %eax
	jg	.L34
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L23:
	movslq	24(%rsp), %rax
	movl	28(%rsp), %edx
	movl	%edx, 32(%rsp,%rax,4)
	jmp	.L25
.L37:
	movl	$2147483647, %eax
	jmp	.L26
.L38:
	movl	$2147483647, %eax
	jmp	.L27
.L36:
	xorl	%eax, %eax
	jmp	.L18
.L46:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.long	2147483647
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include<stdio.h>
#define MAX 2147483647
#define NMAX 100001


int find(int A[],int x,int y){
int i;
int min=MAX;

for(i=x;i<=y;i++){
 if(A[i]<=min){min=A[i];}
}

return min;
}



int main(){
int n,q,i;
int com,x,y;
int A[NMAX];
int C[NMAX];
scanf("%d %d",&n,&q);

for(i=0;i<n;i++)A[i]=MAX;
for(i=0;i<q;i++)C[i]=-1;

for(i=0;i<q;i++){
 scanf("%d %d %d",&com,&x,&y);
 switch(com){
  case 0:A[x]=y;
         break;
  case 1:C[i]=find(A,x,y);
         break;
 }
}


for(i=0;i<q;i++){if(C[i]!=-1){printf("%d\n",C[i]);}}

return 0;
}

1 3
1 -1 0
0 0 5
1 0 0
 3 5
0 0 1
0 1 2
0 2 3
1 0 2
1 1 4
 1 3
1 -1 0
0 0 9
1 0 0
 3 5
0 0 1
0 2 2
0 2 3
1 0 2
1 1 2
 1 3
1 -1 0
0 0 5
0 0 0
 1 3
1 -1 0
0 0 15
1 0 0
 3 5
0 0 1
0 2 2
0 2 3
1 0 2
0 1 2
 3 5
0 0 1
0 0 2
0 2 6
1 0 2
1 1 4
 3 5
0 0 2
0 2 2
0 2 3
1 0 2
0 1 2
 1 3
1 -1 0
0 0 4
1 0 0

0
5
 1
0
 0
9
 1
3
 0
 0
15
 1
 2
0
 2
 0
4

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

```c
#include<stdio.h>
#define MAX 2147483647
#define NMAX 100001


int find(int A[],int x,int y){
int i;
int min=MAX;

for(i=x;i<=y;i++){
 if(A[i]<=min){min=A[i];}
}

return min;
}



int main(){
int n,q,i;
int com,x,y;
int A[NMAX];
int C[NMAX];
scanf("%d %d",&n,&q);

for(i=0;i<n;i++)A[i]=MAX;
for(i=0;i<q;i++)C[i]=-1;

for(i=0;i<q;i++){
 scanf("%d %d %d",&com,&x,&y);
 switch(com){
  case 0:A[x]=y;
         break;
  case 1:C[i]=find(A,x,y);
         break;
 }
}


for(i=0;i<q;i++){if(C[i]!=-1){printf("%d\n",C[i]);}}

return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$2147483647, -4(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L3
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L3:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800052(%rbp), %rdx
	leaq	-800056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800036(%rbp)
	jmp	.L7
.L8:
	movl	-800036(%rbp), %eax
	cltq
	movl	$2147483647, -800032(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L7:
	movl	-800056(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L8
	movl	$0, -800036(%rbp)
	jmp	.L9
.L10:
	movl	-800036(%rbp), %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L9:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L10
	movl	$0, -800036(%rbp)
	jmp	.L11
.L15:
	leaq	-800040(%rbp), %rcx
	leaq	-800044(%rbp), %rdx
	leaq	-800048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800048(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	cmpl	$1, %eax
	je	.L13
	jmp	.L14
.L12:
	movl	-800044(%rbp), %eax
	movl	-800040(%rbp), %edx
	cltq
	movl	%edx, -800032(%rbp,%rax,4)
	jmp	.L14
.L13:
	movl	-800040(%rbp), %edx
	movl	-800044(%rbp), %ecx
	leaq	-800032(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find
	movl	-800036(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	nop
.L14:
	addl	$1, -800036(%rbp)
.L11:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L15
	movl	$0, -800036(%rbp)
	jmp	.L16
.L18:
	movl	-800036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L17
	movl	-800036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -800036(%rbp)
.L16:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L18
	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
.LFE1:
	.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	find
	.type	find, @function
find:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	%edx, -32(%rbp)
	movl	$2147483647, -4(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L2
.L4:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L3
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L3:
	addl	$1, -8(%rbp)
.L2:
	movl	-8(%rbp), %eax
	cmpl	-32(%rbp), %eax
	jle	.L4
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	find, .-find
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d %d %d"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-798720(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1344, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-800052(%rbp), %rdx
	leaq	-800056(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -800036(%rbp)
	jmp	.L7
.L8:
	movl	-800036(%rbp), %eax
	cltq
	movl	$2147483647, -800032(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L7:
	movl	-800056(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L8
	movl	$0, -800036(%rbp)
	jmp	.L9
.L10:
	movl	-800036(%rbp), %eax
	cltq
	movl	$-1, -400016(%rbp,%rax,4)
	addl	$1, -800036(%rbp)
.L9:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L10
	movl	$0, -800036(%rbp)
	jmp	.L11
.L15:
	leaq	-800040(%rbp), %rcx
	leaq	-800044(%rbp), %rdx
	leaq	-800048(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-800048(%rbp), %eax
	testl	%eax, %eax
	je	.L12
	cmpl	$1, %eax
	je	.L13
	jmp	.L14
.L12:
	movl	-800044(%rbp), %eax
	movl	-800040(%rbp), %edx
	cltq
	movl	%edx, -800032(%rbp,%rax,4)
	jmp	.L14
.L13:
	movl	-800040(%rbp), %edx
	movl	-800044(%rbp), %ecx
	leaq	-800032(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	find
	movl	-800036(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -400016(%rbp,%rdx,4)
	nop
.L14:
	addl	$1, -800036(%rbp)
.L11:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L15
	movl	$0, -800036(%rbp)
	jmp	.L16
.L18:
	movl	-800036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	cmpl	$-1, %eax
	je	.L17
	movl	-800036(%rbp), %eax
	cltq
	movl	-400016(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L17:
	addl	$1, -800036(%rbp)
.L16:
	movl	-800052(%rbp), %eax
	cmpl	%eax, -800036(%rbp)
	jl	.L18
	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
.LFE1:
	.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:
