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

```c
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

typedef struct{
  char name[128];
  unsigned int minprice;
  short fr_oth;
} item;

typedef struct{
  char to[128];
  unsigned int num;
  char **from;
} gosei;

item *list;
gosei *makelist;
unsigned int m,n;

void makegosei(gosei *var);
unsigned int makeans(item *var);
void freegosei(gosei *var);

int main(void){
  unsigned int i,j,k,ans;
  char tmpstr[128];
  unsigned int inputs;
  while(scanf("%u%*c",&n) &&n){
    list=(item *)calloc(n,sizeof(item));
    for(i=0;i<n;i++)
      scanf("%s %u%*c",list[i].name,&(list[i].minprice));

    scanf("%u%*c",&m);
    makelist=(gosei *)calloc(m,sizeof(gosei));
    for(i=0;i<m;i++){
      scanf("%s %u%*c",tmpstr,&inputs);
      for(j=0;j<n;j++){
	if(strcmp(list[j].name,tmpstr))continue;
	list[j].fr_oth=1;
	break;
      }
      strcpy(makelist[i].to,tmpstr);
      makelist[i].num=inputs;
      makegosei(makelist+i);
      for(j=0;j<makelist[i].num;j++)
	scanf("%s%*c",makelist[i].from[j]);
    }
    scanf("%s%*c",tmpstr);
    for(i=0;i<n;i++){
      if(strcmp(list[i].name,tmpstr)) continue;
      k=i;
      break;
    }
    
    ans=makeans(&list[k]);
    printf("%u\n",ans);
    free(list);
    for(i=0;i<m;i++) freegosei(makelist+i);
    free(makelist);
  }
  return 0;
}

void makegosei(gosei *var){
  unsigned int i;
  var->from=(char **)calloc(var->num,sizeof(char *));
  for(i=0;i<var->num;i++)
    (var->from)[i]=(char *)calloc(128,sizeof(char));
}

void freegosei(gosei *var){
  unsigned int i;
  for(i=0;i<var->num;i++)
    free((var->from)[i]);
  free(var->from);
}

unsigned int makeans(item *var){
  unsigned int i,j,k,tmp;
  if(var->fr_oth==1){
    tmp=0;
    for(i=0;i<m;i++){
      if(strcmp(makelist[i].to,var->name)) continue;
      k=i;
      break;
    }
    for(i=0;i<makelist[k].num;i++){
      for(j=0;j<n;j++){
	if(strcmp(makelist[k].from[i],list[j].name)) continue;
	break;
      }
      tmp+=makeans(&list[j]);
    }
    if(var->minprice>tmp) var->minprice=tmp;
    var->fr_oth=0;
  }
  return var->minprice;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	list
	.bss
	.align 8
	.type	list, @object
	.size	list, 8
list:
	.zero	8
	.globl	makelist
	.align 8
	.type	makelist, @object
	.size	makelist, 8
makelist:
	.zero	8
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s %u%*c"
.LC1:
	.string	"%u%*c"
.LC2:
	.string	"%s%*c"
.LC3:
	.string	"%u\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L22:
	movl	n(%rip), %eax
	movl	%eax, %eax
	movl	$136, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, list(%rip)
	movl	$0, -160(%rbp)
	jmp	.L3
.L4:
	movq	list(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	128(%rax), %rdx
	movq	list(%rip), %rsi
	movl	-160(%rbp), %ecx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -160(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L4
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	movl	%eax, %eax
	movl	$144, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, makelist(%rip)
	movl	$0, -160(%rbp)
	jmp	.L5
.L13:
	leaq	-164(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -156(%rbp)
	jmp	.L6
.L10:
	movq	list(%rip), %rcx
	movl	-156(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L27
	movq	list(%rip), %rcx
	movl	-156(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movw	$1, 132(%rax)
	jmp	.L9
.L27:
	nop
	addl	$1, -156(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -156(%rbp)
	jb	.L10
.L9:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	movl	-164(%rbp), %eax
	movl	%eax, 128(%rdx)
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makegosei
	movl	$0, -156(%rbp)
	jmp	.L11
.L12:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	136(%rax), %rdx
	movl	-156(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -156(%rbp)
.L11:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movl	128(%rax), %eax
	cmpl	%eax, -156(%rbp)
	jb	.L12
	addl	$1, -160(%rbp)
.L5:
	movl	m(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L13
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -160(%rbp)
	jmp	.L14
.L18:
	movq	list(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L28
	movl	-160(%rbp), %eax
	movl	%eax, -152(%rbp)
	jmp	.L17
.L28:
	nop
	addl	$1, -160(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L18
.L17:
	movq	list(%rip), %rcx
	movl	-152(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makeans
	movl	%eax, -148(%rbp)
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	list(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, -160(%rbp)
	jmp	.L19
.L20:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	freegosei
	addl	$1, -160(%rbp)
.L19:
	movl	m(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L20
	movq	makelist(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L21
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L22
.L21:
	movl	$0, %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
.LFE6:
	.size	main, .-main
	.globl	makegosei
	.type	makegosei, @function
makegosei:
.LFB7:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movq	-40(%rbp), %rax
	movl	128(%rax), %eax
	movl	%eax, %eax
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rdx, 136(%rax)
	movl	$0, -20(%rbp)
	jmp	.L30
.L31:
	movq	-40(%rbp), %rax
	movq	136(%rax), %rdx
	movl	-20(%rbp), %eax
	salq	$3, %rax
	leaq	(%rdx,%rax), %rbx
	movl	$1, %esi
	movl	$128, %edi
	call	calloc@PLT
	movq	%rax, (%rbx)
	addl	$1, -20(%rbp)
.L30:
	movq	-40(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jb	.L31
	nop
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	makegosei, .-makegosei
	.globl	freegosei
	.type	freegosei, @function
freegosei:
.LFB8:
	.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)
	movl	$0, -4(%rbp)
	jmp	.L33
.L34:
	movq	-24(%rbp), %rax
	movq	136(%rax), %rdx
	movl	-4(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	addl	$1, -4(%rbp)
.L33:
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jb	.L34
	movq	-24(%rbp), %rax
	movq	136(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	freegosei, .-freegosei
	.globl	makeans
	.type	makeans, @function
makeans:
.LFB9:
	.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
	movzwl	132(%rax), %eax
	cmpw	$1, %ax
	jne	.L36
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L37
.L41:
	movq	-24(%rbp), %rdx
	movq	makelist(%rip), %rsi
	movl	-16(%rbp), %ecx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L52
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L40
.L52:
	nop
	addl	$1, -16(%rbp)
.L37:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jb	.L41
.L40:
	movl	$0, -16(%rbp)
	jmp	.L42
.L48:
	movl	$0, -12(%rbp)
	jmp	.L43
.L47:
	movq	list(%rip), %rcx
	movl	-12(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rcx
	movq	makelist(%rip), %rsi
	movl	-8(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	136(%rax), %rdx
	movl	-16(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L53
	nop
	addl	$1, -12(%rbp)
.L43:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jb	.L47
	jmp	.L46
.L53:
	nop
.L46:
	movq	list(%rip), %rcx
	movl	-12(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makeans
	addl	%eax, -4(%rbp)
	addl	$1, -16(%rbp)
.L42:
	movq	makelist(%rip), %rcx
	movl	-8(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movl	128(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jb	.L48
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jnb	.L49
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, 128(%rax)
.L49:
	movq	-24(%rbp), %rax
	movw	$0, 132(%rax)
.L36:
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	makeans, .-makeans
	.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	makegosei
	.type	makegosei, @function
makegosei:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$8, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	128(%rdi), %r13d
	movq	%r13, %rdi
	call	calloc@PLT
	movq	%rax, 136(%rbp)
	testl	%r13d, %r13d
	je	.L1
	movq	%rax, %rbx
	leaq	(%rax,%r13,8), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$1, %esi
	movl	$128, %edi
	addq	$8, %rbx
	call	calloc@PLT
	movq	%rax, -8(%rbx)
	cmpq	%rbp, %rbx
	jne	.L3
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	makegosei, .-makegosei
	.p2align 4
	.globl	freegosei
	.type	freegosei, @function
freegosei:
.LFB53:
	.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	128(%rdi), %eax
	testl	%eax, %eax
	je	.L11
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L12:
	movq	136(%rbp), %rax
	movl	%ebx, %edx
	addl	$1, %ebx
	movq	(%rax,%rdx,8), %rdi
	call	free@PLT
	cmpl	%ebx, 128(%rbp)
	ja	.L12
.L11:
	movq	136(%rbp), %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE53:
	.size	freegosei, .-freegosei
	.p2align 4
	.globl	makeans
	.type	makeans, @function
makeans:
.LFB54:
	.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
	movq	%rdi, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	cmpw	$1, 132(%rdi)
	je	.L16
	movl	128(%rdi), %eax
	addq	$40, %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
.L16:
	.cfi_restore_state
	movq	makelist(%rip), %rbp
	movl	m(%rip), %eax
	movq	%rbp, %r13
	testl	%eax, %eax
	je	.L19
	subl	$1, %eax
	leaq	(%rax,%rax,8), %rax
	salq	$4, %rax
	leaq	144(%rbp,%rax), %r12
.L20:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L39
.L19:
	movl	128(%r13), %r12d
	testl	%r12d, %r12d
	je	.L21
	movq	list(%rip), %rax
	xorl	%ebp, %ebp
	movq	%rax, 16(%rsp)
	leaq	0(,%r12,8), %rax
	xorl	%r12d, %r12d
	movq	%rax, 24(%rsp)
.L22:
	movl	n(%rip), %eax
	movq	16(%rsp), %r15
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	je	.L23
	movq	136(%r13), %rax
	movl	$0, 8(%rsp)
	movq	16(%rsp), %r8
	movq	(%rax,%rbp), %r14
.L24:
	movq	%r8, %rsi
	movq	%r14, %rdi
	movq	%r8, %r15
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L40
.L23:
	movq	%r15, %rdi
	addq	$8, %rbp
	call	makeans
	addl	%eax, %r12d
	cmpq	%rbp, 24(%rsp)
	jne	.L22
.L21:
	movl	128(%rbx), %eax
	cmpl	%r12d, %eax
	jbe	.L26
	movl	%r12d, 128(%rbx)
	movl	%r12d, %eax
.L26:
	xorl	%edx, %edx
	movw	%dx, 132(%rbx)
	addq	$40, %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
.L40:
	.cfi_restore_state
	addl	$1, 8(%rsp)
	leaq	136(%r15), %r8
	movl	8(%rsp), %eax
	cmpl	12(%rsp), %eax
	jne	.L24
	movl	%eax, %r15d
	movq	16(%rsp), %rcx
	movq	%r15, %rax
	salq	$4, %rax
	addq	%r15, %rax
	leaq	(%rcx,%rax,8), %r15
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L39:
	addq	$144, %r13
	cmpq	%r13, %r12
	jne	.L20
	movq	%rbp, %r13
	jmp	.L19
	.cfi_endproc
.LFE54:
	.size	makeans, .-makeans
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s %u%*c"
.LC1:
	.string	"%u%*c"
.LC2:
	.string	"%s%*c"
.LC3:
	.string	"%u\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L61
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L61
	movl	%eax, %edi
	movl	$136, %esi
	xorl	%ebx, %ebx
	call	calloc@PLT
	movq	%rax, list(%rip)
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L93:
	movq	list(%rip), %rax
.L44:
	movl	%ebx, %ecx
	leaq	.LC0(%rip), %rdi
	addl	$1, %ebx
	movq	%rcx, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	leaq	(%rax,%rdx,8), %rsi
	xorl	%eax, %eax
	leaq	128(%rsi), %rdx
	call	__isoc99_scanf@PLT
	cmpl	%ebx, n(%rip)
	ja	.L93
	leaq	m(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edi
	movl	$144, %esi
	leaq	48(%rsp), %r14
	movq	%rdi, %rbx
	call	calloc@PLT
	movl	$0, 24(%rsp)
	movq	%rax, makelist(%rip)
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	testl	%ebx, %ebx
	je	.L54
	.p2align 4,,10
	.p2align 3
.L45:
	movq	16(%rsp), %rdx
	movq	%r14, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L48
	leal	-1(%rax), %edx
	movq	list(%rip), %rbx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	leaq	136(%rbx,%rax,8), %rbp
.L50:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L94
	movl	$1, %ecx
	movw	%cx, 132(%rbx)
.L48:
	movl	24(%rsp), %eax
	movq	makelist(%rip), %rdi
	movl	$128, %edx
	movq	%r14, %rsi
	leaq	(%rax,%rax,8), %rbp
	salq	$4, %rbp
	addq	%rbp, %rdi
	call	__strcpy_chk@PLT
	movq	makelist(%rip), %r13
	movl	44(%rsp), %edi
	movl	$8, %esi
	addq	%rbp, %r13
	movq	%rdi, 8(%rsp)
	movq	%rdi, %rbx
	movl	%edi, 128(%r13)
	call	calloc@PLT
	movq	%rax, 136(%r13)
	movq	%rax, %r15
	testl	%ebx, %ebx
	je	.L51
	movq	8(%rsp), %rdi
	movq	%rax, %r13
	leaq	(%rax,%rdi,8), %rbx
	.p2align 4,,10
	.p2align 3
.L52:
	movl	$1, %esi
	movl	$128, %edi
	addq	$8, %r13
	call	calloc@PLT
	movq	%rax, -8(%r13)
	cmpq	%r13, %rbx
	jne	.L52
	xorl	%ebx, %ebx
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L95:
	movq	136(%rax), %r15
.L53:
	movl	%ebx, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	movq	(%r15,%rax,8), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	makelist(%rip), %rax
	addq	%rbp, %rax
	cmpl	%ebx, 128(%rax)
	ja	.L95
.L51:
	addl	$1, 24(%rsp)
	movl	24(%rsp), %eax
	cmpl	%eax, m(%rip)
	ja	.L45
.L54:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ebx
	testl	%ebx, %ebx
	je	.L96
	movq	list(%rip), %rbp
	xorl	%r13d, %r13d
	movq	%rbp, %r15
.L56:
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L97
.L55:
	movq	%r15, %rdi
	xorl	%r14d, %r14d
	call	makeans
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	list(%rip), %rdi
	call	free@PLT
	movl	m(%rip), %edx
	testl	%edx, %edx
	je	.L59
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%r14d, %eax
	xorl	%ebx, %ebx
	leaq	(%rax,%rax,8), %rbp
	salq	$4, %rbp
	addq	makelist(%rip), %rbp
	movl	128(%rbp), %eax
	testl	%eax, %eax
	je	.L60
	.p2align 4,,10
	.p2align 3
.L58:
	movq	136(%rbp), %rax
	movl	%ebx, %edx
	addl	$1, %ebx
	movq	(%rax,%rdx,8), %rdi
	call	free@PLT
	cmpl	128(%rbp), %ebx
	jb	.L58
.L60:
	movq	136(%rbp), %rdi
	addl	$1, %r14d
	call	free@PLT
	cmpl	%r14d, m(%rip)
	ja	.L57
.L59:
	movq	makelist(%rip), %rdi
	call	free@PLT
	movl	%r13d, 28(%rsp)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L94:
	addq	$136, %rbx
	cmpq	%rbx, %rbp
	jne	.L50
	jmp	.L48
.L97:
	addl	$1, %r13d
	addq	$136, %r15
	cmpl	%r13d, %ebx
	jne	.L56
	movl	28(%rsp), %r15d
	movq	%r15, %r13
	imulq	$136, %r15, %r15
	addq	%rbp, %r15
	jmp	.L55
.L61:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L98
	addq	$200, %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
.L96:
	.cfi_restore_state
	movl	28(%rsp), %r15d
	movq	%r15, %r13
	imulq	$136, %r15, %r15
	addq	list(%rip), %r15
	jmp	.L55
.L98:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	makelist
	.align 8
	.type	makelist, @object
	.size	makelist, 8
makelist:
	.zero	8
	.globl	list
	.align 8
	.type	list, @object
	.size	list, 8
list:
	.zero	8
	.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	makegosei
	.type	makegosei, @function
makegosei:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$8, %esi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	movq	%rdi, %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	movl	128(%rdi), %r13d
	movq	%r13, %rdi
	call	calloc@PLT
	movq	%rax, 136(%rbp)
	testl	%r13d, %r13d
	je	.L1
	movq	%rax, %rbx
	leaq	(%rax,%r13,8), %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movl	$1, %esi
	movl	$128, %edi
	addq	$8, %rbx
	call	calloc@PLT
	movq	%rax, -8(%rbx)
	cmpq	%rbp, %rbx
	jne	.L3
.L1:
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE52:
	.size	makegosei, .-makegosei
	.p2align 4
	.globl	freegosei
	.type	freegosei, @function
freegosei:
.LFB53:
	.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	128(%rdi), %eax
	testl	%eax, %eax
	je	.L11
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L12:
	movq	136(%rbp), %rax
	movl	%ebx, %edx
	addl	$1, %ebx
	movq	(%rax,%rdx,8), %rdi
	call	free@PLT
	cmpl	%ebx, 128(%rbp)
	ja	.L12
.L11:
	movq	136(%rbp), %rdi
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	jmp	free@PLT
	.cfi_endproc
.LFE53:
	.size	freegosei, .-freegosei
	.p2align 4
	.globl	makeans
	.type	makeans, @function
makeans:
.LFB54:
	.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
	movq	%rdi, %rbx
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	cmpw	$1, 132(%rdi)
	je	.L16
	movl	128(%rdi), %eax
	addq	$40, %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
.L16:
	.cfi_restore_state
	movq	makelist(%rip), %rbp
	movl	m(%rip), %eax
	movq	%rbp, %r13
	testl	%eax, %eax
	je	.L19
	subl	$1, %eax
	leaq	(%rax,%rax,8), %rax
	salq	$4, %rax
	leaq	144(%rbp,%rax), %r12
.L20:
	movq	%rbx, %rsi
	movq	%r13, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L39
.L19:
	movl	128(%r13), %r12d
	testl	%r12d, %r12d
	je	.L21
	movq	list(%rip), %rax
	xorl	%ebp, %ebp
	movq	%rax, 16(%rsp)
	leaq	0(,%r12,8), %rax
	xorl	%r12d, %r12d
	movq	%rax, 24(%rsp)
.L22:
	movl	n(%rip), %eax
	movq	16(%rsp), %r15
	movl	%eax, 12(%rsp)
	testl	%eax, %eax
	je	.L23
	movq	136(%r13), %rax
	movl	$0, 8(%rsp)
	movq	16(%rsp), %r8
	movq	(%rax,%rbp), %r14
.L24:
	movq	%r8, %rsi
	movq	%r14, %rdi
	movq	%r8, %r15
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L40
.L23:
	movq	%r15, %rdi
	addq	$8, %rbp
	call	makeans
	addl	%eax, %r12d
	cmpq	%rbp, 24(%rsp)
	jne	.L22
.L21:
	movl	128(%rbx), %eax
	cmpl	%r12d, %eax
	jbe	.L26
	movl	%r12d, 128(%rbx)
	movl	%r12d, %eax
.L26:
	xorl	%edx, %edx
	movw	%dx, 132(%rbx)
	addq	$40, %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
.L40:
	.cfi_restore_state
	addl	$1, 8(%rsp)
	leaq	136(%r15), %r8
	movl	8(%rsp), %eax
	cmpl	12(%rsp), %eax
	jne	.L24
	movl	%eax, %r15d
	movq	16(%rsp), %rcx
	movq	%r15, %rax
	salq	$4, %rax
	addq	%r15, %rax
	leaq	(%rcx,%rax,8), %r15
	jmp	.L23
	.p2align 4,,10
	.p2align 3
.L39:
	addq	$144, %r13
	cmpq	%r13, %r12
	jne	.L20
	movq	%rbp, %r13
	jmp	.L19
	.cfi_endproc
.LFE54:
	.size	makeans, .-makeans
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s %u%*c"
.LC1:
	.string	"%u%*c"
.LC2:
	.string	"%s%*c"
.LC3:
	.string	"%u\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC2(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$200, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 184(%rsp)
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L42:
	xorl	%eax, %eax
	leaq	n(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L61
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L61
	movl	%eax, %edi
	movl	$136, %esi
	xorl	%ebx, %ebx
	call	calloc@PLT
	movq	%rax, list(%rip)
	jmp	.L44
	.p2align 4,,10
	.p2align 3
.L93:
	movq	list(%rip), %rax
.L44:
	movl	%ebx, %ecx
	leaq	.LC0(%rip), %rdi
	addl	$1, %ebx
	movq	%rcx, %rdx
	salq	$4, %rdx
	addq	%rcx, %rdx
	leaq	(%rax,%rdx,8), %rsi
	xorl	%eax, %eax
	leaq	128(%rsi), %rdx
	call	__isoc99_scanf@PLT
	cmpl	%ebx, n(%rip)
	ja	.L93
	leaq	m(%rip), %rsi
	leaq	.LC1(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %edi
	movl	$144, %esi
	leaq	48(%rsp), %r14
	movq	%rdi, %rbx
	call	calloc@PLT
	movl	$0, 24(%rsp)
	movq	%rax, makelist(%rip)
	leaq	44(%rsp), %rax
	movq	%rax, 16(%rsp)
	testl	%ebx, %ebx
	je	.L54
	.p2align 4,,10
	.p2align 3
.L45:
	movq	16(%rsp), %rdx
	movq	%r14, %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L48
	leal	-1(%rax), %edx
	movq	list(%rip), %rbx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	leaq	136(%rbx,%rax,8), %rbp
.L50:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L94
	movl	$1, %ecx
	movw	%cx, 132(%rbx)
.L48:
	movl	24(%rsp), %eax
	movq	makelist(%rip), %rdi
	movl	$128, %edx
	movq	%r14, %rsi
	leaq	(%rax,%rax,8), %rbp
	salq	$4, %rbp
	addq	%rbp, %rdi
	call	__strcpy_chk@PLT
	movq	makelist(%rip), %r13
	movl	44(%rsp), %edi
	movl	$8, %esi
	addq	%rbp, %r13
	movq	%rdi, 8(%rsp)
	movq	%rdi, %rbx
	movl	%edi, 128(%r13)
	call	calloc@PLT
	movq	%rax, 136(%r13)
	movq	%rax, %r15
	testl	%ebx, %ebx
	je	.L51
	movq	8(%rsp), %rdi
	movq	%rax, %r13
	leaq	(%rax,%rdi,8), %rbx
	.p2align 4,,10
	.p2align 3
.L52:
	movl	$1, %esi
	movl	$128, %edi
	addq	$8, %r13
	call	calloc@PLT
	movq	%rax, -8(%r13)
	cmpq	%r13, %rbx
	jne	.L52
	xorl	%ebx, %ebx
	jmp	.L53
	.p2align 4,,10
	.p2align 3
.L95:
	movq	136(%rax), %r15
.L53:
	movl	%ebx, %eax
	movq	%r12, %rdi
	addl	$1, %ebx
	movq	(%r15,%rax,8), %rsi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	makelist(%rip), %rax
	addq	%rbp, %rax
	cmpl	%ebx, 128(%rax)
	ja	.L95
.L51:
	addl	$1, 24(%rsp)
	movl	24(%rsp), %eax
	cmpl	%eax, m(%rip)
	ja	.L45
.L54:
	movq	%r14, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	n(%rip), %ebx
	testl	%ebx, %ebx
	je	.L96
	movq	list(%rip), %rbp
	xorl	%r13d, %r13d
	movq	%rbp, %r15
.L56:
	movq	%r14, %rsi
	movq	%r15, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L97
.L55:
	movq	%r15, %rdi
	xorl	%r14d, %r14d
	call	makeans
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	list(%rip), %rdi
	call	free@PLT
	movl	m(%rip), %edx
	testl	%edx, %edx
	je	.L59
	.p2align 4,,10
	.p2align 3
.L57:
	movl	%r14d, %eax
	xorl	%ebx, %ebx
	leaq	(%rax,%rax,8), %rbp
	salq	$4, %rbp
	addq	makelist(%rip), %rbp
	movl	128(%rbp), %eax
	testl	%eax, %eax
	je	.L60
	.p2align 4,,10
	.p2align 3
.L58:
	movq	136(%rbp), %rax
	movl	%ebx, %edx
	addl	$1, %ebx
	movq	(%rax,%rdx,8), %rdi
	call	free@PLT
	cmpl	128(%rbp), %ebx
	jb	.L58
.L60:
	movq	136(%rbp), %rdi
	addl	$1, %r14d
	call	free@PLT
	cmpl	%r14d, m(%rip)
	ja	.L57
.L59:
	movq	makelist(%rip), %rdi
	call	free@PLT
	movl	%r13d, 28(%rsp)
	jmp	.L42
	.p2align 4,,10
	.p2align 3
.L94:
	addq	$136, %rbx
	cmpq	%rbx, %rbp
	jne	.L50
	jmp	.L48
.L97:
	addl	$1, %r13d
	addq	$136, %r15
	cmpl	%r13d, %ebx
	jne	.L56
	movl	28(%rsp), %r15d
	movq	%r15, %r13
	imulq	$136, %r15, %r15
	addq	%rbp, %r15
	jmp	.L55
.L61:
	movq	184(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L98
	addq	$200, %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
.L96:
	.cfi_restore_state
	movl	28(%rsp), %r15d
	movq	%r15, %r13
	imulq	$136, %r15, %r15
	addq	list(%rip), %r15
	jmp	.L55
.L98:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	makelist
	.align 8
	.type	makelist, @object
	.size	makelist, 8
makelist:
	.zero	8
	.globl	list
	.align 8
	.type	list, @object
	.size	list, 8
list:
	.zero	8
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

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

typedef struct{
  char name[128];
  unsigned int minprice;
  short fr_oth;
} item;

typedef struct{
  char to[128];
  unsigned int num;
  char **from;
} gosei;

item *list;
gosei *makelist;
unsigned int m,n;

void makegosei(gosei *var);
unsigned int makeans(item *var);
void freegosei(gosei *var);

int main(void){
  unsigned int i,j,k,ans;
  char tmpstr[128];
  unsigned int inputs;
  while(scanf("%u%*c",&n) &&n){
    list=(item *)calloc(n,sizeof(item));
    for(i=0;i<n;i++)
      scanf("%s %u%*c",list[i].name,&(list[i].minprice));

    scanf("%u%*c",&m);
    makelist=(gosei *)calloc(m,sizeof(gosei));
    for(i=0;i<m;i++){
      scanf("%s %u%*c",tmpstr,&inputs);
      for(j=0;j<n;j++){
	if(strcmp(list[j].name,tmpstr))continue;
	list[j].fr_oth=1;
	break;
      }
      strcpy(makelist[i].to,tmpstr);
      makelist[i].num=inputs;
      makegosei(makelist+i);
      for(j=0;j<makelist[i].num;j++)
	scanf("%s%*c",makelist[i].from[j]);
    }
    scanf("%s%*c",tmpstr);
    for(i=0;i<n;i++){
      if(strcmp(list[i].name,tmpstr)) continue;
      k=i;
      break;
    }
    
    ans=makeans(&list[k]);
    printf("%u\n",ans);
    free(list);
    for(i=0;i<m;i++) freegosei(makelist+i);
    free(makelist);
  }
  return 0;
}

void makegosei(gosei *var){
  unsigned int i;
  var->from=(char **)calloc(var->num,sizeof(char *));
  for(i=0;i<var->num;i++)
    (var->from)[i]=(char *)calloc(128,sizeof(char));
}

void freegosei(gosei *var){
  unsigned int i;
  for(i=0;i<var->num;i++)
    free((var->from)[i]);
  free(var->from);
}

unsigned int makeans(item *var){
  unsigned int i,j,k,tmp;
  if(var->fr_oth==1){
    tmp=0;
    for(i=0;i<m;i++){
      if(strcmp(makelist[i].to,var->name)) continue;
      k=i;
      break;
    }
    for(i=0;i<makelist[k].num;i++){
      for(j=0;j<n;j++){
	if(strcmp(makelist[k].from[i],list[j].name)) continue;
	break;
      }
      tmp+=makeans(&list[j]);
    }
    if(var->minprice>tmp) var->minprice=tmp;
    var->fr_oth=0;
  }
  return var->minprice;
}
8
wood 3000
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 112750
0
computer
0
 8
wood 3000
string 800
rice 1
water 0
racket 5000
microphone 4961
onigiri 113
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 tekcar microphone onigiri
guitar
1
computer 112750
0
computer
0
 8
wood 3000
string 800
rice 1
water 0
racket 5000
enohporcim 4961
onigiri 113
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 racket microphone onigiri
guitar
1
computer 300000
0
computer
0
 8
wood 5003
string 800
rice 36
water 0
racket 5000
microphone 4961
onigiri 140
guitar 98000
3
racket 2 wood string
onigiri 2 rice water
guitar 3 tekcar enohporcim onigiri
guitar
1
computer 112750
0
computer
0

8797
300000
 9997
300000
 9997
112750
 8762
300000
 4997
112750
 3801
300000
 36
112750

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

```c
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

typedef struct{
  char name[128];
  unsigned int minprice;
  short fr_oth;
} item;

typedef struct{
  char to[128];
  unsigned int num;
  char **from;
} gosei;

item *list;
gosei *makelist;
unsigned int m,n;

void makegosei(gosei *var);
unsigned int makeans(item *var);
void freegosei(gosei *var);

int main(void){
  unsigned int i,j,k,ans;
  char tmpstr[128];
  unsigned int inputs;
  while(scanf("%u%*c",&n) &&n){
    list=(item *)calloc(n,sizeof(item));
    for(i=0;i<n;i++)
      scanf("%s %u%*c",list[i].name,&(list[i].minprice));

    scanf("%u%*c",&m);
    makelist=(gosei *)calloc(m,sizeof(gosei));
    for(i=0;i<m;i++){
      scanf("%s %u%*c",tmpstr,&inputs);
      for(j=0;j<n;j++){
	if(strcmp(list[j].name,tmpstr))continue;
	list[j].fr_oth=1;
	break;
      }
      strcpy(makelist[i].to,tmpstr);
      makelist[i].num=inputs;
      makegosei(makelist+i);
      for(j=0;j<makelist[i].num;j++)
	scanf("%s%*c",makelist[i].from[j]);
    }
    scanf("%s%*c",tmpstr);
    for(i=0;i<n;i++){
      if(strcmp(list[i].name,tmpstr)) continue;
      k=i;
      break;
    }
    
    ans=makeans(&list[k]);
    printf("%u\n",ans);
    free(list);
    for(i=0;i<m;i++) freegosei(makelist+i);
    free(makelist);
  }
  return 0;
}

void makegosei(gosei *var){
  unsigned int i;
  var->from=(char **)calloc(var->num,sizeof(char *));
  for(i=0;i<var->num;i++)
    (var->from)[i]=(char *)calloc(128,sizeof(char));
}

void freegosei(gosei *var){
  unsigned int i;
  for(i=0;i<var->num;i++)
    free((var->from)[i]);
  free(var->from);
}

unsigned int makeans(item *var){
  unsigned int i,j,k,tmp;
  if(var->fr_oth==1){
    tmp=0;
    for(i=0;i<m;i++){
      if(strcmp(makelist[i].to,var->name)) continue;
      k=i;
      break;
    }
    for(i=0;i<makelist[k].num;i++){
      for(j=0;j<n;j++){
	if(strcmp(makelist[k].from[i],list[j].name)) continue;
	break;
      }
      tmp+=makeans(&list[j]);
    }
    if(var->minprice>tmp) var->minprice=tmp;
    var->fr_oth=0;
  }
  return var->minprice;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	list
	.bss
	.align 8
	.type	list, @object
	.size	list, 8
list:
	.zero	8
	.globl	makelist
	.align 8
	.type	makelist, @object
	.size	makelist, 8
makelist:
	.zero	8
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s %u%*c"
.LC1:
	.string	"%u%*c"
.LC2:
	.string	"%s%*c"
.LC3:
	.string	"%u\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L22:
	movl	n(%rip), %eax
	movl	%eax, %eax
	movl	$136, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, list(%rip)
	movl	$0, -160(%rbp)
	jmp	.L3
.L4:
	movq	list(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	128(%rax), %rdx
	movq	list(%rip), %rsi
	movl	-160(%rbp), %ecx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -160(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L4
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	movl	%eax, %eax
	movl	$144, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, makelist(%rip)
	movl	$0, -160(%rbp)
	jmp	.L5
.L13:
	leaq	-164(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -156(%rbp)
	jmp	.L6
.L10:
	movq	list(%rip), %rcx
	movl	-156(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L27
	movq	list(%rip), %rcx
	movl	-156(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movw	$1, 132(%rax)
	jmp	.L9
.L27:
	nop
	addl	$1, -156(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -156(%rbp)
	jb	.L10
.L9:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	movl	-164(%rbp), %eax
	movl	%eax, 128(%rdx)
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makegosei
	movl	$0, -156(%rbp)
	jmp	.L11
.L12:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	136(%rax), %rdx
	movl	-156(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -156(%rbp)
.L11:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movl	128(%rax), %eax
	cmpl	%eax, -156(%rbp)
	jb	.L12
	addl	$1, -160(%rbp)
.L5:
	movl	m(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L13
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -160(%rbp)
	jmp	.L14
.L18:
	movq	list(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L28
	movl	-160(%rbp), %eax
	movl	%eax, -152(%rbp)
	jmp	.L17
.L28:
	nop
	addl	$1, -160(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L18
.L17:
	movq	list(%rip), %rcx
	movl	-152(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makeans
	movl	%eax, -148(%rbp)
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	list(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, -160(%rbp)
	jmp	.L19
.L20:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	freegosei
	addl	$1, -160(%rbp)
.L19:
	movl	m(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L20
	movq	makelist(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L21
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L22
.L21:
	movl	$0, %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
.LFE6:
	.size	main, .-main
	.globl	makegosei
	.type	makegosei, @function
makegosei:
.LFB7:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movq	-40(%rbp), %rax
	movl	128(%rax), %eax
	movl	%eax, %eax
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rdx, 136(%rax)
	movl	$0, -20(%rbp)
	jmp	.L30
.L31:
	movq	-40(%rbp), %rax
	movq	136(%rax), %rdx
	movl	-20(%rbp), %eax
	salq	$3, %rax
	leaq	(%rdx,%rax), %rbx
	movl	$1, %esi
	movl	$128, %edi
	call	calloc@PLT
	movq	%rax, (%rbx)
	addl	$1, -20(%rbp)
.L30:
	movq	-40(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jb	.L31
	nop
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	makegosei, .-makegosei
	.globl	freegosei
	.type	freegosei, @function
freegosei:
.LFB8:
	.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)
	movl	$0, -4(%rbp)
	jmp	.L33
.L34:
	movq	-24(%rbp), %rax
	movq	136(%rax), %rdx
	movl	-4(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	addl	$1, -4(%rbp)
.L33:
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jb	.L34
	movq	-24(%rbp), %rax
	movq	136(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	freegosei, .-freegosei
	.globl	makeans
	.type	makeans, @function
makeans:
.LFB9:
	.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
	movzwl	132(%rax), %eax
	cmpw	$1, %ax
	jne	.L36
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L37
.L41:
	movq	-24(%rbp), %rdx
	movq	makelist(%rip), %rsi
	movl	-16(%rbp), %ecx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L52
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L40
.L52:
	nop
	addl	$1, -16(%rbp)
.L37:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jb	.L41
.L40:
	movl	$0, -16(%rbp)
	jmp	.L42
.L48:
	movl	$0, -12(%rbp)
	jmp	.L43
.L47:
	movq	list(%rip), %rcx
	movl	-12(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rcx
	movq	makelist(%rip), %rsi
	movl	-8(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	136(%rax), %rdx
	movl	-16(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L53
	nop
	addl	$1, -12(%rbp)
.L43:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jb	.L47
	jmp	.L46
.L53:
	nop
.L46:
	movq	list(%rip), %rcx
	movl	-12(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makeans
	addl	%eax, -4(%rbp)
	addl	$1, -16(%rbp)
.L42:
	movq	makelist(%rip), %rcx
	movl	-8(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movl	128(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jb	.L48
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jnb	.L49
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, 128(%rax)
.L49:
	movq	-24(%rbp), %rax
	movw	$0, 132(%rax)
.L36:
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	makeans, .-makeans
	.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	list
	.bss
	.align 8
	.type	list, @object
	.size	list, 8
list:
	.zero	8
	.globl	makelist
	.align 8
	.type	makelist, @object
	.size	makelist, 8
makelist:
	.zero	8
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%s %u%*c"
.LC1:
	.string	"%u%*c"
.LC2:
	.string	"%s%*c"
.LC3:
	.string	"%u\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$176, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L2
.L22:
	movl	n(%rip), %eax
	movl	%eax, %eax
	movl	$136, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, list(%rip)
	movl	$0, -160(%rbp)
	jmp	.L3
.L4:
	movq	list(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	leaq	128(%rax), %rdx
	movq	list(%rip), %rsi
	movl	-160(%rbp), %ecx
	movq	%rcx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	salq	$3, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -160(%rbp)
.L3:
	movl	n(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L4
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	movl	%eax, %eax
	movl	$144, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, makelist(%rip)
	movl	$0, -160(%rbp)
	jmp	.L5
.L13:
	leaq	-164(%rbp), %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -156(%rbp)
	jmp	.L6
.L10:
	movq	list(%rip), %rcx
	movl	-156(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L27
	movq	list(%rip), %rcx
	movl	-156(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movw	$1, 132(%rax)
	jmp	.L9
.L27:
	nop
	addl	$1, -156(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -156(%rbp)
	jb	.L10
.L9:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcpy@PLT
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	leaq	(%rcx,%rax), %rdx
	movl	-164(%rbp), %eax
	movl	%eax, 128(%rdx)
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makegosei
	movl	$0, -156(%rbp)
	jmp	.L11
.L12:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	136(%rax), %rdx
	movl	-156(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -156(%rbp)
.L11:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movl	128(%rax), %eax
	cmpl	%eax, -156(%rbp)
	jb	.L12
	addl	$1, -160(%rbp)
.L5:
	movl	m(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L13
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -160(%rbp)
	jmp	.L14
.L18:
	movq	list(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdx
	leaq	-144(%rbp), %rax
	movq	%rax, %rsi
	movq	%rdx, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L28
	movl	-160(%rbp), %eax
	movl	%eax, -152(%rbp)
	jmp	.L17
.L28:
	nop
	addl	$1, -160(%rbp)
.L14:
	movl	n(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L18
.L17:
	movq	list(%rip), %rcx
	movl	-152(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makeans
	movl	%eax, -148(%rbp)
	movl	-148(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	list(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
	movl	$0, -160(%rbp)
	jmp	.L19
.L20:
	movq	makelist(%rip), %rcx
	movl	-160(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	freegosei
	addl	$1, -160(%rbp)
.L19:
	movl	m(%rip), %eax
	cmpl	%eax, -160(%rbp)
	jb	.L20
	movq	makelist(%rip), %rax
	movq	%rax, %rdi
	call	free@PLT
.L2:
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L21
	movl	n(%rip), %eax
	testl	%eax, %eax
	jne	.L22
.L21:
	movl	$0, %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
.LFE6:
	.size	main, .-main
	.globl	makegosei
	.type	makegosei, @function
makegosei:
.LFB7:
	.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	$40, %rsp
	.cfi_offset 3, -24
	movq	%rdi, -40(%rbp)
	movq	-40(%rbp), %rax
	movl	128(%rax), %eax
	movl	%eax, %eax
	movl	$8, %esi
	movq	%rax, %rdi
	call	calloc@PLT
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	movq	%rdx, 136(%rax)
	movl	$0, -20(%rbp)
	jmp	.L30
.L31:
	movq	-40(%rbp), %rax
	movq	136(%rax), %rdx
	movl	-20(%rbp), %eax
	salq	$3, %rax
	leaq	(%rdx,%rax), %rbx
	movl	$1, %esi
	movl	$128, %edi
	call	calloc@PLT
	movq	%rax, (%rbx)
	addl	$1, -20(%rbp)
.L30:
	movq	-40(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -20(%rbp)
	jb	.L31
	nop
	nop
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	makegosei, .-makegosei
	.globl	freegosei
	.type	freegosei, @function
freegosei:
.LFB8:
	.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)
	movl	$0, -4(%rbp)
	jmp	.L33
.L34:
	movq	-24(%rbp), %rax
	movq	136(%rax), %rdx
	movl	-4(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	addl	$1, -4(%rbp)
.L33:
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jb	.L34
	movq	-24(%rbp), %rax
	movq	136(%rax), %rax
	movq	%rax, %rdi
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	freegosei, .-freegosei
	.globl	makeans
	.type	makeans, @function
makeans:
.LFB9:
	.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
	movzwl	132(%rax), %eax
	cmpw	$1, %ax
	jne	.L36
	movl	$0, -4(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L37
.L41:
	movq	-24(%rbp), %rdx
	movq	makelist(%rip), %rsi
	movl	-16(%rbp), %ecx
	movq	%rcx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	%rdx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	jne	.L52
	movl	-16(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L40
.L52:
	nop
	addl	$1, -16(%rbp)
.L37:
	movl	m(%rip), %eax
	cmpl	%eax, -16(%rbp)
	jb	.L41
.L40:
	movl	$0, -16(%rbp)
	jmp	.L42
.L48:
	movl	$0, -12(%rbp)
	jmp	.L43
.L47:
	movq	list(%rip), %rcx
	movl	-12(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rcx
	movq	makelist(%rip), %rsi
	movl	-8(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rsi, %rax
	movq	136(%rax), %rdx
	movl	-16(%rbp), %eax
	salq	$3, %rax
	addq	%rdx, %rax
	movq	(%rax), %rax
	movq	%rcx, %rsi
	movq	%rax, %rdi
	call	strcmp@PLT
	testl	%eax, %eax
	je	.L53
	nop
	addl	$1, -12(%rbp)
.L43:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jb	.L47
	jmp	.L46
.L53:
	nop
.L46:
	movq	list(%rip), %rcx
	movl	-12(%rbp), %edx
	movq	%rdx, %rax
	salq	$4, %rax
	addq	%rdx, %rax
	salq	$3, %rax
	addq	%rcx, %rax
	movq	%rax, %rdi
	call	makeans
	addl	%eax, -4(%rbp)
	addl	$1, -16(%rbp)
.L42:
	movq	makelist(%rip), %rcx
	movl	-8(%rbp), %edx
	movq	%rdx, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	salq	$4, %rax
	addq	%rcx, %rax
	movl	128(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jb	.L48
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	cmpl	%eax, -4(%rbp)
	jnb	.L49
	movq	-24(%rbp), %rax
	movl	-4(%rbp), %edx
	movl	%edx, 128(%rax)
.L49:
	movq	-24(%rbp), %rax
	movw	$0, 132(%rax)
.L36:
	movq	-24(%rbp), %rax
	movl	128(%rax), %eax
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	makeans, .-makeans
	.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:
