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>
#include <string.h>
int main(void){
    int n;
    char s[100+5];
    scanf("%d", &n);
    scanf("%s", s);
    
    int ans=0;
    for(int i=1; i<n; i++){
        int cnt=0;
        for(int a='a'; a<='z'; a++){
            int x=0, y=0;
            for(int j=0; j<i; j++){
                if(s[j]==a){
                    x=1;
                    break;
                }
            }
            for(int j=i; j<n; j++){
                if(s[j]==a){
                    y=1;
                    break;
                }
            }
            if(x==1 && y==1)cnt++;
        }
        if(cnt>ans)ans=cnt;
    }
    
    printf("%d\n", ans);
    
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$152, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	cmpl	$1, %edi
	jle	.L12
	leaq	17(%rsp), %rsi
	movslq	%edi, %rbp
	movl	$1, %r9d
	xorl	%r11d, %r11d
.L3:
	movl	$97, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L13
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L5
	xorl	%r8d, %r8d
.L4:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rax), %ecx
	cmpl	%edx, %ecx
	je	.L6
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L7
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
.L9:
	cmpl	%r10d, %r11d
	cmovl	%r10d, %r11d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%r9, %rbp
	jne	.L3
.L2:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpl	$1, %r8d
	sbbl	$-1, %r10d
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$1, %r8d
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$152, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	cmpl	$1, %edi
	jle	.L12
	leaq	17(%rsp), %rsi
	movslq	%edi, %rbp
	movl	$1, %r9d
	xorl	%r11d, %r11d
.L3:
	movl	$97, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L13
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L5
	xorl	%r8d, %r8d
.L4:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rax), %ecx
	cmpl	%edx, %ecx
	je	.L6
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L7
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
.L9:
	cmpl	%r10d, %r11d
	cmovl	%r10d, %r11d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%r9, %rbp
	jne	.L3
.L2:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpl	$1, %r8d
	sbbl	$-1, %r10d
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$1, %r8d
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$152, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	cmpl	$1, %edi
	jle	.L12
	leaq	17(%rsp), %rsi
	movslq	%edi, %rbp
	movl	$1, %r9d
	xorl	%r11d, %r11d
.L3:
	movl	$97, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L13
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L5
	xorl	%r8d, %r8d
.L4:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rax), %ecx
	cmpl	%edx, %ecx
	je	.L6
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L7
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
.L9:
	cmpl	%r10d, %r11d
	cmovl	%r10d, %r11d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%r9, %rbp
	jne	.L3
.L2:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpl	$1, %r8d
	sbbl	$-1, %r10d
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$1, %r8d
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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>
#include <string.h>
int main(void){
    int n;
    char s[100+5];
    scanf("%d", &n);
    scanf("%s", s);
    
    int ans=0;
    for(int i=1; i<n; i++){
        int cnt=0;
        for(int a='a'; a<='z'; a++){
            int x=0, y=0;
            for(int j=0; j<i; j++){
                if(s[j]==a){
                    x=1;
                    break;
                }
            }
            for(int j=i; j<n; j++){
                if(s[j]==a){
                    y=1;
                    break;
                }
            }
            if(x==1 && y==1)cnt++;
        }
        if(cnt>ans)ans=cnt;
    }
    
    printf("%d\n", ans);
    
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <string.h>
int main(void){
    int n;
    char s[100+5];
    scanf("%d", &n);
    scanf("%s", s);
    
    int ans=0;
    for(int i=1; i<n; i++){
        int cnt=0;
        for(int a='a'; a<='z'; a++){
            int x=0, y=0;
            for(int j=0; j<i; j++){
                if(s[j]==a){
                    x=1;
                    break;
                }
            }
            for(int j=i; j<n; j++){
                if(s[j]==a){
                    y=1;
                    break;
                }
            }
            if(x==1 && y==1)cnt++;
        }
        if(cnt>ans)ans=cnt;
    }
    
    printf("%d\n", ans);
    
    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:

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
 2
 2
 12
 8
 0

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>
#include <string.h>
int main(void){
    int n;
    char s[100+5];
    scanf("%d", &n);
    scanf("%s", s);
    
    int ans=0;
    for(int i=1; i<n; i++){
        int cnt=0;
        for(int a='a'; a<='z'; a++){
            int x=0, y=0;
            for(int j=0; j<i; j++){
                if(s[j]==a){
                    x=1;
                    break;
                }
            }
            for(int j=i; j<n; j++){
                if(s[j]==a){
                    y=1;
                    break;
                }
            }
            if(x==1 && y==1)cnt++;
        }
        if(cnt>ans)ans=cnt;
    }
    
    printf("%d\n", ans);
    
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$152, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	cmpl	$1, %edi
	jle	.L12
	leaq	17(%rsp), %rsi
	movslq	%edi, %rbp
	movl	$1, %r9d
	xorl	%r11d, %r11d
.L3:
	movl	$97, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L13
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L5
	xorl	%r8d, %r8d
.L4:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rax), %ecx
	cmpl	%edx, %ecx
	je	.L6
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L7
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
.L9:
	cmpl	%r10d, %r11d
	cmovl	%r10d, %r11d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%r9, %rbp
	jne	.L3
.L2:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpl	$1, %r8d
	sbbl	$-1, %r10d
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$1, %r8d
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$152, %rsp
	.cfi_def_cfa_offset 176
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	leaq	16(%rsp), %rbx
	call	__isoc99_scanf@PLT
	leaq	.LC1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %edi
	cmpl	$1, %edi
	jle	.L12
	leaq	17(%rsp), %rsi
	movslq	%edi, %rbp
	movl	$1, %r9d
	xorl	%r11d, %r11d
.L3:
	movl	$97, %edx
	xorl	%r10d, %r10d
	.p2align 4,,10
	.p2align 3
.L10:
	movq	%rbx, %rax
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rax), %ecx
	cmpl	%edx, %ecx
	je	.L13
	addq	$1, %rax
	cmpq	%rax, %rsi
	jne	.L5
	xorl	%r8d, %r8d
.L4:
	movq	%r9, %rax
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rax), %ecx
	cmpl	%edx, %ecx
	je	.L6
	addq	$1, %rax
	cmpl	%eax, %edi
	jg	.L7
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
.L9:
	cmpl	%r10d, %r11d
	cmovl	%r10d, %r11d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%r9, %rbp
	jne	.L3
.L2:
	xorl	%eax, %eax
	movl	%r11d, %edx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L20
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	cmpl	$1, %r8d
	sbbl	$-1, %r10d
	addl	$1, %edx
	cmpl	$123, %edx
	jne	.L10
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$1, %r8d
	jmp	.L4
.L12:
	xorl	%r11d, %r11d
	jmp	.L2
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.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:
```