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 max(int a,int b){
  if(a>b) return a;
  return b;
}

int main(void){
  int n,i,j,ans=0,tmp;
  char s[101];
  
  scanf("%d %s",&n,s);

  for(i=1;i<n;i++){
    int alpha[26] = {};
    for(j=0;j<i;j++) alpha[s[j]-'a']++;
  
    tmp = 0;
    for(j=i;j<n;j++){
      if(alpha[s[j]-'a']>0){
        tmp++;
        alpha[s[j]-'a']=0;
      }
    }
    
    ans = max(ans,tmp);
  }
  
  printf("%d\n",ans);
  
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$248, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L10
	leaq	129(%rsp), %rsi
	movslq	%r8d, %rbp
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movl	$1, %r9d
	leaq	16(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$13, %ecx
	movq	%r11, %rdi
	rep stosq
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rcx), %edx
	addq	$1, %rcx
	subl	$97, %edx
	movslq	%edx, %rdx
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rsi
	jne	.L5
	movq	%r9, %rcx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rcx), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	cmpl	$0, 16(%rsp,%rdx,4)
	jle	.L6
	movl	$0, 16(%rsp,%rdx,4)
	addl	$1, %edi
.L6:
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jg	.L7
	cmpl	%edi, %r10d
	cmovl	%edi, %r10d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%rbp, %r9
	jne	.L8
.L4:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$248, %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
.L10:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$248, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L10
	leaq	129(%rsp), %rsi
	movslq	%r8d, %rbp
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movl	$1, %r9d
	leaq	16(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$13, %ecx
	movq	%r11, %rdi
	rep stosq
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rcx), %edx
	addq	$1, %rcx
	subl	$97, %edx
	movslq	%edx, %rdx
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rsi
	jne	.L5
	movq	%r9, %rcx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rcx), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	cmpl	$0, 16(%rsp,%rdx,4)
	jle	.L6
	movl	$0, 16(%rsp,%rdx,4)
	addl	$1, %edi
.L6:
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jg	.L7
	cmpl	%edi, %r10d
	cmovl	%edi, %r10d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%rbp, %r9
	jne	.L8
.L4:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$248, %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
.L10:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$248, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L10
	leaq	129(%rsp), %rsi
	movslq	%r8d, %rbp
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movl	$1, %r9d
	leaq	16(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$13, %ecx
	movq	%r11, %rdi
	rep stosq
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rcx), %edx
	addq	$1, %rcx
	subl	$97, %edx
	movslq	%edx, %rdx
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rsi
	jne	.L5
	movq	%r9, %rcx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rcx), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	cmpl	$0, 16(%rsp,%rdx,4)
	jle	.L6
	movl	$0, 16(%rsp,%rdx,4)
	addl	$1, %edi
.L6:
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jg	.L7
	cmpl	%edi, %r10d
	cmovl	%edi, %r10d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%rbp, %r9
	jne	.L8
.L4:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$248, %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
.L10:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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 max(int a,int b){
  if(a>b) return a;
  return b;
}

int main(void){
  int n,i,j,ans=0,tmp;
  char s[101];
  
  scanf("%d %s",&n,s);

  for(i=1;i<n;i++){
    int alpha[26] = {};
    for(j=0;j<i;j++) alpha[s[j]-'a']++;
  
    tmp = 0;
    for(j=i;j<n;j++){
      if(alpha[s[j]-'a']>0){
        tmp++;
        alpha[s[j]-'a']=0;
      }
    }
    
    ans = max(ans,tmp);
  }
  
  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>

int max(int a,int b){
  if(a>b) return a;
  return b;
}

int main(void){
  int n,i,j,ans=0,tmp;
  char s[101];
  
  scanf("%d %s",&n,s);

  for(i=1;i<n;i++){
    int alpha[26] = {};
    for(j=0;j<i;j++) alpha[s[j]-'a']++;
  
    tmp = 0;
    for(j=i;j<n;j++){
      if(alpha[s[j]-'a']>0){
        tmp++;
        alpha[s[j]-'a']=0;
      }
    }
    
    ans = max(ans,tmp);
  }
  
  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

1
 2
 9
 10
 11
 1
 2
 12
 8

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 max(int a,int b){
  if(a>b) return a;
  return b;
}

int main(void){
  int n,i,j,ans=0,tmp;
  char s[101];
  
  scanf("%d %s",&n,s);

  for(i=1;i<n;i++){
    int alpha[26] = {};
    for(j=0;j<i;j++) alpha[s[j]-'a']++;
  
    tmp = 0;
    for(j=i;j<n;j++){
      if(alpha[s[j]-'a']>0){
        tmp++;
        alpha[s[j]-'a']=0;
      }
    }
    
    ans = max(ans,tmp);
  }
  
  printf("%d\n",ans);
  
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$248, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L10
	leaq	129(%rsp), %rsi
	movslq	%r8d, %rbp
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movl	$1, %r9d
	leaq	16(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$13, %ecx
	movq	%r11, %rdi
	rep stosq
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rcx), %edx
	addq	$1, %rcx
	subl	$97, %edx
	movslq	%edx, %rdx
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rsi
	jne	.L5
	movq	%r9, %rcx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rcx), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	cmpl	$0, 16(%rsp,%rdx,4)
	jle	.L6
	movl	$0, 16(%rsp,%rdx,4)
	addl	$1, %edi
.L6:
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jg	.L7
	cmpl	%edi, %r10d
	cmovl	%edi, %r10d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%rbp, %r9
	jne	.L8
.L4:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$248, %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
.L10:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	$248, %rsp
	.cfi_def_cfa_offset 272
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	128(%rsp), %rbx
	leaq	12(%rsp), %rsi
	movq	%rbx, %rdx
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %r8d
	cmpl	$1, %r8d
	jle	.L10
	leaq	129(%rsp), %rsi
	movslq	%r8d, %rbp
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	movl	$1, %r9d
	leaq	16(%rsp), %r11
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$13, %ecx
	movq	%r11, %rdi
	rep stosq
	movq	%rbx, %rcx
	.p2align 4,,10
	.p2align 3
.L5:
	movsbl	(%rcx), %edx
	addq	$1, %rcx
	subl	$97, %edx
	movslq	%edx, %rdx
	addl	$1, 16(%rsp,%rdx,4)
	cmpq	%rcx, %rsi
	jne	.L5
	movq	%r9, %rcx
	xorl	%edi, %edi
	.p2align 4,,10
	.p2align 3
.L7:
	movsbl	(%rbx,%rcx), %edx
	subl	$97, %edx
	movslq	%edx, %rdx
	cmpl	$0, 16(%rsp,%rdx,4)
	jle	.L6
	movl	$0, 16(%rsp,%rdx,4)
	addl	$1, %edi
.L6:
	addq	$1, %rcx
	cmpl	%ecx, %r8d
	jg	.L7
	cmpl	%edi, %r10d
	cmovl	%edi, %r10d
	addq	$1, %r9
	addq	$1, %rsi
	cmpq	%rbp, %r9
	jne	.L8
.L4:
	xorl	%eax, %eax
	movl	%r10d, %edx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L15
	addq	$248, %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
.L10:
	.cfi_restore_state
	xorl	%r10d, %r10d
	jmp	.L4
.L15:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```