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>
int main()
{
	char input[15],temp[15];
	scanf("%s",input);
	int len = strlen(input);
	int i = 0,j = 0;
	while(len--)
	{
		if(input[j] == 'B')
		{
			if(i > 0)
			{
				i--;
			}
			temp[i] = ' ';
			j++;
		}
		else{
			temp[i] = input[j];
			i++;
			j++;
		}
	}
	temp[i] = '\0';
	printf("%s\n",temp);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	10(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L58
	movzbl	10(%rsp), %ecx
	leal	-1(%rax), %edx
	cmpb	$66, %cl
	je	.L3
	movb	%cl, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L59
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L5
	movl	$1, %esi
.L6:
	movslq	%esi, %rdi
	leal	-1(%rcx), %eax
	movb	%dl, 25(%rsp,%rdi)
	leal	1(%rsi), %edx
	testl	%ecx, %ecx
	je	.L113
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L11
	movl	%edx, %esi
	movl	%eax, %edx
.L10:
	movslq	%esi, %rax
	movb	%cl, 25(%rsp,%rax)
	movl	%edx, %eax
	leal	1(%rsi), %edx
.L12:
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	je	.L113
	movzbl	13(%rsp), %eax
	cmpb	$66, %al
	je	.L15
.L14:
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L16:
	testl	%ecx, %ecx
	je	.L113
	movzbl	14(%rsp), %eax
	cmpb	$66, %al
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L19:
	cmpl	$1, %ecx
	je	.L113
	movzbl	15(%rsp), %eax
	cmpb	$66, %al
	je	.L22
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L23:
	cmpl	$2, %ecx
	je	.L113
	movzbl	16(%rsp), %eax
	cmpb	$66, %al
	je	.L26
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L27:
	cmpl	$3, %ecx
	je	.L113
	movzbl	17(%rsp), %eax
	cmpb	$66, %al
	je	.L30
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L31:
	cmpl	$4, %ecx
	je	.L113
	movzbl	18(%rsp), %eax
	cmpb	$66, %al
	je	.L34
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L35:
	cmpl	$5, %ecx
	je	.L113
	movzbl	19(%rsp), %eax
	cmpb	$66, %al
	je	.L38
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L39:
	cmpl	$6, %ecx
	je	.L113
	movzbl	20(%rsp), %eax
	cmpb	$66, %al
	je	.L42
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L43:
	cmpl	$7, %ecx
	je	.L113
	movzbl	21(%rsp), %eax
	cmpb	$66, %al
	je	.L46
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L47:
	cmpl	$8, %ecx
	je	.L113
	movzbl	22(%rsp), %eax
	cmpb	$66, %al
	je	.L50
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L51:
	cmpl	$9, %ecx
	je	.L113
	movzbl	23(%rsp), %eax
	cmpb	$66, %al
	je	.L117
	movslq	%edx, %rcx
	addl	$1, %edx
	movb	%al, 25(%rsp,%rcx)
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %rax
.L2:
	leaq	25(%rsp), %rdi
	movb	$0, 25(%rsp,%rax)
	call	puts@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movb	$32, 25(%rsp)
.L115:
	leal	-3(%rax), %edx
	testl	%ecx, %ecx
	je	.L58
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L9
	xorl	%esi, %esi
	jmp	.L10
.L3:
	movb	$32, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L115
	xorl	%esi, %esi
	jmp	.L6
.L42:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L43
.L9:
	movb	$32, 25(%rsp)
	leal	-1(%rdx), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	13(%rsp), %eax
	xorl	%edx, %edx
	cmpb	$66, %al
	jne	.L14
.L13:
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L16
.L18:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L19
.L15:
	cmpl	$1, %edx
	adcl	$-1, %edx
	jmp	.L13
.L58:
	xorl	%eax, %eax
	jmp	.L2
.L22:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L23
.L26:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L27
.L11:
	movb	$32, 25(%rsp,%rdi)
	movl	%esi, %edx
	jmp	.L12
.L30:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L31
.L34:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L35
.L38:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L39
.L46:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L47
.L50:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L51
.L117:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L2
.L59:
	movl	$1, %eax
	jmp	.L2
.L118:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	10(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L58
	movzbl	10(%rsp), %ecx
	leal	-1(%rax), %edx
	cmpb	$66, %cl
	je	.L3
	movb	%cl, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L59
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L5
	movl	$1, %esi
.L6:
	movslq	%esi, %rdi
	leal	-1(%rcx), %eax
	movb	%dl, 25(%rsp,%rdi)
	leal	1(%rsi), %edx
	testl	%ecx, %ecx
	je	.L113
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L11
	movl	%edx, %esi
	movl	%eax, %edx
.L10:
	movslq	%esi, %rax
	movb	%cl, 25(%rsp,%rax)
	movl	%edx, %eax
	leal	1(%rsi), %edx
.L12:
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	je	.L113
	movzbl	13(%rsp), %eax
	cmpb	$66, %al
	je	.L15
.L14:
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L16:
	testl	%ecx, %ecx
	je	.L113
	movzbl	14(%rsp), %eax
	cmpb	$66, %al
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L19:
	cmpl	$1, %ecx
	je	.L113
	movzbl	15(%rsp), %eax
	cmpb	$66, %al
	je	.L22
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L23:
	cmpl	$2, %ecx
	je	.L113
	movzbl	16(%rsp), %eax
	cmpb	$66, %al
	je	.L26
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L27:
	cmpl	$3, %ecx
	je	.L113
	movzbl	17(%rsp), %eax
	cmpb	$66, %al
	je	.L30
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L31:
	cmpl	$4, %ecx
	je	.L113
	movzbl	18(%rsp), %eax
	cmpb	$66, %al
	je	.L34
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L35:
	cmpl	$5, %ecx
	je	.L113
	movzbl	19(%rsp), %eax
	cmpb	$66, %al
	je	.L38
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L39:
	cmpl	$6, %ecx
	je	.L113
	movzbl	20(%rsp), %eax
	cmpb	$66, %al
	je	.L42
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L43:
	cmpl	$7, %ecx
	je	.L113
	movzbl	21(%rsp), %eax
	cmpb	$66, %al
	je	.L46
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L47:
	cmpl	$8, %ecx
	je	.L113
	movzbl	22(%rsp), %eax
	cmpb	$66, %al
	je	.L50
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L51:
	cmpl	$9, %ecx
	je	.L113
	movzbl	23(%rsp), %eax
	cmpb	$66, %al
	je	.L117
	movslq	%edx, %rcx
	addl	$1, %edx
	movb	%al, 25(%rsp,%rcx)
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %rax
.L2:
	leaq	25(%rsp), %rdi
	movb	$0, 25(%rsp,%rax)
	call	puts@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movb	$32, 25(%rsp)
.L115:
	leal	-3(%rax), %edx
	testl	%ecx, %ecx
	je	.L58
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L9
	xorl	%esi, %esi
	jmp	.L10
.L3:
	movb	$32, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L115
	xorl	%esi, %esi
	jmp	.L6
.L42:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L43
.L9:
	movb	$32, 25(%rsp)
	leal	-1(%rdx), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	13(%rsp), %eax
	xorl	%edx, %edx
	cmpb	$66, %al
	jne	.L14
.L13:
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L16
.L18:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L19
.L15:
	cmpl	$1, %edx
	adcl	$-1, %edx
	jmp	.L13
.L58:
	xorl	%eax, %eax
	jmp	.L2
.L22:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L23
.L26:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L27
.L11:
	movb	$32, 25(%rsp,%rdi)
	movl	%esi, %edx
	jmp	.L12
.L30:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L31
.L34:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L35
.L38:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L39
.L46:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L47
.L50:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L51
.L117:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L2
.L59:
	movl	$1, %eax
	jmp	.L2
.L118:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	10(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L58
	movzbl	10(%rsp), %ecx
	leal	-1(%rax), %edx
	cmpb	$66, %cl
	je	.L3
	movb	%cl, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L59
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L5
	movl	$1, %esi
.L6:
	movslq	%esi, %rdi
	leal	-1(%rcx), %eax
	movb	%dl, 25(%rsp,%rdi)
	leal	1(%rsi), %edx
	testl	%ecx, %ecx
	je	.L113
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L11
	movl	%edx, %esi
	movl	%eax, %edx
.L10:
	movslq	%esi, %rax
	movb	%cl, 25(%rsp,%rax)
	movl	%edx, %eax
	leal	1(%rsi), %edx
.L12:
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	je	.L113
	movzbl	13(%rsp), %eax
	cmpb	$66, %al
	je	.L15
.L14:
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L16:
	testl	%ecx, %ecx
	je	.L113
	movzbl	14(%rsp), %eax
	cmpb	$66, %al
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L19:
	cmpl	$1, %ecx
	je	.L113
	movzbl	15(%rsp), %eax
	cmpb	$66, %al
	je	.L22
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L23:
	cmpl	$2, %ecx
	je	.L113
	movzbl	16(%rsp), %eax
	cmpb	$66, %al
	je	.L26
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L27:
	cmpl	$3, %ecx
	je	.L113
	movzbl	17(%rsp), %eax
	cmpb	$66, %al
	je	.L30
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L31:
	cmpl	$4, %ecx
	je	.L113
	movzbl	18(%rsp), %eax
	cmpb	$66, %al
	je	.L34
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L35:
	cmpl	$5, %ecx
	je	.L113
	movzbl	19(%rsp), %eax
	cmpb	$66, %al
	je	.L38
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L39:
	cmpl	$6, %ecx
	je	.L113
	movzbl	20(%rsp), %eax
	cmpb	$66, %al
	je	.L42
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L43:
	cmpl	$7, %ecx
	je	.L113
	movzbl	21(%rsp), %eax
	cmpb	$66, %al
	je	.L46
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L47:
	cmpl	$8, %ecx
	je	.L113
	movzbl	22(%rsp), %eax
	cmpb	$66, %al
	je	.L50
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L51:
	cmpl	$9, %ecx
	je	.L113
	movzbl	23(%rsp), %eax
	cmpb	$66, %al
	je	.L117
	movslq	%edx, %rcx
	addl	$1, %edx
	movb	%al, 25(%rsp,%rcx)
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %rax
.L2:
	leaq	25(%rsp), %rdi
	movb	$0, 25(%rsp,%rax)
	call	puts@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movb	$32, 25(%rsp)
.L115:
	leal	-3(%rax), %edx
	testl	%ecx, %ecx
	je	.L58
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L9
	xorl	%esi, %esi
	jmp	.L10
.L3:
	movb	$32, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L115
	xorl	%esi, %esi
	jmp	.L6
.L42:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L43
.L9:
	movb	$32, 25(%rsp)
	leal	-1(%rdx), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	13(%rsp), %eax
	xorl	%edx, %edx
	cmpb	$66, %al
	jne	.L14
.L13:
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L16
.L18:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L19
.L15:
	cmpl	$1, %edx
	adcl	$-1, %edx
	jmp	.L13
.L58:
	xorl	%eax, %eax
	jmp	.L2
.L22:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L23
.L26:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L27
.L11:
	movb	$32, 25(%rsp,%rdi)
	movl	%esi, %edx
	jmp	.L12
.L30:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L31
.L34:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L35
.L38:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L39
.L46:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L47
.L50:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L51
.L117:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L2
.L59:
	movl	$1, %eax
	jmp	.L2
.L118:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>
int main()
{
	char input[15],temp[15];
	scanf("%s",input);
	int len = strlen(input);
	int i = 0,j = 0;
	while(len--)
	{
		if(input[j] == 'B')
		{
			if(i > 0)
			{
				i--;
			}
			temp[i] = ' ';
			j++;
		}
		else{
			temp[i] = input[j];
			i++;
			j++;
		}
	}
	temp[i] = '\0';
	printf("%s\n",temp);
	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>
int main()
{
	char input[15],temp[15];
	scanf("%s",input);
	int len = strlen(input);
	int i = 0,j = 0;
	while(len--)
	{
		if(input[j] == 'B')
		{
			if(i > 0)
			{
				i--;
			}
			temp[i] = ' ';
			j++;
		}
		else{
			temp[i] = input[j];
			i++;
			j++;
		}
	}
	temp[i] = '\0';
	printf("%s\n",temp);
	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:

01B1
 BB11
 B01B
 02B0
 /BB1
 1B10
 B010
 B110
 B011
 B101

01
 11
 0
 00
 1
 10
 010
 110
 011
 101

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>
int main()
{
	char input[15],temp[15];
	scanf("%s",input);
	int len = strlen(input);
	int i = 0,j = 0;
	while(len--)
	{
		if(input[j] == 'B')
		{
			if(i > 0)
			{
				i--;
			}
			temp[i] = ' ';
			j++;
		}
		else{
			temp[i] = input[j];
			i++;
			j++;
		}
	}
	temp[i] = '\0';
	printf("%s\n",temp);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	10(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L58
	movzbl	10(%rsp), %ecx
	leal	-1(%rax), %edx
	cmpb	$66, %cl
	je	.L3
	movb	%cl, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L59
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L5
	movl	$1, %esi
.L6:
	movslq	%esi, %rdi
	leal	-1(%rcx), %eax
	movb	%dl, 25(%rsp,%rdi)
	leal	1(%rsi), %edx
	testl	%ecx, %ecx
	je	.L113
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L11
	movl	%edx, %esi
	movl	%eax, %edx
.L10:
	movslq	%esi, %rax
	movb	%cl, 25(%rsp,%rax)
	movl	%edx, %eax
	leal	1(%rsi), %edx
.L12:
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	je	.L113
	movzbl	13(%rsp), %eax
	cmpb	$66, %al
	je	.L15
.L14:
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L16:
	testl	%ecx, %ecx
	je	.L113
	movzbl	14(%rsp), %eax
	cmpb	$66, %al
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L19:
	cmpl	$1, %ecx
	je	.L113
	movzbl	15(%rsp), %eax
	cmpb	$66, %al
	je	.L22
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L23:
	cmpl	$2, %ecx
	je	.L113
	movzbl	16(%rsp), %eax
	cmpb	$66, %al
	je	.L26
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L27:
	cmpl	$3, %ecx
	je	.L113
	movzbl	17(%rsp), %eax
	cmpb	$66, %al
	je	.L30
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L31:
	cmpl	$4, %ecx
	je	.L113
	movzbl	18(%rsp), %eax
	cmpb	$66, %al
	je	.L34
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L35:
	cmpl	$5, %ecx
	je	.L113
	movzbl	19(%rsp), %eax
	cmpb	$66, %al
	je	.L38
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L39:
	cmpl	$6, %ecx
	je	.L113
	movzbl	20(%rsp), %eax
	cmpb	$66, %al
	je	.L42
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L43:
	cmpl	$7, %ecx
	je	.L113
	movzbl	21(%rsp), %eax
	cmpb	$66, %al
	je	.L46
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L47:
	cmpl	$8, %ecx
	je	.L113
	movzbl	22(%rsp), %eax
	cmpb	$66, %al
	je	.L50
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L51:
	cmpl	$9, %ecx
	je	.L113
	movzbl	23(%rsp), %eax
	cmpb	$66, %al
	je	.L117
	movslq	%edx, %rcx
	addl	$1, %edx
	movb	%al, 25(%rsp,%rcx)
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %rax
.L2:
	leaq	25(%rsp), %rdi
	movb	$0, 25(%rsp,%rax)
	call	puts@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movb	$32, 25(%rsp)
.L115:
	leal	-3(%rax), %edx
	testl	%ecx, %ecx
	je	.L58
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L9
	xorl	%esi, %esi
	jmp	.L10
.L3:
	movb	$32, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L115
	xorl	%esi, %esi
	jmp	.L6
.L42:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L43
.L9:
	movb	$32, 25(%rsp)
	leal	-1(%rdx), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	13(%rsp), %eax
	xorl	%edx, %edx
	cmpb	$66, %al
	jne	.L14
.L13:
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L16
.L18:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L19
.L15:
	cmpl	$1, %edx
	adcl	$-1, %edx
	jmp	.L13
.L58:
	xorl	%eax, %eax
	jmp	.L2
.L22:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L23
.L26:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L27
.L11:
	movb	$32, 25(%rsp,%rdi)
	movl	%esi, %edx
	jmp	.L12
.L30:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L31
.L34:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L35
.L38:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L39
.L46:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L47
.L50:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L51
.L117:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L2
.L59:
	movl	$1, %eax
	jmp	.L2
.L118:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	subq	$48, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	10(%rsp), %rbp
	movq	%rbp, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L58
	movzbl	10(%rsp), %ecx
	leal	-1(%rax), %edx
	cmpb	$66, %cl
	je	.L3
	movb	%cl, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L59
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L5
	movl	$1, %esi
.L6:
	movslq	%esi, %rdi
	leal	-1(%rcx), %eax
	movb	%dl, 25(%rsp,%rdi)
	leal	1(%rsi), %edx
	testl	%ecx, %ecx
	je	.L113
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L11
	movl	%edx, %esi
	movl	%eax, %edx
.L10:
	movslq	%esi, %rax
	movb	%cl, 25(%rsp,%rax)
	movl	%edx, %eax
	leal	1(%rsi), %edx
.L12:
	leal	-1(%rax), %ecx
	testl	%eax, %eax
	je	.L113
	movzbl	13(%rsp), %eax
	cmpb	$66, %al
	je	.L15
.L14:
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L16:
	testl	%ecx, %ecx
	je	.L113
	movzbl	14(%rsp), %eax
	cmpb	$66, %al
	je	.L18
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L19:
	cmpl	$1, %ecx
	je	.L113
	movzbl	15(%rsp), %eax
	cmpb	$66, %al
	je	.L22
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L23:
	cmpl	$2, %ecx
	je	.L113
	movzbl	16(%rsp), %eax
	cmpb	$66, %al
	je	.L26
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L27:
	cmpl	$3, %ecx
	je	.L113
	movzbl	17(%rsp), %eax
	cmpb	$66, %al
	je	.L30
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L31:
	cmpl	$4, %ecx
	je	.L113
	movzbl	18(%rsp), %eax
	cmpb	$66, %al
	je	.L34
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L35:
	cmpl	$5, %ecx
	je	.L113
	movzbl	19(%rsp), %eax
	cmpb	$66, %al
	je	.L38
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L39:
	cmpl	$6, %ecx
	je	.L113
	movzbl	20(%rsp), %eax
	cmpb	$66, %al
	je	.L42
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L43:
	cmpl	$7, %ecx
	je	.L113
	movzbl	21(%rsp), %eax
	cmpb	$66, %al
	je	.L46
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L47:
	cmpl	$8, %ecx
	je	.L113
	movzbl	22(%rsp), %eax
	cmpb	$66, %al
	je	.L50
	movslq	%edx, %rsi
	addl	$1, %edx
	movb	%al, 25(%rsp,%rsi)
.L51:
	cmpl	$9, %ecx
	je	.L113
	movzbl	23(%rsp), %eax
	cmpb	$66, %al
	je	.L117
	movslq	%edx, %rcx
	addl	$1, %edx
	movb	%al, 25(%rsp,%rcx)
	.p2align 4,,10
	.p2align 3
.L113:
	movslq	%edx, %rax
.L2:
	leaq	25(%rsp), %rdi
	movb	$0, 25(%rsp,%rax)
	call	puts@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L118
	addq	$48, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L5:
	.cfi_restore_state
	movb	$32, 25(%rsp)
.L115:
	leal	-3(%rax), %edx
	testl	%ecx, %ecx
	je	.L58
	movzbl	12(%rsp), %ecx
	cmpb	$66, %cl
	je	.L9
	xorl	%esi, %esi
	jmp	.L10
.L3:
	movb	$32, 25(%rsp)
	leal	-2(%rax), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	11(%rsp), %edx
	cmpb	$66, %dl
	je	.L115
	xorl	%esi, %esi
	jmp	.L6
.L42:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L43
.L9:
	movb	$32, 25(%rsp)
	leal	-1(%rdx), %ecx
	testl	%edx, %edx
	je	.L58
	movzbl	13(%rsp), %eax
	xorl	%edx, %edx
	cmpb	$66, %al
	jne	.L14
.L13:
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L16
.L18:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L19
.L15:
	cmpl	$1, %edx
	adcl	$-1, %edx
	jmp	.L13
.L58:
	xorl	%eax, %eax
	jmp	.L2
.L22:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L23
.L26:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L27
.L11:
	movb	$32, 25(%rsp,%rdi)
	movl	%esi, %edx
	jmp	.L12
.L30:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L31
.L34:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L35
.L38:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L39
.L46:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L47
.L50:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L51
.L117:
	cmpl	$1, %edx
	adcl	$-1, %edx
	movslq	%edx, %rax
	movb	$32, 25(%rsp,%rax)
	jmp	.L2
.L59:
	movl	$1, %eax
	jmp	.L2
.L118:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
```