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 <math.h>
 
int main(){
  int N;
  int count = 0;
  int i,j;
  char tmp;
  
  scanf("%d",&N);
  char G[N+1];
  scanf("%s",G);
  
  i = 0;
  j = N-1;
  do{
    if(G[i] == 'W' && G[j] == 'R'){
      tmp = G[i];
      G[i] = G[j];
      G[j] = tmp;
      count++;
    }
    
    while(G[i] != 'W' && i<N) i++;
    while(G[j] != 'R' && j > 0) j--;
  }while(i<j);
  printf("%d\n",count);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L33:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L33
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L34
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %r9d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	leal	-1(%r9), %r8d
	movslq	%r8d, %rax
	movzbl	(%rsp,%rax), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edi, %rcx
	cmpb	$82, %dl
	movzbl	(%rbx,%rcx), %eax
	setne	%r11b
	cmpb	$87, %al
	je	.L35
.L7:
	cmpl	%edi, %r9d
	jle	.L6
	cmpb	$87, %al
	je	.L6
	leal	1(%rdi), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %edi
	setne	%sil
	cmpl	%eax, %r9d
	setg	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L8
.L6:
	testl	%r8d, %r8d
	jle	.L11
	testb	%r11b, %r11b
	je	.L11
	leal	-1(%r8), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	(%rbx,%rax), %edx
	movl	%eax, %r8d
	cmpb	$82, %dl
	setne	%sil
	testl	%eax, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %sil
	jne	.L12
.L11:
	cmpl	%r8d, %edi
	jl	.L13
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	$1, %r11d
	cmpb	$82, %dl
	jne	.L6
	movslq	%r8d, %rax
	movb	$82, (%rbx,%rcx)
	addl	$1, %r10d
	movl	$87, %edx
	movb	$87, (%rbx,%rax)
	movzbl	(%rbx,%rcx), %eax
	jmp	.L7
.L34:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L33:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L33
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L34
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %r9d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	leal	-1(%r9), %r8d
	movslq	%r8d, %rax
	movzbl	(%rsp,%rax), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edi, %rcx
	cmpb	$82, %dl
	movzbl	(%rbx,%rcx), %eax
	setne	%r11b
	cmpb	$87, %al
	je	.L35
.L7:
	cmpl	%edi, %r9d
	jle	.L6
	cmpb	$87, %al
	je	.L6
	leal	1(%rdi), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %edi
	setne	%sil
	cmpl	%eax, %r9d
	setg	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L8
.L6:
	testl	%r8d, %r8d
	jle	.L11
	testb	%r11b, %r11b
	je	.L11
	leal	-1(%r8), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	(%rbx,%rax), %edx
	movl	%eax, %r8d
	cmpb	$82, %dl
	setne	%sil
	testl	%eax, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %sil
	jne	.L12
.L11:
	cmpl	%r8d, %edi
	jl	.L13
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	$1, %r11d
	cmpb	$82, %dl
	jne	.L6
	movslq	%r8d, %rax
	movb	$82, (%rbx,%rcx)
	addl	$1, %r10d
	movl	$87, %edx
	movb	$87, (%rbx,%rax)
	movzbl	(%rbx,%rcx), %eax
	jmp	.L7
.L34:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L33:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L33
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L34
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %r9d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	leal	-1(%r9), %r8d
	movslq	%r8d, %rax
	movzbl	(%rsp,%rax), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edi, %rcx
	cmpb	$82, %dl
	movzbl	(%rbx,%rcx), %eax
	setne	%r11b
	cmpb	$87, %al
	je	.L35
.L7:
	cmpl	%edi, %r9d
	jle	.L6
	cmpb	$87, %al
	je	.L6
	leal	1(%rdi), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %edi
	setne	%sil
	cmpl	%eax, %r9d
	setg	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L8
.L6:
	testl	%r8d, %r8d
	jle	.L11
	testb	%r11b, %r11b
	je	.L11
	leal	-1(%r8), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	(%rbx,%rax), %edx
	movl	%eax, %r8d
	cmpb	$82, %dl
	setne	%sil
	testl	%eax, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %sil
	jne	.L12
.L11:
	cmpl	%r8d, %edi
	jl	.L13
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	$1, %r11d
	cmpb	$82, %dl
	jne	.L6
	movslq	%r8d, %rax
	movb	$82, (%rbx,%rcx)
	addl	$1, %r10d
	movl	$87, %edx
	movb	$87, (%rbx,%rax)
	movzbl	(%rbx,%rcx), %eax
	jmp	.L7
.L34:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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 <math.h>
 
int main(){
  int N;
  int count = 0;
  int i,j;
  char tmp;
  
  scanf("%d",&N);
  char G[N+1];
  scanf("%s",G);
  
  i = 0;
  j = N-1;
  do{
    if(G[i] == 'W' && G[j] == 'R'){
      tmp = G[i];
      G[i] = G[j];
      G[j] = tmp;
      count++;
    }
    
    while(G[i] != 'W' && i<N) i++;
    while(G[j] != 'R' && j > 0) j--;
  }while(i<j);
  printf("%d\n",count);
  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 <math.h>
 
int main(){
  int N;
  int count = 0;
  int i,j;
  char tmp;
  
  scanf("%d",&N);
  char G[N+1];
  scanf("%s",G);
  
  i = 0;
  j = N-1;
  do{
    if(G[i] == 'W' && G[j] == 'R'){
      tmp = G[i];
      G[i] = G[j];
      G[j] = tmp;
      count++;
    }
    
    while(G[i] != 'W' && i<N) i++;
    while(G[j] != 'R' && j > 0) j--;
  }while(i<j);
  printf("%d\n",count);
  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:

8
RRWRWWRW
 2
RQ
 8
RRWWWRRW
 8
WRWWWRRR
 8
WWWWRRRR
 8
RRWRVWRW
 4
RRWW
 4
RWWR
 2
RS
 4
RRVW

1
 0
 2
 3
 4
 1
 0
 1
 0
 0

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 <math.h>
 
int main(){
  int N;
  int count = 0;
  int i,j;
  char tmp;
  
  scanf("%d",&N);
  char G[N+1];
  scanf("%s",G);
  
  i = 0;
  j = N-1;
  do{
    if(G[i] == 'W' && G[j] == 'R'){
      tmp = G[i];
      G[i] = G[j];
      G[j] = tmp;
      count++;
    }
    
    while(G[i] != 'W' && i<N) i++;
    while(G[j] != 'R' && j > 0) j--;
  }while(i<j);
  printf("%d\n",count);
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L33:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L33
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L34
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %r9d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	leal	-1(%r9), %r8d
	movslq	%r8d, %rax
	movzbl	(%rsp,%rax), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edi, %rcx
	cmpb	$82, %dl
	movzbl	(%rbx,%rcx), %eax
	setne	%r11b
	cmpb	$87, %al
	je	.L35
.L7:
	cmpl	%edi, %r9d
	jle	.L6
	cmpb	$87, %al
	je	.L6
	leal	1(%rdi), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %edi
	setne	%sil
	cmpl	%eax, %r9d
	setg	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L8
.L6:
	testl	%r8d, %r8d
	jle	.L11
	testb	%r11b, %r11b
	je	.L11
	leal	-1(%r8), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	(%rbx,%rax), %edx
	movl	%eax, %r8d
	cmpb	$82, %dl
	setne	%sil
	testl	%eax, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %sil
	jne	.L12
.L11:
	cmpl	%r8d, %edi
	jl	.L13
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	$1, %r11d
	cmpb	$82, %dl
	jne	.L6
	movslq	%r8d, %rax
	movb	$82, (%rbx,%rcx)
	addl	$1, %r10d
	movl	$87, %edx
	movb	$87, (%rbx,%rax)
	movzbl	(%rbx,%rcx), %eax
	jmp	.L7
.L34:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	leaq	-28(%rbp), %rsi
	subq	$24, %rsp
	.cfi_offset 3, -24
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movq	%rsp, %rcx
	addl	$1, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L33:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L33
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L34
.L4:
	leaq	.LC1(%rip), %rdi
	movq	%rsp, %rsi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %r9d
	xorl	%edi, %edi
	xorl	%r10d, %r10d
	leal	-1(%r9), %r8d
	movslq	%r8d, %rax
	movzbl	(%rsp,%rax), %edx
	.p2align 4,,10
	.p2align 3
.L13:
	movslq	%edi, %rcx
	cmpb	$82, %dl
	movzbl	(%rbx,%rcx), %eax
	setne	%r11b
	cmpb	$87, %al
	je	.L35
.L7:
	cmpl	%edi, %r9d
	jle	.L6
	cmpb	$87, %al
	je	.L6
	leal	1(%rdi), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L8:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %edi
	setne	%sil
	cmpl	%eax, %r9d
	setg	%cl
	addq	$1, %rax
	testb	%cl, %sil
	jne	.L8
.L6:
	testl	%r8d, %r8d
	jle	.L11
	testb	%r11b, %r11b
	je	.L11
	leal	-1(%r8), %eax
	cltq
	.p2align 4,,10
	.p2align 3
.L12:
	movzbl	(%rbx,%rax), %edx
	movl	%eax, %r8d
	cmpb	$82, %dl
	setne	%sil
	testl	%eax, %eax
	setg	%cl
	subq	$1, %rax
	testb	%cl, %sil
	jne	.L12
.L11:
	cmpl	%r8d, %edi
	jl	.L13
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L36
	movq	-8(%rbp), %rbx
	xorl	%eax, %eax
	leave
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L35:
	.cfi_restore_state
	movl	$1, %r11d
	cmpb	$82, %dl
	jne	.L6
	movslq	%r8d, %rax
	movb	$82, (%rbx,%rcx)
	addl	$1, %r10d
	movl	$87, %edx
	movb	$87, (%rbx,%rax)
	movzbl	(%rbx,%rcx), %eax
	jmp	.L7
.L34:
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L36:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:
```