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 <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define INF ((1LL<<62)-(1LL<<31))

ll n;
ll a[200010];

int main(){
	scanf("%lld",&n);
	rep(i,0,n){
		ll t;
		scanf("%lld",&t);
		a[t-1]=i;
	}
	ll ans=1,temp=1;
	rep(i,1,n){
		if(a[i-1]<a[i])temp++;
		else {ans=max(ans,temp);temp=1;}
	}
	ans=max(ans,temp);
	printf("%lld",n-ans);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L2
	xorl	%ebx, %ebx
	movq	%rsp, %r13
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	movq	n(%rip), %rdx
	movq	%rbx, -8(%rbp,%rax,8)
	addq	$1, %rbx
	cmpq	%rbx, %rdx
	jg	.L3
	cmpq	$1, %rdx
	jle	.L2
	movq	0(%rbp), %rcx
	leaq	0(%rbp,%rdx,8), %r9
	movl	$1, %esi
	leaq	8+a(%rip), %rax
	movl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rax
	addq	$1, %rsi
	cmpq	%r9, %rax
	je	.L7
.L6:
	movq	%rcx, %r8
	movq	(%rax), %rcx
	cmpq	%r8, %rcx
	jg	.L13
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	addq	$8, %rax
	movl	$1, %esi
	cmpq	%r9, %rax
	jne	.L6
.L7:
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$24, %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
.L2:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %edi
	jmp	.L7
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L2
	xorl	%ebx, %ebx
	movq	%rsp, %r13
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	movq	n(%rip), %rdx
	movq	%rbx, -8(%rbp,%rax,8)
	addq	$1, %rbx
	cmpq	%rbx, %rdx
	jg	.L3
	cmpq	$1, %rdx
	jle	.L2
	movq	0(%rbp), %rcx
	leaq	0(%rbp,%rdx,8), %r9
	movl	$1, %esi
	leaq	8+a(%rip), %rax
	movl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rax
	addq	$1, %rsi
	cmpq	%r9, %rax
	je	.L7
.L6:
	movq	%rcx, %r8
	movq	(%rax), %rcx
	cmpq	%r8, %rcx
	jg	.L13
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	addq	$8, %rax
	movl	$1, %esi
	cmpq	%r9, %rax
	jne	.L6
.L7:
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$24, %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
.L2:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %edi
	jmp	.L7
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L2
	xorl	%ebx, %ebx
	movq	%rsp, %r13
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	movq	n(%rip), %rdx
	movq	%rbx, -8(%rbp,%rax,8)
	addq	$1, %rbx
	cmpq	%rbx, %rdx
	jg	.L3
	cmpq	$1, %rdx
	jle	.L2
	movq	0(%rbp), %rcx
	leaq	0(%rbp,%rdx,8), %r9
	movl	$1, %esi
	leaq	8+a(%rip), %rax
	movl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rax
	addq	$1, %rsi
	cmpq	%r9, %rax
	je	.L7
.L6:
	movq	%rcx, %r8
	movq	(%rax), %rcx
	cmpq	%r8, %rcx
	jg	.L13
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	addq	$8, %rax
	movl	$1, %esi
	cmpq	%r9, %rax
	jne	.L6
.L7:
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$24, %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
.L2:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %edi
	jmp	.L7
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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 <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define INF ((1LL<<62)-(1LL<<31))

ll n;
ll a[200010];

int main(){
	scanf("%lld",&n);
	rep(i,0,n){
		ll t;
		scanf("%lld",&t);
		a[t-1]=i;
	}
	ll ans=1,temp=1;
	rep(i,1,n){
		if(a[i-1]<a[i])temp++;
		else {ans=max(ans,temp);temp=1;}
	}
	ans=max(ans,temp);
	printf("%lld",n-ans);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define INF ((1LL<<62)-(1LL<<31))

ll n;
ll a[200010];

int main(){
	scanf("%lld",&n);
	rep(i,0,n){
		ll t;
		scanf("%lld",&t);
		a[t-1]=i;
	}
	ll ans=1,temp=1;
	rep(i,1,n){
		if(a[i-1]<a[i])temp++;
		else {ans=max(ans,temp);temp=1;}
	}
	ans=max(ans,temp);
	printf("%lld",n-ans);
}```

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
2
3
5
1
4
6
 8
6
3
2
1
7
4
8
5
 4
1
4
2
3
 6
3
1
5
2
4
6
 4
3
1
2
4
 8
6
3
1
2
5
4
8
7
 4
2
4
1
3
 8
6
3
2
1
4
7
8
5
 6
2
5
3
1
4
6
 8
6
3
2
1
7
4
5
8

3 5 1 4 2 6 2 5 3 5
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 <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define INF ((1LL<<62)-(1LL<<31))

ll n;
ll a[200010];

int main(){
	scanf("%lld",&n);
	rep(i,0,n){
		ll t;
		scanf("%lld",&t);
		a[t-1]=i;
	}
	ll ans=1,temp=1;
	rep(i,1,n){
		if(a[i-1]<a[i])temp++;
		else {ans=max(ans,temp);temp=1;}
	}
	ans=max(ans,temp);
	printf("%lld",n-ans);
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L2
	xorl	%ebx, %ebx
	movq	%rsp, %r13
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	movq	n(%rip), %rdx
	movq	%rbx, -8(%rbp,%rax,8)
	addq	$1, %rbx
	cmpq	%rbx, %rdx
	jg	.L3
	cmpq	$1, %rdx
	jle	.L2
	movq	0(%rbp), %rcx
	leaq	0(%rbp,%rdx,8), %r9
	movl	$1, %esi
	leaq	8+a(%rip), %rax
	movl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rax
	addq	$1, %rsi
	cmpq	%r9, %rax
	je	.L7
.L6:
	movq	%rcx, %r8
	movq	(%rax), %rcx
	cmpq	%r8, %rcx
	jg	.L13
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	addq	$8, %rax
	movl	$1, %esi
	cmpq	%r9, %rax
	jne	.L6
.L7:
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$24, %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
.L2:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %edi
	jmp	.L7
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	n(%rip), %rsi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%r12, %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$24, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	n(%rip), %rdx
	testq	%rdx, %rdx
	jle	.L2
	xorl	%ebx, %ebx
	movq	%rsp, %r13
	leaq	a(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rax
	movq	n(%rip), %rdx
	movq	%rbx, -8(%rbp,%rax,8)
	addq	$1, %rbx
	cmpq	%rbx, %rdx
	jg	.L3
	cmpq	$1, %rdx
	jle	.L2
	movq	0(%rbp), %rcx
	leaq	0(%rbp,%rdx,8), %r9
	movl	$1, %esi
	leaq	8+a(%rip), %rax
	movl	$1, %edi
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L13:
	addq	$8, %rax
	addq	$1, %rsi
	cmpq	%r9, %rax
	je	.L7
.L6:
	movq	%rcx, %r8
	movq	(%rax), %rcx
	cmpq	%r8, %rcx
	jg	.L13
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	addq	$8, %rax
	movl	$1, %esi
	cmpq	%r9, %rax
	jne	.L6
.L7:
	cmpq	%rsi, %rdi
	cmovl	%rsi, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	subq	%rdi, %rdx
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	addq	$24, %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
.L2:
	.cfi_restore_state
	movl	$1, %esi
	movl	$1, %edi
	jmp	.L7
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 1600080
a:
	.zero	1600080
	.globl	n
	.align 8
	.type	n, @object
	.size	n, 8
n:
	.zero	8
	.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:
```