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>
#include<math.h>
#include<stdlib.h>
#include<ctype.h>

//qsort
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

//比較
int max(int a, int b){
	if (a>b) return a;
	else return b;
}

int min(int a,int b) {
	if(a>b) return b;
	else return a;
}


//main関数
int main() {
	int N;
	scanf("%d",&N);
	char sakoda[N+100];
		scanf("%s",sakoda);
	
	int answer = 0;
	int count = 0;
	for(int i=N-1; i >= 1; i-- ){
		if(sakoda[i] == 'R'){
			int flag = 0;
			for(int j=count; j<i ; j++ ){
				if(sakoda[j] == 'W' ){
					sakoda[j] = 'R';
					sakoda[i] = 'W';
					count = j;
					answer++;
					flag = 1;
					break;
				}
			}
			if(flag == 0){
				printf("%d",answer);
				return 0;
			}
		}
	}
	printf("%d",answer);
}


```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB6:
	.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.globl	max
	.type	max, @function
max:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L4
	movl	-4(%rbp), %eax
	jmp	.L5
.L4:
	movl	-8(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L7
	movl	-8(%rbp), %eax
	jmp	.L8
.L7:
	movl	-4(%rbp), %eax
.L8:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	addl	$100, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -92(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L13
.L20:
	movq	-64(%rbp), %rdx
	movl	-84(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$82, %al
	jne	.L14
	movl	$0, -80(%rbp)
	movl	-88(%rbp), %eax
	movl	%eax, -76(%rbp)
	jmp	.L15
.L18:
	movq	-64(%rbp), %rdx
	movl	-76(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L16
	movq	-64(%rbp), %rdx
	movl	-76(%rbp), %eax
	cltq
	movb	$82, (%rdx,%rax)
	movq	-64(%rbp), %rdx
	movl	-84(%rbp), %eax
	cltq
	movb	$87, (%rdx,%rax)
	movl	-76(%rbp), %eax
	movl	%eax, -88(%rbp)
	addl	$1, -92(%rbp)
	movl	$1, -80(%rbp)
	jmp	.L17
.L16:
	addl	$1, -76(%rbp)
.L15:
	movl	-76(%rbp), %eax
	cmpl	-84(%rbp), %eax
	jl	.L18
.L17:
	cmpl	$0, -80(%rbp)
	jne	.L14
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	jmp	.L19
.L14:
	subl	$1, -84(%rbp)
.L13:
	cmpl	$0, -84(%rbp)
	jg	.L20
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	movl	$0, %eax
.L19:
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	compare_int
	.type	compare_int, @function
compare_int:
.LFB53:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	compare_int, .-compare_int
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB54:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	movq	%rsp, %rcx
	addl	$100, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L7
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L24
.L7:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L8:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	testl	%edx, %edx
	jle	.L17
	movslq	%edx, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	subq	$1, %rdx
	testl	%edx, %edx
	jle	.L9
.L15:
	cmpb	$82, (%rbx,%rdx)
	jne	.L10
	movl	%edx, %esi
	cmpl	%edx, %ecx
	jge	.L9
	movslq	%ecx, %rax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rax
	cmpl	%eax, %esi
	jle	.L9
.L13:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %ecx
	jne	.L12
	cltq
	addl	$1, %r8d
	movb	$82, (%rbx,%rax)
	movb	$87, (%rbx,%rdx)
	subq	$1, %rdx
	testl	%edx, %edx
	jg	.L15
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rsp
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-24(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L8
.L17:
	xorl	%r8d, %r8d
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE56:
	.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	compare_int
	.type	compare_int, @function
compare_int:
.LFB53:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE53:
	.size	compare_int, .-compare_int
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB54:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE54:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB55:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE55:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB56:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	leaq	-44(%rbp), %rsi
	movq	%r13, %rdi
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 12, -32
	.cfi_offset 3, -40
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %r12
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	movq	%rsp, %rcx
	addl	$100, %eax
	cltq
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L7
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L24
.L7:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L8:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %rbx
	call	__isoc99_scanf@PLT
	movl	-44(%rbp), %eax
	leal	-1(%rax), %edx
	testl	%edx, %edx
	jle	.L17
	movslq	%edx, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L10:
	subq	$1, %rdx
	testl	%edx, %edx
	jle	.L9
.L15:
	cmpb	$82, (%rbx,%rdx)
	jne	.L10
	movl	%edx, %esi
	cmpl	%edx, %ecx
	jge	.L9
	movslq	%ecx, %rax
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$1, %rax
	cmpl	%eax, %esi
	jle	.L9
.L13:
	cmpb	$87, (%rbx,%rax)
	movl	%eax, %ecx
	jne	.L12
	cltq
	addl	$1, %r8d
	movb	$82, (%rbx,%rax)
	movb	$87, (%rbx,%rdx)
	subq	$1, %rdx
	testl	%edx, %edx
	jg	.L15
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%r8d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	%r12, %rsp
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-24(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L8
.L17:
	xorl	%r8d, %r8d
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE56:
	.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>
#include<math.h>
#include<stdlib.h>
#include<ctype.h>

//qsort
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

//比較
int max(int a, int b){
	if (a>b) return a;
	else return b;
}

int min(int a,int b) {
	if(a>b) return b;
	else return a;
}


//main関数
int main() {
	int N;
	scanf("%d",&N);
	char sakoda[N+100];
		scanf("%s",sakoda);
	
	int answer = 0;
	int count = 0;
	for(int i=N-1; i >= 1; i-- ){
		if(sakoda[i] == 'R'){
			int flag = 0;
			for(int j=count; j<i ; j++ ){
				if(sakoda[j] == 'W' ){
					sakoda[j] = 'R';
					sakoda[i] = 'W';
					count = j;
					answer++;
					flag = 1;
					break;
				}
			}
			if(flag == 0){
				printf("%d",answer);
				return 0;
			}
		}
	}
	printf("%d",answer);
}



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

```c
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<ctype.h>

//qsort
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

//比較
int max(int a, int b){
	if (a>b) return a;
	else return b;
}

int min(int a,int b) {
	if(a>b) return b;
	else return a;
}


//main関数
int main() {
	int N;
	scanf("%d",&N);
	char sakoda[N+100];
		scanf("%s",sakoda);
	
	int answer = 0;
	int count = 0;
	for(int i=N-1; i >= 1; i-- ){
		if(sakoda[i] == 'R'){
			int flag = 0;
			for(int j=count; j<i ; j++ ){
				if(sakoda[j] == 'W' ){
					sakoda[j] = 'R';
					sakoda[i] = 'W';
					count = j;
					answer++;
					flag = 1;
					break;
				}
			}
			if(flag == 0){
				printf("%d",answer);
				return 0;
			}
		}
	}
	printf("%d",answer);
}


```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare_int
	.type	compare_int, @function
compare_int:
.LFB6:
	.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.globl	max
	.type	max, @function
max:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L4
	movl	-4(%rbp), %eax
	jmp	.L5
.L4:
	movl	-8(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L7
	movl	-8(%rbp), %eax
	jmp	.L8
.L7:
	movl	-4(%rbp), %eax
.L8:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	addl	$100, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -92(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L13
.L20:
	movq	-64(%rbp), %rdx
	movl	-84(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$82, %al
	jne	.L14
	movl	$0, -80(%rbp)
	movl	-88(%rbp), %eax
	movl	%eax, -76(%rbp)
	jmp	.L15
.L18:
	movq	-64(%rbp), %rdx
	movl	-76(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L16
	movq	-64(%rbp), %rdx
	movl	-76(%rbp), %eax
	cltq
	movb	$82, (%rdx,%rax)
	movq	-64(%rbp), %rdx
	movl	-84(%rbp), %eax
	cltq
	movb	$87, (%rdx,%rax)
	movl	-76(%rbp), %eax
	movl	%eax, -88(%rbp)
	addl	$1, -92(%rbp)
	movl	$1, -80(%rbp)
	jmp	.L17
.L16:
	addl	$1, -76(%rbp)
.L15:
	movl	-76(%rbp), %eax
	cmpl	-84(%rbp), %eax
	jl	.L18
.L17:
	cmpl	$0, -80(%rbp)
	jne	.L14
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	jmp	.L19
.L14:
	subl	$1, -84(%rbp)
.L13:
	cmpl	$0, -84(%rbp)
	jg	.L20
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	movl	$0, %eax
.L19:
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	compare_int
	.type	compare_int, @function
compare_int:
.LFB6:
	.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	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	compare_int, .-compare_int
	.globl	max
	.type	max, @function
max:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L4
	movl	-4(%rbp), %eax
	jmp	.L5
.L4:
	movl	-8(%rbp), %eax
.L5:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	max, .-max
	.globl	min
	.type	min, @function
min:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	movl	-4(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L7
	movl	-8(%rbp), %eax
	jmp	.L8
.L7:
	movl	-4(%rbp), %eax
.L8:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	min, .-min
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$56, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	movq	%rsp, %rax
	movq	%rax, %rbx
	leaq	-96(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-96(%rbp), %eax
	addl	$100, %eax
	movslq	%eax, %rdx
	subq	$1, %rdx
	movq	%rdx, -72(%rbp)
	movslq	%eax, %rdx
	movq	%rdx, %r14
	movl	$0, %r15d
	movslq	%eax, %rdx
	movq	%rdx, %r12
	movl	$0, %r13d
	cltq
	movl	$16, %edx
	subq	$1, %rdx
	addq	%rdx, %rax
	movl	$16, %esi
	movl	$0, %edx
	divq	%rsi
	imulq	$16, %rax, %rax
	movq	%rax, %rcx
	andq	$-4096, %rcx
	movq	%rsp, %rdx
	subq	%rcx, %rdx
.L10:
	cmpq	%rdx, %rsp
	je	.L11
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	jmp	.L10
.L11:
	movq	%rax, %rdx
	andl	$4095, %edx
	subq	%rdx, %rsp
	movq	%rax, %rdx
	andl	$4095, %edx
	testq	%rdx, %rdx
	je	.L12
	andl	$4095, %eax
	subq	$8, %rax
	addq	%rsp, %rax
	orq	$0, (%rax)
.L12:
	movq	%rsp, %rax
	addq	$0, %rax
	movq	%rax, -64(%rbp)
	movq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -92(%rbp)
	movl	$0, -88(%rbp)
	movl	-96(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -84(%rbp)
	jmp	.L13
.L20:
	movq	-64(%rbp), %rdx
	movl	-84(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$82, %al
	jne	.L14
	movl	$0, -80(%rbp)
	movl	-88(%rbp), %eax
	movl	%eax, -76(%rbp)
	jmp	.L15
.L18:
	movq	-64(%rbp), %rdx
	movl	-76(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$87, %al
	jne	.L16
	movq	-64(%rbp), %rdx
	movl	-76(%rbp), %eax
	cltq
	movb	$82, (%rdx,%rax)
	movq	-64(%rbp), %rdx
	movl	-84(%rbp), %eax
	cltq
	movb	$87, (%rdx,%rax)
	movl	-76(%rbp), %eax
	movl	%eax, -88(%rbp)
	addl	$1, -92(%rbp)
	movl	$1, -80(%rbp)
	jmp	.L17
.L16:
	addl	$1, -76(%rbp)
.L15:
	movl	-76(%rbp), %eax
	cmpl	-84(%rbp), %eax
	jl	.L18
.L17:
	cmpl	$0, -80(%rbp)
	jne	.L14
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	%rbx, %rsp
	jmp	.L19
.L14:
	subl	$1, -84(%rbp)
.L13:
	cmpl	$0, -84(%rbp)
	jg	.L20
	movl	-92(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	%rbx, %rsp
	movl	$0, %eax
.L19:
	movq	-56(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
