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>
int check_so_chan(int n)
{
    if(!(n%2 == 0)) return 0;
    return 1;
}
main()
{
    int N;
    int check = 1;
    scanf("%d", &N);
    int A[N];
    for(int i = 0 ; i< N ; i++)
    {
        scanf("%d", &A[i]);
    }
    // for(int i = 0 ; i < N ; i++)
    // {
    //     printf("%d ", A[i]);
    // }
    for(int i = 0 ; i < N ; i++)
    {
        if(check_so_chan(A[i]))
        {
            if(!((A[i] % 3 == 0) || (A[i] % 5 == 0))) 
            check = 0;
        }
    }
    if(check == 1) printf("APPROVED");
    else printf("DENIED");
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check_so_chan
	.type	check_so_chan, @function
check_so_chan:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check_so_chan, .-check_so_chan
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"APPROVED"
.LC2:
	.string	"DENIED"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	$56, %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
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$1, -84(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L8:
	movl	-88(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L9
	movl	$0, -76(%rbp)
	jmp	.L10
.L12:
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %edi
	call	check_so_chan
	testl	%eax, %eax
	je	.L11
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L11
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	sall	$2, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L11
	movl	$0, -84(%rbp)
.L11:
	addl	$1, -76(%rbp)
.L10:
	movl	-88(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L12
	cmpl	$1, -84(%rbp)
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L13:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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.
user
	.file	"temp.c"
	.text
	.p2align 4
	.globl	check_so_chan
	.type	check_so_chan, @function
check_so_chan:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	notl	%eax
	andl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check_so_chan, .-check_so_chan
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC4:
	.string	"APPROVED"
.LC5:
	.string	"DENIED"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	-60(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC1(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L5
.L44:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L44
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L45
.L6:
	movq	%rsp, %r14
	testl	%ecx, %ecx
	jle	.L18
	movq	%r14, %r15
	movq	%r14, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L18
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L22
	movdqa	.LC2(%rip), %xmm9
	pxor	%xmm7, %xmm7
	movl	%ecx, %eax
	movdqa	.LC3(%rip), %xmm8
	movdqa	%xmm7, %xmm14
	movdqa	%xmm7, %xmm13
	shrl	$2, %eax
	movdqa	.LC0(%rip), %xmm11
	pcmpgtd	%xmm9, %xmm14
	pcmpgtd	%xmm8, %xmm13
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%r15), %xmm3
	movdqa	%xmm7, %xmm6
	movdqa	%xmm7, %xmm5
	addq	$16, %r15
	movdqa	%xmm14, %xmm2
	movdqa	%xmm14, %xmm15
	movdqa	%xmm3, %xmm0
	movdqa	%xmm3, %xmm4
	punpckldq	%xmm3, %xmm0
	psrad	$31, %xmm4
	pcmpgtd	%xmm0, %xmm6
	pmuludq	%xmm0, %xmm2
	movdqa	%xmm0, %xmm10
	pmuludq	%xmm9, %xmm10
	movdqa	%xmm6, %xmm1
	pmuludq	%xmm8, %xmm6
	pmuludq	%xmm9, %xmm1
	paddq	%xmm2, %xmm1
	movdqa	%xmm3, %xmm2
	punpckhdq	%xmm3, %xmm2
	psllq	$32, %xmm1
	pcmpgtd	%xmm2, %xmm5
	paddq	%xmm1, %xmm10
	movdqa	%xmm2, %xmm12
	pmuludq	%xmm2, %xmm15
	pmuludq	%xmm9, %xmm12
	movdqa	%xmm5, %xmm1
	pmuludq	%xmm8, %xmm5
	pmuludq	%xmm9, %xmm1
	paddq	%xmm15, %xmm1
	psllq	$32, %xmm1
	paddq	%xmm12, %xmm1
	shufps	$221, %xmm1, %xmm10
	psubd	%xmm4, %xmm10
	movdqa	%xmm10, %xmm1
	pslld	$1, %xmm1
	paddd	%xmm10, %xmm1
	movdqa	.LC0(%rip), %xmm10
	pcmpeqd	%xmm3, %xmm1
	pand	%xmm3, %xmm10
	pcmpeqd	%xmm7, %xmm10
	pcmpeqd	%xmm7, %xmm1
	pand	%xmm10, %xmm1
	movdqa	%xmm13, %xmm10
	pmuludq	%xmm0, %xmm10
	pmuludq	%xmm8, %xmm0
	paddq	%xmm10, %xmm6
	psllq	$32, %xmm6
	paddq	%xmm6, %xmm0
	movdqa	%xmm13, %xmm6
	pmuludq	%xmm2, %xmm6
	pmuludq	%xmm8, %xmm2
	paddq	%xmm6, %xmm5
	psllq	$32, %xmm5
	paddq	%xmm5, %xmm2
	shufps	$221, %xmm2, %xmm0
	psrad	$1, %xmm0
	psubd	%xmm4, %xmm0
	movdqa	%xmm0, %xmm2
	pslld	$2, %xmm2
	paddd	%xmm2, %xmm0
	pcmpeqd	%xmm3, %xmm0
	pcmpeqd	%xmm7, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm11, %xmm1
	movdqa	%xmm1, %xmm11
	cmpq	%rax, %r15
	jne	.L10
	psrldq	$8, %xmm1
	movl	%ecx, %edi
	movdqa	%xmm1, %xmm0
	andl	$-4, %edi
	pcmpgtd	%xmm11, %xmm0
	pand	%xmm0, %xmm11
	pandn	%xmm1, %xmm0
	por	%xmm11, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %esi
	testb	$3, %cl
	je	.L11
.L9:
	movslq	%edi, %rax
	leaq	(%r14,%rax,4), %r9
	movl	(%r9), %r8d
	testb	$1, %r8b
	jne	.L12
	movl	%r8d, %eax
	movl	$3, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	je	.L12
	movl	%r8d, %eax
	movl	$5, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	jne	.L13
.L12:
	addl	$1, %edi
	cmpl	%edi, %ecx
	jle	.L11
.L20:
	movl	4(%r9), %r8d
	testb	$1, %r8b
	jne	.L14
	movl	%r8d, %eax
	movl	$3, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	je	.L14
	movl	%r8d, %eax
	movl	$5, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	jne	.L15
.L14:
	addl	$1, %edi
	cmpl	%edi, %ecx
	jle	.L11
.L19:
	movl	8(%r9), %ecx
	testb	$1, %cl
	jne	.L11
	movl	%ecx, %eax
	movl	$3, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jne	.L46
.L11:
	cmpl	$1, %esi
	je	.L18
.L16:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L47
	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
.L18:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L46:
	movl	%ecx, %eax
	movl	$5, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jne	.L16
	jmp	.L11
.L45:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L13:
	addl	$1, %edi
	xorl	%esi, %esi
	cmpl	%edi, %ecx
	jg	.L20
	jmp	.L16
.L15:
	addl	$1, %edi
	xorl	%esi, %esi
	cmpl	%edi, %ecx
	jg	.L19
	jmp	.L16
.L22:
	xorl	%edi, %edi
	movl	$1, %esi
	jmp	.L9
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC2:
	.long	1431655766
	.long	1431655766
	.long	1431655766
	.long	1431655766
	.align 16
.LC3:
	.long	1717986919
	.long	1717986919
	.long	1717986919
	.long	1717986919
	.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
	.p2align 4
	.globl	check_so_chan
	.type	check_so_chan, @function
check_so_chan:
.LFB23:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	notl	%eax
	andl	$1, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check_so_chan, .-check_so_chan
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC4:
	.string	"APPROVED"
.LC5:
	.string	"DENIED"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	-60(%rbp), %rsi
	pushq	%r13
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	leaq	.LC1(%rip), %r13
	pushq	%r12
	movq	%r13, %rdi
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-60(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L5
.L44:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L44
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L45
.L6:
	movq	%rsp, %r14
	testl	%ecx, %ecx
	jle	.L18
	movq	%r14, %r15
	movq	%r14, %r12
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-60(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L18
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L22
	movdqa	.LC2(%rip), %xmm9
	pxor	%xmm7, %xmm7
	movl	%ecx, %eax
	movdqa	.LC3(%rip), %xmm8
	movdqa	%xmm7, %xmm14
	movdqa	%xmm7, %xmm13
	shrl	$2, %eax
	movdqa	.LC0(%rip), %xmm11
	pcmpgtd	%xmm9, %xmm14
	pcmpgtd	%xmm8, %xmm13
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	(%r15), %xmm3
	movdqa	%xmm7, %xmm6
	movdqa	%xmm7, %xmm5
	addq	$16, %r15
	movdqa	%xmm14, %xmm2
	movdqa	%xmm14, %xmm15
	movdqa	%xmm3, %xmm0
	movdqa	%xmm3, %xmm4
	punpckldq	%xmm3, %xmm0
	psrad	$31, %xmm4
	pcmpgtd	%xmm0, %xmm6
	pmuludq	%xmm0, %xmm2
	movdqa	%xmm0, %xmm10
	pmuludq	%xmm9, %xmm10
	movdqa	%xmm6, %xmm1
	pmuludq	%xmm8, %xmm6
	pmuludq	%xmm9, %xmm1
	paddq	%xmm2, %xmm1
	movdqa	%xmm3, %xmm2
	punpckhdq	%xmm3, %xmm2
	psllq	$32, %xmm1
	pcmpgtd	%xmm2, %xmm5
	paddq	%xmm1, %xmm10
	movdqa	%xmm2, %xmm12
	pmuludq	%xmm2, %xmm15
	pmuludq	%xmm9, %xmm12
	movdqa	%xmm5, %xmm1
	pmuludq	%xmm8, %xmm5
	pmuludq	%xmm9, %xmm1
	paddq	%xmm15, %xmm1
	psllq	$32, %xmm1
	paddq	%xmm12, %xmm1
	shufps	$221, %xmm1, %xmm10
	psubd	%xmm4, %xmm10
	movdqa	%xmm10, %xmm1
	pslld	$1, %xmm1
	paddd	%xmm10, %xmm1
	movdqa	.LC0(%rip), %xmm10
	pcmpeqd	%xmm3, %xmm1
	pand	%xmm3, %xmm10
	pcmpeqd	%xmm7, %xmm10
	pcmpeqd	%xmm7, %xmm1
	pand	%xmm10, %xmm1
	movdqa	%xmm13, %xmm10
	pmuludq	%xmm0, %xmm10
	pmuludq	%xmm8, %xmm0
	paddq	%xmm10, %xmm6
	psllq	$32, %xmm6
	paddq	%xmm6, %xmm0
	movdqa	%xmm13, %xmm6
	pmuludq	%xmm2, %xmm6
	pmuludq	%xmm8, %xmm2
	paddq	%xmm6, %xmm5
	psllq	$32, %xmm5
	paddq	%xmm5, %xmm2
	shufps	$221, %xmm2, %xmm0
	psrad	$1, %xmm0
	psubd	%xmm4, %xmm0
	movdqa	%xmm0, %xmm2
	pslld	$2, %xmm2
	paddd	%xmm2, %xmm0
	pcmpeqd	%xmm3, %xmm0
	pcmpeqd	%xmm7, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm11, %xmm1
	movdqa	%xmm1, %xmm11
	cmpq	%rax, %r15
	jne	.L10
	psrldq	$8, %xmm1
	movl	%ecx, %edi
	movdqa	%xmm1, %xmm0
	andl	$-4, %edi
	pcmpgtd	%xmm11, %xmm0
	pand	%xmm0, %xmm11
	pandn	%xmm1, %xmm0
	por	%xmm11, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %esi
	testb	$3, %cl
	je	.L11
.L9:
	movslq	%edi, %rax
	leaq	(%r14,%rax,4), %r9
	movl	(%r9), %r8d
	testb	$1, %r8b
	jne	.L12
	movl	%r8d, %eax
	movl	$3, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	je	.L12
	movl	%r8d, %eax
	movl	$5, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	jne	.L13
.L12:
	addl	$1, %edi
	cmpl	%edi, %ecx
	jle	.L11
.L20:
	movl	4(%r9), %r8d
	testb	$1, %r8b
	jne	.L14
	movl	%r8d, %eax
	movl	$3, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	je	.L14
	movl	%r8d, %eax
	movl	$5, %r10d
	cltd
	idivl	%r10d
	testl	%edx, %edx
	jne	.L15
.L14:
	addl	$1, %edi
	cmpl	%edi, %ecx
	jle	.L11
.L19:
	movl	8(%r9), %ecx
	testb	$1, %cl
	jne	.L11
	movl	%ecx, %eax
	movl	$3, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jne	.L46
.L11:
	cmpl	$1, %esi
	je	.L18
.L16:
	leaq	.LC5(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L17:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L47
	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
.L18:
	.cfi_restore_state
	leaq	.LC4(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L17
.L46:
	movl	%ecx, %eax
	movl	$5, %edi
	cltd
	idivl	%edi
	testl	%edx, %edx
	jne	.L16
	jmp	.L11
.L45:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L13:
	addl	$1, %edi
	xorl	%esi, %esi
	cmpl	%edi, %ecx
	jg	.L20
	jmp	.L16
.L15:
	addl	$1, %edi
	xorl	%esi, %esi
	cmpl	%edi, %ecx
	jg	.L19
	jmp	.L16
.L22:
	xorl	%edi, %edi
	movl	$1, %esi
	jmp	.L9
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.align 16
.LC2:
	.long	1431655766
	.long	1431655766
	.long	1431655766
	.long	1431655766
	.align 16
.LC3:
	.long	1717986919
	.long	1717986919
	.long	1717986919
	.long	1717986919
	.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>
int check_so_chan(int n)
{
    if(!(n%2 == 0)) return 0;
    return 1;
}
main()
{
    int N;
    int check = 1;
    scanf("%d", &N);
    int A[N];
    for(int i = 0 ; i< N ; i++)
    {
        scanf("%d", &A[i]);
    }
    // for(int i = 0 ; i < N ; i++)
    // {
    //     printf("%d ", A[i]);
    // }
    for(int i = 0 ; i < N ; i++)
    {
        if(check_so_chan(A[i]))
        {
            if(!((A[i] % 3 == 0) || (A[i] % 5 == 0))) 
            check = 0;
        }
    }
    if(check == 1) printf("APPROVED");
    else printf("DENIED");
}
5
6 7 3 10 31
 3
28 27 47
 5
6 7 4 10 31
 3
28 15 47
 5
0 7 4 10 31
 3
2 15 47
 5
-1 7 4 10 31
 3
2 26 47
 5
1 7 4 10 31
 3
4 26 47

APPROVED DENIED DENIED DENIED DENIED DENIED DENIED DENIED DENIED DENIED
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>
int check_so_chan(int n)
{
    if(!(n%2 == 0)) return 0;
    return 1;
}
main()
{
    int N;
    int check = 1;
    scanf("%d", &N);
    int A[N];
    for(int i = 0 ; i< N ; i++)
    {
        scanf("%d", &A[i]);
    }
    // for(int i = 0 ; i < N ; i++)
    // {
    //     printf("%d ", A[i]);
    // }
    for(int i = 0 ; i < N ; i++)
    {
        if(check_so_chan(A[i]))
        {
            if(!((A[i] % 3 == 0) || (A[i] % 5 == 0))) 
            check = 0;
        }
    }
    if(check == 1) printf("APPROVED");
    else printf("DENIED");
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check_so_chan
	.type	check_so_chan, @function
check_so_chan:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check_so_chan, .-check_so_chan
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"APPROVED"
.LC2:
	.string	"DENIED"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	$56, %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
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$1, -84(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L8:
	movl	-88(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L9
	movl	$0, -76(%rbp)
	jmp	.L10
.L12:
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %edi
	call	check_so_chan
	testl	%eax, %eax
	je	.L11
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L11
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	sall	$2, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L11
	movl	$0, -84(%rbp)
.L11:
	addl	$1, -76(%rbp)
.L10:
	movl	-88(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L12
	cmpl	$1, -84(%rbp)
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L13:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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.
train
	.file	"temp.c"
	.text
	.globl	check_so_chan
	.type	check_so_chan, @function
check_so_chan:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	-4(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L2
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	check_so_chan, .-check_so_chan
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"APPROVED"
.LC2:
	.string	"DENIED"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.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	$56, %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
	movq	%rsp, %rax
	movq	%rax, %rbx
	movl	$1, -84(%rbp)
	leaq	-88(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-88(%rbp), %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	leaq	0(,%rax,4), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L5:
	cmpq	%rdx, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L6:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L7
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L7:
	movq	%rsp, %rax
	addq	$3, %rax
	shrq	$2, %rax
	salq	$2, %rax
	movq	%rax, -64(%rbp)
	movl	$0, -80(%rbp)
	jmp	.L8
.L9:
	movl	-80(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-64(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -80(%rbp)
.L8:
	movl	-88(%rbp), %eax
	cmpl	%eax, -80(%rbp)
	jl	.L9
	movl	$0, -76(%rbp)
	jmp	.L10
.L12:
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %edi
	call	check_so_chan
	testl	%eax, %eax
	je	.L11
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L11
	movq	-64(%rbp), %rax
	movl	-76(%rbp), %edx
	movslq	%edx, %rdx
	movl	(%rax,%rdx,4), %edx
	movslq	%edx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	%eax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	sall	$2, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L11
	movl	$0, -84(%rbp)
.L11:
	addl	$1, -76(%rbp)
.L10:
	movl	-88(%rbp), %eax
	cmpl	%eax, -76(%rbp)
	jl	.L12
	cmpl	$1, -84(%rbp)
	jne	.L13
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L14
.L13:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L14:
	movq	%rbx, %rsp
	movl	$0, %eax
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
