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>
#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;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	push
	.type	push, @function
push:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, %eax
	movb	%al, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	cmpl	$200001, %eax
	jg	.L2
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 200004(%rax)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	movq	-8(%rbp), %rdx
	cltq
	movzbl	-12(%rbp), %ecx
	movb	%cl, (%rdx,%rax)
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$-1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	push, .-push
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	testl	%eax, %eax
	je	.L5
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 200004(%rax)
.L5:
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pop2, .-pop2
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -200044(%rbp)
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400052(%rbp)
	jmp	.L8
.L12:
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L9
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	movsbl	%al, %edx
	leaq	-400048(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	jmp	.L10
.L9:
	movl	-200044(%rbp), %eax
	cltq
	movzbl	-400048(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L11
	leaq	-400048(%rbp), %rax
	movq	%rax, %rdi
	call	pop2
	jmp	.L10
.L11:
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	movsbl	%al, %edx
	leaq	-400048(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
.L10:
	addl	$1, -400052(%rbp)
.L8:
	movl	-400052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-200032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L12
	movl	-200044(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	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
	.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:

#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;
}

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 unoptimized 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;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	push
	.type	push, @function
push:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, %eax
	movb	%al, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	cmpl	$200001, %eax
	jg	.L2
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 200004(%rax)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	movq	-8(%rbp), %rdx
	cltq
	movzbl	-12(%rbp), %ecx
	movb	%cl, (%rdx,%rax)
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$-1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	push, .-push
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	testl	%eax, %eax
	je	.L5
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 200004(%rax)
.L5:
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pop2, .-pop2
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -200044(%rbp)
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400052(%rbp)
	jmp	.L8
.L12:
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L9
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	movsbl	%al, %edx
	leaq	-400048(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	jmp	.L10
.L9:
	movl	-200044(%rbp), %eax
	cltq
	movzbl	-400048(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L11
	leaq	-400048(%rbp), %rax
	movq	%rax, %rdi
	call	pop2
	jmp	.L10
.L11:
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	movsbl	%al, %edx
	leaq	-400048(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
.L10:
	addl	$1, -400052(%rbp)
.L8:
	movl	-400052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-200032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L12
	movl	-200044(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	push
	.type	push, @function
push:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movl	%esi, %eax
	movb	%al, -12(%rbp)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	cmpl	$200001, %eax
	jg	.L2
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	leal	1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 200004(%rax)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	movq	-8(%rbp), %rdx
	cltq
	movzbl	-12(%rbp), %ecx
	movb	%cl, (%rdx,%rax)
	movl	$0, %eax
	jmp	.L3
.L2:
	movl	$-1, %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	push, .-push
	.globl	pop2
	.type	pop2, @function
pop2:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	testl	%eax, %eax
	je	.L5
	movq	-8(%rbp), %rax
	movl	200004(%rax), %eax
	leal	-1(%rax), %edx
	movq	-8(%rbp), %rax
	movl	%edx, 200004(%rax)
.L5:
	movl	$0, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	pop2, .-pop2
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.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
	leaq	-397312(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2744, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	movl	$0, -200044(%rbp)
	leaq	-200032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -400052(%rbp)
	jmp	.L8
.L12:
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L9
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	movsbl	%al, %edx
	leaq	-400048(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
	jmp	.L10
.L9:
	movl	-200044(%rbp), %eax
	cltq
	movzbl	-400048(%rbp,%rax), %eax
	cmpb	$83, %al
	jne	.L11
	leaq	-400048(%rbp), %rax
	movq	%rax, %rdi
	call	pop2
	jmp	.L10
.L11:
	movl	-400052(%rbp), %eax
	cltq
	movzbl	-200032(%rbp,%rax), %eax
	movsbl	%al, %edx
	leaq	-400048(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	push
.L10:
	addl	$1, -400052(%rbp)
.L8:
	movl	-400052(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-200032(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L12
	movl	-200044(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
