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>
int main()
{
	int n;

	scanf("%d", &n);

	int A[10000];
	int i, lop, cnt = 0;

	for(i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}

	do{
		lop = 0;
		for(i = 0; i < n; i++){
			if(A[i] % 2 == 0){
				A[i] /= 2;
				cnt++;
				lop = 1;
			}
			else{
				A[i] *= 3;
			}
		}
	}while(lop);

	printf("%d\n", cnt);

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %r12
	cmpl	%ebp, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	%ecx, %r9d
	movdqa	.LC1(%rip), %xmm6
	xorl	%r8d, %r8d
	shrl	$2, %eax
	leal	-1(%rcx), %r10d
	pxor	%xmm7, %xmm7
	andl	$-4, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%ecx, %ecx
	jle	.L13
	cmpl	$2, %r10d
	jbe	.L17
	pxor	%xmm4, %xmm4
	movq	%rbx, %rax
	movdqa	%xmm4, %xmm5
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%rax), %xmm2
	movdqa	%xmm6, %xmm1
	addq	$16, %rax
	movdqa	%xmm2, %xmm0
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm7, %xmm0
	movdqa	%xmm0, %xmm3
	pand	%xmm0, %xmm1
	psubd	%xmm0, %xmm4
	pandn	%xmm5, %xmm3
	movdqa	%xmm3, %xmm5
	movdqa	%xmm7, %xmm3
	pcmpgtd	%xmm2, %xmm3
	por	%xmm1, %xmm5
	movdqa	%xmm2, %xmm1
	psubd	%xmm3, %xmm1
	movdqa	%xmm2, %xmm3
	pslld	$1, %xmm3
	psrad	$1, %xmm1
	paddd	%xmm3, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rsi, %rax
	jne	.L5
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm1
	psrldq	$8, %xmm0
	psrldq	$8, %xmm1
	paddd	%xmm0, %xmm4
	movdqa	%xmm4, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm5, %xmm0
	movd	%xmm4, %eax
	addl	%eax, %r8d
	movl	%r9d, %eax
	pand	%xmm0, %xmm1
	pandn	%xmm5, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	cmpl	%r9d, %ecx
	je	.L6
.L4:
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L7
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L10
.L28:
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	je	.L12
.L29:
	leal	(%rdi,%rdi,2), %edi
	movl	%edi, 16(%rsp,%rax,4)
.L6:
	testl	%edx, %edx
	jne	.L14
.L13:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40040, %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
.L7:
	.cfi_restore_state
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	je	.L28
.L10:
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	jne	.L29
.L12:
	movl	%edi, %edx
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L4
.L16:
	xorl	%r8d, %r8d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %r12
	cmpl	%ebp, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	%ecx, %r9d
	movdqa	.LC1(%rip), %xmm6
	xorl	%r8d, %r8d
	shrl	$2, %eax
	leal	-1(%rcx), %r10d
	pxor	%xmm7, %xmm7
	andl	$-4, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%ecx, %ecx
	jle	.L13
	cmpl	$2, %r10d
	jbe	.L17
	pxor	%xmm4, %xmm4
	movq	%rbx, %rax
	movdqa	%xmm4, %xmm5
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%rax), %xmm2
	movdqa	%xmm6, %xmm1
	addq	$16, %rax
	movdqa	%xmm2, %xmm0
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm7, %xmm0
	movdqa	%xmm0, %xmm3
	pand	%xmm0, %xmm1
	psubd	%xmm0, %xmm4
	pandn	%xmm5, %xmm3
	movdqa	%xmm3, %xmm5
	movdqa	%xmm7, %xmm3
	pcmpgtd	%xmm2, %xmm3
	por	%xmm1, %xmm5
	movdqa	%xmm2, %xmm1
	psubd	%xmm3, %xmm1
	movdqa	%xmm2, %xmm3
	pslld	$1, %xmm3
	psrad	$1, %xmm1
	paddd	%xmm3, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rsi, %rax
	jne	.L5
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm1
	psrldq	$8, %xmm0
	psrldq	$8, %xmm1
	paddd	%xmm0, %xmm4
	movdqa	%xmm4, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm5, %xmm0
	movd	%xmm4, %eax
	addl	%eax, %r8d
	movl	%r9d, %eax
	pand	%xmm0, %xmm1
	pandn	%xmm5, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	cmpl	%r9d, %ecx
	je	.L6
.L4:
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L7
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L10
.L28:
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	je	.L12
.L29:
	leal	(%rdi,%rdi,2), %edi
	movl	%edi, 16(%rsp,%rax,4)
.L6:
	testl	%edx, %edx
	jne	.L14
.L13:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40040, %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
.L7:
	.cfi_restore_state
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	je	.L28
.L10:
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	jne	.L29
.L12:
	movl	%edi, %edx
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L4
.L16:
	xorl	%r8d, %r8d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %r12
	cmpl	%ebp, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	%ecx, %r9d
	movdqa	.LC1(%rip), %xmm6
	xorl	%r8d, %r8d
	shrl	$2, %eax
	leal	-1(%rcx), %r10d
	pxor	%xmm7, %xmm7
	andl	$-4, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%ecx, %ecx
	jle	.L13
	cmpl	$2, %r10d
	jbe	.L17
	pxor	%xmm4, %xmm4
	movq	%rbx, %rax
	movdqa	%xmm4, %xmm5
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%rax), %xmm2
	movdqa	%xmm6, %xmm1
	addq	$16, %rax
	movdqa	%xmm2, %xmm0
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm7, %xmm0
	movdqa	%xmm0, %xmm3
	pand	%xmm0, %xmm1
	psubd	%xmm0, %xmm4
	pandn	%xmm5, %xmm3
	movdqa	%xmm3, %xmm5
	movdqa	%xmm7, %xmm3
	pcmpgtd	%xmm2, %xmm3
	por	%xmm1, %xmm5
	movdqa	%xmm2, %xmm1
	psubd	%xmm3, %xmm1
	movdqa	%xmm2, %xmm3
	pslld	$1, %xmm3
	psrad	$1, %xmm1
	paddd	%xmm3, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rsi, %rax
	jne	.L5
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm1
	psrldq	$8, %xmm0
	psrldq	$8, %xmm1
	paddd	%xmm0, %xmm4
	movdqa	%xmm4, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm5, %xmm0
	movd	%xmm4, %eax
	addl	%eax, %r8d
	movl	%r9d, %eax
	pand	%xmm0, %xmm1
	pandn	%xmm5, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	cmpl	%r9d, %ecx
	je	.L6
.L4:
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L7
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L10
.L28:
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	je	.L12
.L29:
	leal	(%rdi,%rdi,2), %edi
	movl	%edi, 16(%rsp,%rax,4)
.L6:
	testl	%edx, %edx
	jne	.L14
.L13:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40040, %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
.L7:
	.cfi_restore_state
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	je	.L28
.L10:
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	jne	.L29
.L12:
	movl	%edi, %edx
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L4
.L16:
	xorl	%r8d, %r8d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
int main()
{
	int n;

	scanf("%d", &n);

	int A[10000];
	int i, lop, cnt = 0;

	for(i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}

	do{
		lop = 0;
		for(i = 0; i < n; i++){
			if(A[i] % 2 == 0){
				A[i] /= 2;
				cnt++;
				lop = 1;
			}
			else{
				A[i] *= 3;
			}
		}
	}while(lop);

	printf("%d\n", cnt);

	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int main()
{
	int n;

	scanf("%d", &n);

	int A[10000];
	int i, lop, cnt = 0;

	for(i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}

	do{
		lop = 0;
		for(i = 0; i < n; i++){
			if(A[i] % 2 == 0){
				A[i] /= 2;
				cnt++;
				lop = 1;
			}
			else{
				A[i] *= 3;
			}
		}
	}while(lop);

	printf("%d\n", cnt);

	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
2184 2126 1721 1800 1480 2528 3360 1945 1280 1776
 4
631 846 243 199
 10
2184 2126 1721 1800 1480 2850 3360 1945 1280 1776
 4
631 846 218 199
 3
5 2 8
 10
2184 2126 1721 1800 1480 2850 1620 1945 1280 1776
 3
5 3 8
 10
2184 2126 1721 1800 1480 2850 1620 1945 875 1776
 3
3 3 11
 10
2184 2126 1721 1800 1480 1870 1620 1945 875 2447

32
 1
 28
 2
 4
 25
 3
 17
 0
 13

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>
int main()
{
	int n;

	scanf("%d", &n);

	int A[10000];
	int i, lop, cnt = 0;

	for(i = 0; i < n; i++){
		scanf("%d", &A[i]);
	}

	do{
		lop = 0;
		for(i = 0; i < n; i++){
			if(A[i] % 2 == 0){
				A[i] /= 2;
				cnt++;
				lop = 1;
			}
			else{
				A[i] *= 3;
			}
		}
	}while(lop);

	printf("%d\n", cnt);

	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %r12
	cmpl	%ebp, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	%ecx, %r9d
	movdqa	.LC1(%rip), %xmm6
	xorl	%r8d, %r8d
	shrl	$2, %eax
	leal	-1(%rcx), %r10d
	pxor	%xmm7, %xmm7
	andl	$-4, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%ecx, %ecx
	jle	.L13
	cmpl	$2, %r10d
	jbe	.L17
	pxor	%xmm4, %xmm4
	movq	%rbx, %rax
	movdqa	%xmm4, %xmm5
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%rax), %xmm2
	movdqa	%xmm6, %xmm1
	addq	$16, %rax
	movdqa	%xmm2, %xmm0
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm7, %xmm0
	movdqa	%xmm0, %xmm3
	pand	%xmm0, %xmm1
	psubd	%xmm0, %xmm4
	pandn	%xmm5, %xmm3
	movdqa	%xmm3, %xmm5
	movdqa	%xmm7, %xmm3
	pcmpgtd	%xmm2, %xmm3
	por	%xmm1, %xmm5
	movdqa	%xmm2, %xmm1
	psubd	%xmm3, %xmm1
	movdqa	%xmm2, %xmm3
	pslld	$1, %xmm3
	psrad	$1, %xmm1
	paddd	%xmm3, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rsi, %rax
	jne	.L5
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm1
	psrldq	$8, %xmm0
	psrldq	$8, %xmm1
	paddd	%xmm0, %xmm4
	movdqa	%xmm4, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm5, %xmm0
	movd	%xmm4, %eax
	addl	%eax, %r8d
	movl	%r9d, %eax
	pand	%xmm0, %xmm1
	pandn	%xmm5, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	cmpl	%r9d, %ecx
	je	.L6
.L4:
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L7
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L10
.L28:
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	je	.L12
.L29:
	leal	(%rdi,%rdi,2), %edi
	movl	%edi, 16(%rsp,%rax,4)
.L6:
	testl	%edx, %edx
	jne	.L14
.L13:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40040, %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
.L7:
	.cfi_restore_state
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	je	.L28
.L10:
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	jne	.L29
.L12:
	movl	%edi, %edx
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L4
.L16:
	xorl	%r8d, %r8d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-36864(%rsp), %r11
	.cfi_def_cfa 11, 36904
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3176, %rsp
	.cfi_def_cfa_offset 40080
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 40024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L16
	leaq	16(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %ecx
	addq	$4, %r12
	cmpl	%ebp, %ecx
	jg	.L3
	movl	%ecx, %eax
	movl	%ecx, %r9d
	movdqa	.LC1(%rip), %xmm6
	xorl	%r8d, %r8d
	shrl	$2, %eax
	leal	-1(%rcx), %r10d
	pxor	%xmm7, %xmm7
	andl	$-4, %r9d
	subl	$1, %eax
	salq	$4, %rax
	leaq	16(%rbx,%rax), %rsi
	.p2align 4,,10
	.p2align 3
.L14:
	testl	%ecx, %ecx
	jle	.L13
	cmpl	$2, %r10d
	jbe	.L17
	pxor	%xmm4, %xmm4
	movq	%rbx, %rax
	movdqa	%xmm4, %xmm5
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%rax), %xmm2
	movdqa	%xmm6, %xmm1
	addq	$16, %rax
	movdqa	%xmm2, %xmm0
	pand	%xmm6, %xmm0
	pcmpeqd	%xmm7, %xmm0
	movdqa	%xmm0, %xmm3
	pand	%xmm0, %xmm1
	psubd	%xmm0, %xmm4
	pandn	%xmm5, %xmm3
	movdqa	%xmm3, %xmm5
	movdqa	%xmm7, %xmm3
	pcmpgtd	%xmm2, %xmm3
	por	%xmm1, %xmm5
	movdqa	%xmm2, %xmm1
	psubd	%xmm3, %xmm1
	movdqa	%xmm2, %xmm3
	pslld	$1, %xmm3
	psrad	$1, %xmm1
	paddd	%xmm3, %xmm2
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movaps	%xmm0, -16(%rax)
	cmpq	%rsi, %rax
	jne	.L5
	movdqa	%xmm4, %xmm0
	movdqa	%xmm5, %xmm1
	psrldq	$8, %xmm0
	psrldq	$8, %xmm1
	paddd	%xmm0, %xmm4
	movdqa	%xmm4, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm4
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm5, %xmm0
	movd	%xmm4, %eax
	addl	%eax, %r8d
	movl	%r9d, %eax
	pand	%xmm0, %xmm1
	pandn	%xmm5, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	cmpl	%r9d, %ecx
	je	.L6
.L4:
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L7
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	jne	.L10
.L28:
	movl	%edi, %edx
	addl	$1, %eax
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%r11,4)
	movl	$1, %edx
	cmpl	%eax, %ecx
	jle	.L14
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	je	.L12
.L29:
	leal	(%rdi,%rdi,2), %edi
	movl	%edi, 16(%rsp,%rax,4)
.L6:
	testl	%edx, %edx
	jne	.L14
.L13:
	xorl	%eax, %eax
	movl	%r8d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L27
	addq	$40040, %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
.L7:
	.cfi_restore_state
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	movslq	%eax, %r11
	movl	16(%rsp,%r11,4), %edi
	testb	$1, %dil
	je	.L28
.L10:
	leal	(%rdi,%rdi,2), %edi
	addl	$1, %eax
	movl	%edi, 16(%rsp,%r11,4)
	cmpl	%eax, %ecx
	jle	.L6
	cltq
	movl	16(%rsp,%rax,4), %edi
	testb	$1, %dil
	jne	.L29
.L12:
	movl	%edi, %edx
	addl	$1, %r8d
	shrl	$31, %edx
	addl	%edi, %edx
	sarl	%edx
	movl	%edx, 16(%rsp,%rax,4)
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L4
.L16:
	xorl	%r8d, %r8d
	jmp	.L13
.L27:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```