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(void){
    char string[101];
    int num_string;
    int i,j,k=0;
    char X[100],Y[100];
    int kinds=0;
    int count=0,max=0;
    //printf("Input the length of string:");
    scanf("%d",&num_string);
    //printf("Input string:");
    scanf("%s",string);
 
    for(i=0;i<num_string-1;i++){
        //printf("i:%d ",i);
        for(j=0;j<=i;j++){
            X[j]=string[j];
        }
        //printf("X:%s\n",X);
        k=0;
        for(j=i+1;j<num_string;j++){
            Y[k]=string[j];
            //printf("Y[%d]:%c\n",k,Y[k]);
            for(int m=0;m<=i;m++){
                if(Y[k]==X[m]){
                    count++;
                    //printf("count:%d\n",count);
                    for(int n=m;n<=i;n++){
                        //printf("n:%d\n",n);
                        if(Y[k]==X[n]){
                            X[n]=' ';
                        }
                    }
                }
            }
            k++;
            if(kinds<count){
            kinds=count;
            }
        }
        count=0;
 
    }
    printf("%d",kinds);
    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	$384, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -360(%rbp)
	movl	$0, -356(%rbp)
	movl	$0, -352(%rbp)
	movl	$0, -340(%rbp)
	leaq	-372(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -368(%rbp)
	jmp	.L2
.L14:
	movl	$0, -364(%rbp)
	jmp	.L3
.L4:
	movl	-364(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %edx
	movl	-364(%rbp), %eax
	cltq
	movb	%dl, -336(%rbp,%rax)
	addl	$1, -364(%rbp)
.L3:
	movl	-364(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L4
	movl	$0, -360(%rbp)
	movl	-368(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -364(%rbp)
	jmp	.L5
.L13:
	movl	-364(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %edx
	movl	-360(%rbp), %eax
	cltq
	movb	%dl, -224(%rbp,%rax)
	movl	$0, -348(%rbp)
	jmp	.L6
.L11:
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %edx
	movl	-348(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	addl	$1, -352(%rbp)
	movl	-348(%rbp), %eax
	movl	%eax, -344(%rbp)
	jmp	.L8
.L10:
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %edx
	movl	-344(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L9
	movl	-344(%rbp), %eax
	cltq
	movb	$32, -336(%rbp,%rax)
.L9:
	addl	$1, -344(%rbp)
.L8:
	movl	-344(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L10
.L7:
	addl	$1, -348(%rbp)
.L6:
	movl	-348(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L11
	addl	$1, -360(%rbp)
	movl	-356(%rbp), %eax
	cmpl	-352(%rbp), %eax
	jge	.L12
	movl	-352(%rbp), %eax
	movl	%eax, -356(%rbp)
.L12:
	addl	$1, -364(%rbp)
.L5:
	movl	-372(%rbp), %eax
	cmpl	%eax, -364(%rbp)
	jl	.L13
	movl	$0, -352(%rbp)
	addl	$1, -368(%rbp)
.L2:
	movl	-372(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -368(%rbp)
	jl	.L14
	movl	-356(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rsi
	leaq	192(%rsp), %r12
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%r12, 56(%rsp)
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %eax
	movl	%eax, 36(%rsp)
	cmpl	$1, %eax
	jle	.L31
	subl	$2, %eax
	movl	$2, %r9d
	xorl	%r14d, %r14d
	movq	%r12, %r13
	movq	%rax, 48(%rsp)
	movdqa	.LC2(%rip), %xmm2
	leaq	80(%rsp), %rbp
	movl	$32, %r10d
	movq	$1, 24(%rsp)
	movq	$0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L29:
	movq	24(%rsp), %rcx
	movl	16(%rsp), %ebx
	movq	%rbp, %rdi
	movq	56(%rsp), %rsi
	movl	%ecx, %eax
	cmpl	$8, %ecx
	jb	.L3
	shrl	$3, %ecx
	rep movsq
.L3:
	xorl	%edx, %edx
	testb	$4, %al
	je	.L4
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	$4, %edx
.L4:
	testb	$2, %al
	je	.L5
	movzwl	(%rsi,%rdx), %ecx
	movw	%cx, (%rdi,%rdx)
	addq	$2, %rdx
.L5:
	testb	$1, %al
	je	.L6
	movzbl	(%rsi,%rdx), %eax
	movb	%al, (%rdi,%rdx)
.L6:
	movl	24(%rsp), %edi
	cmpl	%edi, 36(%rsp)
	jle	.L63
	movl	36(%rsp), %eax
	leaq	1(%r13), %rdi
	movl	16(%rsp), %r8d
	xorl	%r12d, %r12d
	movq	%rdi, 40(%rsp)
	subl	%r9d, %eax
	addq	%rdi, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L28:
	movzbl	1(%r13), %esi
	movq	%rbp, %rax
	movl	%ebx, %ecx
	movl	$1, %edx
	movd	%esi, %xmm0
	punpcklbw	%xmm0, %xmm0
	punpcklwd	%xmm0, %xmm0
	pshufd	$0, %xmm0, %xmm0
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rdx
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%rdx, %r9
	je	.L64
.L27:
	cmpb	(%rax), %sil
	jne	.L8
	movb	$32, (%rax)
	addl	$1, %r12d
	movl	%edx, %edi
	cmpl	%edx, %r8d
	jl	.L8
	movl	%ebx, %r11d
	subl	%edx, %r11d
	cmpl	$14, %r11d
	jbe	.L9
	movdqu	1(%rax), %xmm1
	movdqu	1(%rax), %xmm4
	movdqa	%xmm2, %xmm3
	movl	%ecx, %r11d
	shrl	$4, %r11d
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm4, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 1(%rax)
	cmpl	$1, %r11d
	je	.L10
	movdqu	17(%rax), %xmm1
	movdqu	17(%rax), %xmm5
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm5, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 17(%rax)
	cmpl	$2, %r11d
	je	.L10
	movdqu	33(%rax), %xmm1
	movdqu	33(%rax), %xmm6
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm6, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 33(%rax)
	cmpl	$3, %r11d
	je	.L10
	movdqu	49(%rax), %xmm1
	movdqu	49(%rax), %xmm7
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm7, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 49(%rax)
	cmpl	$4, %r11d
	je	.L10
	movdqu	65(%rax), %xmm1
	movdqu	65(%rax), %xmm7
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm7, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 65(%rax)
	cmpl	$5, %r11d
	je	.L10
	movdqu	81(%rax), %xmm1
	movdqu	81(%rax), %xmm6
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm6, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 81(%rax)
.L10:
	movl	%ecx, %r11d
	andl	$-16, %r11d
	addl	%r11d, %edi
	cmpl	%r11d, %ecx
	je	.L8
.L9:
	movslq	%edi, %r15
	movzbl	80(%rsp,%r15), %r11d
	cmpb	%r11b, %sil
	cmove	%r10d, %r11d
	movb	%r11b, 80(%rsp,%r15)
	leal	1(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	2(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	3(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	4(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	5(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	6(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	7(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	8(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	9(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	10(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	11(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	12(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	13(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	addl	$14, %edi
	movb	%r15b, 80(%rsp,%r11)
	cmpl	%edi, %r8d
	jl	.L8
	movslq	%edi, %rdi
	movzbl	80(%rsp,%rdi), %r11d
	cmpb	%r11b, %sil
	cmove	%r10d, %r11d
	addq	$1, %rdx
	addq	$1, %rax
	subl	$1, %ecx
	movb	%r11b, 80(%rsp,%rdi)
	cmpq	%rdx, %r9
	jne	.L27
	.p2align 4,,10
	.p2align 3
.L64:
	cmpl	%r12d, %r14d
	cmovl	%r12d, %r14d
	addq	$1, %r13
	cmpq	%r13, 8(%rsp)
	jne	.L28
.L7:
	movq	16(%rsp), %rbx
	addq	$1, 24(%rsp)
	addq	$1, %r9
	movq	40(%rsp), %r13
	leaq	1(%rbx), %rax
	cmpq	%rbx, 48(%rsp)
	je	.L2
	movq	%rax, 16(%rsp)
	jmp	.L29
.L31:
	xorl	%r14d, %r14d
.L2:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L63:
	.cfi_restore_state
	leaq	1(%r13), %rax
	movq	%rax, 40(%rsp)
	jmp	.L7
.L65:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.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	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$312, %rsp
	.cfi_def_cfa_offset 368
	movq	%fs:40, %rax
	movq	%rax, 296(%rsp)
	xorl	%eax, %eax
	leaq	76(%rsp), %rsi
	leaq	192(%rsp), %r12
	call	__isoc99_scanf@PLT
	movq	%r12, %rsi
	xorl	%eax, %eax
	movq	%r12, 56(%rsp)
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	76(%rsp), %eax
	movl	%eax, 36(%rsp)
	cmpl	$1, %eax
	jle	.L31
	subl	$2, %eax
	movl	$2, %r9d
	xorl	%r14d, %r14d
	movq	%r12, %r13
	movq	%rax, 48(%rsp)
	movdqa	.LC2(%rip), %xmm2
	leaq	80(%rsp), %rbp
	movl	$32, %r10d
	movq	$1, 24(%rsp)
	movq	$0, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L29:
	movq	24(%rsp), %rcx
	movl	16(%rsp), %ebx
	movq	%rbp, %rdi
	movq	56(%rsp), %rsi
	movl	%ecx, %eax
	cmpl	$8, %ecx
	jb	.L3
	shrl	$3, %ecx
	rep movsq
.L3:
	xorl	%edx, %edx
	testb	$4, %al
	je	.L4
	movl	(%rsi), %edx
	movl	%edx, (%rdi)
	movl	$4, %edx
.L4:
	testb	$2, %al
	je	.L5
	movzwl	(%rsi,%rdx), %ecx
	movw	%cx, (%rdi,%rdx)
	addq	$2, %rdx
.L5:
	testb	$1, %al
	je	.L6
	movzbl	(%rsi,%rdx), %eax
	movb	%al, (%rdi,%rdx)
.L6:
	movl	24(%rsp), %edi
	cmpl	%edi, 36(%rsp)
	jle	.L63
	movl	36(%rsp), %eax
	leaq	1(%r13), %rdi
	movl	16(%rsp), %r8d
	xorl	%r12d, %r12d
	movq	%rdi, 40(%rsp)
	subl	%r9d, %eax
	addq	%rdi, %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L28:
	movzbl	1(%r13), %esi
	movq	%rbp, %rax
	movl	%ebx, %ecx
	movl	$1, %edx
	movd	%esi, %xmm0
	punpcklbw	%xmm0, %xmm0
	punpcklwd	%xmm0, %xmm0
	pshufd	$0, %xmm0, %xmm0
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L8:
	addq	$1, %rdx
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%rdx, %r9
	je	.L64
.L27:
	cmpb	(%rax), %sil
	jne	.L8
	movb	$32, (%rax)
	addl	$1, %r12d
	movl	%edx, %edi
	cmpl	%edx, %r8d
	jl	.L8
	movl	%ebx, %r11d
	subl	%edx, %r11d
	cmpl	$14, %r11d
	jbe	.L9
	movdqu	1(%rax), %xmm1
	movdqu	1(%rax), %xmm4
	movdqa	%xmm2, %xmm3
	movl	%ecx, %r11d
	shrl	$4, %r11d
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm4, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 1(%rax)
	cmpl	$1, %r11d
	je	.L10
	movdqu	17(%rax), %xmm1
	movdqu	17(%rax), %xmm5
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm5, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 17(%rax)
	cmpl	$2, %r11d
	je	.L10
	movdqu	33(%rax), %xmm1
	movdqu	33(%rax), %xmm6
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm6, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 33(%rax)
	cmpl	$3, %r11d
	je	.L10
	movdqu	49(%rax), %xmm1
	movdqu	49(%rax), %xmm7
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm7, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 49(%rax)
	cmpl	$4, %r11d
	je	.L10
	movdqu	65(%rax), %xmm1
	movdqu	65(%rax), %xmm7
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm7, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 65(%rax)
	cmpl	$5, %r11d
	je	.L10
	movdqu	81(%rax), %xmm1
	movdqu	81(%rax), %xmm6
	movdqa	%xmm2, %xmm3
	pcmpeqb	%xmm0, %xmm1
	pand	%xmm1, %xmm3
	pandn	%xmm6, %xmm1
	por	%xmm3, %xmm1
	movups	%xmm1, 81(%rax)
.L10:
	movl	%ecx, %r11d
	andl	$-16, %r11d
	addl	%r11d, %edi
	cmpl	%r11d, %ecx
	je	.L8
.L9:
	movslq	%edi, %r15
	movzbl	80(%rsp,%r15), %r11d
	cmpb	%r11b, %sil
	cmove	%r10d, %r11d
	movb	%r11b, 80(%rsp,%r15)
	leal	1(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	2(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	3(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	4(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	5(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	6(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	7(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	8(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	9(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	10(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	11(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	12(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	movb	%r15b, 80(%rsp,%r11)
	leal	13(%rdi), %r11d
	cmpl	%r11d, %r8d
	jl	.L8
	movslq	%r11d, %r11
	movzbl	80(%rsp,%r11), %r15d
	cmpb	%r15b, %sil
	cmove	%r10d, %r15d
	addl	$14, %edi
	movb	%r15b, 80(%rsp,%r11)
	cmpl	%edi, %r8d
	jl	.L8
	movslq	%edi, %rdi
	movzbl	80(%rsp,%rdi), %r11d
	cmpb	%r11b, %sil
	cmove	%r10d, %r11d
	addq	$1, %rdx
	addq	$1, %rax
	subl	$1, %ecx
	movb	%r11b, 80(%rsp,%rdi)
	cmpq	%rdx, %r9
	jne	.L27
	.p2align 4,,10
	.p2align 3
.L64:
	cmpl	%r12d, %r14d
	cmovl	%r12d, %r14d
	addq	$1, %r13
	cmpq	%r13, 8(%rsp)
	jne	.L28
.L7:
	movq	16(%rsp), %rbx
	addq	$1, 24(%rsp)
	addq	$1, %r9
	movq	40(%rsp), %r13
	leaq	1(%rbx), %rax
	cmpq	%rbx, 48(%rsp)
	je	.L2
	movq	%rax, 16(%rsp)
	jmp	.L29
.L31:
	xorl	%r14d, %r14d
.L2:
	xorl	%eax, %eax
	movl	%r14d, %edx
	movl	$1, %edi
	leaq	.LC0(%rip), %rsi
	call	__printf_chk@PLT
	movq	296(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L65
	addq	$312, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L63:
	.cfi_restore_state
	leaq	1(%r13), %rax
	movq	%rax, 40(%rsp)
	jmp	.L7
.L65:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.byte	32
	.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(void){
    char string[101];
    int num_string;
    int i,j,k=0;
    char X[100],Y[100];
    int kinds=0;
    int count=0,max=0;
    //printf("Input the length of string:");
    scanf("%d",&num_string);
    //printf("Input string:");
    scanf("%s",string);
 
    for(i=0;i<num_string-1;i++){
        //printf("i:%d ",i);
        for(j=0;j<=i;j++){
            X[j]=string[j];
        }
        //printf("X:%s\n",X);
        k=0;
        for(j=i+1;j<num_string;j++){
            Y[k]=string[j];
            //printf("Y[%d]:%c\n",k,Y[k]);
            for(int m=0;m<=i;m++){
                if(Y[k]==X[m]){
                    count++;
                    //printf("count:%d\n",count);
                    for(int n=m;n<=i;n++){
                        //printf("n:%d\n",n);
                        if(Y[k]==X[n]){
                            X[n]=' ';
                        }
                    }
                }
            }
            k++;
            if(kinds<count){
            kinds=count;
            }
        }
        count=0;
 
    }
    printf("%d",kinds);
    return 0;
}
10
aaabaaaaaa
 6
`abbca
 45
tgxgdqkyjphyzutjjtllptdfxocrylqfqjynmfbfucbir
 45
tgxgtqkyjfhyzutjjdllptdpxrbrylqfqjynmfbfucbio
 45
bnxgtqkykfhyzutjjdllptdpxrtrylqfqjygmfbftcbio
 10
aba`ab`bbb
 10
`bcca_ba_`
 45
blxhtqkyjehxzutkjdmlpidpurtrzlbfribgmhqfzcyto
 45
twhhbqkztehxjvukjdjioldpurzrzlbfribgmnqfzcytn
 6
b`^dca

1 2 9 10 11 3 4 12 8 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>
int main(void){
    char string[101];
    int num_string;
    int i,j,k=0;
    char X[100],Y[100];
    int kinds=0;
    int count=0,max=0;
    //printf("Input the length of string:");
    scanf("%d",&num_string);
    //printf("Input string:");
    scanf("%s",string);
 
    for(i=0;i<num_string-1;i++){
        //printf("i:%d ",i);
        for(j=0;j<=i;j++){
            X[j]=string[j];
        }
        //printf("X:%s\n",X);
        k=0;
        for(j=i+1;j<num_string;j++){
            Y[k]=string[j];
            //printf("Y[%d]:%c\n",k,Y[k]);
            for(int m=0;m<=i;m++){
                if(Y[k]==X[m]){
                    count++;
                    //printf("count:%d\n",count);
                    for(int n=m;n<=i;n++){
                        //printf("n:%d\n",n);
                        if(Y[k]==X[n]){
                            X[n]=' ';
                        }
                    }
                }
            }
            k++;
            if(kinds<count){
            kinds=count;
            }
        }
        count=0;
 
    }
    printf("%d",kinds);
    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	$384, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -360(%rbp)
	movl	$0, -356(%rbp)
	movl	$0, -352(%rbp)
	movl	$0, -340(%rbp)
	leaq	-372(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -368(%rbp)
	jmp	.L2
.L14:
	movl	$0, -364(%rbp)
	jmp	.L3
.L4:
	movl	-364(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %edx
	movl	-364(%rbp), %eax
	cltq
	movb	%dl, -336(%rbp,%rax)
	addl	$1, -364(%rbp)
.L3:
	movl	-364(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L4
	movl	$0, -360(%rbp)
	movl	-368(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -364(%rbp)
	jmp	.L5
.L13:
	movl	-364(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %edx
	movl	-360(%rbp), %eax
	cltq
	movb	%dl, -224(%rbp,%rax)
	movl	$0, -348(%rbp)
	jmp	.L6
.L11:
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %edx
	movl	-348(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	addl	$1, -352(%rbp)
	movl	-348(%rbp), %eax
	movl	%eax, -344(%rbp)
	jmp	.L8
.L10:
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %edx
	movl	-344(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L9
	movl	-344(%rbp), %eax
	cltq
	movb	$32, -336(%rbp,%rax)
.L9:
	addl	$1, -344(%rbp)
.L8:
	movl	-344(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L10
.L7:
	addl	$1, -348(%rbp)
.L6:
	movl	-348(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L11
	addl	$1, -360(%rbp)
	movl	-356(%rbp), %eax
	cmpl	-352(%rbp), %eax
	jge	.L12
	movl	-352(%rbp), %eax
	movl	%eax, -356(%rbp)
.L12:
	addl	$1, -364(%rbp)
.L5:
	movl	-372(%rbp), %eax
	cmpl	%eax, -364(%rbp)
	jl	.L13
	movl	$0, -352(%rbp)
	addl	$1, -368(%rbp)
.L2:
	movl	-372(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -368(%rbp)
	jl	.L14
	movl	-356(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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	$384, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -360(%rbp)
	movl	$0, -356(%rbp)
	movl	$0, -352(%rbp)
	movl	$0, -340(%rbp)
	leaq	-372(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-112(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -368(%rbp)
	jmp	.L2
.L14:
	movl	$0, -364(%rbp)
	jmp	.L3
.L4:
	movl	-364(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %edx
	movl	-364(%rbp), %eax
	cltq
	movb	%dl, -336(%rbp,%rax)
	addl	$1, -364(%rbp)
.L3:
	movl	-364(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L4
	movl	$0, -360(%rbp)
	movl	-368(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -364(%rbp)
	jmp	.L5
.L13:
	movl	-364(%rbp), %eax
	cltq
	movzbl	-112(%rbp,%rax), %edx
	movl	-360(%rbp), %eax
	cltq
	movb	%dl, -224(%rbp,%rax)
	movl	$0, -348(%rbp)
	jmp	.L6
.L11:
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %edx
	movl	-348(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	addl	$1, -352(%rbp)
	movl	-348(%rbp), %eax
	movl	%eax, -344(%rbp)
	jmp	.L8
.L10:
	movl	-360(%rbp), %eax
	cltq
	movzbl	-224(%rbp,%rax), %edx
	movl	-344(%rbp), %eax
	cltq
	movzbl	-336(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L9
	movl	-344(%rbp), %eax
	cltq
	movb	$32, -336(%rbp,%rax)
.L9:
	addl	$1, -344(%rbp)
.L8:
	movl	-344(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L10
.L7:
	addl	$1, -348(%rbp)
.L6:
	movl	-348(%rbp), %eax
	cmpl	-368(%rbp), %eax
	jle	.L11
	addl	$1, -360(%rbp)
	movl	-356(%rbp), %eax
	cmpl	-352(%rbp), %eax
	jge	.L12
	movl	-352(%rbp), %eax
	movl	%eax, -356(%rbp)
.L12:
	addl	$1, -364(%rbp)
.L5:
	movl	-372(%rbp), %eax
	cmpl	%eax, -364(%rbp)
	jl	.L13
	movl	$0, -352(%rbp)
	addl	$1, -368(%rbp)
.L2:
	movl	-372(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -368(%rbp)
	jl	.L14
	movl	-356(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L16
	call	__stack_chk_fail@PLT
.L16:
	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:
