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>

int main(){
    int N,K,i,j;
    int sum=0;
    char S[100002];
    scanf("%d %d",&N,&K);
    scanf("%s",&S);
    i=0;
    for(i = 0 ; i < N ; i++){
        if(S[i] == S[i+1]){
            sum++;
        }
    }
    if( ( sum+2*K ) < ( N-1 )){
        printf("%d",sum+2*K);
    }else{
        printf("%d",N-1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100020(%rbp)
	leaq	-100028(%rbp), %rdx
	leaq	-100032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -100024(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L4:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	addl	$1, -100020(%rbp)
.L3:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100032(%rbp), %eax
	cmpl	%eax, -100024(%rbp)
	jl	.L4
	movl	-100028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-100020(%rbp), %eax
	addl	%eax, %edx
	movl	-100032(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-100028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-100020(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L6
.L5:
	movl	-100032(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L26
	leal	-1(%rdx), %r8d
	cmpl	$14, %r8d
	jbe	.L27
	movl	%edx, %ecx
	pxor	%xmm1, %xmm1
	pxor	%xmm5, %xmm5
	movq	%rbx, %rax
	shrl	$4, %ecx
	movdqa	.LC2(%rip), %xmm6
	pxor	%xmm4, %xmm4
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	32(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	1(%rax), %xmm0
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	pand	%xmm6, %xmm0
	pcmpgtb	%xmm0, %xmm3
	movdqa	%xmm0, %xmm2
	punpcklbw	%xmm3, %xmm2
	punpckhbw	%xmm3, %xmm0
	movdqa	%xmm4, %xmm3
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm7
	punpcklwd	%xmm3, %xmm7
	punpckhwd	%xmm3, %xmm2
	movdqa	%xmm0, %xmm3
	paddd	%xmm7, %xmm1
	paddd	%xmm2, %xmm1
	movdqa	%xmm4, %xmm2
	pcmpgtw	%xmm0, %xmm2
	punpcklwd	%xmm2, %xmm3
	punpckhwd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	paddd	%xmm0, %xmm1
	cmpq	%rax, %rcx
	jne	.L4
	movdqa	%xmm1, %xmm0
	movl	%edx, %ecx
	psrldq	$8, %xmm0
	andl	$-16, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$15, %dl
	je	.L2
.L3:
	leal	1(%rcx), %esi
	movslq	%ecx, %r9
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, 16(%rsp,%r9)
	jne	.L7
	addl	$1, %eax
.L7:
	cmpl	%edx, %esi
	jge	.L2
	leal	2(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%dil, %r9b
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %eax
	cmpl	%edx, %esi
	jge	.L2
	leal	3(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L32
.L9:
	cmpl	%esi, %edx
	jle	.L2
	leal	4(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	je	.L33
.L10:
	cmpl	%esi, %edx
	jle	.L2
	leal	5(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L34
.L11:
	cmpl	%esi, %edx
	jle	.L2
	leal	6(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	jne	.L12
	addl	$1, %eax
.L12:
	cmpl	%esi, %edx
	jle	.L2
	leal	7(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	jne	.L13
	addl	$1, %eax
.L13:
	cmpl	%esi, %edx
	jle	.L2
	leal	8(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	jne	.L14
	addl	$1, %eax
.L14:
	cmpl	%esi, %edx
	jle	.L2
	leal	9(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	jne	.L15
	addl	$1, %eax
.L15:
	cmpl	%esi, %edx
	jle	.L2
	leal	10(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	je	.L35
.L16:
	cmpl	%esi, %edx
	jle	.L2
	leal	11(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L36
.L17:
	cmpl	%esi, %edx
	jle	.L2
	leal	12(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	je	.L37
.L18:
	cmpl	%esi, %edx
	jle	.L2
	leal	13(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L38
.L19:
	cmpl	%esi, %edx
	jle	.L2
	leal	14(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	jne	.L20
	addl	$1, %eax
.L20:
	cmpl	%esi, %edx
	jle	.L2
	addl	$15, %ecx
	movslq	%ecx, %rcx
	cmpb	%r9b, 16(%rsp,%rcx)
	jne	.L2
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L2:
	movl	12(%rsp), %edx
	leal	(%rax,%rdx,2), %edx
	cmpl	%r8d, %edx
	jl	.L30
	movl	%r8d, %edx
.L30:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L9
.L33:
	addl	$1, %eax
	jmp	.L10
.L34:
	addl	$1, %eax
	jmp	.L11
.L35:
	addl	$1, %eax
	jmp	.L16
.L36:
	addl	$1, %eax
	jmp	.L17
.L37:
	addl	$1, %eax
	jmp	.L18
.L38:
	addl	$1, %eax
	jmp	.L19
.L26:
	xorl	%eax, %eax
	leal	-1(%rdx), %r8d
	jmp	.L2
.L27:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L3
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1728, %rsp
	.cfi_def_cfa_offset 100048
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rdx
	leaq	8(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	movq	%rbx, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %edx
	testl	%edx, %edx
	jle	.L26
	leal	-1(%rdx), %r8d
	cmpl	$14, %r8d
	jbe	.L27
	movl	%edx, %ecx
	pxor	%xmm1, %xmm1
	pxor	%xmm5, %xmm5
	movq	%rbx, %rax
	shrl	$4, %ecx
	movdqa	.LC2(%rip), %xmm6
	pxor	%xmm4, %xmm4
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	32(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqu	1(%rax), %xmm0
	movdqa	%xmm5, %xmm3
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	pand	%xmm6, %xmm0
	pcmpgtb	%xmm0, %xmm3
	movdqa	%xmm0, %xmm2
	punpcklbw	%xmm3, %xmm2
	punpckhbw	%xmm3, %xmm0
	movdqa	%xmm4, %xmm3
	pcmpgtw	%xmm2, %xmm3
	movdqa	%xmm2, %xmm7
	punpcklwd	%xmm3, %xmm7
	punpckhwd	%xmm3, %xmm2
	movdqa	%xmm0, %xmm3
	paddd	%xmm7, %xmm1
	paddd	%xmm2, %xmm1
	movdqa	%xmm4, %xmm2
	pcmpgtw	%xmm0, %xmm2
	punpcklwd	%xmm2, %xmm3
	punpckhwd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	paddd	%xmm0, %xmm1
	cmpq	%rax, %rcx
	jne	.L4
	movdqa	%xmm1, %xmm0
	movl	%edx, %ecx
	psrldq	$8, %xmm0
	andl	$-16, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %eax
	testb	$15, %dl
	je	.L2
.L3:
	leal	1(%rcx), %esi
	movslq	%ecx, %r9
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, 16(%rsp,%r9)
	jne	.L7
	addl	$1, %eax
.L7:
	cmpl	%edx, %esi
	jge	.L2
	leal	2(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%dil, %r9b
	sete	%dil
	movzbl	%dil, %edi
	addl	%edi, %eax
	cmpl	%edx, %esi
	jge	.L2
	leal	3(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L32
.L9:
	cmpl	%esi, %edx
	jle	.L2
	leal	4(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	je	.L33
.L10:
	cmpl	%esi, %edx
	jle	.L2
	leal	5(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L34
.L11:
	cmpl	%esi, %edx
	jle	.L2
	leal	6(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	jne	.L12
	addl	$1, %eax
.L12:
	cmpl	%esi, %edx
	jle	.L2
	leal	7(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	jne	.L13
	addl	$1, %eax
.L13:
	cmpl	%esi, %edx
	jle	.L2
	leal	8(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	jne	.L14
	addl	$1, %eax
.L14:
	cmpl	%esi, %edx
	jle	.L2
	leal	9(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	jne	.L15
	addl	$1, %eax
.L15:
	cmpl	%esi, %edx
	jle	.L2
	leal	10(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	je	.L35
.L16:
	cmpl	%esi, %edx
	jle	.L2
	leal	11(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L36
.L17:
	cmpl	%esi, %edx
	jle	.L2
	leal	12(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	je	.L37
.L18:
	cmpl	%esi, %edx
	jle	.L2
	leal	13(%rcx), %esi
	movslq	%esi, %rdi
	movzbl	16(%rsp,%rdi), %edi
	cmpb	%dil, %r9b
	je	.L38
.L19:
	cmpl	%esi, %edx
	jle	.L2
	leal	14(%rcx), %esi
	movslq	%esi, %r9
	movzbl	16(%rsp,%r9), %r9d
	cmpb	%r9b, %dil
	jne	.L20
	addl	$1, %eax
.L20:
	cmpl	%esi, %edx
	jle	.L2
	addl	$15, %ecx
	movslq	%ecx, %rcx
	cmpb	%r9b, 16(%rsp,%rcx)
	jne	.L2
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L2:
	movl	12(%rsp), %edx
	leal	(%rax,%rdx,2), %edx
	cmpl	%r8d, %edx
	jl	.L30
	movl	%r8d, %edx
.L30:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	100024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L39
	addq	$100032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore_state
	addl	$1, %eax
	jmp	.L9
.L33:
	addl	$1, %eax
	jmp	.L10
.L34:
	addl	$1, %eax
	jmp	.L11
.L35:
	addl	$1, %eax
	jmp	.L16
.L36:
	addl	$1, %eax
	jmp	.L17
.L37:
	addl	$1, %eax
	jmp	.L18
.L38:
	addl	$1, %eax
	jmp	.L19
.L26:
	xorl	%eax, %eax
	leal	-1(%rdx), %r8d
	jmp	.L2
.L27:
	xorl	%eax, %eax
	xorl	%ecx, %ecx
	jmp	.L3
.L39:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.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>

int main(){
    int N,K,i,j;
    int sum=0;
    char S[100002];
    scanf("%d %d",&N,&K);
    scanf("%s",&S);
    i=0;
    for(i = 0 ; i < N ; i++){
        if(S[i] == S[i+1]){
            sum++;
        }
    }
    if( ( sum+2*K ) < ( N-1 )){
        printf("%d",sum+2*K);
    }else{
        printf("%d",N-1);
    }
    return 0;
}
6 2
LRLRRL
 9 3
RRRLRLRLL
 9 0
RRRLRLRLL
 6 0
LRRLRL
 9 1
RRRRLLRLL
 9 1
RLRRLLLRR
 6 1
RRLLRL
 10 2
LLLLLRRRRR
 13 4
LRRLRLRRLRLLR
 13 8
LRRLRLRRLRLLR

5 8 3 1 7 6 4 9 11 12
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>

int main(){
    int N,K,i,j;
    int sum=0;
    char S[100002];
    scanf("%d %d",&N,&K);
    scanf("%s",&S);
    i=0;
    for(i = 0 ; i < N ; i++){
        if(S[i] == S[i+1]){
            sum++;
        }
    }
    if( ( sum+2*K ) < ( N-1 )){
        printf("%d",sum+2*K);
    }else{
        printf("%d",N-1);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100020(%rbp)
	leaq	-100028(%rbp), %rdx
	leaq	-100032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -100024(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L4:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	addl	$1, -100020(%rbp)
.L3:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100032(%rbp), %eax
	cmpl	%eax, -100024(%rbp)
	jl	.L4
	movl	-100028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-100020(%rbp), %eax
	addl	%eax, %edx
	movl	-100032(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-100028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-100020(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L6
.L5:
	movl	-100032(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100020(%rbp)
	leaq	-100028(%rbp), %rdx
	leaq	-100032(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -100024(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L4:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %edx
	movl	-100024(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L3
	addl	$1, -100020(%rbp)
.L3:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100032(%rbp), %eax
	cmpl	%eax, -100024(%rbp)
	jl	.L4
	movl	-100028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-100020(%rbp), %eax
	addl	%eax, %edx
	movl	-100032(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, %edx
	jge	.L5
	movl	-100028(%rbp), %eax
	leal	(%rax,%rax), %edx
	movl	-100020(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L6
.L5:
	movl	-100032(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L6:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
