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

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

#define MDATA 200001

typedef struct
{
    char arr[MDATA];
    int top;    //末尾のデータのある配列の要素番号
} stack;

int push(stack *stk, char input)
{
    if (stk->top <= MDATA)
    {
        stk->top++;
        stk->arr[stk->top] = input;
        return 0;
    }else{
        return -1;
    }
}

int pop2(stack *stk)
{
    if (stk->top != 0)
    {
        stk->top--;
    }
    return 0;
}

int main(void)
{
    stack stk;
    char x[MDATA];
    stk.top=0;
    scanf("%s",x);
    for(int i=0;i<strlen(x);i++)
    {
        if(x[i]=='S')
        {
            push(&stk,x[i]);
        }else{
            if(stk.arr[stk.top]=='S')
            {
                pop2(&stk);
            }else{
                push(&stk,x[i]);
            }
        }
    }
    printf("%d\n",stk.top);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB35:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	cmpl	$200001, %eax
	jg	.L3
	addl	$1, %eax
	movl	%eax, 200004(%rdi)
	cltq
	movb	%sil, (%rdi,%rax)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	push, .-push
	.p2align 4
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB36:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	testl	%eax, %eax
	je	.L6
	subl	$1, %eax
	movl	%eax, 200004(%rdi)
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	pop2, .-pop2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	200016(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%r12d, %rdx
	cmpb	$83, (%rsp,%rdx)
	je	.L20
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rdx
	movb	%al, (%rsp,%rdx)
.L13:
	addq	$1, %rbx
.L11:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L21
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	jne	.L12
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rax
	movb	$83, (%rsp,%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$1, %r12d
	adcl	$-1, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB35:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	cmpl	$200001, %eax
	jg	.L3
	addl	$1, %eax
	movl	%eax, 200004(%rdi)
	cltq
	movb	%sil, (%rdi,%rax)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	push, .-push
	.p2align 4
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB36:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	testl	%eax, %eax
	je	.L6
	subl	$1, %eax
	movl	%eax, 200004(%rdi)
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	pop2, .-pop2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	200016(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%r12d, %rdx
	cmpb	$83, (%rsp,%rdx)
	je	.L20
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rdx
	movb	%al, (%rsp,%rdx)
.L13:
	addq	$1, %rbx
.L11:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L21
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	jne	.L12
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rax
	movb	$83, (%rsp,%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$1, %r12d
	adcl	$-1, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB35:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	cmpl	$200001, %eax
	jg	.L3
	addl	$1, %eax
	movl	%eax, 200004(%rdi)
	cltq
	movb	%sil, (%rdi,%rax)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	push, .-push
	.p2align 4
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB36:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	testl	%eax, %eax
	je	.L6
	subl	$1, %eax
	movl	%eax, 200004(%rdi)
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	pop2, .-pop2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	200016(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%r12d, %rdx
	cmpb	$83, (%rsp,%rdx)
	je	.L20
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rdx
	movb	%al, (%rsp,%rdx)
.L13:
	addq	$1, %rbx
.L11:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L21
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	jne	.L12
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rax
	movb	$83, (%rsp,%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$1, %r12d
	adcl	$-1, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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:
```
```c
#include <stdio.h>
#include <string.h>

#define MDATA 200001

typedef struct
{
    char arr[MDATA];
    int top;    //末尾のデータのある配列の要素番号
} stack;

int push(stack *stk, char input)
{
    if (stk->top <= MDATA)
    {
        stk->top++;
        stk->arr[stk->top] = input;
        return 0;
    }else{
        return -1;
    }
}

int pop2(stack *stk)
{
    if (stk->top != 0)
    {
        stk->top--;
    }
    return 0;
}

int main(void)
{
    stack stk;
    char x[MDATA];
    stk.top=0;
    scanf("%s",x);
    for(int i=0;i<strlen(x);i++)
    {
        if(x[i]=='S')
        {
            push(&stk,x[i]);
        }else{
            if(stk.arr[stk.top]=='S')
            {
                pop2(&stk);
            }else{
                push(&stk,x[i]);
            }
        }
    }
    printf("%d\n",stk.top);
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

#define MDATA 200001

typedef struct
{
    char arr[MDATA];
    int top;    //末尾のデータのある配列の要素番号
} stack;

int push(stack *stk, char input)
{
    if (stk->top <= MDATA)
    {
        stk->top++;
        stk->arr[stk->top] = input;
        return 0;
    }else{
        return -1;
    }
}

int pop2(stack *stk)
{
    if (stk->top != 0)
    {
        stk->top--;
    }
    return 0;
}

int main(void)
{
    stack stk;
    char x[MDATA];
    stk.top=0;
    scanf("%s",x);
    for(int i=0;i<strlen(x);i++)
    {
        if(x[i]=='S')
        {
            push(&stk,x[i]);
        }else{
            if(stk.arr[stk.top]=='S')
            {
                pop2(&stk);
            }else{
                push(&stk,x[i]);
            }
        }
    }
    printf("%d\n",stk.top);
    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:

SSTTTSST
 STTTSS
 SSSTTT
 TTTSSS
 TTTTSSSS
 TSTSST
 SSTTTS
 TSSTST
 STTSST
 TSSSTT

2
 4
 0
 6
 8
 2
 2
 2
 2
 2

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

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

#define MDATA 200001

typedef struct
{
    char arr[MDATA];
    int top;    //末尾のデータのある配列の要素番号
} stack;

int push(stack *stk, char input)
{
    if (stk->top <= MDATA)
    {
        stk->top++;
        stk->arr[stk->top] = input;
        return 0;
    }else{
        return -1;
    }
}

int pop2(stack *stk)
{
    if (stk->top != 0)
    {
        stk->top--;
    }
    return 0;
}

int main(void)
{
    stack stk;
    char x[MDATA];
    stk.top=0;
    scanf("%s",x);
    for(int i=0;i<strlen(x);i++)
    {
        if(x[i]=='S')
        {
            push(&stk,x[i]);
        }else{
            if(stk.arr[stk.top]=='S')
            {
                pop2(&stk);
            }else{
                push(&stk,x[i]);
            }
        }
    }
    printf("%d\n",stk.top);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB35:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	cmpl	$200001, %eax
	jg	.L3
	addl	$1, %eax
	movl	%eax, 200004(%rdi)
	cltq
	movb	%sil, (%rdi,%rax)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	push, .-push
	.p2align 4
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB36:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	testl	%eax, %eax
	je	.L6
	subl	$1, %eax
	movl	%eax, 200004(%rdi)
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	pop2, .-pop2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	200016(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%r12d, %rdx
	cmpb	$83, (%rsp,%rdx)
	je	.L20
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rdx
	movb	%al, (%rsp,%rdx)
.L13:
	addq	$1, %rbx
.L11:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L21
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	jne	.L12
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rax
	movb	$83, (%rsp,%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$1, %r12d
	adcl	$-1, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	push
	.type	push, @function
push:
.LFB35:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	cmpl	$200001, %eax
	jg	.L3
	addl	$1, %eax
	movl	%eax, 200004(%rdi)
	cltq
	movb	%sil, (%rdi,%rax)
	xorl	%eax, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$-1, %eax
	ret
	.cfi_endproc
.LFE35:
	.size	push, .-push
	.p2align 4
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB36:
	.cfi_startproc
	endbr64
	movl	200004(%rdi), %eax
	testl	%eax, %eax
	je	.L6
	subl	$1, %eax
	movl	%eax, 200004(%rdi)
.L6:
	xorl	%eax, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	pop2, .-pop2
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	-397312(%rsp), %r11
	.cfi_def_cfa 11, 397344
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2720, %rsp
	.cfi_def_cfa_offset 400064
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	movq	%fs:40, %rax
	movq	%rax, 400024(%rsp)
	xorl	%eax, %eax
	leaq	200016(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%r12d, %rdx
	cmpb	$83, (%rsp,%rdx)
	je	.L20
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rdx
	movb	%al, (%rsp,%rdx)
.L13:
	addq	$1, %rbx
.L11:
	movq	%rbp, %rdi
	call	strlen@PLT
	cmpq	%rbx, %rax
	jbe	.L21
	movzbl	0(%rbp,%rbx), %eax
	cmpb	$83, %al
	jne	.L12
	cmpl	$200001, %r12d
	jg	.L13
	addl	$1, %r12d
	movslq	%r12d, %rax
	movb	$83, (%rsp,%rax)
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L20:
	cmpl	$1, %r12d
	adcl	$-1, %r12d
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L21:
	xorl	%eax, %eax
	movl	%r12d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	400024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L22
	addq	$400032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
.L22:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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:
```