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 i,N,K;
  char S[11],a;
  scanf("%d",&N);
  scanf("%s",&S);
  scanf("%d",&K);
  for(i=0;i<N;i++){
    a=S[K-1];
    if(S[i]!=a){
      S[i]='*';
    }
  }
    printf("%s",S);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L4:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movb	%al, -33(%rbp)
	movl	-24(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	cmpb	%al, -33(%rbp)
	je	.L3
	movl	-24(%rbp), %eax
	cltq
	movb	$42, -19(%rbp,%rax)
.L3:
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	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"
.LC1:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	leaq	13(%rsp), %r12
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	movl	8(%rsp), %eax
	movzbl	13(%rsp), %ecx
	subl	$1, %eax
	cltq
	cmpb	%cl, 13(%rsp,%rax)
	je	.L3
	movb	$42, 13(%rsp)
.L3:
	cmpl	$1, %edx
	je	.L2
	movzbl	14(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L4
	movb	$42, 14(%rsp)
.L4:
	cmpl	$2, %edx
	je	.L2
	movzbl	15(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L5
	movb	$42, 15(%rsp)
.L5:
	cmpl	$3, %edx
	je	.L2
	movzbl	16(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L6
	movb	$42, 16(%rsp)
.L6:
	cmpl	$4, %edx
	je	.L2
	movzbl	17(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L7
	movb	$42, 17(%rsp)
.L7:
	cmpl	$5, %edx
	je	.L2
	movzbl	18(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L8
	movb	$42, 18(%rsp)
.L8:
	cmpl	$6, %edx
	je	.L2
	movzbl	19(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L9
	movb	$42, 19(%rsp)
.L9:
	cmpl	$7, %edx
	je	.L2
	movzbl	20(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L10
	movb	$42, 20(%rsp)
.L10:
	cmpl	$8, %edx
	je	.L2
	movzbl	21(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L11
	movb	$42, 21(%rsp)
.L11:
	cmpl	$9, %edx
	je	.L2
	movzbl	22(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L12
	movb	$42, 22(%rsp)
.L12:
	cmpl	$10, %edx
	je	.L2
	movzbl	13(%rsp,%rax), %eax
	cmpb	%al, 23(%rsp)
	je	.L2
	movb	$42, 23(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L47:
	.cfi_restore_state
	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
	.file	"temp.c"
	.text
	.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:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	subq	$32, %rsp
	.cfi_def_cfa_offset 64
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	leaq	13(%rsp), %r12
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	leaq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L2
	movl	8(%rsp), %eax
	movzbl	13(%rsp), %ecx
	subl	$1, %eax
	cltq
	cmpb	%cl, 13(%rsp,%rax)
	je	.L3
	movb	$42, 13(%rsp)
.L3:
	cmpl	$1, %edx
	je	.L2
	movzbl	14(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L4
	movb	$42, 14(%rsp)
.L4:
	cmpl	$2, %edx
	je	.L2
	movzbl	15(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L5
	movb	$42, 15(%rsp)
.L5:
	cmpl	$3, %edx
	je	.L2
	movzbl	16(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L6
	movb	$42, 16(%rsp)
.L6:
	cmpl	$4, %edx
	je	.L2
	movzbl	17(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L7
	movb	$42, 17(%rsp)
.L7:
	cmpl	$5, %edx
	je	.L2
	movzbl	18(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L8
	movb	$42, 18(%rsp)
.L8:
	cmpl	$6, %edx
	je	.L2
	movzbl	19(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L9
	movb	$42, 19(%rsp)
.L9:
	cmpl	$7, %edx
	je	.L2
	movzbl	20(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L10
	movb	$42, 20(%rsp)
.L10:
	cmpl	$8, %edx
	je	.L2
	movzbl	21(%rsp), %ecx
	cmpb	%cl, 13(%rsp,%rax)
	je	.L11
	movb	$42, 21(%rsp)
.L11:
	cmpl	$9, %edx
	je	.L2
	movzbl	22(%rsp), %edi
	cmpb	%dil, 13(%rsp,%rax)
	je	.L12
	movb	$42, 22(%rsp)
.L12:
	cmpl	$10, %edx
	je	.L2
	movzbl	13(%rsp,%rax), %eax
	cmpb	%al, 23(%rsp)
	je	.L2
	movb	$42, 23(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L47
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L47:
	.cfi_restore_state
	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:

#include<stdio.h>
int main(){
  int i,N,K;
  char S[11],a;
  scanf("%d",&N);
  scanf("%s",&S);
  scanf("%d",&K);
  for(i=0;i<N;i++){
    a=S[K-1];
    if(S[i]!=a){
      S[i]='*';
    }
  }
    printf("%s",S);
  return 0;
}

9
education
4
 5
orrer
2
 9
edubation
4
 9
edubation
6
 9
edubation
8
 9
edubatinn
8
 9
nnitabude
8
 9
edubatinn
1
 9
edubatinn
2
 6
eleven
4

***c***** *rr*r ***b***** *****t*** *******o* *******nn *******d* e******** *d******* ***v**
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 i,N,K;
  char S[11],a;
  scanf("%d",&N);
  scanf("%s",&S);
  scanf("%d",&K);
  for(i=0;i<N;i++){
    a=S[K-1];
    if(S[i]!=a){
      S[i]='*';
    }
  }
    printf("%s",S);
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L4:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movb	%al, -33(%rbp)
	movl	-24(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	cmpb	%al, -33(%rbp)
	je	.L3
	movl	-24(%rbp), %eax
	cltq
	movb	$42, -19(%rbp,%rax)
.L3:
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	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"
.LC1:
	.string	"%s"
	.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
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -24(%rbp)
	jmp	.L2
.L4:
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	movb	%al, -33(%rbp)
	movl	-24(%rbp), %eax
	cltq
	movzbl	-19(%rbp,%rax), %eax
	cmpb	%al, -33(%rbp)
	je	.L3
	movl	-24(%rbp), %eax
	cltq
	movb	$42, -19(%rbp,%rax)
.L3:
	addl	$1, -24(%rbp)
.L2:
	movl	-32(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L4
	leaq	-19(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	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:
