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>
#include <string.h>

int
main(int argc, char *argv[])
{
  int n; char s[100][100];
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%s", s[i]);
  }

  int l; int flag[100];

  for(int i = 0; i < strlen(s[0]); i++){
    l = 0;
    for(int j = 1; j < n; j++){
      for(int x = 0; x < strlen(s[j]); x++){
	if(s[j][x] == s[0][i]){
	  s[j][x] = '.';
	  l++;
	  break;
	}
      }
    }
    if(l == n - 1) flag[i] = 1;
    else flag[i] = 0;
  }

   char ss[100]; int h = 0;

   for(int i = 0; i < strlen(s[0]); i++){
    if(flag[i] == 1){
      ss[h] = s[0][i];
      h++;
    }
  }

  ss[h] = '\0';

  char d;

  for(int i = 0; i < h - 1; i++){
    for(int j = i + 1; j < h; j++){
      if(ss[i] > ss[j]){
	d = ss[i];
	ss[i] = ss[j];
	ss[j] = d;
      }
    }
  }

  printf("%s\n", ss);

  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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2392, %rsp
	.cfi_offset 3, -24
	movl	%edi, -10580(%rbp)
	movq	%rsi, -10592(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-10568(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10564(%rbp)
	jmp	.L2
.L3:
	leaq	-10128(%rbp), %rcx
	movl	-10564(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -10564(%rbp)
.L2:
	movl	-10568(%rbp), %eax
	cmpl	%eax, -10564(%rbp)
	jl	.L3
	movl	$0, -10556(%rbp)
	jmp	.L4
.L13:
	movl	$0, -10560(%rbp)
	movl	$1, -10552(%rbp)
	jmp	.L5
.L10:
	movl	$0, -10548(%rbp)
	jmp	.L6
.L9:
	movl	-10548(%rbp), %eax
	movslq	%eax, %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$10112, %rax
	movzbl	(%rax), %edx
	movl	-10556(%rbp), %eax
	cltq
	movzbl	-10128(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	movl	-10548(%rbp), %eax
	movslq	%eax, %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$10112, %rax
	movb	$46, (%rax)
	addl	$1, -10560(%rbp)
	jmp	.L8
.L7:
	addl	$1, -10548(%rbp)
.L6:
	movl	-10548(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L9
.L8:
	addl	$1, -10552(%rbp)
.L5:
	movl	-10568(%rbp), %eax
	cmpl	%eax, -10552(%rbp)
	jl	.L10
	movl	-10568(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -10560(%rbp)
	jne	.L11
	movl	-10556(%rbp), %eax
	cltq
	movl	$1, -10528(%rbp,%rax,4)
	jmp	.L12
.L11:
	movl	-10556(%rbp), %eax
	cltq
	movl	$0, -10528(%rbp,%rax,4)
.L12:
	addl	$1, -10556(%rbp)
.L4:
	movl	-10556(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L13
	movl	$0, -10544(%rbp)
	movl	$0, -10540(%rbp)
	jmp	.L14
.L16:
	movl	-10540(%rbp), %eax
	cltq
	movl	-10528(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	-10540(%rbp), %eax
	cltq
	movzbl	-10128(%rbp,%rax), %edx
	movl	-10544(%rbp), %eax
	cltq
	movb	%dl, -128(%rbp,%rax)
	addl	$1, -10544(%rbp)
.L15:
	addl	$1, -10540(%rbp)
.L14:
	movl	-10540(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L16
	movl	-10544(%rbp), %eax
	cltq
	movb	$0, -128(%rbp,%rax)
	movl	$0, -10536(%rbp)
	jmp	.L17
.L21:
	movl	-10536(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -10532(%rbp)
	jmp	.L18
.L20:
	movl	-10536(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	cmpb	%al, %dl
	jle	.L19
	movl	-10536(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	movb	%al, -10569(%rbp)
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-10536(%rbp), %eax
	cltq
	movb	%dl, -128(%rbp,%rax)
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-10569(%rbp), %edx
	movb	%dl, -128(%rbp,%rax)
.L19:
	addl	$1, -10532(%rbp)
.L18:
	movl	-10532(%rbp), %eax
	cmpl	-10544(%rbp), %eax
	jl	.L20
	addl	$1, -10536(%rbp)
.L17:
	movl	-10544(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -10536(%rbp)
	jl	.L21
	leaq	-128(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$2360, %rsp
	.cfi_def_cfa_offset 10608
	leaq	.LC0(%rip), %rdi
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 10536(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	leaq	432(%rsp), %rax
	movq	%rax, (%rsp)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$100, %r12
	cmpl	%ebp, %ebx
	jg	.L3
.L2:
	movq	(%rsp), %rdi
	leal	-1(%rbx), %eax
	xorl	%r12d, %r12d
	movq	(%rsp), %r14
	movl	%eax, 12(%rsp)
	call	strlen@PLT
	cmpq	%r12, %rax
	jbe	.L37
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	$1, %ebx
	jle	.L25
	leaq	532(%rsp), %r15
	movl	$1, %r13d
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r15, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	movzbl	(%r15,%rdx), %ecx
	addq	$1, %rdx
	cmpb	(%r14), %cl
	je	.L38
.L5:
	movslq	%edx, %rsi
	cmpq	%rdx, %rax
	jne	.L7
	addl	$1, %r13d
	addq	$100, %r15
	cmpl	%ebx, %r13d
	jne	.L12
.L8:
	xorl	%eax, %eax
	movq	(%rsp), %rdi
	cmpl	%ebp, 12(%rsp)
	sete	%al
	addq	$1, %r14
	movl	%eax, 32(%rsp,%r12,4)
	addq	$1, %r12
	call	strlen@PLT
	cmpq	%r12, %rax
	ja	.L9
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	leaq	32(%rsp), %rcx
	testq	%rax, %rax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	$1, (%rcx,%rdx,4)
	je	.L40
	addq	$1, %rdx
	cmpq	%rdx, %rax
	ja	.L10
.L15:
	movslq	%r10d, %rax
	leal	-1(%r10), %r11d
	leaq	10432(%rsp), %rbp
	movb	$0, 10432(%rsp,%rax)
	testl	%r11d, %r11d
	jle	.L19
	movq	%rbp, %rsi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %r8d
	cmpl	%r10d, %r8d
	jge	.L41
	movl	%r11d, %edi
	leaq	1(%rsi), %r9
	movq	%rsi, %rax
	subl	%r8d, %edi
	addq	%r9, %rdi
	.p2align 4,,10
	.p2align 3
.L21:
	movzbl	(%rsi), %edx
	movzbl	1(%rax), %ecx
	cmpb	%cl, %dl
	jle	.L20
	movb	%cl, (%rsi)
	movb	%dl, 1(%rax)
.L20:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L21
	movq	%r9, %rsi
	cmpl	%r11d, %r8d
	jne	.L18
.L19:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	10536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$10552, %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
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	movslq	%r13d, %rax
	addl	$1, %r13d
	addl	$1, %ebp
	addq	$100, %r15
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	10544(%rsp,%rax,4), %rax
	movb	$46, -10112(%rsi,%rax)
	cmpl	%ebx, %r13d
	jne	.L12
	jmp	.L8
.L40:
	movq	(%rsp), %rbx
	movslq	%r10d, %rsi
	addl	$1, %r10d
	movzbl	(%rbx,%rdx), %edi
	addq	$1, %rdx
	movb	%dil, 10432(%rsp,%rsi)
	cmpq	%rdx, %rax
	ja	.L10
	jmp	.L15
.L41:
	leaq	1(%rsi), %r9
	movq	%r9, %rsi
	cmpl	%r11d, %r8d
	jne	.L18
	jmp	.L19
.L25:
	xorl	%ebp, %ebp
	jmp	.L8
.L39:
	movb	$0, 10432(%rsp)
	leaq	10432(%rsp), %rbp
	jmp	.L19
.L42:
	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
	.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:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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	$4096, %rsp
	.cfi_def_cfa_offset 4152
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8248
	orq	$0, (%rsp)
	subq	$2360, %rsp
	.cfi_def_cfa_offset 10608
	leaq	.LC0(%rip), %rdi
	xorl	%ebp, %ebp
	leaq	.LC1(%rip), %r14
	movq	%fs:40, %rax
	movq	%rax, 10536(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	leaq	432(%rsp), %rax
	movq	%rax, (%rsp)
	movq	%rax, %r12
	testl	%ebx, %ebx
	jle	.L2
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %ebx
	addq	$100, %r12
	cmpl	%ebp, %ebx
	jg	.L3
.L2:
	movq	(%rsp), %rdi
	leal	-1(%rbx), %eax
	xorl	%r12d, %r12d
	movq	(%rsp), %r14
	movl	%eax, 12(%rsp)
	call	strlen@PLT
	cmpq	%r12, %rax
	jbe	.L37
	.p2align 4,,10
	.p2align 3
.L9:
	cmpl	$1, %ebx
	jle	.L25
	leaq	532(%rsp), %r15
	movl	$1, %r13d
	xorl	%ebp, %ebp
	.p2align 4,,10
	.p2align 3
.L12:
	movq	%r15, %rdi
	call	strlen@PLT
	xorl	%edx, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L7:
	movzbl	(%r15,%rdx), %ecx
	addq	$1, %rdx
	cmpb	(%r14), %cl
	je	.L38
.L5:
	movslq	%edx, %rsi
	cmpq	%rdx, %rax
	jne	.L7
	addl	$1, %r13d
	addq	$100, %r15
	cmpl	%ebx, %r13d
	jne	.L12
.L8:
	xorl	%eax, %eax
	movq	(%rsp), %rdi
	cmpl	%ebp, 12(%rsp)
	sete	%al
	addq	$1, %r14
	movl	%eax, 32(%rsp,%r12,4)
	addq	$1, %r12
	call	strlen@PLT
	cmpq	%r12, %rax
	ja	.L9
.L37:
	xorl	%edx, %edx
	xorl	%r10d, %r10d
	leaq	32(%rsp), %rcx
	testq	%rax, %rax
	je	.L39
	.p2align 4,,10
	.p2align 3
.L10:
	cmpl	$1, (%rcx,%rdx,4)
	je	.L40
	addq	$1, %rdx
	cmpq	%rdx, %rax
	ja	.L10
.L15:
	movslq	%r10d, %rax
	leal	-1(%r10), %r11d
	leaq	10432(%rsp), %rbp
	movb	$0, 10432(%rsp,%rax)
	testl	%r11d, %r11d
	jle	.L19
	movq	%rbp, %rsi
	xorl	%r8d, %r8d
	.p2align 4,,10
	.p2align 3
.L18:
	addl	$1, %r8d
	cmpl	%r10d, %r8d
	jge	.L41
	movl	%r11d, %edi
	leaq	1(%rsi), %r9
	movq	%rsi, %rax
	subl	%r8d, %edi
	addq	%r9, %rdi
	.p2align 4,,10
	.p2align 3
.L21:
	movzbl	(%rsi), %edx
	movzbl	1(%rax), %ecx
	cmpb	%cl, %dl
	jle	.L20
	movb	%cl, (%rsi)
	movb	%dl, 1(%rax)
.L20:
	addq	$1, %rax
	cmpq	%rdi, %rax
	jne	.L21
	movq	%r9, %rsi
	cmpl	%r11d, %r8d
	jne	.L18
.L19:
	movq	%rbp, %rdi
	call	puts@PLT
	movq	10536(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L42
	addq	$10552, %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
	.p2align 4,,10
	.p2align 3
.L38:
	.cfi_restore_state
	movslq	%r13d, %rax
	addl	$1, %r13d
	addl	$1, %ebp
	addq	$100, %r15
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	10544(%rsp,%rax,4), %rax
	movb	$46, -10112(%rsi,%rax)
	cmpl	%ebx, %r13d
	jne	.L12
	jmp	.L8
.L40:
	movq	(%rsp), %rbx
	movslq	%r10d, %rsi
	addl	$1, %r10d
	movzbl	(%rbx,%rdx), %edi
	addq	$1, %rdx
	movb	%dil, 10432(%rsp,%rsi)
	cmpq	%rdx, %rax
	ja	.L10
	jmp	.L15
.L41:
	leaq	1(%rsi), %r9
	movq	%r9, %rsi
	cmpl	%r11d, %r8d
	jne	.L18
	jmp	.L19
.L25:
	xorl	%ebp, %ebp
	jmp	.L8
.L39:
	movb	$0, 10432(%rsp)
	leaq	10432(%rsp), %rbp
	jmp	.L19
.L42:
	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:

#include <stdio.h>
#include <string.h>

int
main(int argc, char *argv[])
{
  int n; char s[100][100];
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%s", s[i]);
  }

  int l; int flag[100];

  for(int i = 0; i < strlen(s[0]); i++){
    l = 0;
    for(int j = 1; j < n; j++){
      for(int x = 0; x < strlen(s[j]); x++){
	if(s[j][x] == s[0][i]){
	  s[j][x] = '.';
	  l++;
	  break;
	}
      }
    }
    if(l == n - 1) flag[i] = 1;
    else flag[i] = 0;
  }

   char ss[100]; int h = 0;

   for(int i = 0; i < strlen(s[0]); i++){
    if(flag[i] == 1){
      ss[h] = s[0][i];
      h++;
    }
  }

  ss[h] = '\0';

  char d;

  for(int i = 0; i < h - 1; i++){
    for(int j = i + 1; j < h; j++){
      if(ss[i] > ss[j]){
	d = ss[i];
	ss[i] = ss[j];
	ss[j] = d;
      }
    }
  }

  printf("%s\n", ss);

  return 0;
}
3
caaa
daacc
acacac
 3
caaa
d`acc
acacac
 3
aaca
bdb`c
acacac
 3
a
aa
a
 3
caca
cca`d
acacac
 3
acba
da`cb
acacbc
 3
_a_b
c_bcb
abcada
 3
aad_
bdb_c
ababcd
 3
ba`c
bcb`c
abdbcb
 3
bcac
cc`be
acacbc

aac
 ac
 c
 a
 acc
 abc
 b
 d
 bc
 bcc

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>
#include <string.h>

int
main(int argc, char *argv[])
{
  int n; char s[100][100];
  scanf("%d", &n);
  for(int i = 0; i < n; i++){
    scanf("%s", s[i]);
  }

  int l; int flag[100];

  for(int i = 0; i < strlen(s[0]); i++){
    l = 0;
    for(int j = 1; j < n; j++){
      for(int x = 0; x < strlen(s[j]); x++){
	if(s[j][x] == s[0][i]){
	  s[j][x] = '.';
	  l++;
	  break;
	}
      }
    }
    if(l == n - 1) flag[i] = 1;
    else flag[i] = 0;
  }

   char ss[100]; int h = 0;

   for(int i = 0; i < strlen(s[0]); i++){
    if(flag[i] == 1){
      ss[h] = s[0][i];
      h++;
    }
  }

  ss[h] = '\0';

  char d;

  for(int i = 0; i < h - 1; i++){
    for(int j = i + 1; j < h; j++){
      if(ss[i] > ss[j]){
	d = ss[i];
	ss[i] = ss[j];
	ss[j] = d;
      }
    }
  }

  printf("%s\n", ss);

  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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2392, %rsp
	.cfi_offset 3, -24
	movl	%edi, -10580(%rbp)
	movq	%rsi, -10592(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-10568(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10564(%rbp)
	jmp	.L2
.L3:
	leaq	-10128(%rbp), %rcx
	movl	-10564(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -10564(%rbp)
.L2:
	movl	-10568(%rbp), %eax
	cmpl	%eax, -10564(%rbp)
	jl	.L3
	movl	$0, -10556(%rbp)
	jmp	.L4
.L13:
	movl	$0, -10560(%rbp)
	movl	$1, -10552(%rbp)
	jmp	.L5
.L10:
	movl	$0, -10548(%rbp)
	jmp	.L6
.L9:
	movl	-10548(%rbp), %eax
	movslq	%eax, %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$10112, %rax
	movzbl	(%rax), %edx
	movl	-10556(%rbp), %eax
	cltq
	movzbl	-10128(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	movl	-10548(%rbp), %eax
	movslq	%eax, %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$10112, %rax
	movb	$46, (%rax)
	addl	$1, -10560(%rbp)
	jmp	.L8
.L7:
	addl	$1, -10548(%rbp)
.L6:
	movl	-10548(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L9
.L8:
	addl	$1, -10552(%rbp)
.L5:
	movl	-10568(%rbp), %eax
	cmpl	%eax, -10552(%rbp)
	jl	.L10
	movl	-10568(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -10560(%rbp)
	jne	.L11
	movl	-10556(%rbp), %eax
	cltq
	movl	$1, -10528(%rbp,%rax,4)
	jmp	.L12
.L11:
	movl	-10556(%rbp), %eax
	cltq
	movl	$0, -10528(%rbp,%rax,4)
.L12:
	addl	$1, -10556(%rbp)
.L4:
	movl	-10556(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L13
	movl	$0, -10544(%rbp)
	movl	$0, -10540(%rbp)
	jmp	.L14
.L16:
	movl	-10540(%rbp), %eax
	cltq
	movl	-10528(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	-10540(%rbp), %eax
	cltq
	movzbl	-10128(%rbp,%rax), %edx
	movl	-10544(%rbp), %eax
	cltq
	movb	%dl, -128(%rbp,%rax)
	addl	$1, -10544(%rbp)
.L15:
	addl	$1, -10540(%rbp)
.L14:
	movl	-10540(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L16
	movl	-10544(%rbp), %eax
	cltq
	movb	$0, -128(%rbp,%rax)
	movl	$0, -10536(%rbp)
	jmp	.L17
.L21:
	movl	-10536(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -10532(%rbp)
	jmp	.L18
.L20:
	movl	-10536(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	cmpb	%al, %dl
	jle	.L19
	movl	-10536(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	movb	%al, -10569(%rbp)
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-10536(%rbp), %eax
	cltq
	movb	%dl, -128(%rbp,%rax)
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-10569(%rbp), %edx
	movb	%dl, -128(%rbp,%rax)
.L19:
	addl	$1, -10532(%rbp)
.L18:
	movl	-10532(%rbp), %eax
	cmpl	-10544(%rbp), %eax
	jl	.L20
	addl	$1, -10536(%rbp)
.L17:
	movl	-10544(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -10536(%rbp)
	jl	.L21
	leaq	-128(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	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
	pushq	%rbx
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$2392, %rsp
	.cfi_offset 3, -24
	movl	%edi, -10580(%rbp)
	movq	%rsi, -10592(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -24(%rbp)
	xorl	%eax, %eax
	leaq	-10568(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10564(%rbp)
	jmp	.L2
.L3:
	leaq	-10128(%rbp), %rcx
	movl	-10564(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -10564(%rbp)
.L2:
	movl	-10568(%rbp), %eax
	cmpl	%eax, -10564(%rbp)
	jl	.L3
	movl	$0, -10556(%rbp)
	jmp	.L4
.L13:
	movl	$0, -10560(%rbp)
	movl	$1, -10552(%rbp)
	jmp	.L5
.L10:
	movl	$0, -10548(%rbp)
	jmp	.L6
.L9:
	movl	-10548(%rbp), %eax
	movslq	%eax, %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$10112, %rax
	movzbl	(%rax), %edx
	movl	-10556(%rbp), %eax
	cltq
	movzbl	-10128(%rbp,%rax), %eax
	cmpb	%al, %dl
	jne	.L7
	movl	-10548(%rbp), %eax
	movslq	%eax, %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	-16(%rax), %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$10112, %rax
	movb	$46, (%rax)
	addl	$1, -10560(%rbp)
	jmp	.L8
.L7:
	addl	$1, -10548(%rbp)
.L6:
	movl	-10548(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rcx
	movl	-10552(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L9
.L8:
	addl	$1, -10552(%rbp)
.L5:
	movl	-10568(%rbp), %eax
	cmpl	%eax, -10552(%rbp)
	jl	.L10
	movl	-10568(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -10560(%rbp)
	jne	.L11
	movl	-10556(%rbp), %eax
	cltq
	movl	$1, -10528(%rbp,%rax,4)
	jmp	.L12
.L11:
	movl	-10556(%rbp), %eax
	cltq
	movl	$0, -10528(%rbp,%rax,4)
.L12:
	addl	$1, -10556(%rbp)
.L4:
	movl	-10556(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L13
	movl	$0, -10544(%rbp)
	movl	$0, -10540(%rbp)
	jmp	.L14
.L16:
	movl	-10540(%rbp), %eax
	cltq
	movl	-10528(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L15
	movl	-10540(%rbp), %eax
	cltq
	movzbl	-10128(%rbp,%rax), %edx
	movl	-10544(%rbp), %eax
	cltq
	movb	%dl, -128(%rbp,%rax)
	addl	$1, -10544(%rbp)
.L15:
	addl	$1, -10540(%rbp)
.L14:
	movl	-10540(%rbp), %eax
	movslq	%eax, %rbx
	leaq	-10128(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	cmpq	%rax, %rbx
	jb	.L16
	movl	-10544(%rbp), %eax
	cltq
	movb	$0, -128(%rbp,%rax)
	movl	$0, -10536(%rbp)
	jmp	.L17
.L21:
	movl	-10536(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -10532(%rbp)
	jmp	.L18
.L20:
	movl	-10536(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	cmpb	%al, %dl
	jle	.L19
	movl	-10536(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %eax
	movb	%al, -10569(%rbp)
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-128(%rbp,%rax), %edx
	movl	-10536(%rbp), %eax
	cltq
	movb	%dl, -128(%rbp,%rax)
	movl	-10532(%rbp), %eax
	cltq
	movzbl	-10569(%rbp), %edx
	movb	%dl, -128(%rbp,%rax)
.L19:
	addl	$1, -10532(%rbp)
.L18:
	movl	-10532(%rbp), %eax
	cmpl	-10544(%rbp), %eax
	jl	.L20
	addl	$1, -10536(%rbp)
.L17:
	movl	-10544(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -10536(%rbp)
	jl	.L21
	leaq	-128(%rbp), %rax
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-24(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	movq	-8(%rbp), %rbx
	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:
