LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: poller_ctl
int poller_ctl(void *p, int op, struct poller_item *item)
{
	int rc, eop;
	struct poller *poller = p;
	struct epoll_event epollev;

	if (poller == NULL)
		return -EINVAL;
	eop = to_epoll_op(op);
	if (eop < 0)
		return eop;
	if (op == P_CTL_DEL || item->prewait == NULL)
		del_prewait(poller, item);

	epollev = (struct epoll_event){
		.events   = to_epoll_events(item->events),
		.data.ptr = item,
	};
	rc = epoll_ctl(poller->epollfd, eop, item->fd, &epollev);

	return (rc >= 0 ? rc : -errno);
}

// Assembly:
movl $0xffffffea, %eax       # imm = 0xFFFFFFEA
testq %rdi, %rdi
je 0x4206
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
cmpl $0x2, %esi
je 0x41b5
cmpl $0x1, %ebp
je 0x41a6
testl %ebp, %ebp
jne 0x41fe
movl $0x1, %ebp
jmp 0x41ab
movl $0x3, %ebp
cmpq $0x0, 0x120(%rbx)
jne 0x41c0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4207
movl 0x4(%rbx), %eax
movl %eax, %ecx
shrl %ecx
andl $0x1, %ecx
movl %eax, %edx
andl $0x4, %edx
orl %ecx, %edx
andl $0x1, %eax
leal (%rdx,%rax,8), %eax
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq %rbx, 0x4(%rcx)
movl (%r14), %edi
movl (%rbx), %edx
movl %ebp, %esi
callq 0x1110
testl %eax, %eax
jns 0x41fe
callq 0x1050
movq %rax, %rcx
xorl %eax, %eax
subl (%rcx), %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: del_prewait
static void del_prewait(struct poller *poller, struct poller_item *item)
{
	int i, prews_num = item->prews_num;
	struct prewait *prew;

	for (i = 0; i < ARRAY_SIZE(item->prews) && prews_num; i++) {
		prew = &item->prews[i];
		if (prew->poller)
			prews_num--;
		if (poller == prew->poller) {
			__del_prewait(prew);
			break;
		}
	}
}

// Assembly:
movl 0x18(%rsi), %eax
testl %eax, %eax
je 0x4234
addq $0x20, %rsi
xorl %ecx, %ecx
movq (%rsi), %rdx
cmpq %rdi, %rdx
je 0x4235
cmpq $0x1, %rdx
adcl $-0x1, %eax
cmpq $0x6, %rcx
ja 0x4234
incq %rcx
addq $0x20, %rsi
testl %eax, %eax
jne 0x4214
retq
movq %rsi, %rdi
jmp 0x444c
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: poller_set_prewait
int poller_set_prewait(void *p, struct poller_item *item)
{
	int rc = 0;
	struct poller *poller = p;

	if (item->prewait == NULL)
		del_prewait(poller, item);
	else if (item->prewait) {
		/*
		 * Item with a prewait action is a special case:
		 * it can belong to a limit amount of pollers,
		 * thus we have to check and return an error if
		 * no buffers left.
		 */
		rc = add_prewait(poller, item);
	}

	return rc;
}

// Assembly:
pushq %rax
cmpq $0x0, 0x120(%rsi)
je 0x42ce
movl 0x18(%rsi), %ecx
movl $0xffffff97, %eax       # imm = 0xFFFFFF97
cmpl $0x7, %ecx
ja 0x42d5
movl $0x20, %r8d
xorl %eax, %eax
xorl %edx, %edx
movl %ecx, %r9d
movq (%rsi,%r8), %r10
cmpq %rdi, %r10
je 0x42d5
testq %r10, %r10
je 0x427e
testl %r9d, %r9d
je 0x42d7
decl %r9d
jmp 0x4289
leaq (%rsi,%r8), %r10
testq %rdx, %rdx
cmoveq %r10, %rdx
testl %r9d, %r9d
jne 0x4293
testq %rdx, %rdx
jne 0x42a5
addq $0x20, %r8
cmpq $0x120, %r8             # imm = 0x120
jne 0x4266
testq %rdx, %rdx
je 0x42f6
movq %rdi, (%rdx)
movq %rsi, 0x8(%rdx)
leaq 0x10(%rdx), %r8
leaq 0x8(%rdi), %r9
movq 0x10(%rdi), %r10
movq %r8, 0x10(%rdi)
movq %r9, 0x10(%rdx)
movq %r10, 0x18(%rdx)
movq %r8, (%r10)
incl %ecx
movl %ecx, 0x18(%rsi)
jmp 0x42d5
callq 0x4207
xorl %eax, %eax
popq %rcx
retq
leaq 0x1533(%rip), %rdi      # 0x5811
leaq 0x1536(%rip), %rsi      # 0x581b
leaq 0x155d(%rip), %rcx      # 0x5849
movl $0x51, %edx
callq 0x10d0
leaq 0x1583(%rip), %rdi      # 0x5880
leaq 0x1517(%rip), %rsi      # 0x581b
leaq 0x153e(%rip), %rcx      # 0x5849
movl $0x59, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: poller_wait
int poller_wait(void *p, struct poller_item **pitems, int num, int timeout)
{
	int rc, i;
	struct poller *poller = p;
	struct epoll_event epollevs[num];
	struct poller_item *item;

	if (poller == NULL)
		return -EINVAL;

	rc = call_prewaits(poller, pitems, num);
	if (rc)
		return rc;
	rc = epoll_wait(poller->epollfd, epollevs, num, tv_to_poll(timeout));
	if (rc > 0) {
		for (i = 0; i < rc; i++) {
			item = (struct poller_item *)epollevs[i].data.ptr;
			item->revents = from_epoll_events(epollevs[i].events);
			pitems[i] = item;
		}
	}

	return (rc >= 0 ? rc : -errno);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %eax
movq %rsp, %r14
leaq (%rax,%rax,2), %rax
leaq 0xf(,%rax,4), %rax
andq $-0x10, %rax
subq %rax, %r14
movq %r14, %rsp
testq %rdi, %rdi
je 0x43aa
movq %rsi, %rbx
movq %rdi, %r13
movl %ecx, -0x30(%rbp)
movl %edx, -0x2c(%rbp)
testl %edx, %edx
je 0x43c0
leaq 0x8(%r13), %rax
movq 0x8(%r13), %r12
movq %rax, -0x38(%rbp)
cmpq %rax, %r12
je 0x43c0
xorl %r15d, %r15d
movq -0x8(%r12), %rsi
movl $0x0, 0x8(%rsi)
movq %r13, %rdi
callq *0x120(%rsi)
testl %eax, %eax
jne 0x43b2
movq -0x8(%r12), %rax
cmpl $0x0, 0x8(%rax)
je 0x439e
movslq %r15d, %rcx
incl %r15d
movq %rax, (%rbx,%rcx,8)
cmpl -0x2c(%rbp), %r15d
je 0x43b7
movq (%r12), %r12
cmpq -0x38(%rbp), %r12
jne 0x436a
jmp 0x43bb
movl $0xffffffea, %r15d      # imm = 0xFFFFFFEA
jmp 0x4431
movl %eax, %r15d
jmp 0x4431
movl -0x2c(%rbp), %r15d
testl %r15d, %r15d
jne 0x4431
movl (%r13), %edi
movl -0x30(%rbp), %eax
cmpl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmovnel %eax, %ecx
movq %r14, %rsi
movl -0x2c(%rbp), %edx
callq 0x11c0
movl %eax, %r15d
testl %eax, %eax
jle 0x4421
movl %r15d, %eax
addq $0x4, %r14
xorl %ecx, %ecx
movq (%r14), %rdx
movl -0x4(%r14), %esi
movl %esi, %edi
andl $0x1, %edi
movl %esi, %r8d
andl $0x4, %r8d
leal (%r8,%rdi,2), %edi
shrl $0x3, %esi
andl $0x1, %esi
orl %edi, %esi
movl %esi, 0x8(%rdx)
movq %rdx, (%rbx,%rcx,8)
incq %rcx
addq $0xc, %r14
cmpq %rcx, %rax
jne 0x43ef
testl %r15d, %r15d
jns 0x4431
callq 0x1050
xorl %r15d, %r15d
subl (%rax), %r15d
movl %r15d, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/rouming[P]io/poller.c
// Function: _del_prewait
static void __del_prewait(struct prewait *prew)
{
	assert(prew->item->prews_num);
	prew->item->prews_num -= 1;
	prew->poller = NULL;
	prew->item = NULL;
	list_del(&prew->list);
}

// Assembly:
movq 0x8(%rdi), %rax
movl 0x18(%rax), %ecx
testl %ecx, %ecx
je 0x4472
decl %ecx
movl %ecx, 0x18(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
movq %rcx, 0x8(%rax)
movq %rax, (%rcx)
retq
pushq %rax
leaq 0x138b(%rip), %rdi      # 0x5805
leaq 0x139a(%rip), %rsi      # 0x581b
leaq 0x139c(%rip), %rcx      # 0x5824
movl $0x25, %edx
callq 0x10d0
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/utils.c
// Function: dump_function
void dump_function(Function* func) {
  eprintf("%s ", func->name);
  eprintf("(");
  for (size_t i = 0; i < func->params->length; i++) {
    if (i != 0)
      eprintf(", ");
    dump_type(((Node*)func->params->ptr[i])->type);
    eprintf(" %s", ((Node*)func->params->ptr[i])->name);
  }
  eprintf(")\n");

  if (func->body)
    dump_node(func->body, 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rsi
leaq 0xc490(%rip), %rdi      # 0xf365
xorl %eax, %eax
callq 0x21b0
leaq 0xc94b(%rip), %rdi      # 0xf82e
xorl %eax, %eax
callq 0x21b0
movq 0x18(%rbx), %rax
cmpq $0x0, 0x10(%rax)
je 0x2f59
leaq 0xc145(%rip), %r14      # 0xf041
leaq 0xc912(%rip), %r15      # 0xf815
xorl %r12d, %r12d
testq %r12, %r12
je 0x2f19
movq %r15, %rdi
xorl %eax, %eax
callq 0x21b0
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rax
movq 0x10(%rax), %rdi
callq 0xdb4f
movq %rax, %rdi
xorl %eax, %eax
callq 0x21b0
movq 0x18(%rbx), %rax
movq (%rax), %rax
movq (%rax,%r12,8), %rax
movq 0x40(%rax), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x21b0
incq %r12
movq 0x18(%rbx), %rax
cmpq 0x10(%rax), %r12
jb 0x2f06
leaq 0xc8a6(%rip), %rdi      # 0xf806
xorl %eax, %eax
callq 0x21b0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
jne 0x2f7c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
pushq $0x1
popq %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2259
nop
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/containers.c
// Function: new_vec
Vector* new_vec() {
  Vector* v = calloc(1, sizeof(Vector));
  v->ptr = calloc(16, sizeof(void*));
  v->capacity = 16;
  v->length = 0;
  return v;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x20f0
movq %rax, %rbx
movl $0x10, %edi
movl $0x8, %esi
callq 0x20f0
movq %rax, (%rbx)
movq $0x10, 0x8(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: preprocess
Token* preprocess(char* dir, Token* tokens) {
  gbl_env = calloc(1, sizeof(MacroEnv));
  gbl_env->name = "__hoc__";
  input = tokens;
  src_dir = dir;

  while (input) {
    traverse();
  }

  return output;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, 0xffac(%rip)      # 0x130e8
leaq 0xaec1(%rip), %rcx      # 0xe004
movq %rcx, 0x8(%rax)
movq %rbx, 0xffa2(%rip)      # 0x130f0
movq %r14, 0xffa3(%rip)      # 0x130f8
testq %rbx, %rbx
je 0x3169
callq 0x3178
cmpq $0x0, 0xff89(%rip)      # 0x130f0
jne 0x315a
movq 0xff90(%rip), %rax      # 0x13100
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: expect
static Token* expect(char* expected, enum TokenTag tag) {
  if (input->tag != tag) {
    pp_error(expected, input);
    return NULL;
  } else {
    Token* ret = input;
    consume();
    return ret;
  }
}

// Assembly:
pushq %rbx
movq 0xf894(%rip), %rbx      # 0x130f0
cmpl $0x2, 0x8(%rbx)
jne 0x3871
movq (%rbx), %rax
movq %rax, 0xf884(%rip)      # 0x130f0
movq %rbx, %rax
popq %rbx
retq
movq %rdi, %rsi
leaq 0xa7d5(%rip), %rdi      # 0xe050
xorl %eax, %eax
callq 0xd86a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: is_macro
static bool is_macro(Token* token) {
  if (token->tag == TIDENT) {
    for (MacroEnv* env = gbl_env; env != NULL; env = env->next) {
      if (streq(token->ident, env->name)) {
        return true;
      }
    }
  }
  return false;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x2, 0x8(%rdi)
jne 0x38c0
movq %rdi, %rbx
leaq 0xf847(%rip), %r14      # 0x130e8
movq (%r14), %r14
testq %r14, %r14
setne %bpl
je 0x38c2
movq 0x10(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0xd9ca
testl %eax, %eax
je 0x38a1
jmp 0x38c2
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: read_until_bol
static Token* read_until_bol(void) {
  if (input->bol) {
    return NULL;
  } else {
    Token* new = copy_token(input);
    consume();
    new->next = read_until_bol();
    return new;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0xf7c4(%rip), %r14      # 0x130f0
cmpb $0x1, 0x30(%r14)
jne 0x3937
xorl %ebx, %ebx
jmp 0x397c
movl $0x1, %edi
movl $0x38, %esi
callq 0x20f0
movq %rax, %rbx
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
movups %xmm2, 0x20(%rax)
movq 0x30(%r14), %rax
movq %rax, 0x30(%rbx)
movq (%r14), %rax
movq %rax, 0xf77c(%rip)      # 0x130f0
callq 0x3921
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: get_macro_tokens
static Token* get_macro_tokens(char* name) {
  for (MacroEnv* env = gbl_env; env != NULL; env = env->next) {
    if (streq(name, env->name)) {
      return copy_tokens(env->tokens);
    }
  }
  return false;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0xf753(%rip), %r14      # 0x130e8
movq (%r14), %r14
testq %r14, %r14
je 0x39ba
movq 0x8(%r14), %rsi
movq %rbx, %rdi
callq 0xd9ca
testl %eax, %eax
je 0x3995
movq 0x10(%r14), %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x39c4
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/cpp.c
// Function: copy_tokens
static Token* copy_tokens(Token* src) {
  if (src == NULL) {
    return NULL;
  } else {
    Token* new = copy_token(src);
    new->next = copy_tokens(src->next);
    return new;
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x3a10
movq %rdi, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x20f0
movq %rax, %rbx
movups (%r14), %xmm0
movups 0x10(%r14), %xmm1
movups 0x20(%r14), %xmm2
movups %xmm0, (%rax)
movups %xmm1, 0x10(%rax)
movups %xmm2, 0x20(%rax)
movq 0x30(%r14), %rax
movq %rax, 0x30(%rbx)
movq (%r14), %rdi
callq 0x39c4
movq %rax, (%rbx)
jmp 0x3a12
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: emit_const
static void emit_const(Type* type, Node* node) {
  if (!node) {
    return;
  }

  switch (node->tag) {
  case NINT: {
    if (size_of(type) == 1) {
      emit(".byte %d", node->integer);
    } else if (size_of(type) == 4) {
      emit(".int %d", node->integer);
    } else if (size_of(type) == 8) {
      emit(".quad %d", node->integer);
    } else {
      bad_token(node->token, "emit error: emit_const(invalid size)");
    }
    break;
  }
  case NGVAR: {
    if (size_of(type) == 1) {
      emit(".byte %s", node->name);
    } else if (size_of(type) == 4) {
      emit(".int %s", node->name);
    } else if (size_of(type) == 8) {
      emit(".quad %s", node->name);
    } else {
      bad_token(node->token, "emit error: emit_const(invalid size)");
    }
    break;
  }
  default:
    bad_token(node->token, "emit error: value is not constant");
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x3e2e
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %eax
cmpl $0x2, %eax
je 0x3e36
testl %eax, %eax
jne 0x3ecd
movq %r14, %rdi
callq 0x9bf4
cmpq $0x1, %rax
jne 0x3e6c
movl 0x28(%rbx), %esi
leaq 0xa345(%rip), %rdi      # 0xe16e
jmp 0x3ec2
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x9bf4
cmpq $0x1, %rax
jne 0x3e51
movq 0x40(%rbx), %rsi
leaq 0xa35e(%rip), %rdi      # 0xe1ad
jmp 0x3e9f
movq %r14, %rdi
callq 0x9bf4
cmpq $0x4, %rax
jne 0x3e86
movq 0x40(%rbx), %rsi
leaq 0xa34c(%rip), %rdi      # 0xe1b6
jmp 0x3e9f
movq %r14, %rdi
callq 0x9bf4
cmpq $0x4, %rax
jne 0x3eaa
movl 0x28(%rbx), %esi
leaq 0xa2f3(%rip), %rdi      # 0xe177
jmp 0x3ec2
movq %r14, %rdi
callq 0x9bf4
cmpq $0x8, %rax
jne 0x3edd
movq 0x40(%rbx), %rsi
leaq 0xa31f(%rip), %rdi      # 0xe1be
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3eed
movq %r14, %rdi
callq 0x9bf4
cmpq $0x8, %rax
jne 0x3edd
movl 0x28(%rbx), %esi
leaq 0xa2bd(%rip), %rdi      # 0xe17f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3eed
movq 0x8(%rbx), %rdi
leaq 0xa2ef(%rip), %rsi      # 0xe1c7
callq 0xcd01
movq 0x8(%rbx), %rdi
leaq 0xa2a0(%rip), %rsi      # 0xe188
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: comment
static void comment(char *fmt, ...) {
  va_list ap;
  va_start(ap, fmt);
  printf("# ");
  vprintf(fmt, ap);
  printf("\n");
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x3ff9
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %r14
movq %rdi, 0x10(%r14)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%r14)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%r14)
leaq 0xa22c(%rip), %rdi      # 0xe24c
xorl %eax, %eax
callq 0x20a0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2130
movl $0xa, %edi
callq 0x2040
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: emit_var
static void emit_var(Node* var) {
  comment("start lval NVAR %s", var->name);
  emit("lea rax, -%zu[rbp]", var->offset);
  push(AX);
  comment("end lval NVAR %s", var->name);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x40(%rdi), %rsi
leaq 0xa340(%rip), %rdi      # 0xe396
xorl %eax, %eax
callq 0x3f98
movq 0x48(%rbx), %rsi
leaq 0xa341(%rip), %rdi      # 0xe3a9
xorl %eax, %eax
callq 0x3eed
leaq 0xa357(%rip), %rdi      # 0xe3cd
leaq 0xa57a(%rip), %rsi      # 0xe5f7
xorl %eax, %eax
callq 0x20a0
movq 0x40(%rbx), %rsi
leaq 0xa32d(%rip), %rdi      # 0xe3bc
xorl %eax, %eax
popq %rbx
jmp 0x3f98
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: emit_lval
static void emit_lval(Node* node) {
  if (node->tag == NVAR) {
    emit_var(node);
  } else if (node->tag == NGVAR) {
    comment("start lval NGVAR");
    emit("lea rax, %s", node->name);
    push(AX);
    comment("end lval NGVAR");
  } else if (node->tag == NMEMBER) {
    comment("start lval NMEMBER");
    emit_lval(node->expr);
    size_t offset = field_offset(type_of(node->expr)->fields, node->name);
    pop(AX);
    emit("lea rax, %zu[rax]", offset);
    push(AX);
    comment("end lval NMEMBER");
  } else if (node->tag == NDEREF){
    comment("start lval NDEREF");
    emit_node(node->expr);
    comment("end lval NDEREF");
  } else {
    bad_token(node->token, "emit error: emit_lval");
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x19, %eax
jg 0x5b7a
cmpl $0x1, %eax
je 0x5bff
cmpl $0x2, %eax
jne 0x5c3a
leaq 0x8da6(%rip), %rdi      # 0xe8e6
xorl %eax, %eax
callq 0x3f98
movq 0x40(%rbx), %rsi
leaq 0x8da5(%rip), %rdi      # 0xe8f7
xorl %eax, %eax
callq 0x3eed
leaq 0x886d(%rip), %rdi      # 0xe3cd
leaq 0x8a90(%rip), %rsi      # 0xe5f7
xorl %eax, %eax
callq 0x20a0
leaq 0x8d8e(%rip), %rdi      # 0xe903
jmp 0x5c2c
cmpl $0x1a, %eax
je 0x5c0e
cmpl $0x1b, %eax
jne 0x5c3a
leaq 0x8d7f(%rip), %rdi      # 0xe912
xorl %eax, %eax
callq 0x3f98
movq 0x38(%rbx), %rdi
callq 0x5b19
movq 0x38(%rbx), %rdi
callq 0x9d62
movq 0x30(%rax), %rdi
movq 0x40(%rbx), %rsi
callq 0x9e20
movq %rax, %rbx
leaq 0x8dbd(%rip), %rdi      # 0xe980
leaq 0x8a2d(%rip), %r14      # 0xe5f7
movq %r14, %rsi
xorl %eax, %eax
callq 0x20a0
leaq 0x8d4a(%rip), %rdi      # 0xe925
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3eed
leaq 0x87e1(%rip), %rdi      # 0xe3cd
movq %r14, %rsi
xorl %eax, %eax
callq 0x20a0
leaq 0x8d3a(%rip), %rdi      # 0xe937
jmp 0x5c2c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4047
leaq 0x8d33(%rip), %rdi      # 0xe948
xorl %eax, %eax
callq 0x3f98
movq 0x38(%rbx), %rdi
callq 0x4097
leaq 0x8d2e(%rip), %rdi      # 0xe95a
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3f98
movq 0x8(%rbx), %rdi
leaq 0x8d25(%rip), %rsi      # 0xe96a
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: load
static void load(Reg dst, size_t size) {
  if (size == 1) {
    // 8bitの値は自動では0拡張されないので、movzxを使う
    // 32bit整数との演算を行うので32bitレジスタにロードする
    emit("movsx %s, BYTE PTR [rax]", reg(dst, 4));
  } else {
   emit("mov %s, [rax]", reg(dst, size));
  }
}

// Assembly:
cmpq $0x1, %rdi
jne 0x5c65
leaq 0x8d32(%rip), %rdi      # 0xe989
leaq 0x87a7(%rip), %rsi      # 0xe405
xorl %eax, %eax
jmp 0x3eed
cmpq $0x4, %rdi
leaq 0x8795(%rip), %rax      # 0xe405
leaq 0x8980(%rip), %rsi      # 0xe5f7
cmoveq %rax, %rsi
leaq 0x8d20(%rip), %rdi      # 0xe9a2
xorl %eax, %eax
jmp 0x3eed
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: emit_assign
static void emit_assign(Node* lhs, Node* rhs) {
  comment("  start lval");
  emit_lval(lhs);
  comment("  end lval");
  emit_node(rhs);
  pop(DI);
  pop(AX);
  store(DI, size_of(type_of(lhs)));
  push(DI);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8cec(%rip), %rdi      # 0xe9b0
xorl %eax, %eax
callq 0x3f98
movq %r14, %rdi
callq 0x5b19
leaq 0x8ce3(%rip), %rdi      # 0xe9bd
xorl %eax, %eax
callq 0x3f98
movq %rbx, %rdi
callq 0x4097
leaq 0x8c90(%rip), %r15      # 0xe980
leaq 0x8576(%rip), %rbx      # 0xe26d
movq %r15, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x20a0
leaq 0x88ec(%rip), %rsi      # 0xe5f7
movq %r15, %rdi
xorl %eax, %eax
callq 0x20a0
movq %r14, %rdi
callq 0x9d62
movq %rax, %rdi
callq 0x9bf4
cmpq $0x4, %rax
leaq 0xccb0(%rip), %rcx      # 0x129e0
leaq 0xcc09(%rip), %rdx      # 0x12940
cmoveq %rcx, %rdx
cmpq $0x1, %rax
leaq 0xcc4a(%rip), %rax      # 0x12990
cmovneq %rdx, %rax
movq 0x8(%rax), %rsi
leaq 0x8682(%rip), %rdi      # 0xe3d7
xorl %eax, %eax
callq 0x3eed
leaq 0x866a(%rip), %rdi      # 0xe3cd
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x20a0
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: emit_builtin_va_start
static void emit_builtin_va_start(Node* node) {
  align_rsp();
  emit_node(node);
  pop(AX); // address of va_list
  push(CX); // save register
  emit("mov DWORD PTR [rax], %d", numgp * 8);
  emit("mov DWORD PTR [rax + 4], 48");
  emit("lea rcx, [rbp - %d]", REGAREA_SIZE);
  emit("mov [rax + 16], rcx");
  pop(CX); // load register
  revert_rsp();
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x5e12
movq %rbx, %rdi
callq 0x4097
leaq 0x8bf3(%rip), %rbx      # 0xe980
leaq 0x8863(%rip), %rsi      # 0xe5f7
movq %rbx, %rdi
xorl %eax, %eax
callq 0x20a0
leaq 0x8628(%rip), %rdi      # 0xe3cd
leaq 0x84fc(%rip), %r14      # 0xe2a8
movq %r14, %rsi
xorl %eax, %eax
callq 0x20a0
movl 0xd358(%rip), %esi      # 0x13114
shll $0x3, %esi
leaq 0x8c02(%rip), %rdi      # 0xe9c8
xorl %eax, %eax
callq 0x3eed
leaq 0x8c0c(%rip), %rdi      # 0xe9e0
xorl %eax, %eax
callq 0x3eed
leaq 0x8c1a(%rip), %rdi      # 0xe9fc
movl $0xb0, %esi
xorl %eax, %eax
callq 0x3eed
leaq 0x8c1b(%rip), %rdi      # 0xea10
xorl %eax, %eax
callq 0x3eed
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x20a0
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x5e4c
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/emit.c
// Function: align_rsp
static void align_rsp(void) {
  comment("start align rsp");
  emit("mov r10, rsp");
  emit("and rsp, -16"); // 下位4bit(16で割ったあまり)を切り捨て
  comment("end align rsp");
}

// Assembly:
pushq %rax
leaq 0x8c0a(%rip), %rdi      # 0xea24
xorl %eax, %eax
callq 0x3f98
leaq 0x8c0c(%rip), %rdi      # 0xea34
xorl %eax, %eax
callq 0x3eed
leaq 0x8c0b(%rip), %rdi      # 0xea41
xorl %eax, %eax
callq 0x3eed
leaq 0x8c0a(%rip), %rdi      # 0xea4e
xorl %eax, %eax
popq %rcx
jmp 0x3f98
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/gen_ir.c
// Function: is_defined_proto
IFunc* is_defined_proto(Vector* funcs, char* name) {
  for (size_t i = 0; i < funcs->length; i++) {
    IFunc* func = funcs->ptr[i];
    if (streq(func->name, name) && !func->blocks) {
      return func;
    }
  }
  return false;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x10(%rdi)
je 0x5eb6
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%r12,8), %r15
movq (%r15), %rdi
movq %rbx, %rsi
callq 0xd9ca
testl %eax, %eax
je 0x5ead
cmpq $0x0, 0x18(%r15)
je 0x5eb9
incq %r12
cmpq 0x10(%r14), %r12
jb 0x5e90
xorl %r15d, %r15d
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/gen_ir.c
// Function: emit_lval
static IReg* emit_lval(Node* node) {
  switch (node->tag) {
  case NVAR: {
    IReg* addr = new_reg(8);
    emit_ir(address(addr, node->offset));
    return addr;
  }
  case NGVAR: {
    IReg* addr = new_reg(8);
    emit_ir(label(addr, node->name));
    return addr;
  }
  case NMEMBER: {
    IReg* addr = emit_lval(node->expr);
    IReg* offset = new_reg(8);
    emit_ir(imm(offset, field_offset(type_of(node->expr)->fields, node->name)));
    IReg* reg = new_reg(8);
    emit_ir(new_binop_ir(IADD, reg, addr, offset));
    return reg;
  }
  case NDEREF: {
    return emit_expr(node->expr);
  }
  default: {
    bad_token(node->token, "gen_ir error: emit_lval");
  }
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
cmpl $0x19, %eax
jg 0x7a0d
cmpl $0x1, %eax
je 0x7adc
cmpl $0x2, %eax
jne 0x7b4f
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, %r14
movl 0xb766(%rip), %eax      # 0x13138
leal 0x1(%rax), %ecx
movl %ecx, 0xb75d(%rip)      # 0x13138
movl %eax, 0x4(%r14)
movq $0x8, 0x8(%r14)
movq 0x40(%rbx), %rbx
movl $0x1, %edi
movl $0x58, %esi
callq 0x20f0
movl $0x1, (%rax)
movq %r14, 0x10(%rax)
movq %rbx, 0x28(%rax)
jmp 0x7b1d
cmpl $0x1a, %eax
je 0x7b3d
cmpl $0x1b, %eax
jne 0x7b4f
movq 0x38(%rbx), %rdi
callq 0x7995
movq %rax, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, %r12
movl 0xb6f5(%rip), %eax      # 0x13138
leal 0x1(%rax), %ecx
movl %ecx, 0xb6ec(%rip)      # 0x13138
movl %eax, 0x4(%r12)
movl $0x8, %r13d
movq %r13, 0x8(%r12)
movq 0x38(%rbx), %rdi
callq 0x9d62
movq 0x30(%rax), %rdi
movq 0x40(%rbx), %rsi
callq 0x9e20
movq %rax, %rbx
movl $0x1, %edi
movl $0x58, %esi
callq 0x20f0
movq %r12, 0x10(%rax)
movl %ebx, 0x4(%rax)
movq 0xb69e(%rip), %rcx      # 0x13130
movq 0x8(%rcx), %rdi
movq %rax, %rsi
callq 0x30ae
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, %r14
movl 0xb682(%rip), %eax      # 0x13138
leal 0x1(%rax), %ecx
movl %ecx, 0xb679(%rip)      # 0x13138
movl %eax, 0x4(%r14)
movq %r13, 0x8(%r14)
movl $0x2, %edi
movq %r14, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x8c2a
jmp 0x7b1d
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, %r14
movl 0xb644(%rip), %eax      # 0x13138
leal 0x1(%rax), %ecx
movl %ecx, 0xb63b(%rip)      # 0x13138
movl %eax, 0x4(%r14)
movq $0x8, 0x8(%r14)
movl 0x48(%rbx), %ebx
movl $0x11, %edi
callq 0x8c14
movq %r14, 0x10(%rax)
movl %ebx, 0x4(%rax)
movq 0xb60c(%rip), %rcx      # 0x13130
movq 0x8(%rcx), %rdi
movq %rax, %rsi
callq 0x30ae
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x38(%rbx), %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x6a4f
movq 0x8(%rbx), %rdi
leaq 0x7157(%rip), %rsi      # 0xecb1
callq 0xcd01
nop
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/gen_x86.c
// Function: emit_const
static void emit_const(Type* type, Node* node) {
  if (!node) {
    return;
  }

  switch (node->tag) {
  case NINT: {
    if (size_of(type) == 1) {
      emit("db %d", node->integer);
    } else if (size_of(type) == 4) {
      emit("dd %d", node->integer);
    } else if (size_of(type) == 8) {
      emit("dq %d", node->integer);
    } else {
      bad_token(node->token, "emit error: emit_const(invalid size)");
    }
    break;
  }
  case NGVAR: {
    if (size_of(type) == 1) {
      emit("db %s", node->name);
    } else if (size_of(type) == 4) {
      emit("dd %s", node->name);
    } else if (size_of(type) == 8) {
      emit("dq %s", node->name);
    } else {
      bad_token(node->token, "emit error: emit_const(invalid size)");
    }
    break;
  }
  default:
    bad_token(node->token, "emit error: value is not constant");
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x8a74
movq %rsi, %rbx
movq %rdi, %r14
movl (%rsi), %eax
cmpl $0x2, %eax
je 0x8a7c
testl %eax, %eax
jne 0x8b13
movq %r14, %rdi
callq 0x9bf4
cmpq $0x1, %rax
jne 0x8ab2
movl 0x28(%rbx), %esi
leaq 0x634e(%rip), %rdi      # 0xedbd
jmp 0x8b08
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x9bf4
cmpq $0x1, %rax
jne 0x8a97
movq 0x40(%rbx), %rsi
leaq 0x633a(%rip), %rdi      # 0xedcf
jmp 0x8ae5
movq %r14, %rdi
callq 0x9bf4
cmpq $0x4, %rax
jne 0x8acc
movq 0x40(%rbx), %rsi
leaq 0x6325(%rip), %rdi      # 0xedd5
jmp 0x8ae5
movq %r14, %rdi
callq 0x9bf4
cmpq $0x4, %rax
jne 0x8af0
movl 0x28(%rbx), %esi
leaq 0x62f9(%rip), %rdi      # 0xedc3
jmp 0x8b08
movq %r14, %rdi
callq 0x9bf4
cmpq $0x8, %rax
jne 0x8b23
movq 0x40(%rbx), %rsi
leaq 0x62f6(%rip), %rdi      # 0xeddb
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8b33
movq %r14, %rdi
callq 0x9bf4
cmpq $0x8, %rax
jne 0x8b23
movl 0x28(%rbx), %esi
leaq 0x62c1(%rip), %rdi      # 0xedc9
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x8b33
movq 0x8(%rbx), %rdi
leaq 0x56a9(%rip), %rsi      # 0xe1c7
callq 0xcd01
movq 0x8(%rbx), %rdi
leaq 0x565a(%rip), %rsi      # 0xe188
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/ir.c
// Function: count_stack_size
int count_stack_size(IFunc* func) {
  int size = 0;

  for (int i = 0; i < func->blocks->length; i++) {
    Block* block = func->blocks->ptr[i];

    for (int i = 0; i < block->instrs->length; i++) {
      IR* inst = block->instrs->ptr[i];

      if (inst->op == IALLOC) {
        size += inst->imm_int;
      }
    }
  }

  return size;
}

// Assembly:
movq 0x18(%rdi), %rax
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x8cae
movq (%rax), %rdx
xorl %esi, %esi
xorl %eax, %eax
movq (%rdx,%rsi,8), %rdi
movq 0x8(%rdi), %r8
movq 0x10(%r8), %rdi
testq %rdi, %rdi
je 0x8ca5
movq (%r8), %r8
xorl %r9d, %r9d
movq (%r8,%r9,8), %r10
cmpl $0x12, (%r10)
jne 0x8c9d
addl 0x4(%r10), %eax
incq %r9
cmpq %r9, %rdi
jne 0x8c8f
incq %rsi
cmpq %rcx, %rsi
jne 0x8c78
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/ir.c
// Function: show_block
char* show_block(int* inst_count, Block* block) {
  StringBuilder* sb = new_sb();
  sb_puts(sb, format("%s: {\n", block->label));
  for (int i = 0; i < block->instrs->length; i++, (*inst_count)++) {
    sb_puts(sb, format(" [%d] ", *inst_count));
    sb_puts(sb, show_ir(block->instrs->ptr[i]));
    sb_puts(sb, "\n");
  }
  sb_puts(sb, "}");
  return sb_run(sb);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0xd9db
movq %rax, %rbx
movq (%r14), %rsi
leaq 0x59aa(%rip), %rdi      # 0xf153
xorl %eax, %eax
callq 0xd86a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xda51
movq 0x8(%r14), %rax
cmpq $0x0, 0x10(%rax)
je 0x9829
movl (%r15), %esi
leaq 0x598a(%rip), %r12      # 0xf15a
leaq 0x5cc5(%rip), %r13      # 0xf49c
xorl %ebp, %ebp
movq %r12, %rdi
xorl %eax, %eax
callq 0xd86a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xda51
movq 0x8(%r14), %rax
movq (%rax), %rax
movq (%rax,%rbp,8), %rdi
callq 0x8cd0
movq %rbx, %rdi
movq %rax, %rsi
callq 0xda51
movq %rbx, %rdi
movq %r13, %rsi
callq 0xda51
incq %rbp
movl (%r15), %esi
incl %esi
movl %esi, (%r15)
movq 0x8(%r14), %rax
cmpq %rbp, 0x10(%rax)
ja 0x97d9
leaq 0x5931(%rip), %rsi      # 0xf161
movq %rbx, %rdi
callq 0xda51
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xda87
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/ir.c
// Function: show_ifunc
char* show_ifunc(IFunc* ifunc) {
  if (!ifunc->blocks) {
    return format("extern %s", ifunc->name);
  }

  StringBuilder* sb = new_sb();
  int inst_count = 0;
  sb_puts(sb, format("=== %s(%s) ===\n", ifunc->name, ifunc->entry_label));
  sb_puts(sb, "params: ");
  for (int i = 0; i < ifunc->params->length; i++) {
    sb_puts(sb, show_ireg(ifunc->params->ptr[i]));
    sb_puts(sb, " ");
  }
  sb_puts(sb, "\n");
  for (int i = 0; i < ifunc->blocks->length; i++) {
    sb_puts(sb, show_block(&inst_count, ifunc->blocks->ptr[i]));
    sb_puts(sb, "\n");
  }
  return sb_run(sb);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
cmpq $0x0, 0x18(%rdi)
je 0x9979
callq 0xd9db
movq %rax, %r14
movl $0x0, 0xc(%rsp)
movq (%rbx), %rsi
movq 0x20(%rbx), %rdx
leaq 0x58e6(%rip), %rdi      # 0xf16d
xorl %eax, %eax
callq 0xd86a
movq %r14, %rdi
movq %rax, %rsi
callq 0xda51
leaq 0x58dd(%rip), %rsi      # 0xf17d
movq %r14, %rdi
callq 0xda51
movq 0x10(%rbx), %rax
cmpq $0x0, 0x10(%rax)
je 0x9909
leaq 0x5726(%rip), %r15      # 0xefe0
leaq 0x498c(%rip), %r12      # 0xe24d
xorl %r13d, %r13d
movq (%rax), %rax
movq (%rax,%r13,8), %rax
movl (%rax), %ecx
movl 0x4(%rax), %esi
movq 0x8(%rax), %rdx
movl 0x10(%rax), %r8d
movl 0x14(%rax), %r9d
movq %r15, %rdi
xorl %eax, %eax
callq 0xd86a
movq %r14, %rdi
movq %rax, %rsi
callq 0xda51
movq %r14, %rdi
movq %r12, %rsi
callq 0xda51
incq %r13
movq 0x10(%rbx), %rax
cmpq %r13, 0x10(%rax)
ja 0x98c4
leaq 0x5b8c(%rip), %rsi      # 0xf49c
movq %r14, %rdi
callq 0xda51
movq 0x18(%rbx), %rax
cmpq $0x0, 0x10(%rax)
je 0x9964
xorl %r13d, %r13d
leaq 0xc(%rsp), %r15
leaq 0x5b6a(%rip), %r12      # 0xf49c
movq (%rax), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
callq 0x9786
movq %r14, %rdi
movq %rax, %rsi
callq 0xda51
movq %r14, %rdi
movq %r12, %rsi
callq 0xda51
incq %r13
movq 0x18(%rbx), %rax
cmpq %r13, 0x10(%rax)
ja 0x9932
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xda87
movq (%rbx), %rsi
leaq 0x57e0(%rip), %rdi      # 0xf163
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0xd86a
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/ir.c
// Function: show_iprog
char* show_iprog(IProgram* iprog) {
  StringBuilder* sb = new_sb();
  for (int i = 0; i < iprog->ifuncs->length; i++) {
    sb_puts(sb, show_ifunc(iprog->ifuncs->ptr[i]));
  }
  return sb_run(sb);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0xd9db
movq %rax, %r14
movq (%rbx), %rax
cmpq $0x0, 0x10(%rax)
je 0x99d7
xorl %r15d, %r15d
movq (%rax), %rax
movq (%rax,%r15,8), %rdi
callq 0x984e
movq %r14, %rdi
movq %rax, %rsi
callq 0xda51
incq %r15
movq (%rbx), %rax
cmpq %r15, 0x10(%rax)
ja 0x99b4
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0xda87
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/node.c
// Function: array_of
Type *array_of(Type *type, size_t size) {
  Type *array = ptr_to(type);
  array->array_size = size;
  array->size = size * size_of(type);
  return array;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x20f0
movl $0x4, (%rax)
movq $0x8, 0x8(%rax)
movq %r14, 0x18(%rax)
movq %rbx, 0x20(%rax)
imulq 0x10(%r14), %rbx
movq %rbx, 0x10(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/node.c
// Function: look_struct
Field *look_struct(Field *fields, char *name) {
  for (Field *f = fields; f != NULL; f = f->next) {
    if (streq(f->name, name)) {
      return f;
    }
  }
  for (Field *f = fields; f != NULL; f = f->next) {
    if (f->type->fields) {
      // Unnamed substructures
      Field *sub = look_struct(f->type->fields, name);
      if (sub) {
        Field *g = calloc(1, sizeof(Field));
        g->name = sub->name;
        g->type = sub->type;
        g->next = sub->next;
        g->offset = f->offset + sub->offset;
        return g;
      }
    }
  }
  return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x9dbb
movq %rsi, %r15
movq %rdi, %r14
movq %rdi, %rbx
movq 0x8(%rbx), %rdi
movq %r15, %rsi
callq 0xd9ca
testl %eax, %eax
jne 0x9df2
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0x9d7d
xorl %ebx, %ebx
movq 0x10(%r14), %rax
movq 0x30(%rax), %rdi
testq %rdi, %rdi
je 0x9db1
movq %r15, %rsi
callq 0x9d67
testq %rax, %rax
jne 0x9dbf
movq (%r14), %r14
testq %r14, %r14
jne 0x9d97
jmp 0x9df2
xorl %ebx, %ebx
jmp 0x9df2
movq %rax, %r12
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, %rbx
movq 0x10(%r12), %rax
movq %rax, 0x10(%rbx)
movups (%r12), %xmm0
movups %xmm0, (%rbx)
movq 0x18(%r12), %rax
addq 0x18(%r14), %rax
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/node.c
// Function: field_type
Type *field_type(Field *fields, char *name) {
  Field *field = look_struct(fields, name);
  if (!field)
    error("unreachable(field_type)");
  return field->type;
}

// Assembly:
pushq %rax
callq 0x9d67
testq %rax, %rax
je 0x9e12
movq 0x10(%rax), %rax
popq %rcx
retq
leaq 0x538b(%rip), %rdi      # 0xf1a4
xorl %eax, %eax
callq 0xd930
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/node.c
// Function: field_offset
size_t field_offset(Field *fields, char *name) {
  Field *field = look_struct(fields, name);
  if (!field)
    error("unreachable(field_offset)");
  return field->offset;
}

// Assembly:
pushq %rax
callq 0x9d67
testq %rax, %rax
je 0x9e31
movq 0x18(%rax), %rax
popq %rcx
retq
leaq 0x5384(%rip), %rdi      # 0xf1bc
xorl %eax, %eax
callq 0xd930
nop
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: match
static Token *match(char *name) {
  if (peek_tag(0) == TRESERVED && streq(peek(0)->ident, name)) {
    Token *t = peek(0);
    consume();
    return t;
  } else {
    return NULL;
  }
}

// Assembly:
pushq %rax
movq 0x90b1(%rip), %rax      # 0x13158
cmpl $0x3, 0x8(%rax)
jne 0xa0d0
movq %rdi, %rsi
movq 0x10(%rax), %rdi
callq 0xd9ca
testl %eax, %eax
je 0xa0d0
movq 0x9094(%rip), %rax      # 0x13158
movq (%rax), %rcx
movq %rcx, 0x908a(%rip)      # 0x13158
jmp 0xa0d2
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: global_var
static void global_var(void) {
  Type *type = type_specifier();

  while (match("*")) {
    type = ptr_to(type);
  }

  Token *tok = peek(0);
  char *name = read_ident();

  type = read_type_suffix(type);

  if (match("=")) {
    if (match("{")) {
      /* リスト初期化 */
      Vector *inits = new_vec();
      vec_push(inits, assign());
      while (match(",")) {
        vec_push(inits, assign());
      }
      if (!match("}")) {
        parse_error("}", peek(0));
      }
      add_gvar(tok, name, type, NULL, inits);
    } else {
      add_gvar(tok, name, type, expr(), NULL);
    }
  } else {
    add_gvar(tok, name, type, NULL, NULL);
  }

  if (!match(";")) {
    parse_error("global_var: ;", peek(0));
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0xa5b8
movq %rax, %rbx
leaq 0x515d(%rip), %rdi      # 0xf248
callq 0xa09f
testq %rax, %rax
je 0xa114
leaq 0x514c(%rip), %r14      # 0xf248
movq %rbx, %rdi
callq 0x9cf6
movq %rax, %rbx
movq %r14, %rdi
callq 0xa09f
testq %rax, %rax
jne 0xa0fc
leaq 0x50e4(%rip), %rsi      # 0xf1ff
movl $0x2, %edi
callq 0xa9d6
movq 0x10(%rax), %r12
movq %rbx, %rdi
callq 0xa531
movq %rax, %rbx
leaq 0x513c(%rip), %rdi      # 0xf277
callq 0xa09f
testq %rax, %rax
je 0xa1df
leaq 0x50d3(%rip), %rdi      # 0xf223
callq 0xa09f
testq %rax, %rax
je 0xa1f8
xorl %eax, %eax
callq 0x307c
movq %rax, %r14
callq 0xaa0b
movq %r14, %rdi
movq %rax, %rsi
callq 0x30ae
leaq 0x3ecf(%rip), %rdi      # 0xe04e
callq 0xa09f
testq %rax, %rax
je 0xa1ad
leaq 0x3ebe(%rip), %r15      # 0xe04e
callq 0xaa0b
movq %r14, %rdi
movq %rax, %rsi
callq 0x30ae
movq %r15, %rdi
callq 0xa09f
testq %rax, %rax
jne 0xa190
leaq 0x4fad(%rip), %rdi      # 0xf161
callq 0xa09f
testq %rax, %rax
je 0xa260
movl $0x30, %edi
movl $0x1, %esi
callq 0x20f0
movq %r12, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %r14, 0x20(%rax)
jmp 0xa21b
movl $0x30, %edi
movl $0x1, %esi
callq 0x20f0
movq %r12, 0x8(%rax)
movq %rbx, 0x10(%rax)
jmp 0xa21b
callq 0xb86a
movq %rax, %r14
movl $0x30, %edi
movl $0x1, %esi
callq 0x20f0
movq %r12, 0x8(%rax)
movq %rbx, 0x10(%rax)
movq %r14, 0x18(%rax)
movq 0x8f3e(%rip), %rcx      # 0x13160
movq %rcx, (%rax)
movq %rax, 0x8f34(%rip)      # 0x13160
leaq 0x50f0(%rip), %rdi      # 0xf323
callq 0xa09f
testq %rax, %rax
je 0xa249
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x8f08(%rip), %rbx      # 0x13158
leaq 0x3df9(%rip), %rdi      # 0xe050
leaq 0x4ff6(%rip), %rsi      # 0xf254
jmp 0xa275
movq 0x8ef1(%rip), %rbx      # 0x13158
leaq 0x3de2(%rip), %rdi      # 0xe050
leaq 0x4eec(%rip), %rsi      # 0xf161
xorl %eax, %eax
callq 0xd86a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: read_type_suffix
static Type *read_type_suffix(Type *base) {
  if (!match("[")) {
    return base;
  }
  size_t size = expect(TINT, "integer")->integer;
  if (!match("]")) {
    parse_error("]", peek(0));
  }
  base = read_type_suffix(base);
  return array_of(base, size);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x4d0b(%rip), %rdi      # 0xf24a
callq 0xa09f
testq %rax, %rax
je 0xa586
leaq 0x4cfc(%rip), %rsi      # 0xf24c
xorl %edi, %edi
callq 0xa9d6
movslq 0xc(%rax), %r14
leaq 0x48e4(%rip), %rdi      # 0xee46
callq 0xa09f
testq %rax, %rax
je 0xa591
movq %rbx, %rdi
callq 0xa531
movq %rax, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x9d22
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq 0x8bc0(%rip), %rbx      # 0x13158
leaq 0x3ab1(%rip), %rdi      # 0xe050
leaq 0x48a0(%rip), %rsi      # 0xee46
xorl %eax, %eax
callq 0xd86a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: read_field
static Field *read_field() {
  match(";");
  if (match("}")) {
    return NULL;
  }

  Node *def = declarator(type_specifier());
  Field *field = calloc(1, sizeof(Field));
  field->name = def->name;
  field->type = def->type;
  field->next = read_field();
  return field;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x4a51(%rip), %rdi      # 0xf323
callq 0xa09f
leaq 0x4883(%rip), %rdi      # 0xf161
callq 0xa09f
testq %rax, %rax
je 0xa8ec
xorl %ebx, %ebx
jmp 0xa926
callq 0xa5b8
movq %rax, %rdi
callq 0xa931
movq %rax, %r14
movl $0x1, %edi
movl $0x20, %esi
callq 0x20f0
movq %rax, %rbx
movq 0x40(%r14), %rax
movq %rax, 0x8(%rbx)
movq 0x10(%r14), %rax
movq %rax, 0x10(%rbx)
callq 0xa8c7
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: expect
static Token *expect(enum TokenTag tag, char *expected) {
  if (peek_tag(0) == tag) {
    Token *t = tokens;
    consume();
    return t;
  }
  parse_error(expected, peek(0));
  return NULL;
}

// Assembly:
pushq %rbx
movq 0x877a(%rip), %rbx      # 0x13158
cmpl %edi, 0x8(%rbx)
jne 0xa9f2
movq (%rbx), %rax
movq %rax, 0x876b(%rip)      # 0x13158
movq %rbx, %rax
popq %rbx
retq
leaq 0x3657(%rip), %rdi      # 0xe050
xorl %eax, %eax
callq 0xd86a
movq %rbx, %rdi
movq %rax, %rsi
callq 0xcd01
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: assign
static Node *assign() {
  Node *node = logical_or();
  Token *token;

  if ((token = match("="))) {
    node = new_assign_node(token, 0, node, assign());
  } else if ((token = match("+="))) {
    node = new_assign_node(token, NADD, node, assign());
  } else if ((token = match("-="))) {
    node = new_assign_node(token, NSUB, node, assign());
  } else if ((token = match("*="))) {
    node = new_assign_node(token, NMUL, node, assign());
  }

  return node;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0xab15
movq %rax, %rbx
leaq 0x4855(%rip), %rdi      # 0xf277
callq 0xa09f
testq %rax, %rax
je 0xaa4c
movq %rax, %r15
callq 0xaa0b
movq %rax, %r14
movl $0x17, %edi
movq %r15, %rsi
callq 0x9bd0
movq %rax, %r15
jmp 0xaafb
leaq 0x480f(%rip), %rdi      # 0xf262
callq 0xa09f
testq %rax, %rax
je 0xaa83
movq %rax, %r12
callq 0xaa0b
movq %rax, %r14
movl $0x17, %edi
movq %r12, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
movl $0x3, %edi
jmp 0xaaef
leaq 0x47db(%rip), %rdi      # 0xf265
callq 0xa09f
testq %rax, %rax
je 0xaaba
movq %rax, %r12
callq 0xaa0b
movq %rax, %r14
movl $0x17, %edi
movq %r12, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
movl $0x4, %edi
jmp 0xaaef
leaq 0x47a7(%rip), %rdi      # 0xf268
callq 0xa09f
testq %rax, %rax
je 0xab06
movq %rax, %r12
callq 0xaa0b
movq %rax, %r14
movl $0x17, %edi
movq %r12, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
movl $0x5, %edi
movq %r12, %rsi
callq 0x9bd0
movq %rax, 0x20(%r15)
movq %rbx, 0x18(%rax)
movq %r14, 0x20(%rax)
movq %r15, %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: logical_or
static Node *logical_or() {
  Node *lhs = logical_and();
  Token *tok;
  for (;;) {
    if ((tok = match("||"))) {
      Node *node = new_node(NLOGOR, tok);
      node->lhs = lhs;
      node->rhs = logical_and();
      lhs = node;
    } else {
      return lhs;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0xab75
movq %rax, %rbx
leaq 0x4742(%rip), %rdi      # 0xf26b
callq 0xa09f
testq %rax, %rax
je 0xab69
leaq 0x4731(%rip), %r14      # 0xf26b
movl $0x14, %edi
movq %rax, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
callq 0xab75
movq %rax, 0x20(%r15)
movq %r14, %rdi
callq 0xa09f
movq %r15, %rbx
testq %rax, %rax
jne 0xab3a
jmp 0xab6c
movq %rbx, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: logical_and
static Node *logical_and() {
  Node *lhs = bit_or();
  Token *tok;
  for (;;) {
    if ((tok = match("&&"))) {
      Node *node = new_node(NLOGAND, tok);
      node->lhs = lhs;
      node->rhs = bit_or();
      lhs = node;
    } else {
      return lhs;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0xabd5
movq %rax, %rbx
leaq 0x46e5(%rip), %rdi      # 0xf26e
callq 0xa09f
testq %rax, %rax
je 0xabc9
leaq 0x46d4(%rip), %r14      # 0xf26e
movl $0x13, %edi
movq %rax, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
callq 0xabd5
movq %rax, 0x20(%r15)
movq %r14, %rdi
callq 0xa09f
movq %r15, %rbx
testq %rax, %rax
jne 0xab9a
jmp 0xabcc
movq %rbx, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: bit_or
static Node *bit_or() {
  Node *lhs = bit_xor();
  Token *token;
  for (;;) {
    if ((token = match("|"))) {
      Node *node = new_node(NOR, token);
      node->lhs = lhs;
      node->rhs = bit_xor();
      lhs = node;
    } else {
      return lhs;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0xac35
movq %rax, %rbx
leaq 0x4683(%rip), %rdi      # 0xf26c
callq 0xa09f
testq %rax, %rax
je 0xac29
leaq 0x4672(%rip), %r14      # 0xf26c
movl $0x11, %edi
movq %rax, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
callq 0xac35
movq %rax, 0x20(%r15)
movq %r14, %rdi
callq 0xa09f
movq %r15, %rbx
testq %rax, %rax
jne 0xabfa
jmp 0xac2c
movq %rbx, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: bit_xor
static Node *bit_xor() {
  Node *lhs = bit_and();
  Token *token;
  for (;;) {
    if ((token = match("^"))) {
      Node *node = new_node(NXOR, token);
      node->lhs = lhs;
      node->rhs = bit_and();
      lhs = node;
    } else {
      return lhs;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0xac95
movq %rax, %rbx
leaq 0x4628(%rip), %rdi      # 0xf271
callq 0xa09f
testq %rax, %rax
je 0xac89
leaq 0x4617(%rip), %r14      # 0xf271
movl $0x12, %edi
movq %rax, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
callq 0xac95
movq %rax, 0x20(%r15)
movq %r14, %rdi
callq 0xa09f
movq %r15, %rbx
testq %rax, %rax
jne 0xac5a
jmp 0xac8c
movq %rbx, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/takoeight0821[P]hoc_nyan/src/parse.c
// Function: bit_and
static Node *bit_and() {
  Node *lhs = equality();
  Token *token;
  for (;;) {
    if ((token = match("&"))) {
      Node *node = new_node(NAND, token);
      node->lhs = lhs;
      node->rhs = equality();
      lhs = node;
    } else {
      return lhs;
    }
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0xacf5
movq %rax, %rbx
leaq 0x45c6(%rip), %rdi      # 0xf26f
callq 0xa09f
testq %rax, %rax
je 0xace9
leaq 0x45b5(%rip), %r14      # 0xf26f
movl $0x10, %edi
movq %rax, %rsi
callq 0x9bd0
movq %rax, %r15
movq %rbx, 0x18(%rax)
callq 0xacf5
movq %rax, 0x20(%r15)
movq %r14, %rdi
callq 0xa09f
movq %r15, %rbx
testq %rax, %rax
jne 0xacba
jmp 0xacec
movq %rbx, %r15
movq %r15, %rax
popq %rbx
popq %r14
popq %r15
retq