Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint64_t nextplong(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
inline int abs2(const int a){return a>=0?a:-a;}

#define p 998244353

int a[100000];
int d[100000];
int main(void){
	int n=nextpint();
	if(nextpint()!=0){
		puts("0");
		return 0;
	}
	a[0]=1;
	for(int i=1; i<n; i++){
		d[i]=nextpint();
		if(d[i]==0){
			puts("0");
			return 0;
		}
		a[d[i]]++;
	}
	long ans=1;
	for(int i=1; i<n; i++){
		ans=(ans*a[d[i]-1])%p;
	}
	printf("%ld\n", ans);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	compr
	.type	compr, @function
compr:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	setg	%al
	movzbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compr, .-compr
	.globl	nextpint
	.type	nextpint, @function
nextpint:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	call	getchar@PLT
	movb	%al, -5(%rbp)
	jmp	.L6
.L7:
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L6:
	cmpb	$47, -5(%rbp)
	jle	.L7
	cmpb	$57, -5(%rbp)
	jg	.L7
	movl	$0, -4(%rbp)
	jmp	.L8
.L10:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-5(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L8:
	cmpb	$47, -5(%rbp)
	jle	.L9
	cmpb	$57, -5(%rbp)
	jle	.L10
.L9:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	nextpint, .-nextpint
	.globl	nextplong
	.type	nextplong, @function
nextplong:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	call	getchar@PLT
	movb	%al, -9(%rbp)
	jmp	.L13
.L14:
	call	getchar@PLT
	movb	%al, -9(%rbp)
.L13:
	cmpb	$47, -9(%rbp)
	jle	.L14
	cmpb	$57, -9(%rbp)
	jg	.L14
	movq	$0, -8(%rbp)
	jmp	.L15
.L17:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movsbq	-9(%rbp), %rax
	addq	%rdx, %rax
	subq	$48, %rax
	movq	%rax, -8(%rbp)
	call	getchar@PLT
	movb	%al, -9(%rbp)
.L15:
	cmpb	$47, -9(%rbp)
	jle	.L16
	cmpb	$57, -9(%rbp)
	jle	.L17
.L16:
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	nextplong, .-nextplong
	.globl	nextstr
	.type	nextstr, @function
nextstr:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
	jmp	.L20
.L21:
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L20:
	cmpb	$32, -5(%rbp)
	je	.L21
	cmpb	$10, -5(%rbp)
	je	.L21
	movl	$0, -4(%rbp)
	jmp	.L22
.L24:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	-5(%rbp), %edx
	movb	%dl, (%rax)
	addl	$1, -4(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L22:
	cmpb	$32, -5(%rbp)
	je	.L23
	cmpb	$10, -5(%rbp)
	jne	.L24
.L23:
	movq	-24(%rbp), %rax
	movb	$0, (%rax)
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	nextstr, .-nextstr
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400000
d:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"0"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	call	nextpint
	movl	%eax, -12(%rbp)
	call	nextpint
	testl	%eax, %eax
	je	.L27
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L28
.L27:
	movl	$1, a(%rip)
	movl	$1, -20(%rbp)
	jmp	.L29
.L31:
	call	nextpint
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L30
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L28
.L30:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L29:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L31
	movq	$1, -8(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L32
.L33:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$155014655926305585, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$23, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$998244353, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$1, -16(%rbp)
.L32:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L33
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	comp
	.type	comp, @function
comp:
.LFB63:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setg	%al
	setl	%dl
	movzbl	%dl, %edx
	movzbl	%al, %eax
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE63:
	.size	comp, .-comp
	.p2align 4
	.globl	compr
	.type	compr, @function
compr:
.LFB64:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setl	%al
	setg	%dl
	movzbl	%dl, %edx
	movzbl	%al, %eax
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE64:
	.size	compr, .-compr
	.p2align 4
	.globl	nextpint
	.type	nextpint, @function
nextpint:
.LFB65:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	.p2align 4,,10
	.p2align 3
.L13:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L13
	movsbl	%al, %edx
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	stdin(%rip), %rdi
	leal	(%r12,%r12,4), %eax
	leal	-48(%rdx,%rax,2), %r12d
	call	getc@PLT
	movsbl	%al, %edx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L8
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE65:
	.size	nextpint, .-nextpint
	.p2align 4
	.globl	nextplong
	.type	nextplong, @function
nextplong:
.LFB66:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	.p2align 4,,10
	.p2align 3
.L23:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L23
	movsbq	%al, %rdx
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L18:
	movq	stdin(%rip), %rdi
	leaq	(%r12,%r12,4), %rax
	leaq	-48(%rdx,%rax,2), %r12
	call	getc@PLT
	movsbq	%al, %rdx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L18
	movq	%r12, %rax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE66:
	.size	nextplong, .-nextplong
	.p2align 4
	.globl	nextstr
	.type	nextstr, @function
nextstr:
.LFB67:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpb	$32, %al
	je	.L36
	movl	%eax, %edx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L36:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	%eax, %edx
	cmpb	$32, %al
	je	.L36
.L41:
	cmpb	$10, %al
	je	.L36
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L28:
	movb	%dl, (%rbx)
	movq	stdin(%rip), %rdi
	addq	$1, %rbx
	addl	$1, %r12d
	call	getc@PLT
	movl	%eax, %edx
	cmpb	$32, %al
	je	.L30
	cmpb	$10, %al
	jne	.L28
.L30:
	movb	$0, (%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE67:
	.size	nextstr, .-nextstr
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"0"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB72:
	.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
	call	nextpint
	movl	%eax, %ebx
	call	nextpint
	testl	%eax, %eax
	jne	.L50
	movl	$1, a(%rip)
	cmpl	$1, %ebx
	jle	.L53
	leaq	4+d(%rip), %r12
	leal	-2(%rbx), %edx
	leaq	4(%r12), %rax
	movq	%r12, %rbx
	leaq	a(%rip), %rbp
	leaq	(%rax,%rdx,4), %r13
	.p2align 4,,10
	.p2align 3
.L51:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L51
	movsbl	%al, %edx
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L49:
	movq	stdin(%rip), %rdi
	leal	(%r14,%r14,4), %eax
	leal	-48(%rdx,%rax,2), %r14d
	call	getc@PLT
	movsbl	%al, %edx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L49
	movl	%r14d, (%rbx)
	testl	%r14d, %r14d
	je	.L50
	movslq	%r14d, %r14
	addq	$4, %rbx
	addl	$1, 0(%rbp,%r14,4)
	cmpq	%rbx, %r13
	jne	.L51
	movabsq	$155014655926305585, %rsi
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L52:
	movl	(%r12), %eax
	addq	$4, %r12
	subl	$1, %eax
	cltq
	movslq	0(%rbp,%rax,4), %rcx
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%r12, %r13
	jne	.L52
.L45:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L61
.L50:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L61:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L53:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L45
	.cfi_endproc
.LFE72:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 400000
d:
	.zero	400000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.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	comp
	.type	comp, @function
comp:
.LFB63:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setg	%al
	setl	%dl
	movzbl	%dl, %edx
	movzbl	%al, %eax
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE63:
	.size	comp, .-comp
	.p2align 4
	.globl	compr
	.type	compr, @function
compr:
.LFB64:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setl	%al
	setg	%dl
	movzbl	%dl, %edx
	movzbl	%al, %eax
	subl	%edx, %eax
	ret
	.cfi_endproc
.LFE64:
	.size	compr, .-compr
	.p2align 4
	.globl	nextpint
	.type	nextpint, @function
nextpint:
.LFB65:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	.p2align 4,,10
	.p2align 3
.L13:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L13
	movsbl	%al, %edx
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L8:
	movq	stdin(%rip), %rdi
	leal	(%r12,%r12,4), %eax
	leal	-48(%rdx,%rax,2), %r12d
	call	getc@PLT
	movsbl	%al, %edx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L8
	movl	%r12d, %eax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE65:
	.size	nextpint, .-nextpint
	.p2align 4
	.globl	nextplong
	.type	nextplong, @function
nextplong:
.LFB66:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	.p2align 4,,10
	.p2align 3
.L23:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L23
	movsbq	%al, %rdx
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L18:
	movq	stdin(%rip), %rdi
	leaq	(%r12,%r12,4), %rax
	leaq	-48(%rdx,%rax,2), %r12
	call	getc@PLT
	movsbq	%al, %rdx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L18
	movq	%r12, %rax
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE66:
	.size	nextplong, .-nextplong
	.p2align 4
	.globl	nextstr
	.type	nextstr, @function
nextstr:
.LFB67:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movq	%rdi, %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movq	stdin(%rip), %rdi
	call	getc@PLT
	cmpb	$32, %al
	je	.L36
	movl	%eax, %edx
	jmp	.L41
	.p2align 4,,10
	.p2align 3
.L36:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	movl	%eax, %edx
	cmpb	$32, %al
	je	.L36
.L41:
	cmpb	$10, %al
	je	.L36
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L28:
	movb	%dl, (%rbx)
	movq	stdin(%rip), %rdi
	addq	$1, %rbx
	addl	$1, %r12d
	call	getc@PLT
	movl	%eax, %edx
	cmpb	$32, %al
	je	.L30
	cmpb	$10, %al
	jne	.L28
.L30:
	movb	$0, (%rbx)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	%r12d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE67:
	.size	nextstr, .-nextstr
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"0"
.LC1:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB72:
	.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
	call	nextpint
	movl	%eax, %ebx
	call	nextpint
	testl	%eax, %eax
	jne	.L50
	movl	$1, a(%rip)
	cmpl	$1, %ebx
	jle	.L53
	leaq	4+d(%rip), %r12
	leal	-2(%rbx), %edx
	leaq	4(%r12), %rax
	movq	%r12, %rbx
	leaq	a(%rip), %rbp
	leaq	(%rax,%rdx,4), %r13
	.p2align 4,,10
	.p2align 3
.L51:
	movq	stdin(%rip), %rdi
	call	getc@PLT
	leal	-48(%rax), %edx
	cmpb	$9, %dl
	ja	.L51
	movsbl	%al, %edx
	xorl	%r14d, %r14d
	.p2align 4,,10
	.p2align 3
.L49:
	movq	stdin(%rip), %rdi
	leal	(%r14,%r14,4), %eax
	leal	-48(%rdx,%rax,2), %r14d
	call	getc@PLT
	movsbl	%al, %edx
	subl	$48, %eax
	cmpb	$9, %al
	jbe	.L49
	movl	%r14d, (%rbx)
	testl	%r14d, %r14d
	je	.L50
	movslq	%r14d, %r14
	addq	$4, %rbx
	addl	$1, 0(%rbp,%r14,4)
	cmpq	%rbx, %r13
	jne	.L51
	movabsq	$155014655926305585, %rsi
	movl	$1, %edx
	.p2align 4,,10
	.p2align 3
.L52:
	movl	(%r12), %eax
	addq	$4, %r12
	subl	$1, %eax
	cltq
	movslq	0(%rbp,%rax,4), %rcx
	imulq	%rdx, %rcx
	movq	%rcx, %rax
	imulq	%rsi
	movq	%rcx, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	subq	%rax, %rcx
	movq	%rcx, %rdx
	cmpq	%r12, %r13
	jne	.L52
.L45:
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L61
.L50:
	leaq	.LC0(%rip), %rdi
	call	puts@PLT
.L61:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L53:
	.cfi_restore_state
	movl	$1, %edx
	jmp	.L45
	.cfi_endproc
.LFE72:
	.size	main, .-main
	.globl	d
	.bss
	.align 32
	.type	d, @object
	.size	d, 400000
d:
	.zero	400000
	.globl	a
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.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 <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint64_t nextplong(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
inline int abs2(const int a){return a>=0?a:-a;}

#define p 998244353

int a[100000];
int d[100000];
int main(void){
	int n=nextpint();
	if(nextpint()!=0){
		puts("0");
		return 0;
	}
	a[0]=1;
	for(int i=1; i<n; i++){
		d[i]=nextpint();
		if(d[i]==0){
			puts("0");
			return 0;
		}
		a[d[i]]++;
	}
	long ans=1;
	for(int i=1; i<n; i++){
		ans=(ans*a[d[i]-1])%p;
	}
	printf("%ld\n", ans);
}

4
0 1 1 2

2

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint64_t nextplong(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
inline int abs2(const int a){return a>=0?a:-a;}

#define p 998244353

int a[100000];
int d[100000];
int main(void){
	int n=nextpint();
	if(nextpint()!=0){
		puts("0");
		return 0;
	}
	a[0]=1;
	for(int i=1; i<n; i++){
		d[i]=nextpint();
		if(d[i]==0){
			puts("0");
			return 0;
		}
		a[d[i]]++;
	}
	long ans=1;
	for(int i=1; i<n; i++){
		ans=(ans*a[d[i]-1])%p;
	}
	printf("%ld\n", ans);
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	compr
	.type	compr, @function
compr:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	setg	%al
	movzbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compr, .-compr
	.globl	nextpint
	.type	nextpint, @function
nextpint:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	call	getchar@PLT
	movb	%al, -5(%rbp)
	jmp	.L6
.L7:
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L6:
	cmpb	$47, -5(%rbp)
	jle	.L7
	cmpb	$57, -5(%rbp)
	jg	.L7
	movl	$0, -4(%rbp)
	jmp	.L8
.L10:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-5(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L8:
	cmpb	$47, -5(%rbp)
	jle	.L9
	cmpb	$57, -5(%rbp)
	jle	.L10
.L9:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	nextpint, .-nextpint
	.globl	nextplong
	.type	nextplong, @function
nextplong:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	call	getchar@PLT
	movb	%al, -9(%rbp)
	jmp	.L13
.L14:
	call	getchar@PLT
	movb	%al, -9(%rbp)
.L13:
	cmpb	$47, -9(%rbp)
	jle	.L14
	cmpb	$57, -9(%rbp)
	jg	.L14
	movq	$0, -8(%rbp)
	jmp	.L15
.L17:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movsbq	-9(%rbp), %rax
	addq	%rdx, %rax
	subq	$48, %rax
	movq	%rax, -8(%rbp)
	call	getchar@PLT
	movb	%al, -9(%rbp)
.L15:
	cmpb	$47, -9(%rbp)
	jle	.L16
	cmpb	$57, -9(%rbp)
	jle	.L17
.L16:
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	nextplong, .-nextplong
	.globl	nextstr
	.type	nextstr, @function
nextstr:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
	jmp	.L20
.L21:
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L20:
	cmpb	$32, -5(%rbp)
	je	.L21
	cmpb	$10, -5(%rbp)
	je	.L21
	movl	$0, -4(%rbp)
	jmp	.L22
.L24:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	-5(%rbp), %edx
	movb	%dl, (%rax)
	addl	$1, -4(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L22:
	cmpb	$32, -5(%rbp)
	je	.L23
	cmpb	$10, -5(%rbp)
	jne	.L24
.L23:
	movq	-24(%rbp), %rax
	movb	$0, (%rax)
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	nextstr, .-nextstr
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400000
d:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"0"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	call	nextpint
	movl	%eax, -12(%rbp)
	call	nextpint
	testl	%eax, %eax
	je	.L27
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L28
.L27:
	movl	$1, a(%rip)
	movl	$1, -20(%rbp)
	jmp	.L29
.L31:
	call	nextpint
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L30
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L28
.L30:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L29:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L31
	movq	$1, -8(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L32
.L33:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$155014655926305585, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$23, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$998244353, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$1, -16(%rbp)
.L32:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L33
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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	comp
	.type	comp, @function
comp:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setg	%al
	movzbl	%al, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	setl	%al
	movzbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	comp, .-comp
	.globl	compr
	.type	compr, @function
compr:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %edx
	setl	%al
	movzbl	%al, %edx
	movq	-8(%rbp), %rax
	movl	(%rax), %ecx
	movq	-16(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ecx
	setg	%al
	movzbl	%al, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	compr, .-compr
	.globl	nextpint
	.type	nextpint, @function
nextpint:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	call	getchar@PLT
	movb	%al, -5(%rbp)
	jmp	.L6
.L7:
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L6:
	cmpb	$47, -5(%rbp)
	jle	.L7
	cmpb	$57, -5(%rbp)
	jg	.L7
	movl	$0, -4(%rbp)
	jmp	.L8
.L10:
	movl	-4(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movsbl	-5(%rbp), %eax
	addl	%edx, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L8:
	cmpb	$47, -5(%rbp)
	jle	.L9
	cmpb	$57, -5(%rbp)
	jle	.L10
.L9:
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	nextpint, .-nextpint
	.globl	nextplong
	.type	nextplong, @function
nextplong:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	call	getchar@PLT
	movb	%al, -9(%rbp)
	jmp	.L13
.L14:
	call	getchar@PLT
	movb	%al, -9(%rbp)
.L13:
	cmpb	$47, -9(%rbp)
	jle	.L14
	cmpb	$57, -9(%rbp)
	jg	.L14
	movq	$0, -8(%rbp)
	jmp	.L15
.L17:
	movq	-8(%rbp), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rax, %rax
	movq	%rax, %rdx
	movsbq	-9(%rbp), %rax
	addq	%rdx, %rax
	subq	$48, %rax
	movq	%rax, -8(%rbp)
	call	getchar@PLT
	movb	%al, -9(%rbp)
.L15:
	cmpb	$47, -9(%rbp)
	jle	.L16
	cmpb	$57, -9(%rbp)
	jle	.L17
.L16:
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	nextplong, .-nextplong
	.globl	nextstr
	.type	nextstr, @function
nextstr:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
	jmp	.L20
.L21:
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L20:
	cmpb	$32, -5(%rbp)
	je	.L21
	cmpb	$10, -5(%rbp)
	je	.L21
	movl	$0, -4(%rbp)
	jmp	.L22
.L24:
	movq	-24(%rbp), %rax
	leaq	1(%rax), %rdx
	movq	%rdx, -24(%rbp)
	movzbl	-5(%rbp), %edx
	movb	%dl, (%rax)
	addl	$1, -4(%rbp)
	call	getchar@PLT
	movb	%al, -5(%rbp)
.L22:
	cmpb	$32, -5(%rbp)
	je	.L23
	cmpb	$10, -5(%rbp)
	jne	.L24
.L23:
	movq	-24(%rbp), %rax
	movb	$0, (%rax)
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	nextstr, .-nextstr
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.globl	d
	.align 32
	.type	d, @object
	.size	d, 400000
d:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"0"
.LC1:
	.string	"%ld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB15:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	call	nextpint
	movl	%eax, -12(%rbp)
	call	nextpint
	testl	%eax, %eax
	je	.L27
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L28
.L27:
	movl	$1, a(%rip)
	movl	$1, -20(%rbp)
	jmp	.L29
.L31:
	call	nextpint
	movl	%eax, %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jne	.L30
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L28
.L30:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	movslq	%eax, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	a(%rip), %rdx
	movl	(%rcx,%rdx), %edx
	leal	1(%rdx), %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	addl	$1, -20(%rbp)
.L29:
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L31
	movq	$1, -8(%rbp)
	movl	$1, -16(%rbp)
	jmp	.L32
.L33:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	d(%rip), %rax
	movl	(%rdx,%rax), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	imulq	-8(%rbp), %rax
	movq	%rax, %rcx
	movabsq	$155014655926305585, %rdx
	movq	%rcx, %rax
	imulq	%rdx
	movq	%rdx, %rax
	sarq	$23, %rax
	movq	%rcx, %rdx
	sarq	$63, %rdx
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	imulq	$998244353, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -8(%rbp)
	addl	$1, -16(%rbp)
.L32:
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L33
	movq	-8(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L28:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.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:
