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

```c
/* Coached by Dukkha */
#include <stdio.h>

#define N 100000

int check(char p, char o, char q, char a) {
	return ((o == 'S') == (a == 'o')) == (p == q);
}

char s[N + 1], t[N + 1];
int n;

int solve(char c1, char c2) {
	int i, sw = 'S' ^ 'W';

	t[0] = c1, t[1] = c2;
	for (i = 1; i < n - 1; i++)
		t[i + 1] = (t[i] == 'S') == (s[i] == 'o') ? t[i - 1] : t[i - 1] ^ sw;
	return check(t[n - 1], t[0], t[1], s[0]) && check(t[n - 2], t[n - 1], t[0], s[n - 1]);
}

int main() {
	scanf("%d%s", &n, s);
	printf("%s\n", solve('S', 'S') || solve('S', 'W') || solve('W', 'S') || solve('W', 'W') ? t : "-1");
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %sil
	setne	%al
	cmpb	$111, %cl
	sete	%cl
	xorl	%ecx, %eax
	cmpb	%dl, %dil
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r10d
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	leaq	t(%rip), %r11
	movb	%dil, %al
	movl	%edi, %r8d
	movb	%bl, %ah
	leal	-3(%r10), %ecx
	leaq	1(%r11), %rdi
	leal	-1(%r10), %r9d
	movw	%ax, t(%rip)
	leaq	1+s(%rip), %rdx
	movq	%r11, %rax
	addq	%rcx, %rdi
	cmpl	$1, %r9d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$111, (%rdx)
	sete	%sil
	cmpb	$83, 1(%rax)
	setne	%cl
	cmpb	%cl, %sil
	movzbl	(%rax), %ecx
	jne	.L14
	xorl	$4, %ecx
.L14:
	movb	%cl, 2(%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L10
.L9:
	cmpb	$111, s(%rip)
	movslq	%r9d, %r9
	sete	%al
	movzbl	(%r11,%r9), %edx
	cmpb	$83, %r8b
	setne	%cl
	xorl	%ecx, %eax
	cmpb	%bl, %dl
	sete	%cl
	cmpb	%cl, %al
	je	.L5
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	leaq	s(%rip), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	cmpb	$111, (%rax,%r9)
	sete	%al
	cmpb	$83, %dl
	setne	%dl
	subl	$2, %r10d
	movslq	%r10d, %r10
	xorl	%edx, %eax
	cmpb	%r8b, (%r11,%r10)
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	s(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	$83, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	je	.L21
.L16:
	leaq	t(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	$87, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$83, %esi
	movl	$87, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$87, %edi
	movl	$87, %esi
	call	solve
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	jmp	.L16
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 100001
t:
	.zero	100001
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100001
s:
	.zero	100001
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %sil
	setne	%al
	cmpb	$111, %cl
	sete	%cl
	xorl	%ecx, %eax
	cmpb	%dl, %dil
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r10d
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	leaq	t(%rip), %r11
	movb	%dil, %al
	movl	%edi, %r8d
	movb	%bl, %ah
	leal	-3(%r10), %ecx
	leaq	1(%r11), %rdi
	leal	-1(%r10), %r9d
	movw	%ax, t(%rip)
	leaq	1+s(%rip), %rdx
	movq	%r11, %rax
	addq	%rcx, %rdi
	cmpl	$1, %r9d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$111, (%rdx)
	sete	%sil
	cmpb	$83, 1(%rax)
	setne	%cl
	cmpb	%cl, %sil
	movzbl	(%rax), %ecx
	jne	.L14
	xorl	$4, %ecx
.L14:
	movb	%cl, 2(%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L10
.L9:
	cmpb	$111, s(%rip)
	movslq	%r9d, %r9
	sete	%al
	movzbl	(%r11,%r9), %edx
	cmpb	$83, %r8b
	setne	%cl
	xorl	%ecx, %eax
	cmpb	%bl, %dl
	sete	%cl
	cmpb	%cl, %al
	je	.L5
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	leaq	s(%rip), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	cmpb	$111, (%rax,%r9)
	sete	%al
	cmpb	$83, %dl
	setne	%dl
	subl	$2, %r10d
	movslq	%r10d, %r10
	xorl	%edx, %eax
	cmpb	%r8b, (%r11,%r10)
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	s(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	$83, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	je	.L21
.L16:
	leaq	t(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	$87, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$83, %esi
	movl	$87, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$87, %edi
	movl	$87, %esi
	call	solve
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	jmp	.L16
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 100001
t:
	.zero	100001
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100001
s:
	.zero	100001
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %sil
	setne	%al
	cmpb	$111, %cl
	sete	%cl
	xorl	%ecx, %eax
	cmpb	%dl, %dil
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r10d
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	leaq	t(%rip), %r11
	movb	%dil, %al
	movl	%edi, %r8d
	movb	%bl, %ah
	leal	-3(%r10), %ecx
	leaq	1(%r11), %rdi
	leal	-1(%r10), %r9d
	movw	%ax, t(%rip)
	leaq	1+s(%rip), %rdx
	movq	%r11, %rax
	addq	%rcx, %rdi
	cmpl	$1, %r9d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$111, (%rdx)
	sete	%sil
	cmpb	$83, 1(%rax)
	setne	%cl
	cmpb	%cl, %sil
	movzbl	(%rax), %ecx
	jne	.L14
	xorl	$4, %ecx
.L14:
	movb	%cl, 2(%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L10
.L9:
	cmpb	$111, s(%rip)
	movslq	%r9d, %r9
	sete	%al
	movzbl	(%r11,%r9), %edx
	cmpb	$83, %r8b
	setne	%cl
	xorl	%ecx, %eax
	cmpb	%bl, %dl
	sete	%cl
	cmpb	%cl, %al
	je	.L5
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	leaq	s(%rip), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	cmpb	$111, (%rax,%r9)
	sete	%al
	cmpb	$83, %dl
	setne	%dl
	subl	$2, %r10d
	movslq	%r10d, %r10
	xorl	%edx, %eax
	cmpb	%r8b, (%r11,%r10)
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	s(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	$83, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	je	.L21
.L16:
	leaq	t(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	$87, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$83, %esi
	movl	$87, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$87, %edi
	movl	$87, %esi
	call	solve
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	jmp	.L16
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 100001
t:
	.zero	100001
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100001
s:
	.zero	100001
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
```c
/* Coached by Dukkha */
#include <stdio.h>

#define N 100000

int check(char p, char o, char q, char a) {
	return ((o == 'S') == (a == 'o')) == (p == q);
}

char s[N + 1], t[N + 1];
int n;

int solve(char c1, char c2) {
	int i, sw = 'S' ^ 'W';

	t[0] = c1, t[1] = c2;
	for (i = 1; i < n - 1; i++)
		t[i + 1] = (t[i] == 'S') == (s[i] == 'o') ? t[i - 1] : t[i - 1] ^ sw;
	return check(t[n - 1], t[0], t[1], s[0]) && check(t[n - 2], t[n - 1], t[0], s[n - 1]);
}

int main() {
	scanf("%d%s", &n, s);
	printf("%s\n", solve('S', 'S') || solve('S', 'W') || solve('W', 'S') || solve('W', 'W') ? t : "-1");
	return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/* Coached by Dukkha */
#include <stdio.h>

#define N 100000

int check(char p, char o, char q, char a) {
	return ((o == 'S') == (a == 'o')) == (p == q);
}

char s[N + 1], t[N + 1];
int n;

int solve(char c1, char c2) {
	int i, sw = 'S' ^ 'W';

	t[0] = c1, t[1] = c2;
	for (i = 1; i < n - 1; i++)
		t[i + 1] = (t[i] == 'S') == (s[i] == 'o') ? t[i - 1] : t[i - 1] ^ sw;
	return check(t[n - 1], t[0], t[1], s[0]) && check(t[n - 2], t[n - 1], t[0], s[n - 1]);
}

int main() {
	scanf("%d%s", &n, s);
	printf("%s\n", solve('S', 'S') || solve('S', 'W') || solve('W', 'S') || solve('W', 'W') ? t : "-1");
	return 0;
}
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

3
xoo
 6
xooxoo
 10
xooxoxooxo
 10
xxooxoxooo
 10
oxooooxxox
 10
xoxxooooxo
 10
oooxoxooxx
 10
oxooooxxxo
 10
oxoooxxoox
 10
oxooooxoxx

-1
 SSSSWW
 SWWSSSWWSS
 SWSWWWSSSS
 SSWWSWWWWS
 SWWWWSWWSS
 SSSSWWWSWS
 WWWSWWSSWS
 WSSSSSWSWW
 WSSSSSSWWW

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

```c
/* Coached by Dukkha */
#include <stdio.h>

#define N 100000

int check(char p, char o, char q, char a) {
	return ((o == 'S') == (a == 'o')) == (p == q);
}

char s[N + 1], t[N + 1];
int n;

int solve(char c1, char c2) {
	int i, sw = 'S' ^ 'W';

	t[0] = c1, t[1] = c2;
	for (i = 1; i < n - 1; i++)
		t[i + 1] = (t[i] == 'S') == (s[i] == 'o') ? t[i - 1] : t[i - 1] ^ sw;
	return check(t[n - 1], t[0], t[1], s[0]) && check(t[n - 2], t[n - 1], t[0], s[n - 1]);
}

int main() {
	scanf("%d%s", &n, s);
	printf("%s\n", solve('S', 'S') || solve('S', 'W') || solve('W', 'S') || solve('W', 'W') ? t : "-1");
	return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %sil
	setne	%al
	cmpb	$111, %cl
	sete	%cl
	xorl	%ecx, %eax
	cmpb	%dl, %dil
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r10d
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	leaq	t(%rip), %r11
	movb	%dil, %al
	movl	%edi, %r8d
	movb	%bl, %ah
	leal	-3(%r10), %ecx
	leaq	1(%r11), %rdi
	leal	-1(%r10), %r9d
	movw	%ax, t(%rip)
	leaq	1+s(%rip), %rdx
	movq	%r11, %rax
	addq	%rcx, %rdi
	cmpl	$1, %r9d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$111, (%rdx)
	sete	%sil
	cmpb	$83, 1(%rax)
	setne	%cl
	cmpb	%cl, %sil
	movzbl	(%rax), %ecx
	jne	.L14
	xorl	$4, %ecx
.L14:
	movb	%cl, 2(%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L10
.L9:
	cmpb	$111, s(%rip)
	movslq	%r9d, %r9
	sete	%al
	movzbl	(%r11,%r9), %edx
	cmpb	$83, %r8b
	setne	%cl
	xorl	%ecx, %eax
	cmpb	%bl, %dl
	sete	%cl
	cmpb	%cl, %al
	je	.L5
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	leaq	s(%rip), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	cmpb	$111, (%rax,%r9)
	sete	%al
	cmpb	$83, %dl
	setne	%dl
	subl	$2, %r10d
	movslq	%r10d, %r10
	xorl	%edx, %eax
	cmpb	%r8b, (%r11,%r10)
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	s(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	$83, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	je	.L21
.L16:
	leaq	t(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	$87, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$83, %esi
	movl	$87, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$87, %edi
	movl	$87, %esi
	call	solve
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	jmp	.L16
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 100001
t:
	.zero	100001
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100001
s:
	.zero	100001
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	check
	.type	check, @function
check:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %sil
	setne	%al
	cmpb	$111, %cl
	sete	%cl
	xorl	%ecx, %eax
	cmpb	%dl, %dil
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	check, .-check
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB24:
	.cfi_startproc
	endbr64
	movl	n(%rip), %r10d
	xorl	%eax, %eax
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movl	%esi, %ebx
	leaq	t(%rip), %r11
	movb	%dil, %al
	movl	%edi, %r8d
	movb	%bl, %ah
	leal	-3(%r10), %ecx
	leaq	1(%r11), %rdi
	leal	-1(%r10), %r9d
	movw	%ax, t(%rip)
	leaq	1+s(%rip), %rdx
	movq	%r11, %rax
	addq	%rcx, %rdi
	cmpl	$1, %r9d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L10:
	cmpb	$111, (%rdx)
	sete	%sil
	cmpb	$83, 1(%rax)
	setne	%cl
	cmpb	%cl, %sil
	movzbl	(%rax), %ecx
	jne	.L14
	xorl	$4, %ecx
.L14:
	movb	%cl, 2(%rax)
	addq	$1, %rax
	addq	$1, %rdx
	cmpq	%rax, %rdi
	jne	.L10
.L9:
	cmpb	$111, s(%rip)
	movslq	%r9d, %r9
	sete	%al
	movzbl	(%r11,%r9), %edx
	cmpb	$83, %r8b
	setne	%cl
	xorl	%ecx, %eax
	cmpb	%bl, %dl
	sete	%cl
	cmpb	%cl, %al
	je	.L5
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	leaq	s(%rip), %rax
	popq	%rbx
	.cfi_def_cfa_offset 8
	cmpb	$111, (%rax,%r9)
	sete	%al
	cmpb	$83, %dl
	setne	%dl
	subl	$2, %r10d
	movslq	%r10d, %r10
	xorl	%edx, %eax
	cmpb	%r8b, (%r11,%r10)
	sete	%dl
	cmpb	%dl, %al
	sete	%al
	movzbl	%al, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	solve, .-solve
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-1"
.LC1:
	.string	"%d%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	leaq	s(%rip), %rdx
	call	__isoc99_scanf@PLT
	movl	$83, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	je	.L21
.L16:
	leaq	t(%rip), %rdi
.L17:
	call	puts@PLT
	xorl	%eax, %eax
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L21:
	.cfi_restore_state
	movl	$87, %esi
	movl	$83, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$83, %esi
	movl	$87, %edi
	call	solve
	testl	%eax, %eax
	jne	.L16
	movl	$87, %edi
	movl	$87, %esi
	call	solve
	leaq	.LC0(%rip), %rdi
	testl	%eax, %eax
	je	.L17
	jmp	.L16
	.cfi_endproc
.LFE25:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	t
	.align 32
	.type	t, @object
	.size	t, 100001
t:
	.zero	100001
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100001
s:
	.zero	100001
	.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:
```