Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
  AOJ 1188
  Title:Hierarchical Democracy
  @kankichi573
*/
#include <stdio.h>
#include <string.h>

#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int compare(const void *a, const void *b)
{
  return *(int *)a - *(int *)b;
}


int solve(char s[],int len)
{
  int i,cnt,lv,ret,st;
  int kahan[3333];
  /*
  for(i=0;i<len;i++)
    printf("%c",s[i]);
  printf("\n");
  */
  if(isdigit(s[1]))
    return(atoi(&s[1])/2+1);
  lv=cnt=0;
  st=1;
  for(i=1;i<len-1;i++)
    {
      if(s[i]=='[')
	lv++;
      if(s[i]==']')
	lv--;
      if(lv==0)
	{
	  kahan[cnt]=solve(s+st,i-st+1);
	  cnt++;
	  st=i+1;
	}
    }
  qsort(kahan,cnt,sizeof(int),compare);
  for(i=ret=0;i<cnt/2+1;i++)
    ret+=kahan[i];
  return(ret);
}


main()
{
  int n,i,ret;
  char senkyoku[10001];

  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%s",senkyoku);
      ret=solve(senkyoku,strlen(senkyoku));
      printf("%d\n",ret);
    }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	compare, .-compare
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1104, %rsp
	movq	%rdi, -13384(%rbp)
	movl	%esi, -13388(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-13384(%rbp), %rax
	addq	$1, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L4
	movq	-13384(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	jmp	.L13
.L4:
	movl	$0, -13360(%rbp)
	movl	-13360(%rbp), %eax
	movl	%eax, -13356(%rbp)
	movl	$1, -13348(%rbp)
	movl	$1, -13364(%rbp)
	jmp	.L6
.L10:
	movl	-13364(%rbp), %eax
	movslq	%eax, %rdx
	movq	-13384(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$91, %al
	jne	.L7
	addl	$1, -13356(%rbp)
.L7:
	movl	-13364(%rbp), %eax
	movslq	%eax, %rdx
	movq	-13384(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$93, %al
	jne	.L8
	subl	$1, -13356(%rbp)
.L8:
	cmpl	$0, -13356(%rbp)
	jne	.L9
	movl	-13364(%rbp), %eax
	subl	-13348(%rbp), %eax
	leal	1(%rax), %edx
	movl	-13348(%rbp), %eax
	movslq	%eax, %rcx
	movq	-13384(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	solve
	movl	-13360(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -13344(%rbp,%rdx,4)
	addl	$1, -13360(%rbp)
	movl	-13364(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -13348(%rbp)
.L9:
	addl	$1, -13364(%rbp)
.L6:
	movl	-13388(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -13364(%rbp)
	jl	.L10
	movl	-13360(%rbp), %esi
	leaq	-13344(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -13352(%rbp)
	movl	-13352(%rbp), %eax
	movl	%eax, -13364(%rbp)
	jmp	.L11
.L12:
	movl	-13364(%rbp), %eax
	cltq
	movl	-13344(%rbp,%rax,4), %eax
	addl	%eax, -13352(%rbp)
	addl	$1, -13364(%rbp)
.L11:
	movl	-13360(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -13364(%rbp)
	jle	.L12
	movl	-13352(%rbp), %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1840, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10024(%rbp)
	jmp	.L16
.L17:
	leaq	-10016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-10016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	leaq	-10016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	solve
	movl	%eax, -10020(%rbp)
	movl	-10020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10024(%rbp)
.L16:
	movl	-10028(%rbp), %eax
	cmpl	%eax, -10024(%rbp)
	jl	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB35:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	compare, .-compare
	.p2align 4
	.type	solve.part.0, @function
solve.part.0:
.LFB38:
	.cfi_startproc
	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	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$1064, %rsp
	.cfi_def_cfa_offset 13408
	movq	%fs:40, %rax
	movq	%rax, 13336(%rsp)
	xorl	%eax, %eax
	cmpl	$2, %esi
	jle	.L4
	leal	-3(%rsi), %r15d
	movq	%rdi, %r14
	movl	$1, %ebx
	xorl	%r13d, %r13d
	addq	$2, %r15
	movl	$1, %edi
	xorl	%r12d, %r12d
.L10:
	movzbl	(%r14,%rbx), %eax
	movl	%ebx, %ebp
	movl	%ebx, %esi
	cmpb	$91, %al
	je	.L19
	cmpb	$93, %al
	sete	%al
	addl	$1, %ebp
	movzbl	%al, %eax
	subl	%eax, %r12d
	testl	%r12d, %r12d
	je	.L20
.L7:
	addq	$1, %rbx
	cmpq	%r15, %rbx
	jne	.L10
	movl	%r13d, %ebp
	movq	%rsp, %rbx
	leaq	compare(%rip), %rcx
	movl	%r13d, %esi
	sarl	%ebp
	movl	$4, %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	qsort@PLT
	leal	1(%rbp), %ecx
	cmpl	$2, %ebp
	jle	.L15
	movl	%ecx, %edx
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L12:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%ecx, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	andl	$3, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L3
.L11:
	movslq	%edx, %rcx
	addl	(%rsp,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ebp, %ecx
	jg	.L3
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	(%rsp,%rcx,4), %eax
	cmpl	%edx, %ebp
	jl	.L3
	movslq	%edx, %rdx
	addl	(%rsp,%rdx,4), %eax
.L3:
	movq	13336(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L21
	addq	$13352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L19:
	.cfi_restore_state
	addl	$1, %r12d
	addl	$1, %ebp
	testl	%r12d, %r12d
	jne	.L7
.L20:
	subl	%edi, %esi
	addq	%r14, %rdi
	movsbl	1(%rdi), %eax
	addl	$1, %esi
	subl	$48, %eax
	cmpl	$9, %eax
	jbe	.L22
	call	solve.part.0
.L9:
	movslq	%r13d, %rdx
	movslq	%ebp, %rdi
	addl	$1, %r13d
	movl	%eax, (%rsp,%rdx,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$1, %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsp, %rdi
	leaq	compare(%rip), %rcx
	xorl	%esi, %esi
	xorl	%eax, %eax
	movl	$4, %edx
	call	qsort@PLT
	movl	(%rsp), %eax
	jmp	.L3
.L15:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L11
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.size	solve.part.0, .-solve.part.0
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB36:
	.cfi_startproc
	endbr64
	movsbl	1(%rdi), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	jbe	.L27
	jmp	solve.part.0
	.p2align 4,,10
	.p2align 3
.L27:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	addq	$1, %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	solve, .-solve
	.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:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L31
	xorl	%ebx, %ebx
	leaq	16(%rsp), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	17(%rsp), %r14
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rbp, %rdi
	call	solve.part.0
	movl	%eax, %edx
.L37:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jle	.L31
.L34:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movsbl	17(%rsp), %edx
	movl	%eax, %esi
	subl	$48, %edx
	cmpl	$9, %edx
	ja	.L32
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	addl	$1, %edx
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L31:
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L38:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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
	.p2align 4
	.globl	compare
	.type	compare, @function
compare:
.LFB35:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE35:
	.size	compare, .-compare
	.p2align 4
	.type	solve.part.0, @function
solve.part.0:
.LFB38:
	.cfi_startproc
	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	$4096, %rsp
	.cfi_def_cfa_offset 12344
	orq	$0, (%rsp)
	subq	$1064, %rsp
	.cfi_def_cfa_offset 13408
	movq	%fs:40, %rax
	movq	%rax, 13336(%rsp)
	xorl	%eax, %eax
	cmpl	$2, %esi
	jle	.L4
	leal	-3(%rsi), %r15d
	movq	%rdi, %r14
	movl	$1, %ebx
	xorl	%r13d, %r13d
	addq	$2, %r15
	movl	$1, %edi
	xorl	%r12d, %r12d
.L10:
	movzbl	(%r14,%rbx), %eax
	movl	%ebx, %ebp
	movl	%ebx, %esi
	cmpb	$91, %al
	je	.L19
	cmpb	$93, %al
	sete	%al
	addl	$1, %ebp
	movzbl	%al, %eax
	subl	%eax, %r12d
	testl	%r12d, %r12d
	je	.L20
.L7:
	addq	$1, %rbx
	cmpq	%r15, %rbx
	jne	.L10
	movl	%r13d, %ebp
	movq	%rsp, %rbx
	leaq	compare(%rip), %rcx
	movl	%r13d, %esi
	sarl	%ebp
	movl	$4, %edx
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	qsort@PLT
	leal	1(%rbp), %ecx
	cmpl	$2, %ebp
	jle	.L15
	movl	%ecx, %edx
	movq	%rbx, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L12:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%ecx, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	andl	$3, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	je	.L3
.L11:
	movslq	%edx, %rcx
	addl	(%rsp,%rcx,4), %eax
	leal	1(%rdx), %ecx
	cmpl	%ebp, %ecx
	jg	.L3
	movslq	%ecx, %rcx
	addl	$2, %edx
	addl	(%rsp,%rcx,4), %eax
	cmpl	%edx, %ebp
	jl	.L3
	movslq	%edx, %rdx
	addl	(%rsp,%rdx,4), %eax
.L3:
	movq	13336(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L21
	addq	$13352, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L19:
	.cfi_restore_state
	addl	$1, %r12d
	addl	$1, %ebp
	testl	%r12d, %r12d
	jne	.L7
.L20:
	subl	%edi, %esi
	addq	%r14, %rdi
	movsbl	1(%rdi), %eax
	addl	$1, %esi
	subl	$48, %eax
	cmpl	$9, %eax
	jbe	.L22
	call	solve.part.0
.L9:
	movslq	%r13d, %rdx
	movslq	%ebp, %rdi
	addl	$1, %r13d
	movl	%eax, (%rsp,%rdx,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$1, %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L4:
	movq	%rsp, %rdi
	leaq	compare(%rip), %rcx
	xorl	%esi, %esi
	xorl	%eax, %eax
	movl	$4, %edx
	call	qsort@PLT
	movl	(%rsp), %eax
	jmp	.L3
.L15:
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L11
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE38:
	.size	solve.part.0, .-solve.part.0
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB36:
	.cfi_startproc
	endbr64
	movsbl	1(%rdi), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	jbe	.L27
	jmp	solve.part.0
	.p2align 4,,10
	.p2align 3
.L27:
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	addq	$1, %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	ret
	.cfi_endproc
.LFE36:
	.size	solve, .-solve
	.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:
.LFB37:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$4096, %rsp
	.cfi_def_cfa_offset 4144
	orq	$0, (%rsp)
	subq	$4096, %rsp
	.cfi_def_cfa_offset 8240
	orq	$0, (%rsp)
	subq	$1840, %rsp
	.cfi_def_cfa_offset 10080
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 10024(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	jle	.L31
	xorl	%ebx, %ebx
	leaq	16(%rsp), %rbp
	leaq	.LC1(%rip), %r12
	leaq	.LC2(%rip), %r13
	leaq	17(%rsp), %r14
	jmp	.L34
	.p2align 4,,10
	.p2align 3
.L32:
	movq	%rbp, %rdi
	call	solve.part.0
	movl	%eax, %edx
.L37:
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__printf_chk@PLT
	cmpl	%ebx, 12(%rsp)
	jle	.L31
.L34:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	%rbp, %rdi
	call	strlen@PLT
	movsbl	17(%rsp), %edx
	movl	%eax, %esi
	subl	$48, %edx
	cmpl	$9, %edx
	ja	.L32
	movq	%r14, %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	addl	$1, %edx
	jmp	.L37
	.p2align 4,,10
	.p2align 3
.L31:
	movq	10024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L38
	addq	$10032, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L38:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE37:
	.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:

/*
  AOJ 1188
  Title:Hierarchical Democracy
  @kankichi573
*/
#include <stdio.h>
#include <string.h>

#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int compare(const void *a, const void *b)
{
  return *(int *)a - *(int *)b;
}


int solve(char s[],int len)
{
  int i,cnt,lv,ret,st;
  int kahan[3333];
  /*
  for(i=0;i<len;i++)
    printf("%c",s[i]);
  printf("\n");
  */
  if(isdigit(s[1]))
    return(atoi(&s[1])/2+1);
  lv=cnt=0;
  st=1;
  for(i=1;i<len-1;i++)
    {
      if(s[i]=='[')
	lv++;
      if(s[i]==']')
	lv--;
      if(lv==0)
	{
	  kahan[cnt]=solve(s+st,i-st+1);
	  cnt++;
	  st=i+1;
	}
    }
  qsort(kahan,cnt,sizeof(int),compare);
  for(i=ret=0;i<cnt/2+1;i++)
    ret+=kahan[i];
  return(ret);
}


main()
{
  int n,i,ret;
  char senkyoku[10001];

  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%s",senkyoku);
      ret=solve(senkyoku,strlen(senkyoku));
      printf("%d\n",ret);
    }
  return(0);
}
6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[95][59][63][85][51]][[1539][7995][467]][[51][97][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[99][59][73][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[123][4567][89]]
[[5][3][6][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][94][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8853]]
 6
[[123][4567][89]]
[[5][3][7][3][9]]
[[[99][59][73][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4667][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1559][7995][467]][[51][57][79][99][3][91][39]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3271][8843]]
 6
[[133][4568][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3721][203][3371][8852]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[95][59][63][85][51]][[1539][7995][467]][[51][97][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8241][3731][203][3271][8943]]
 6
[[133][4567][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1539][7995][467]][[51][57][79][99][3][91][59]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][79][29]][[47][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8231][3711][203][3271][8853]]
 6
[[133][4667][89]]
[[5][3][7][3][9]]
[[[99][59][63][85][51]][[1559][7995][467]][[51][57][79][99][3][91][39]]]
[[[37][95][31][77][15]][[43][5][5][5][85]][[71][3][51][89][29]][[57][95][5][69][31]][[99][59][65][73][31]]]
[[[[9][7][3]][[3][5][7]][[7][9][5]]][[[9][9][3]][[5][9][9]][[7][7][3]]][[[5][9][7]][[3][9][3]][[9][5][5]]]]
[[8221][3731][203][3271][8843]]

112
7
175
95
21
3599
 112
7
186
95
21
3599
 112
7
180
95
21
3599
 107
7
175
95
21
3599
 107
7
180
95
21
3599
 112
7
165
95
21
3599
 112
7
175
95
21
3649
 112
7
186
95
21
3604
 112
7
175
95
21
3594
 112
7
165
95
21
3604

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
  AOJ 1188
  Title:Hierarchical Democracy
  @kankichi573
*/
#include <stdio.h>
#include <string.h>

#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int compare(const void *a, const void *b)
{
  return *(int *)a - *(int *)b;
}


int solve(char s[],int len)
{
  int i,cnt,lv,ret,st;
  int kahan[3333];
  /*
  for(i=0;i<len;i++)
    printf("%c",s[i]);
  printf("\n");
  */
  if(isdigit(s[1]))
    return(atoi(&s[1])/2+1);
  lv=cnt=0;
  st=1;
  for(i=1;i<len-1;i++)
    {
      if(s[i]=='[')
	lv++;
      if(s[i]==']')
	lv--;
      if(lv==0)
	{
	  kahan[cnt]=solve(s+st,i-st+1);
	  cnt++;
	  st=i+1;
	}
    }
  qsort(kahan,cnt,sizeof(int),compare);
  for(i=ret=0;i<cnt/2+1;i++)
    ret+=kahan[i];
  return(ret);
}


main()
{
  int n,i,ret;
  char senkyoku[10001];

  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%s",senkyoku);
      ret=solve(senkyoku,strlen(senkyoku));
      printf("%d\n",ret);
    }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	compare
	.type	compare, @function
compare:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	compare, .-compare
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1104, %rsp
	movq	%rdi, -13384(%rbp)
	movl	%esi, -13388(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-13384(%rbp), %rax
	addq	$1, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L4
	movq	-13384(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	jmp	.L13
.L4:
	movl	$0, -13360(%rbp)
	movl	-13360(%rbp), %eax
	movl	%eax, -13356(%rbp)
	movl	$1, -13348(%rbp)
	movl	$1, -13364(%rbp)
	jmp	.L6
.L10:
	movl	-13364(%rbp), %eax
	movslq	%eax, %rdx
	movq	-13384(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$91, %al
	jne	.L7
	addl	$1, -13356(%rbp)
.L7:
	movl	-13364(%rbp), %eax
	movslq	%eax, %rdx
	movq	-13384(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$93, %al
	jne	.L8
	subl	$1, -13356(%rbp)
.L8:
	cmpl	$0, -13356(%rbp)
	jne	.L9
	movl	-13364(%rbp), %eax
	subl	-13348(%rbp), %eax
	leal	1(%rax), %edx
	movl	-13348(%rbp), %eax
	movslq	%eax, %rcx
	movq	-13384(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	solve
	movl	-13360(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -13344(%rbp,%rdx,4)
	addl	$1, -13360(%rbp)
	movl	-13364(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -13348(%rbp)
.L9:
	addl	$1, -13364(%rbp)
.L6:
	movl	-13388(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -13364(%rbp)
	jl	.L10
	movl	-13360(%rbp), %esi
	leaq	-13344(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -13352(%rbp)
	movl	-13352(%rbp), %eax
	movl	%eax, -13364(%rbp)
	jmp	.L11
.L12:
	movl	-13364(%rbp), %eax
	cltq
	movl	-13344(%rbp,%rax,4), %eax
	addl	%eax, -13352(%rbp)
	addl	$1, -13364(%rbp)
.L11:
	movl	-13360(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -13364(%rbp)
	jle	.L12
	movl	-13352(%rbp), %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1840, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10024(%rbp)
	jmp	.L16
.L17:
	leaq	-10016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-10016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	leaq	-10016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	solve
	movl	%eax, -10020(%rbp)
	movl	-10020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10024(%rbp)
.L16:
	movl	-10028(%rbp), %eax
	cmpl	%eax, -10024(%rbp)
	jl	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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
	.globl	compare
	.type	compare, @function
compare:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -8(%rbp)
	movq	%rsi, -16(%rbp)
	movq	-8(%rbp), %rax
	movl	(%rax), %edx
	movq	-16(%rbp), %rax
	movl	(%rax), %ecx
	movl	%edx, %eax
	subl	%ecx, %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	compare, .-compare
	.globl	solve
	.type	solve, @function
solve:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1104, %rsp
	movq	%rdi, -13384(%rbp)
	movl	%esi, -13388(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-13384(%rbp), %rax
	addq	$1, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L4
	movq	-13384(%rbp), %rax
	addq	$1, %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	addl	$1, %eax
	jmp	.L13
.L4:
	movl	$0, -13360(%rbp)
	movl	-13360(%rbp), %eax
	movl	%eax, -13356(%rbp)
	movl	$1, -13348(%rbp)
	movl	$1, -13364(%rbp)
	jmp	.L6
.L10:
	movl	-13364(%rbp), %eax
	movslq	%eax, %rdx
	movq	-13384(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$91, %al
	jne	.L7
	addl	$1, -13356(%rbp)
.L7:
	movl	-13364(%rbp), %eax
	movslq	%eax, %rdx
	movq	-13384(%rbp), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$93, %al
	jne	.L8
	subl	$1, -13356(%rbp)
.L8:
	cmpl	$0, -13356(%rbp)
	jne	.L9
	movl	-13364(%rbp), %eax
	subl	-13348(%rbp), %eax
	leal	1(%rax), %edx
	movl	-13348(%rbp), %eax
	movslq	%eax, %rcx
	movq	-13384(%rbp), %rax
	addq	%rcx, %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	solve
	movl	-13360(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -13344(%rbp,%rdx,4)
	addl	$1, -13360(%rbp)
	movl	-13364(%rbp), %eax
	addl	$1, %eax
	movl	%eax, -13348(%rbp)
.L9:
	addl	$1, -13364(%rbp)
.L6:
	movl	-13388(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -13364(%rbp)
	jl	.L10
	movl	-13360(%rbp), %esi
	leaq	-13344(%rbp), %rax
	leaq	compare(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	movl	$0, %eax
	call	qsort@PLT
	movl	$0, -13352(%rbp)
	movl	-13352(%rbp), %eax
	movl	%eax, -13364(%rbp)
	jmp	.L11
.L12:
	movl	-13364(%rbp), %eax
	cltq
	movl	-13344(%rbp,%rax,4), %eax
	addl	%eax, -13352(%rbp)
	addl	$1, -13364(%rbp)
.L11:
	movl	-13360(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -13364(%rbp)
	jle	.L12
	movl	-13352(%rbp), %eax
.L13:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	solve, .-solve
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$4096, %rsp
	orq	$0, (%rsp)
	subq	$1840, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-10028(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -10024(%rbp)
	jmp	.L16
.L17:
	leaq	-10016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-10016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, %edx
	leaq	-10016(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	solve
	movl	%eax, -10020(%rbp)
	movl	-10020(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -10024(%rbp)
.L16:
	movl	-10028(%rbp), %eax
	cmpl	%eax, -10024(%rbp)
	jl	.L17
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L19
	call	__stack_chk_fail@PLT
.L19:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
