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()
{
    long int i, j, k, n;
    long int cnt;
    long int cnt_2 = 0;
    long int r_cnt = 0;
    long int g_cnt = 0;
    long int b_cnt = 0;
    char s[4001];
    scanf("%ld", &n);
    scanf("%s", s);

    for(i=0; i<n; i++)
    {
        if(s[i] == 'R') r_cnt++;
        else if(s[i] == 'G') g_cnt++;
        else if(s[i] == 'B') b_cnt++;
    }
    cnt = r_cnt * g_cnt * b_cnt;
    for(i=1; i<=n; i++)
    {
        for(j=i+1; j<=n; j++)
        {
            k = 2 * j - i;
            if(k > n) continue;
            if(s[i-1] == s[j-1]) continue;
            if(s[i-1] == s[k-1]) continue;
            if(s[j-1] == s[k-1]) continue;
            cnt_2++;
        }
    }
    printf("%ld\n", cnt - cnt_2);

    return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L14
	movq	%rbx, %r11
	leaq	(%rbx,%rsi), %rdi
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L24
	cmpb	$66, %dl
	sete	%dl
	movzbl	%dl, %edx
	addq	%rdx, %r8
.L4:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L25
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rdi
	jne	.L6
.L25:
	imulq	%r9, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rbp
	cmpq	$1, %rsi
	je	.L22
	leaq	1(%rsi), %r12
	xorl	%edx, %edx
	leaq	15(%rsp), %r10
	movl	$2, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rbx
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rsi, %rcx
	jg	.L9
	movzbl	(%r11), %r8d
	movzbl	(%r10,%rax), %edi
	cmpb	%dil, %r8b
	je	.L9
	movzbl	(%r10,%rcx), %r9d
	cmpb	%r9b, %dil
	je	.L9
	cmpb	%r9b, %r8b
	sete	%dil
	cmpb	$1, %dil
	adcq	$0, %rdx
.L9:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	%rsi, %rax
	jle	.L10
	movq	%rbx, %rax
	addq	$1, %r11
	cmpq	%r12, %rbx
	jne	.L12
.L2:
	movq	%rbp, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	subq	%rdx, %r8
	leaq	.LC2(%rip), %rsi
	movq	%r8, %rdx
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	addq	$1, %r9
	jmp	.L4
.L14:
	xorl	%ebp, %ebp
.L22:
	xorl	%edx, %edx
	jmp	.L2
.L26:
	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	"%ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L14
	movq	%rbx, %r11
	leaq	(%rbx,%rsi), %rdi
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L24
	cmpb	$66, %dl
	sete	%dl
	movzbl	%dl, %edx
	addq	%rdx, %r8
.L4:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L25
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rdi
	jne	.L6
.L25:
	imulq	%r9, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rbp
	cmpq	$1, %rsi
	je	.L22
	leaq	1(%rsi), %r12
	xorl	%edx, %edx
	leaq	15(%rsp), %r10
	movl	$2, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rbx
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rsi, %rcx
	jg	.L9
	movzbl	(%r11), %r8d
	movzbl	(%r10,%rax), %edi
	cmpb	%dil, %r8b
	je	.L9
	movzbl	(%r10,%rcx), %r9d
	cmpb	%r9b, %dil
	je	.L9
	cmpb	%r9b, %r8b
	sete	%dil
	cmpb	$1, %dil
	adcq	$0, %rdx
.L9:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	%rsi, %rax
	jle	.L10
	movq	%rbx, %rax
	addq	$1, %r11
	cmpq	%r12, %rbx
	jne	.L12
.L2:
	movq	%rbp, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	subq	%rdx, %r8
	leaq	.LC2(%rip), %rsi
	movq	%r8, %rdx
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	addq	$1, %r9
	jmp	.L4
.L14:
	xorl	%ebp, %ebp
.L22:
	xorl	%edx, %edx
	jmp	.L2
.L26:
	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	"%ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L14
	movq	%rbx, %r11
	leaq	(%rbx,%rsi), %rdi
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L24
	cmpb	$66, %dl
	sete	%dl
	movzbl	%dl, %edx
	addq	%rdx, %r8
.L4:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L25
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rdi
	jne	.L6
.L25:
	imulq	%r9, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rbp
	cmpq	$1, %rsi
	je	.L22
	leaq	1(%rsi), %r12
	xorl	%edx, %edx
	leaq	15(%rsp), %r10
	movl	$2, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rbx
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rsi, %rcx
	jg	.L9
	movzbl	(%r11), %r8d
	movzbl	(%r10,%rax), %edi
	cmpb	%dil, %r8b
	je	.L9
	movzbl	(%r10,%rcx), %r9d
	cmpb	%r9b, %dil
	je	.L9
	cmpb	%r9b, %r8b
	sete	%dil
	cmpb	$1, %dil
	adcq	$0, %rdx
.L9:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	%rsi, %rax
	jle	.L10
	movq	%rbx, %rax
	addq	$1, %r11
	cmpq	%r12, %rbx
	jne	.L12
.L2:
	movq	%rbp, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	subq	%rdx, %r8
	leaq	.LC2(%rip), %rsi
	movq	%r8, %rdx
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	addq	$1, %r9
	jmp	.L4
.L14:
	xorl	%ebp, %ebp
.L22:
	xorl	%edx, %edx
	jmp	.L2
.L26:
	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()
{
    long int i, j, k, n;
    long int cnt;
    long int cnt_2 = 0;
    long int r_cnt = 0;
    long int g_cnt = 0;
    long int b_cnt = 0;
    char s[4001];
    scanf("%ld", &n);
    scanf("%s", s);

    for(i=0; i<n; i++)
    {
        if(s[i] == 'R') r_cnt++;
        else if(s[i] == 'G') g_cnt++;
        else if(s[i] == 'B') b_cnt++;
    }
    cnt = r_cnt * g_cnt * b_cnt;
    for(i=1; i<=n; i++)
    {
        for(j=i+1; j<=n; j++)
        {
            k = 2 * j - i;
            if(k > n) continue;
            if(s[i-1] == s[j-1]) continue;
            if(s[i-1] == s[k-1]) continue;
            if(s[j-1] == s[k-1]) continue;
            cnt_2++;
        }
    }
    printf("%ld\n", cnt - cnt_2);

    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()
{
    long int i, j, k, n;
    long int cnt;
    long int cnt_2 = 0;
    long int r_cnt = 0;
    long int g_cnt = 0;
    long int b_cnt = 0;
    char s[4001];
    scanf("%ld", &n);
    scanf("%s", s);

    for(i=0; i<n; i++)
    {
        if(s[i] == 'R') r_cnt++;
        else if(s[i] == 'G') g_cnt++;
        else if(s[i] == 'B') b_cnt++;
    }
    cnt = r_cnt * g_cnt * b_cnt;
    for(i=1; i<=n; i++)
    {
        for(j=i+1; j<=n; j++)
        {
            k = 2 * j - i;
            if(k > n) continue;
            if(s[i-1] == s[j-1]) continue;
            if(s[i-1] == s[k-1]) continue;
            if(s[j-1] == s[k-1]) continue;
            cnt_2++;
        }
    }
    printf("%ld\n", cnt - cnt_2);

    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:

4
BGRR
 39
BBBGBBBRBGBRBGBRBGGBRRRBBGRRBBGGBRGBRBR
 39
RBRBRRBGGBBRRGBBGRRBGGBRBGBRBGBRBBBGBBB
 4
GRRB
 39
RRRBGRBGGBBRRGBBRBRBGGBRBGBRBGBRBBBGBBB
 39
BBBGBBBRBGBRBGBRBGGBRRBBBGRRBBGGBRGRRBR
 39
RRRBGRBGGBBRRGBBRBRBGGBRBGBRBGBBBBBGBBR
 39
RRRBGRBGGBBRRGBBRRBBGGBRBGBRBGBBBBBGBBR
 39
RBBGBBBBBGBRBRBRBGGBBGRBBGRRBBGGRRGBBRR
 4
RGBR

1
 1800
 1796
 2
 1804
 1806
 1813
 1811
 1803
 0

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()
{
    long int i, j, k, n;
    long int cnt;
    long int cnt_2 = 0;
    long int r_cnt = 0;
    long int g_cnt = 0;
    long int b_cnt = 0;
    char s[4001];
    scanf("%ld", &n);
    scanf("%s", s);

    for(i=0; i<n; i++)
    {
        if(s[i] == 'R') r_cnt++;
        else if(s[i] == 'G') g_cnt++;
        else if(s[i] == 'B') b_cnt++;
    }
    cnt = r_cnt * g_cnt * b_cnt;
    for(i=1; i<=n; i++)
    {
        for(j=i+1; j<=n; j++)
        {
            k = 2 * j - i;
            if(k > n) continue;
            if(s[i-1] == s[j-1]) continue;
            if(s[i-1] == s[k-1]) continue;
            if(s[j-1] == s[k-1]) continue;
            cnt_2++;
        }
    }
    printf("%ld\n", cnt - cnt_2);

    return 0;
}

```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L14
	movq	%rbx, %r11
	leaq	(%rbx,%rsi), %rdi
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L24
	cmpb	$66, %dl
	sete	%dl
	movzbl	%dl, %edx
	addq	%rdx, %r8
.L4:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L25
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rdi
	jne	.L6
.L25:
	imulq	%r9, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rbp
	cmpq	$1, %rsi
	je	.L22
	leaq	1(%rsi), %r12
	xorl	%edx, %edx
	leaq	15(%rsp), %r10
	movl	$2, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rbx
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rsi, %rcx
	jg	.L9
	movzbl	(%r11), %r8d
	movzbl	(%r10,%rax), %edi
	cmpb	%dil, %r8b
	je	.L9
	movzbl	(%r10,%rcx), %r9d
	cmpb	%r9b, %dil
	je	.L9
	cmpb	%r9b, %r8b
	sete	%dil
	cmpb	$1, %dil
	adcq	$0, %rdx
.L9:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	%rsi, %rax
	jle	.L10
	movq	%rbx, %rax
	addq	$1, %r11
	cmpq	%r12, %rbx
	jne	.L12
.L2:
	movq	%rbp, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	subq	%rdx, %r8
	leaq	.LC2(%rip), %rsi
	movq	%r8, %rdx
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	addq	$1, %r9
	jmp	.L4
.L14:
	xorl	%ebp, %ebp
.L22:
	xorl	%edx, %edx
	jmp	.L2
.L26:
	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	"%ld"
.LC1:
	.string	"%s"
.LC2:
	.string	"%ld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	subq	$4032, %rsp
	.cfi_def_cfa_offset 4064
	movq	%fs:40, %rax
	movq	%rax, 4024(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	testq	%rsi, %rsi
	jle	.L14
	movq	%rbx, %r11
	leaq	(%rbx,%rsi), %rdi
	movq	%rbx, %rax
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	xorl	%ecx, %ecx
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L24
	cmpb	$66, %dl
	sete	%dl
	movzbl	%dl, %edx
	addq	%rdx, %r8
.L4:
	addq	$1, %rax
	cmpq	%rax, %rdi
	je	.L25
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rdi
	jne	.L6
.L25:
	imulq	%r9, %rcx
	imulq	%r8, %rcx
	movq	%rcx, %rbp
	cmpq	$1, %rsi
	je	.L22
	leaq	1(%rsi), %r12
	xorl	%edx, %edx
	leaq	15(%rsp), %r10
	movl	$2, %eax
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	1(%rax), %rbx
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	cmpq	%rsi, %rcx
	jg	.L9
	movzbl	(%r11), %r8d
	movzbl	(%r10,%rax), %edi
	cmpb	%dil, %r8b
	je	.L9
	movzbl	(%r10,%rcx), %r9d
	cmpb	%r9b, %dil
	je	.L9
	cmpb	%r9b, %r8b
	sete	%dil
	cmpb	$1, %dil
	adcq	$0, %rdx
.L9:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	%rsi, %rax
	jle	.L10
	movq	%rbx, %rax
	addq	$1, %r11
	cmpq	%r12, %rbx
	jne	.L12
.L2:
	movq	%rbp, %r8
	xorl	%eax, %eax
	movl	$1, %edi
	subq	%rdx, %r8
	leaq	.LC2(%rip), %rsi
	movq	%r8, %rdx
	call	__printf_chk@PLT
	movq	4024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$4032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L24:
	.cfi_restore_state
	addq	$1, %r9
	jmp	.L4
.L14:
	xorl	%ebp, %ebp
.L22:
	xorl	%edx, %edx
	jmp	.L2
.L26:
	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:
```