LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: main
int main(void)
{
  int c;
  char word[MAX_WORD_LEN];
  while ((c = get_word(word, MAX_WORD_LEN)) != EOF)
  {
    if (isalpha(c))
    {
      struct list_node *node_p = lookup(word);
      if (node_p != NULL)
      {
        printf("%s", node_p->definition);
      }
      else
      {
        printf("%s", word);
      }
    }
    else
    {

      if (c == '/')
      {
        ungetc(c, stdin);
        consume_comments();
      }
      else if (c == '\'')
      {
        ungetc(c, stdin);
        consume_char_literal();
      }
      else if (c == '"')
      {
        ungetc(c, stdin);
        consume_string_literal();
      }
      else if (c == '#')
      {
        ungetc(c, stdin);
        consume_preproc();
      }
      else
      {
        putc(c, stdout);
      }
    }
  }

  return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsp, %rdi
movl $0x64, %esi
callq 0x1307
cmpl $-0x1, %eax
je 0x12f6
movl %eax, %ebp
callq 0x10d0
movq %rax, %rbx
movq 0x2dcf(%rip), %r12      # 0x3fe0
movq 0x2dc0(%rip), %r13      # 0x3fd8
movq %rsp, %r14
leaq 0xde2(%rip), %r15       # 0x2004
movq (%rbx), %rax
movslq %ebp, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x1256
cmpl $0x26, %ebp
jg 0x126c
cmpl $0x22, %ebp
je 0x12a7
cmpl $0x23, %ebp
jne 0x129a
movq (%r12), %rsi
movl $0x23, %edi
callq 0x10b0
callq 0x156e
jmp 0x12de
movq %r14, %rdi
callq 0x13dc
testq %rax, %rax
je 0x128b
movq 0x8(%rax), %rsi
movq %r15, %rdi
jmp 0x1291
cmpl $0x27, %ebp
je 0x12c1
cmpl $0x2f, %ebp
jne 0x129a
movq (%r12), %rsi
movl $0x2f, %edi
callq 0x10b0
callq 0x146a
jmp 0x12de
movq %r15, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x1070
jmp 0x12de
movq (%r13), %rsi
movl %ebp, %edi
callq 0x1080
jmp 0x12de
movq (%r12), %rsi
movl $0x22, %edi
callq 0x10b0
movl $0x22, %edi
movl $0x22, %esi
jmp 0x12d9
movq (%r12), %rsi
movl $0x27, %edi
callq 0x10b0
movl $0x27, %edi
movl $0x27, %esi
callq 0x1a1a
movl $0x64, %esi
movq %r14, %rdi
callq 0x1307
movl %eax, %ebp
cmpl $-0x1, %eax
jne 0x1222
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: consume_comments
void consume_comments(void)
{
  int c = getc(stdin);
  if (c == '/')
  {
    putc(c, stdout);

    c = getc(stdin);
    if (c == '/')
    {
      putc(c, stdout);
      while ((c = getc(stdin)) != '\n' && c != EOF)
      {
        putc(c, stdout);
      }
    }
    else if (c == '*')
    {
      putc(c, stdout);
      while ((c = getc(stdin)) != EOF)
      {
        putc(c, stdout);
        if (c == '*')
        {
          c = getc(stdin);
          putc(c, stdout);
          if (c == '/')
          {
            break;
          }
        }
      }

      c = getc(stdin);
      if (c == '/')
      {
        putc(c, stdout);
        return;
      }
    }
  }
  ungetc(c, stdin);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq 0x2b6a(%rip), %r14      # 0x3fe0
movq (%r14), %rdi
callq 0x10c0
cmpl $0x2f, %eax
jne 0x1541
movq 0x2b4a(%rip), %r15      # 0x3fd8
movq (%r15), %rsi
movl $0x2f, %edi
callq 0x1080
movq (%r14), %rdi
callq 0x10c0
cmpl $0x2a, %eax
je 0x14cf
cmpl $0x2f, %eax
jne 0x1541
movq (%r15), %rsi
movl %eax, %edi
callq 0x1080
movq (%r14), %rdi
callq 0x10c0
cmpl $-0x1, %eax
je 0x1541
cmpl $0xa, %eax
jne 0x14b1
jmp 0x1541
movq (%r15), %rsi
movl $0x2a, %edi
callq 0x1080
movq (%r14), %rdi
callq 0x10c0
cmpl $-0x1, %eax
je 0x1522
movl %eax, %ebx
movq (%r15), %rsi
movl %ebx, %edi
callq 0x1080
cmpl $0x2a, %ebx
jne 0x1513
movq (%r14), %rdi
callq 0x10c0
movl %eax, %ebx
movq (%r15), %rsi
movl %eax, %edi
callq 0x1080
cmpl $0x2f, %ebx
je 0x1522
movq (%r14), %rdi
callq 0x10c0
movl %eax, %ebx
cmpl $-0x1, %eax
jne 0x14eb
movq (%r14), %rdi
callq 0x10c0
cmpl $0x2f, %eax
jne 0x1541
movq (%r15), %rsi
movl $0x2f, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x1080
movq (%r14), %rsi
movl %eax, %edi
popq %rbx
popq %r14
popq %r15
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: consume_preproc
void consume_preproc(void)
{
  int c = getc(stdin);
  if (c == '#')
  {
    putc(c, stdout);

    char word[MAX_WORD_LEN];
    consume_word(word, "Error: expected preprocessor directive.");

    enum directive_type directive = NONE;
    if (strcmp(word, "define") == 0)
    {
      directive = DEFINE;
    }
    else if (strcmp(word, "undef") == 0)
    {
      directive = UNDEF;
    }

    if (directive)
    {
      consume_blanks();
      consume_word(word, "Error: invalid name.");
    }

    if (directive == DEFINE)
    {
      consume_blanks();
      char definition[MAX_WORD_LEN];
      get_alnum_str(definition, MAX_WORD_LEN);
      printf("%s", definition);

      struct list_node *node_p = lookup(definition);
      if (node_p != NULL)
      {
        install(word, node_p->definition);
      }
      else
      {
        install(word, definition);
      }
    }
    else if (directive == UNDEF)
    {
      undef(word);
    }
  }
  else
  {
    ungetc(c, stdin);
  }
}

// Assembly:
pushq %rbp
pushq %rbx
subq $0xd8, %rsp
movq 0x2a62(%rip), %rbx      # 0x3fe0
movq (%rbx), %rdi
callq 0x10c0
cmpl $0x23, %eax
jne 0x15e4
movq 0x2a46(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
movl $0x23, %edi
callq 0x1080
leaq 0xa61(%rip), %rsi       # 0x2007
movq %rsp, %rbx
movq %rbx, %rdi
callq 0x1951
movl $0x69666564, %eax       # imm = 0x69666564
xorl (%rbx), %eax
movl $0x656e69, %ecx         # imm = 0x656E69
xorl 0x3(%rbx), %ecx
xorl %ebx, %ebx
orl %eax, %ecx
setne %al
je 0x15f7
movl $0x65646e75, %ecx       # imm = 0x65646E75
xorl (%rsp), %ecx
movzwl 0x4(%rsp), %edx
xorl $0x66, %edx
orl %ecx, %edx
setne %cl
sete %bpl
jmp 0x15fb
movq (%rbx), %rsi
movl %eax, %edi
addq $0xd8, %rsp
popq %rbx
popq %rbp
jmp 0x10b0
xorl %ecx, %ecx
xorl %ebp, %ebp
movb %al, %bl
testb %cl, %cl
jne 0x1615
callq 0x19b3
leaq 0xa2f(%rip), %rsi       # 0x203c
movq %rsp, %rdi
callq 0x1951
testl %ebx, %ebx
je 0x1628
testb %bpl, %bpl
je 0x1673
movq %rsp, %rdi
callq 0x17c9
jmp 0x1673
callq 0x19b3
leaq 0x70(%rsp), %rbx
movl $0x64, %esi
movq %rbx, %rdi
callq 0x18c9
leaq 0x9be(%rip), %rdi       # 0x2004
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1070
movq %rbx, %rdi
callq 0x13dc
testq %rax, %rax
je 0x1666
movq 0x8(%rax), %rsi
movq %rsp, %rdi
jmp 0x166e
movq %rsp, %rdi
leaq 0x70(%rsp), %rsi
callq 0x16f9
addq $0xd8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: get_alnum_str
size_t get_alnum_str(char *str, size_t max_str_len)
{
  size_t i = 0;
  int c;
  while (isalnum(c = getc(stdin)) && i < max_str_len)
  {
    str[i++] = c;
  }
  str[i] = '\0';
  ungetc(c, stdin);
  return i;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x10d0
movq %rax, %r15
movq (%rax), %r12
movq 0x26f4(%rip), %r13      # 0x3fe0
movq (%r13), %rdi
callq 0x10c0
movslq %eax, %rcx
testb $0x8, (%r12,%rcx,2)
sete %cl
testq %r14, %r14
sete %dl
xorl %r12d, %r12d
orb %cl, %dl
jne 0x192f
movb %al, (%rbx,%r12)
incq %r12
movq (%r15), %rbp
movq (%r13), %rdi
callq 0x10c0
movslq %eax, %rcx
testb $0x8, (%rbp,%rcx,2)
je 0x192f
cmpq %r14, %r12
jb 0x190d
movb $0x0, (%rbx,%r12)
movq (%r13), %rsi
movl %eax, %edi
callq 0x10b0
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: consume_word
void consume_word(char *word, char *Error_str)
{
  int c;
  if ((c = get_word(word, MAX_WORD_LEN)) == EOF)
  {
    ungetc(c, stdin);
    return;
  }
  else if (!isalpha(c))
  {
    puts(Error_str);
  }
  printf("%s", word);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl $0x64, %esi
callq 0x1307
cmpl $-0x1, %eax
je 0x199b
movl %eax, %ebp
callq 0x10d0
movq (%rax), %rax
movslq %ebp, %rcx
testb $0x4, 0x1(%rax,%rcx,2)
jne 0x1986
movq %r14, %rdi
callq 0x1050
leaq 0x677(%rip), %rdi       # 0x2004
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1070
movq 0x263e(%rip), %rax      # 0x3fe0
movq (%rax), %rsi
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %rbp
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: consume_blanks
void consume_blanks(void)
{
  int c;
  while (isblank(c = getc(stdin)))
  {
    putc(c, stdout);
  }
  ungetc(c, stdin);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x10d0
movq %rax, %rbx
movq (%rax), %r15
movq 0x2613(%rip), %r14      # 0x3fe0
movq (%r14), %rdi
callq 0x10c0
movslq %eax, %rcx
testb $0x1, (%r15,%rcx,2)
je 0x1a05
movq 0x25f2(%rip), %r15      # 0x3fd8
movq (%r15), %rsi
movl %eax, %edi
callq 0x1080
movq (%rbx), %r12
movq (%r14), %rdi
callq 0x10c0
movslq %eax, %rcx
testb $0x1, (%r12,%rcx,2)
jne 0x19e6
movq (%r14), %rsi
movl %eax, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10b0
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_6/exercise_6_06/define.c
// Function: consume_chars_between
void consume_chars_between(char start, char end)
{
  int c = getc(stdin);
  if (c == start)
  {
    putc(c, stdout);
    while ((c = getc(stdin)) != EOF)
    {
      putc(c, stdout);
      if (c == '\\')
      {
        c = getc(stdin);
        putc(c, stdout);
        if (c == EOF)
        {
          break;
        }
      }
      else if (c == end)
      {
        return;
      }
    }
  }
  ungetc(c, stdin);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %r14d
movq 0x25af(%rip), %r15      # 0x3fe0
movq (%r15), %rdi
callq 0x10c0
movl %eax, %ebx
cmpl %r14d, %eax
jne 0x1aae
movq 0x2591(%rip), %r12      # 0x3fd8
movq (%r12), %rsi
movl %ebx, %edi
callq 0x1080
movq (%r15), %rdi
callq 0x10c0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
cmpl $-0x1, %eax
je 0x1aae
movl %eax, %r14d
movsbl %bpl, %r13d
movq (%r12), %rsi
movl %r14d, %edi
callq 0x1080
cmpl $0x5c, %r14d
jne 0x1a99
movq (%r15), %rdi
callq 0x10c0
movl %eax, %ebp
movq (%r12), %rsi
movl %eax, %edi
callq 0x1080
cmpl $-0x1, %ebp
jne 0x1a9e
jmp 0x1aae
cmpl %r13d, %r14d
je 0x1ac6
movq (%r15), %rdi
callq 0x10c0
movl %eax, %r14d
cmpl $-0x1, %eax
jne 0x1a6b
movq (%r15), %rsi
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10b0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/juliusHuelsmann[P]st-focus/x.c
// Function: xloadalpha
void
xloadalpha(void)
{
	float const usedAlpha = focused ? alpha : alphaUnfocused;
	if (opt_alpha) alpha = strtof(opt_alpha, NULL);
	dc.col[defaultbg].color.alpha = (unsigned short)(0xffff * usedAlpha);
	dc.col[defaultbg].pixel &= 0x00FFFFFF;
	dc.col[defaultbg].pixel |= (unsigned char)(0xff * usedAlpha) << 24;
}

// Assembly:
pushq %rax
movss 0xb745(%rip), %xmm1     # 0x154e0
movq 0xddbe(%rip), %rdi      # 0x17b60
testq %rdi, %rdi
je 0x9dc2
xorl %esi, %esi
movss %xmm1, 0x4(%rsp)
callq 0x5450
movss 0x4(%rsp), %xmm1
movss %xmm0, 0xb71a(%rip)     # 0x154dc
movss 0x4c7a(%rip), %xmm0     # 0xea44
mulss %xmm1, %xmm0
cvttss2si %xmm0, %eax
movq 0xdd8f(%rip), %rcx      # 0x17b68
movl 0xdd79(%rip), %edx      # 0x17b58
shlq $0x4, %rdx
movw %ax, 0xe(%rcx,%rdx)
movq (%rcx,%rdx), %rax
andl $0xffffff, %eax         # imm = 0xFFFFFF
mulss 0x4c4f(%rip), %xmm1     # 0xea48
cvttss2si %xmm1, %esi
shll $0x18, %esi
movslq %esi, %rsi
orq %rax, %rsi
movq %rsi, (%rcx,%rdx)
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O1/juliusHuelsmann[P]st-focus/x.c
// Function: xloadcols
void
xloadcols(void)
{
	static int loaded;
	Color *cp;

	if (!loaded) {
		dc.collen = 1 + (defaultbg = MAX(LEN(colorname), 256));
		dc.col = xmalloc((dc.collen) * sizeof(Color));
	}

	for (int i = 0; i+1 < dc.collen; ++i)
		if (!xloadcolor(i, NULL, &dc.col[i])) {
			if (colorname[i])
				die("could not allocate color '%s'\n", colorname[i]);
			else
				die("could not allocate color %d\n", i);
		}
	if (dc.collen) // cannot die, as the color is already loaded.
		xloadcolor(focused ?bg :bgUnfocused, NULL, &dc.col[defaultbg]);

	xloadalpha();
	loaded = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
cmpb $0x0, 0xde44(%rip)      # 0x17c60
jne 0x9e44
movl $0x103, 0xdd30(%rip)    # imm = 0x103
movq $0x104, 0xdd3d(%rip) # imm = 0x104
movl $0x1040, %edi           # imm = 0x1040
callq 0x5e4c
movq %rax, 0xdd24(%rip)      # 0x17b68
movq 0xdd25(%rip), %rax      # 0x17b70
cmpq $0x2, %rax
jb 0x9ec8
leaq 0x8bb8(%rip), %r12      # 0x12a10
leaq 0x4d28(%rip), %rbx      # 0xeb87
leaq 0x4d02(%rip), %r14      # 0xeb68
xorl %r13d, %r13d
xorl %r15d, %r15d
movq 0xdcf5(%rip), %rdx      # 0x17b68
addq %r13, %rdx
movl %r15d, %edi
xorl %esi, %esi
callq 0x9f01
testl %eax, %eax
jne 0x9ead
leaq -0x10(%r15), %rax
cmpq $0xf0, %rax
jae 0x9e9f
movq %rbx, %rdi
movl %r15d, %esi
xorl %eax, %eax
callq 0x5e76
jmp 0x9ead
movq (%r12), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x5e76
movq 0xdcbc(%rip), %rax      # 0x17b70
addq $0x8, %r12
addq $0x10, %r13
leaq 0x2(%r15), %rcx
incq %r15
cmpq %rcx, %rax
ja 0x9e6c
testq %rax, %rax
je 0x9eeb
movl 0xb619(%rip), %edi      # 0x154ec
movl 0xdc7f(%rip), %edx      # 0x17b58
shlq $0x4, %rdx
addq 0xdc84(%rip), %rdx      # 0x17b68
xorl %esi, %esi
callq 0x9f01
callq 0x9d92
movb $0x1, 0xdd69(%rip)      # 0x17c60
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/deepika9294[P]Threading-Library/many-one/test/matrix.c
// Function: print_matrix
void print_matrix(matrix *t) {
    printf("\n");
    // printf("%d %d\n",t->r,t->c);
    // t->mat[5][5] = 34;

    for(int i = 0; i < t->r; i++) {
        for(int j = 0; j < t->c; j++) {
            // printf("%d ", t->mat[i][j]);
            // just for test case
            if(t->mat[i][j] != 80){
                final_check = 0;
            }
        }
        // printf("\n");
    }
    if(final_check == 1) {
        printf(GREEN "**PASSED** : MATRIX TEST with rows=%d, columns=%d\n" NONE, t->r, t->c);
    }
    else {
        printf(RED "**FAILED** : MATRIX TEST with rows=%d, columns=%d\n" NONE,  t->r, t->c);

    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0xa, %edi
callq 0x1050
movslq 0x8(%rbx), %rsi
testq %rsi, %rsi
jle 0x1a46
movl 0xc(%rbx), %eax
xorl %ecx, %ecx
testl %eax, %eax
jle 0x1a3e
movq (%rbx), %rdx
movq (%rdx,%rcx,8), %rdx
xorl %edi, %edi
cmpl $0x50, (%rdx,%rdi,4)
je 0x1a36
movl $0x0, 0x267a(%rip)      # 0x40b0
incq %rdi
cmpq %rdi, %rax
jne 0x1a26
incq %rcx
cmpq %rsi, %rcx
jne 0x1a19
cmpl $0x1, 0x2663(%rip)      # 0x40b0
movl 0xc(%rbx), %edx
leaq 0x5da(%rip), %rax       # 0x2031
leaq 0x613(%rip), %rdi       # 0x2071
cmoveq %rax, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O1/mflatt[P]gc-demo/gen2space/gen2space.c
// Function: is_allocated
int is_allocated(void *p)
{
  return (((uintptr_t)p >= space_start
           && (uintptr_t)p < space_end)
          || (is_major
              /* During a major collection, also treat references
                 into the old generation's space as allocated: */
              && ((uintptr_t)p >= gen1_space_start
                  && (uintptr_t)p < gen1_space_end)));
}

// Assembly:
leaq 0x303e(%rip), %rax      # 0x44b0
cmpq %rdi, (%rax)
ja 0x1489
leaq 0x2c1a(%rip), %rcx      # 0x4098
movl $0x1, %eax
cmpq %rdi, (%rcx)
jbe 0x1489
retq
xorl %eax, %eax
cmpb $0x1, 0x2be6(%rip)      # 0x4078
jne 0x1488
cmpq %rdi, 0x2be5(%rip)      # 0x4080
setbe %al
cmpq %rdi, 0x2bc3(%rip)      # 0x4068
seta %cl
andb %al, %cl
movzbl %cl, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O1/cyb70289[P]tt/tests/tree.c
// Function: walk
static bool walk(const void *key, const void *v, void *context)
{
#if 0
	printf("%s -> %d\n", (const char *)key, *(int *)v);
#endif
	/* Verify key and value pair */
	if (*(int *)v != key2v((const char *)key)) {
		printf("Error in walking tree\n");
		return false;	/* Stop */
	}
	return true;	/* Continue */
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl (%rsi), %ebx
movb (%rdi), %al
testb %al, %al
je 0x1821
incq %rdi
xorl %r14d, %r14d
leal (%r14,%r14,4), %ecx
leal (%rcx,%rcx,4), %ecx
addl %r14d, %ecx
movsbl %al, %eax
leal (%rax,%rcx), %r14d
addl $-0x61, %r14d
movb (%rdi), %al
incq %rdi
testb %al, %al
jne 0x1801
jmp 0x1824
xorl %r14d, %r14d
cmpl %r14d, %ebx
je 0x1835
leaq 0x2847(%rip), %rdi      # 0x4077
callq 0x1060
cmpl %r14d, %ebx
sete %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O1/chrispanag[P]operating-systems-scheduler/execve-example.c
// Function: main
int main(int argc, char *argv[])
{
	char executable[] = "prog";
	char *newargv[] = { executable, NULL, NULL, NULL };
	char *newenviron[] = { NULL };

	printf("I am %s, PID = %ld\n",
		argv[0], (long)getpid());
	printf("About to replace myself with the executable %s...\n",
		executable);
	sleep(2);

	execve(executable, newargv, newenviron);

	/* execve() only returns on error */
	perror("execve");
	exit(1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsp, %rbx
movb $0x0, 0x4(%rbx)
movl $0x676f7270, (%rbx)     # imm = 0x676F7270
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r14
movaps %xmm0, (%r14)
movaps %xmm0, 0x10(%r14)
movq %rbx, (%r14)
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
movq (%rsi), %r12
callq 0x1030
movslq %eax, %rdx
leaq 0xe33(%rip), %rdi       # 0x2009
movq %r12, %rsi
xorl %eax, %eax
callq 0x1040
leaq 0xe36(%rip), %rdi       # 0x201d
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
movl $0x2, %edi
callq 0x1080
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1050
leaq 0xe40(%rip), %rdi       # 0x2050
callq 0x1060
movl $0x1, %edi
callq 0x1070
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: logging
void logging(enum loglevel_t loglevel, char *format, ...)
{
	va_list arg;
	static const char *loglevel2str[] = {
		[DEBUG] = "DEBUG",
		[WARN]  = "WARN",
		[ERROR] = "ERROR",
		[FATAL] = "FATAL",
	};

	/* debug message is available on verbose mode */
	if ((loglevel == DEBUG) && (VERBOSE == false))
		return;

	fprintf(stderr, ">>%s<<\t", loglevel2str[loglevel]);

	va_start(arg, format);
	vfprintf(stderr, format, arg);
	va_end(arg);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xd8, %rsp
movq %rdx, 0x30(%rsp)
movq %rcx, 0x38(%rsp)
movq %r8, 0x40(%rsp)
movq %r9, 0x48(%rsp)
testb %al, %al
je 0x24b5
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)
testl %edi, %edi
jne 0x24c4
addq $0xd8, %rsp
popq %rbx
popq %r14
retq
movq %rsi, %rbx
movq 0x53b2a(%rip), %r14     # 0x55ff8
movq (%r14), %rax
movl %edi, %ecx
leaq 0x607a(%rip), %rsi      # 0x8554
movslq (%rsi,%rcx,4), %rdx
addq %rsi, %rdx
leaq 0x5035c(%rip), %rsi     # 0x52844
movq %rax, %rdi
xorl %eax, %eax
callq 0x21a0
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rsp, %rdx
movq %rax, (%rdx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rdx)
leaq 0x20(%rsp), %rax
movq %rax, 0x10(%rdx)
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x22a0
jmp 0x24b9
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eopen
int eopen(const char *path, int flag)
{
	int fd;
	errno = 0;

	if ((fd = open(path, flag)) < 0) {
		logging(ERROR, "couldn't open \"%s\"\n", path);
		logging(ERROR, "open: %s\n", strerror(errno));
	}
	return fd;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r15
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, %rdi
movl %ebx, %esi
xorl %eax, %eax
callq 0x2270
movl %eax, %ebx
testl %eax, %eax
jns 0x2582
leaq 0x502f7(%rip), %rsi     # 0x5284c
movl $0x2, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x245c
movl (%r14), %edi
callq 0x22e0
leaq 0x502ee(%rip), %rsi     # 0x52861
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eclose
int eclose(int fd)
{
	int ret;
	errno = 0;

	if ((ret = close(fd)) < 0)
		logging(ERROR, "close: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movl %ebx, %edi
callq 0x2150
movl %eax, %ebx
testl %eax, %eax
jns 0x25c9
movl (%r14), %edi
callq 0x22e0
leaq 0x502b2(%rip), %rsi     # 0x5286c
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: efopen
FILE *efopen(const char *path, char *mode)
{
	FILE *fp;
	errno = 0;

	if ((fp = fopen(path, mode)) == NULL) {
		logging(ERROR, "couldn't open \"%s\"\n", path);
		logging(ERROR, "fopen: %s\n", strerror(errno));
	}
	return fp;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2280
movq %rax, %rbx
testq %rax, %rax
jne 0x2633
leaq 0x50246(%rip), %rsi     # 0x5284c
movl $0x2, %edi
movq %r15, %rdx
xorl %eax, %eax
callq 0x245c
movl (%r14), %edi
callq 0x22e0
leaq 0x5023c(%rip), %rsi     # 0x52860
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: efclose
int efclose(FILE *fp)
{
	int ret;
	errno = 0;

	if ((ret = fclose(fp)) < 0)
		logging(ERROR, "fclose: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %rbx, %rdi
callq 0x20c0
movl %eax, %ebx
testl %eax, %eax
jns 0x267d
movl (%r14), %edi
callq 0x22e0
leaq 0x501fd(%rip), %rsi     # 0x5286b
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: emmap
void *emmap(void *addr, size_t len, int prot, int flag, int fd, off_t offset)
{
	void *fp;
	errno = 0;

	if ((fp = mmap(addr, len, prot, flag, fd, offset)) == MAP_FAILED)
		logging(ERROR, "mmap: %s\n", strerror(errno));

	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, (%rsp)
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %rbx
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r13, %rsi
movl %r12d, %edx
movl %r15d, %ecx
movl %ebp, %r8d
movq (%rsp), %r9
callq 0x20e0
movq %rax, %rbx
cmpq $-0x1, %rax
jne 0x26f2
movl (%r14), %edi
callq 0x22e0
leaq 0x50194(%rip), %rsi     # 0x52877
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: emunmap
int emunmap(void *ptr, size_t len)
{
	int ret;
	errno = 0;

	if ((ret = munmap(ptr, len)) < 0)
		logging(ERROR, "munmap: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2230
movl %eax, %ebx
testl %eax, %eax
jns 0x274c
movl (%r14), %edi
callq 0x22e0
leaq 0x50144(%rip), %rsi     # 0x52881
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: ecalloc
void *ecalloc(size_t nmemb, size_t size)
{
	void *ptr;
	errno = 0;

	if ((ptr = calloc(nmemb, size)) == NULL)
		logging(ERROR, "calloc: %s\n", strerror(errno));

	return ptr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2060
movl $0x0, (%rax)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2180
movq %rax, %rbx
testq %rax, %rax
jne 0x2799
xorl %edi, %edi
callq 0x22e0
leaq 0x50103(%rip), %rsi     # 0x5288d
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: erealloc
void *erealloc(void *ptr, size_t size)
{
	void *new;
	errno = 0;

	if ((new = realloc(ptr, size)) == NULL)
		logging(ERROR, "realloc: %s\n", strerror(errno));

	return new;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2220
movq %rax, %rbx
testq %rax, %rax
jne 0x27ee
movl (%r14), %edi
callq 0x22e0
leaq 0x500ba(%rip), %rsi     # 0x52899
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eselect
int eselect(int maxfd, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *tv)
{
	int ret;
	errno = 0;

	if ((ret = select(maxfd, readfds, writefds, errorfds, tv)) < 0) {
		if (errno == EINTR)
			return eselect(maxfd, readfds, writefds, errorfds, tv);
		else
			logging(ERROR, "select: %s\n", strerror(errno));
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
movl %edi, %r13d
callq 0x2060
movq %rax, %rbx
movl $0x0, (%rax)
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movq (%rsp), %r8
callq 0x21e0
movl %eax, %ebp
testl %eax, %eax
jns 0x285d
movl (%rbx), %edi
cmpl $0x4, %edi
je 0x2812
callq 0x22e0
leaq 0x50058(%rip), %rsi     # 0x528a6
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: ewrite
ssize_t ewrite(int fd, const void *buf, size_t size)
{
	ssize_t ret;
	errno = 0;

	if ((ret = write(fd, buf, size)) < 0) {
		if (errno == EINTR) {
			logging(ERROR, "write: EINTR occurred\n");
			return ewrite(fd, buf, size);
		} else if (errno == EAGAIN || errno == EWOULDBLOCK) {
			logging(ERROR, "write: EAGAIN or EWOULDBLOCK occurred, sleep %d usec\n", SLEEP_TIME);
			usleep(SLEEP_TIME);
			return ewrite(fd, buf, size);
		} else {
			logging(ERROR, "write: %s\n", strerror(errno));
			return ret;
		}
	} else if (ret < (ssize_t) size) {
		logging(ERROR, "data size:%zu write size:%zd\n", size, ret);
		return ewrite(fd, (char *) buf + ret, size - ret);
	}
	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r13
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x5002a(%rip), %r15     # 0x528b2
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movl %ebp, %edi
movq %rbx, %rsi
movq %r13, %rdx
callq 0x20b0
movq %rax, %r12
testq %rax, %rax
jns 0x28ed
movl (%r14), %edi
cmpl $0xb, %edi
je 0x28c9
cmpl $0x4, %edi
jne 0x2919
movl $0x2, %edi
movq %r15, %rsi
xorl %eax, %eax
callq 0x245c
jmp 0x2888
movl $0x2, %edi
leaq 0x4fff4(%rip), %rsi     # 0x528c9
movl $0x7530, %edx           # imm = 0x7530
xorl %eax, %eax
callq 0x245c
movl $0x7530, %edi           # imm = 0x7530
callq 0x2350
jmp 0x2888
movq %r13, %r14
subq %r12, %r14
jle 0x2934
movl $0x2, %edi
leaq 0x50009(%rip), %rsi     # 0x5290a
movq %r13, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x245c
addq %r12, %rbx
movq %r14, %r13
jmp 0x2888
callq 0x22e0
leaq 0x4ffda(%rip), %rsi     # 0x528ff
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movq %r12, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: esigaction
int esigaction(int signo, struct sigaction *act, struct sigaction *oact)
{
	int ret;
	errno = 0;

	if ((ret = sigaction(signo, act, oact)) < 0)
		logging(ERROR, "sigaction: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movl %edi, %ebp
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x2090
movl %eax, %ebx
testl %eax, %eax
jns 0x2994
movl (%r14), %edi
callq 0x22e0
leaq 0x4ffa3(%rip), %rsi     # 0x52928
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: etcgetattr
int etcgetattr(int fd, struct termios *tm)
{
	int ret;
	errno = 0;

	if ((ret = tcgetattr(fd, tm)) < 0)
		logging(ERROR, "tcgetattr: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movl %ebp, %edi
movq %rbx, %rsi
callq 0x2250
movl %eax, %ebx
testl %eax, %eax
jns 0x29e6
movl (%r14), %edi
callq 0x22e0
leaq 0x4ff60(%rip), %rsi     # 0x52937
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: etcsetattr
int etcsetattr(int fd, int action, const struct termios *tm)
{
	int ret;
	errno = 0;

	if ((ret = tcsetattr(fd, action, tm)) < 0)
		logging(ERROR, "tcgetattr: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movl %edi, %r15d
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movl %r15d, %edi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x2260
movl %eax, %ebx
testl %eax, %eax
jns 0x2a3b
movl (%r14), %edi
callq 0x22e0
leaq 0x4ff0b(%rip), %rsi     # 0x52937
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eopenpty
int eopenpty(int *amaster, int *aslave, char *aname,
	const struct termios *termp, const struct winsize *winsize)
{
	int master;
	char *name = NULL;
	errno = 0;

	if ((master = posix_openpt(O_RDWR | O_NOCTTY)) < 0
		|| grantpt(master) < 0
		|| unlockpt(master) < 0
		|| (name = ptsname(master)) == NULL) {
		logging(ERROR, "openpty: %s\n", strerror(errno));
		return -1;
	}
	*amaster = master;
	*aslave  = eopen(name, O_RDWR | O_NOCTTY);

	if (aname)
		/* XXX: we don't use the slave's name, do nothing */
		(void) aname;
		//strncpy(aname, name, _POSIX_TTY_NAME_MAX - 1);
		//snprintf(aname, _POSIX_TTY_NAME_MAX, "%s", name);
	if (termp)
		etcsetattr(*aslave, TCSAFLUSH, termp);
	if (winsize)
		ioctl(*aslave, TIOCSWINSZ, winsize);

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %rbx
movq %rcx, %r15
movq %rsi, %r14
movq %rdi, %r12
callq 0x2060
movq %rax, %r13
movl $0x0, (%rax)
movl $0x102, %edi            # imm = 0x102
callq 0x2300
testl %eax, %eax
js 0x2ae2
movl %eax, %ebp
movl %eax, %edi
callq 0x22c0
testl %eax, %eax
js 0x2ae2
movl %ebp, %edi
callq 0x2190
testl %eax, %eax
js 0x2ae2
movl %ebp, %edi
callq 0x2040
testq %rax, %rax
je 0x2ae2
movl %ebp, (%r12)
movq %rax, %rdi
movl $0x102, %esi            # imm = 0x102
callq 0x2524
movl %eax, (%r14)
testq %r15, %r15
je 0x2ac7
movl %eax, %edi
movl $0x2, %esi
movq %r15, %rdx
callq 0x29ed
testq %rbx, %rbx
je 0x2b17
movl (%r14), %edi
xorl %ebp, %ebp
movl $0x5414, %esi           # imm = 0x5414
movq %rbx, %rdx
xorl %eax, %eax
callq 0x2140
jmp 0x2b06
movl (%r13), %edi
callq 0x22e0
leaq 0x4fe54(%rip), %rsi     # 0x52946
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %ebp, %ebp
jmp 0x2b06
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eforkpty
pid_t eforkpty(int *amaster, char *name,
	const struct termios *termp, const struct winsize *winsize)
{
	int master, slave;
	pid_t pid;

	if (eopenpty(&master, &slave, name, termp, winsize) < 0)
		return -1;

	errno = 0;
	pid   = fork();
	if (pid < 0) {
		logging(ERROR, "fork: %s\n", strerror(errno));
		return pid;
	} else if (pid == 0) { /* child */
		close(master);
		setsid();

		dup2(slave, STDIN_FILENO);
		dup2(slave, STDOUT_FILENO);
		dup2(slave, STDERR_FILENO);

		/* XXX: this ioctl may fail in Mac OS X
			ref http://www.opensource.apple.com/source/Libc/Libc-825.25/util/pty.c?txt */
		if (ioctl(slave, TIOCSCTTY, NULL))
			logging(WARN, "ioctl: TIOCSCTTY faild\n");
		close(slave);

		return 0;
	}
	/* parent */
	close(slave);
	*amaster = master;

	return pid;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r8
movq %rdx, %rcx
movq %rdi, %r14
leaq 0x4(%rsp), %rdi
movq %rsp, %rsi
callq 0x2a48
testl %eax, %eax
js 0x2b6b
callq 0x2060
movq %rax, %r15
movl $0x0, (%rax)
callq 0x2320
movl %eax, %ebx
testl %eax, %eax
js 0x2b75
je 0x2b95
movl (%rsp), %edi
callq 0x2150
movl 0x4(%rsp), %eax
movl %eax, (%r14)
jmp 0x2bf7
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x2bf7
movl (%r15), %edi
callq 0x22e0
leaq 0x4fdcf(%rip), %rsi     # 0x52953
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
jmp 0x2bf7
movl 0x4(%rsp), %edi
callq 0x2150
callq 0x2160
movl (%rsp), %ebp
xorl %ebx, %ebx
movl %ebp, %edi
xorl %esi, %esi
callq 0x20f0
movl %ebp, %edi
movl $0x1, %esi
callq 0x20f0
movl %ebp, %edi
movl $0x2, %esi
callq 0x20f0
movl $0x540e, %esi           # imm = 0x540E
movl %ebp, %edi
xorl %edx, %edx
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
je 0x2bf0
leaq 0x4fd79(%rip), %rsi     # 0x5295d
movl $0x1, %edi
xorl %eax, %eax
callq 0x245c
movl %ebp, %edi
callq 0x2150
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: esetenv
int esetenv(const char *name, const char *value, int overwrite)
{
	int ret;
	errno = 0;

	if ((ret = setenv(name, value, overwrite)) < 0)
		logging(ERROR, "setenv: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r12
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x20a0
movl %eax, %ebx
testl %eax, %eax
jns 0x2c53
movl (%r14), %edi
callq 0x22e0
leaq 0x4fd31(%rip), %rsi     # 0x52975
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eexecvp
int eexecvp(const char *file, char *const argv[])
{
	int ret;
	errno = 0;

	if ((ret = execvp(file, (char * const *) argv)) < 0)
		logging(ERROR, "execvp: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r15, %rdi
movq %rbx, %rsi
callq 0x22b0
movl %eax, %ebx
testl %eax, %eax
jns 0x2ca9
movl (%r14), %edi
callq 0x22e0
leaq 0x4fce7(%rip), %rsi     # 0x52981
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: eexecl
int eexecl(const char *path)
{
	int ret;
	errno = 0;

	/* XXX: assume only one argument is given */
	if ((ret = execl(path, path, NULL)) < 0)
		logging(ERROR, "execl: %s\n", strerror(errno));

	return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %rbx, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x22f0
movl %eax, %ebx
testl %eax, %eax
jns 0x2cf9
movl (%r14), %edi
callq 0x22e0
leaq 0x4fca3(%rip), %rsi     # 0x5298d
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: estrtol
long estrtol(const char *nptr, char **endptr, int base)
{
	long int ret;
	errno = 0;

	ret = strtol(nptr, endptr, base);
	if (ret == LONG_MIN || ret == LONG_MAX) {
		logging(ERROR, "strtol: %s\n", strerror(errno));
		return 0;
	}

	return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r12
callq 0x2060
movq %rax, %r14
movl $0x0, (%rax)
movq %r12, %rdi
movq %r15, %rsi
movl %ebx, %edx
callq 0x21b0
movq %rax, %rbx
movabsq $-0x7fffffffffffffff, %rax # imm = 0x8000000000000001
addq %rbx, %rax
cmpq $0x1, %rax
ja 0x2d64
movl (%r14), %edi
callq 0x22e0
leaq 0x4fc45(%rip), %rsi     # 0x52998
xorl %ebx, %ebx
movl $0x2, %edi
movq %rax, %rdx
xorl %eax, %eax
callq 0x245c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: parse_arg
void parse_arg(char *buf, struct parm_t *pt, int delim, int (is_valid)(int c))
{
	/*
		v..........v d           v.....v d v.....v ... d
		(valid char) (delimiter)
		argv[0]                  argv[1]   argv[2] ...   argv[argc - 1]
	*/
	size_t length;
	char *cp, *vp;

	if (buf == NULL)
		return;

	length = strlen(buf);
	logging(DEBUG, "parse_arg() length:%u\n", (unsigned) length);

	vp = NULL;
	for (size_t i = 0; i < length; i++) {
		cp = buf + i;

		if (vp == NULL && is_valid(*cp))
			vp = cp;

		if (*cp == delim) {
			*cp = '\0';
			add_parm(pt, vp);
			vp = NULL;
		}

		if (i == (length - 1) && (vp != NULL || *cp == '\0'))
			add_parm(pt, vp);
	}

	logging(DEBUG, "argc:%d\n", pt->argc);
}

// Assembly:
testq %rdi, %rdi
je 0x2e49
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
callq 0x20d0
testq %rax, %rax
je 0x2e41
movq %rax, %r12
xorl %eax, %eax
testq %rax, %rax
jne 0x2df1
movsbl (%r15), %edi
callq *%rbx
testl %eax, %eax
je 0x2def
movq %r15, %rax
jmp 0x2df1
xorl %eax, %eax
movsbl (%r15), %ecx
cmpl %ebp, %ecx
jne 0x2e13
movb $0x0, (%r15)
movslq (%r14), %rcx
cmpq $0xf, %rcx
jg 0x2e11
movq %rax, 0x8(%r14,%rcx,8)
leal 0x1(%rcx), %eax
movl %eax, (%r14)
xorl %eax, %eax
cmpq $0x1, %r12
jne 0x2e39
testq %rax, %rax
je 0x2e33
movslq (%r14), %rcx
cmpq $0xf, %rcx
jg 0x2e39
movq %rax, 0x8(%r14,%rcx,8)
incl %ecx
movl %ecx, (%r14)
jmp 0x2e39
cmpb $0x0, (%r15)
je 0x2e1e
incq %r15
decq %r12
jne 0x2ddb
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./util.h
// Function: sum
int sum(struct parm_t *parm)
{
	int sum = 0;

	for (int i = 0; i < parm->argc; i++)
		sum += dec2num(parm->argv[i]);

	return sum;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, (%rdi)
jle 0x2ec9
movq %rdi, %rbx
xorl %r14d, %r14d
xorl %ebp, %ebp
movq 0x8(%rbx,%r14,8), %rdi
movl $0x0, %eax
testq %rdi, %rdi
je 0x2eba
xorl %esi, %esi
movl $0xa, %edx
callq 0x2d03
addl %eax, %ebp
incq %r14
movslq (%rbx), %rax
cmpq %rax, %r14
jl 0x2e9f
jmp 0x2ecb
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/linux.h
// Function: alloc_cmap
void alloc_cmap(cmap_t *cmap, int colors)
{
	cmap->start  = 0;
	cmap->len    = colors;
	cmap->red    = (__u16 *) ecalloc(colors, sizeof(__u16));
	cmap->green  = (__u16 *) ecalloc(colors, sizeof(__u16));
	cmap->blue   = (__u16 *) ecalloc(colors, sizeof(__u16));
	cmap->transp = NULL;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movl $0x0, (%rdi)
movl %esi, 0x4(%rdi)
movslq %esi, %r14
movl $0x2, %esi
movq %r14, %rdi
callq 0x2754
movq %rax, 0x8(%rbx)
movl $0x2, %esi
movq %r14, %rdi
callq 0x2754
movq %rax, 0x10(%rbx)
movl $0x2, %esi
movq %r14, %rdi
callq 0x2754
movq %rax, 0x18(%rbx)
movq $0x0, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/linux.h
// Function: set_bitfield
void set_bitfield(struct fb_var_screeninfo *vinfo,
	struct bitfield_t *red, struct bitfield_t *green, struct bitfield_t *blue)
{
	red->length   = vinfo->red.length;
	green->length = vinfo->green.length;
	blue->length  = vinfo->blue.length;

	red->offset   = vinfo->red.offset;
	green->offset = vinfo->green.offset;
	blue->offset  = vinfo->blue.offset;
}

// Assembly:
movl 0x24(%rdi), %eax
movl %eax, (%rsi)
movl 0x30(%rdi), %eax
movl %eax, (%rdx)
movl 0x3c(%rdi), %eax
movl %eax, (%rcx)
movl 0x20(%rdi), %eax
movl %eax, 0x4(%rsi)
movl 0x2c(%rdi), %eax
movl %eax, 0x4(%rdx)
movl 0x38(%rdi), %eax
movl %eax, 0x4(%rcx)
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/linux.h
// Function: set_fbinfo
bool set_fbinfo(int fd, struct fb_info_t *info)
{
	struct fb_fix_screeninfo finfo;
	struct fb_var_screeninfo vinfo;

	if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo)) {
		logging(ERROR, "ioctl: FBIOGET_FSCREENINFO failed\n");
		return false;
	}

	if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo)) {
		logging(ERROR, "ioctl: FBIOGET_VSCREENINFO failed\n");
		return false;
	}

	set_bitfield(&vinfo, &info->red, &info->green, &info->blue);

	info->width  = vinfo.xres;
	info->height = vinfo.yres;
	info->screen_size = finfo.smem_len;
	info->line_length = finfo.line_length;

	info->bits_per_pixel  = vinfo.bits_per_pixel;
	info->bytes_per_pixel = my_ceil(info->bits_per_pixel, BITS_PER_BYTE);

	info->type   = set_type(finfo.type);
	info->visual = set_visual(finfo.visual);

	/* check screen [xy]offset and initialize because linux console changes these values */
	if (vinfo.xoffset != 0 || vinfo.yoffset != 0) {
		vinfo.xoffset = vinfo.yoffset = 0;
		if (ioctl(fd, FBIOPUT_VSCREENINFO, &vinfo))
			logging(WARN, "couldn't reset offset (x:%d y:%d)\n", vinfo.xoffset, vinfo.yoffset);
	}

	return true;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0xf0, %rsp
movq %rsi, %r14
movl %edi, %ebx
leaq 0xa0(%rsp), %rdx
movl $0x4602, %esi           # imm = 0x4602
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
je 0x2fc3
leaq 0x4f9e3(%rip), %rsi     # 0x529a4
jmp 0x2fdf
movq %rsp, %rdx
movl $0x4600, %esi           # imm = 0x4600
movl %ebx, %edi
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
je 0x2ffb
leaq 0x4f9e8(%rip), %rsi     # 0x529c7
xorl %ebp, %ebp
movl $0x2, %edi
xorl %eax, %eax
callq 0x245c
movl %ebp, %eax
addq $0xf0, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movl 0x24(%rsp), %eax
movl %eax, (%r14)
movl 0x30(%rsp), %eax
movl %eax, 0x8(%r14)
movl 0x3c(%rsp), %eax
movl %eax, 0x10(%r14)
movl 0x20(%rsp), %eax
movl %eax, 0x4(%r14)
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%r14)
movl 0x38(%rsp), %eax
movl %eax, 0x14(%r14)
movl (%rsp), %eax
movl %eax, 0x18(%r14)
movl 0x4(%rsp), %eax
movl %eax, 0x1c(%r14)
movl 0xb8(%rsp), %eax
movq %rax, 0x20(%r14)
movl 0xd0(%rsp), %eax
movl %eax, 0x28(%r14)
movl 0x18(%rsp), %eax
movl %eax, 0x30(%r14)
leal 0x7(%rax), %ecx
addl $0xe, %eax
testl %ecx, %ecx
cmovnsl %ecx, %eax
sarl $0x3, %eax
movl %eax, 0x2c(%r14)
movl 0xbc(%rsp), %eax
xorl %ecx, %ecx
cmpl $0x1, %eax
setne %cl
incl %ecx
testl %eax, %eax
cmovel %eax, %ecx
movl %ecx, 0x34(%r14)
movl 0xc4(%rsp), %eax
addl $-0x2, %eax
movl $0x3, %ecx
cmpl $0x2, %eax
ja 0x30a3
movl %eax, %eax
leaq 0x4f760(%rip), %rcx     # 0x52800
movl (%rcx,%rax,4), %ecx
movl %ecx, 0x38(%r14)
movl 0x14(%rsp), %eax
movb $0x1, %bpl
orl 0x10(%rsp), %eax
je 0x2fed
movq %rsp, %rdx
movq $0x0, 0x10(%rdx)
movl $0x4601, %esi           # imm = 0x4601
movl %ebx, %edi
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
je 0x2fed
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
leaq 0x4f902(%rip), %rsi     # 0x529ea
movl $0x1, %edi
xorl %eax, %eax
callq 0x245c
jmp 0x2fed
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/common.h
// Function: cmap_die
void cmap_die(cmap_t *cmap)
{
	if (cmap) {
		free(cmap->red);
		free(cmap->green);
		free(cmap->blue);
		//free(cmap->transp);
		free(cmap);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x3171
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x2050
movq 0x10(%rbx), %rdi
callq 0x2050
movq 0x18(%rbx), %rdi
callq 0x2050
movq %rbx, %rdi
popq %rbx
jmp 0x2050
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/common.h
// Function: cmap_create
cmap_t *cmap_create(int colors)
{
	cmap_t *cmap;

	if ((cmap = (cmap_t *) ecalloc(1, sizeof(cmap_t))) == NULL) {
		logging(ERROR, "couldn't allocate cmap buffer\n");
		return NULL;
	}

	/* init os specific */
	alloc_cmap(cmap, colors);

	if (!cmap->red || !cmap->green || !cmap->blue) {
		logging(ERROR, "couldn't allocate red/green/blue buffer of cmap\n");
		cmap_die(cmap);
		return NULL;
	}
	return cmap;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x1, %edi
movl $0x28, %esi
callq 0x2754
testq %rax, %rax
je 0x31cc
movq %rax, %rbx
movq %rax, %rdi
movl %ebp, %esi
callq 0x2ed2
cmpq $0x0, 0x8(%rbx)
je 0x31ad
cmpq $0x0, 0x10(%rbx)
je 0x31ad
cmpq $0x0, 0x18(%rbx)
jne 0x31e1
leaq 0x4f89c(%rip), %rsi     # 0x52a50
movl $0x2, %edi
xorl %eax, %eax
callq 0x245c
movq %rbx, %rdi
callq 0x3144
xorl %ebx, %ebx
jmp 0x31e1
leaq 0x4f85e(%rip), %rsi     # 0x52a31
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x245c
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/common.h
// Function: cmap_update
bool cmap_update(int fd, cmap_t *cmap)
{
	if (cmap) {
		if (put_cmap(fd, cmap)) {
			logging(ERROR, "put_cmap failed\n");
			return false;
		}
	}
	return true;
}

// Assembly:
pushq %rbx
movb $0x1, %bl
testq %rsi, %rsi
je 0x321b
movq %rsi, %rdx
movl $0x4605, %esi           # imm = 0x4605
xorl %eax, %eax
callq 0x2140
testl %eax, %eax
je 0x321b
leaq 0x4f874(%rip), %rsi     # 0x52a81
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x245c
movl %ebx, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/common.h
// Function: cmap_save
bool cmap_save(int fd, cmap_t *cmap)
{
	if (get_cmap(fd, cmap)) {
		logging(WARN, "get_cmap failed\n");
		return false;
	}
	return true;
}

// Assembly:
pushq %rbx
movq %rsi, %rdx
movl $0x4604, %esi           # imm = 0x4604
xorl %eax, %eax
callq 0x2140
movl %eax, %ebx
testl %eax, %eax
je 0x3248
leaq 0x4f856(%rip), %rsi     # 0x52a92
movl $0x1, %edi
xorl %eax, %eax
callq 0x245c
testl %ebx, %ebx
sete %al
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/common.h
// Function: init_truecolor
bool init_truecolor(struct fb_info_t *info, cmap_t **cmap, cmap_t **cmap_orig)
{
	switch(info->bits_per_pixel) {
	case 15: /* XXX: 15 bpp is not tested */
	case 16:
	case 24:
	case 32:
		break;
	default:
		logging(ERROR, "truecolor %d bpp not supported\n", info->bits_per_pixel);
		return false;
	}
	/* we don't use cmap in truecolor */
	*cmap = *cmap_orig = NULL;

	return true;
}

// Assembly:
pushq %rbx
movq %rdx, %rax
movl 0x30(%rdi), %edx
cmpq $0x20, %rdx
ja 0x33c0
movabsq $0x101018000, %rcx      # imm = 0x101018000
btq %rdx, %rcx
jae 0x33c0
xorl %ecx, %ecx
movq %rcx, (%rax)
movq %rcx, (%rsi)
movb $0x1, %bl
movl %ebx, %eax
popq %rbx
retq
leaq 0x4f6dc(%rip), %rsi     # 0x52aa3
xorl %ebx, %ebx
movl $0x2, %edi
xorl %eax, %eax
callq 0x245c
jmp 0x33bc
// File: /workspace/github_c_makefile_star2_O1/uobikiemukot[P]yaft/./fb/common.h
// Function: fb_die
void fb_die(struct framebuffer_t *fb)
{
	cmap_die(fb->cmap);
	if (fb->cmap_orig) {
		put_cmap(fb->fd, fb->cmap_orig);
		cmap_die(fb->cmap_orig);
	}
	free(fb->wall);
	free(fb->buf);
	emunmap(fb->fp, fb->info.screen_size);
	eclose(fb->fd);
	//fb_release(fb->fd, &fb->info); /* os specific */
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x460(%rdi), %rdi
callq 0x3144
movq 0x468(%rbx), %rdx
testq %rdx, %rdx
je 0x3781
movl (%rbx), %edi
movl $0x4605, %esi           # imm = 0x4605
xorl %eax, %eax
callq 0x2140
movq 0x468(%rbx), %rdi
callq 0x3144
movq 0x18(%rbx), %rdi
callq 0x2050
movq 0x10(%rbx), %rdi
callq 0x2050
movq 0x8(%rbx), %rdi
movq 0x440(%rbx), %rsi
callq 0x2704
movl (%rbx), %edi
popq %rbx
jmp 0x258a