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>

long long ru(int a,int b){
		long long r=1;
		for(int i=0;i<b;i++)r=r*a;
		return r;
}

int main(){
		int n,i,a[100],m=0;
		long long ans;
		scanf("%d",&n);
		for(i=0;i<n;i++)scanf("%d",&a[i]);
		for(i=0;i<n;i++){
				if(a[i]%2==0)m++;
		}
		ans=ru(3,n)-ru(2,m);
		printf("%lld\n",ans);
		return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	ru
	.type	ru, @function
ru:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %eax
	imulq	%rdi, %r8
	cmpl	%eax, %esi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	ru, .-ru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
	testl	%esi, %esi
	jle	.L8
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%esi, %eax
	pxor	%xmm1, %xmm1
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %eax
	movdqa	%xmm1, %xmm2
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L11:
	movdqa	(%r12), %xmm0
	movq	%rax, %r12
	pand	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %sil
	je	.L12
.L10:
	movslq	%edx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	leal	1(%rdx), %ecx
	adcl	$0, %eax
	cmpl	%ecx, %esi
	jle	.L12
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	adcl	$0, %eax
	addl	$2, %edx
	cmpl	%edx, %esi
	jle	.L12
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	andl	$1, %edx
	cmpl	$1, %edx
	adcl	$0, %eax
.L12:
	xorl	%ecx, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %ecx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	%ecx, %esi
	jne	.L18
	testl	%eax, %eax
	jle	.L22
	xorl	%ecx, %ecx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %ecx
	addq	%rsi, %rsi
	cmpl	%eax, %ecx
	jne	.L19
.L17:
	subq	%rsi, %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$440, %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
.L8:
	.cfi_restore_state
	movl	$1, %edx
	movl	$1, %esi
	jmp	.L17
.L22:
	movl	$1, %esi
	jmp	.L17
.L21:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L10
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	ru
	.type	ru, @function
ru:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %eax
	imulq	%rdi, %r8
	cmpl	%eax, %esi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	ru, .-ru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
	testl	%esi, %esi
	jle	.L8
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%esi, %eax
	pxor	%xmm1, %xmm1
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %eax
	movdqa	%xmm1, %xmm2
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L11:
	movdqa	(%r12), %xmm0
	movq	%rax, %r12
	pand	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %sil
	je	.L12
.L10:
	movslq	%edx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	leal	1(%rdx), %ecx
	adcl	$0, %eax
	cmpl	%ecx, %esi
	jle	.L12
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	adcl	$0, %eax
	addl	$2, %edx
	cmpl	%edx, %esi
	jle	.L12
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	andl	$1, %edx
	cmpl	$1, %edx
	adcl	$0, %eax
.L12:
	xorl	%ecx, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %ecx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	%ecx, %esi
	jne	.L18
	testl	%eax, %eax
	jle	.L22
	xorl	%ecx, %ecx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %ecx
	addq	%rsi, %rsi
	cmpl	%eax, %ecx
	jne	.L19
.L17:
	subq	%rsi, %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$440, %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
.L8:
	.cfi_restore_state
	movl	$1, %edx
	movl	$1, %esi
	jmp	.L17
.L22:
	movl	$1, %esi
	jmp	.L17
.L21:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L10
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	ru
	.type	ru, @function
ru:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %eax
	imulq	%rdi, %r8
	cmpl	%eax, %esi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	ru, .-ru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
	testl	%esi, %esi
	jle	.L8
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%esi, %eax
	pxor	%xmm1, %xmm1
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %eax
	movdqa	%xmm1, %xmm2
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L11:
	movdqa	(%r12), %xmm0
	movq	%rax, %r12
	pand	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %sil
	je	.L12
.L10:
	movslq	%edx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	leal	1(%rdx), %ecx
	adcl	$0, %eax
	cmpl	%ecx, %esi
	jle	.L12
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	adcl	$0, %eax
	addl	$2, %edx
	cmpl	%edx, %esi
	jle	.L12
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	andl	$1, %edx
	cmpl	$1, %edx
	adcl	$0, %eax
.L12:
	xorl	%ecx, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %ecx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	%ecx, %esi
	jne	.L18
	testl	%eax, %eax
	jle	.L22
	xorl	%ecx, %ecx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %ecx
	addq	%rsi, %rsi
	cmpl	%eax, %ecx
	jne	.L19
.L17:
	subq	%rsi, %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$440, %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
.L8:
	.cfi_restore_state
	movl	$1, %edx
	movl	$1, %esi
	jmp	.L17
.L22:
	movl	$1, %esi
	jmp	.L17
.L21:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L10
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>

long long ru(int a,int b){
		long long r=1;
		for(int i=0;i<b;i++)r=r*a;
		return r;
}

int main(){
		int n,i,a[100],m=0;
		long long ans;
		scanf("%d",&n);
		for(i=0;i<n;i++)scanf("%d",&a[i]);
		for(i=0;i<n;i++){
				if(a[i]%2==0)m++;
		}
		ans=ru(3,n)-ru(2,m);
		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>

long long ru(int a,int b){
		long long r=1;
		for(int i=0;i<b;i++)r=r*a;
		return r;
}

int main(){
		int n,i,a[100],m=0;
		long long ans;
		scanf("%d",&n);
		for(i=0;i<n;i++)scanf("%d",&a[i]);
		for(i=0;i<n;i++){
				if(a[i]%2==0)m++;
		}
		ans=ru(3,n)-ru(2,m);
		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:

10
90 101 56 71 44 8 13 30 57 84
 2
2 4
 1
000
 3
3 3 2
 10
41 101 56 71 44 8 13 30 57 84
 2
3 6
 1
011
 3
3 2 0
 10
60 101 56 71 44 8 13 30 114 84
 3
1 1 -1

58985
 5
 1
 25
 59017
 7
 2
 23
 58921
 26

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>

long long ru(int a,int b){
		long long r=1;
		for(int i=0;i<b;i++)r=r*a;
		return r;
}

int main(){
		int n,i,a[100],m=0;
		long long ans;
		scanf("%d",&n);
		for(i=0;i<n;i++)scanf("%d",&a[i]);
		for(i=0;i<n;i++){
				if(a[i]%2==0)m++;
		}
		ans=ru(3,n)-ru(2,m);
		printf("%lld\n",ans);
		return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	ru
	.type	ru, @function
ru:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %eax
	imulq	%rdi, %r8
	cmpl	%eax, %esi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	ru, .-ru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
	testl	%esi, %esi
	jle	.L8
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%esi, %eax
	pxor	%xmm1, %xmm1
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %eax
	movdqa	%xmm1, %xmm2
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L11:
	movdqa	(%r12), %xmm0
	movq	%rax, %r12
	pand	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %sil
	je	.L12
.L10:
	movslq	%edx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	leal	1(%rdx), %ecx
	adcl	$0, %eax
	cmpl	%ecx, %esi
	jle	.L12
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	adcl	$0, %eax
	addl	$2, %edx
	cmpl	%edx, %esi
	jle	.L12
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	andl	$1, %edx
	cmpl	$1, %edx
	adcl	$0, %eax
.L12:
	xorl	%ecx, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %ecx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	%ecx, %esi
	jne	.L18
	testl	%eax, %eax
	jle	.L22
	xorl	%ecx, %ecx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %ecx
	addq	%rsi, %rsi
	cmpl	%eax, %ecx
	jne	.L19
.L17:
	subq	%rsi, %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$440, %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
.L8:
	.cfi_restore_state
	movl	$1, %edx
	movl	$1, %esi
	jmp	.L17
.L22:
	movl	$1, %esi
	jmp	.L17
.L21:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L10
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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	ru
	.type	ru, @function
ru:
.LFB23:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L4
	movslq	%edi, %rdi
	xorl	%eax, %eax
	movl	$1, %r8d
	.p2align 4,,10
	.p2align 3
.L3:
	addl	$1, %eax
	imulq	%rdi, %r8
	cmpl	%eax, %esi
	jne	.L3
	movq	%r8, %rax
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	movl	$1, %r8d
	movq	%r8, %rax
	ret
	.cfi_endproc
.LFE23:
	.size	ru, .-ru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L8
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %rbp
	cmpl	%ebx, %esi
	jg	.L9
	testl	%esi, %esi
	jle	.L8
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%esi, %eax
	pxor	%xmm1, %xmm1
	movdqa	.LC1(%rip), %xmm3
	shrl	$2, %eax
	movdqa	%xmm1, %xmm2
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L29:
	addq	$16, %rax
.L11:
	movdqa	(%r12), %xmm0
	movq	%rax, %r12
	pand	%xmm3, %xmm0
	pcmpeqd	%xmm2, %xmm0
	psubd	%xmm0, %xmm1
	cmpq	%rax, %rdx
	jne	.L29
	movdqa	%xmm1, %xmm0
	movl	%esi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$3, %sil
	je	.L12
.L10:
	movslq	%edx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	leal	1(%rdx), %ecx
	adcl	$0, %eax
	cmpl	%ecx, %esi
	jle	.L12
	movslq	%ecx, %rcx
	movl	16(%rsp,%rcx,4), %ecx
	andl	$1, %ecx
	cmpl	$1, %ecx
	adcl	$0, %eax
	addl	$2, %edx
	cmpl	%edx, %esi
	jle	.L12
	movslq	%edx, %rdx
	movl	16(%rsp,%rdx,4), %edx
	andl	$1, %edx
	cmpl	$1, %edx
	adcl	$0, %eax
.L12:
	xorl	%ecx, %ecx
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %ecx
	leaq	(%rdx,%rdx,2), %rdx
	cmpl	%ecx, %esi
	jne	.L18
	testl	%eax, %eax
	jle	.L22
	xorl	%ecx, %ecx
	movl	$1, %esi
	.p2align 4,,10
	.p2align 3
.L19:
	addl	$1, %ecx
	addq	%rsi, %rsi
	cmpl	%eax, %ecx
	jne	.L19
.L17:
	subq	%rsi, %rdx
	xorl	%eax, %eax
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$440, %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
.L8:
	.cfi_restore_state
	movl	$1, %edx
	movl	$1, %esi
	jmp	.L17
.L22:
	movl	$1, %esi
	jmp	.L17
.L21:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L10
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:
```