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>
#include <stdlib.h>
#include <string.h>

int main(void) {
    int n,i,j,k;
    long long int ans,r=0,g=0,b=0;
    char s[4100];
    (void)scanf("%d",&n);
    (void)scanf("%s",&s[1]);
    for(i=1;i<=n;i++){
      if(s[i]=='R')r++;
      if(s[i]=='G')g++;
      if(s[i]=='B')b++;
    }
    ans=r*g*b;
    for(i=1;i<=n-2;i++){
      for(j=i+1;j<=n-1;j++){
        k=2*j-i;
        if(j<k&&k<=n){
          if((s[i]!=s[j])&&(s[i]!=s[k])&&(s[j]!=s[k]))
            ans--;
        }
      }
    }
    printf("%lld\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -4136(%rbp)
	movq	$0, -4128(%rbp)
	movq	$0, -4120(%rbp)
	leaq	-4160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-4112(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4156(%rbp)
	jmp	.L2
.L6:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L3
	addq	$1, -4136(%rbp)
.L3:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$71, %al
	jne	.L4
	addq	$1, -4128(%rbp)
.L4:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L5
	addq	$1, -4120(%rbp)
.L5:
	addl	$1, -4156(%rbp)
.L2:
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4156(%rbp)
	jle	.L6
	movq	-4136(%rbp), %rax
	imulq	-4128(%rbp), %rax
	movq	-4120(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -4144(%rbp)
	movl	$1, -4156(%rbp)
	jmp	.L7
.L11:
	movl	-4156(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4152(%rbp)
	jmp	.L8
.L10:
	movl	-4152(%rbp), %eax
	addl	%eax, %eax
	subl	-4156(%rbp), %eax
	movl	%eax, -4148(%rbp)
	movl	-4152(%rbp), %eax
	cmpl	-4148(%rbp), %eax
	jge	.L9
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4148(%rbp)
	jg	.L9
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4152(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4148(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-4152(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4148(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	subq	$1, -4144(%rbp)
.L9:
	addl	$1, -4152(%rbp)
.L8:
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4152(%rbp)
	jl	.L10
	addl	$1, -4156(%rbp)
.L7:
	movl	-4160(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -4156(%rbp)
	jl	.L11
	movq	-4144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$32, %rsp
	.cfi_def_cfa_offset 4176
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4120(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	17(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L12
	leal	-1(%rsi), %edx
	movq	%rbx, %rax
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	leaq	18(%rsp,%rdx), %rcx
	xorl	%r11d, %r11d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L5
	cmpb	$66, %dl
	jne	.L4
	addq	$1, %rdi
.L4:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L29
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %r11
	cmpq	%rcx, %rax
	jne	.L6
.L29:
	imulq	%r8, %r11
	imulq	%rdi, %r11
	cmpl	$2, %esi
	jle	.L2
	leal	-3(%rsi), %r12d
	leal	-1(%rsi,%rsi), %ecx
	movl	$2, %edi
	addq	$3, %r12
	leaq	15(%rsp), %r14
	leaq	19(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%edi, %esi
	jle	.L7
	movq	%r13, %rbp
	leal	1(%rdi), %eax
	leaq	(%rdi,%r14), %rbx
	movq	%rdi, %rdx
	subq	%rdi, %rbp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$2, %eax
	addq	$1, %rdx
	cmpl	%ecx, %eax
	je	.L7
.L9:
	cmpl	%esi, %eax
	jg	.L8
	cmpl	%edx, %eax
	jle	.L8
	movzbl	(%rbx), %r8d
	movzbl	16(%rsp,%rdx), %r9d
	cmpb	%r9b, %r8b
	je	.L8
	movzbl	-2(%rbp,%rdx,2), %r10d
	cmpb	%r10b, %r8b
	je	.L8
	cmpb	%r10b, %r9b
	setne	%r8b
	cmpb	$1, %r8b
	adcq	$-1, %r11
	addl	$2, %eax
	addq	$1, %rdx
	cmpl	%ecx, %eax
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rdi
	subl	$1, %ecx
	cmpq	%r12, %rdi
	jne	.L10
.L2:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	4120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$4128, %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
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	addq	$1, %r8
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$32, %rsp
	.cfi_def_cfa_offset 4176
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 4120(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	17(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	jle	.L12
	leal	-1(%rsi), %edx
	movq	%rbx, %rax
	xorl	%edi, %edi
	xorl	%r8d, %r8d
	leaq	18(%rsp,%rdx), %rcx
	xorl	%r11d, %r11d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L3:
	cmpb	$71, %dl
	je	.L5
	cmpb	$66, %dl
	jne	.L4
	addq	$1, %rdi
.L4:
	addq	$1, %rax
	cmpq	%rcx, %rax
	je	.L29
.L6:
	movzbl	(%rax), %edx
	cmpb	$82, %dl
	jne	.L3
	addq	$1, %rax
	addq	$1, %r11
	cmpq	%rcx, %rax
	jne	.L6
.L29:
	imulq	%r8, %r11
	imulq	%rdi, %r11
	cmpl	$2, %esi
	jle	.L2
	leal	-3(%rsi), %r12d
	leal	-1(%rsi,%rsi), %ecx
	movl	$2, %edi
	addq	$3, %r12
	leaq	15(%rsp), %r14
	leaq	19(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	%edi, %esi
	jle	.L7
	movq	%r13, %rbp
	leal	1(%rdi), %eax
	leaq	(%rdi,%r14), %rbx
	movq	%rdi, %rdx
	subq	%rdi, %rbp
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$2, %eax
	addq	$1, %rdx
	cmpl	%ecx, %eax
	je	.L7
.L9:
	cmpl	%esi, %eax
	jg	.L8
	cmpl	%edx, %eax
	jle	.L8
	movzbl	(%rbx), %r8d
	movzbl	16(%rsp,%rdx), %r9d
	cmpb	%r9b, %r8b
	je	.L8
	movzbl	-2(%rbp,%rdx,2), %r10d
	cmpb	%r10b, %r8b
	je	.L8
	cmpb	%r10b, %r9b
	setne	%r8b
	cmpb	$1, %r8b
	adcq	$-1, %r11
	addl	$2, %eax
	addq	$1, %rdx
	cmpl	%ecx, %eax
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L7:
	addq	$1, %rdi
	subl	$1, %ecx
	cmpq	%r12, %rdi
	jne	.L10
.L2:
	xorl	%eax, %eax
	movq	%r11, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	4120(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L30
	addq	$4128, %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
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	addq	$1, %r8
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L30:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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>
#include <stdlib.h>
#include <string.h>

int main(void) {
    int n,i,j,k;
    long long int ans,r=0,g=0,b=0;
    char s[4100];
    (void)scanf("%d",&n);
    (void)scanf("%s",&s[1]);
    for(i=1;i<=n;i++){
      if(s[i]=='R')r++;
      if(s[i]=='G')g++;
      if(s[i]=='B')b++;
    }
    ans=r*g*b;
    for(i=1;i<=n-2;i++){
      for(j=i+1;j<=n-1;j++){
        k=2*j-i;
        if(j<k&&k<=n){
          if((s[i]!=s[j])&&(s[i]!=s[k])&&(s[j]!=s[k]))
            ans--;
        }
      }
    }
    printf("%lld\n",ans);
    return 0;
}
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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(void) {
    int n,i,j,k;
    long long int ans,r=0,g=0,b=0;
    char s[4100];
    (void)scanf("%d",&n);
    (void)scanf("%s",&s[1]);
    for(i=1;i<=n;i++){
      if(s[i]=='R')r++;
      if(s[i]=='G')g++;
      if(s[i]=='B')b++;
    }
    ans=r*g*b;
    for(i=1;i<=n-2;i++){
      for(j=i+1;j<=n-1;j++){
        k=2*j-i;
        if(j<k&&k<=n){
          if((s[i]!=s[j])&&(s[i]!=s[k])&&(s[j]!=s[k]))
            ans--;
        }
      }
    }
    printf("%lld\n",ans);
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -4136(%rbp)
	movq	$0, -4128(%rbp)
	movq	$0, -4120(%rbp)
	leaq	-4160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-4112(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4156(%rbp)
	jmp	.L2
.L6:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L3
	addq	$1, -4136(%rbp)
.L3:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$71, %al
	jne	.L4
	addq	$1, -4128(%rbp)
.L4:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L5
	addq	$1, -4120(%rbp)
.L5:
	addl	$1, -4156(%rbp)
.L2:
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4156(%rbp)
	jle	.L6
	movq	-4136(%rbp), %rax
	imulq	-4128(%rbp), %rax
	movq	-4120(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -4144(%rbp)
	movl	$1, -4156(%rbp)
	jmp	.L7
.L11:
	movl	-4156(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4152(%rbp)
	jmp	.L8
.L10:
	movl	-4152(%rbp), %eax
	addl	%eax, %eax
	subl	-4156(%rbp), %eax
	movl	%eax, -4148(%rbp)
	movl	-4152(%rbp), %eax
	cmpl	-4148(%rbp), %eax
	jge	.L9
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4148(%rbp)
	jg	.L9
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4152(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4148(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-4152(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4148(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	subq	$1, -4144(%rbp)
.L9:
	addl	$1, -4152(%rbp)
.L8:
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4152(%rbp)
	jl	.L10
	addl	$1, -4156(%rbp)
.L7:
	movl	-4160(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -4156(%rbp)
	jl	.L11
	movq	-4144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%lld\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -4136(%rbp)
	movq	$0, -4128(%rbp)
	movq	$0, -4120(%rbp)
	leaq	-4160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-4112(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4156(%rbp)
	jmp	.L2
.L6:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L3
	addq	$1, -4136(%rbp)
.L3:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$71, %al
	jne	.L4
	addq	$1, -4128(%rbp)
.L4:
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L5
	addq	$1, -4120(%rbp)
.L5:
	addl	$1, -4156(%rbp)
.L2:
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4156(%rbp)
	jle	.L6
	movq	-4136(%rbp), %rax
	imulq	-4128(%rbp), %rax
	movq	-4120(%rbp), %rdx
	imulq	%rdx, %rax
	movq	%rax, -4144(%rbp)
	movl	$1, -4156(%rbp)
	jmp	.L7
.L11:
	movl	-4156(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -4152(%rbp)
	jmp	.L8
.L10:
	movl	-4152(%rbp), %eax
	addl	%eax, %eax
	subl	-4156(%rbp), %eax
	movl	%eax, -4148(%rbp)
	movl	-4152(%rbp), %eax
	cmpl	-4148(%rbp), %eax
	jge	.L9
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4148(%rbp)
	jg	.L9
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4152(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-4156(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4148(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	movl	-4152(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %edx
	movl	-4148(%rbp), %eax
	cltq
	movzbl	-4112(%rbp,%rax), %eax
	cmpb	%al, %dl
	je	.L9
	subq	$1, -4144(%rbp)
.L9:
	addl	$1, -4152(%rbp)
.L8:
	movl	-4160(%rbp), %eax
	cmpl	%eax, -4152(%rbp)
	jl	.L10
	addl	$1, -4156(%rbp)
.L7:
	movl	-4160(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -4156(%rbp)
	jl	.L11
	movq	-4144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
