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(void) {

  int n;
	scanf("%d", &n);
	char s[2][n+1];
	scanf("%s %s", s[0], s[1]);
	long mod = 1000000007;
	int prev = -1;
	long answer = 1;
	for (int i = 0; i < n; i++) {
		if (i != n-1 && s[0][i] == s[0][i+1]) {
			i++;
			if (prev == -1) {
				answer *= 3*2;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 3;
			}
			answer %= mod;
			prev = 2;
		} else {
			if (prev == -1) {
				answer *= 3;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 1;
			}
			answer %= mod;
			prev = 1;
		}
	}
	printf("%ld\n", answer);

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %s"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rsi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx,%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L22:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L22
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L23
.L4:
	leaq	.LC1(%rip), %rdi
	addq	%rsp, %rdx
	movq	%rsp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edi
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L15
	leal	-1(%rdi), %r9d
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$-1, %edx
	movabsq	$-8543223828751151131, %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r8,%r8), %rax
	cmpl	$1, %edx
	cmove	%rax, %r8
.L12:
	movq	%r8, %rax
	movl	%esi, %ecx
	imulq	%r10
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r8
	movl	$1, %edx
	cmpl	%ecx, %edi
	jle	.L5
.L13:
	leal	1(%rcx), %esi
	cmpl	%ecx, %r9d
	je	.L6
	movslq	%esi, %r11
	movslq	%ecx, %rax
	movzbl	(%rbx,%r11), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L24
.L6:
	cmpl	$-1, %edx
	jne	.L11
	leaq	(%r8,%r8,2), %r8
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	imulq	$6, %r8, %rsi
	cmpl	$-1, %edx
	je	.L8
	leaq	(%r8,%r8), %rsi
	addq	%rsi, %r8
	cmpl	$1, %edx
	cmovne	%r8, %rsi
.L8:
	movq	%rsi, %rax
	addl	$2, %ecx
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	movl	$2, %edx
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	cmpl	%ecx, %edi
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L23:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L15:
	movl	$1, %r8d
	jmp	.L5
.L25:
	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"
.LC1:
	.string	"%s %s"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rsi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx,%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L22:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L22
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L23
.L4:
	leaq	.LC1(%rip), %rdi
	addq	%rsp, %rdx
	movq	%rsp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edi
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L15
	leal	-1(%rdi), %r9d
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$-1, %edx
	movabsq	$-8543223828751151131, %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r8,%r8), %rax
	cmpl	$1, %edx
	cmove	%rax, %r8
.L12:
	movq	%r8, %rax
	movl	%esi, %ecx
	imulq	%r10
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r8
	movl	$1, %edx
	cmpl	%ecx, %edi
	jle	.L5
.L13:
	leal	1(%rcx), %esi
	cmpl	%ecx, %r9d
	je	.L6
	movslq	%esi, %r11
	movslq	%ecx, %rax
	movzbl	(%rbx,%r11), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L24
.L6:
	cmpl	$-1, %edx
	jne	.L11
	leaq	(%r8,%r8,2), %r8
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	imulq	$6, %r8, %rsi
	cmpl	$-1, %edx
	je	.L8
	leaq	(%r8,%r8), %rsi
	addq	%rsi, %r8
	cmpl	$1, %edx
	cmovne	%r8, %rsi
.L8:
	movq	%rsi, %rax
	addl	$2, %ecx
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	movl	$2, %edx
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	cmpl	%ecx, %edi
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L23:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L15:
	movl	$1, %r8d
	jmp	.L5
.L25:
	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"
.LC1:
	.string	"%s %s"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rsi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx,%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L22:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L22
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L23
.L4:
	leaq	.LC1(%rip), %rdi
	addq	%rsp, %rdx
	movq	%rsp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edi
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L15
	leal	-1(%rdi), %r9d
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$-1, %edx
	movabsq	$-8543223828751151131, %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r8,%r8), %rax
	cmpl	$1, %edx
	cmove	%rax, %r8
.L12:
	movq	%r8, %rax
	movl	%esi, %ecx
	imulq	%r10
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r8
	movl	$1, %edx
	cmpl	%ecx, %edi
	jle	.L5
.L13:
	leal	1(%rcx), %esi
	cmpl	%ecx, %r9d
	je	.L6
	movslq	%esi, %r11
	movslq	%ecx, %rax
	movzbl	(%rbx,%r11), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L24
.L6:
	cmpl	$-1, %edx
	jne	.L11
	leaq	(%r8,%r8,2), %r8
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	imulq	$6, %r8, %rsi
	cmpl	$-1, %edx
	je	.L8
	leaq	(%r8,%r8), %rsi
	addq	%rsi, %r8
	cmpl	$1, %edx
	cmovne	%r8, %rsi
.L8:
	movq	%rsi, %rax
	addl	$2, %ecx
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	movl	$2, %edx
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	cmpl	%ecx, %edi
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L23:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L15:
	movl	$1, %r8d
	jmp	.L5
.L25:
	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(void) {

  int n;
	scanf("%d", &n);
	char s[2][n+1];
	scanf("%s %s", s[0], s[1]);
	long mod = 1000000007;
	int prev = -1;
	long answer = 1;
	for (int i = 0; i < n; i++) {
		if (i != n-1 && s[0][i] == s[0][i+1]) {
			i++;
			if (prev == -1) {
				answer *= 3*2;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 3;
			}
			answer %= mod;
			prev = 2;
		} else {
			if (prev == -1) {
				answer *= 3;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 1;
			}
			answer %= mod;
			prev = 1;
		}
	}
	printf("%ld\n", answer);

  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(void) {

  int n;
	scanf("%d", &n);
	char s[2][n+1];
	scanf("%s %s", s[0], s[1]);
	long mod = 1000000007;
	int prev = -1;
	long answer = 1;
	for (int i = 0; i < n; i++) {
		if (i != n-1 && s[0][i] == s[0][i+1]) {
			i++;
			if (prev == -1) {
				answer *= 3*2;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 3;
			}
			answer %= mod;
			prev = 2;
		} else {
			if (prev == -1) {
				answer *= 3;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 1;
			}
			answer %= mod;
			prev = 1;
		}
	}
	printf("%ld\n", answer);

  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:

3
aab
ccb

6

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(void) {

  int n;
	scanf("%d", &n);
	char s[2][n+1];
	scanf("%s %s", s[0], s[1]);
	long mod = 1000000007;
	int prev = -1;
	long answer = 1;
	for (int i = 0; i < n; i++) {
		if (i != n-1 && s[0][i] == s[0][i+1]) {
			i++;
			if (prev == -1) {
				answer *= 3*2;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 3;
			}
			answer %= mod;
			prev = 2;
		} else {
			if (prev == -1) {
				answer *= 3;
			} else if (prev == 1) {
				answer *= 2;
			} else {
				answer *= 1;
			}
			answer %= mod;
			prev = 1;
		}
	}
	printf("%ld\n", answer);

  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s %s"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rsi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx,%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L22:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L22
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L23
.L4:
	leaq	.LC1(%rip), %rdi
	addq	%rsp, %rdx
	movq	%rsp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edi
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L15
	leal	-1(%rdi), %r9d
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$-1, %edx
	movabsq	$-8543223828751151131, %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r8,%r8), %rax
	cmpl	$1, %edx
	cmove	%rax, %r8
.L12:
	movq	%r8, %rax
	movl	%esi, %ecx
	imulq	%r10
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r8
	movl	$1, %edx
	cmpl	%ecx, %edi
	jle	.L5
.L13:
	leal	1(%rcx), %esi
	cmpl	%ecx, %r9d
	je	.L6
	movslq	%esi, %r11
	movslq	%ecx, %rax
	movzbl	(%rbx,%r11), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L24
.L6:
	cmpl	$-1, %edx
	jne	.L11
	leaq	(%r8,%r8,2), %r8
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	imulq	$6, %r8, %rsi
	cmpl	$-1, %edx
	je	.L8
	leaq	(%r8,%r8), %rsi
	addq	%rsi, %r8
	cmpl	$1, %edx
	cmovne	%r8, %rsi
.L8:
	movq	%rsi, %rax
	addl	$2, %ecx
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	movl	$2, %edx
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	cmpl	%ecx, %edi
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L23:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L15:
	movl	$1, %r8d
	jmp	.L5
.L25:
	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"
.LC1:
	.string	"%s %s"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rsi
	leal	1(%rax), %edx
	movslq	%edx, %rdx
	leaq	15(%rdx,%rdx), %rax
	movq	%rax, %rcx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rcx
	cmpq	%rsi, %rsp
	je	.L3
.L22:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L22
.L3:
	andl	$4095, %ecx
	subq	%rcx, %rsp
	testq	%rcx, %rcx
	jne	.L23
.L4:
	leaq	.LC1(%rip), %rdi
	addq	%rsp, %rdx
	movq	%rsp, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %edi
	movq	%rsp, %rbx
	testl	%edi, %edi
	jle	.L15
	leal	-1(%rdi), %r9d
	xorl	%ecx, %ecx
	movl	$1, %r8d
	movl	$-1, %edx
	movabsq	$-8543223828751151131, %r10
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L11:
	leaq	(%r8,%r8), %rax
	cmpl	$1, %edx
	cmove	%rax, %r8
.L12:
	movq	%r8, %rax
	movl	%esi, %ecx
	imulq	%r10
	movq	%r8, %rax
	sarq	$63, %rax
	addq	%r8, %rdx
	sarq	$29, %rdx
	subq	%rax, %rdx
	imulq	$1000000007, %rdx, %rdx
	subq	%rdx, %r8
	movl	$1, %edx
	cmpl	%ecx, %edi
	jle	.L5
.L13:
	leal	1(%rcx), %esi
	cmpl	%ecx, %r9d
	je	.L6
	movslq	%esi, %r11
	movslq	%ecx, %rax
	movzbl	(%rbx,%r11), %r11d
	cmpb	%r11b, (%rbx,%rax)
	je	.L24
.L6:
	cmpl	$-1, %edx
	jne	.L11
	leaq	(%r8,%r8,2), %r8
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L24:
	imulq	$6, %r8, %rsi
	cmpl	$-1, %edx
	je	.L8
	leaq	(%r8,%r8), %rsi
	addq	%rsi, %r8
	cmpl	$1, %edx
	cmovne	%r8, %rsi
.L8:
	movq	%rsi, %rax
	addl	$2, %ecx
	imulq	%r10
	movq	%rsi, %rax
	sarq	$63, %rax
	leaq	(%rdx,%rsi), %r8
	movl	$2, %edx
	sarq	$29, %r8
	subq	%rax, %r8
	imulq	$1000000007, %r8, %rax
	subq	%rax, %rsi
	movq	%rsi, %r8
	cmpl	%ecx, %edi
	jg	.L13
	.p2align 4,,10
	.p2align 3
.L5:
	xorl	%eax, %eax
	movq	%r8, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L25
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L23:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rcx)
	jmp	.L4
.L15:
	movl	$1, %r8d
	jmp	.L5
.L25:
	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:
```