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>
typedef long long ll;
int main() {
  ll N,i;
  scanf("%lld", &N);
  ll D[N], countD[N];
  for(i=0;i<N;i++){
    countD[i] = 0;
  }
  for(i=0;i<N;i++){
    scanf("%lld",&D[i]);
    countD[D[i]]++;
  }

  if(D[0]!=0){
    printf("0\n");
    return 0;
  }
  /*
  if(countD[0]!=1){
    printf("0\n");
    return 0;
  }
  for(i=1;i<N;i++){
    if(countD[i]!=0 && countD[i-1]==0){
      printf("0\n");
      return 0;
    }
  }
  */  
  ll ans=1;
  for(i=1;i<N;i++){
    if(D[i]==0){
      ans=0;
      break;
    }else{
      //    printf("%llu\n",countD[D[i]-1]);
      ans = ans * countD[D[i]-1] % 998244353;
    }
  }
  printf("%lld\n",ans);
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	$104, %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
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	leaq	0(,%rax,8), %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
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	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	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L8
.L9:
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	addq	$1, -104(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-64(%rbp), %rdx
	movq	(%rdx,%rax,8), %rdx
	leaq	1(%rdx), %rcx
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rdx,%rax,8)
	addq	$1, -104(%rbp)
.L10:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L11
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movq	$1, -96(%rbp)
	movq	$1, -104(%rbp)
	jmp	.L14
.L17:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L15
	movq	$0, -96(%rbp)
	jmp	.L16
.L15:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	-1(%rax), %rdx
	movq	-64(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	imulq	-96(%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, -96(%rbp)
	movq	-96(%rbp), %rax
	imulq	$998244353, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -96(%rbp)
	addq	$1, -104(%rbp)
.L14:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L17
.L16:
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rdi
	movq	%rsp, %rsi
	leaq	0(,%rdi,8), %rdx
	leaq	15(%rdx), %rax
	movq	%rax, %r8
	movq	%rax, %rcx
	andq	$-4096, %r8
	andq	$-16, %rcx
	subq	%r8, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	leaq	7(%rsp), %r12
	movq	%rax, %rcx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%r12, %rbx
	andq	$-16, %rcx
	andq	$-8, %r12
	subq	%rax, %rsi
	shrq	$3, %rbx
	movq	%rbx, -72(%rbp)
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L29:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L30
.L7:
	movq	%rsp, %r13
	testq	%rdi, %rdi
	jle	.L8
	xorl	%esi, %esi
	movq	%r13, %rdi
	movq	%r12, %rbx
	xorl	%r15d, %r15d
	call	memset@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movq	(%rbx), %rax
	movq	-64(%rbp), %rdi
	addq	$8, %rbx
	addq	$1, 0(%r13,%rax,8)
	cmpq	%r15, %rdi
	jg	.L9
.L8:
	movq	-72(%rbp), %rax
	cmpq	$0, 0(,%rax,8)
	jne	.L10
	movl	$1, %edx
	movl	$1, %ecx
	movabsq	$155014655926305585, %r8
	cmpq	$1, %rdi
	jg	.L11
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movq	-8(%r13,%rax,8), %rsi
	addq	$1, %rcx
	imulq	%rdx, %rsi
	movq	%rsi, %rax
	imulq	%r8
	movq	%rsi, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	movq	%rsi, %rdx
	subq	%rax, %rdx
	cmpq	%rdi, %rcx
	je	.L12
.L11:
	movq	(%r12,%rcx,8), %rax
	testq	%rax, %rax
	jne	.L31
	xorl	%edx, %edx
.L12:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L32
	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
.L10:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L13
.L30:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L7
.L32:
	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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	leaq	.LC0(%rip), %r14
	leaq	-64(%rbp), %rsi
	pushq	%r13
	movq	%r14, %rdi
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	-64(%rbp), %rdi
	movq	%rsp, %rsi
	leaq	0(,%rdi,8), %rdx
	leaq	15(%rdx), %rax
	movq	%rax, %r8
	movq	%rax, %rcx
	andq	$-4096, %r8
	andq	$-16, %rcx
	subq	%r8, %rsi
	cmpq	%rsi, %rsp
	je	.L3
.L28:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L28
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L29
.L4:
	leaq	7(%rsp), %r12
	movq	%rax, %rcx
	movq	%rsp, %rsi
	andq	$-4096, %rax
	movq	%r12, %rbx
	andq	$-16, %rcx
	andq	$-8, %r12
	subq	%rax, %rsi
	shrq	$3, %rbx
	movq	%rbx, -72(%rbp)
.L5:
	cmpq	%rsi, %rsp
	je	.L6
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L5
.L29:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L6:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L30
.L7:
	movq	%rsp, %r13
	testq	%rdi, %rdi
	jle	.L8
	xorl	%esi, %esi
	movq	%r13, %rdi
	movq	%r12, %rbx
	xorl	%r15d, %r15d
	call	memset@PLT
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rbx, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	movq	(%rbx), %rax
	movq	-64(%rbp), %rdi
	addq	$8, %rbx
	addq	$1, 0(%r13,%rax,8)
	cmpq	%r15, %rdi
	jg	.L9
.L8:
	movq	-72(%rbp), %rax
	cmpq	$0, 0(,%rax,8)
	jne	.L10
	movl	$1, %edx
	movl	$1, %ecx
	movabsq	$155014655926305585, %r8
	cmpq	$1, %rdi
	jg	.L11
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L31:
	movq	-8(%r13,%rax,8), %rsi
	addq	$1, %rcx
	imulq	%rdx, %rsi
	movq	%rsi, %rax
	imulq	%r8
	movq	%rsi, %rax
	sarq	$63, %rax
	sarq	$23, %rdx
	subq	%rax, %rdx
	imulq	$998244353, %rdx, %rax
	movq	%rsi, %rdx
	subq	%rax, %rdx
	cmpq	%rdi, %rcx
	je	.L12
.L11:
	movq	(%r12,%rcx,8), %rax
	testq	%rax, %rax
	jne	.L31
	xorl	%edx, %edx
.L12:
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L13:
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L32
	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
.L10:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L13
.L30:
	orq	$0, -8(%rsp,%rcx)
	jmp	.L7
.L32:
	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:

#include <stdio.h>
typedef long long ll;
int main() {
  ll N,i;
  scanf("%lld", &N);
  ll D[N], countD[N];
  for(i=0;i<N;i++){
    countD[i] = 0;
  }
  for(i=0;i<N;i++){
    scanf("%lld",&D[i]);
    countD[D[i]]++;
  }

  if(D[0]!=0){
    printf("0\n");
    return 0;
  }
  /*
  if(countD[0]!=1){
    printf("0\n");
    return 0;
  }
  for(i=1;i<N;i++){
    if(countD[i]!=0 && countD[i-1]==0){
      printf("0\n");
      return 0;
    }
  }
  */  
  ll ans=1;
  for(i=1;i<N;i++){
    if(D[i]==0){
      ans=0;
      break;
    }else{
      //    printf("%llu\n",countD[D[i]-1]);
      ans = ans * countD[D[i]-1] % 998244353;
    }
  }
  printf("%lld\n",ans);
  
  return 0;
}

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 <stdio.h>
typedef long long ll;
int main() {
  ll N,i;
  scanf("%lld", &N);
  ll D[N], countD[N];
  for(i=0;i<N;i++){
    countD[i] = 0;
  }
  for(i=0;i<N;i++){
    scanf("%lld",&D[i]);
    countD[D[i]]++;
  }

  if(D[0]!=0){
    printf("0\n");
    return 0;
  }
  /*
  if(countD[0]!=1){
    printf("0\n");
    return 0;
  }
  for(i=1;i<N;i++){
    if(countD[i]!=0 && countD[i-1]==0){
      printf("0\n");
      return 0;
    }
  }
  */  
  ll ans=1;
  for(i=1;i<N;i++){
    if(D[i]==0){
      ans=0;
      break;
    }else{
      //    printf("%llu\n",countD[D[i]-1]);
      ans = ans * countD[D[i]-1] % 998244353;
    }
  }
  printf("%lld\n",ans);
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	$104, %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
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	leaq	0(,%rax,8), %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
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	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	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L8
.L9:
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	addq	$1, -104(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-64(%rbp), %rdx
	movq	(%rdx,%rax,8), %rdx
	leaq	1(%rdx), %rcx
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rdx,%rax,8)
	addq	$1, -104(%rbp)
.L10:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L11
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movq	$1, -96(%rbp)
	movq	$1, -104(%rbp)
	jmp	.L14
.L17:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L15
	movq	$0, -96(%rbp)
	jmp	.L16
.L15:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	-1(%rax), %rdx
	movq	-64(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	imulq	-96(%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, -96(%rbp)
	movq	-96(%rbp), %rax
	imulq	$998244353, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -96(%rbp)
	addq	$1, -104(%rbp)
.L14:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L17
.L16:
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%lld"
.LC1:
	.string	"0"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	$104, %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
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -88(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -128(%rbp)
	movq	$0, -120(%rbp)
	movq	%rax, %rdx
	movq	%rdx, -144(%rbp)
	movq	$0, -136(%rbp)
	leaq	0(,%rax,8), %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
.L2:
	cmpq	%rdx, %rsp
	je	.L3
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L2
.L3:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L4
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L4:
	movq	%rsp, %rax
	addq	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -80(%rbp)
	movq	-112(%rbp), %rax
	leaq	-1(%rax), %rdx
	movq	%rdx, -72(%rbp)
	movq	%rax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movq	%rax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	leaq	0(,%rax,8), %rdx
	movl	$16, %eax
	subq	$1, %rax
	addq	%rdx, %rax
	movl	$16, %edi
	movl	$0, %edx
	divq	%rdi
	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	$7, %rax
	shrq	$3, %rax
	salq	$3, %rax
	movq	%rax, -64(%rbp)
	movq	$0, -104(%rbp)
	jmp	.L8
.L9:
	movq	-64(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	$0, (%rax,%rdx,8)
	addq	$1, -104(%rbp)
.L8:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L9
	movq	$0, -104(%rbp)
	jmp	.L10
.L11:
	movq	-104(%rbp), %rax
	leaq	0(,%rax,8), %rdx
	movq	-80(%rbp), %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	movq	-64(%rbp), %rdx
	movq	(%rdx,%rax,8), %rdx
	leaq	1(%rdx), %rcx
	movq	-64(%rbp), %rdx
	movq	%rcx, (%rdx,%rax,8)
	addq	$1, -104(%rbp)
.L10:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L11
	movq	-80(%rbp), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	.L12
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	jmp	.L13
.L12:
	movq	$1, -96(%rbp)
	movq	$1, -104(%rbp)
	jmp	.L14
.L17:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	testq	%rax, %rax
	jne	.L15
	movq	$0, -96(%rbp)
	jmp	.L16
.L15:
	movq	-80(%rbp), %rax
	movq	-104(%rbp), %rdx
	movq	(%rax,%rdx,8), %rax
	leaq	-1(%rax), %rdx
	movq	-64(%rbp), %rax
	movq	(%rax,%rdx,8), %rax
	imulq	-96(%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, -96(%rbp)
	movq	-96(%rbp), %rax
	imulq	$998244353, %rax, %rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	movq	%rax, -96(%rbp)
	addq	$1, -104(%rbp)
.L14:
	movq	-112(%rbp), %rax
	cmpq	%rax, -104(%rbp)
	jl	.L17
.L16:
	movq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
.L13:
	movq	%rbx, %rsp
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
