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>

#define S 100003

int N;
char list[S];
char s[S];

char getInv(char c){
	if( c == 'S' ){
		return 'W';
	}
	return 'S';
}

void output(){
	int i;
	for( i = 1; i <= N; i++ ){ printf("%c", list[i]); }
	printf("\n");
	return;
}

/*
void say(){
	int r, i;
	const char Sans[2] = {'x', 'o'};
	const char Wans[2] = {'o', 'x'};
	list[0] = list[N];
	list[N+1] = list[1];
	for( i = 1; i <= N; i++ ){
		if( list[i-1] == list[i+1] ){
			r = 1;
		}else{
			r = 0;
		}
		if( list[i] == 'S' ){
			printf("%c", Sans[r]);
		}else{
			printf("%c", Wans[r]);
		}
	}
	printf("\n");
	return;
}
*/

int get(int i){
	int re = 0;
	if( i > N+1 ){
		if( list[1] == list[N+1] && list[2] == list[N+2] ){
			output();
			return 1;
		}
	}else if( i == 1 ){
		list[i+1] = 'S';
		re = get(i+1);
		if( re ){ return 1; }
		list[i+1] = 'W';
		re = get(i+1);
		if( re ){ return 1; }
	}else{
		if( list[i] == 'S' && s[i] == 'o' ){
			list[i+1] = list[i-1];
		}
		if( list[i] == 'S' && s[i] == 'x' ){
			list[i+1] = getInv(list[i-1]);
		}
		if( list[i] == 'W' && s[i] == 'o' ){
			list[i+1] = getInv(list[i-1]);
		}
		if( list[i] == 'W' && s[i] == 'x' ){
			list[i+1] = list[i-1];
		}
		re = get(i+1);
	}
	return re;
}

int main(){
	int i;
	scanf("%d\n", &N);
	for( i = 1; i <= N; i++ ){
		scanf("%c", &s[i]);
	}
	s[N+1] = s[1];
	list[1] = 'S';
	if( get(1) ){ return 0; }
	list[1] = 'W';
	if( get(1) ){ return 0; }
	printf("-1\n");
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	list
	.align 32
	.type	list, @object
	.size	list, 100003
list:
	.zero	100003
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100003
s:
	.zero	100003
	.text
	.globl	getInv
	.type	getInv, @function
getInv:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	cmpb	$83, -4(%rbp)
	jne	.L2
	movl	$87, %eax
	jmp	.L3
.L2:
	movl	$83, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getInv, .-getInv
	.globl	output
	.type	output, @function
output:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L6
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	output, .-output
	.globl	get
	.type	get, @function
get:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	$0, -20(%rbp)
	movl	N(%rip), %eax
	addl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jle	.L9
	movzbl	1+list(%rip), %edx
	movl	N(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L10
	movzbl	2+list(%rip), %edx
	movl	N(%rip), %eax
	addl	$2, %eax
	cltq
	leaq	list(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L10
	movl	$0, %eax
	call	output
	movl	$1, %eax
	jmp	.L11
.L9:
	cmpl	$1, -36(%rbp)
	jne	.L12
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movb	$83, (%rax,%rdx)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L13
	movl	$1, %eax
	jmp	.L11
.L13:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movb	$87, (%rax,%rdx)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L10
	movl	$1, %eax
	jmp	.L11
.L12:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L14
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$111, %al
	jne	.L14
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movslq	%ecx, %rax
	leaq	list(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L14:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L15
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$120, %al
	jne	.L15
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	-36(%rbp), %edx
	leal	1(%rdx), %ebx
	movl	%eax, %edi
	call	getInv
	movslq	%ebx, %rdx
	leaq	list(%rip), %rcx
	movb	%al, (%rdx,%rcx)
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L16
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$111, %al
	jne	.L16
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	-36(%rbp), %edx
	leal	1(%rdx), %ebx
	movl	%eax, %edi
	call	getInv
	movslq	%ebx, %rdx
	leaq	list(%rip), %rcx
	movb	%al, (%rdx,%rcx)
.L16:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L17
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$120, %al
	jne	.L17
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movslq	%ecx, %rax
	leaq	list(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L17:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
.L11:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get, .-get
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"-1"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L19
.L20:
	movl	-4(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L20
	movl	N(%rip), %eax
	addl	$1, %eax
	movzbl	1+s(%rip), %edx
	cltq
	leaq	s(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	movb	$83, 1+list(%rip)
	movl	$1, %edi
	call	get
	testl	%eax, %eax
	je	.L21
	movl	$0, %eax
	jmp	.L22
.L21:
	movb	$87, 1+list(%rip)
	movl	$1, %edi
	call	get
	testl	%eax, %eax
	je	.L23
	movl	$0, %eax
	jmp	.L22
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.type	get.constprop.1, @function
get.constprop.1:
.LFB27:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	1+list(%rip), %rax
	leaq	2+s(%rip), %rcx
	movl	$83, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	1(%rax), %rsi
	movl	$87, %r10d
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	N(%rip), %r9d
	leal	-1(%r9), %edx
	leal	1(%r9), %r8d
	addq	%rdx, %rsi
	cmpl	$1, %r8d
	jg	.L15
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$87, %dl
	jne	.L13
	movzbl	(%rcx), %edi
	cmpb	$111, %dil
	je	.L28
	cmpb	$120, %dil
	jne	.L13
.L16:
	movzbl	(%rax), %edx
	movb	%dl, 2(%rax)
.L13:
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rsi
	je	.L14
.L15:
	movzbl	1(%rax), %edx
	cmpb	$83, %dl
	jne	.L6
	movzbl	(%rcx), %edi
	cmpb	$111, %dil
	je	.L16
	cmpb	$120, %dil
	jne	.L13
	cmpb	$83, (%rax)
	cmove	%r10d, %edx
	addq	$1, %rax
	addq	$1, %rcx
	movb	%dl, 1(%rax)
	cmpq	%rax, %rsi
	jne	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	list(%rip), %rbx
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movzbl	(%rbx,%r8), %esi
	cmpb	%sil, 1+list(%rip)
	je	.L29
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	cmpb	$83, (%rax)
	cmovne	%r11d, %edx
	movb	%dl, 2(%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	leal	2(%r9), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %esi
	cmpb	%sil, 2+list(%rip)
	jne	.L1
	movl	$1, %ebp
	testl	%r9d, %r9d
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movsbl	(%rbx,%rbp), %edi
	addq	$1, %rbp
	call	putchar@PLT
	cmpl	%ebp, N(%rip)
	jge	.L4
.L5:
	movl	$10, %edi
	call	putchar@PLT
	movl	$1, %eax
	jmp	.L1
	.cfi_endproc
.LFE27:
	.size	get.constprop.1, .-get.constprop.1
	.p2align 4
	.type	get.constprop.0, @function
get.constprop.0:
.LFB28:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	N(%rip), %edx
	leal	1(%rdx), %eax
	testl	%eax, %eax
	jle	.L40
	movb	$83, 2+list(%rip)
	call	get.constprop.1
	movl	$1, %r8d
	testl	%eax, %eax
	je	.L41
.L30:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r8d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	leaq	list(%rip), %rbx
	cltq
	xorl	%r8d, %r8d
	movzbl	(%rbx,%rax), %eax
	cmpb	%al, 1+list(%rip)
	jne	.L30
	leal	2(%rdx), %eax
	cltq
	movzbl	(%rbx,%rax), %eax
	cmpb	%al, 2+list(%rip)
	jne	.L30
	testl	%edx, %edx
	jle	.L33
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L34:
	movsbl	(%rbx,%rbp), %edi
	addq	$1, %rbp
	call	putchar@PLT
	cmpl	%ebp, N(%rip)
	jge	.L34
.L33:
	movl	$10, %edi
	call	putchar@PLT
	movl	$1, %r8d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L41:
	movb	$87, 2+list(%rip)
	call	get.constprop.1
	xorl	%r8d, %r8d
	testl	%eax, %eax
	setne	%r8b
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	%r8d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE28:
	.size	get.constprop.0, .-get.constprop.0
	.p2align 4
	.globl	getInv
	.type	getInv, @function
getInv:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %dil
	sete	%al
	leal	83(,%rax,4), %eax
	ret
	.cfi_endproc
.LFE23:
	.size	getInv, .-getInv
	.p2align 4
	.globl	output
	.type	output, @function
output:
.LFB24:
	.cfi_startproc
	endbr64
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L50
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	list(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	$1, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L47:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpl	%ebx, N(%rip)
	jge	.L47
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$10, %edi
	jmp	putchar@PLT
	.cfi_endproc
.LFE24:
	.size	output, .-output
	.p2align 4
	.globl	get
	.type	get, @function
get:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	list(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	N(%rip), %r8d
	leal	1(%r8), %r10d
	cmpl	%r10d, %edi
	jg	.L54
	cmpl	$1, %edi
	je	.L60
	movslq	%edi, %rax
	leal	-1(%rdi), %esi
	leaq	list(%rip), %rbx
	movl	$83, %ebp
	leaq	(%rbx,%rax), %rdx
	leaq	s(%rip), %r9
	movl	$87, %r11d
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L62:
	cmpb	$87, %cl
	jne	.L69
	movzbl	(%r9,%rax), %edi
	cmpb	$111, %dil
	je	.L85
	cmpb	$120, %dil
	jne	.L69
.L71:
	movslq	%esi, %rcx
	movzbl	(%rbx,%rcx), %ecx
	movb	%cl, 1(%rdx)
.L69:
	cmpl	%eax, %r8d
	jl	.L54
.L83:
	addq	$1, %rax
	addq	$1, %rdx
	addl	$1, %esi
	cmpl	$1, %eax
	je	.L60
.L61:
	movzbl	(%rdx), %ecx
	cmpb	$83, %cl
	jne	.L62
	movzbl	(%r9,%rax), %edi
	cmpb	$111, %dil
	je	.L71
	cmpb	$120, %dil
	jne	.L69
	movslq	%esi, %rdi
	cmpb	$83, (%rbx,%rdi)
	cmove	%r11d, %ecx
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r8d
	jge	.L83
	.p2align 4,,10
	.p2align 3
.L54:
	movslq	%r10d, %r10
	xorl	%eax, %eax
	movzbl	(%rbx,%r10), %esi
	cmpb	%sil, 1+list(%rip)
	je	.L86
.L53:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L85:
	.cfi_restore_state
	movslq	%esi, %rdi
	cmpb	$83, (%rbx,%rdi)
	cmovne	%ebp, %ecx
	movb	%cl, 1(%rdx)
	jmp	.L69
	.p2align 4,,10
	.p2align 3
.L60:
	movb	$83, 2+list(%rip)
	call	get.constprop.1
	movl	%eax, %r8d
	movl	$1, %eax
	testl	%r8d, %r8d
	jne	.L53
	movb	$87, 2+list(%rip)
	call	get.constprop.1
	testl	%eax, %eax
	setne	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movzbl	%al, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L86:
	.cfi_restore_state
	leal	2(%r8), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %esi
	cmpb	%sil, 2+list(%rip)
	jne	.L53
	movl	$1, %ebp
	testl	%r8d, %r8d
	jle	.L59
	.p2align 4,,10
	.p2align 3
.L58:
	movsbl	(%rbx,%rbp), %edi
	addq	$1, %rbp
	call	putchar@PLT
	cmpl	%ebp, N(%rip)
	jge	.L58
.L59:
	movl	$10, %edi
	call	putchar@PLT
	movl	$1, %eax
	jmp	.L53
	.cfi_endproc
.LFE25:
	.size	get, .-get
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L88
	leaq	1+s(%rip), %rbx
	movl	$1, %ebp
	leaq	.LC1(%rip), %r12
	subl	%ebx, %ebp
	.p2align 4,,10
	.p2align 3
.L89:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	leal	0(%rbp,%rbx), %edx
	cmpl	%edx, %eax
	jge	.L89
.L88:
	addl	$1, %eax
	movzbl	1+s(%rip), %ecx
	leaq	s(%rip), %rdx
	movb	$83, 1+list(%rip)
	cltq
	movb	%cl, (%rdx,%rax)
	call	get.constprop.0
	testl	%eax, %eax
	je	.L95
.L91:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L95:
	.cfi_restore_state
	movb	$87, 1+list(%rip)
	call	get.constprop.0
	testl	%eax, %eax
	jne	.L91
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L91
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100003
s:
	.zero	100003
	.globl	list
	.align 32
	.type	list, @object
	.size	list, 100003
list:
	.zero	100003
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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	get.constprop.1, @function
get.constprop.1:
.LFB27:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	1+list(%rip), %rax
	leaq	2+s(%rip), %rcx
	movl	$83, %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	1(%rax), %rsi
	movl	$87, %r10d
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	N(%rip), %r9d
	leal	-1(%r9), %edx
	leal	1(%r9), %r8d
	addq	%rdx, %rsi
	cmpl	$1, %r8d
	jg	.L15
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L6:
	cmpb	$87, %dl
	jne	.L13
	movzbl	(%rcx), %edi
	cmpb	$111, %dil
	je	.L28
	cmpb	$120, %dil
	jne	.L13
.L16:
	movzbl	(%rax), %edx
	movb	%dl, 2(%rax)
.L13:
	addq	$1, %rax
	addq	$1, %rcx
	cmpq	%rax, %rsi
	je	.L14
.L15:
	movzbl	1(%rax), %edx
	cmpb	$83, %dl
	jne	.L6
	movzbl	(%rcx), %edi
	cmpb	$111, %dil
	je	.L16
	cmpb	$120, %dil
	jne	.L13
	cmpb	$83, (%rax)
	cmove	%r10d, %edx
	addq	$1, %rax
	addq	$1, %rcx
	movb	%dl, 1(%rax)
	cmpq	%rax, %rsi
	jne	.L15
	.p2align 4,,10
	.p2align 3
.L14:
	leaq	list(%rip), %rbx
	movslq	%r8d, %r8
	xorl	%eax, %eax
	movzbl	(%rbx,%r8), %esi
	cmpb	%sil, 1+list(%rip)
	je	.L29
.L1:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L28:
	.cfi_restore_state
	cmpb	$83, (%rax)
	cmovne	%r11d, %edx
	movb	%dl, 2(%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L29:
	leal	2(%r9), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %esi
	cmpb	%sil, 2+list(%rip)
	jne	.L1
	movl	$1, %ebp
	testl	%r9d, %r9d
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	movsbl	(%rbx,%rbp), %edi
	addq	$1, %rbp
	call	putchar@PLT
	cmpl	%ebp, N(%rip)
	jge	.L4
.L5:
	movl	$10, %edi
	call	putchar@PLT
	movl	$1, %eax
	jmp	.L1
	.cfi_endproc
.LFE27:
	.size	get.constprop.1, .-get.constprop.1
	.p2align 4
	.type	get.constprop.0, @function
get.constprop.0:
.LFB28:
	.cfi_startproc
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	N(%rip), %edx
	leal	1(%rdx), %eax
	testl	%eax, %eax
	jle	.L40
	movb	$83, 2+list(%rip)
	call	get.constprop.1
	movl	$1, %r8d
	testl	%eax, %eax
	je	.L41
.L30:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movl	%r8d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	leaq	list(%rip), %rbx
	cltq
	xorl	%r8d, %r8d
	movzbl	(%rbx,%rax), %eax
	cmpb	%al, 1+list(%rip)
	jne	.L30
	leal	2(%rdx), %eax
	cltq
	movzbl	(%rbx,%rax), %eax
	cmpb	%al, 2+list(%rip)
	jne	.L30
	testl	%edx, %edx
	jle	.L33
	movl	$1, %ebp
	.p2align 4,,10
	.p2align 3
.L34:
	movsbl	(%rbx,%rbp), %edi
	addq	$1, %rbp
	call	putchar@PLT
	cmpl	%ebp, N(%rip)
	jge	.L34
.L33:
	movl	$10, %edi
	call	putchar@PLT
	movl	$1, %r8d
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L41:
	movb	$87, 2+list(%rip)
	call	get.constprop.1
	xorl	%r8d, %r8d
	testl	%eax, %eax
	setne	%r8b
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	%r8d, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE28:
	.size	get.constprop.0, .-get.constprop.0
	.p2align 4
	.globl	getInv
	.type	getInv, @function
getInv:
.LFB23:
	.cfi_startproc
	endbr64
	cmpb	$83, %dil
	sete	%al
	leal	83(,%rax,4), %eax
	ret
	.cfi_endproc
.LFE23:
	.size	getInv, .-getInv
	.p2align 4
	.globl	output
	.type	output, @function
output:
.LFB24:
	.cfi_startproc
	endbr64
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L50
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	list(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	$1, %ebx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L47:
	movsbl	0(%rbp,%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpl	%ebx, N(%rip)
	jge	.L47
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L50:
	movl	$10, %edi
	jmp	putchar@PLT
	.cfi_endproc
.LFE24:
	.size	output, .-output
	.p2align 4
	.globl	get
	.type	get, @function
get:
.LFB25:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	list(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	N(%rip), %r8d
	leal	1(%r8), %r10d
	cmpl	%r10d, %edi
	jg	.L54
	cmpl	$1, %edi
	je	.L60
	movslq	%edi, %rax
	leal	-1(%rdi), %esi
	leaq	list(%rip), %rbx
	movl	$83, %ebp
	leaq	(%rbx,%rax), %rdx
	leaq	s(%rip), %r9
	movl	$87, %r11d
	jmp	.L61
	.p2align 4,,10
	.p2align 3
.L62:
	cmpb	$87, %cl
	jne	.L69
	movzbl	(%r9,%rax), %edi
	cmpb	$111, %dil
	je	.L85
	cmpb	$120, %dil
	jne	.L69
.L71:
	movslq	%esi, %rcx
	movzbl	(%rbx,%rcx), %ecx
	movb	%cl, 1(%rdx)
.L69:
	cmpl	%eax, %r8d
	jl	.L54
.L83:
	addq	$1, %rax
	addq	$1, %rdx
	addl	$1, %esi
	cmpl	$1, %eax
	je	.L60
.L61:
	movzbl	(%rdx), %ecx
	cmpb	$83, %cl
	jne	.L62
	movzbl	(%r9,%rax), %edi
	cmpb	$111, %dil
	je	.L71
	cmpb	$120, %dil
	jne	.L69
	movslq	%esi, %rdi
	cmpb	$83, (%rbx,%rdi)
	cmove	%r11d, %ecx
	movb	%cl, 1(%rdx)
	cmpl	%eax, %r8d
	jge	.L83
	.p2align 4,,10
	.p2align 3
.L54:
	movslq	%r10d, %r10
	xorl	%eax, %eax
	movzbl	(%rbx,%r10), %esi
	cmpb	%sil, 1+list(%rip)
	je	.L86
.L53:
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L85:
	.cfi_restore_state
	movslq	%esi, %rdi
	cmpb	$83, (%rbx,%rdi)
	cmovne	%ebp, %ecx
	movb	%cl, 1(%rdx)
	jmp	.L69
	.p2align 4,,10
	.p2align 3
.L60:
	movb	$83, 2+list(%rip)
	call	get.constprop.1
	movl	%eax, %r8d
	movl	$1, %eax
	testl	%r8d, %r8d
	jne	.L53
	movb	$87, 2+list(%rip)
	call	get.constprop.1
	testl	%eax, %eax
	setne	%al
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	movzbl	%al, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L86:
	.cfi_restore_state
	leal	2(%r8), %edx
	movslq	%edx, %rdx
	movzbl	(%rbx,%rdx), %esi
	cmpb	%sil, 2+list(%rip)
	jne	.L53
	movl	$1, %ebp
	testl	%r8d, %r8d
	jle	.L59
	.p2align 4,,10
	.p2align 3
.L58:
	movsbl	(%rbx,%rbp), %edi
	addq	$1, %rbp
	call	putchar@PLT
	cmpl	%ebp, N(%rip)
	jge	.L58
.L59:
	movl	$10, %edi
	call	putchar@PLT
	movl	$1, %eax
	jmp	.L53
	.cfi_endproc
.LFE25:
	.size	get, .-get
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"-1"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	N(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L88
	leaq	1+s(%rip), %rbx
	movl	$1, %ebp
	leaq	.LC1(%rip), %r12
	subl	%ebx, %ebp
	.p2align 4,,10
	.p2align 3
.L89:
	movq	%rbx, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addq	$1, %rbx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	leal	0(%rbp,%rbx), %edx
	cmpl	%edx, %eax
	jge	.L89
.L88:
	addl	$1, %eax
	movzbl	1+s(%rip), %ecx
	leaq	s(%rip), %rdx
	movb	$83, 1+list(%rip)
	cltq
	movb	%cl, (%rdx,%rax)
	call	get.constprop.0
	testl	%eax, %eax
	je	.L95
.L91:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L95:
	.cfi_restore_state
	movb	$87, 1+list(%rip)
	call	get.constprop.0
	testl	%eax, %eax
	jne	.L91
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L91
	.cfi_endproc
.LFE26:
	.size	main, .-main
	.globl	s
	.bss
	.align 32
	.type	s, @object
	.size	s, 100003
s:
	.zero	100003
	.globl	list
	.align 32
	.type	list, @object
	.size	list, 100003
list:
	.zero	100003
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.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>

#define S 100003

int N;
char list[S];
char s[S];

char getInv(char c){
	if( c == 'S' ){
		return 'W';
	}
	return 'S';
}

void output(){
	int i;
	for( i = 1; i <= N; i++ ){ printf("%c", list[i]); }
	printf("\n");
	return;
}

/*
void say(){
	int r, i;
	const char Sans[2] = {'x', 'o'};
	const char Wans[2] = {'o', 'x'};
	list[0] = list[N];
	list[N+1] = list[1];
	for( i = 1; i <= N; i++ ){
		if( list[i-1] == list[i+1] ){
			r = 1;
		}else{
			r = 0;
		}
		if( list[i] == 'S' ){
			printf("%c", Sans[r]);
		}else{
			printf("%c", Wans[r]);
		}
	}
	printf("\n");
	return;
}
*/

int get(int i){
	int re = 0;
	if( i > N+1 ){
		if( list[1] == list[N+1] && list[2] == list[N+2] ){
			output();
			return 1;
		}
	}else if( i == 1 ){
		list[i+1] = 'S';
		re = get(i+1);
		if( re ){ return 1; }
		list[i+1] = 'W';
		re = get(i+1);
		if( re ){ return 1; }
	}else{
		if( list[i] == 'S' && s[i] == 'o' ){
			list[i+1] = list[i-1];
		}
		if( list[i] == 'S' && s[i] == 'x' ){
			list[i+1] = getInv(list[i-1]);
		}
		if( list[i] == 'W' && s[i] == 'o' ){
			list[i+1] = getInv(list[i-1]);
		}
		if( list[i] == 'W' && s[i] == 'x' ){
			list[i+1] = list[i-1];
		}
		re = get(i+1);
	}
	return re;
}

int main(){
	int i;
	scanf("%d\n", &N);
	for( i = 1; i <= N; i++ ){
		scanf("%c", &s[i]);
	}
	s[N+1] = s[1];
	list[1] = 'S';
	if( get(1) ){ return 0; }
	list[1] = 'W';
	if( get(1) ){ return 0; }
	printf("-1\n");
	return 0;
}


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 unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include<stdio.h>

#define S 100003

int N;
char list[S];
char s[S];

char getInv(char c){
	if( c == 'S' ){
		return 'W';
	}
	return 'S';
}

void output(){
	int i;
	for( i = 1; i <= N; i++ ){ printf("%c", list[i]); }
	printf("\n");
	return;
}

/*
void say(){
	int r, i;
	const char Sans[2] = {'x', 'o'};
	const char Wans[2] = {'o', 'x'};
	list[0] = list[N];
	list[N+1] = list[1];
	for( i = 1; i <= N; i++ ){
		if( list[i-1] == list[i+1] ){
			r = 1;
		}else{
			r = 0;
		}
		if( list[i] == 'S' ){
			printf("%c", Sans[r]);
		}else{
			printf("%c", Wans[r]);
		}
	}
	printf("\n");
	return;
}
*/

int get(int i){
	int re = 0;
	if( i > N+1 ){
		if( list[1] == list[N+1] && list[2] == list[N+2] ){
			output();
			return 1;
		}
	}else if( i == 1 ){
		list[i+1] = 'S';
		re = get(i+1);
		if( re ){ return 1; }
		list[i+1] = 'W';
		re = get(i+1);
		if( re ){ return 1; }
	}else{
		if( list[i] == 'S' && s[i] == 'o' ){
			list[i+1] = list[i-1];
		}
		if( list[i] == 'S' && s[i] == 'x' ){
			list[i+1] = getInv(list[i-1]);
		}
		if( list[i] == 'W' && s[i] == 'o' ){
			list[i+1] = getInv(list[i-1]);
		}
		if( list[i] == 'W' && s[i] == 'x' ){
			list[i+1] = list[i-1];
		}
		re = get(i+1);
	}
	return re;
}

int main(){
	int i;
	scanf("%d\n", &N);
	for( i = 1; i <= N; i++ ){
		scanf("%c", &s[i]);
	}
	s[N+1] = s[1];
	list[1] = 'S';
	if( get(1) ){ return 0; }
	list[1] = 'W';
	if( get(1) ){ return 0; }
	printf("-1\n");
	return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	list
	.align 32
	.type	list, @object
	.size	list, 100003
list:
	.zero	100003
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100003
s:
	.zero	100003
	.text
	.globl	getInv
	.type	getInv, @function
getInv:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	cmpb	$83, -4(%rbp)
	jne	.L2
	movl	$87, %eax
	jmp	.L3
.L2:
	movl	$83, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getInv, .-getInv
	.globl	output
	.type	output, @function
output:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L6
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	output, .-output
	.globl	get
	.type	get, @function
get:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	$0, -20(%rbp)
	movl	N(%rip), %eax
	addl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jle	.L9
	movzbl	1+list(%rip), %edx
	movl	N(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L10
	movzbl	2+list(%rip), %edx
	movl	N(%rip), %eax
	addl	$2, %eax
	cltq
	leaq	list(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L10
	movl	$0, %eax
	call	output
	movl	$1, %eax
	jmp	.L11
.L9:
	cmpl	$1, -36(%rbp)
	jne	.L12
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movb	$83, (%rax,%rdx)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L13
	movl	$1, %eax
	jmp	.L11
.L13:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movb	$87, (%rax,%rdx)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L10
	movl	$1, %eax
	jmp	.L11
.L12:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L14
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$111, %al
	jne	.L14
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movslq	%ecx, %rax
	leaq	list(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L14:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L15
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$120, %al
	jne	.L15
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	-36(%rbp), %edx
	leal	1(%rdx), %ebx
	movl	%eax, %edi
	call	getInv
	movslq	%ebx, %rdx
	leaq	list(%rip), %rcx
	movb	%al, (%rdx,%rcx)
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L16
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$111, %al
	jne	.L16
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	-36(%rbp), %edx
	leal	1(%rdx), %ebx
	movl	%eax, %edi
	call	getInv
	movslq	%ebx, %rdx
	leaq	list(%rip), %rcx
	movb	%al, (%rdx,%rcx)
.L16:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L17
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$120, %al
	jne	.L17
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movslq	%ecx, %rax
	leaq	list(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L17:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
.L11:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get, .-get
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"-1"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L19
.L20:
	movl	-4(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L20
	movl	N(%rip), %eax
	addl	$1, %eax
	movzbl	1+s(%rip), %edx
	cltq
	leaq	s(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	movb	$83, 1+list(%rip)
	movl	$1, %edi
	call	get
	testl	%eax, %eax
	je	.L21
	movl	$0, %eax
	jmp	.L22
.L21:
	movb	$87, 1+list(%rip)
	movl	$1, %edi
	call	get
	testl	%eax, %eax
	je	.L23
	movl	$0, %eax
	jmp	.L22
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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	N
	.bss
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	list
	.align 32
	.type	list, @object
	.size	list, 100003
list:
	.zero	100003
	.globl	s
	.align 32
	.type	s, @object
	.size	s, 100003
s:
	.zero	100003
	.text
	.globl	getInv
	.type	getInv, @function
getInv:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	cmpb	$83, -4(%rbp)
	jne	.L2
	movl	$87, %eax
	jmp	.L3
.L2:
	movl	$83, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	getInv, .-getInv
	.globl	output
	.type	output, @function
output:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$1, -4(%rbp)
	jmp	.L5
.L6:
	movl	-4(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L5:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L6
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	output, .-output
	.globl	get
	.type	get, @function
get:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset 3, -24
	movl	%edi, -36(%rbp)
	movl	$0, -20(%rbp)
	movl	N(%rip), %eax
	addl	$1, %eax
	cmpl	%eax, -36(%rbp)
	jle	.L9
	movzbl	1+list(%rip), %edx
	movl	N(%rip), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L10
	movzbl	2+list(%rip), %edx
	movl	N(%rip), %eax
	addl	$2, %eax
	cltq
	leaq	list(%rip), %rcx
	movzbl	(%rax,%rcx), %eax
	cmpb	%al, %dl
	jne	.L10
	movl	$0, %eax
	call	output
	movl	$1, %eax
	jmp	.L11
.L9:
	cmpl	$1, -36(%rbp)
	jne	.L12
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movb	$83, (%rax,%rdx)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L13
	movl	$1, %eax
	jmp	.L11
.L13:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movb	$87, (%rax,%rdx)
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L10
	movl	$1, %eax
	jmp	.L11
.L12:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L14
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$111, %al
	jne	.L14
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movslq	%ecx, %rax
	leaq	list(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L14:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$83, %al
	jne	.L15
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$120, %al
	jne	.L15
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	-36(%rbp), %edx
	leal	1(%rdx), %ebx
	movl	%eax, %edi
	call	getInv
	movslq	%ebx, %rdx
	leaq	list(%rip), %rcx
	movb	%al, (%rdx,%rcx)
.L15:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L16
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$111, %al
	jne	.L16
	movl	-36(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	movl	-36(%rbp), %edx
	leal	1(%rdx), %ebx
	movl	%eax, %edi
	call	getInv
	movslq	%ebx, %rdx
	leaq	list(%rip), %rcx
	movb	%al, (%rdx,%rcx)
.L16:
	movl	-36(%rbp), %eax
	cltq
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$87, %al
	jne	.L17
	movl	-36(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$120, %al
	jne	.L17
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	leal	1(%rax), %ecx
	movslq	%edx, %rax
	leaq	list(%rip), %rdx
	movzbl	(%rax,%rdx), %edx
	movslq	%ecx, %rax
	leaq	list(%rip), %rcx
	movb	%dl, (%rax,%rcx)
.L17:
	movl	-36(%rbp), %eax
	addl	$1, %eax
	movl	%eax, %edi
	call	get
	movl	%eax, -20(%rbp)
.L10:
	movl	-20(%rbp), %eax
.L11:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	get, .-get
	.section	.rodata
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%c"
.LC2:
	.string	"-1"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	leaq	N(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L19
.L20:
	movl	-4(%rbp), %eax
	cltq
	leaq	s(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L19:
	movl	N(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L20
	movl	N(%rip), %eax
	addl	$1, %eax
	movzbl	1+s(%rip), %edx
	cltq
	leaq	s(%rip), %rcx
	movb	%dl, (%rax,%rcx)
	movb	$83, 1+list(%rip)
	movl	$1, %edi
	call	get
	testl	%eax, %eax
	je	.L21
	movl	$0, %eax
	jmp	.L22
.L21:
	movb	$87, 1+list(%rip)
	movl	$1, %edi
	call	get
	testl	%eax, %eax
	je	.L23
	movl	$0, %eax
	jmp	.L22
.L23:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
