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, m, h[100010], check[100010]={0}, count = 0;

    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &h[i]);

    for (int i = 0; i < m; i++)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        if (h[a] > h[b])
            check[b]=1;
        else if (h[a] < h[b])
            check[a]=1;
        else
        {
            check[a]=1;
            check[b]=1;
        }
    }

    for (int i = 1; i <= n; i++)
    {
        if (check[i] == 0)
            count++;
    }

    printf("%d", count);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1392, %rsp
	.cfi_def_cfa_offset 800160
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	400064(%rsp), %rdi
	call	memset@PLT
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jge	.L3
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L19:
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r14, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rdx
	movl	16(%rsp,%rax,4), %ecx
	cmpl	%ecx, 16(%rsp,%rdx,4)
	jg	.L7
	movl	$1, 400064(%rsp,%rdx,4)
	jl	.L6
.L7:
	movl	$1, 400064(%rsp,%rax,4)
.L6:
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L8
.L4:
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L9
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%ecx, %edx
	pxor	%xmm0, %xmm0
	leaq	400068(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400084(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L13
.L10:
	movslq	%eax, %rsi
	cmpl	$1, 400064(%rsp,%rsi,4)
	leal	1(%rax), %esi
	adcl	$0, %edx
	cmpl	%ecx, %esi
	jg	.L13
	movslq	%esi, %rsi
	cmpl	$0, 400064(%rsp,%rsi,4)
	je	.L29
.L16:
	addl	$2, %eax
	cmpl	%ecx, %eax
	jg	.L13
	cltq
	cmpl	$0, 400064(%rsp,%rax,4)
	je	.L30
.L13:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L16
.L30:
	addl	$1, %edx
	jmp	.L13
.L2:
	cmpl	$0, 4(%rsp)
	leaq	.LC1(%rip), %r12
	jg	.L19
.L9:
	xorl	%edx, %edx
	jmp	.L13
.L21:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1392, %rsp
	.cfi_def_cfa_offset 800160
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	400064(%rsp), %rdi
	call	memset@PLT
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jge	.L3
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L19:
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r14, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rdx
	movl	16(%rsp,%rax,4), %ecx
	cmpl	%ecx, 16(%rsp,%rdx,4)
	jg	.L7
	movl	$1, 400064(%rsp,%rdx,4)
	jl	.L6
.L7:
	movl	$1, 400064(%rsp,%rax,4)
.L6:
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L8
.L4:
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L9
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%ecx, %edx
	pxor	%xmm0, %xmm0
	leaq	400068(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400084(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L13
.L10:
	movslq	%eax, %rsi
	cmpl	$1, 400064(%rsp,%rsi,4)
	leal	1(%rax), %esi
	adcl	$0, %edx
	cmpl	%ecx, %esi
	jg	.L13
	movslq	%esi, %rsi
	cmpl	$0, 400064(%rsp,%rsi,4)
	je	.L29
.L16:
	addl	$2, %eax
	cmpl	%ecx, %eax
	jg	.L13
	cltq
	cmpl	$0, 400064(%rsp,%rax,4)
	je	.L30
.L13:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L16
.L30:
	addl	$1, %edx
	jmp	.L13
.L2:
	cmpl	$0, 4(%rsp)
	leaq	.LC1(%rip), %r12
	jg	.L19
.L9:
	xorl	%edx, %edx
	jmp	.L13
.L21:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1392, %rsp
	.cfi_def_cfa_offset 800160
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	400064(%rsp), %rdi
	call	memset@PLT
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jge	.L3
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L19:
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r14, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rdx
	movl	16(%rsp,%rax,4), %ecx
	cmpl	%ecx, 16(%rsp,%rdx,4)
	jg	.L7
	movl	$1, 400064(%rsp,%rdx,4)
	jl	.L6
.L7:
	movl	$1, 400064(%rsp,%rax,4)
.L6:
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L8
.L4:
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L9
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%ecx, %edx
	pxor	%xmm0, %xmm0
	leaq	400068(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400084(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L13
.L10:
	movslq	%eax, %rsi
	cmpl	$1, 400064(%rsp,%rsi,4)
	leal	1(%rax), %esi
	adcl	$0, %edx
	cmpl	%ecx, %esi
	jg	.L13
	movslq	%esi, %rsi
	cmpl	$0, 400064(%rsp,%rsi,4)
	je	.L29
.L16:
	addl	$2, %eax
	cmpl	%ecx, %eax
	jg	.L13
	cltq
	cmpl	$0, 400064(%rsp,%rax,4)
	je	.L30
.L13:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L16
.L30:
	addl	$1, %edx
	jmp	.L13
.L2:
	cmpl	$0, 4(%rsp)
	leaq	.LC1(%rip), %r12
	jg	.L19
.L9:
	xorl	%edx, %edx
	jmp	.L13
.L21:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>

int main()
{
    int n, m, h[100010], check[100010]={0}, count = 0;

    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &h[i]);

    for (int i = 0; i < m; i++)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        if (h[a] > h[b])
            check[b]=1;
        else if (h[a] < h[b])
            check[a]=1;
        else
        {
            check[a]=1;
            check[b]=1;
        }
    }

    for (int i = 1; i <= n; i++)
    {
        if (check[i] == 0)
            count++;
    }

    printf("%d", count);
    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, m, h[100010], check[100010]={0}, count = 0;

    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &h[i]);

    for (int i = 0; i < m; i++)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        if (h[a] > h[b])
            check[b]=1;
        else if (h[a] < h[b])
            check[a]=1;
        else
        {
            check[a]=1;
            check[b]=1;
        }
    }

    for (int i = 1; i <= n; i++)
    {
        if (check[i] == 0)
            count++;
    }

    printf("%d", count);
    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 5
8 6 9 1 2 1
1 3
4 2
4 0
4 6
4 6
 4 3
1 2 3 4
1 3
3 3
2 4
 4 2
2 4 3 5
1 3
3 3
2 4
 4 0
2 4 3 5
1 3
3 3
4 4
 6 0
9 6 8 1 1 1
0 3
3 0
4 1
4 2
1 6
 6 5
8 6 9 1 2 0
0 3
4 0
4 0
2 6
4 6
 4 3
1 6 3 3
1 3
2 2
3 4
 6 5
8 6 9 1 2 1
1 3
4 1
4 0
4 6
4 6
 4 3
1 2 3 5
1 3
3 3
2 4
 6 5
8 6 9 1 2 1
1 3
4 1
4 0
4 3
4 6

3 1 2 4 6 5 0 3 1 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>

int main()
{
    int n, m, h[100010], check[100010]={0}, count = 0;

    scanf("%d %d", &n, &m);
    for (int i = 1; i <= n; i++)
        scanf("%d", &h[i]);

    for (int i = 0; i < m; i++)
    {
        int a, b;
        scanf("%d %d", &a, &b);
        if (h[a] > h[b])
            check[b]=1;
        else if (h[a] < h[b])
            check[a]=1;
        else
        {
            check[a]=1;
            check[b]=1;
        }
    }

    for (int i = 1; i <= n; i++)
    {
        if (check[i] == 0)
            count++;
    }

    printf("%d", count);
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1392, %rsp
	.cfi_def_cfa_offset 800160
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	400064(%rsp), %rdi
	call	memset@PLT
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jge	.L3
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L19:
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r14, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rdx
	movl	16(%rsp,%rax,4), %ecx
	cmpl	%ecx, 16(%rsp,%rdx,4)
	jg	.L7
	movl	$1, 400064(%rsp,%rdx,4)
	jl	.L6
.L7:
	movl	$1, 400064(%rsp,%rax,4)
.L6:
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L8
.L4:
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L9
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%ecx, %edx
	pxor	%xmm0, %xmm0
	leaq	400068(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400084(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L13
.L10:
	movslq	%eax, %rsi
	cmpl	$1, 400064(%rsp,%rsi,4)
	leal	1(%rax), %esi
	adcl	$0, %edx
	cmpl	%ecx, %esi
	jg	.L13
	movslq	%esi, %rsi
	cmpl	$0, 400064(%rsp,%rsi,4)
	je	.L29
.L16:
	addl	$2, %eax
	cmpl	%ecx, %eax
	jg	.L13
	cltq
	cmpl	$0, 400064(%rsp,%rax,4)
	je	.L30
.L13:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L16
.L30:
	addl	$1, %edx
	jmp	.L13
.L2:
	cmpl	$0, 4(%rsp)
	leaq	.LC1(%rip), %r12
	jg	.L19
.L9:
	xorl	%edx, %edx
	jmp	.L13
.L21:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	-798720(%rsp), %r11
	.cfi_def_cfa 11, 798768
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1392, %rsp
	.cfi_def_cfa_offset 800160
	movl	$400040, %edx
	xorl	%esi, %esi
	leaq	.LC0(%rip), %r13
	movq	%fs:40, %rax
	movq	%rax, 800104(%rsp)
	xorl	%eax, %eax
	leaq	400064(%rsp), %rdi
	call	memset@PLT
	leaq	4(%rsp), %rdx
	movq	%rsp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	leaq	20(%rsp), %rbp
	movl	$1, %ebx
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, (%rsp)
	jge	.L3
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
.L19:
	xorl	%ebx, %ebx
	leaq	12(%rsp), %r14
	leaq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r14, %rdx
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movslq	8(%rsp), %rdx
	movl	16(%rsp,%rax,4), %ecx
	cmpl	%ecx, 16(%rsp,%rdx,4)
	jg	.L7
	movl	$1, 400064(%rsp,%rdx,4)
	jl	.L6
.L7:
	movl	$1, 400064(%rsp,%rax,4)
.L6:
	addl	$1, %ebx
	cmpl	%ebx, 4(%rsp)
	jg	.L8
.L4:
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L9
	leal	-1(%rcx), %eax
	cmpl	$2, %eax
	jbe	.L21
	movl	%ecx, %edx
	pxor	%xmm0, %xmm0
	leaq	400068(%rsp), %rax
	shrl	$2, %edx
	movdqa	%xmm0, %xmm2
	subl	$1, %edx
	salq	$4, %rdx
	leaq	400084(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L11:
	movdqu	(%rax), %xmm1
	addq	$16, %rax
	pcmpeqd	%xmm2, %xmm1
	psubd	%xmm1, %xmm0
	cmpq	%rax, %rdx
	jne	.L11
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	leal	1(%rsi), %eax
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%esi, %ecx
	je	.L13
.L10:
	movslq	%eax, %rsi
	cmpl	$1, 400064(%rsp,%rsi,4)
	leal	1(%rax), %esi
	adcl	$0, %edx
	cmpl	%ecx, %esi
	jg	.L13
	movslq	%esi, %rsi
	cmpl	$0, 400064(%rsp,%rsi,4)
	je	.L29
.L16:
	addl	$2, %eax
	cmpl	%ecx, %eax
	jg	.L13
	cltq
	cmpl	$0, 400064(%rsp,%rax,4)
	je	.L30
.L13:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	800104(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L31
	addq	$800112, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L29:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L16
.L30:
	addl	$1, %edx
	jmp	.L13
.L2:
	cmpl	$0, 4(%rsp)
	leaq	.LC1(%rip), %r12
	jg	.L19
.L9:
	xorl	%edx, %edx
	jmp	.L13
.L21:
	movl	$1, %eax
	xorl	%edx, %edx
	jmp	.L10
.L31:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```