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>
#include <math.h>

const int Num = 200001; //defineよりいいらしい
int times; //how many times
    
long long int max_profit(int *price);

int main () {

    int price[Num];
    int i; 
    
    scanf ("%d",&times);
    
    for (i = 0;i < times;i ++) {
        scanf ("%d",&price[i]);
    }
    
    printf ("%lld\n",max_profit(price) );
    return 0;
}

long long int max_profit(int *price) {
    int i;
    long long int maxsa,min; //max初期化命 でも0やと事故る
    //max差　ただ最小値
    maxsa = -10000000000;
    
    /*ただただ差だけを考えないと事故る
      全走査しないと*/
    min = price[0];
    for (i = 1;i < times;i ++) {
        maxsa = (maxsa < price[i] - min) ? (price[i] - min) : maxsa;
        min = (min > price[i]) ? price[i] : min; 
    }
    return maxsa;
} 
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Num
	.section	.rodata
	.align 4
	.type	Num, @object
	.size	Num, 4
Num:
	.long	200001
	.globl	times
	.bss
	.align 4
	.type	times, @object
	.size	times, 4
times:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$200001, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -40(%rbp)
	movl	$200001, %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	$200001, %eax
	cltq
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$200001, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -32(%rbp)
	leaq	times(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L5
.L6:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L5:
	movl	times(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L6
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	max_profit
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max_profit
	.type	max_profit, @function
max_profit:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movabsq	$-10000000000, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cltq
	movq	%rax, -8(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$1, -20(%rbp)
.L10:
	movl	times(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max_profit, .-max_profit
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-798720(%rsp), %rax
	cmpq	%rax, %rsp
	je	.L3
.L15:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rax, %rsp
	jne	.L15
.L3:
	subq	$1296, %rsp
	orq	$0, 1288(%rsp)
	leaq	.LC0(%rip), %r13
	xorl	%eax, %eax
	leaq	times(%rip), %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	leaq	3(%rsp), %r12
	movabsq	$-10000000000, %r8
	movq	%r12, %r14
	andq	$-4, %r12
	shrq	$2, %r14
	cmpl	$0, times(%rip)
	jle	.L5
	movq	%r12, %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	times(%rip), %ecx
	addq	$4, %r15
	cmpl	%ebx, %ecx
	jg	.L6
	movslq	0(,%r14,4), %rdx
	cmpl	$1, %ecx
	jle	.L10
	subl	$2, %ecx
	leaq	4(%r12), %rax
	movabsq	$-10000000000, %r8
	leaq	8(%r12,%rcx,4), %rdi
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	(%rax), %rcx
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	cmpq	%rsi, %r8
	cmovl	%rsi, %r8
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	addq	$4, %rax
	cmpq	%rax, %rdi
	jne	.L7
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L16
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	movabsq	$-10000000000, %r8
	jmp	.L5
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	max_profit
	.type	max_profit, @function
max_profit:
.LFB24:
	.cfi_startproc
	endbr64
	movl	times(%rip), %ecx
	movslq	(%rdi), %rax
	movabsq	$-10000000000, %r8
	cmpl	$1, %ecx
	jle	.L17
	subl	$2, %ecx
	leaq	4(%rdi), %rdx
	leaq	8(%rdi,%rcx,4), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	(%rdx), %rcx
	movq	%rcx, %rsi
	subq	%rax, %rsi
	cmpq	%rsi, %r8
	cmovl	%rsi, %r8
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L19
.L17:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE24:
	.size	max_profit, .-max_profit
	.globl	times
	.bss
	.align 4
	.type	times, @object
	.size	times, 4
times:
	.zero	4
	.globl	Num
	.section	.rodata
	.align 4
	.type	Num, @object
	.size	Num, 4
Num:
	.long	200001
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	leaq	-798720(%rsp), %rax
	cmpq	%rax, %rsp
	je	.L3
.L15:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rax, %rsp
	jne	.L15
.L3:
	subq	$1296, %rsp
	orq	$0, 1288(%rsp)
	leaq	.LC0(%rip), %r13
	xorl	%eax, %eax
	leaq	times(%rip), %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	leaq	3(%rsp), %r12
	movabsq	$-10000000000, %r8
	movq	%r12, %r14
	andq	$-4, %r12
	shrq	$2, %r14
	cmpl	$0, times(%rip)
	jle	.L5
	movq	%r12, %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r15, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	times(%rip), %ecx
	addq	$4, %r15
	cmpl	%ebx, %ecx
	jg	.L6
	movslq	0(,%r14,4), %rdx
	cmpl	$1, %ecx
	jle	.L10
	subl	$2, %ecx
	leaq	4(%r12), %rax
	movabsq	$-10000000000, %r8
	leaq	8(%r12,%rcx,4), %rdi
	.p2align 4,,10
	.p2align 3
.L7:
	movslq	(%rax), %rcx
	movq	%rcx, %rsi
	subq	%rdx, %rsi
	cmpq	%rsi, %r8
	cmovl	%rsi, %r8
	cmpq	%rcx, %rdx
	cmovg	%rcx, %rdx
	addq	$4, %rax
	cmpq	%rax, %rdi
	jne	.L7
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L16
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L10:
	.cfi_restore_state
	movabsq	$-10000000000, %r8
	jmp	.L5
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	max_profit
	.type	max_profit, @function
max_profit:
.LFB24:
	.cfi_startproc
	endbr64
	movl	times(%rip), %ecx
	movslq	(%rdi), %rax
	movabsq	$-10000000000, %r8
	cmpl	$1, %ecx
	jle	.L17
	subl	$2, %ecx
	leaq	4(%rdi), %rdx
	leaq	8(%rdi,%rcx,4), %rdi
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	(%rdx), %rcx
	movq	%rcx, %rsi
	subq	%rax, %rsi
	cmpq	%rsi, %r8
	cmovl	%rsi, %r8
	cmpq	%rcx, %rax
	cmovg	%rcx, %rax
	addq	$4, %rdx
	cmpq	%rdx, %rdi
	jne	.L19
.L17:
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE24:
	.size	max_profit, .-max_profit
	.globl	times
	.bss
	.align 4
	.type	times, @object
	.size	times, 4
times:
	.zero	4
	.globl	Num
	.section	.rodata
	.align 4
	.type	Num, @object
	.size	Num, 4
Num:
	.long	200001
	.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>
#include <math.h>

const int Num = 200001; //defineよりいいらしい
int times; //how many times
    
long long int max_profit(int *price);

int main () {

    int price[Num];
    int i; 
    
    scanf ("%d",&times);
    
    for (i = 0;i < times;i ++) {
        scanf ("%d",&price[i]);
    }
    
    printf ("%lld\n",max_profit(price) );
    return 0;
}

long long int max_profit(int *price) {
    int i;
    long long int maxsa,min; //max初期化命 でも0やと事故る
    //max差　ただ最小値
    maxsa = -10000000000;
    
    /*ただただ差だけを考えないと事故る
      全走査しないと*/
    min = price[0];
    for (i = 1;i < times;i ++) {
        maxsa = (maxsa < price[i] - min) ? (price[i] - min) : maxsa;
        min = (min > price[i]) ? price[i] : min; 
    }
    return maxsa;
} 

3
4
1
2
 6
5
3
0
3
4
3
 3
4
1
3
 6
5
3
0
2
0
3
 3
5
0
6
 3
5
0
10
 6
5
2
-1
4
1
3
 6
5
2
-1
7
1
3
 3
3
0
9
 6
5
2
-1
14
1
3

1
 4
 2
 3
 6
 10
 5
 8
 9
 15

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>
#include <math.h>

const int Num = 200001; //defineよりいいらしい
int times; //how many times
    
long long int max_profit(int *price);

int main () {

    int price[Num];
    int i; 
    
    scanf ("%d",&times);
    
    for (i = 0;i < times;i ++) {
        scanf ("%d",&price[i]);
    }
    
    printf ("%lld\n",max_profit(price) );
    return 0;
}

long long int max_profit(int *price) {
    int i;
    long long int maxsa,min; //max初期化命 でも0やと事故る
    //max差　ただ最小値
    maxsa = -10000000000;
    
    /*ただただ差だけを考えないと事故る
      全走査しないと*/
    min = price[0];
    for (i = 1;i < times;i ++) {
        maxsa = (maxsa < price[i] - min) ? (price[i] - min) : maxsa;
        min = (min > price[i]) ? price[i] : min; 
    }
    return maxsa;
} 
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	Num
	.section	.rodata
	.align 4
	.type	Num, @object
	.size	Num, 4
Num:
	.long	200001
	.globl	times
	.bss
	.align 4
	.type	times, @object
	.size	times, 4
times:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$200001, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -40(%rbp)
	movl	$200001, %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	$200001, %eax
	cltq
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$200001, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -32(%rbp)
	leaq	times(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L5
.L6:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L5:
	movl	times(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L6
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	max_profit
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max_profit
	.type	max_profit, @function
max_profit:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movabsq	$-10000000000, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cltq
	movq	%rax, -8(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$1, -20(%rbp)
.L10:
	movl	times(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max_profit, .-max_profit
	.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	Num
	.section	.rodata
	.align 4
	.type	Num, @object
	.size	Num, 4
Num:
	.long	200001
	.globl	times
	.bss
	.align 4
	.type	times, @object
	.size	times, 4
times:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$200001, %eax
	cltq
	subq	$1, %rax
	movq	%rax, -40(%rbp)
	movl	$200001, %eax
	cltq
	movq	%rax, %r8
	movl	$0, %r9d
	movl	$200001, %eax
	cltq
	movq	%rax, %rsi
	movl	$0, %edi
	movl	$200001, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -32(%rbp)
	leaq	times(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L5
.L6:
	movl	-44(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-32(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -44(%rbp)
.L5:
	movl	times(%rip), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L6
	movq	-32(%rbp), %rax
	movq	%rax, %rdi
	call	max_profit
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	max_profit
	.type	max_profit, @function
max_profit:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movabsq	$-10000000000, %rax
	movq	%rax, -16(%rbp)
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cltq
	movq	%rax, -8(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L10
.L11:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	subq	-8(%rbp), %rax
	movq	-16(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovge	%rdx, %rax
	movq	%rax, -16(%rbp)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-40(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cltq
	movq	-8(%rbp), %rdx
	cmpq	%rax, %rdx
	cmovle	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$1, -20(%rbp)
.L10:
	movl	times(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L11
	movq	-16(%rbp), %rax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	max_profit, .-max_profit
	.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:
