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 <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;
} 
```

Assembly Code:

```assembly
	.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:
```

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	"%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
```assembly
	.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:
```
```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;
} 
```
Given the following C 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;
} 
```

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:

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 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;
} 
```

Assembly Code:

```assembly
	.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:
```

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	"%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:
```