Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 2206: Compile
// 2017.11.10 bal4u@uu

#include <stdio.h>
#include <string.h>

char m[12][7], t[12][7];

int same(char a, int r, int c)
{
	int dr, dc;
	int ans = 1;

	for (dc = -1; dc <= 1; dc++) for (dr = -1; dr <= 1; dr++) {
		if (dr == dc || dr && dc) continue;
		if (c + dc < 0 || c + dc >= 6 || r + dr < 0 || r + dr >= 12) continue;
		if (t[r+dr][c+dc] == a) {
			t[r+dr][c+dc] = 'x';
			ans += same(a, r+dr, c+dc);
		} else if (t[r+dr][c+dc] == 'O') t[r+dr][c+dc] = 'x';
	}
	return ans;
}

int main()
{
	int cno, r, c, f, ans;
	char a;

	scanf("%d", &cno);
	while (cno--) {
		for (r = 0; r < 12; r++)  scanf("%s", m[r]);

		ans = 0, f = 1;
		while (f) {
			f = 0;
			for (c = 0; c < 6; c++) for (r = 11; r >= 0; r--) {
				memcpy(t, m, sizeof(m));
				a = m[r][c];
				if (a == 'O' || a == '.' || a == 'x') continue;
				t[r][c] = 'x';
				if (same(a, r, c) >= 4) {
					memcpy(m, t, sizeof(m));
					f = 1;
				}
			}

			if (f) {
				ans++;
				for (c = 0; c < 6; c++) {
					for (r = 11; r >= 0; r--) {
						int rr;
						if (m[r][c] != 'x') continue;
						rr = r-1;
						while (rr >= 0 && m[rr][c] == 'x') rr--;
						if (rr < 0) m[r][c] = '.';
						else m[r][c] = m[rr][c], m[rr][c] = 'x';
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 84
m:
	.zero	84
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 84
t:
	.zero	84
	.text
	.globl	same
	.type	same, @function
same:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, %eax
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movb	%al, -20(%rbp)
	movl	$1, -4(%rbp)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L11:
	movl	$-1, -12(%rbp)
	jmp	.L3
.L10:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L13
	cmpl	$0, -12(%rbp)
	je	.L5
	cmpl	$0, -8(%rbp)
	jne	.L13
.L5:
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L14
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cmpl	$5, %eax
	jg	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cmpl	$11, %eax
	jg	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -20(%rbp)
	jne	.L9
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%eax, %ecx
	movsbl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	addl	%eax, -4(%rbp)
	jmp	.L6
.L9:
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$79, %al
	jne	.L6
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	jmp	.L6
.L13:
	nop
	jmp	.L6
.L14:
	nop
.L6:
	addl	$1, -12(%rbp)
.L3:
	cmpl	$1, -12(%rbp)
	jle	.L10
	addl	$1, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L11
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	same, .-same
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L16
.L38:
	movl	$0, -28(%rbp)
	jmp	.L17
.L18:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	m(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L17:
	cmpl	$11, -28(%rbp)
	jle	.L18
	movl	$0, -16(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L19
.L37:
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L20
.L26:
	movl	$11, -28(%rbp)
	jmp	.L21
.L25:
	movq	m(%rip), %rax
	movq	8+m(%rip), %rdx
	movq	%rax, t(%rip)
	movq	%rdx, 8+t(%rip)
	movq	16+m(%rip), %rax
	movq	24+m(%rip), %rdx
	movq	%rax, 16+t(%rip)
	movq	%rdx, 24+t(%rip)
	movq	32+m(%rip), %rax
	movq	40+m(%rip), %rdx
	movq	%rax, 32+t(%rip)
	movq	%rdx, 40+t(%rip)
	movq	48+m(%rip), %rax
	movq	56+m(%rip), %rdx
	movq	%rax, 48+t(%rip)
	movq	%rdx, 56+t(%rip)
	movq	64+m(%rip), %rax
	movq	72+m(%rip), %rdx
	movq	%rax, 64+t(%rip)
	movq	%rdx, 72+t(%rip)
	movl	80+m(%rip), %eax
	movl	%eax, 80+t(%rip)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -33(%rbp)
	cmpb	$79, -33(%rbp)
	je	.L41
	cmpb	$46, -33(%rbp)
	je	.L41
	cmpb	$120, -33(%rbp)
	je	.L41
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movsbl	-33(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	cmpl	$3, %eax
	jle	.L24
	movq	t(%rip), %rax
	movq	8+t(%rip), %rdx
	movq	%rax, m(%rip)
	movq	%rdx, 8+m(%rip)
	movq	16+t(%rip), %rax
	movq	24+t(%rip), %rdx
	movq	%rax, 16+m(%rip)
	movq	%rdx, 24+m(%rip)
	movq	32+t(%rip), %rax
	movq	40+t(%rip), %rdx
	movq	%rax, 32+m(%rip)
	movq	%rdx, 40+m(%rip)
	movq	48+t(%rip), %rax
	movq	56+t(%rip), %rdx
	movq	%rax, 48+m(%rip)
	movq	%rdx, 56+m(%rip)
	movq	64+t(%rip), %rax
	movq	72+t(%rip), %rdx
	movq	%rax, 64+m(%rip)
	movq	%rdx, 72+m(%rip)
	movl	80+t(%rip), %eax
	movl	%eax, 80+m(%rip)
	movl	$1, -20(%rbp)
	jmp	.L24
.L41:
	nop
.L24:
	subl	$1, -28(%rbp)
.L21:
	cmpl	$0, -28(%rbp)
	jns	.L25
	addl	$1, -24(%rbp)
.L20:
	cmpl	$5, -24(%rbp)
	jle	.L26
	cmpl	$0, -20(%rbp)
	je	.L19
	addl	$1, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L27
.L36:
	movl	$11, -28(%rbp)
	jmp	.L28
.L35:
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L42
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L31
.L33:
	subl	$1, -12(%rbp)
.L31:
	cmpl	$0, -12(%rbp)
	js	.L32
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	je	.L33
.L32:
	cmpl	$0, -12(%rbp)
	jns	.L34
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movb	$46, (%rax)
	jmp	.L30
.L34:
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	jmp	.L30
.L42:
	nop
.L30:
	subl	$1, -28(%rbp)
.L28:
	cmpl	$0, -28(%rbp)
	jns	.L35
	addl	$1, -24(%rbp)
.L27:
	cmpl	$5, -24(%rbp)
	jle	.L36
.L19:
	cmpl	$0, -20(%rbp)
	jne	.L37
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L38
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.p2align 4
	.globl	same
	.type	same, @function
same:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	-1(%rsi), %r8d
	leal	1(%rsi), %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$11, %esi
	seta	%r14b
	subl	$1, %edx
	cmpl	$5, %edx
	ja	.L16
	testb	%r14b, %r14b
	jne	.L16
	movslq	%ebp, %rcx
	leaq	t(%rip), %rax
	movslq	%edx, %rsi
	leaq	(%rax,%rcx,8), %rax
	subq	%rcx, %rax
	addq	%rsi, %rax
	movzbl	(%rax), %ecx
	cmpb	%dil, %cl
	je	.L22
	movl	$1, %r12d
	cmpb	$79, %cl
	jne	.L7
	movb	$120, (%rax)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %r12d
.L7:
	cmpl	$5, %ebx
	ja	.L4
	cmpl	$11, %r8d
	jbe	.L23
.L11:
	cmpl	$11, %r15d
	jbe	.L24
.L4:
	addl	$1, %ebx
	cmpl	$5, %ebx
	ja	.L1
	testb	%r14b, %r14b
	jne	.L1
	movslq	%ebp, %rdx
	leaq	t(%rip), %rax
	movslq	%ebx, %rcx
	leaq	(%rax,%rdx,8), %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movzbl	(%rax), %edx
	cmpb	%dl, %r13b
	je	.L25
	cmpb	$79, %dl
	je	.L26
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L23:
	.cfi_restore_state
	movslq	%r8d, %rdx
	leaq	t(%rip), %rax
	movslq	%ebx, %rcx
	leaq	(%rax,%rdx,8), %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movzbl	(%rax), %edx
	cmpb	%dl, %r13b
	je	.L27
	cmpb	$79, %dl
	jne	.L11
	movb	$120, (%rax)
	jmp	.L11
.L24:
	movslq	%r15d, %rdx
	leaq	t(%rip), %rax
	movslq	%ebx, %rcx
	leaq	(%rax,%rdx,8), %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movzbl	(%rax), %edx
	cmpb	%dl, %r13b
	je	.L28
	cmpb	$79, %dl
	jne	.L4
	movb	$120, (%rax)
	jmp	.L4
.L26:
	movb	$120, (%rax)
	jmp	.L1
.L22:
	movb	$120, (%rax)
	movsbl	%dil, %edi
	movl	%ebp, %esi
	movl	%r8d, 12(%rsp)
	call	same
	movl	12(%rsp), %r8d
	leal	1(%rax), %r12d
	jmp	.L7
.L28:
	movb	$120, (%rax)
	movsbl	%r13b, %edi
	movl	%ebx, %edx
	movl	%r15d, %esi
	call	same
	addl	%eax, %r12d
	jmp	.L4
.L27:
	movb	$120, (%rax)
	movsbl	%r13b, %edi
	movl	%ebx, %edx
	movl	%r8d, %esi
	call	same
	addl	%eax, %r12d
	jmp	.L11
.L25:
	movb	$120, (%rax)
	movsbl	%r13b, %edi
	movl	%ebx, %edx
	movl	%ebp, %esi
	call	same
	addl	%eax, %r12d
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	same, .-same
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	je	.L30
	leaq	t(%rip), %r15
.L37:
	leaq	m(%rip), %r14
	movq	%r14, %rbx
.L31:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addq	$7, %rbx
	call	__isoc99_scanf@PLT
	leaq	84+m(%rip), %rax
	cmpq	%rax, %rbx
	jne	.L31
	movl	$0, 28(%rsp)
.L32:
	movl	$77, %r11d
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L44:
	leal	-77(%r11), %ebp
	leaq	(%r11,%r14), %r10
	movl	$11, %r9d
	leaq	(%r15,%r11), %r12
	.p2align 4,,10
	.p2align 3
.L34:
	movdqa	(%r14), %xmm0
	movdqa	16+m(%rip), %xmm1
	leaq	16+t(%rip), %rax
	leaq	80+t(%rip), %rcx
	movdqa	32+m(%rip), %xmm2
	movdqa	48+m(%rip), %xmm3
	movdqa	64+m(%rip), %xmm4
	movsbl	(%r10), %edi
	movaps	%xmm0, (%r15)
	movaps	%xmm1, (%rax)
	movaps	%xmm2, 16(%rax)
	cmpb	$79, %dil
	movaps	%xmm3, 32(%rax)
	movaps	%xmm4, 48(%rax)
	movl	80+m(%rip), %eax
	movl	%eax, (%rcx)
	sete	%al
	cmpb	$46, %dil
	sete	%dl
	orb	%dl, %al
	jne	.L33
	cmpb	$120, %dil
	je	.L33
	movb	$120, (%r12)
	movl	%ebp, %edx
	movl	%r9d, %esi
	call	same
	cmpl	$3, %eax
	jle	.L33
	movdqa	(%r15), %xmm5
	movdqa	16+t(%rip), %xmm6
	movl	$1, %ebx
	movl	80+t(%rip), %eax
	movdqa	32+t(%rip), %xmm7
	movaps	%xmm5, (%r14)
	movdqa	48+t(%rip), %xmm5
	movaps	%xmm6, 16+m(%rip)
	movdqa	64+t(%rip), %xmm6
	movl	%eax, 80+m(%rip)
	movaps	%xmm7, 32+m(%rip)
	movaps	%xmm5, 48+m(%rip)
	movaps	%xmm6, 64+m(%rip)
.L33:
	subl	$1, %r9d
	subq	$7, %r10
	subq	$7, %r12
	cmpl	$-1, %r9d
	jne	.L34
	addq	$1, %r11
	cmpq	$83, %r11
	jne	.L44
	testl	%ebx, %ebx
	je	.L93
	addl	$1, 28(%rsp)
	movq	%r14, 16(%rsp)
	movl	$0, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	24(%rsp), %rcx
	movq	16(%rsp), %rax
	movl	$3, %r12d
	movl	$4, %ebp
	movl	$5, %ebx
	movl	$6, %r11d
	movl	$9, %edi
	movl	$7, %r9d
	movq	%rcx, 8(%rsp)
	movl	$8, %r8d
	xorl	%r13d, %r13d
	movl	$11, %esi
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	$-1, %ecx
	je	.L94
.L42:
	subl	$1, %r13d
	subq	$7, %rax
	subl	$1, %edi
	subl	$1, %r8d
	subl	$1, %r9d
	subl	$1, %r11d
	subl	$1, %ebx
	subl	$1, %ebp
	subl	$1, %r12d
	movl	%ecx, %esi
.L43:
	cmpb	$120, 77(%rax)
	leal	-1(%rsi), %ecx
	jne	.L39
	cmpl	$-1, %ecx
	je	.L40
	movzbl	70(%rax), %edx
	cmpb	$120, %dl
	jne	.L46
	movl	%edi, %r10d
	cmpl	$-1, %edi
	je	.L40
	movzbl	63(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r8d, %r10d
	cmpl	$-1, %r8d
	je	.L40
	movzbl	56(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r9d, %r10d
	cmpl	$-1, %r9d
	je	.L40
	movzbl	49(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r11d, %r10d
	cmpl	$-1, %r11d
	je	.L40
	movzbl	42(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%ebx, %r10d
	cmpl	$-1, %ebx
	je	.L40
	movzbl	35(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%ebp, %r10d
	cmpl	$-1, %ebp
	je	.L40
	movzbl	28(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r12d, %r10d
	cmpl	$-1, %r12d
	je	.L40
	movzbl	21(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	leal	-9(%rsi), %r10d
	cmpl	$8, %esi
	je	.L40
	movzbl	14(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	leal	-10(%rsi), %r10d
	cmpl	$9, %esi
	je	.L40
	movzbl	7(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r13d, %r10d
	cmpl	$-1, %r13d
	je	.L40
	movzbl	(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
.L40:
	movb	$46, 77(%rax)
	cmpl	$-1, %ecx
	jne	.L42
	.p2align 4,,10
	.p2align 3
.L94:
	addl	$1, 24(%rsp)
	movl	24(%rsp), %eax
	addq	$1, 16(%rsp)
	cmpl	$6, %eax
	jne	.L38
	jmp	.L32
.L46:
	movl	%ecx, %r10d
	.p2align 4,,10
	.p2align 3
.L41:
	movslq	%r10d, %r10
	movb	%dl, 77(%rax)
	movq	8(%rsp), %rsi
	leaq	(%r14,%r10,8), %rdx
	subq	%r10, %rdx
	movb	$120, (%rdx,%rsi)
	jmp	.L42
.L93:
	movl	28(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L37
.L30:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	addq	$56, %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
.L95:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 84
t:
	.zero	84
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 84
m:
	.zero	84
	.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
	.globl	same
	.type	same, @function
same:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leal	-1(%rsi), %r8d
	leal	1(%rsi), %r15d
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movl	%edi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	movl	%esi, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movl	%edx, %ebx
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$11, %esi
	seta	%r14b
	subl	$1, %edx
	cmpl	$5, %edx
	ja	.L16
	testb	%r14b, %r14b
	jne	.L16
	movslq	%ebp, %rcx
	leaq	t(%rip), %rax
	movslq	%edx, %rsi
	leaq	(%rax,%rcx,8), %rax
	subq	%rcx, %rax
	addq	%rsi, %rax
	movzbl	(%rax), %ecx
	cmpb	%dil, %cl
	je	.L22
	movl	$1, %r12d
	cmpb	$79, %cl
	jne	.L7
	movb	$120, (%rax)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L16:
	movl	$1, %r12d
.L7:
	cmpl	$5, %ebx
	ja	.L4
	cmpl	$11, %r8d
	jbe	.L23
.L11:
	cmpl	$11, %r15d
	jbe	.L24
.L4:
	addl	$1, %ebx
	cmpl	$5, %ebx
	ja	.L1
	testb	%r14b, %r14b
	jne	.L1
	movslq	%ebp, %rdx
	leaq	t(%rip), %rax
	movslq	%ebx, %rcx
	leaq	(%rax,%rdx,8), %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movzbl	(%rax), %edx
	cmpb	%dl, %r13b
	je	.L25
	cmpb	$79, %dl
	je	.L26
.L1:
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
.L23:
	.cfi_restore_state
	movslq	%r8d, %rdx
	leaq	t(%rip), %rax
	movslq	%ebx, %rcx
	leaq	(%rax,%rdx,8), %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movzbl	(%rax), %edx
	cmpb	%dl, %r13b
	je	.L27
	cmpb	$79, %dl
	jne	.L11
	movb	$120, (%rax)
	jmp	.L11
.L24:
	movslq	%r15d, %rdx
	leaq	t(%rip), %rax
	movslq	%ebx, %rcx
	leaq	(%rax,%rdx,8), %rax
	subq	%rdx, %rax
	addq	%rcx, %rax
	movzbl	(%rax), %edx
	cmpb	%dl, %r13b
	je	.L28
	cmpb	$79, %dl
	jne	.L4
	movb	$120, (%rax)
	jmp	.L4
.L26:
	movb	$120, (%rax)
	jmp	.L1
.L22:
	movb	$120, (%rax)
	movsbl	%dil, %edi
	movl	%ebp, %esi
	movl	%r8d, 12(%rsp)
	call	same
	movl	12(%rsp), %r8d
	leal	1(%rax), %r12d
	jmp	.L7
.L28:
	movb	$120, (%rax)
	movsbl	%r13b, %edi
	movl	%ebx, %edx
	movl	%r15d, %esi
	call	same
	addl	%eax, %r12d
	jmp	.L4
.L27:
	movb	$120, (%rax)
	movsbl	%r13b, %edi
	movl	%ebx, %edx
	movl	%r8d, %esi
	call	same
	addl	%eax, %r12d
	jmp	.L11
.L25:
	movb	$120, (%rax)
	movsbl	%r13b, %edi
	movl	%ebx, %edx
	movl	%ebp, %esi
	call	same
	addl	%eax, %r12d
	jmp	.L1
	.cfi_endproc
.LFE35:
	.size	same, .-same
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	je	.L30
	leaq	t(%rip), %r15
.L37:
	leaq	m(%rip), %r14
	movq	%r14, %rbx
.L31:
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	addq	$7, %rbx
	call	__isoc99_scanf@PLT
	leaq	84+m(%rip), %rax
	cmpq	%rax, %rbx
	jne	.L31
	movl	$0, 28(%rsp)
.L32:
	movl	$77, %r11d
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L44:
	leal	-77(%r11), %ebp
	leaq	(%r11,%r14), %r10
	movl	$11, %r9d
	leaq	(%r15,%r11), %r12
	.p2align 4,,10
	.p2align 3
.L34:
	movdqa	(%r14), %xmm0
	movdqa	16+m(%rip), %xmm1
	leaq	16+t(%rip), %rax
	leaq	80+t(%rip), %rcx
	movdqa	32+m(%rip), %xmm2
	movdqa	48+m(%rip), %xmm3
	movdqa	64+m(%rip), %xmm4
	movsbl	(%r10), %edi
	movaps	%xmm0, (%r15)
	movaps	%xmm1, (%rax)
	movaps	%xmm2, 16(%rax)
	cmpb	$79, %dil
	movaps	%xmm3, 32(%rax)
	movaps	%xmm4, 48(%rax)
	movl	80+m(%rip), %eax
	movl	%eax, (%rcx)
	sete	%al
	cmpb	$46, %dil
	sete	%dl
	orb	%dl, %al
	jne	.L33
	cmpb	$120, %dil
	je	.L33
	movb	$120, (%r12)
	movl	%ebp, %edx
	movl	%r9d, %esi
	call	same
	cmpl	$3, %eax
	jle	.L33
	movdqa	(%r15), %xmm5
	movdqa	16+t(%rip), %xmm6
	movl	$1, %ebx
	movl	80+t(%rip), %eax
	movdqa	32+t(%rip), %xmm7
	movaps	%xmm5, (%r14)
	movdqa	48+t(%rip), %xmm5
	movaps	%xmm6, 16+m(%rip)
	movdqa	64+t(%rip), %xmm6
	movl	%eax, 80+m(%rip)
	movaps	%xmm7, 32+m(%rip)
	movaps	%xmm5, 48+m(%rip)
	movaps	%xmm6, 64+m(%rip)
.L33:
	subl	$1, %r9d
	subq	$7, %r10
	subq	$7, %r12
	cmpl	$-1, %r9d
	jne	.L34
	addq	$1, %r11
	cmpq	$83, %r11
	jne	.L44
	testl	%ebx, %ebx
	je	.L93
	addl	$1, 28(%rsp)
	movq	%r14, 16(%rsp)
	movl	$0, 24(%rsp)
	.p2align 4,,10
	.p2align 3
.L38:
	movslq	24(%rsp), %rcx
	movq	16(%rsp), %rax
	movl	$3, %r12d
	movl	$4, %ebp
	movl	$5, %ebx
	movl	$6, %r11d
	movl	$9, %edi
	movl	$7, %r9d
	movq	%rcx, 8(%rsp)
	movl	$8, %r8d
	xorl	%r13d, %r13d
	movl	$11, %esi
	jmp	.L43
	.p2align 4,,10
	.p2align 3
.L39:
	cmpl	$-1, %ecx
	je	.L94
.L42:
	subl	$1, %r13d
	subq	$7, %rax
	subl	$1, %edi
	subl	$1, %r8d
	subl	$1, %r9d
	subl	$1, %r11d
	subl	$1, %ebx
	subl	$1, %ebp
	subl	$1, %r12d
	movl	%ecx, %esi
.L43:
	cmpb	$120, 77(%rax)
	leal	-1(%rsi), %ecx
	jne	.L39
	cmpl	$-1, %ecx
	je	.L40
	movzbl	70(%rax), %edx
	cmpb	$120, %dl
	jne	.L46
	movl	%edi, %r10d
	cmpl	$-1, %edi
	je	.L40
	movzbl	63(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r8d, %r10d
	cmpl	$-1, %r8d
	je	.L40
	movzbl	56(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r9d, %r10d
	cmpl	$-1, %r9d
	je	.L40
	movzbl	49(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r11d, %r10d
	cmpl	$-1, %r11d
	je	.L40
	movzbl	42(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%ebx, %r10d
	cmpl	$-1, %ebx
	je	.L40
	movzbl	35(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%ebp, %r10d
	cmpl	$-1, %ebp
	je	.L40
	movzbl	28(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r12d, %r10d
	cmpl	$-1, %r12d
	je	.L40
	movzbl	21(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	leal	-9(%rsi), %r10d
	cmpl	$8, %esi
	je	.L40
	movzbl	14(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	leal	-10(%rsi), %r10d
	cmpl	$9, %esi
	je	.L40
	movzbl	7(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
	movl	%r13d, %r10d
	cmpl	$-1, %r13d
	je	.L40
	movzbl	(%rax), %edx
	cmpb	$120, %dl
	jne	.L41
.L40:
	movb	$46, 77(%rax)
	cmpl	$-1, %ecx
	jne	.L42
	.p2align 4,,10
	.p2align 3
.L94:
	addl	$1, 24(%rsp)
	movl	24(%rsp), %eax
	addq	$1, 16(%rsp)
	cmpl	$6, %eax
	jne	.L38
	jmp	.L32
.L46:
	movl	%ecx, %r10d
	.p2align 4,,10
	.p2align 3
.L41:
	movslq	%r10d, %r10
	movb	%dl, 77(%rax)
	movq	8(%rsp), %rsi
	leaq	(%r14,%r10,8), %rdx
	subq	%r10, %rdx
	movb	$120, (%rdx,%rsi)
	jmp	.L42
.L93:
	movl	28(%rsp), %edx
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	36(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 36(%rsp)
	testl	%eax, %eax
	jne	.L37
.L30:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L95
	addq	$56, %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
.L95:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.size	main, .-main
	.globl	t
	.bss
	.align 32
	.type	t, @object
	.size	t, 84
t:
	.zero	84
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 84
m:
	.zero	84
	.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:

// AOJ 2206: Compile
// 2017.11.10 bal4u@uu

#include <stdio.h>
#include <string.h>

char m[12][7], t[12][7];

int same(char a, int r, int c)
{
	int dr, dc;
	int ans = 1;

	for (dc = -1; dc <= 1; dc++) for (dr = -1; dr <= 1; dr++) {
		if (dr == dc || dr && dc) continue;
		if (c + dc < 0 || c + dc >= 6 || r + dr < 0 || r + dr >= 12) continue;
		if (t[r+dr][c+dc] == a) {
			t[r+dr][c+dc] = 'x';
			ans += same(a, r+dr, c+dc);
		} else if (t[r+dr][c+dc] == 'O') t[r+dr][c+dc] = 'x';
	}
	return ans;
}

int main()
{
	int cno, r, c, f, ans;
	char a;

	scanf("%d", &cno);
	while (cno--) {
		for (r = 0; r < 12; r++)  scanf("%s", m[r]);

		ans = 0, f = 1;
		while (f) {
			f = 0;
			for (c = 0; c < 6; c++) for (r = 11; r >= 0; r--) {
				memcpy(t, m, sizeof(m));
				a = m[r][c];
				if (a == 'O' || a == '.' || a == 'x') continue;
				t[r][c] = 'x';
				if (same(a, r, c) >= 4) {
					memcpy(m, t, sizeof(m));
					f = 1;
				}
			}

			if (f) {
				ans++;
				for (c = 0; c < 6; c++) {
					for (r = 11; r >= 0; r--) {
						int rr;
						if (m[r][c] != 'x') continue;
						rr = r-1;
						while (rr >= 0 && m[rr][c] == 'x') rr--;
						if (rr < 0) m[r][c] = '.';
						else m[r][c] = m[rr][c], m[rr][c] = 'x';
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}
3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRRYP
BGGRBB
BPRGYY
GGPRRY
BYPPRB
YGGGPB
RPYYYG
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
......
......
......
......
......
......
......
......
......
..OO..
..OO..
 3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRRYP
BGGRBB
BPRGYY
GGPRRY
BYPPRB
YGGGPB
GYYYPR
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
......
......
......
......
......
......
......
.....-
......
..OO..
..OO..
 3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRRYP
BGGRBB
BPYGYR
GGPRRY
BYPPRB
YGGGPB
GYYYPR
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
./....
......
......
......
......
......
......
.....-
......
..OO..
..OO..
 3
../...
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRQYP
BGGRBB
BPRGYY
GGPRRY
BYPPRB
YGGGPB
RPYYYG
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
......
......
......
......
......
./....
......
......
......
..OO..
..OO..
 3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRRYP
BGGRBB
CPRGYY
GGPRRY
BYPPRB
YGGGPB
GYYYPR
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
./....
......
......
......
......
......
......
.....-
......
..OO..
..OO..
 3
../...
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRRYP
BGGRBB
BPRGYY
YRRPGG
BYPPRB
YGGGPB
RPYYYG
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
......
......
......
....-.
......
./....
......
......
......
..OO..
..OO..
 3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
R.BPBG
RGBPP.
GBRGYP
GBRRYP
BGGRBB
BPYGYR
GGPRRY
BYPPRB
YGGGPB
GYYYPR
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
./...-
......
......
......
......
......
......
.....-
......
..OO..
..NO..
 3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
RGBPP.
GBGRYP
GBRRYP
BGGRBB
BPYGYR
GGPRRY
BYPPRB
BPGGGY
GYYYPR
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
./....
......
/.....
......
......
......
......
.....-
......
..OO..
..NO..
 3
.../..
......
......
......
......
......
......
.....-
.RGB..
RGOP..
RGBPB.
RGBPP.
GBRGYP
GBRRYP
BGGRBB
BYRGYP
GGPRRY
BYPPRB
YGGGPB
RPYYYG
YRBRBR
YBRBRB
RBRBRB
BRBRBR
......
......
......
......
....-.
......
-/....
......
......
......
..OO..
..OO..
 3
......
......
......
......
......
......
......
......
.RGB..
RGOP..
RGBPB.
.PPBGR
GBRFYP
GBRRYP
BGGRBB
BPRGYY
GGPRRY
BYPPRB
YGGGPB
GYYYPR
YRBRBR
YBRBRB
BRBRBR
BRBRBR
......
......
......
......
......
......
......
......
......
......
..OO..
O.P...

3
8
0
 3
18
0
 3
5
0
 3
0
0
 3
2
0
 3
3
0
 2
5
0
 3
1
0
 3
4
0
 0
1
0

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 2206: Compile
// 2017.11.10 bal4u@uu

#include <stdio.h>
#include <string.h>

char m[12][7], t[12][7];

int same(char a, int r, int c)
{
	int dr, dc;
	int ans = 1;

	for (dc = -1; dc <= 1; dc++) for (dr = -1; dr <= 1; dr++) {
		if (dr == dc || dr && dc) continue;
		if (c + dc < 0 || c + dc >= 6 || r + dr < 0 || r + dr >= 12) continue;
		if (t[r+dr][c+dc] == a) {
			t[r+dr][c+dc] = 'x';
			ans += same(a, r+dr, c+dc);
		} else if (t[r+dr][c+dc] == 'O') t[r+dr][c+dc] = 'x';
	}
	return ans;
}

int main()
{
	int cno, r, c, f, ans;
	char a;

	scanf("%d", &cno);
	while (cno--) {
		for (r = 0; r < 12; r++)  scanf("%s", m[r]);

		ans = 0, f = 1;
		while (f) {
			f = 0;
			for (c = 0; c < 6; c++) for (r = 11; r >= 0; r--) {
				memcpy(t, m, sizeof(m));
				a = m[r][c];
				if (a == 'O' || a == '.' || a == 'x') continue;
				t[r][c] = 'x';
				if (same(a, r, c) >= 4) {
					memcpy(m, t, sizeof(m));
					f = 1;
				}
			}

			if (f) {
				ans++;
				for (c = 0; c < 6; c++) {
					for (r = 11; r >= 0; r--) {
						int rr;
						if (m[r][c] != 'x') continue;
						rr = r-1;
						while (rr >= 0 && m[rr][c] == 'x') rr--;
						if (rr < 0) m[r][c] = '.';
						else m[r][c] = m[rr][c], m[rr][c] = 'x';
					}
				}
			}
		}
		printf("%d\n", ans);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 84
m:
	.zero	84
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 84
t:
	.zero	84
	.text
	.globl	same
	.type	same, @function
same:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, %eax
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movb	%al, -20(%rbp)
	movl	$1, -4(%rbp)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L11:
	movl	$-1, -12(%rbp)
	jmp	.L3
.L10:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L13
	cmpl	$0, -12(%rbp)
	je	.L5
	cmpl	$0, -8(%rbp)
	jne	.L13
.L5:
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L14
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cmpl	$5, %eax
	jg	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cmpl	$11, %eax
	jg	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -20(%rbp)
	jne	.L9
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%eax, %ecx
	movsbl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	addl	%eax, -4(%rbp)
	jmp	.L6
.L9:
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$79, %al
	jne	.L6
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	jmp	.L6
.L13:
	nop
	jmp	.L6
.L14:
	nop
.L6:
	addl	$1, -12(%rbp)
.L3:
	cmpl	$1, -12(%rbp)
	jle	.L10
	addl	$1, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L11
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	same, .-same
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L16
.L38:
	movl	$0, -28(%rbp)
	jmp	.L17
.L18:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	m(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L17:
	cmpl	$11, -28(%rbp)
	jle	.L18
	movl	$0, -16(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L19
.L37:
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L20
.L26:
	movl	$11, -28(%rbp)
	jmp	.L21
.L25:
	movq	m(%rip), %rax
	movq	8+m(%rip), %rdx
	movq	%rax, t(%rip)
	movq	%rdx, 8+t(%rip)
	movq	16+m(%rip), %rax
	movq	24+m(%rip), %rdx
	movq	%rax, 16+t(%rip)
	movq	%rdx, 24+t(%rip)
	movq	32+m(%rip), %rax
	movq	40+m(%rip), %rdx
	movq	%rax, 32+t(%rip)
	movq	%rdx, 40+t(%rip)
	movq	48+m(%rip), %rax
	movq	56+m(%rip), %rdx
	movq	%rax, 48+t(%rip)
	movq	%rdx, 56+t(%rip)
	movq	64+m(%rip), %rax
	movq	72+m(%rip), %rdx
	movq	%rax, 64+t(%rip)
	movq	%rdx, 72+t(%rip)
	movl	80+m(%rip), %eax
	movl	%eax, 80+t(%rip)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -33(%rbp)
	cmpb	$79, -33(%rbp)
	je	.L41
	cmpb	$46, -33(%rbp)
	je	.L41
	cmpb	$120, -33(%rbp)
	je	.L41
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movsbl	-33(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	cmpl	$3, %eax
	jle	.L24
	movq	t(%rip), %rax
	movq	8+t(%rip), %rdx
	movq	%rax, m(%rip)
	movq	%rdx, 8+m(%rip)
	movq	16+t(%rip), %rax
	movq	24+t(%rip), %rdx
	movq	%rax, 16+m(%rip)
	movq	%rdx, 24+m(%rip)
	movq	32+t(%rip), %rax
	movq	40+t(%rip), %rdx
	movq	%rax, 32+m(%rip)
	movq	%rdx, 40+m(%rip)
	movq	48+t(%rip), %rax
	movq	56+t(%rip), %rdx
	movq	%rax, 48+m(%rip)
	movq	%rdx, 56+m(%rip)
	movq	64+t(%rip), %rax
	movq	72+t(%rip), %rdx
	movq	%rax, 64+m(%rip)
	movq	%rdx, 72+m(%rip)
	movl	80+t(%rip), %eax
	movl	%eax, 80+m(%rip)
	movl	$1, -20(%rbp)
	jmp	.L24
.L41:
	nop
.L24:
	subl	$1, -28(%rbp)
.L21:
	cmpl	$0, -28(%rbp)
	jns	.L25
	addl	$1, -24(%rbp)
.L20:
	cmpl	$5, -24(%rbp)
	jle	.L26
	cmpl	$0, -20(%rbp)
	je	.L19
	addl	$1, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L27
.L36:
	movl	$11, -28(%rbp)
	jmp	.L28
.L35:
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L42
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L31
.L33:
	subl	$1, -12(%rbp)
.L31:
	cmpl	$0, -12(%rbp)
	js	.L32
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	je	.L33
.L32:
	cmpl	$0, -12(%rbp)
	jns	.L34
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movb	$46, (%rax)
	jmp	.L30
.L34:
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	jmp	.L30
.L42:
	nop
.L30:
	subl	$1, -28(%rbp)
.L28:
	cmpl	$0, -28(%rbp)
	jns	.L35
	addl	$1, -24(%rbp)
.L27:
	cmpl	$5, -24(%rbp)
	jle	.L36
.L19:
	cmpl	$0, -20(%rbp)
	jne	.L37
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L38
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 84
m:
	.zero	84
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 84
t:
	.zero	84
	.text
	.globl	same
	.type	same, @function
same:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, %eax
	movl	%esi, -24(%rbp)
	movl	%edx, -28(%rbp)
	movb	%al, -20(%rbp)
	movl	$1, -4(%rbp)
	movl	$-1, -8(%rbp)
	jmp	.L2
.L11:
	movl	$-1, -12(%rbp)
	jmp	.L3
.L10:
	movl	-12(%rbp), %eax
	cmpl	-8(%rbp), %eax
	je	.L13
	cmpl	$0, -12(%rbp)
	je	.L5
	cmpl	$0, -8(%rbp)
	jne	.L13
.L5:
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L14
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%edx, %eax
	cmpl	$5, %eax
	jg	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	testl	%eax, %eax
	js	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	cmpl	$11, %eax
	jg	.L14
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	%al, -20(%rbp)
	jne	.L9
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movl	-28(%rbp), %edx
	movl	-8(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %ecx
	movl	-12(%rbp), %eax
	addl	%eax, %ecx
	movsbl	-20(%rbp), %eax
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	addl	%eax, -4(%rbp)
	jmp	.L6
.L9:
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$79, %al
	jne	.L6
	movl	-24(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	movl	-28(%rbp), %ecx
	movl	-8(%rbp), %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	jmp	.L6
.L13:
	nop
	jmp	.L6
.L14:
	nop
.L6:
	addl	$1, -12(%rbp)
.L3:
	cmpl	$1, -12(%rbp)
	jle	.L10
	addl	$1, -8(%rbp)
.L2:
	cmpl	$1, -8(%rbp)
	jle	.L11
	movl	-4(%rbp), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	same, .-same
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L16
.L38:
	movl	$0, -28(%rbp)
	jmp	.L17
.L18:
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	m(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -28(%rbp)
.L17:
	cmpl	$11, -28(%rbp)
	jle	.L18
	movl	$0, -16(%rbp)
	movl	$1, -20(%rbp)
	jmp	.L19
.L37:
	movl	$0, -20(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L20
.L26:
	movl	$11, -28(%rbp)
	jmp	.L21
.L25:
	movq	m(%rip), %rax
	movq	8+m(%rip), %rdx
	movq	%rax, t(%rip)
	movq	%rdx, 8+t(%rip)
	movq	16+m(%rip), %rax
	movq	24+m(%rip), %rdx
	movq	%rax, 16+t(%rip)
	movq	%rdx, 24+t(%rip)
	movq	32+m(%rip), %rax
	movq	40+m(%rip), %rdx
	movq	%rax, 32+t(%rip)
	movq	%rdx, 40+t(%rip)
	movq	48+m(%rip), %rax
	movq	56+m(%rip), %rdx
	movq	%rax, 48+t(%rip)
	movq	%rdx, 56+t(%rip)
	movq	64+m(%rip), %rax
	movq	72+m(%rip), %rdx
	movq	%rax, 64+t(%rip)
	movq	%rdx, 72+t(%rip)
	movl	80+m(%rip), %eax
	movl	%eax, 80+t(%rip)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movb	%al, -33(%rbp)
	cmpb	$79, -33(%rbp)
	je	.L41
	cmpb	$46, -33(%rbp)
	je	.L41
	cmpb	$120, -33(%rbp)
	je	.L41
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	t(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	movsbl	-33(%rbp), %eax
	movl	-24(%rbp), %edx
	movl	-28(%rbp), %ecx
	movl	%ecx, %esi
	movl	%eax, %edi
	call	same
	cmpl	$3, %eax
	jle	.L24
	movq	t(%rip), %rax
	movq	8+t(%rip), %rdx
	movq	%rax, m(%rip)
	movq	%rdx, 8+m(%rip)
	movq	16+t(%rip), %rax
	movq	24+t(%rip), %rdx
	movq	%rax, 16+m(%rip)
	movq	%rdx, 24+m(%rip)
	movq	32+t(%rip), %rax
	movq	40+t(%rip), %rdx
	movq	%rax, 32+m(%rip)
	movq	%rdx, 40+m(%rip)
	movq	48+t(%rip), %rax
	movq	56+t(%rip), %rdx
	movq	%rax, 48+m(%rip)
	movq	%rdx, 56+m(%rip)
	movq	64+t(%rip), %rax
	movq	72+t(%rip), %rdx
	movq	%rax, 64+m(%rip)
	movq	%rdx, 72+m(%rip)
	movl	80+t(%rip), %eax
	movl	%eax, 80+m(%rip)
	movl	$1, -20(%rbp)
	jmp	.L24
.L41:
	nop
.L24:
	subl	$1, -28(%rbp)
.L21:
	cmpl	$0, -28(%rbp)
	jns	.L25
	addl	$1, -24(%rbp)
.L20:
	cmpl	$5, -24(%rbp)
	jle	.L26
	cmpl	$0, -20(%rbp)
	je	.L19
	addl	$1, -16(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L27
.L36:
	movl	$11, -28(%rbp)
	jmp	.L28
.L35:
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	jne	.L42
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L31
.L33:
	subl	$1, -12(%rbp)
.L31:
	cmpl	$0, -12(%rbp)
	js	.L32
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$120, %al
	je	.L33
.L32:
	cmpl	$0, -12(%rbp)
	jns	.L34
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movb	$46, (%rax)
	jmp	.L30
.L34:
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %edx
	movl	-24(%rbp), %eax
	movslq	%eax, %rsi
	movl	-28(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$3, %rax
	subq	%rcx, %rax
	leaq	(%rax,%rsi), %rcx
	leaq	m(%rip), %rax
	addq	%rcx, %rax
	movb	%dl, (%rax)
	movl	-24(%rbp), %eax
	movslq	%eax, %rcx
	movl	-12(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$3, %rax
	subq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	m(%rip), %rax
	addq	%rdx, %rax
	movb	$120, (%rax)
	jmp	.L30
.L42:
	nop
.L30:
	subl	$1, -28(%rbp)
.L28:
	cmpl	$0, -28(%rbp)
	jns	.L35
	addl	$1, -24(%rbp)
.L27:
	cmpl	$5, -24(%rbp)
	jle	.L36
.L19:
	cmpl	$0, -20(%rbp)
	jne	.L37
	movl	-16(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L16:
	movl	-32(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -32(%rbp)
	testl	%eax, %eax
	jne	.L38
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L40
	call	__stack_chk_fail@PLT
.L40:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
