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>

int main(int argc, char const *argv[])
{
    int N,K;
    scanf("%d",&N);
    char S[N];
    scanf("%s",S);
    scanf("%d",&K);
    char tmp=S[K-1];
    for (size_t i = 0; i < N; i++)
    {
        if (S[i]!=tmp)
        {
            S[i]='*';
        }
    }
    printf("%s\n",S);
    return 0;
}
```

Assembly Code:

```assembly
	.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	leaq	-32(%rbp), %rsi
	movq	%r12, %rdi
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-32(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L18
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L19
.L4:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	-32(%rbp), %rdx
	subl	$1, %eax
	cltq
	movzbl	(%rsp,%rax), %ecx
	testq	%rdx, %rdx
	je	.L5
	movq	%rsp, %rax
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	%cl, (%rax)
	je	.L6
	movb	$42, (%rax)
.L6:
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L7
.L5:
	movq	%r13, %rdi
	call	puts@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L20
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L19:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L20:
	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"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	leaq	-32(%rbp), %rsi
	movq	%r12, %rdi
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-32(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L18
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L19
.L4:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	-32(%rbp), %rdx
	subl	$1, %eax
	cltq
	movzbl	(%rsp,%rax), %ecx
	testq	%rdx, %rdx
	je	.L5
	movq	%rsp, %rax
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	%cl, (%rax)
	je	.L6
	movb	$42, (%rax)
.L6:
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L7
.L5:
	movq	%r13, %rdi
	call	puts@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L20
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L19:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L20:
	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"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	leaq	-32(%rbp), %rsi
	movq	%r12, %rdi
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-32(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L18
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L19
.L4:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	-32(%rbp), %rdx
	subl	$1, %eax
	cltq
	movzbl	(%rsp,%rax), %ecx
	testq	%rdx, %rdx
	je	.L5
	movq	%rsp, %rax
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	%cl, (%rax)
	je	.L6
	movb	$42, (%rax)
.L6:
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L7
.L5:
	movq	%r13, %rdi
	call	puts@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L20
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L19:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L20:
	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>

int main(int argc, char const *argv[])
{
    int N,K;
    scanf("%d",&N);
    char S[N];
    scanf("%s",S);
    scanf("%d",&K);
    char tmp=S[K-1];
    for (size_t i = 0; i < N; i++)
    {
        if (S[i]!=tmp)
        {
            S[i]='*';
        }
    }
    printf("%s\n",S);
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int N,K;
    scanf("%d",&N);
    char S[N];
    scanf("%s",S);
    scanf("%d",&K);
    char tmp=S[K-1];
    for (size_t i = 0; i < N; i++)
    {
        if (S[i]!=tmp)
        {
            S[i]='*';
        }
    }
    printf("%s\n",S);
    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:

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

```c
#include <stdio.h>

int main(int argc, char const *argv[])
{
    int N,K;
    scanf("%d",&N);
    char S[N];
    scanf("%s",S);
    scanf("%d",&K);
    char tmp=S[K-1];
    for (size_t i = 0; i < N; i++)
    {
        if (S[i]!=tmp)
        {
            S[i]='*';
        }
    }
    printf("%s\n",S);
    return 0;
}
```

Assembly Code:

```assembly
	.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	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	leaq	-32(%rbp), %rsi
	movq	%r12, %rdi
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-32(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L18
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L19
.L4:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	-32(%rbp), %rdx
	subl	$1, %eax
	cltq
	movzbl	(%rsp,%rax), %ecx
	testq	%rdx, %rdx
	je	.L5
	movq	%rsp, %rax
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	%cl, (%rax)
	je	.L6
	movb	$42, (%rax)
.L6:
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L7
.L5:
	movq	%r13, %rdi
	call	puts@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L20
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L19:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L20:
	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"
	.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
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r13
	pushq	%r12
	.cfi_offset 13, -24
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	leaq	-32(%rbp), %rsi
	movq	%r12, %rdi
	subq	$16, %rsp
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-32(%rbp), %rax
	movq	%rsp, %rcx
	addq	$15, %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rcx
	andq	$-16, %rdx
	cmpq	%rcx, %rsp
	je	.L3
.L18:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rcx, %rsp
	jne	.L18
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L19
.L4:
	movq	%rsp, %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	movq	%rsp, %r13
	call	__isoc99_scanf@PLT
	leaq	-28(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	-28(%rbp), %eax
	movslq	-32(%rbp), %rdx
	subl	$1, %eax
	cltq
	movzbl	(%rsp,%rax), %ecx
	testq	%rdx, %rdx
	je	.L5
	movq	%rsp, %rax
	addq	%rsp, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	cmpb	%cl, (%rax)
	je	.L6
	movb	$42, (%rax)
.L6:
	addq	$1, %rax
	cmpq	%rdx, %rax
	jne	.L7
.L5:
	movq	%r13, %rdi
	call	puts@PLT
	movq	-24(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L20
	leaq	-16(%rbp), %rsp
	xorl	%eax, %eax
	popq	%r12
	popq	%r13
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L19:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L20:
	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:
```