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
   Hierarchical Democaracy
*/


#include<stdio.h>
#include<stdlib.h>

#define MAX_STR 10001

typedef struct block
{
  int majority, child_num;
  struct block *children[MAX_STR];
}block;


char str[MAX_STR];
int p;



block* new(void)
{
  block* ret = malloc(sizeof(block));
  ret->majority = 0;
  ret->child_num = 0;
  return ret;
}

int parse_num(void)
{
  int ret = 0, n;
  while('0' <= str[p] && str[p] <= '9')
    {
      n = str[p] - '0';
      ret = ret * 10 + n;
      p++;
    }
  return ret;
}

block* parse_block(void)
{
  block* ret = new();
  p++;
  if(str[p] == '[')
    {
      while(str[p] == '[')
	{
	  ret->children[ret->child_num] = parse_block();
	  ret->child_num++;
	  p++;
	}
    }
  else if('0' <= str[p] && str[p] <= '9')
    {
      ret->majority = (parse_num() / 2) + 1;
    }
  return ret;
}

int comp(const void *a, const void *b)
{
  int x = *(int *)a;
  int y = *(int *)b;

  if(x < y)
    return -1;
  else
    return 1;
}

int solve(block* b)
{
  int i;
  int majority_arr[MAX_STR];

  if(b->majority == 0)
    {
      for(i = 0; i < b->child_num; i++)
	majority_arr[i] = solve(b->children[i]);
      qsort(majority_arr, b->child_num, sizeof(int), comp);
      for(i = 0; i < (b->child_num / 2) + 1; i++)
	b->majority += majority_arr[i];
    }

  return b->majority;
}


void free_blocks(block* b)
{
  int i;
  if(b->child_num != 0)
      for(i = 0; i < b->child_num; i++)
	free_blocks(b->children[i]);
  free(b);
  return ;
}

void init(block* head)
{
  free_blocks(head);
  p = 0;
}

int main(void)
{
  int n, i;
  block *head;

  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%s", str);
      head = parse_block();
      printf("%d\n", solve(head));
      init(head);
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	str
	.bss
	.align 32
	.type	str, @object
	.size	str, 10001
str:
	.zero	10001
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.text
	.globl	new
	.type	new, @function
new:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$80016, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$0, 4(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new, .-new
	.globl	parse_num
	.type	parse_num, @function
parse_num:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	jmp	.L4
.L6:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
.L4:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L5
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jle	.L6
.L5:
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	parse_num, .-parse_num
	.globl	parse_block
	.type	parse_block, @function
parse_block:
.LFB8:
	.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	$24, %rsp
	.cfi_offset 3, -24
	call	new
	movq	%rax, -24(%rbp)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$91, %al
	jne	.L9
	jmp	.L10
.L11:
	movq	-24(%rbp), %rax
	movl	4(%rax), %ebx
	call	parse_block
	movq	-24(%rbp), %rdx
	movslq	%ebx, %rcx
	movq	%rax, 8(%rdx,%rcx,8)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
.L10:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$91, %al
	je	.L11
	jmp	.L12
.L9:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L12
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jg	.L12
	call	parse_num
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
.L12:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	parse_block, .-parse_block
	.globl	comp
	.type	comp, @function
comp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L15
	movl	$-1, %eax
	jmp	.L16
.L15:
	movl	$1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	comp, .-comp
	.globl	solve
	.type	solve, @function
solve:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%rdi, -40040(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-40040(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, -40020(%rbp)
	jmp	.L19
.L20:
	movq	-40040(%rbp), %rax
	movl	-40020(%rbp), %edx
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	solve
	movl	-40020(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -40016(%rbp,%rdx,4)
	addl	$1, -40020(%rbp)
.L19:
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -40020(%rbp)
	jl	.L20
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	movslq	%eax, %rsi
	leaq	-40016(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40020(%rbp)
	jmp	.L21
.L22:
	movq	-40040(%rbp), %rax
	movl	(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movq	-40040(%rbp), %rax
	movl	%edx, (%rax)
	addl	$1, -40020(%rbp)
.L21:
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40020(%rbp)
	jle	.L22
.L18:
	movq	-40040(%rbp), %rax
	movl	(%rax), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	solve, .-solve
	.globl	free_blocks
	.type	free_blocks, @function
free_blocks:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	testl	%eax, %eax
	je	.L26
	movl	$0, -4(%rbp)
	jmp	.L27
.L28:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	free_blocks
	addl	$1, -4(%rbp)
.L27:
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L28
.L26:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	free_blocks, .-free_blocks
	.globl	init
	.type	init, @function
init:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free_blocks
	movl	$0, p(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L32
.L33:
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	parse_block
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	solve
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	init
	addl	$1, -20(%rbp)
.L32:
	movl	-24(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L33
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	comp
	.type	comp, @function
comp:
.LFB42:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setge	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE42:
	.size	comp, .-comp
	.p2align 4
	.globl	new
	.type	new, @function
new:
.LFB39:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$80016, %edi
	call	malloc@PLT
	movq	$0, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	new, .-new
	.p2align 4
	.globl	parse_num
	.type	parse_num, @function
parse_num:
.LFB40:
	.cfi_startproc
	endbr64
	movslq	p(%rip), %rax
	leaq	str(%rip), %rsi
	movq	%rax, %rdx
	movzbl	(%rsi,%rax), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L10
	addl	$1, %edx
	xorl	%r8d, %r8d
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %eax
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %edi
	movsbl	%al, %eax
	leal	(%rax,%rcx,2), %r8d
	movzbl	(%rsi,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	jbe	.L9
	movl	%edi, p(%rip)
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	parse_num, .-parse_num
	.p2align 4
	.globl	parse_block
	.type	parse_block, @function
parse_block:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$80016, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	str(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	malloc@PLT
	movl	p(%rip), %edx
	movq	$0, (%rax)
	movq	%rax, %r12
	leal	1(%rdx), %eax
	movl	%eax, p(%rip)
	cltq
	movzbl	0(%rbp,%rax), %eax
	cmpb	$91, %al
	je	.L21
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L12
	addl	$2, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L17:
	subl	$48, %eax
	leal	(%rcx,%rcx,4), %ecx
	movl	%edx, %edi
	movsbl	%al, %eax
	leal	(%rax,%rcx,2), %ecx
	movzbl	0(%rbp,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %esi
	cmpb	$9, %sil
	jbe	.L17
	sarl	%ecx
	movl	%edi, p(%rip)
	addl	$1, %ecx
	movl	%ecx, (%r12)
.L12:
	movq	%r12, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	xorl	%ebx, %ebx
.L14:
	call	parse_block
	movslq	%ebx, %rbx
	movq	%rax, 8(%r12,%rbx,8)
	movl	4(%r12), %eax
	leal	1(%rax), %ebx
	movl	p(%rip), %eax
	movl	%ebx, 4(%r12)
	addl	$1, %eax
	movl	%eax, p(%rip)
	cltq
	cmpb	$91, 0(%rbp,%rax)
	je	.L14
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	parse_block, .-parse_block
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB43:
	.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
	leaq	-356352(%rsp), %r11
	.cfi_def_cfa 11, 356408
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3992, %rsp
	.cfi_def_cfa_offset 360400
	movq	%rdi, 168(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 360328(%rsp)
	movl	(%rdi), %eax
	testl	%eax, %eax
	jne	.L22
	movl	4(%rdi), %edx
	testl	%edx, %edx
	jle	.L125
	leaq	comp(%rip), %rax
	leaq	320320(%rsp), %r13
	movq	$0, 160(%rsp)
	movq	%rax, 16(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 184(%rsp)
.L81:
	movq	168(%rsp), %rax
	movq	160(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 144(%rsp)
	testl	%eax, %eax
	jne	.L25
	movl	4(%rdi), %edx
	leaq	40208(%rsp), %rax
	movq	%rax, 176(%rsp)
	testl	%edx, %edx
	jle	.L26
	movq	$0, 136(%rsp)
.L76:
	movq	144(%rsp), %rax
	movq	136(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 128(%rsp)
	testl	%eax, %eax
	jne	.L27
	movl	4(%rdi), %edx
	leaq	80224(%rsp), %rax
	movq	%rax, 152(%rsp)
	testl	%edx, %edx
	jle	.L28
	movq	$0, 120(%rsp)
.L71:
	movq	128(%rsp), %rax
	movq	120(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 104(%rsp)
	testl	%eax, %eax
	jne	.L29
	movl	4(%rdi), %edx
	leaq	120240(%rsp), %rax
	movq	%rax, 112(%rsp)
	testl	%edx, %edx
	jle	.L30
	movq	$0, 88(%rsp)
.L66:
	movq	104(%rsp), %rax
	movq	88(%rsp), %rdi
	movq	8(%rax,%rdi,8), %rbx
	movl	(%rbx), %eax
	movq	%rbx, 72(%rsp)
	testl	%eax, %eax
	jne	.L31
	movl	4(%rbx), %edx
	leaq	160256(%rsp), %rax
	movq	%rax, 96(%rsp)
	testl	%edx, %edx
	jle	.L32
	movq	$0, 56(%rsp)
.L61:
	movq	72(%rsp), %rax
	movq	56(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rbx
	movl	(%rbx), %eax
	movq	%rbx, 40(%rsp)
	testl	%eax, %eax
	jne	.L33
	movslq	4(%rbx), %rsi
	leaq	200272(%rsp), %rax
	movq	%rax, 64(%rsp)
	testl	%esi, %esi
	jle	.L34
	leaq	240288(%rsp), %rax
	movq	$0, 24(%rsp)
	movq	%rax, 32(%rsp)
.L56:
	movq	40(%rsp), %rax
	movq	24(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 8(%rsp)
	testl	%eax, %eax
	jne	.L35
	movslq	4(%rdi), %rsi
	testl	%esi, %esi
	jle	.L36
	leaq	280304(%rsp), %rax
	xorl	%ebp, %ebp
	movq	%rax, 48(%rsp)
.L51:
	movq	8(%rsp), %rax
	movq	8(%rax,%rbp,8), %rbx
	movl	(%rbx), %eax
	testl	%eax, %eax
	jne	.L37
	movslq	4(%rbx), %rsi
	testl	%esi, %esi
	jle	.L38
	movq	%rbp, 80(%rsp)
	movq	48(%rsp), %r12
	xorl	%r15d, %r15d
.L46:
	movq	8(%rbx,%r15,8), %rbp
	movl	0(%rbp), %eax
	testl	%eax, %eax
	jne	.L39
	movslq	4(%rbp), %rsi
	testl	%esi, %esi
	jle	.L40
	xorl	%r14d, %r14d
.L41:
	movq	8(%rbp,%r14,8), %rdi
	call	solve
	movslq	4(%rbp), %rsi
	movl	%eax, 0(%r13,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %esi
	jg	.L41
.L40:
	movq	16(%rsp), %rcx
	movl	$4, %edx
	movq	%r13, %rdi
	call	qsort@PLT
	movl	4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L126
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movl	0(%rbp), %edi
	cmovns	%edx, %ecx
	addl	$1, %ecx
	cmpl	$5, %eax
	jle	.L87
	movl	%ecx, %esi
	movq	%r13, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	320336(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L44:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L44
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edi, %eax
	andl	$3, %ecx
	je	.L45
.L43:
	movslq	%esi, %rcx
	addl	320320(%rsp,%rcx,4), %eax
	leal	1(%rsi), %ecx
	cmpl	%ecx, %edx
	jl	.L45
	movslq	%ecx, %rcx
	addl	$2, %esi
	addl	320320(%rsp,%rcx,4), %eax
	cmpl	%esi, %edx
	jl	.L45
	movslq	%esi, %rsi
	addl	320320(%rsp,%rsi,4), %eax
.L45:
	movl	%eax, 0(%rbp)
	movslq	4(%rbx), %rsi
.L39:
	movl	%eax, (%r12,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, %esi
	jg	.L46
	movq	80(%rsp), %rbp
.L38:
	movq	16(%rsp), %rcx
	movq	48(%rsp), %rdi
	movl	$4, %edx
	call	qsort@PLT
	movl	4(%rbx), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L127
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movl	(%rbx), %esi
	cmovns	%edx, %ecx
	leal	1(%rcx), %edi
	cmpl	$5, %eax
	jle	.L88
	movl	%edi, %ecx
	movq	48(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	280320(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L49:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L49
	movdqa	%xmm0, %xmm1
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L50
.L48:
	movslq	%ecx, %rsi
	addl	280304(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	jl	.L50
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	280304(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jl	.L50
	movslq	%ecx, %rcx
	addl	280304(%rsp,%rcx,4), %eax
.L50:
	movq	8(%rsp), %rdi
	movl	%eax, (%rbx)
	movslq	4(%rdi), %rsi
.L37:
	movq	32(%rsp), %rbx
	movl	%eax, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %esi
	jg	.L51
.L36:
	movq	16(%rsp), %rcx
	movq	32(%rsp), %rdi
	movl	$4, %edx
	call	qsort@PLT
	movq	8(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	$-1, %eax
	jl	.L128
	xorl	%edx, %edx
	testl	%ecx, %ecx
	movq	8(%rsp), %rdi
	cmovns	%ecx, %edx
	movl	(%rdi), %esi
	leal	1(%rdx), %edi
	cmpl	$5, %eax
	jle	.L89
	movl	%edi, %edx
	movq	32(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	240304(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L54:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L54
	movdqa	%xmm0, %xmm1
	movl	%edi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L55
.L53:
	movslq	%edx, %rsi
	addl	240288(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ecx, %esi
	jg	.L55
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	240288(%rsp,%rsi,4), %eax
	cmpl	%edx, %ecx
	jl	.L55
	movslq	%edx, %rdx
	addl	240288(%rsp,%rdx,4), %eax
.L55:
	movq	8(%rsp), %rbx
	movq	40(%rsp), %rdi
	movl	%eax, (%rbx)
	movslq	4(%rdi), %rsi
.L35:
	movq	24(%rsp), %rbx
	movq	64(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 24(%rsp)
	cmpl	%ebx, %esi
	jg	.L56
.L34:
	movq	16(%rsp), %rcx
	movq	64(%rsp), %rdi
	movl	$4, %edx
	call	qsort@PLT
	movq	40(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L129
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movq	40(%rsp), %rdi
	cmovns	%edx, %ecx
	movl	(%rdi), %esi
	leal	1(%rcx), %edi
	cmpl	$5, %eax
	jle	.L90
	movl	%edi, %ecx
	movq	64(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	200288(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L59:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	.L59
	movdqa	%xmm0, %xmm1
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L60
.L58:
	movslq	%ecx, %rsi
	addl	200272(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	jl	.L60
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	200272(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jl	.L60
	movslq	%ecx, %rcx
	addl	200272(%rsp,%rcx,4), %eax
.L60:
	movq	40(%rsp), %rdi
	movq	72(%rsp), %rbx
	movl	%eax, (%rdi)
	movl	4(%rbx), %edx
.L33:
	movq	56(%rsp), %rbx
	movq	96(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 56(%rsp)
	cmpl	%ebx, %edx
	jg	.L61
.L32:
	movq	16(%rsp), %rcx
	movq	96(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	72(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	$-1, %eax
	jl	.L130
	xorl	%edx, %edx
	testl	%ecx, %ecx
	movq	72(%rsp), %rdi
	cmovns	%ecx, %edx
	movl	(%rdi), %esi
	leal	1(%rdx), %edi
	cmpl	$5, %eax
	jle	.L91
	movl	%edi, %edx
	movq	96(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	160272(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L64:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L64
	movdqa	%xmm0, %xmm1
	movl	%edi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L65
.L63:
	movslq	%edx, %rsi
	addl	160256(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ecx, %esi
	jg	.L65
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	160256(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jg	.L65
	movslq	%edx, %rdx
	addl	160256(%rsp,%rdx,4), %eax
.L65:
	movq	72(%rsp), %rbx
	movq	104(%rsp), %rdx
	movl	%eax, (%rbx)
	movl	4(%rdx), %edx
.L31:
	movq	88(%rsp), %rdi
	movq	112(%rsp), %rbx
	movl	%eax, (%rbx,%rdi,4)
	addq	$1, %rdi
	movq	%rdi, 88(%rsp)
	cmpl	%edi, %edx
	jg	.L66
.L30:
	movq	16(%rsp), %rcx
	movq	112(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	104(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, %ecx
	cmpl	$-1, %eax
	jl	.L131
	xorl	%esi, %esi
	testl	%edx, %edx
	movq	104(%rsp), %rbx
	cmovns	%edx, %esi
	movl	(%rbx), %edi
	addl	$1, %esi
	cmpl	$5, %eax
	jle	.L92
	movl	%esi, %edx
	movq	112(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	120256(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L69:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L69
	movdqa	%xmm0, %xmm1
	movl	%esi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edi, %eax
	andl	$3, %esi
	je	.L70
.L68:
	movslq	%edx, %rsi
	addl	120240(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L70
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	120240(%rsp,%rsi,4), %eax
	cmpl	%edx, %ecx
	jl	.L70
	movslq	%edx, %rdx
	addl	120240(%rsp,%rdx,4), %eax
.L70:
	movq	104(%rsp), %rbx
	movl	%eax, (%rbx)
	movq	128(%rsp), %rbx
	movl	4(%rbx), %edx
.L29:
	movq	120(%rsp), %rbx
	movq	152(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 120(%rsp)
	cmpl	%ebx, %edx
	jg	.L71
.L28:
	movq	16(%rsp), %rcx
	movq	152(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	128(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L132
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movq	128(%rsp), %rbx
	cmovns	%edx, %ecx
	movl	(%rbx), %esi
	leal	1(%rcx), %edi
	cmpl	$5, %eax
	jle	.L93
	movl	%edi, %ecx
	movq	152(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	80240(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L74:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	.L74
	movdqa	%xmm0, %xmm1
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L75
.L73:
	movslq	%ecx, %rsi
	addl	80224(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	jl	.L75
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	80224(%rsp,%rsi,4), %eax
	cmpl	%edx, %ecx
	jg	.L75
	movslq	%ecx, %rcx
	addl	80224(%rsp,%rcx,4), %eax
.L75:
	movq	128(%rsp), %rdi
	movq	144(%rsp), %rbx
	movl	%eax, (%rdi)
	movl	4(%rbx), %edx
.L27:
	movq	136(%rsp), %rbx
	movq	176(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 136(%rsp)
	cmpl	%ebx, %edx
	jg	.L76
.L26:
	movq	16(%rsp), %rcx
	movq	176(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	144(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, %ecx
	cmpl	$-1, %eax
	jl	.L133
	xorl	%esi, %esi
	testl	%edx, %edx
	movq	144(%rsp), %rdi
	cmovns	%edx, %esi
	movl	(%rdi), %edi
	addl	$1, %esi
	cmpl	$5, %eax
	jle	.L94
	movl	%esi, %edx
	movq	176(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	40224(%rsp,%rdx), %rdx
.L79:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L79
	movdqa	%xmm0, %xmm1
	movl	%esi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edi, %eax
	andl	$3, %esi
	je	.L80
.L78:
	movslq	%edx, %rsi
	addl	40208(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ecx, %esi
	jg	.L80
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	40208(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jg	.L80
	movslq	%edx, %rdx
	addl	40208(%rsp,%rdx,4), %eax
.L80:
	movq	144(%rsp), %rbx
	movq	168(%rsp), %rdi
	movl	%eax, (%rbx)
	movl	4(%rdi), %edx
.L25:
	movq	160(%rsp), %rbx
	movq	184(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 160(%rsp)
	cmpl	%ebx, %edx
	jg	.L81
.L24:
	movq	184(%rsp), %rdi
	movq	16(%rsp), %rcx
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	168(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	cmpl	$-1, %eax
	jl	.L134
	xorl	%esi, %esi
	testl	%edi, %edi
	movq	168(%rsp), %rbx
	cmovns	%edi, %esi
	movl	(%rbx), %edx
	addl	$1, %esi
	cmpl	$5, %eax
	jle	.L95
	movl	%esi, %ecx
	movq	184(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	208(%rsp,%rcx), %rcx
.L84:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L84
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edx, %eax
	andl	$3, %esi
	je	.L85
.L83:
	movslq	%ecx, %rdx
	addl	192(%rsp,%rdx,4), %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %edi
	jl	.L85
	movslq	%edx, %rdx
	addl	$2, %ecx
	addl	192(%rsp,%rdx,4), %eax
	cmpl	%edi, %ecx
	jg	.L85
	movslq	%ecx, %rcx
	addl	192(%rsp,%rcx,4), %eax
.L85:
	movq	168(%rsp), %rdi
	movl	%eax, (%rdi)
.L22:
	movq	360328(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L135
	addq	$360344, %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
.L126:
	.cfi_restore_state
	movslq	4(%rbx), %rsi
	movl	0(%rbp), %eax
	jmp	.L39
.L87:
	xorl	%esi, %esi
	movl	%edi, %eax
	jmp	.L43
.L127:
	movq	8(%rsp), %rax
	movslq	4(%rax), %rsi
	movl	(%rbx), %eax
	jmp	.L37
.L88:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	jmp	.L48
.L128:
	movq	40(%rsp), %rax
	movslq	4(%rax), %rsi
	movq	8(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L35
.L89:
	xorl	%edx, %edx
	movl	%esi, %eax
	jmp	.L53
.L129:
	movq	72(%rsp), %rax
	movl	4(%rax), %edx
	movq	40(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L33
.L90:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	jmp	.L58
.L130:
	movq	104(%rsp), %rax
	movl	4(%rax), %edx
	movq	72(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L31
.L91:
	xorl	%edx, %edx
	movl	%esi, %eax
	jmp	.L63
.L131:
	movq	128(%rsp), %rax
	movl	4(%rax), %edx
	movq	104(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L29
.L92:
	xorl	%edx, %edx
	movl	%edi, %eax
	jmp	.L68
.L125:
	leaq	comp(%rip), %rax
	movq	%rax, 16(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 184(%rsp)
	jmp	.L24
.L132:
	movq	144(%rsp), %rax
	movl	4(%rax), %edx
	movq	128(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L27
.L93:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	jmp	.L73
.L133:
	movq	168(%rsp), %rax
	movl	4(%rax), %edx
	movq	144(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L25
.L94:
	xorl	%edx, %edx
	movl	%edi, %eax
	jmp	.L78
.L134:
	movq	168(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L22
.L95:
	xorl	%ecx, %ecx
	movl	%edx, %eax
	jmp	.L83
.L135:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	solve, .-solve
	.p2align 4
	.globl	free_blocks
	.type	free_blocks, @function
free_blocks:
.LFB44:
	.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	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	4(%rdi), %r11d
	movq	%rdi, 88(%rsp)
	testl	%r11d, %r11d
	jle	.L137
	movq	$0, 80(%rsp)
.L154:
	movq	88(%rsp), %rax
	movq	80(%rsp), %rdx
	movq	8(%rax,%rdx,8), %rax
	movl	4(%rax), %r10d
	movq	%rax, 72(%rsp)
	testl	%r10d, %r10d
	jle	.L138
	movq	$0, 64(%rsp)
.L153:
	movq	72(%rsp), %rax
	movq	64(%rsp), %rdx
	movq	8(%rax,%rdx,8), %rax
	movl	4(%rax), %r9d
	movq	%rax, 56(%rsp)
	testl	%r9d, %r9d
	jle	.L139
	movq	$0, 48(%rsp)
.L152:
	movq	56(%rsp), %rax
	movq	48(%rsp), %rsi
	movq	8(%rax,%rsi,8), %rax
	movl	4(%rax), %r8d
	movq	%rax, 40(%rsp)
	testl	%r8d, %r8d
	jle	.L140
	movq	$0, 32(%rsp)
.L151:
	movq	40(%rsp), %rax
	movq	32(%rsp), %rdx
	movq	8(%rax,%rdx,8), %rax
	movl	4(%rax), %edi
	movq	%rax, 24(%rsp)
	testl	%edi, %edi
	jle	.L141
	movq	$0, 16(%rsp)
.L150:
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rax
	movq	8(%rax,%rsi,8), %rax
	movl	4(%rax), %esi
	movq	%rax, 8(%rsp)
	testl	%esi, %esi
	jle	.L142
	movq	$0, (%rsp)
.L149:
	movq	8(%rsp), %rax
	movq	(%rsp), %rdx
	movq	8(%rax,%rdx,8), %r13
	movl	4(%r13), %ecx
	testl	%ecx, %ecx
	jle	.L143
	xorl	%r12d, %r12d
.L148:
	movq	8(%r13,%r12,8), %r15
	movl	4(%r15), %edx
	testl	%edx, %edx
	jle	.L144
	xorl	%r14d, %r14d
.L147:
	movq	8(%r15,%r14,8), %rbp
	movl	4(%rbp), %eax
	testl	%eax, %eax
	jle	.L145
	xorl	%ebx, %ebx
.L146:
	movq	8(%rbp,%rbx,8), %rdi
	addq	$1, %rbx
	call	free_blocks
	cmpl	%ebx, 4(%rbp)
	jg	.L146
.L145:
	movq	%rbp, %rdi
	addq	$1, %r14
	call	free@PLT
	cmpl	%r14d, 4(%r15)
	jg	.L147
.L144:
	movq	%r15, %rdi
	addq	$1, %r12
	call	free@PLT
	cmpl	%r12d, 4(%r13)
	jg	.L148
.L143:
	movq	%r13, %rdi
	call	free@PLT
	movq	8(%rsp), %rcx
	addq	$1, (%rsp)
	movq	(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L149
.L142:
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	24(%rsp), %rsi
	addq	$1, 16(%rsp)
	movq	16(%rsp), %rax
	cmpl	%eax, 4(%rsi)
	jg	.L150
.L141:
	movq	24(%rsp), %rdi
	call	free@PLT
	movq	40(%rsp), %rcx
	addq	$1, 32(%rsp)
	movq	32(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L151
.L140:
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	56(%rsp), %rsi
	addq	$1, 48(%rsp)
	movq	48(%rsp), %rax
	cmpl	%eax, 4(%rsi)
	jg	.L152
.L139:
	movq	56(%rsp), %rdi
	call	free@PLT
	movq	72(%rsp), %rcx
	addq	$1, 64(%rsp)
	movq	64(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L153
.L138:
	movq	72(%rsp), %rdi
	call	free@PLT
	movq	88(%rsp), %rcx
	addq	$1, 80(%rsp)
	movq	80(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L154
.L137:
	movq	88(%rsp), %rdi
	addq	$104, %rsp
	.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
	jmp	free@PLT
	.cfi_endproc
.LFE44:
	.size	free_blocks, .-free_blocks
	.p2align 4
	.globl	init
	.type	init, @function
init:
.LFB45:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	4(%rdi), %eax
	testl	%eax, %eax
	jle	.L166
	xorl	%ebx, %ebx
.L167:
	movq	8(%rbp,%rbx,8), %rdi
	addq	$1, %rbx
	call	free_blocks
	cmpl	%ebx, 4(%rbp)
	jg	.L167
.L166:
	movq	%rbp, %rdi
	call	free@PLT
	movl	$0, p(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE45:
	.size	init, .-init
	.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:
.LFB46:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L171
	xorl	%ebx, %ebx
	leaq	str(%rip), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L174:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	call	parse_block
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	solve
	movq	%r12, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rbp), %eax
	testl	%eax, %eax
	jle	.L172
	xorl	%r15d, %r15d
.L173:
	movq	8(%rbp,%r15,8), %rdi
	addq	$1, %r15
	call	free_blocks
	cmpl	%r15d, 4(%rbp)
	jg	.L173
.L172:
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	free@PLT
	movl	$0, p(%rip)
	cmpl	%ebx, 4(%rsp)
	jg	.L174
.L171:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L179
	addq	$24, %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
.L179:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE46:
	.size	main, .-main
	.globl	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 10001
str:
	.zero	10001
	.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	comp
	.type	comp, @function
comp:
.LFB42:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	cmpl	%eax, (%rdi)
	setge	%al
	movzbl	%al, %eax
	leal	-1(%rax,%rax), %eax
	ret
	.cfi_endproc
.LFE42:
	.size	comp, .-comp
	.p2align 4
	.globl	new
	.type	new, @function
new:
.LFB39:
	.cfi_startproc
	endbr64
	subq	$8, %rsp
	.cfi_def_cfa_offset 16
	movl	$80016, %edi
	call	malloc@PLT
	movq	$0, (%rax)
	addq	$8, %rsp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE39:
	.size	new, .-new
	.p2align 4
	.globl	parse_num
	.type	parse_num, @function
parse_num:
.LFB40:
	.cfi_startproc
	endbr64
	movslq	p(%rip), %rax
	leaq	str(%rip), %rsi
	movq	%rax, %rdx
	movzbl	(%rsi,%rax), %eax
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L10
	addl	$1, %edx
	xorl	%r8d, %r8d
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	subl	$48, %eax
	leal	(%r8,%r8,4), %ecx
	movl	%edx, %edi
	movsbl	%al, %eax
	leal	(%rax,%rcx,2), %r8d
	movzbl	(%rsi,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	jbe	.L9
	movl	%edi, p(%rip)
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	xorl	%r8d, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE40:
	.size	parse_num, .-parse_num
	.p2align 4
	.globl	parse_block
	.type	parse_block, @function
parse_block:
.LFB41:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	movl	$80016, %edi
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	str(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	malloc@PLT
	movl	p(%rip), %edx
	movq	$0, (%rax)
	movq	%rax, %r12
	leal	1(%rdx), %eax
	movl	%eax, p(%rip)
	cltq
	movzbl	0(%rbp,%rax), %eax
	cmpb	$91, %al
	je	.L21
	leal	-48(%rax), %ecx
	cmpb	$9, %cl
	ja	.L12
	addl	$2, %edx
	xorl	%ecx, %ecx
	movslq	%edx, %rdx
	.p2align 4,,10
	.p2align 3
.L17:
	subl	$48, %eax
	leal	(%rcx,%rcx,4), %ecx
	movl	%edx, %edi
	movsbl	%al, %eax
	leal	(%rax,%rcx,2), %ecx
	movzbl	0(%rbp,%rdx), %eax
	addq	$1, %rdx
	leal	-48(%rax), %esi
	cmpb	$9, %sil
	jbe	.L17
	sarl	%ecx
	movl	%edi, p(%rip)
	addl	$1, %ecx
	movl	%ecx, (%r12)
.L12:
	movq	%r12, %rax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	xorl	%ebx, %ebx
.L14:
	call	parse_block
	movslq	%ebx, %rbx
	movq	%rax, 8(%r12,%rbx,8)
	movl	4(%r12), %eax
	leal	1(%rax), %ebx
	movl	p(%rip), %eax
	movl	%ebx, 4(%r12)
	addl	$1, %eax
	movl	%eax, p(%rip)
	cltq
	cmpb	$91, 0(%rbp,%rax)
	je	.L14
	movq	%r12, %rax
	popq	%rbx
	.cfi_def_cfa_offset 24
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE41:
	.size	parse_block, .-parse_block
	.p2align 4
	.globl	solve
	.type	solve, @function
solve:
.LFB43:
	.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
	leaq	-356352(%rsp), %r11
	.cfi_def_cfa 11, 356408
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$3992, %rsp
	.cfi_def_cfa_offset 360400
	movq	%rdi, 168(%rsp)
	movq	%fs:40, %rax
	movq	%rax, 360328(%rsp)
	movl	(%rdi), %eax
	testl	%eax, %eax
	jne	.L22
	movl	4(%rdi), %edx
	testl	%edx, %edx
	jle	.L125
	leaq	comp(%rip), %rax
	leaq	320320(%rsp), %r13
	movq	$0, 160(%rsp)
	movq	%rax, 16(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 184(%rsp)
.L81:
	movq	168(%rsp), %rax
	movq	160(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 144(%rsp)
	testl	%eax, %eax
	jne	.L25
	movl	4(%rdi), %edx
	leaq	40208(%rsp), %rax
	movq	%rax, 176(%rsp)
	testl	%edx, %edx
	jle	.L26
	movq	$0, 136(%rsp)
.L76:
	movq	144(%rsp), %rax
	movq	136(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 128(%rsp)
	testl	%eax, %eax
	jne	.L27
	movl	4(%rdi), %edx
	leaq	80224(%rsp), %rax
	movq	%rax, 152(%rsp)
	testl	%edx, %edx
	jle	.L28
	movq	$0, 120(%rsp)
.L71:
	movq	128(%rsp), %rax
	movq	120(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 104(%rsp)
	testl	%eax, %eax
	jne	.L29
	movl	4(%rdi), %edx
	leaq	120240(%rsp), %rax
	movq	%rax, 112(%rsp)
	testl	%edx, %edx
	jle	.L30
	movq	$0, 88(%rsp)
.L66:
	movq	104(%rsp), %rax
	movq	88(%rsp), %rdi
	movq	8(%rax,%rdi,8), %rbx
	movl	(%rbx), %eax
	movq	%rbx, 72(%rsp)
	testl	%eax, %eax
	jne	.L31
	movl	4(%rbx), %edx
	leaq	160256(%rsp), %rax
	movq	%rax, 96(%rsp)
	testl	%edx, %edx
	jle	.L32
	movq	$0, 56(%rsp)
.L61:
	movq	72(%rsp), %rax
	movq	56(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rbx
	movl	(%rbx), %eax
	movq	%rbx, 40(%rsp)
	testl	%eax, %eax
	jne	.L33
	movslq	4(%rbx), %rsi
	leaq	200272(%rsp), %rax
	movq	%rax, 64(%rsp)
	testl	%esi, %esi
	jle	.L34
	leaq	240288(%rsp), %rax
	movq	$0, 24(%rsp)
	movq	%rax, 32(%rsp)
.L56:
	movq	40(%rsp), %rax
	movq	24(%rsp), %rbx
	movq	8(%rax,%rbx,8), %rdi
	movl	(%rdi), %eax
	movq	%rdi, 8(%rsp)
	testl	%eax, %eax
	jne	.L35
	movslq	4(%rdi), %rsi
	testl	%esi, %esi
	jle	.L36
	leaq	280304(%rsp), %rax
	xorl	%ebp, %ebp
	movq	%rax, 48(%rsp)
.L51:
	movq	8(%rsp), %rax
	movq	8(%rax,%rbp,8), %rbx
	movl	(%rbx), %eax
	testl	%eax, %eax
	jne	.L37
	movslq	4(%rbx), %rsi
	testl	%esi, %esi
	jle	.L38
	movq	%rbp, 80(%rsp)
	movq	48(%rsp), %r12
	xorl	%r15d, %r15d
.L46:
	movq	8(%rbx,%r15,8), %rbp
	movl	0(%rbp), %eax
	testl	%eax, %eax
	jne	.L39
	movslq	4(%rbp), %rsi
	testl	%esi, %esi
	jle	.L40
	xorl	%r14d, %r14d
.L41:
	movq	8(%rbp,%r14,8), %rdi
	call	solve
	movslq	4(%rbp), %rsi
	movl	%eax, 0(%r13,%r14,4)
	addq	$1, %r14
	cmpl	%r14d, %esi
	jg	.L41
.L40:
	movq	16(%rsp), %rcx
	movl	$4, %edx
	movq	%r13, %rdi
	call	qsort@PLT
	movl	4(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L126
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movl	0(%rbp), %edi
	cmovns	%edx, %ecx
	addl	$1, %ecx
	cmpl	$5, %eax
	jle	.L87
	movl	%ecx, %esi
	movq	%r13, %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %esi
	subl	$1, %esi
	salq	$4, %rsi
	leaq	320336(%rsp,%rsi), %rsi
	.p2align 4,,10
	.p2align 3
.L44:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rsi, %rax
	jne	.L44
	movdqa	%xmm0, %xmm1
	movl	%ecx, %esi
	psrldq	$8, %xmm1
	andl	$-4, %esi
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edi, %eax
	andl	$3, %ecx
	je	.L45
.L43:
	movslq	%esi, %rcx
	addl	320320(%rsp,%rcx,4), %eax
	leal	1(%rsi), %ecx
	cmpl	%ecx, %edx
	jl	.L45
	movslq	%ecx, %rcx
	addl	$2, %esi
	addl	320320(%rsp,%rcx,4), %eax
	cmpl	%esi, %edx
	jl	.L45
	movslq	%esi, %rsi
	addl	320320(%rsp,%rsi,4), %eax
.L45:
	movl	%eax, 0(%rbp)
	movslq	4(%rbx), %rsi
.L39:
	movl	%eax, (%r12,%r15,4)
	addq	$1, %r15
	cmpl	%r15d, %esi
	jg	.L46
	movq	80(%rsp), %rbp
.L38:
	movq	16(%rsp), %rcx
	movq	48(%rsp), %rdi
	movl	$4, %edx
	call	qsort@PLT
	movl	4(%rbx), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L127
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movl	(%rbx), %esi
	cmovns	%edx, %ecx
	leal	1(%rcx), %edi
	cmpl	$5, %eax
	jle	.L88
	movl	%edi, %ecx
	movq	48(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	280320(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L49:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L49
	movdqa	%xmm0, %xmm1
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L50
.L48:
	movslq	%ecx, %rsi
	addl	280304(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	jl	.L50
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	280304(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jl	.L50
	movslq	%ecx, %rcx
	addl	280304(%rsp,%rcx,4), %eax
.L50:
	movq	8(%rsp), %rdi
	movl	%eax, (%rbx)
	movslq	4(%rdi), %rsi
.L37:
	movq	32(%rsp), %rbx
	movl	%eax, (%rbx,%rbp,4)
	addq	$1, %rbp
	cmpl	%ebp, %esi
	jg	.L51
.L36:
	movq	16(%rsp), %rcx
	movq	32(%rsp), %rdi
	movl	$4, %edx
	call	qsort@PLT
	movq	8(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	$-1, %eax
	jl	.L128
	xorl	%edx, %edx
	testl	%ecx, %ecx
	movq	8(%rsp), %rdi
	cmovns	%ecx, %edx
	movl	(%rdi), %esi
	leal	1(%rdx), %edi
	cmpl	$5, %eax
	jle	.L89
	movl	%edi, %edx
	movq	32(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	240304(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L54:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L54
	movdqa	%xmm0, %xmm1
	movl	%edi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L55
.L53:
	movslq	%edx, %rsi
	addl	240288(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ecx, %esi
	jg	.L55
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	240288(%rsp,%rsi,4), %eax
	cmpl	%edx, %ecx
	jl	.L55
	movslq	%edx, %rdx
	addl	240288(%rsp,%rdx,4), %eax
.L55:
	movq	8(%rsp), %rbx
	movq	40(%rsp), %rdi
	movl	%eax, (%rbx)
	movslq	4(%rdi), %rsi
.L35:
	movq	24(%rsp), %rbx
	movq	64(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 24(%rsp)
	cmpl	%ebx, %esi
	jg	.L56
.L34:
	movq	16(%rsp), %rcx
	movq	64(%rsp), %rdi
	movl	$4, %edx
	call	qsort@PLT
	movq	40(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L129
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movq	40(%rsp), %rdi
	cmovns	%edx, %ecx
	movl	(%rdi), %esi
	leal	1(%rcx), %edi
	cmpl	$5, %eax
	jle	.L90
	movl	%edi, %ecx
	movq	64(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	200288(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L59:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	.L59
	movdqa	%xmm0, %xmm1
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L60
.L58:
	movslq	%ecx, %rsi
	addl	200272(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	jl	.L60
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	200272(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jl	.L60
	movslq	%ecx, %rcx
	addl	200272(%rsp,%rcx,4), %eax
.L60:
	movq	40(%rsp), %rdi
	movq	72(%rsp), %rbx
	movl	%eax, (%rdi)
	movl	4(%rbx), %edx
.L33:
	movq	56(%rsp), %rbx
	movq	96(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 56(%rsp)
	cmpl	%ebx, %edx
	jg	.L61
.L32:
	movq	16(%rsp), %rcx
	movq	96(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	72(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	cmpl	$-1, %eax
	jl	.L130
	xorl	%edx, %edx
	testl	%ecx, %ecx
	movq	72(%rsp), %rdi
	cmovns	%ecx, %edx
	movl	(%rdi), %esi
	leal	1(%rdx), %edi
	cmpl	$5, %eax
	jle	.L91
	movl	%edi, %edx
	movq	96(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	160272(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L64:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L64
	movdqa	%xmm0, %xmm1
	movl	%edi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L65
.L63:
	movslq	%edx, %rsi
	addl	160256(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ecx, %esi
	jg	.L65
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	160256(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jg	.L65
	movslq	%edx, %rdx
	addl	160256(%rsp,%rdx,4), %eax
.L65:
	movq	72(%rsp), %rbx
	movq	104(%rsp), %rdx
	movl	%eax, (%rbx)
	movl	4(%rdx), %edx
.L31:
	movq	88(%rsp), %rdi
	movq	112(%rsp), %rbx
	movl	%eax, (%rbx,%rdi,4)
	addq	$1, %rdi
	movq	%rdi, 88(%rsp)
	cmpl	%edi, %edx
	jg	.L66
.L30:
	movq	16(%rsp), %rcx
	movq	112(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	104(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, %ecx
	cmpl	$-1, %eax
	jl	.L131
	xorl	%esi, %esi
	testl	%edx, %edx
	movq	104(%rsp), %rbx
	cmovns	%edx, %esi
	movl	(%rbx), %edi
	addl	$1, %esi
	cmpl	$5, %eax
	jle	.L92
	movl	%esi, %edx
	movq	112(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	120256(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L69:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rdx
	jne	.L69
	movdqa	%xmm0, %xmm1
	movl	%esi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edi, %eax
	andl	$3, %esi
	je	.L70
.L68:
	movslq	%edx, %rsi
	addl	120240(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%esi, %ecx
	jl	.L70
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	120240(%rsp,%rsi,4), %eax
	cmpl	%edx, %ecx
	jl	.L70
	movslq	%edx, %rdx
	addl	120240(%rsp,%rdx,4), %eax
.L70:
	movq	104(%rsp), %rbx
	movl	%eax, (%rbx)
	movq	128(%rsp), %rbx
	movl	4(%rbx), %edx
.L29:
	movq	120(%rsp), %rbx
	movq	152(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 120(%rsp)
	cmpl	%ebx, %edx
	jg	.L71
.L28:
	movq	16(%rsp), %rcx
	movq	152(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	128(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	cmpl	$-1, %eax
	jl	.L132
	xorl	%ecx, %ecx
	testl	%edx, %edx
	movq	128(%rsp), %rbx
	cmovns	%edx, %ecx
	movl	(%rbx), %esi
	leal	1(%rcx), %edi
	cmpl	$5, %eax
	jle	.L93
	movl	%edi, %ecx
	movq	152(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	80240(%rsp,%rcx), %rcx
	.p2align 4,,10
	.p2align 3
.L74:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rax, %rcx
	jne	.L74
	movdqa	%xmm0, %xmm1
	movl	%edi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%esi, %eax
	andl	$3, %edi
	je	.L75
.L73:
	movslq	%ecx, %rsi
	addl	80224(%rsp,%rsi,4), %eax
	leal	1(%rcx), %esi
	cmpl	%esi, %edx
	jl	.L75
	movslq	%esi, %rsi
	addl	$2, %ecx
	addl	80224(%rsp,%rsi,4), %eax
	cmpl	%edx, %ecx
	jg	.L75
	movslq	%ecx, %rcx
	addl	80224(%rsp,%rcx,4), %eax
.L75:
	movq	128(%rsp), %rdi
	movq	144(%rsp), %rbx
	movl	%eax, (%rdi)
	movl	4(%rbx), %edx
.L27:
	movq	136(%rsp), %rbx
	movq	176(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 136(%rsp)
	cmpl	%ebx, %edx
	jg	.L76
.L26:
	movq	16(%rsp), %rcx
	movq	176(%rsp), %rdi
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	144(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%eax, %edx
	sarl	%edx
	movl	%edx, %ecx
	cmpl	$-1, %eax
	jl	.L133
	xorl	%esi, %esi
	testl	%edx, %edx
	movq	144(%rsp), %rdi
	cmovns	%edx, %esi
	movl	(%rdi), %edi
	addl	$1, %esi
	cmpl	$5, %eax
	jle	.L94
	movl	%esi, %edx
	movq	176(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %edx
	subl	$1, %edx
	salq	$4, %rdx
	leaq	40224(%rsp,%rdx), %rdx
.L79:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L79
	movdqa	%xmm0, %xmm1
	movl	%esi, %edx
	psrldq	$8, %xmm1
	andl	$-4, %edx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edi, %eax
	andl	$3, %esi
	je	.L80
.L78:
	movslq	%edx, %rsi
	addl	40208(%rsp,%rsi,4), %eax
	leal	1(%rdx), %esi
	cmpl	%ecx, %esi
	jg	.L80
	movslq	%esi, %rsi
	addl	$2, %edx
	addl	40208(%rsp,%rsi,4), %eax
	cmpl	%ecx, %edx
	jg	.L80
	movslq	%edx, %rdx
	addl	40208(%rsp,%rdx,4), %eax
.L80:
	movq	144(%rsp), %rbx
	movq	168(%rsp), %rdi
	movl	%eax, (%rbx)
	movl	4(%rdi), %edx
.L25:
	movq	160(%rsp), %rbx
	movq	184(%rsp), %rdi
	movl	%eax, (%rdi,%rbx,4)
	addq	$1, %rbx
	movq	%rbx, 160(%rsp)
	cmpl	%ebx, %edx
	jg	.L81
.L24:
	movq	184(%rsp), %rdi
	movq	16(%rsp), %rcx
	movslq	%edx, %rsi
	movl	$4, %edx
	call	qsort@PLT
	movq	168(%rsp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edi
	shrl	$31, %edi
	addl	%eax, %edi
	sarl	%edi
	cmpl	$-1, %eax
	jl	.L134
	xorl	%esi, %esi
	testl	%edi, %edi
	movq	168(%rsp), %rbx
	cmovns	%edi, %esi
	movl	(%rbx), %edx
	addl	$1, %esi
	cmpl	$5, %eax
	jle	.L95
	movl	%esi, %ecx
	movq	184(%rsp), %rax
	pxor	%xmm0, %xmm0
	shrl	$2, %ecx
	subl	$1, %ecx
	salq	$4, %rcx
	leaq	208(%rsp,%rcx), %rcx
.L84:
	paddd	(%rax), %xmm0
	addq	$16, %rax
	cmpq	%rcx, %rax
	jne	.L84
	movdqa	%xmm0, %xmm1
	movl	%esi, %ecx
	psrldq	$8, %xmm1
	andl	$-4, %ecx
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %eax
	addl	%edx, %eax
	andl	$3, %esi
	je	.L85
.L83:
	movslq	%ecx, %rdx
	addl	192(%rsp,%rdx,4), %eax
	leal	1(%rcx), %edx
	cmpl	%edx, %edi
	jl	.L85
	movslq	%edx, %rdx
	addl	$2, %ecx
	addl	192(%rsp,%rdx,4), %eax
	cmpl	%edi, %ecx
	jg	.L85
	movslq	%ecx, %rcx
	addl	192(%rsp,%rcx,4), %eax
.L85:
	movq	168(%rsp), %rdi
	movl	%eax, (%rdi)
.L22:
	movq	360328(%rsp), %rdx
	subq	%fs:40, %rdx
	jne	.L135
	addq	$360344, %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
.L126:
	.cfi_restore_state
	movslq	4(%rbx), %rsi
	movl	0(%rbp), %eax
	jmp	.L39
.L87:
	xorl	%esi, %esi
	movl	%edi, %eax
	jmp	.L43
.L127:
	movq	8(%rsp), %rax
	movslq	4(%rax), %rsi
	movl	(%rbx), %eax
	jmp	.L37
.L88:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	jmp	.L48
.L128:
	movq	40(%rsp), %rax
	movslq	4(%rax), %rsi
	movq	8(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L35
.L89:
	xorl	%edx, %edx
	movl	%esi, %eax
	jmp	.L53
.L129:
	movq	72(%rsp), %rax
	movl	4(%rax), %edx
	movq	40(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L33
.L90:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	jmp	.L58
.L130:
	movq	104(%rsp), %rax
	movl	4(%rax), %edx
	movq	72(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L31
.L91:
	xorl	%edx, %edx
	movl	%esi, %eax
	jmp	.L63
.L131:
	movq	128(%rsp), %rax
	movl	4(%rax), %edx
	movq	104(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L29
.L92:
	xorl	%edx, %edx
	movl	%edi, %eax
	jmp	.L68
.L125:
	leaq	comp(%rip), %rax
	movq	%rax, 16(%rsp)
	leaq	192(%rsp), %rax
	movq	%rax, 184(%rsp)
	jmp	.L24
.L132:
	movq	144(%rsp), %rax
	movl	4(%rax), %edx
	movq	128(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L27
.L93:
	xorl	%ecx, %ecx
	movl	%esi, %eax
	jmp	.L73
.L133:
	movq	168(%rsp), %rax
	movl	4(%rax), %edx
	movq	144(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L25
.L94:
	xorl	%edx, %edx
	movl	%edi, %eax
	jmp	.L78
.L134:
	movq	168(%rsp), %rax
	movl	(%rax), %eax
	jmp	.L22
.L95:
	xorl	%ecx, %ecx
	movl	%edx, %eax
	jmp	.L83
.L135:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE43:
	.size	solve, .-solve
	.p2align 4
	.globl	free_blocks
	.type	free_blocks, @function
free_blocks:
.LFB44:
	.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	$104, %rsp
	.cfi_def_cfa_offset 160
	movl	4(%rdi), %r11d
	movq	%rdi, 88(%rsp)
	testl	%r11d, %r11d
	jle	.L137
	movq	$0, 80(%rsp)
.L154:
	movq	88(%rsp), %rax
	movq	80(%rsp), %rdx
	movq	8(%rax,%rdx,8), %rax
	movl	4(%rax), %r10d
	movq	%rax, 72(%rsp)
	testl	%r10d, %r10d
	jle	.L138
	movq	$0, 64(%rsp)
.L153:
	movq	72(%rsp), %rax
	movq	64(%rsp), %rdx
	movq	8(%rax,%rdx,8), %rax
	movl	4(%rax), %r9d
	movq	%rax, 56(%rsp)
	testl	%r9d, %r9d
	jle	.L139
	movq	$0, 48(%rsp)
.L152:
	movq	56(%rsp), %rax
	movq	48(%rsp), %rsi
	movq	8(%rax,%rsi,8), %rax
	movl	4(%rax), %r8d
	movq	%rax, 40(%rsp)
	testl	%r8d, %r8d
	jle	.L140
	movq	$0, 32(%rsp)
.L151:
	movq	40(%rsp), %rax
	movq	32(%rsp), %rdx
	movq	8(%rax,%rdx,8), %rax
	movl	4(%rax), %edi
	movq	%rax, 24(%rsp)
	testl	%edi, %edi
	jle	.L141
	movq	$0, 16(%rsp)
.L150:
	movq	16(%rsp), %rsi
	movq	24(%rsp), %rax
	movq	8(%rax,%rsi,8), %rax
	movl	4(%rax), %esi
	movq	%rax, 8(%rsp)
	testl	%esi, %esi
	jle	.L142
	movq	$0, (%rsp)
.L149:
	movq	8(%rsp), %rax
	movq	(%rsp), %rdx
	movq	8(%rax,%rdx,8), %r13
	movl	4(%r13), %ecx
	testl	%ecx, %ecx
	jle	.L143
	xorl	%r12d, %r12d
.L148:
	movq	8(%r13,%r12,8), %r15
	movl	4(%r15), %edx
	testl	%edx, %edx
	jle	.L144
	xorl	%r14d, %r14d
.L147:
	movq	8(%r15,%r14,8), %rbp
	movl	4(%rbp), %eax
	testl	%eax, %eax
	jle	.L145
	xorl	%ebx, %ebx
.L146:
	movq	8(%rbp,%rbx,8), %rdi
	addq	$1, %rbx
	call	free_blocks
	cmpl	%ebx, 4(%rbp)
	jg	.L146
.L145:
	movq	%rbp, %rdi
	addq	$1, %r14
	call	free@PLT
	cmpl	%r14d, 4(%r15)
	jg	.L147
.L144:
	movq	%r15, %rdi
	addq	$1, %r12
	call	free@PLT
	cmpl	%r12d, 4(%r13)
	jg	.L148
.L143:
	movq	%r13, %rdi
	call	free@PLT
	movq	8(%rsp), %rcx
	addq	$1, (%rsp)
	movq	(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L149
.L142:
	movq	8(%rsp), %rdi
	call	free@PLT
	movq	24(%rsp), %rsi
	addq	$1, 16(%rsp)
	movq	16(%rsp), %rax
	cmpl	%eax, 4(%rsi)
	jg	.L150
.L141:
	movq	24(%rsp), %rdi
	call	free@PLT
	movq	40(%rsp), %rcx
	addq	$1, 32(%rsp)
	movq	32(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L151
.L140:
	movq	40(%rsp), %rdi
	call	free@PLT
	movq	56(%rsp), %rsi
	addq	$1, 48(%rsp)
	movq	48(%rsp), %rax
	cmpl	%eax, 4(%rsi)
	jg	.L152
.L139:
	movq	56(%rsp), %rdi
	call	free@PLT
	movq	72(%rsp), %rcx
	addq	$1, 64(%rsp)
	movq	64(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L153
.L138:
	movq	72(%rsp), %rdi
	call	free@PLT
	movq	88(%rsp), %rcx
	addq	$1, 80(%rsp)
	movq	80(%rsp), %rax
	cmpl	%eax, 4(%rcx)
	jg	.L154
.L137:
	movq	88(%rsp), %rdi
	addq	$104, %rsp
	.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
	jmp	free@PLT
	.cfi_endproc
.LFE44:
	.size	free_blocks, .-free_blocks
	.p2align 4
	.globl	init
	.type	init, @function
init:
.LFB45:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	movl	4(%rdi), %eax
	testl	%eax, %eax
	jle	.L166
	xorl	%ebx, %ebx
.L167:
	movq	8(%rbp,%rbx,8), %rdi
	addq	$1, %rbx
	call	free_blocks
	cmpl	%ebx, 4(%rbp)
	jg	.L167
.L166:
	movq	%rbp, %rdi
	call	free@PLT
	movl	$0, p(%rip)
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE45:
	.size	init, .-init
	.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:
.LFB46:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edx
	testl	%edx, %edx
	jle	.L171
	xorl	%ebx, %ebx
	leaq	str(%rip), %r14
	leaq	.LC1(%rip), %r13
	leaq	.LC2(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L174:
	movq	%r14, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	call	parse_block
	movq	%rax, %rdi
	movq	%rax, %rbp
	call	solve
	movq	%r12, %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	4(%rbp), %eax
	testl	%eax, %eax
	jle	.L172
	xorl	%r15d, %r15d
.L173:
	movq	8(%rbp,%r15,8), %rdi
	addq	$1, %r15
	call	free_blocks
	cmpl	%r15d, 4(%rbp)
	jg	.L173
.L172:
	movq	%rbp, %rdi
	addl	$1, %ebx
	call	free@PLT
	movl	$0, p(%rip)
	cmpl	%ebx, 4(%rsp)
	jg	.L174
.L171:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L179
	addq	$24, %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
.L179:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE46:
	.size	main, .-main
	.globl	p
	.bss
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.globl	str
	.align 32
	.type	str, @object
	.size	str, 10001
str:
	.zero	10001
	.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
   Hierarchical Democaracy
*/


#include<stdio.h>
#include<stdlib.h>

#define MAX_STR 10001

typedef struct block
{
  int majority, child_num;
  struct block *children[MAX_STR];
}block;


char str[MAX_STR];
int p;



block* new(void)
{
  block* ret = malloc(sizeof(block));
  ret->majority = 0;
  ret->child_num = 0;
  return ret;
}

int parse_num(void)
{
  int ret = 0, n;
  while('0' <= str[p] && str[p] <= '9')
    {
      n = str[p] - '0';
      ret = ret * 10 + n;
      p++;
    }
  return ret;
}

block* parse_block(void)
{
  block* ret = new();
  p++;
  if(str[p] == '[')
    {
      while(str[p] == '[')
	{
	  ret->children[ret->child_num] = parse_block();
	  ret->child_num++;
	  p++;
	}
    }
  else if('0' <= str[p] && str[p] <= '9')
    {
      ret->majority = (parse_num() / 2) + 1;
    }
  return ret;
}

int comp(const void *a, const void *b)
{
  int x = *(int *)a;
  int y = *(int *)b;

  if(x < y)
    return -1;
  else
    return 1;
}

int solve(block* b)
{
  int i;
  int majority_arr[MAX_STR];

  if(b->majority == 0)
    {
      for(i = 0; i < b->child_num; i++)
	majority_arr[i] = solve(b->children[i]);
      qsort(majority_arr, b->child_num, sizeof(int), comp);
      for(i = 0; i < (b->child_num / 2) + 1; i++)
	b->majority += majority_arr[i];
    }

  return b->majority;
}


void free_blocks(block* b)
{
  int i;
  if(b->child_num != 0)
      for(i = 0; i < b->child_num; i++)
	free_blocks(b->children[i]);
  free(b);
  return ;
}

void init(block* head)
{
  free_blocks(head);
  p = 0;
}

int main(void)
{
  int n, i;
  block *head;

  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%s", str);
      head = parse_block();
      printf("%d\n", solve(head));
      init(head);
    }
  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
   Hierarchical Democaracy
*/


#include<stdio.h>
#include<stdlib.h>

#define MAX_STR 10001

typedef struct block
{
  int majority, child_num;
  struct block *children[MAX_STR];
}block;


char str[MAX_STR];
int p;



block* new(void)
{
  block* ret = malloc(sizeof(block));
  ret->majority = 0;
  ret->child_num = 0;
  return ret;
}

int parse_num(void)
{
  int ret = 0, n;
  while('0' <= str[p] && str[p] <= '9')
    {
      n = str[p] - '0';
      ret = ret * 10 + n;
      p++;
    }
  return ret;
}

block* parse_block(void)
{
  block* ret = new();
  p++;
  if(str[p] == '[')
    {
      while(str[p] == '[')
	{
	  ret->children[ret->child_num] = parse_block();
	  ret->child_num++;
	  p++;
	}
    }
  else if('0' <= str[p] && str[p] <= '9')
    {
      ret->majority = (parse_num() / 2) + 1;
    }
  return ret;
}

int comp(const void *a, const void *b)
{
  int x = *(int *)a;
  int y = *(int *)b;

  if(x < y)
    return -1;
  else
    return 1;
}

int solve(block* b)
{
  int i;
  int majority_arr[MAX_STR];

  if(b->majority == 0)
    {
      for(i = 0; i < b->child_num; i++)
	majority_arr[i] = solve(b->children[i]);
      qsort(majority_arr, b->child_num, sizeof(int), comp);
      for(i = 0; i < (b->child_num / 2) + 1; i++)
	b->majority += majority_arr[i];
    }

  return b->majority;
}


void free_blocks(block* b)
{
  int i;
  if(b->child_num != 0)
      for(i = 0; i < b->child_num; i++)
	free_blocks(b->children[i]);
  free(b);
  return ;
}

void init(block* head)
{
  free_blocks(head);
  p = 0;
}

int main(void)
{
  int n, i;
  block *head;

  scanf("%d", &n);
  for(i = 0; i < n; i++)
    {
      scanf("%s", str);
      head = parse_block();
      printf("%d\n", solve(head));
      init(head);
    }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	str
	.bss
	.align 32
	.type	str, @object
	.size	str, 10001
str:
	.zero	10001
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.text
	.globl	new
	.type	new, @function
new:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$80016, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$0, 4(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new, .-new
	.globl	parse_num
	.type	parse_num, @function
parse_num:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	jmp	.L4
.L6:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
.L4:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L5
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jle	.L6
.L5:
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	parse_num, .-parse_num
	.globl	parse_block
	.type	parse_block, @function
parse_block:
.LFB8:
	.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	$24, %rsp
	.cfi_offset 3, -24
	call	new
	movq	%rax, -24(%rbp)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$91, %al
	jne	.L9
	jmp	.L10
.L11:
	movq	-24(%rbp), %rax
	movl	4(%rax), %ebx
	call	parse_block
	movq	-24(%rbp), %rdx
	movslq	%ebx, %rcx
	movq	%rax, 8(%rdx,%rcx,8)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
.L10:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$91, %al
	je	.L11
	jmp	.L12
.L9:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L12
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jg	.L12
	call	parse_num
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
.L12:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	parse_block, .-parse_block
	.globl	comp
	.type	comp, @function
comp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L15
	movl	$-1, %eax
	jmp	.L16
.L15:
	movl	$1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	comp, .-comp
	.globl	solve
	.type	solve, @function
solve:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%rdi, -40040(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-40040(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, -40020(%rbp)
	jmp	.L19
.L20:
	movq	-40040(%rbp), %rax
	movl	-40020(%rbp), %edx
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	solve
	movl	-40020(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -40016(%rbp,%rdx,4)
	addl	$1, -40020(%rbp)
.L19:
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -40020(%rbp)
	jl	.L20
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	movslq	%eax, %rsi
	leaq	-40016(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40020(%rbp)
	jmp	.L21
.L22:
	movq	-40040(%rbp), %rax
	movl	(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movq	-40040(%rbp), %rax
	movl	%edx, (%rax)
	addl	$1, -40020(%rbp)
.L21:
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40020(%rbp)
	jle	.L22
.L18:
	movq	-40040(%rbp), %rax
	movl	(%rax), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	solve, .-solve
	.globl	free_blocks
	.type	free_blocks, @function
free_blocks:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	testl	%eax, %eax
	je	.L26
	movl	$0, -4(%rbp)
	jmp	.L27
.L28:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	free_blocks
	addl	$1, -4(%rbp)
.L27:
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L28
.L26:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	free_blocks, .-free_blocks
	.globl	init
	.type	init, @function
init:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free_blocks
	movl	$0, p(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L32
.L33:
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	parse_block
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	solve
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	init
	addl	$1, -20(%rbp)
.L32:
	movl	-24(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L33
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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	str
	.bss
	.align 32
	.type	str, @object
	.size	str, 10001
str:
	.zero	10001
	.globl	p
	.align 4
	.type	p, @object
	.size	p, 4
p:
	.zero	4
	.text
	.globl	new
	.type	new, @function
new:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	$80016, %edi
	call	malloc@PLT
	movq	%rax, -8(%rbp)
	movq	-8(%rbp), %rax
	movl	$0, (%rax)
	movq	-8(%rbp), %rax
	movl	$0, 4(%rax)
	movq	-8(%rbp), %rax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	new, .-new
	.globl	parse_num
	.type	parse_num, @function
parse_num:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	$0, -8(%rbp)
	jmp	.L4
.L6:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	movsbl	%al, %eax
	subl	$48, %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	movl	%eax, %edx
	movl	-4(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -8(%rbp)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
.L4:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L5
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jle	.L6
.L5:
	movl	-8(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	parse_num, .-parse_num
	.globl	parse_block
	.type	parse_block, @function
parse_block:
.LFB8:
	.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	$24, %rsp
	.cfi_offset 3, -24
	call	new
	movq	%rax, -24(%rbp)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$91, %al
	jne	.L9
	jmp	.L10
.L11:
	movq	-24(%rbp), %rax
	movl	4(%rax), %ebx
	call	parse_block
	movq	-24(%rbp), %rdx
	movslq	%ebx, %rcx
	movq	%rax, 8(%rdx,%rcx,8)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, 4(%rax)
	movl	p(%rip), %eax
	addl	$1, %eax
	movl	%eax, p(%rip)
.L10:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$91, %al
	je	.L11
	jmp	.L12
.L9:
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$47, %al
	jle	.L12
	movl	p(%rip), %eax
	cltq
	leaq	str(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$57, %al
	jg	.L12
	call	parse_num
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	leal	1(%rax), %edx
	movq	-24(%rbp), %rax
	movl	%edx, (%rax)
.L12:
	movq	-24(%rbp), %rax
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	parse_block, .-parse_block
	.globl	comp
	.type	comp, @function
comp:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	%rsi, -32(%rbp)
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -8(%rbp)
	movq	-32(%rbp), %rax
	movl	(%rax), %eax
	movl	%eax, -4(%rbp)
	movl	-8(%rbp), %eax
	cmpl	-4(%rbp), %eax
	jge	.L15
	movl	$-1, %eax
	jmp	.L16
.L15:
	movl	$1, %eax
.L16:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	comp, .-comp
	.globl	solve
	.type	solve, @function
solve:
.LFB10:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-36864(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$3184, %rsp
	movq	%rdi, -40040(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	-40040(%rbp), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	jne	.L18
	movl	$0, -40020(%rbp)
	jmp	.L19
.L20:
	movq	-40040(%rbp), %rax
	movl	-40020(%rbp), %edx
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	solve
	movl	-40020(%rbp), %edx
	movslq	%edx, %rdx
	movl	%eax, -40016(%rbp,%rdx,4)
	addl	$1, -40020(%rbp)
.L19:
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -40020(%rbp)
	jl	.L20
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	movslq	%eax, %rsi
	leaq	-40016(%rbp), %rax
	leaq	comp(%rip), %rdx
	movq	%rdx, %rcx
	movl	$4, %edx
	movq	%rax, %rdi
	call	qsort@PLT
	movl	$0, -40020(%rbp)
	jmp	.L21
.L22:
	movq	-40040(%rbp), %rax
	movl	(%rax), %edx
	movl	-40020(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	addl	%eax, %edx
	movq	-40040(%rbp), %rax
	movl	%edx, (%rax)
	addl	$1, -40020(%rbp)
.L21:
	movq	-40040(%rbp), %rax
	movl	4(%rax), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	cmpl	%eax, -40020(%rbp)
	jle	.L22
.L18:
	movq	-40040(%rbp), %rax
	movl	(%rax), %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	solve, .-solve
	.globl	free_blocks
	.type	free_blocks, @function
free_blocks:
.LFB11:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	testl	%eax, %eax
	je	.L26
	movl	$0, -4(%rbp)
	jmp	.L27
.L28:
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movslq	%edx, %rdx
	movq	8(%rax,%rdx,8), %rax
	movq	%rax, %rdi
	call	free_blocks
	addl	$1, -4(%rbp)
.L27:
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L28
.L26:
	movq	-24(%rbp), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	free_blocks, .-free_blocks
	.globl	init
	.type	init, @function
init:
.LFB12:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movq	%rdi, -8(%rbp)
	movq	-8(%rbp), %rax
	movq	%rax, %rdi
	call	free_blocks
	movl	$0, p(%rip)
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	init, .-init
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%s"
.LC2:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB13:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -20(%rbp)
	jmp	.L32
.L33:
	leaq	str(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	call	parse_block
	movq	%rax, -16(%rbp)
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	solve
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	-16(%rbp), %rax
	movq	%rax, %rdi
	call	init
	addl	$1, -20(%rbp)
.L32:
	movl	-24(%rbp), %eax
	cmpl	%eax, -20(%rbp)
	jl	.L33
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.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:
