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>



int checkResult(int *mat,int mat_i);

int main(void) {

	// Rummy
	int ds,ds_i;
	int num[9];
	char col[10];
	int r[9],g[9],b[9];
	int ri,gi,bi;
	int i;
	int r_check,g_check,b_check;

	// ????????????????????°????????????
	scanf("%d",&ds);

	for(ds_i=0; ds_i<ds; ds_i++){
	// ?????????????????????????????????????????????

		// ?????????
		for(i=0; i<9; i++){
			r[i]=0;
			g[i]=0;
			b[i]=0;
		}
		ri=0;
		gi=0;
		bi=0;

		// ?????????????????????
		for(i=0; i<9; i++){	scanf("%d",&num[i]);	}
		for(i=0; i<9; i++){	scanf("%1s",&col[i]);	}

		// ????????????????????¨????????????????´?
		for(i=0; i<9; i++){
			if(col[i]=='R'){
				r[ num[i]-1 ]++;
				ri++;
			}else if(col[i]=='G'){
				g[ num[i]-1 ]++;
				gi++;
			}else if(col[i]=='B'){
				b[ num[i]-1 ]++;
				bi++;
			}
		}

		// ???(R)?????????
		r_check = checkResult(r,ri);
		// ???(G)?????????
		g_check = checkResult(g,gi);
		// ???(B)?????????
		b_check = checkResult(b,bi);

		if(r_check && g_check && b_check){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}

	return 0;

}

int checkResult(int *mat,int mat_i){
	int result=1;
	int i,j,wk;

	if(mat_i%3!=0){
		// ??????????????£????????????????????????????????????????????????????????????
		result = 0;
	}else if(0<mat_i){
		for(i=0; i<7; i++){
			if(0<mat[i] && 0<mat[i+1] && 0<mat[i+2]){
				wk = 10;
				for(j=0; j<2; j++){
					if(mat[i+j] < wk){
						wk=mat[i+j];
					}
				}
				mat[i+2]-=wk;
				mat[i+1]-=wk;
				mat[i]-=wk;
			}
		}
		for(i=0; i<9; i++){
			if(mat[i]==3){
				mat[i] = 0;
			}
		}
		for(i=0; i<9; i++){
			if(mat[i]!=0){
				result = 0;
			}
		}
	}
	
	return result;
}
	```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%1s"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.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
	subq	$256, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -240(%rbp)
	jmp	.L2
.L16:
	movl	$0, -224(%rbp)
	jmp	.L3
.L4:
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -160(%rbp,%rax,4)
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -112(%rbp,%rax,4)
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -64(%rbp,%rax,4)
	addl	$1, -224(%rbp)
.L3:
	cmpl	$8, -224(%rbp)
	jle	.L4
	movl	$0, -236(%rbp)
	movl	$0, -232(%rbp)
	movl	$0, -228(%rbp)
	movl	$0, -224(%rbp)
	jmp	.L5
.L6:
	leaq	-208(%rbp), %rdx
	movl	-224(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -224(%rbp)
.L5:
	cmpl	$8, -224(%rbp)
	jle	.L6
	movl	$0, -224(%rbp)
	jmp	.L7
.L8:
	leaq	-18(%rbp), %rdx
	movl	-224(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -224(%rbp)
.L7:
	cmpl	$8, -224(%rbp)
	jle	.L8
	movl	$0, -224(%rbp)
	jmp	.L9
.L13:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-160(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -236(%rbp)
	jmp	.L11
.L10:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$71, %al
	jne	.L12
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-112(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -112(%rbp,%rax,4)
	addl	$1, -232(%rbp)
	jmp	.L11
.L12:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L11
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-64(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	addl	$1, -228(%rbp)
.L11:
	addl	$1, -224(%rbp)
.L9:
	cmpl	$8, -224(%rbp)
	jle	.L13
	movl	-236(%rbp), %edx
	leaq	-160(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -220(%rbp)
	movl	-232(%rbp), %edx
	leaq	-112(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -216(%rbp)
	movl	-228(%rbp), %edx
	leaq	-64(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -212(%rbp)
	cmpl	$0, -220(%rbp)
	je	.L14
	cmpl	$0, -216(%rbp)
	je	.L14
	cmpl	$0, -212(%rbp)
	je	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	addl	$1, -240(%rbp)
.L2:
	movl	-244(%rbp), %eax
	cmpl	%eax, -240(%rbp)
	jl	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	checkResult
	.type	checkResult, @function
checkResult:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$1, -16(%rbp)
	movl	-28(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, -16(%rbp)
	jmp	.L21
.L20:
	cmpl	$0, -28(%rbp)
	jle	.L21
	movl	$0, -12(%rbp)
	jmp	.L22
.L27:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	-12(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	-12(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	$10, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L25
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L25:
	addl	$1, -8(%rbp)
.L24:
	cmpl	$1, -8(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$2, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L23:
	addl	$1, -12(%rbp)
.L22:
	cmpl	$6, -12(%rbp)
	jle	.L27
	movl	$0, -12(%rbp)
	jmp	.L28
.L30:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$3, %eax
	jne	.L29
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
.L29:
	addl	$1, -12(%rbp)
.L28:
	cmpl	$8, -12(%rbp)
	jle	.L30
	movl	$0, -12(%rbp)
	jmp	.L31
.L33:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	.L32
	movl	$0, -16(%rbp)
.L32:
	addl	$1, -12(%rbp)
.L31:
	cmpl	$8, -12(%rbp)
	jle	.L33
.L21:
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	checkResult, .-checkResult
	.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
	.type	checkResult.part.0, @function
checkResult.part.0:
.LFB25:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	.L2
	movl	4(%rdi), %r8d
	movq	(%rdi), %r9
	testl	%r8d, %r8d
	jle	.L3
	movl	8(%rdi), %esi
	movl	%r8d, %ecx
	leaq	4(%rdi), %rdi
	testl	%esi, %esi
	jle	.L36
	movl	$10, %ecx
	movq	%r9, %xmm1
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	cmpl	%r8d, %eax
	cmovg	%r8d, %eax
	movd	%eax, %xmm4
	subl	%eax, %esi
	pshufd	$0xe0, %xmm4, %xmm0
	movl	%esi, 8(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rdx)
.L2:
	movl	4(%rdx), %ecx
	leaq	4(%rdx), %rdi
	testl	%ecx, %ecx
	jle	.L5
	movl	8(%rdx), %esi
.L36:
	movd	%ecx, %xmm1
	movd	%esi, %xmm3
	punpckldq	%xmm3, %xmm1
	testl	%esi, %esi
	jle	.L6
	movl	12(%rdx), %r11d
	leaq	8(%rdx), %r8
	movl	%esi, %eax
	testl	%r11d, %r11d
	jle	.L35
	cmpl	%esi, %ecx
	movl	$10, %eax
	cmovg	%esi, %ecx
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	movd	%ecx, %xmm5
	subl	%ecx, %r11d
	pshufd	$0xe0, %xmm5, %xmm0
	movl	%r11d, 12(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rdi)
.L5:
	movl	8(%rdx), %eax
	leaq	8(%rdx), %r8
	testl	%eax, %eax
	jle	.L8
.L44:
	movl	12(%rdx), %r11d
.L35:
	movd	%eax, %xmm1
	movd	%r11d, %xmm4
	punpckldq	%xmm4, %xmm1
	testl	%r11d, %r11d
	jle	.L9
	movl	16(%rdx), %r10d
	leaq	12(%rdx), %r9
	movl	%r11d, %esi
	testl	%r10d, %r10d
	jg	.L39
.L34:
	movd	%esi, %xmm1
	movd	%r10d, %xmm5
	punpckldq	%xmm5, %xmm1
	testl	%r10d, %r10d
	jle	.L12
	movl	20(%rdx), %r11d
	leaq	16(%rdx), %rax
	movl	%r10d, %ecx
	testl	%r11d, %r11d
	jg	.L40
.L33:
	movd	%ecx, %xmm1
	movd	%r11d, %xmm6
	punpckldq	%xmm6, %xmm1
	testl	%r11d, %r11d
	jle	.L15
	movl	24(%rdx), %r10d
	leaq	20(%rdx), %rbx
	movl	%r11d, %esi
	testl	%r10d, %r10d
	jg	.L41
.L32:
	movd	%esi, %xmm1
	movd	%r10d, %xmm7
	leaq	24(%rdx), %rbp
	punpckldq	%xmm7, %xmm1
	testl	%r10d, %r10d
	jle	.L20
	movl	28(%rdx), %r11d
	movl	%r10d, %ecx
	testl	%r11d, %r11d
	jle	.L31
	cmpl	%r10d, %esi
	movl	$10, %ecx
	cmovg	%r10d, %esi
	cmpl	%ecx, %esi
	cmovg	%ecx, %esi
	movd	%esi, %xmm5
	subl	%esi, %r11d
	pshufd	$0xe0, %xmm5, %xmm0
	movl	%r11d, 28(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rbx)
.L17:
	movl	24(%rdx), %ecx
	leaq	24(%rdx), %rbp
	testl	%ecx, %ecx
	jle	.L20
.L45:
	movl	28(%rdx), %r11d
.L31:
	movd	%ecx, %xmm1
	movd	%r11d, %xmm3
	punpckldq	%xmm3, %xmm1
	testl	%r11d, %r11d
	jle	.L20
	movl	32(%rdx), %esi
	testl	%esi, %esi
	jg	.L42
.L20:
	cmpl	$3, (%rdx)
	jne	.L21
	movl	$0, (%rdx)
.L21:
	cmpl	$3, (%rdi)
	jne	.L22
	movl	$0, (%rdi)
.L22:
	cmpl	$3, (%r8)
	jne	.L23
	movl	$0, (%r8)
.L23:
	cmpl	$3, (%r9)
	jne	.L24
	movl	$0, (%r9)
.L24:
	cmpl	$3, (%rax)
	jne	.L25
	movl	$0, (%rax)
.L25:
	cmpl	$3, (%rbx)
	jne	.L26
	movl	$0, (%rbx)
.L26:
	cmpl	$3, 0(%rbp)
	jne	.L27
	movl	$0, 0(%rbp)
.L27:
	cmpl	$3, 28(%rdx)
	jne	.L28
	movl	$0, 28(%rdx)
.L28:
	cmpl	$3, 32(%rdx)
	je	.L43
	movdqu	(%rax), %xmm1
	pxor	%xmm2, %xmm2
	movdqu	(%rdx), %xmm0
	movl	32(%rdx), %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pcmpeqd	%xmm2, %xmm1
	pcmpeqd	%xmm2, %xmm0
	pand	.LC0(%rip), %xmm0
	popq	%rbp
	.cfi_def_cfa_offset 8
	testl	%edx, %edx
	movl	$0, %edx
	pand	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$8, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmovne	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	leaq	8(%rdx), %r8
.L8:
	movl	12(%rdx), %esi
	leaq	12(%rdx), %r9
	testl	%esi, %esi
	jle	.L11
.L46:
	movl	16(%rdx), %r10d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	12(%rdx), %r9
.L11:
	movl	16(%rdx), %ecx
	leaq	16(%rdx), %rax
	testl	%ecx, %ecx
	jle	.L14
.L48:
	movl	20(%rdx), %r11d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	16(%rdx), %rax
.L14:
	movl	20(%rdx), %esi
	leaq	20(%rdx), %rbx
	testl	%esi, %esi
	jle	.L17
.L47:
	movl	24(%rdx), %r10d
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rdx), %eax
	leaq	4(%rdi), %rdi
	leaq	8(%rdx), %r8
	testl	%eax, %eax
	jg	.L44
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$0, 32(%rdx)
	movdqu	(%rax), %xmm0
	pxor	%xmm2, %xmm2
	movdqu	(%rdx), %xmm1
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pcmpeqd	%xmm2, %xmm0
	popq	%rbp
	.cfi_def_cfa_offset 8
	pcmpeqd	%xmm2, %xmm1
	pand	.LC0(%rip), %xmm1
	pand	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$8, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	24(%rdx), %ecx
	leaq	20(%rdx), %rbx
	leaq	24(%rdx), %rbp
	testl	%ecx, %ecx
	jg	.L45
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L42:
	cmpl	%r11d, %ecx
	movl	$10, %r10d
	cmovg	%r11d, %ecx
	cmpl	%r10d, %ecx
	cmovg	%r10d, %ecx
	movd	%ecx, %xmm6
	subl	%ecx, %esi
	pshufd	$0xe0, %xmm6, %xmm0
	movl	%esi, 32(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, 0(%rbp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	%r11d, %eax
	movl	$10, %ecx
	leaq	12(%rdx), %r9
	cmovg	%r11d, %eax
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	movd	%eax, %xmm6
	subl	%eax, %r10d
	pshufd	$0xe0, %xmm6, %xmm0
	movl	%r10d, 16(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%r8)
	movl	12(%rdx), %esi
	testl	%esi, %esi
	jg	.L46
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	%r11d, %ecx
	movl	$10, %esi
	leaq	20(%rdx), %rbx
	cmovg	%r11d, %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	movd	%ecx, %xmm4
	subl	%ecx, %r10d
	pshufd	$0xe0, %xmm4, %xmm0
	movl	%r10d, 24(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rax)
	movl	20(%rdx), %esi
	testl	%esi, %esi
	jg	.L47
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L40:
	cmpl	%r10d, %esi
	movl	$10, %eax
	cmovg	%r10d, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	leaq	16(%rdx), %rax
	movd	%esi, %xmm7
	subl	%esi, %r11d
	pshufd	$0xe0, %xmm7, %xmm0
	movl	%r11d, 20(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%r9)
	movl	16(%rdx), %ecx
	testl	%ecx, %ecx
	jg	.L48
	jmp	.L14
	.cfi_endproc
.LFE25:
	.size	checkResult.part.0, .-checkResult.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%1s"
.LC3:
	.string	"1"
.LC4:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$264, %rsp
	.cfi_def_cfa_offset 320
	movq	%fs:40, %rax
	movq	%rax, 248(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L51
	leaq	238(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	247(%rsp), %r13
	movq	%rax, 16(%rsp)
	leaq	48(%rsp), %rax
	leaq	84(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$0, 128(%rsp)
	pxor	%xmm0, %xmm0
	movq	8(%rsp), %r15
	movl	$0, 176(%rsp)
	movl	$0, 224(%rsp)
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 160(%rsp)
	movaps	%xmm0, 192(%rsp)
	movaps	%xmm0, 208(%rsp)
	.p2align 4,,10
	.p2align 3
.L52:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%rbp, %r15
	jne	.L52
	movq	16(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L53:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r13, %r15
	jne	.L53
	movzbl	238(%rsp), %eax
	cmpb	$82, %al
	je	.L54
	cmpb	$71, %al
	je	.L55
	cmpb	$66, %al
	je	.L109
	movl	$1, %edi
	movl	$1, %r8d
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	movl	$1, %r9d
	xorl	%eax, %eax
.L56:
	movzbl	239(%rsp), %esi
	cmpb	$82, %sil
	je	.L57
.L111:
	cmpb	$71, %sil
	je	.L58
	cmpb	$66, %sil
	jne	.L59
	movl	52(%rsp), %ecx
	movl	%r9d, %r15d
	subl	$1, %ecx
	movslq	%ecx, %rcx
	addl	$1, 192(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L59:
	movzbl	240(%rsp), %esi
	cmpb	$82, %sil
	je	.L60
	cmpb	$71, %sil
	je	.L61
	cmpb	$66, %sil
	jne	.L62
	movl	56(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L62:
	movzbl	241(%rsp), %esi
	cmpb	$82, %sil
	je	.L63
	cmpb	$71, %sil
	je	.L64
	cmpb	$66, %sil
	jne	.L65
	movl	60(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L65:
	movzbl	242(%rsp), %esi
	cmpb	$82, %sil
	je	.L66
	cmpb	$71, %sil
	je	.L67
	cmpb	$66, %sil
	jne	.L68
	movl	64(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L68:
	movzbl	243(%rsp), %esi
	cmpb	$82, %sil
	je	.L69
	cmpb	$71, %sil
	je	.L70
	cmpb	$66, %sil
	jne	.L71
	movl	68(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L71:
	movzbl	244(%rsp), %esi
	cmpb	$82, %sil
	je	.L72
	cmpb	$71, %sil
	je	.L73
	cmpb	$66, %sil
	jne	.L74
	movl	72(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L74:
	movzbl	245(%rsp), %esi
	cmpb	$82, %sil
	je	.L75
	cmpb	$71, %sil
	je	.L76
	cmpb	$66, %sil
	jne	.L77
	movl	76(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L77:
	movzbl	246(%rsp), %esi
	cmpb	$82, %sil
	je	.L78
	cmpb	$71, %sil
	je	.L79
	cmpb	$66, %sil
	jne	.L80
	movl	80(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
.L80:
	imull	$-1431655765, %eax, %edi
	xorl	%esi, %esi
	cmpl	$1431655765, %edi
	ja	.L81
	movl	$1, %esi
	testl	%eax, %eax
	jne	.L82
.L81:
	imull	$-1431655765, %edx, %edi
	xorl	%eax, %eax
	cmpl	$1431655765, %edi
	ja	.L83
	movl	$1, %eax
	testl	%edx, %edx
	je	.L83
	leaq	144(%rsp), %rdi
	movl	%esi, 28(%rsp)
	call	checkResult.part.0
	movl	28(%rsp), %esi
.L83:
	imull	$-1431655765, %r15d, %edx
	cmpl	$1431655765, %edx
	ja	.L84
	testl	%eax, %eax
	setne	%al
	testl	%esi, %esi
	setne	%dl
	andl	%eax, %edx
	testl	%r15d, %r15d
	je	.L108
	leaq	192(%rsp), %rdi
	movb	%dl, 28(%rsp)
	call	checkResult.part.0
	testl	%eax, %eax
	je	.L84
	movzbl	28(%rsp), %edx
.L108:
	testb	%dl, %dl
	je	.L84
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L86:
	addl	$1, %r14d
	cmpl	%r14d, 44(%rsp)
	jg	.L50
.L51:
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L110
	addq	$264, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L86
	.p2align 4,,10
	.p2align 3
.L78:
	movl	80(%rsp), %ecx
	addl	$1, %eax
	imull	$-1431655765, %eax, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	xorl	%esi, %esi
	cmpl	$1431655765, %eax
	ja	.L81
.L82:
	leaq	96(%rsp), %rdi
	movl	%edx, 28(%rsp)
	call	checkResult.part.0
	movl	28(%rsp), %edx
	movl	%eax, %esi
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L75:
	movl	76(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L72:
	movl	72(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L69:
	movl	68(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L66:
	movl	64(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L63:
	movl	60(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L60:
	movl	56(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L54:
	movl	48(%rsp), %eax
	movl	$2, %edi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	movzbl	239(%rsp), %esi
	movl	$1, %r8d
	movl	$1, %r9d
	subl	$1, %eax
	cltq
	addl	$1, 96(%rsp,%rax,4)
	movl	$1, %eax
	cmpb	$82, %sil
	jne	.L111
.L57:
	movl	52(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 96(%rsp,%rax,4)
	movl	%edi, %eax
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L67:
	movl	64(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L64:
	movl	60(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L61:
	movl	56(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L58:
	movl	52(%rsp), %ecx
	leal	-1(%rcx), %edx
	movslq	%edx, %rdx
	addl	$1, 144(%rsp,%rdx,4)
	movl	%r8d, %edx
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L55:
	movl	48(%rsp), %eax
	movl	$1, %edi
	movl	$2, %r8d
	movl	$1, %r9d
	xorl	%r15d, %r15d
	movl	$1, %edx
	subl	$1, %eax
	cltq
	addl	$1, 144(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L73:
	movl	72(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L70:
	movl	68(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L79:
	movl	80(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L76:
	movl	76(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L109:
	movl	48(%rsp), %eax
	movl	$1, %edi
	xorl	%edx, %edx
	movl	$1, %r8d
	movl	$2, %r9d
	movl	$1, %r15d
	subl	$1, %eax
	cltq
	addl	$1, 192(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L56
.L110:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	checkResult
	.type	checkResult, @function
checkResult:
.LFB24:
	.cfi_startproc
	endbr64
	imull	$-1431655765, %esi, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	ja	.L114
	testl	%esi, %esi
	jle	.L115
	jmp	checkResult.part.0
	.p2align 4,,10
	.p2align 3
.L114:
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L115:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	checkResult, .-checkResult
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
	.type	checkResult.part.0, @function
checkResult.part.0:
.LFB25:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rdx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	.L2
	movl	4(%rdi), %r8d
	movq	(%rdi), %r9
	testl	%r8d, %r8d
	jle	.L3
	movl	8(%rdi), %esi
	movl	%r8d, %ecx
	leaq	4(%rdi), %rdi
	testl	%esi, %esi
	jle	.L36
	movl	$10, %ecx
	movq	%r9, %xmm1
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	cmpl	%r8d, %eax
	cmovg	%r8d, %eax
	movd	%eax, %xmm4
	subl	%eax, %esi
	pshufd	$0xe0, %xmm4, %xmm0
	movl	%esi, 8(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rdx)
.L2:
	movl	4(%rdx), %ecx
	leaq	4(%rdx), %rdi
	testl	%ecx, %ecx
	jle	.L5
	movl	8(%rdx), %esi
.L36:
	movd	%ecx, %xmm1
	movd	%esi, %xmm3
	punpckldq	%xmm3, %xmm1
	testl	%esi, %esi
	jle	.L6
	movl	12(%rdx), %r11d
	leaq	8(%rdx), %r8
	movl	%esi, %eax
	testl	%r11d, %r11d
	jle	.L35
	cmpl	%esi, %ecx
	movl	$10, %eax
	cmovg	%esi, %ecx
	cmpl	%eax, %ecx
	cmovg	%eax, %ecx
	movd	%ecx, %xmm5
	subl	%ecx, %r11d
	pshufd	$0xe0, %xmm5, %xmm0
	movl	%r11d, 12(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rdi)
.L5:
	movl	8(%rdx), %eax
	leaq	8(%rdx), %r8
	testl	%eax, %eax
	jle	.L8
.L44:
	movl	12(%rdx), %r11d
.L35:
	movd	%eax, %xmm1
	movd	%r11d, %xmm4
	punpckldq	%xmm4, %xmm1
	testl	%r11d, %r11d
	jle	.L9
	movl	16(%rdx), %r10d
	leaq	12(%rdx), %r9
	movl	%r11d, %esi
	testl	%r10d, %r10d
	jg	.L39
.L34:
	movd	%esi, %xmm1
	movd	%r10d, %xmm5
	punpckldq	%xmm5, %xmm1
	testl	%r10d, %r10d
	jle	.L12
	movl	20(%rdx), %r11d
	leaq	16(%rdx), %rax
	movl	%r10d, %ecx
	testl	%r11d, %r11d
	jg	.L40
.L33:
	movd	%ecx, %xmm1
	movd	%r11d, %xmm6
	punpckldq	%xmm6, %xmm1
	testl	%r11d, %r11d
	jle	.L15
	movl	24(%rdx), %r10d
	leaq	20(%rdx), %rbx
	movl	%r11d, %esi
	testl	%r10d, %r10d
	jg	.L41
.L32:
	movd	%esi, %xmm1
	movd	%r10d, %xmm7
	leaq	24(%rdx), %rbp
	punpckldq	%xmm7, %xmm1
	testl	%r10d, %r10d
	jle	.L20
	movl	28(%rdx), %r11d
	movl	%r10d, %ecx
	testl	%r11d, %r11d
	jle	.L31
	cmpl	%r10d, %esi
	movl	$10, %ecx
	cmovg	%r10d, %esi
	cmpl	%ecx, %esi
	cmovg	%ecx, %esi
	movd	%esi, %xmm5
	subl	%esi, %r11d
	pshufd	$0xe0, %xmm5, %xmm0
	movl	%r11d, 28(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rbx)
.L17:
	movl	24(%rdx), %ecx
	leaq	24(%rdx), %rbp
	testl	%ecx, %ecx
	jle	.L20
.L45:
	movl	28(%rdx), %r11d
.L31:
	movd	%ecx, %xmm1
	movd	%r11d, %xmm3
	punpckldq	%xmm3, %xmm1
	testl	%r11d, %r11d
	jle	.L20
	movl	32(%rdx), %esi
	testl	%esi, %esi
	jg	.L42
.L20:
	cmpl	$3, (%rdx)
	jne	.L21
	movl	$0, (%rdx)
.L21:
	cmpl	$3, (%rdi)
	jne	.L22
	movl	$0, (%rdi)
.L22:
	cmpl	$3, (%r8)
	jne	.L23
	movl	$0, (%r8)
.L23:
	cmpl	$3, (%r9)
	jne	.L24
	movl	$0, (%r9)
.L24:
	cmpl	$3, (%rax)
	jne	.L25
	movl	$0, (%rax)
.L25:
	cmpl	$3, (%rbx)
	jne	.L26
	movl	$0, (%rbx)
.L26:
	cmpl	$3, 0(%rbp)
	jne	.L27
	movl	$0, 0(%rbp)
.L27:
	cmpl	$3, 28(%rdx)
	jne	.L28
	movl	$0, 28(%rdx)
.L28:
	cmpl	$3, 32(%rdx)
	je	.L43
	movdqu	(%rax), %xmm1
	pxor	%xmm2, %xmm2
	movdqu	(%rdx), %xmm0
	movl	32(%rdx), %edx
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pcmpeqd	%xmm2, %xmm1
	pcmpeqd	%xmm2, %xmm0
	pand	.LC0(%rip), %xmm0
	popq	%rbp
	.cfi_def_cfa_offset 8
	testl	%edx, %edx
	movl	$0, %edx
	pand	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$8, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movd	%xmm1, %eax
	cmovne	%edx, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	leaq	8(%rdx), %r8
.L8:
	movl	12(%rdx), %esi
	leaq	12(%rdx), %r9
	testl	%esi, %esi
	jle	.L11
.L46:
	movl	16(%rdx), %r10d
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L9:
	leaq	12(%rdx), %r9
.L11:
	movl	16(%rdx), %ecx
	leaq	16(%rdx), %rax
	testl	%ecx, %ecx
	jle	.L14
.L48:
	movl	20(%rdx), %r11d
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L12:
	leaq	16(%rdx), %rax
.L14:
	movl	20(%rdx), %esi
	leaq	20(%rdx), %rbx
	testl	%esi, %esi
	jle	.L17
.L47:
	movl	24(%rdx), %r10d
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L3:
	movl	8(%rdx), %eax
	leaq	4(%rdi), %rdi
	leaq	8(%rdx), %r8
	testl	%eax, %eax
	jg	.L44
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L43:
	movl	$0, 32(%rdx)
	movdqu	(%rax), %xmm0
	pxor	%xmm2, %xmm2
	movdqu	(%rdx), %xmm1
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	pcmpeqd	%xmm2, %xmm0
	popq	%rbp
	.cfi_def_cfa_offset 8
	pcmpeqd	%xmm2, %xmm1
	pand	.LC0(%rip), %xmm1
	pand	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$8, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	por	%xmm0, %xmm1
	movdqa	%xmm1, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movd	%xmm0, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	24(%rdx), %ecx
	leaq	20(%rdx), %rbx
	leaq	24(%rdx), %rbp
	testl	%ecx, %ecx
	jg	.L45
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L42:
	cmpl	%r11d, %ecx
	movl	$10, %r10d
	cmovg	%r11d, %ecx
	cmpl	%r10d, %ecx
	cmovg	%r10d, %ecx
	movd	%ecx, %xmm6
	subl	%ecx, %esi
	pshufd	$0xe0, %xmm6, %xmm0
	movl	%esi, 32(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, 0(%rbp)
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	%r11d, %eax
	movl	$10, %ecx
	leaq	12(%rdx), %r9
	cmovg	%r11d, %eax
	cmpl	%ecx, %eax
	cmovg	%ecx, %eax
	movd	%eax, %xmm6
	subl	%eax, %r10d
	pshufd	$0xe0, %xmm6, %xmm0
	movl	%r10d, 16(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%r8)
	movl	12(%rdx), %esi
	testl	%esi, %esi
	jg	.L46
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L41:
	cmpl	%r11d, %ecx
	movl	$10, %esi
	leaq	20(%rdx), %rbx
	cmovg	%r11d, %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	movd	%ecx, %xmm4
	subl	%ecx, %r10d
	pshufd	$0xe0, %xmm4, %xmm0
	movl	%r10d, 24(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%rax)
	movl	20(%rdx), %esi
	testl	%esi, %esi
	jg	.L47
	jmp	.L17
	.p2align 4,,10
	.p2align 3
.L40:
	cmpl	%r10d, %esi
	movl	$10, %eax
	cmovg	%r10d, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	leaq	16(%rdx), %rax
	movd	%esi, %xmm7
	subl	%esi, %r11d
	pshufd	$0xe0, %xmm7, %xmm0
	movl	%r11d, 20(%rdx)
	psubd	%xmm0, %xmm1
	movq	%xmm1, (%r9)
	movl	16(%rdx), %ecx
	testl	%ecx, %ecx
	jg	.L48
	jmp	.L14
	.cfi_endproc
.LFE25:
	.size	checkResult.part.0, .-checkResult.part.0
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC1:
	.string	"%d"
.LC2:
	.string	"%1s"
.LC3:
	.string	"1"
.LC4:
	.string	"0"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC1(%rip), %rbx
	movq	%rbx, %rdi
	subq	$264, %rsp
	.cfi_def_cfa_offset 320
	movq	%fs:40, %rax
	movq	%rax, 248(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L51
	leaq	238(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	247(%rsp), %r13
	movq	%rax, 16(%rsp)
	leaq	48(%rsp), %rax
	leaq	84(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$0, 128(%rsp)
	pxor	%xmm0, %xmm0
	movq	8(%rsp), %r15
	movl	$0, 176(%rsp)
	movl	$0, 224(%rsp)
	movaps	%xmm0, 96(%rsp)
	movaps	%xmm0, 112(%rsp)
	movaps	%xmm0, 144(%rsp)
	movaps	%xmm0, 160(%rsp)
	movaps	%xmm0, 192(%rsp)
	movaps	%xmm0, 208(%rsp)
	.p2align 4,,10
	.p2align 3
.L52:
	movq	%r15, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addq	$4, %r15
	call	__isoc99_scanf@PLT
	cmpq	%rbp, %r15
	jne	.L52
	movq	16(%rsp), %r15
	.p2align 4,,10
	.p2align 3
.L53:
	movq	%r15, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %r15
	call	__isoc99_scanf@PLT
	cmpq	%r13, %r15
	jne	.L53
	movzbl	238(%rsp), %eax
	cmpb	$82, %al
	je	.L54
	cmpb	$71, %al
	je	.L55
	cmpb	$66, %al
	je	.L109
	movl	$1, %edi
	movl	$1, %r8d
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	movl	$1, %r9d
	xorl	%eax, %eax
.L56:
	movzbl	239(%rsp), %esi
	cmpb	$82, %sil
	je	.L57
.L111:
	cmpb	$71, %sil
	je	.L58
	cmpb	$66, %sil
	jne	.L59
	movl	52(%rsp), %ecx
	movl	%r9d, %r15d
	subl	$1, %ecx
	movslq	%ecx, %rcx
	addl	$1, 192(%rsp,%rcx,4)
	.p2align 4,,10
	.p2align 3
.L59:
	movzbl	240(%rsp), %esi
	cmpb	$82, %sil
	je	.L60
	cmpb	$71, %sil
	je	.L61
	cmpb	$66, %sil
	jne	.L62
	movl	56(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L62:
	movzbl	241(%rsp), %esi
	cmpb	$82, %sil
	je	.L63
	cmpb	$71, %sil
	je	.L64
	cmpb	$66, %sil
	jne	.L65
	movl	60(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L65:
	movzbl	242(%rsp), %esi
	cmpb	$82, %sil
	je	.L66
	cmpb	$71, %sil
	je	.L67
	cmpb	$66, %sil
	jne	.L68
	movl	64(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L68:
	movzbl	243(%rsp), %esi
	cmpb	$82, %sil
	je	.L69
	cmpb	$71, %sil
	je	.L70
	cmpb	$66, %sil
	jne	.L71
	movl	68(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L71:
	movzbl	244(%rsp), %esi
	cmpb	$82, %sil
	je	.L72
	cmpb	$71, %sil
	je	.L73
	cmpb	$66, %sil
	jne	.L74
	movl	72(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L74:
	movzbl	245(%rsp), %esi
	cmpb	$82, %sil
	je	.L75
	cmpb	$71, %sil
	je	.L76
	cmpb	$66, %sil
	jne	.L77
	movl	76(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
	.p2align 4,,10
	.p2align 3
.L77:
	movzbl	246(%rsp), %esi
	cmpb	$82, %sil
	je	.L78
	cmpb	$71, %sil
	je	.L79
	cmpb	$66, %sil
	jne	.L80
	movl	80(%rsp), %ecx
	addl	$1, %r15d
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 192(%rsp,%rsi,4)
.L80:
	imull	$-1431655765, %eax, %edi
	xorl	%esi, %esi
	cmpl	$1431655765, %edi
	ja	.L81
	movl	$1, %esi
	testl	%eax, %eax
	jne	.L82
.L81:
	imull	$-1431655765, %edx, %edi
	xorl	%eax, %eax
	cmpl	$1431655765, %edi
	ja	.L83
	movl	$1, %eax
	testl	%edx, %edx
	je	.L83
	leaq	144(%rsp), %rdi
	movl	%esi, 28(%rsp)
	call	checkResult.part.0
	movl	28(%rsp), %esi
.L83:
	imull	$-1431655765, %r15d, %edx
	cmpl	$1431655765, %edx
	ja	.L84
	testl	%eax, %eax
	setne	%al
	testl	%esi, %esi
	setne	%dl
	andl	%eax, %edx
	testl	%r15d, %r15d
	je	.L108
	leaq	192(%rsp), %rdi
	movb	%dl, 28(%rsp)
	call	checkResult.part.0
	testl	%eax, %eax
	je	.L84
	movzbl	28(%rsp), %edx
.L108:
	testb	%dl, %dl
	je	.L84
	leaq	.LC3(%rip), %rdi
	call	puts@PLT
.L86:
	addl	$1, %r14d
	cmpl	%r14d, 44(%rsp)
	jg	.L50
.L51:
	movq	248(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L110
	addq	$264, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L84:
	.cfi_restore_state
	leaq	.LC4(%rip), %rdi
	call	puts@PLT
	jmp	.L86
	.p2align 4,,10
	.p2align 3
.L78:
	movl	80(%rsp), %ecx
	addl	$1, %eax
	imull	$-1431655765, %eax, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	xorl	%esi, %esi
	cmpl	$1431655765, %eax
	ja	.L81
.L82:
	leaq	96(%rsp), %rdi
	movl	%edx, 28(%rsp)
	call	checkResult.part.0
	movl	28(%rsp), %edx
	movl	%eax, %esi
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L75:
	movl	76(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L72:
	movl	72(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L69:
	movl	68(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L66:
	movl	64(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L63:
	movl	60(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L60:
	movl	56(%rsp), %ecx
	addl	$1, %eax
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 96(%rsp,%rsi,4)
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L54:
	movl	48(%rsp), %eax
	movl	$2, %edi
	xorl	%r15d, %r15d
	xorl	%edx, %edx
	movzbl	239(%rsp), %esi
	movl	$1, %r8d
	movl	$1, %r9d
	subl	$1, %eax
	cltq
	addl	$1, 96(%rsp,%rax,4)
	movl	$1, %eax
	cmpb	$82, %sil
	jne	.L111
.L57:
	movl	52(%rsp), %eax
	subl	$1, %eax
	cltq
	addl	$1, 96(%rsp,%rax,4)
	movl	%edi, %eax
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L67:
	movl	64(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L68
	.p2align 4,,10
	.p2align 3
.L64:
	movl	60(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L65
	.p2align 4,,10
	.p2align 3
.L61:
	movl	56(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L62
	.p2align 4,,10
	.p2align 3
.L58:
	movl	52(%rsp), %ecx
	leal	-1(%rcx), %edx
	movslq	%edx, %rdx
	addl	$1, 144(%rsp,%rdx,4)
	movl	%r8d, %edx
	jmp	.L59
	.p2align 4,,10
	.p2align 3
.L55:
	movl	48(%rsp), %eax
	movl	$1, %edi
	movl	$2, %r8d
	movl	$1, %r9d
	xorl	%r15d, %r15d
	movl	$1, %edx
	subl	$1, %eax
	cltq
	addl	$1, 144(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L56
	.p2align 4,,10
	.p2align 3
.L73:
	movl	72(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L74
	.p2align 4,,10
	.p2align 3
.L70:
	movl	68(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L71
	.p2align 4,,10
	.p2align 3
.L79:
	movl	80(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L80
	.p2align 4,,10
	.p2align 3
.L76:
	movl	76(%rsp), %ecx
	addl	$1, %edx
	leal	-1(%rcx), %esi
	movslq	%esi, %rsi
	addl	$1, 144(%rsp,%rsi,4)
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L109:
	movl	48(%rsp), %eax
	movl	$1, %edi
	xorl	%edx, %edx
	movl	$1, %r8d
	movl	$2, %r9d
	movl	$1, %r15d
	subl	$1, %eax
	cltq
	addl	$1, 192(%rsp,%rax,4)
	xorl	%eax, %eax
	jmp	.L56
.L110:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.text
	.p2align 4
	.globl	checkResult
	.type	checkResult, @function
checkResult:
.LFB24:
	.cfi_startproc
	endbr64
	imull	$-1431655765, %esi, %eax
	addl	$715827882, %eax
	cmpl	$1431655764, %eax
	ja	.L114
	testl	%esi, %esi
	jle	.L115
	jmp	checkResult.part.0
	.p2align 4,,10
	.p2align 3
.L114:
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L115:
	movl	$1, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	checkResult, .-checkResult
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>



int checkResult(int *mat,int mat_i);

int main(void) {

	// Rummy
	int ds,ds_i;
	int num[9];
	char col[10];
	int r[9],g[9],b[9];
	int ri,gi,bi;
	int i;
	int r_check,g_check,b_check;

	// ????????????????????°????????????
	scanf("%d",&ds);

	for(ds_i=0; ds_i<ds; ds_i++){
	// ?????????????????????????????????????????????

		// ?????????
		for(i=0; i<9; i++){
			r[i]=0;
			g[i]=0;
			b[i]=0;
		}
		ri=0;
		gi=0;
		bi=0;

		// ?????????????????????
		for(i=0; i<9; i++){	scanf("%d",&num[i]);	}
		for(i=0; i<9; i++){	scanf("%1s",&col[i]);	}

		// ????????????????????¨????????????????´?
		for(i=0; i<9; i++){
			if(col[i]=='R'){
				r[ num[i]-1 ]++;
				ri++;
			}else if(col[i]=='G'){
				g[ num[i]-1 ]++;
				gi++;
			}else if(col[i]=='B'){
				b[ num[i]-1 ]++;
				bi++;
			}
		}

		// ???(R)?????????
		r_check = checkResult(r,ri);
		// ???(G)?????????
		g_check = checkResult(g,gi);
		// ???(B)?????????
		b_check = checkResult(b,bi);

		if(r_check && g_check && b_check){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}

	return 0;

}

int checkResult(int *mat,int mat_i){
	int result=1;
	int i,j,wk;

	if(mat_i%3!=0){
		// ??????????????£????????????????????????????????????????????????????????????
		result = 0;
	}else if(0<mat_i){
		for(i=0; i<7; i++){
			if(0<mat[i] && 0<mat[i+1] && 0<mat[i+2]){
				wk = 10;
				for(j=0; j<2; j++){
					if(mat[i+j] < wk){
						wk=mat[i+j];
					}
				}
				mat[i+2]-=wk;
				mat[i+1]-=wk;
				mat[i]-=wk;
			}
		}
		for(i=0; i<9; i++){
			if(mat[i]==3){
				mat[i] = 0;
			}
		}
		for(i=0; i<9; i++){
			if(mat[i]!=0){
				result = 0;
			}
		}
	}
	
	return result;
}
	
5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R R
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 2
R G B R G B R G B
 5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R R
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 2 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 1
R G B R G B R G B
 5
1 1 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R R
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 3
R G B R G B R G B
 5
1 3 0 3 4 5 5 7 7
R R R R R R G G G
1 2 2 3 5 4 4 4 5
R R R R R R R R R
1 2 3 4 6 4 5 7 5
R R B R R R R R R
1 1 2 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 1
R G B R G B R G B
 5
0 2 3 3 4 5 7 7 7
R R R R R S G G G
1 2 2 3 4 2 4 2 4
R R R R R R R R R
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 2 3 4 5 6 6 6
R Q B G G G R R S
2 2 2 3 3 3 0 1 1
R G B R G B R G B
 5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R R
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 3
R G B R G B R G B
 5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R Q
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 3
R G B R G B R G B
 5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R S R R Q
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 3
R G B R G B R G B
 5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R R
1 2 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R S
2 2 2 3 3 3 1 1 2
R G B R G B R G B
 5
1 2 3 3 4 5 7 7 7
R R R R R R G G G
1 2 2 3 4 4 4 4 5
R R R R R R R R Q
1 0 3 4 4 4 5 5 5
R R B R R R R R R
1 1 1 3 4 5 6 6 6
R R B G G G R R R
2 2 2 3 3 3 1 1 3
R G B R G B R G B

1
0
0
0
0
 1
0
0
0
1
 0
0
0
0
0
 0
0
0
0
1
 0
1
0
0
0
 1
0
0
0
0
 1
0
0
0
0
 1
0
0
0
0
 1
0
0
0
0
 1
0
0
0
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>



int checkResult(int *mat,int mat_i);

int main(void) {

	// Rummy
	int ds,ds_i;
	int num[9];
	char col[10];
	int r[9],g[9],b[9];
	int ri,gi,bi;
	int i;
	int r_check,g_check,b_check;

	// ????????????????????°????????????
	scanf("%d",&ds);

	for(ds_i=0; ds_i<ds; ds_i++){
	// ?????????????????????????????????????????????

		// ?????????
		for(i=0; i<9; i++){
			r[i]=0;
			g[i]=0;
			b[i]=0;
		}
		ri=0;
		gi=0;
		bi=0;

		// ?????????????????????
		for(i=0; i<9; i++){	scanf("%d",&num[i]);	}
		for(i=0; i<9; i++){	scanf("%1s",&col[i]);	}

		// ????????????????????¨????????????????´?
		for(i=0; i<9; i++){
			if(col[i]=='R'){
				r[ num[i]-1 ]++;
				ri++;
			}else if(col[i]=='G'){
				g[ num[i]-1 ]++;
				gi++;
			}else if(col[i]=='B'){
				b[ num[i]-1 ]++;
				bi++;
			}
		}

		// ???(R)?????????
		r_check = checkResult(r,ri);
		// ???(G)?????????
		g_check = checkResult(g,gi);
		// ???(B)?????????
		b_check = checkResult(b,bi);

		if(r_check && g_check && b_check){
			printf("1\n");
		}else{
			printf("0\n");
		}
	}

	return 0;

}

int checkResult(int *mat,int mat_i){
	int result=1;
	int i,j,wk;

	if(mat_i%3!=0){
		// ??????????????£????????????????????????????????????????????????????????????
		result = 0;
	}else if(0<mat_i){
		for(i=0; i<7; i++){
			if(0<mat[i] && 0<mat[i+1] && 0<mat[i+2]){
				wk = 10;
				for(j=0; j<2; j++){
					if(mat[i+j] < wk){
						wk=mat[i+j];
					}
				}
				mat[i+2]-=wk;
				mat[i+1]-=wk;
				mat[i]-=wk;
			}
		}
		for(i=0; i<9; i++){
			if(mat[i]==3){
				mat[i] = 0;
			}
		}
		for(i=0; i<9; i++){
			if(mat[i]!=0){
				result = 0;
			}
		}
	}
	
	return result;
}
	```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%1s"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.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
	subq	$256, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -240(%rbp)
	jmp	.L2
.L16:
	movl	$0, -224(%rbp)
	jmp	.L3
.L4:
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -160(%rbp,%rax,4)
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -112(%rbp,%rax,4)
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -64(%rbp,%rax,4)
	addl	$1, -224(%rbp)
.L3:
	cmpl	$8, -224(%rbp)
	jle	.L4
	movl	$0, -236(%rbp)
	movl	$0, -232(%rbp)
	movl	$0, -228(%rbp)
	movl	$0, -224(%rbp)
	jmp	.L5
.L6:
	leaq	-208(%rbp), %rdx
	movl	-224(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -224(%rbp)
.L5:
	cmpl	$8, -224(%rbp)
	jle	.L6
	movl	$0, -224(%rbp)
	jmp	.L7
.L8:
	leaq	-18(%rbp), %rdx
	movl	-224(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -224(%rbp)
.L7:
	cmpl	$8, -224(%rbp)
	jle	.L8
	movl	$0, -224(%rbp)
	jmp	.L9
.L13:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-160(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -236(%rbp)
	jmp	.L11
.L10:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$71, %al
	jne	.L12
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-112(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -112(%rbp,%rax,4)
	addl	$1, -232(%rbp)
	jmp	.L11
.L12:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L11
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-64(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	addl	$1, -228(%rbp)
.L11:
	addl	$1, -224(%rbp)
.L9:
	cmpl	$8, -224(%rbp)
	jle	.L13
	movl	-236(%rbp), %edx
	leaq	-160(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -220(%rbp)
	movl	-232(%rbp), %edx
	leaq	-112(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -216(%rbp)
	movl	-228(%rbp), %edx
	leaq	-64(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -212(%rbp)
	cmpl	$0, -220(%rbp)
	je	.L14
	cmpl	$0, -216(%rbp)
	je	.L14
	cmpl	$0, -212(%rbp)
	je	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	addl	$1, -240(%rbp)
.L2:
	movl	-244(%rbp), %eax
	cmpl	%eax, -240(%rbp)
	jl	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	checkResult
	.type	checkResult, @function
checkResult:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$1, -16(%rbp)
	movl	-28(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, -16(%rbp)
	jmp	.L21
.L20:
	cmpl	$0, -28(%rbp)
	jle	.L21
	movl	$0, -12(%rbp)
	jmp	.L22
.L27:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	-12(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	-12(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	$10, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L25
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L25:
	addl	$1, -8(%rbp)
.L24:
	cmpl	$1, -8(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$2, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L23:
	addl	$1, -12(%rbp)
.L22:
	cmpl	$6, -12(%rbp)
	jle	.L27
	movl	$0, -12(%rbp)
	jmp	.L28
.L30:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$3, %eax
	jne	.L29
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
.L29:
	addl	$1, -12(%rbp)
.L28:
	cmpl	$8, -12(%rbp)
	jle	.L30
	movl	$0, -12(%rbp)
	jmp	.L31
.L33:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	.L32
	movl	$0, -16(%rbp)
.L32:
	addl	$1, -12(%rbp)
.L31:
	cmpl	$8, -12(%rbp)
	jle	.L33
.L21:
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	checkResult, .-checkResult
	.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	"%1s"
.LC2:
	.string	"1"
.LC3:
	.string	"0"
	.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
	subq	$256, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -240(%rbp)
	jmp	.L2
.L16:
	movl	$0, -224(%rbp)
	jmp	.L3
.L4:
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -160(%rbp,%rax,4)
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -112(%rbp,%rax,4)
	movl	-224(%rbp), %eax
	cltq
	movl	$0, -64(%rbp,%rax,4)
	addl	$1, -224(%rbp)
.L3:
	cmpl	$8, -224(%rbp)
	jle	.L4
	movl	$0, -236(%rbp)
	movl	$0, -232(%rbp)
	movl	$0, -228(%rbp)
	movl	$0, -224(%rbp)
	jmp	.L5
.L6:
	leaq	-208(%rbp), %rdx
	movl	-224(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -224(%rbp)
.L5:
	cmpl	$8, -224(%rbp)
	jle	.L6
	movl	$0, -224(%rbp)
	jmp	.L7
.L8:
	leaq	-18(%rbp), %rdx
	movl	-224(%rbp), %eax
	cltq
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -224(%rbp)
.L7:
	cmpl	$8, -224(%rbp)
	jle	.L8
	movl	$0, -224(%rbp)
	jmp	.L9
.L13:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$82, %al
	jne	.L10
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-160(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -160(%rbp,%rax,4)
	addl	$1, -236(%rbp)
	jmp	.L11
.L10:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$71, %al
	jne	.L12
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-112(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -112(%rbp,%rax,4)
	addl	$1, -232(%rbp)
	jmp	.L11
.L12:
	movl	-224(%rbp), %eax
	cltq
	movzbl	-18(%rbp,%rax), %eax
	cmpb	$66, %al
	jne	.L11
	movl	-224(%rbp), %eax
	cltq
	movl	-208(%rbp,%rax,4), %eax
	subl	$1, %eax
	movslq	%eax, %rdx
	movl	-64(%rbp,%rdx,4), %edx
	addl	$1, %edx
	cltq
	movl	%edx, -64(%rbp,%rax,4)
	addl	$1, -228(%rbp)
.L11:
	addl	$1, -224(%rbp)
.L9:
	cmpl	$8, -224(%rbp)
	jle	.L13
	movl	-236(%rbp), %edx
	leaq	-160(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -220(%rbp)
	movl	-232(%rbp), %edx
	leaq	-112(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -216(%rbp)
	movl	-228(%rbp), %edx
	leaq	-64(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	checkResult
	movl	%eax, -212(%rbp)
	cmpl	$0, -220(%rbp)
	je	.L14
	cmpl	$0, -216(%rbp)
	je	.L14
	cmpl	$0, -212(%rbp)
	je	.L14
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L15
.L14:
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L15:
	addl	$1, -240(%rbp)
.L2:
	movl	-244(%rbp), %eax
	cmpl	%eax, -240(%rbp)
	jl	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	checkResult
	.type	checkResult, @function
checkResult:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$1, -16(%rbp)
	movl	-28(%rbp), %edx
	movslq	%edx, %rax
	imulq	$1431655766, %rax, %rax
	shrq	$32, %rax
	movl	%edx, %ecx
	sarl	$31, %ecx
	subl	%ecx, %eax
	movl	%eax, %ecx
	addl	%ecx, %ecx
	addl	%eax, %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	testl	%eax, %eax
	je	.L20
	movl	$0, -16(%rbp)
	jmp	.L21
.L20:
	cmpl	$0, -28(%rbp)
	jle	.L21
	movl	$0, -12(%rbp)
	jmp	.L22
.L27:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	-12(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	-12(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	.L23
	movl	$10, -4(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L24
.L26:
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L25
	movl	-12(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
.L25:
	addl	$1, -8(%rbp)
.L24:
	cmpl	$1, -8(%rbp)
	jle	.L26
	movl	-12(%rbp), %eax
	cltq
	addq	$2, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$2, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	addq	$1, %rax
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	addq	$1, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	movl	-12(%rbp), %edx
	movslq	%edx, %rdx
	leaq	0(,%rdx,4), %rcx
	movq	-24(%rbp), %rdx
	addq	%rcx, %rdx
	subl	-4(%rbp), %eax
	movl	%eax, (%rdx)
.L23:
	addl	$1, -12(%rbp)
.L22:
	cmpl	$6, -12(%rbp)
	jle	.L27
	movl	$0, -12(%rbp)
	jmp	.L28
.L30:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	cmpl	$3, %eax
	jne	.L29
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	$0, (%rax)
.L29:
	addl	$1, -12(%rbp)
.L28:
	cmpl	$8, -12(%rbp)
	jle	.L30
	movl	$0, -12(%rbp)
	jmp	.L31
.L33:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	movq	-24(%rbp), %rax
	addq	%rdx, %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	.L32
	movl	$0, -16(%rbp)
.L32:
	addl	$1, -12(%rbp)
.L31:
	cmpl	$8, -12(%rbp)
	jle	.L33
.L21:
	movl	-16(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	checkResult, .-checkResult
	.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:
