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 <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll power(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)

//your code here!

int main(void){
    ll N, A[100100], ans=1, fpp=0, fmm=0;
    scanf("%lld", &N);
    rep(i, N) scanf("%lld", A+i);
    rep(i, N-1) {
        if(fpp==0 && fmm==0) {
            if(A[i] < A[i+1]) fpp=1;
            if(A[i] > A[i+1]) fmm=1;
        }
        if(fpp && A[i]>A[i+1]) {
            ans++;
            fpp=0;
        }
        if(fmm && A[i]<A[i+1]) {
            ans++;
            fmm=0;
        }
    }
    printf("%lld\n", ans);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB51:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	jle	.L4
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	imulq	%rdi, %r8
	cmpq	%rax, %rsi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	$2120, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L17
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L9
	cmpq	$1, %rdx
	jle	.L17
	leaq	0(%r13,%rdx,8), %r10
	leaq	24(%rsp), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rax), %rbx
	cmpq	%rbx, -8(%rax)
	jl	.L18
	setg	%dl
	xorl	%ecx, %ecx
	movzbl	%dl, %edx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r10
	je	.L8
.L14:
	movq	%rcx, %rsi
	orq	%rdx, %rsi
	je	.L29
	movq	-8(%rax), %r8
	movq	(%rax), %rdi
	testq	%rcx, %rcx
	je	.L12
	cmpq	%rdi, %r8
	jle	.L13
	addq	$1, %r9
	xorl	%ecx, %ecx
.L13:
	testq	%rdx, %rdx
	je	.L11
.L12:
	movq	%rsi, %rdx
	cmpq	%rdi, %r8
	jge	.L11
	addq	$8, %rax
	addq	$1, %r9
	xorl	%edx, %edx
	cmpq	%rax, %r10
	jne	.L14
.L8:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800840, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %ecx
	jmp	.L11
.L17:
	movl	$1, %r9d
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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	power
	.type	power, @function
power:
.LFB51:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	jle	.L4
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	imulq	%rdi, %r8
	cmpq	%rax, %rsi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	$2120, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L17
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L9
	cmpq	$1, %rdx
	jle	.L17
	leaq	0(%r13,%rdx,8), %r10
	leaq	24(%rsp), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rax), %rbx
	cmpq	%rbx, -8(%rax)
	jl	.L18
	setg	%dl
	xorl	%ecx, %ecx
	movzbl	%dl, %edx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r10
	je	.L8
.L14:
	movq	%rcx, %rsi
	orq	%rdx, %rsi
	je	.L29
	movq	-8(%rax), %r8
	movq	(%rax), %rdi
	testq	%rcx, %rcx
	je	.L12
	cmpq	%rdi, %r8
	jle	.L13
	addq	$1, %r9
	xorl	%ecx, %ecx
.L13:
	testq	%rdx, %rdx
	je	.L11
.L12:
	movq	%rsi, %rdx
	cmpq	%rdi, %r8
	jge	.L11
	addq	$8, %rax
	addq	$1, %r9
	xorl	%edx, %edx
	cmpq	%rax, %r10
	jne	.L14
.L8:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800840, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %ecx
	jmp	.L11
.L17:
	movl	$1, %r9d
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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	power
	.type	power, @function
power:
.LFB51:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	jle	.L4
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	imulq	%rdi, %r8
	cmpq	%rax, %rsi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	$2120, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L17
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L9
	cmpq	$1, %rdx
	jle	.L17
	leaq	0(%r13,%rdx,8), %r10
	leaq	24(%rsp), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rax), %rbx
	cmpq	%rbx, -8(%rax)
	jl	.L18
	setg	%dl
	xorl	%ecx, %ecx
	movzbl	%dl, %edx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r10
	je	.L8
.L14:
	movq	%rcx, %rsi
	orq	%rdx, %rsi
	je	.L29
	movq	-8(%rax), %r8
	movq	(%rax), %rdi
	testq	%rcx, %rcx
	je	.L12
	cmpq	%rdi, %r8
	jle	.L13
	addq	$1, %r9
	xorl	%ecx, %ecx
.L13:
	testq	%rdx, %rdx
	je	.L11
.L12:
	movq	%rsi, %rdx
	cmpq	%rdi, %r8
	jge	.L11
	addq	$8, %rax
	addq	$1, %r9
	xorl	%edx, %edx
	cmpq	%rax, %r10
	jne	.L14
.L8:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800840, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %ecx
	jmp	.L11
.L17:
	movl	$1, %r9d
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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 <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll power(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)

//your code here!

int main(void){
    ll N, A[100100], ans=1, fpp=0, fmm=0;
    scanf("%lld", &N);
    rep(i, N) scanf("%lld", A+i);
    rep(i, N-1) {
        if(fpp==0 && fmm==0) {
            if(A[i] < A[i+1]) fpp=1;
            if(A[i] > A[i+1]) fmm=1;
        }
        if(fpp && A[i]>A[i+1]) {
            ans++;
            fpp=0;
        }
        if(fmm && A[i]<A[i+1]) {
            ans++;
            fmm=0;
        }
    }
    printf("%lld\n", ans);
    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 <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll power(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)

//your code here!

int main(void){
    ll N, A[100100], ans=1, fpp=0, fmm=0;
    scanf("%lld", &N);
    rep(i, N) scanf("%lld", A+i);
    rep(i, N-1) {
        if(fpp==0 && fmm==0) {
            if(A[i] < A[i+1]) fpp=1;
            if(A[i] > A[i+1]) fmm=1;
        }
        if(fpp && A[i]>A[i+1]) {
            ans++;
            fpp=0;
        }
        if(fmm && A[i]<A[i+1]) {
            ans++;
            fmm=0;
        }
    }
    printf("%lld\n", ans);
    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
1 2 3 2 0 1
 9
1 2 1 2 2 2 1 2 1
 6
1 2 3 2 0 0
 9
0 1 0 -1 2 7 2 -1 0
 7
1 2 3 2 1 999999999 1000000100
 9
1 2 1 2 2 2 2 2 1
 7
1 4 3 2 1 999999999 1000000100
 6
0 2 3 2 0 0
 9
1 2 0 2 2 2 2 2 1
 7
1 4 3 4 1 999999999 1000000100

3
 4
 2
 5
 3
 3
 3
 2
 3
 3

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 <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll power(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)

//your code here!

int main(void){
    ll N, A[100100], ans=1, fpp=0, fmm=0;
    scanf("%lld", &N);
    rep(i, N) scanf("%lld", A+i);
    rep(i, N-1) {
        if(fpp==0 && fmm==0) {
            if(A[i] < A[i+1]) fpp=1;
            if(A[i] > A[i+1]) fmm=1;
        }
        if(fpp && A[i]>A[i+1]) {
            ans++;
            fpp=0;
        }
        if(fmm && A[i]<A[i+1]) {
            ans++;
            fmm=0;
        }
    }
    printf("%lld\n", ans);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	power
	.type	power, @function
power:
.LFB51:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	jle	.L4
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	imulq	%rdi, %r8
	cmpq	%rax, %rsi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	$2120, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L17
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L9
	cmpq	$1, %rdx
	jle	.L17
	leaq	0(%r13,%rdx,8), %r10
	leaq	24(%rsp), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rax), %rbx
	cmpq	%rbx, -8(%rax)
	jl	.L18
	setg	%dl
	xorl	%ecx, %ecx
	movzbl	%dl, %edx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r10
	je	.L8
.L14:
	movq	%rcx, %rsi
	orq	%rdx, %rsi
	je	.L29
	movq	-8(%rax), %r8
	movq	(%rax), %rdi
	testq	%rcx, %rcx
	je	.L12
	cmpq	%rdi, %r8
	jle	.L13
	addq	$1, %r9
	xorl	%ecx, %ecx
.L13:
	testq	%rdx, %rdx
	je	.L11
.L12:
	movq	%rsi, %rdx
	cmpq	%rdi, %r8
	jge	.L11
	addq	$8, %rax
	addq	$1, %r9
	xorl	%edx, %edx
	cmpq	%rax, %r10
	jne	.L14
.L8:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800840, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %ecx
	jmp	.L11
.L17:
	movl	$1, %r9d
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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	power
	.type	power, @function
power:
.LFB51:
	.cfi_startproc
	endbr64
	testq	%rsi, %rsi
	jle	.L4
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addq	$1, %rax
	imulq	%rdi, %r8
	cmpq	%rax, %rsi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE51:
	.size	power, .-power
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.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	$2120, %rsp
	.cfi_def_cfa_offset 800880
	leaq	.LC0(%rip), %r12
	movq	%r12, %rdi
	movq	%fs:40, %rax
	movq	%rax, 800824(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	call	__isoc99_scanf@PLT
	cmpq	$0, 8(%rsp)
	jle	.L17
	leaq	16(%rsp), %r13
	xorl	%ebx, %ebx
	movq	%r13, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rdx
	addq	$8, %rbp
	cmpq	%rbx, %rdx
	jg	.L9
	cmpq	$1, %rdx
	jle	.L17
	leaq	0(%r13,%rdx,8), %r10
	leaq	24(%rsp), %rax
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$1, %r9d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L29:
	movq	(%rax), %rbx
	cmpq	%rbx, -8(%rax)
	jl	.L18
	setg	%dl
	xorl	%ecx, %ecx
	movzbl	%dl, %edx
.L11:
	addq	$8, %rax
	cmpq	%rax, %r10
	je	.L8
.L14:
	movq	%rcx, %rsi
	orq	%rdx, %rsi
	je	.L29
	movq	-8(%rax), %r8
	movq	(%rax), %rdi
	testq	%rcx, %rcx
	je	.L12
	cmpq	%rdi, %r8
	jle	.L13
	addq	$1, %r9
	xorl	%ecx, %ecx
.L13:
	testq	%rdx, %rdx
	je	.L11
.L12:
	movq	%rsi, %rdx
	cmpq	%rdi, %r8
	jge	.L11
	addq	$8, %rax
	addq	$1, %r9
	xorl	%edx, %edx
	cmpq	%rax, %r10
	jne	.L14
.L8:
	xorl	%eax, %eax
	movq	%r9, %rdx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	800824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$800840, %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
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	xorl	%edx, %edx
	movl	$1, %ecx
	jmp	.L11
.L17:
	movl	$1, %r9d
	jmp	.L8
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.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:
```