LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/token.c
// Function: print_line
static void print_line(char* start, char* pos) {
  size_t line = 0;
  size_t column = 0;
  /* char* start = src; // 出力する行の先頭文字 */

  for (char *c = start; c != pos && *c != '\0'; c++) {
    if (*c == '\n') {
      start = c + 1;
      line++;
      column = 0;
    } else {
      column++;
    }
  }

  eprintf("error at (%d, %d)\n\n", line + 1, column + 1);

  // 行を出力
  size_t len = strchr(start, '\n') - start;
  eprintf("%.*s\n", len, start);

  // posまでインデントする
  for (size_t i = 0; i < column; i++) {
    if (start[i] == '\t') {
      eprintf("\t");
    } else {
      eprintf(" ");
    }
  }

  eprintf("^\n\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
cmpq %rsi, %rdi
je 0xcdc6
movq %rsi, %rax
xorl %r14d, %r14d
movq %rbx, %rcx
xorl %esi, %esi
movzbl (%rcx), %edx
cmpl $0xa, %edx
je 0xcdaf
testl %edx, %edx
je 0xcdc1
incq %r14
jmp 0xcdb9
leaq 0x1(%rcx), %rbx
incq %rsi
xorl %r14d, %r14d
incq %rcx
cmpq %rax, %rcx
jne 0xcd9e
incq %rsi
jmp 0xcdce
movl $0x1, %esi
xorl %r14d, %r14d
leaq 0x1(%r14), %rdx
leaq 0x26d5(%rip), %rdi      # 0xf4ae
xorl %eax, %eax
callq 0x21b0
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2090
subq %rbx, %rax
leaq 0x26cb(%rip), %rdi      # 0xf4c2
movq %rax, %rsi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x21b0
testq %r14, %r14
je 0xce36
leaq 0x26b8(%rip), %r15      # 0xf4c8
leaq 0x1436(%rip), %r12      # 0xe24d
xorl %r13d, %r13d
cmpb $0x9, (%rbx,%r13)
movq %r15, %rdi
je 0xce27
movq %r12, %rdi
xorl %eax, %eax
callq 0x21b0
incq %r13
cmpq %r13, %r14
jne 0xce1a
leaq 0x268d(%rip), %rdi      # 0xf4ca
xorl %eax, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x21b0
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/token.c
// Function: lex
Token* lex(char* path) {
  FILE* file = fopen(path, "r");
  if (file == NULL) {
    error("cannot open file: %s\n", path);
  }

  src = read_file(file);
  fclose(file);
  cur = src;

  Token* current = next_token();
  Token* head = current;

  while ((current->next = next_token()) != NULL) {
    current = current->next;
  }

  return head;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x239b(%rip), %rsi      # 0xf206
callq 0x2150
testq %rax, %rax
je 0xcee4
movq %rax, %rbx
callq 0xd963
movq %rax, %r14
movq %rbx, %rdi
callq 0x20d0
cmpb $-0x1, %al
je 0xce99
movsbl %al, %esi
movq %r14, %rdi
callq 0xd99d
jmp 0xce80
movq %r14, %rdi
callq 0xda17
movq %rax, 0x6308(%rip)      # 0x131b0
movq %rbx, %rdi
callq 0x2070
movq 0x62f9(%rip), %rax      # 0x131b0
movq %rax, 0x62fa(%rip)      # 0x131b8
callq 0xcef5
movq %rax, %rbx
movq %rax, %r14
callq 0xcef5
movq %rax, (%r14)
movq %rax, %r14
testq %rax, %rax
jne 0xcec9
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x25ad(%rip), %rdi      # 0xf498
movq %r14, %rsi
xorl %eax, %eax
callq 0xd8b8
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/token.c
// Function: read_include_path
static char* read_include_path(void) {
  StringBuilder* sb = new_sb();

  if (*cur != '"' && *cur != '<') {
    print_line(src, cur);
    error("expected \" or <, but actual %c\n", *cur);
  }
  consume();

  while (*cur != '"' && *cur != '>') {
    sb_putc(sb, *cur);
    consume();
  }

  consume();
  return sb_run(sb);
}

// Assembly:
pushq %rbx
callq 0xd963
movq %rax, %rbx
movq 0x5bf7(%rip), %rsi      # 0x131b8
movzbl (%rsi), %eax
cmpl $0x3c, %eax
je 0xd5fd
cmpl $0x22, %eax
je 0xd5fd
movq 0x5bdb(%rip), %rdi      # 0x131b0
callq 0xcd82
movq 0x5bd7(%rip), %rax      # 0x131b8
movsbl (%rax), %esi
leaq 0x1f59(%rip), %rdi      # 0xf544
xorl %eax, %eax
callq 0xd8b8
movsbl %al, %esi
movq %rbx, %rdi
callq 0xd99d
callq 0xd7ac
movq 0x5baf(%rip), %rax      # 0x131b8
movzbl (%rax), %eax
cmpl $0x22, %eax
je 0xd616
cmpl $0x3e, %eax
jne 0xd5f2
callq 0xd7ac
movq %rbx, %rdi
popq %rbx
jmp 0xda17
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/token.c
// Function: read_char
static char read_char(void) {
  char c;
  if (*cur == '\\') {
    consume();
    switch (*cur) {
    case 'a':
      c = '\a';
      break;
    case 'b':
      c = '\b';
      break;
    case 'f':
      c = '\f';
      break;
    case 'n':
      c = '\n';
      break;
    case 'r':
      c = '\r';
      break;
    case 't':
      c = '\t';
      break;
    case 'v':
      c = '\v';
      break;
    case '\\':
      c = '\\';
      break;
    case '\'':
      c = '\'';
      break;
    case '\"':
      c = '\"';
      break;
    case '0':
      c = '\0';
      break;
    default:
      print_line(src, cur);
      error("invalid escape sequence: %c\n", *cur);
    }
  } else {
    c = *cur;
  }
  consume();
  return c;
}

// Assembly:
pushq %rbx
movq 0x5b45(%rip), %rax      # 0x131b8
movb (%rax), %bl
cmpb $0x5c, %bl
jne 0xd6f0
callq 0xd7ac
movq 0x5b32(%rip), %rsi      # 0x131b8
movb (%rsi), %bl
movzbl %bl, %eax
cmpl $0x61, %eax
jg 0xd6a8
cmpl $0x2f, %eax
jle 0xd6c4
cmpl $0x30, %eax
je 0xd6de
cmpl $0x5c, %eax
je 0xd6f0
movb $0x7, %bl
cmpl $0x61, %eax
je 0xd6f0
jmp 0xd6f9
leal -0x6e(%rax), %ecx
cmpl $0x8, %ecx
ja 0xd6d0
leaq 0x1dbd(%rip), %rax      # 0xf474
movslq (%rax,%rcx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movb $0xa, %bl
jmp 0xd6f0
cmpl $0x22, %eax
je 0xd6f0
cmpl $0x27, %eax
je 0xd6f0
jmp 0xd6f9
cmpl $0x66, %eax
je 0xd6ee
cmpl $0x62, %eax
jne 0xd6f9
movb $0x8, %bl
jmp 0xd6f0
xorl %ebx, %ebx
jmp 0xd6f0
movb $0xd, %bl
jmp 0xd6f0
movb $0x9, %bl
jmp 0xd6f0
movb $0xb, %bl
jmp 0xd6f0
movb $0xc, %bl
callq 0xd7ac
movl %ebx, %eax
popq %rbx
retq
movq 0x5ab0(%rip), %rdi      # 0x131b0
callq 0xcd82
movq 0x5aac(%rip), %rax      # 0x131b8
movsbl (%rax), %esi
leaq 0x1f31(%rip), %rdi      # 0xf647
xorl %eax, %eax
callq 0xd8b8
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/token.c
// Function: ident
static Token* ident(char* start) {
  Token* t = new_token(TIDENT, start);
  StringBuilder* sb = new_sb();
  while (isalnum(*cur) || *cur == '_') {
    sb_putc(sb, *cur);
    consume();
  }
  t->ident = sb_run(sb);
  return t;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movl $0x1, %edi
movl $0x38, %esi
callq 0x20f0
movq %rax, %rbx
movl $0x2, 0x8(%rax)
movq 0x5a6b(%rip), %rax      # 0x131b0
movq %rax, 0x20(%rbx)
movq %r14, 0x28(%rbx)
movb 0x5a6d(%rip), %al       # 0x131c0
xorb $0x1, %al
movb %al, 0x30(%rbx)
callq 0xd963
movq %rax, %r14
callq 0x2190
movq %rax, %r15
movq 0x5a49(%rip), %rax      # 0x131b8
movsbq (%rax), %rax
cmpq $0x5f, %rax
je 0xd785
movq (%r15), %rcx
movzwl (%rcx,%rax,2), %ecx
andl $0x8, %ecx
je 0xd797
movsbl %al, %esi
movq %r14, %rdi
callq 0xd99d
callq 0xd7ac
jmp 0xd768
movq %r14, %rdi
callq 0xda17
movq %rax, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: format
char* format(const char *fmt, ...) {
#endif
  char* buf = calloc(2048, sizeof(char));
  va_list ap;
  va_start(ap, fmt);
  vsnprintf(buf, 2048, fmt, ap);
  va_end(ap);
  return realloc(buf, sizeof(char) * (strlen(buf) + 1));
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0xd0, %rsp
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rsi, 0x8(%r15)
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0xd855
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)
movl $0x800, %edi            # imm = 0x800
movl $0x1, %esi
callq 0x20f0
movq %rax, %r14
movq %rsp, %rcx
movq %r15, 0x10(%rcx)
leaq 0xf0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
movl $0x800, %esi            # imm = 0x800
movq %r14, %rdi
movq %rbx, %rdx
callq 0x2060
movq %r14, %rdi
callq 0x2080
leaq 0x1(%rax), %rsi
movq %r14, %rdi
callq 0x2140
addq $0xd0, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: error
void error(const char *fmt, ...) {
#endif
  va_list ap;
  va_start(ap, fmt);
  vfprintf(stderr, fmt, ap);
  va_end(ap);
  exit(1);
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, %r10
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 0xd916
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, %rdx
movq %rdi, 0x10(%rdx)
leaq 0xe0(%rsp), %rax
movq %rax, 0x8(%rdx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rdx)
movq 0x56bb(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movq %r10, %rsi
callq 0x2170
movl $0x1, %edi
callq 0x2180
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: new_sb
StringBuilder* new_sb(void) {
  StringBuilder* sb = calloc(1, sizeof(StringBuilder));
  sb->buf = calloc(8, sizeof(char));
  sb->capacity = 8;
  sb->length = 0;
  return sb;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x20f0
movq %rax, %rbx
movl $0x8, %edi
movl $0x1, %esi
callq 0x20f0
movq %rax, (%rbx)
movq $0x8, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: sb_putc
void sb_putc(StringBuilder* sb, char c) {
  while (sb->length >= sb->capacity) {
    sb->capacity += 8;
    sb->buf = realloc(sb->buf, sizeof(char) * sb->capacity);
  }
  sb->buf[sb->length] = c;
  sb->length++;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rax
cmpq %rsi, %rax
jb 0xd9cf
addq $0x8, %rsi
movq %rsi, 0x8(%rbx)
movq (%rbx), %rdi
callq 0x2140
movq %rax, (%rbx)
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rax
jmp 0xd9ad
movq (%rbx), %rcx
movb %bpl, (%rcx,%rax)
incq 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: sb_run
char* sb_run(StringBuilder* sb) {
  sb_putc(sb, '\0');
  char* ret = sb->buf;
  sb_destory(sb);
  return ret;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %esi, %esi
callq 0xd99d
movq (%rbx), %r14
movq %rbx, %rdi
callq 0x2030
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: dump_token
void dump_token(Token* tok) {
  switch (tok->tag) {
  case TINT: {
    eprintf("%d", tok->integer);
    break;
  }
  case TSTRING: {
    eprintf("\"%s\"", tok->str);
    break;
  }
  case TIDENT: {
    eprintf("%s", tok->ident);
    break;
  }
  case TRESERVED: {
    eprintf("_%s_", tok->ident);
    break;
  }
  case TDIRECTIVE: {
    eprintf("#%s", tok->ident);
    break;
  }
  }
  if (tok->next != NULL) {
    eprintf(" ");
  }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpq $0x4, %rax
jbe 0xda72
cmpq $0x0, (%rbx)
jne 0xda95
popq %rbx
retq
leaq 0x1beb(%rip), %rcx      # 0xf664
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl 0xc(%rbx), %esi
leaq 0xf51(%rip), %rdi       # 0xe9dd
xorl %eax, %eax
callq 0x21b0
jmp 0xda6a
leaq 0x7b1(%rip), %rdi       # 0xe24d
xorl %eax, %eax
popq %rbx
jmp 0x21b0
movq 0x10(%rbx), %rsi
leaq 0x1c8f(%rip), %rdi      # 0xf73e
jmp 0xdad6
movq 0x10(%rbx), %rsi
leaq 0x15ae(%rip), %rdi      # 0xf06a
jmp 0xdad6
movq 0x10(%rbx), %rsi
leaq 0x1c70(%rip), %rdi      # 0xf739
jmp 0xdad6
movq 0x18(%rbx), %rsi
leaq 0x1c5e(%rip), %rdi      # 0xf734
xorl %eax, %eax
callq 0x21b0
jmp 0xda6a
// File: /workspace/github_c_makefile_star2_O1/takoeight0821[P]hoc_nyan/src/utils.c
// Function: show_type_
static void show_type_(StringBuilder* sb, Type* ty) {
  if (ty == NULL) {
    sb_puts(sb, "NULL");
    return;
  }

  switch (ty->ty) {
  case TY_VOID:
    sb_puts(sb, "void");
    break;
  case TY_CHAR:
    sb_puts(sb, "char");
    break;
  case TY_INT:
    sb_puts(sb, "int");
    break;
  case TY_LONG:
    sb_puts(sb, "long");
    break;
  case TY_PTR:
    if (ty->array_size) {
      sb_puts(sb, "array(");
      show_type_(sb, ty->ptr_to);
      sb_puts(sb, format(", %zu)", ty->array_size));
    } else {
      sb_puts(sb, "ptr(");
      show_type_(sb, ty->ptr_to);
      sb_puts(sb, ")");
    }
    break;
  case TY_STRUCT: {
    if (ty->tag) {
      sb_puts(sb, format("struct %s", ty->tag));
    } else {
      sb_puts(sb, "struct");
    }

    // 以下のコードは無限ループを引き起こす
    /* sb_puts(sb, format("struct %s {", ty->tag)); */
    /* for (Field* f = ty->fields; f != NULL; f = f->next) { */
    /*   sb_puts(sb, format("%s(+%zu) : ", f->name, f->offset)); */
    /*   show_type_(sb, f->type, ty->tag); */
    /*   sb_puts(sb, ","); */
    /* } */
    /* sb_puts(sb, "}"); */
    break;
  }
  }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
testq %rsi, %rsi
je 0xdb79
movq %rsi, %r14
movl (%rsi), %eax
cmpq $0x5, %rax
ja 0xdbf8
leaq 0x1b11(%rip), %rcx      # 0xf678
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1687(%rip), %rsi      # 0xf1fe
jmp 0xdb80
leaq 0x1cbc(%rip), %rsi      # 0xf83c
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0xd9e1
cmpq $0x0, 0x20(%r14)
je 0xdc00
leaq 0x1ca4(%rip), %rsi      # 0xf841
movq %rbx, %rdi
callq 0xd9e1
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xdb45
movq 0x20(%r14), %rsi
leaq 0x1c8c(%rip), %rdi      # 0xf848
jmp 0xdbe9
leaq 0x1643(%rip), %rsi      # 0xf208
jmp 0xdb80
leaq 0x163e(%rip), %rsi      # 0xf20c
jmp 0xdb80
leaq 0x162c(%rip), %rsi      # 0xf203
jmp 0xdb80
movq 0x28(%r14), %rsi
testq %rsi, %rsi
je 0xdc27
leaq 0x1c6b(%rip), %rdi      # 0xf854
xorl %eax, %eax
callq 0xd7f2
movq %rbx, %rdi
movq %rax, %rsi
jmp 0xdb83
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x1c48(%rip), %rsi      # 0xf84f
movq %rbx, %rdi
callq 0xd9e1
movq 0x18(%r14), %rsi
movq %rbx, %rdi
callq 0xdb45
leaq 0x16d0(%rip), %rsi      # 0xf2f2
jmp 0xdb80
leaq 0x160d(%rip), %rsi      # 0xf23b
jmp 0xdb80
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/smoke.c
// Function: test_syntax
void test_syntax() {
    test_case errors[] = {
        {"", 1},
        {"1+", 2},
        {"1)", 2},
        {"(1", 2},
        {"1**1", 3},
        {"1*2(+4", 4},
        {"1*2(1+4", 4},
        {"a+5", 1},
        {"!+5", 1},
        {"_a+5", 1},
        {"#a+5", 1},
        {"1^^5", 3},
        {"1**5", 3},
        {"sin(cos5", 8},
    };


    int i;
    for (i = 0; i < sizeof(errors) / sizeof(test_case); ++i) {
        const char *expr = errors[i].expr;
        const int e = errors[i].answer;

        int err;
        const double r = te_interp(expr, &err);
        lequal(err, e);
        lok(r != r);

        te_expr *n = te_compile(expr, 0, 0, &err);
        lequal(err, e);
        lok(!n);

        if (err != e) {
            printf("FAILED: %s\n", expr);
        }

        const double k = te_interp(expr, 0);
        lok(k != k);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x8, %ebx
leaq 0xc(%rsp), %r13
leaq 0x4fc0(%rip), %r15      # 0x83bb
leaq 0x810e(%rip), %rax      # 0xb510
movq -0x8(%rbx,%rax), %rbp
cvttsd2si (%rbx,%rax), %r12d
movq %rbp, %rdi
movq %r13, %rsi
callq 0x6cff
incl 0x8ce6(%rip)            # 0xc104
movl 0xc(%rsp), %ecx
cmpl %r12d, %ecx
je 0x3452
incl 0x8cdb(%rip)            # 0xc108
leaq 0x4fed(%rip), %rdi      # 0x8421
movq %r15, %rsi
movl $0xc1, %edx
movl %r12d, %r8d
xorl %eax, %eax
movsd %xmm0, 0x10(%rsp)
callq 0x3090
movsd 0x10(%rsp), %xmm0
incl 0x8cac(%rip)            # 0xc104
ucomisd %xmm0, %xmm0
jp 0x347a
incl 0x8ca4(%rip)            # 0xc108
leaq 0x4f42(%rip), %rdi      # 0x83ad
movq %r15, %rsi
movl $0xc2, %edx
xorl %eax, %eax
callq 0x3090
movq %rbp, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %r13, %r14
movq %r13, %rcx
callq 0x6af2
incl 0x8c72(%rip)            # 0xc104
movq %rax, %r13
movl 0xc(%rsp), %ecx
cmpl %r12d, %ecx
je 0x34bd
incl 0x8c64(%rip)            # 0xc108
leaq 0x4f76(%rip), %rdi      # 0x8421
movq %r15, %rsi
movl $0xc5, %edx
movl %r12d, %r8d
xorl %eax, %eax
callq 0x3090
incl 0x8c41(%rip)            # 0xc104
testq %r13, %r13
je 0x34e4
incl 0x8c3a(%rip)            # 0xc108
leaq 0x4ed8(%rip), %rdi      # 0x83ad
movq %r15, %rsi
movl $0xc6, %edx
xorl %eax, %eax
callq 0x3090
cmpl %r12d, 0xc(%rsp)
movq %r14, %r13
je 0x34ff
leaq 0x4f3e(%rip), %rdi      # 0x8433
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3090
movq %rbp, %rdi
xorl %esi, %esi
callq 0x6cff
incl 0x8bf5(%rip)            # 0xc104
ucomisd %xmm0, %xmm0
jp 0x3531
incl 0x8bed(%rip)            # 0xc108
leaq 0x4e8b(%rip), %rdi      # 0x83ad
movq %r15, %rsi
movl $0xcd, %edx
xorl %eax, %eax
callq 0x3090
addq $0x10, %rbx
cmpq $0xe8, %rbx
jne 0x33fb
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/smoke.c
// Function: test_nans
void test_nans() {

    const char *nans[] = {
        "0/0",
        "1%0",
        "1%(1%0)",
        "(1%0)%1",
        "fac(-1)",
        "ncr(2, 4)",
        "ncr(-2, 4)",
        "ncr(2, -4)",
        "npr(2, 4)",
        "npr(-2, 4)",
        "npr(2, -4)",
    };

    int i;
    for (i = 0; i < sizeof(nans) / sizeof(const char *); ++i) {
        const char *expr = nans[i];

        int err;
        const double r = te_interp(expr, &err);
        lequal(err, 0);
        lok(r != r);

        te_expr *n = te_compile(expr, 0, 0, &err);
        lok(n);
        lequal(err, 0);
        const double c = te_eval(n);
        lok(c != c);
        te_free(n);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xc(%rsp), %rbx
leaq 0x4e42(%rip), %r14      # 0x83ad
leaq 0x4e49(%rip), %r15      # 0x83bb
leaq 0x4ea8(%rip), %r12      # 0x8421
xorl %ebp, %ebp
leaq 0x806e(%rip), %rax      # 0xb5f0
movq (%rbp,%rax), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6cff
incl 0x8b6c(%rip)            # 0xc104
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
je 0x35c7
incl 0x8b62(%rip)            # 0xc108
movq %r12, %rdi
movq %r15, %rsi
movl $0xe8, %edx
xorl %r8d, %r8d
xorl %eax, %eax
movsd %xmm0, 0x10(%rsp)
callq 0x3090
movsd 0x10(%rsp), %xmm0
incl 0x8b37(%rip)            # 0xc104
ucomisd %xmm0, %xmm0
jp 0x35eb
incl 0x8b2f(%rip)            # 0xc108
movq %r14, %rdi
movq %r15, %rsi
movl $0xe9, %edx
xorl %eax, %eax
callq 0x3090
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x6af2
movq %rax, %r13
incl 0x8b01(%rip)            # 0xc104
testq %rax, %rax
jne 0x3620
incl 0x8afa(%rip)            # 0xc108
movq %r14, %rdi
movq %r15, %rsi
movl $0xec, %edx
xorl %eax, %eax
callq 0x3090
incl 0x8ade(%rip)            # 0xc104
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
je 0x3649
incl 0x8ad4(%rip)            # 0xc108
movq %r12, %rdi
movq %r15, %rsi
movl $0xed, %edx
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3090
movq %r13, %rdi
callq 0x64f9
incl 0x8aad(%rip)            # 0xc104
ucomisd %xmm0, %xmm0
jp 0x3675
incl 0x8aa5(%rip)            # 0xc108
movq %r14, %rdi
movq %r15, %rsi
movl $0xef, %edx
xorl %eax, %eax
callq 0x3090
movq %r13, %rdi
callq 0x61c7
addq $0x8, %rbp
cmpq $0x58, %rbp
jne 0x357b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/smoke.c
// Function: test_infs
void test_infs() {

    const char *infs[] = {
            "1/0",
            "log(0)",
            "pow(2,10000000)",
            "fac(300)",
            "ncr(300,100)",
            "ncr(300000,100)",
            "ncr(300000,100)*8",
            "npr(3,2)*ncr(300000,100)",
            "npr(100,90)",
            "npr(30,25)",
    };

    int i;
    for (i = 0; i < sizeof(infs) / sizeof(const char *); ++i) {
        const char *expr = infs[i];

        int err;
        const double r = te_interp(expr, &err);
        lequal(err, 0);
        lok(r == r + 1);

        te_expr *n = te_compile(expr, 0, 0, &err);
        lok(n);
        lequal(err, 0);
        const double c = te_eval(n);
        lok(c == c + 1);
        te_free(n);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0xc(%rsp), %rbx
leaq 0x4cf9(%rip), %r14      # 0x83ad
leaq 0x4d00(%rip), %r15      # 0x83bb
leaq 0x4d5f(%rip), %r12      # 0x8421
xorl %ebp, %ebp
leaq 0x7f85(%rip), %rax      # 0xb650
movq (%rbp,%rax), %r13
movq %r13, %rdi
movq %rbx, %rsi
callq 0x6cff
incl 0x8a23(%rip)            # 0xc104
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
je 0x3710
incl 0x8a19(%rip)            # 0xc108
movq %r12, %rdi
movq %r15, %rsi
movl $0x10a, %edx            # imm = 0x10A
xorl %r8d, %r8d
xorl %eax, %eax
movsd %xmm0, 0x10(%rsp)
callq 0x3090
movsd 0x10(%rsp), %xmm0
incl 0x89ee(%rip)            # 0xc104
movapd %xmm0, %xmm1
addsd 0x4926(%rip), %xmm1     # 0x8048
ucomisd %xmm1, %xmm0
jne 0x372a
jnp 0x3742
incl 0x89d8(%rip)            # 0xc108
movq %r14, %rdi
movq %r15, %rsi
movl $0x10b, %edx            # imm = 0x10B
xorl %eax, %eax
callq 0x3090
movq %r13, %rdi
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x6af2
movq %rax, %r13
incl 0x89aa(%rip)            # 0xc104
testq %rax, %rax
jne 0x3777
incl 0x89a3(%rip)            # 0xc108
movq %r14, %rdi
movq %r15, %rsi
movl $0x10e, %edx            # imm = 0x10E
xorl %eax, %eax
callq 0x3090
incl 0x8987(%rip)            # 0xc104
movl 0xc(%rsp), %ecx
testl %ecx, %ecx
je 0x37a0
incl 0x897d(%rip)            # 0xc108
movq %r12, %rdi
movq %r15, %rsi
movl $0x10f, %edx            # imm = 0x10F
xorl %r8d, %r8d
xorl %eax, %eax
callq 0x3090
movq %r13, %rdi
callq 0x64f9
incl 0x8956(%rip)            # 0xc104
movapd %xmm0, %xmm1
addsd 0x488e(%rip), %xmm1     # 0x8048
ucomisd %xmm1, %xmm0
jne 0x37c2
jnp 0x37da
incl 0x8940(%rip)            # 0xc108
movq %r14, %rdi
movq %r15, %rsi
movl $0x111, %edx            # imm = 0x111
xorl %eax, %eax
callq 0x3090
movq %r13, %rdi
callq 0x61c7
addq $0x8, %rbp
cmpq $0x50, %rbp
jne 0x36c4
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/smoke.c
// Function: test_optimize
void test_optimize() {

    test_case cases[] = {
        {"5+5", 10},
        {"pow(2,2)", 4},
        {"sqrt 100", 10},
        {"pi * 2", 6.2832},
    };

    int i;
    for (i = 0; i < sizeof(cases) / sizeof(test_case); ++i) {
        const char *expr = cases[i].expr;
        const double answer = cases[i].answer;

        int err;
        te_expr *ex = te_compile(expr, 0, 0, &err);
        lok(ex);

        /* The answer should be know without
         * even running eval. */
        lfequal(ex->value, answer);
        lfequal(te_eval(ex), answer);

        te_free(ex);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x6103(%rip), %rbp      # 0xb870
leaq 0x14(%rsp), %rbx
leaq 0x2c42(%rip), %r15      # 0x83bb
leaq 0x2c43(%rip), %r12      # 0x83c3
xorl %r14d, %r14d
movq (%r14,%rbp), %rdi
movsd 0x8(%r14,%rbp), %xmm0
movsd %xmm0, 0x8(%rsp)
xorl %esi, %esi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x6af2
movq %rax, %r13
incl 0x695b(%rip)            # 0xc104
testq %rax, %rax
jne 0x57ca
incl 0x6954(%rip)            # 0xc108
leaq 0x2bf2(%rip), %rdi      # 0x83ad
movq %r15, %rsi
movl $0x234, %edx            # imm = 0x234
xorl %eax, %eax
callq 0x3090
incl 0x6934(%rip)            # 0xc104
movsd 0x8(%r13), %xmm0
movapd %xmm0, %xmm1
subsd 0x8(%rsp), %xmm1
movapd %xmm1, %xmm2
andpd 0x2824(%rip), %xmm2     # 0x8010
ucomisd 0x284c(%rip), %xmm2     # 0x8040
ja 0x57fc
ucomisd %xmm1, %xmm1
jnp 0x581a
incl 0x6906(%rip)            # 0xc108
movq %r12, %rdi
movq %r15, %rsi
movl $0x238, %edx            # imm = 0x238
movsd 0x8(%rsp), %xmm1
movb $0x2, %al
callq 0x3090
incl 0x68e4(%rip)            # 0xc104
movq %r13, %rdi
callq 0x64f9
movsd 0x8(%rsp), %xmm2
subsd %xmm2, %xmm0
movapd %xmm0, %xmm1
andpd 0x27d2(%rip), %xmm1     # 0x8010
ucomisd 0x27fa(%rip), %xmm1     # 0x8040
ja 0x584e
ucomisd %xmm0, %xmm0
jnp 0x5874
incl 0x68b4(%rip)            # 0xc108
movq %r13, %rdi
callq 0x64f9
movq %r12, %rdi
movq %r15, %rsi
movl $0x239, %edx            # imm = 0x239
movsd 0x8(%rsp), %xmm1
movb $0x2, %al
callq 0x3090
movq %r13, %rdi
callq 0x61c7
addq $0x10, %r14
cmpq $0x40, %r14
jne 0x5783
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/smoke.c
// Function: test_combinatorics
void test_combinatorics() {
    test_case cases[] = {
            {"fac(0)", 1},
            {"fac(0.2)", 1},
            {"fac(1)", 1},
            {"fac(2)", 2},
            {"fac(3)", 6},
            {"fac(4.8)", 24},
            {"fac(10)", 3628800},

            {"ncr(0,0)", 1},
            {"ncr(10,1)", 10},
            {"ncr(10,0)", 1},
            {"ncr(10,10)", 1},
            {"ncr(16,7)", 11440},
            {"ncr(16,9)", 11440},
            {"ncr(100,95)", 75287520},

            {"npr(0,0)", 1},
            {"npr(10,1)", 10},
            {"npr(10,0)", 1},
            {"npr(10,10)", 3628800},
            {"npr(20,5)", 1860480},
            {"npr(100,4)", 94109400},
    };


    int i;
    for (i = 0; i < sizeof(cases) / sizeof(test_case); ++i) {
        const char *expr = cases[i].expr;
        const double answer = cases[i].answer;

        int err;
        const double ev = te_interp(expr, &err);
        lok(!err);
        lfequal(ev, answer);

        if (err) {
            printf("FAILED: %s (%d)\n", expr, err);
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl $0x8, %r14d
leaq 0x5ee9(%rip), %r12      # 0xb970
leaq 0x4(%rsp), %rbx
leaq 0x2928(%rip), %r15      # 0x83bb
leaq 0x2913(%rip), %r13      # 0x83ad
movq -0x8(%r14,%r12), %rbp
movsd (%r14,%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x6cff
incl 0x6648(%rip)            # 0xc104
cmpl $0x0, 0x4(%rsp)
je 0x5ae7
incl 0x663f(%rip)            # 0xc108
movq %r13, %rdi
movq %r15, %rsi
movl $0x2ab, %edx            # imm = 0x2AB
xorl %eax, %eax
movsd %xmm0, 0x8(%rsp)
callq 0x3090
movsd 0x8(%rsp), %xmm0
incl 0x6617(%rip)            # 0xc104
movapd %xmm0, %xmm3
movsd 0x10(%rsp), %xmm1
subsd %xmm1, %xmm3
movapd %xmm3, %xmm2
andpd 0x2509(%rip), %xmm2     # 0x8010
ucomisd 0x2531(%rip), %xmm2     # 0x8040
ja 0x5b17
ucomisd %xmm3, %xmm3
jnp 0x5b33
incl 0x65eb(%rip)            # 0xc108
leaq 0x289f(%rip), %rdi      # 0x83c3
movq %r15, %rsi
movl $0x2ac, %edx            # imm = 0x2AC
movb $0x2, %al
callq 0x3090
movl 0x4(%rsp), %edx
testl %edx, %edx
je 0x5b4c
leaq 0x2893(%rip), %rdi      # 0x83d5
movq %rbp, %rsi
xorl %eax, %eax
callq 0x3090
addq $0x10, %r14
cmpq $0x148, %r14            # imm = 0x148
jne 0x5a9a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: te_free_parameters
void te_free_parameters(te_expr *n) {
    if (!n) return;
    switch (TYPE_MASK(n->type)) {
        case TE_FUNCTION7: case TE_CLOSURE7: te_free(n->parameters[6]);     /* Falls through. */
        case TE_FUNCTION6: case TE_CLOSURE6: te_free(n->parameters[5]);     /* Falls through. */
        case TE_FUNCTION5: case TE_CLOSURE5: te_free(n->parameters[4]);     /* Falls through. */
        case TE_FUNCTION4: case TE_CLOSURE4: te_free(n->parameters[3]);     /* Falls through. */
        case TE_FUNCTION3: case TE_CLOSURE3: te_free(n->parameters[2]);     /* Falls through. */
        case TE_FUNCTION2: case TE_CLOSURE2: te_free(n->parameters[1]);     /* Falls through. */
        case TE_FUNCTION1: case TE_CLOSURE1: te_free(n->parameters[0]);
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x61bf
movq %rdi, %rbx
movl (%rdi), %eax
andl $0x1f, %eax
addl $-0x9, %eax
cmpl $0xe, %eax
ja 0x61bf
leaq 0x2824(%rip), %rcx      # 0x8924
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x40(%rbx), %r14
testq %r14, %r14
je 0x6122
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x613b
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq 0x30(%rbx), %r14
testq %r14, %r14
je 0x6154
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x616d
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq 0x20(%rbx), %r14
testq %r14, %r14
je 0x6186
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq 0x18(%rbx), %r14
testq %r14, %r14
je 0x619f
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
movq 0x10(%rbx), %rbx
testq %rbx, %rbx
je 0x61bf
movq %rbx, %rdi
callq 0x60d8
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3030
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: te_compile
te_expr *te_compile(const char *expression, const te_variable *variables, int var_count, int *error) {
    state s;
    s.start = s.next = expression;
    s.lookup = variables;
    s.lookup_len = var_count;

    next_token(&s);
    te_expr *root = list(&s);
    if (root == NULL) {
        if (error) *error = -1;
        return NULL;
    }

    if (s.type != TOK_END) {
        te_free(root);
        if (error) {
            *error = (s.next - s.start);
            if (*error == 0) *error = 1;
        }
        return 0;
    } else {
        optimize(root);
        if (error) *error = 0;
        return root;
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x38, %rsp
movq %rcx, %rbx
movq %rsp, %r14
movq %rdi, 0x8(%r14)
movq %rdi, (%r14)
movq %rsi, 0x28(%r14)
movl %edx, 0x30(%r14)
movq %r14, %rdi
callq 0x61df
movq %r14, %rdi
callq 0x6b7f
testq %rax, %rax
je 0x6b39
movq %rax, %r14
cmpl $0x1a, 0x10(%rsp)
jne 0x6b48
movq %r14, %rdi
callq 0x6c64
xorl %eax, %eax
jmp 0x6b41
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %r14d, %r14d
testq %rbx, %rbx
jne 0x6b6d
jmp 0x6b6f
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
testq %rbx, %rbx
je 0x6b7a
movl 0x8(%rsp), %eax
subl (%rsp), %eax
cmpl $0x1, %eax
adcl $0x0, %eax
xorl %r14d, %r14d
movl %eax, (%rbx)
movq %r14, %rax
addq $0x38, %rsp
popq %rbx
popq %r14
retq
xorl %r14d, %r14d
jmp 0x6b6f
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: list
static te_expr *list(state *s) {
    /* <list>      =    <expr> {"," <expr>} */
    te_expr *ret = expr(s);
    CHECK_NULL(ret);

    while (s->type == TOK_SEP) {
        next_token(s);
        te_expr *e = expr(s);
        CHECK_NULL(e, te_free(ret));

        te_expr *prev = ret;
        ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, e);
        CHECK_NULL(ret, te_free(e), te_free(prev));

        ret->function = comma;
    }

    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
callq 0x7051
testq %rax, %rax
je 0x6c54
movq %rax, %r14
leaq 0x64a(%rip), %r13       # 0x71ed
cmpl $0x1b, 0x10(%rbx)
jne 0x6c57
movq %rbx, %rdi
callq 0x61df
movq %rbx, %rdi
callq 0x7051
testq %rax, %rax
je 0x6bf9
movq %rax, %r12
movl $0x20, %edi
callq 0x3120
testq %rax, %rax
je 0x6c12
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x2a, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x6c15
testq %r14, %r14
je 0x6c0e
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %eax, %eax
jmp 0x6c4c
xorl %r15d, %r15d
testq %r15, %r15
je 0x6c22
movq %r13, 0x8(%r15)
movb $0x1, %al
jmp 0x6c49
movq %r12, %rdi
callq 0x60d8
movq %r12, %rdi
callq 0x3030
testq %r14, %r14
je 0x6c47
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %eax, %eax
movq %r15, %r14
testb %al, %al
jne 0x6ba3
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: optimize
static void optimize(te_expr *n) {
    /* Evaluates as much as possible. */
    if (n->type == TE_CONSTANT) return;
    if (n->type == TE_VARIABLE) return;

    /* Only optimize out functions flagged as pure. */
    if (IS_PURE(n->type)) {
        const int arity = ARITY(n->type);
        int known = 1;
        int i;
        for (i = 0; i < arity; ++i) {
            optimize(n->parameters[i]);
            if (((te_expr*)(n->parameters[i]))->type != TE_CONSTANT) {
                known = 0;
            }
        }
        if (known) {
            const double value = te_eval(n);
            te_free_parameters(n);
            n->type = TE_CONSTANT;
            n->value = value;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %r14d
testb $0x20, %r14b
je 0x6cf0
movq %rdi, %rbx
testb $0x18, %r14b
sete %al
movq %r14, %r15
andq $0x7, %r15
sete %cl
orb %al, %cl
jne 0x6ccb
movl $0x1, %ebp
movl $0x1, %r12d
xorl %r13d, %r13d
movq 0x8(%rbx,%r12,8), %rdi
callq 0x6c64
movq 0x8(%rbx,%r12,8), %rax
cmpl $0x1, (%rax)
cmovnel %r13d, %ebp
testb $0x18, %r14b
je 0x6cc7
leaq 0x1(%r12), %rax
cmpq %r15, %r12
movq %rax, %r12
jb 0x6c9e
testl %ebp, %ebp
je 0x6cf0
movq %rbx, %rdi
callq 0x64f9
movsd %xmm0, (%rsp)
movq %rbx, %rdi
callq 0x60d8
movl $0x1, (%rbx)
movsd (%rsp), %xmm0
movsd %xmm0, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: te_interp
double te_interp(const char *expression, int *error) {
    te_expr *n = te_compile(expression, 0, 0, error);

    double ret;
    if (n) {
        ret = te_eval(n);
        te_free(n);
    } else {
        ret = NAN;
    }
    return ret;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rcx
xorl %esi, %esi
xorl %edx, %edx
callq 0x6af2
testq %rax, %rax
je 0x6d3e
movq %rax, %rbx
movq %rax, %rdi
callq 0x64f9
movsd %xmm0, 0x8(%rsp)
movq %rbx, %rdi
callq 0x60d8
movq %rbx, %rdi
callq 0x3030
movsd 0x8(%rsp), %xmm0
jmp 0x6d46
movsd 0x1d5a(%rip), %xmm0     # 0x8aa0
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: pn
static void pn (const te_expr *n, int depth) {
    int i, arity;
    printf("%*s", depth, "");

    switch(TYPE_MASK(n->type)) {
    case TE_CONSTANT: printf("%f\n", n->value); break;
    case TE_VARIABLE: printf("bound %p\n", n->bound); break;

    case TE_FUNCTION0: case TE_FUNCTION1: case TE_FUNCTION2: case TE_FUNCTION3:
    case TE_FUNCTION4: case TE_FUNCTION5: case TE_FUNCTION6: case TE_FUNCTION7:
    case TE_CLOSURE0: case TE_CLOSURE1: case TE_CLOSURE2: case TE_CLOSURE3:
    case TE_CLOSURE4: case TE_CLOSURE5: case TE_CLOSURE6: case TE_CLOSURE7:
         arity = ARITY(n->type);
         printf("f%d", arity);
         for(i = 0; i < arity; i++) {
             printf(" %p", n->parameters[i]);
         }
         printf("\n");
         for(i = 0; i < arity; i++) {
             pn(n->parameters[i], depth + 1);
         }
         break;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x1df2(%rip), %rdi      # 0x8b59
leaq 0x164c(%rip), %rdx      # 0x83ba
xorl %eax, %eax
callq 0x3090
movl (%rbx), %r14d
movl %r14d, %eax
andl $0x1f, %eax
leal -0x8(%rax), %ecx
cmpl $0x10, %ecx
jae 0x6e0b
movl %r14d, %eax
andl $0x18, %eax
andl $0x7, %r14d
testl %eax, %eax
cmovel %eax, %r14d
leaq 0x1dca(%rip), %rdi      # 0x8b6b
movl %r14d, %esi
xorl %eax, %eax
callq 0x3090
movl %r14d, %r12d
testl %r14d, %r14d
je 0x6dd4
leaq 0x1db5(%rip), %r15      # 0x8b6f
xorl %r13d, %r13d
movq 0x10(%rbx,%r13,8), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x3090
incq %r13
cmpq %r13, %r12
jne 0x6dbd
movl $0xa, %edi
callq 0x3040
testl %r14d, %r14d
je 0x6dfc
incl %ebp
xorl %r14d, %r14d
movq 0x10(%rbx,%r14,8), %rdi
movl %ebp, %esi
callq 0x6d50
incq %r14
cmpq %r14, %r12
jne 0x6de8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
je 0x6e35
cmpl $0x1, %eax
jne 0x6dfc
movsd 0x8(%rbx), %xmm0
leaq 0x1d3d(%rip), %rdi      # 0x8b5d
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3090
movq 0x8(%rbx), %rsi
leaq 0x1d21(%rip), %rdi      # 0x8b61
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3090
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: fac
static double fac(double a) {/* simplest version of fac */
    if (a < 0.0)
        return NAN;
    if (a > UINT_MAX)
        return INFINITY;
    unsigned int ua = (unsigned int)(a);
    unsigned long int result = 1, i;
    for (i = 1; i <= ua; i++) {
        if (i > ULONG_MAX / result)
            return INFINITY;
        result *= i;
    }
    return (double)result;
}

// Assembly:
movapd %xmm0, %xmm1
xorpd %xmm0, %xmm0
ucomisd %xmm1, %xmm0
jbe 0x6e75
movsd 0x1c2c(%rip), %xmm0     # 0x8aa0
retq
movsd 0x1c33(%rip), %xmm0     # 0x8ab0
ucomisd 0x1c33(%rip), %xmm1     # 0x8ab8
ja 0x6edc
cvttsd2si %xmm1, %rax
testl %eax, %eax
je 0x6edd
movl %eax, %esi
negq %rsi
movl $0x1, %edi
movl $0x1, %ecx
movq %rcx, %rax
mulq %rdi
jo 0x6edc
imulq %rdi, %rcx
leaq (%rsi,%rdi), %rax
incq %rax
incq %rdi
cmpq $0x1, %rax
jne 0x6e9f
movq %rcx, %xmm1
punpckldq 0x1c08(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1c10(%rip), %xmm1     # 0x8ae0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
retq
movsd 0x1163(%rip), %xmm0     # 0x8048
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: ncr
static double ncr(double n, double r) {
    if (n < 0.0 || r < 0.0 || n < r) return NAN;
    if (n > UINT_MAX || r > UINT_MAX) return INFINITY;
    unsigned long int un = (unsigned int)(n), ur = (unsigned int)(r), i;
    unsigned long int result = 1;
    if (ur > un / 2) ur = un - ur;
    for (i = 1; i <= ur; i++) {
        if (result > ULONG_MAX / (un - ur + i))
            return INFINITY;
        result *= un - ur + i;
        result /= i;
    }
    return result;
}

// Assembly:
movapd %xmm0, %xmm2
ucomisd %xmm0, %xmm1
movsd 0x1baa(%rip), %xmm0     # 0x8aa0
ja 0x6fa3
xorpd %xmm3, %xmm3
ucomisd %xmm2, %xmm3
ja 0x6fa3
ucomisd %xmm1, %xmm3
ja 0x6fa3
ucomisd 0x1b9c(%rip), %xmm2     # 0x8ab8
movsd 0x1b8c(%rip), %xmm0     # 0x8ab0
ja 0x6fa3
ucomisd 0x1b8a(%rip), %xmm1     # 0x8ab8
ja 0x6fa3
cvttsd2si %xmm2, %rax
movl %eax, %edi
cvttsd2si %xmm1, %rcx
movl %ecx, %edx
shrl %eax
movq %rdi, %r8
subq %rdx, %r8
cmpl %ecx, %eax
cmovaeq %rdx, %r8
testq %r8, %r8
je 0x6fa4
subq %r8, %rdi
movl $0x1, %ecx
movl $0x1, %r9d
leaq (%rdi,%r9), %rsi
movq %rsi, %rax
mulq %rcx
jo 0x6fa3
imulq %rsi, %rcx
movq %rcx, %rax
xorl %edx, %edx
divq %r9
incq %r9
movq %rax, %rcx
cmpq %r8, %r9
jbe 0x6f5f
movq %rcx, %xmm1
punpckldq 0x1b41(%rip), %xmm1 # xmm1 = xmm1[0],mem[0],xmm1[1],mem[1]
subpd 0x1b49(%rip), %xmm1     # 0x8ae0
movapd %xmm1, %xmm0
unpckhpd %xmm1, %xmm0            # xmm0 = xmm0[1],xmm1[1]
addsd %xmm1, %xmm0
retq
movsd 0x109c(%rip), %xmm0     # 0x8048
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: expr
static te_expr *expr(state *s) {
    /* <expr>      =    <term> {("+" | "-") <term>} */
    te_expr *ret = term(s);
    CHECK_NULL(ret);

    while (s->type == TOK_INFIX && (s->function == add || s->function == sub)) {
        te_fun2 t = s->function;
        next_token(s);
        te_expr *te = term(s);
        CHECK_NULL(te, te_free(ret));

        te_expr *prev = ret;
        ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, te);
        CHECK_NULL(ret, te_free(te), te_free(prev));

        ret->function = t;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x71f1
testq %rax, %rax
je 0x7147
movq %rax, %r14
leaq -0xb8d(%rip), %rbp      # 0x64ea
cmpl $0x20, 0x10(%rbx)
jne 0x714a
movq 0x18(%rbx), %r13
leaq -0xba7(%rip), %rax      # 0x64e5
cmpq %rax, %r13
setne %al
cmpq %rbp, %r13
setne %cl
testb %cl, %al
jne 0x714a
movq %rbx, %rdi
callq 0x61df
movq %rbx, %rdi
callq 0x71f1
testq %rax, %rax
je 0x70ec
movq %rax, %r12
movl $0x20, %edi
callq 0x3120
testq %rax, %rax
je 0x7105
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x2a, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x7108
testq %r14, %r14
je 0x7101
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %eax, %eax
jmp 0x713f
xorl %r15d, %r15d
testq %r15, %r15
je 0x7115
movq %r13, 0x8(%r15)
movb $0x1, %al
jmp 0x713c
movq %r12, %rdi
callq 0x60d8
movq %r12, %rdi
callq 0x3030
testq %r14, %r14
je 0x713a
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %eax, %eax
movq %r15, %r14
testb %al, %al
jne 0x7077
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: new_expr
static te_expr *new_expr(const int type, const te_expr *parameters[]) {
    const int arity = ARITY(type);
    const int psize = sizeof(void*) * arity;
    const int size = (sizeof(te_expr) - sizeof(void*)) + psize + (IS_CLOSURE(type) ? sizeof(void*) : 0);
    te_expr *ret = malloc(size);
    CHECK_NULL(ret);

    memset(ret, 0, size);
    if (arity && parameters) {
        memcpy(ret->parameters, parameters, psize);
    }
    ret->type = type;
    ret->bound = 0;
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %r14
movl %edi, %ebx
movl %edi, %eax
andl $0x18, %eax
movl %edi, %r15d
andl $0x7, %r15d
testl %eax, %eax
cmovel %eax, %r15d
movl %edi, %eax
shrl %eax
andl $0x8, %eax
leal (%rax,%r15,8), %r13d
addl $0x10, %r13d
movq %r13, %rdi
callq 0x3120
testq %rax, %rax
je 0x71dd
movq %rax, %r12
movq %rax, %rdi
xorl %esi, %esi
movq %r13, %rdx
callq 0x30a0
testl %r15d, %r15d
sete %al
testq %r14, %r14
sete %cl
orb %al, %cl
jne 0x71ce
shll $0x3, %r15d
movq %r12, %rdi
addq $0x10, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x30f0
movl %ebx, (%r12)
movq $0x0, 0x8(%r12)
jmp 0x71e0
xorl %r12d, %r12d
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: term
static te_expr *term(state *s) {
    /* <term>      =    <factor> {("*" | "/" | "%") <factor>} */
    te_expr *ret = factor(s);
    CHECK_NULL(ret);

    while (s->type == TOK_INFIX && (s->function == mul || s->function == divide || s->function == fmod)) {
        te_fun2 t = s->function;
        next_token(s);
        te_expr *f = factor(s);
        CHECK_NULL(f, te_free(ret));

        te_expr *prev = ret;
        ret = NEW_EXPR(TE_FUNCTION2 | TE_FLAG_PURE, ret, f);
        CHECK_NULL(ret, te_free(f), te_free(prev));

        ret->function = t;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x7302
testq %rax, %rax
je 0x72ed
movq %rax, %r14
movq 0x4dc9(%rip), %r13      # 0xbfe0
cmpl $0x20, 0x10(%rbx)
jne 0x72f0
movq 0x18(%rbx), %rbp
cmpq %r13, %rbp
je 0x7246
leaq -0xd42(%rip), %rax      # 0x64ef
cmpq %rax, %rbp
je 0x7246
leaq -0xd49(%rip), %rax      # 0x64f4
cmpq %rax, %rbp
jne 0x72f0
movq %rbx, %rdi
callq 0x61df
movq %rbx, %rdi
callq 0x7302
testq %rax, %rax
je 0x7292
movq %rax, %r12
movl $0x20, %edi
callq 0x3120
testq %rax, %rax
je 0x72ab
movq %rax, %r15
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rax)
movups %xmm0, (%rax)
movq %r14, 0x10(%rax)
movq %r12, 0x18(%rax)
movl $0x2a, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x72ae
testq %r14, %r14
je 0x72a7
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %eax, %eax
jmp 0x72e5
xorl %r15d, %r15d
testq %r15, %r15
je 0x72bb
movq %rbp, 0x8(%r15)
movb $0x1, %al
jmp 0x72e2
movq %r12, %rdi
callq 0x60d8
movq %r12, %rdi
callq 0x3030
testq %r14, %r14
je 0x72e0
movq %r14, %rdi
callq 0x60d8
movq %r14, %rdi
callq 0x3030
xorl %eax, %eax
movq %r15, %r14
testb %al, %al
jne 0x7217
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/codeplea[P]tinyexpr/tinyexpr.c
// Function: power
static te_expr *power(state *s) {
    /* <power>     =    {("-" | "+")} <base> */
    int sign = 1;
    while (s->type == TOK_INFIX && (s->function == add || s->function == sub)) {
        if (s->function == sub) sign = -sign;
        next_token(s);
    }

    te_expr *ret;

    if (sign == 1) {
        ret = base(s);
    } else {
        te_expr *b = base(s);
        CHECK_NULL(b);

        ret = NEW_EXPR(TE_FUNCTION1 | TE_FLAG_PURE, b);
        CHECK_NULL(ret, te_free(b));

        ret->function = negate;
    }

    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x20, 0x10(%rdi)
jne 0x7582
movl $0x1, %ebp
leaq -0x1065(%rip), %r14     # 0x64e5
leaq -0x1067(%rip), %r15     # 0x64ea
movq 0x18(%rbx), %rax
cmpq %r14, %rax
setne %cl
cmpq %r15, %rax
setne %dl
testb %dl, %cl
jne 0x757d
movl %ebp, %ecx
negl %ecx
cmpq %r15, %rax
cmovel %ecx, %ebp
movq %rbx, %rdi
callq 0x61df
cmpl $0x20, 0x10(%rbx)
je 0x7551
cmpl $0x1, %ebp
jne 0x7591
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x7603
movq %rbx, %rdi
callq 0x7603
testq %rax, %rax
je 0x75ee
movq %rax, %rbx
movl $0x18, %edi
callq 0x3120
testq %rax, %rax
je 0x75ca
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rbx, 0x10(%rax)
movl $0x29, (%rax)
movq $0x0, 0x8(%rax)
jmp 0x75cc
xorl %eax, %eax
testq %rax, %rax
je 0x75de
leaq 0x23(%rip), %rcx        # 0x75fb
movq %rcx, 0x8(%rax)
jmp 0x75f0
movq %rbx, %rdi
callq 0x60d8
movq %rbx, %rdi
callq 0x3030
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/eridanhq[P]miraclelib/setsig.c
// Function: main
int main(int argc, char *argv[])
{
	char filename[100];
	int memfd;
	void *mapped_base;

	strcpy(filename,"/mnt/");
	strcat(filename,argv[1]);
	strcat(filename,".bin");

	memfd = open("/dev/mem", O_RDWR | O_SYNC);
	if (memfd == -1) {
		printf("Can't open /dev/mem.\n");
		exit(0);
	}

	// Map one page of memory into user space such that the device is in that page, but it may not
	// be at the start of the page

	mapped_base = mmap( (void *) MEM0_BASE_ADDRESS, MAP_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, memfd, FIFO_BASE_ADDRESS);
	if (mapped_base == (void *) -1) {
		printf("Can't map the memory to user space.\n");
		exit(0);
	}
	
	/* ----------- INSERT CODE BELOW THIS LINE ------------ */

	set_sig_tx(filename, mapped_base);

	/* ----------- INSERT CODE ABOVE THIS LINE ------------ */
	if (munmap(mapped_base, MAP_SIZE) == -1) {
		printf("Can't unmap memory from user space.\n");
		exit(0);
	}
	close(memfd);
	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x68, %rsp
movq %rsp, %rbx
movw $0x2f, 0x4(%rbx)
movl $0x746e6d2f, (%rbx)     # imm = 0x746E6D2F
movq 0x8(%rsi), %rsi
movq %rbx, %rdi
callq 0x1120
movq %rbx, %rdi
callq 0x1080
movl $0x6e69622e, (%rsp,%rax) # imm = 0x6E69622E
movb $0x0, 0x4(%rsp,%rax)
leaq 0xd76(%rip), %rdi       # 0x200f
movl $0x101002, %esi         # imm = 0x101002
xorl %eax, %eax
callq 0x1100
cmpl $-0x1, %eax
je 0x1305
movl %eax, %ebx
movl $0x40000000, %edi       # imm = 0x40000000
movl $0x400000, %esi         # imm = 0x400000
movl $0x60000000, %r9d       # imm = 0x60000000
movl $0x3, %edx
movl $0x11, %ecx
movl %eax, %r8d
callq 0x1090
cmpq $-0x1, %rax
je 0x130e
movq %rax, %r14
movq %rsp, %rdi
movq %rax, %rsi
callq 0x13e0
movl $0x400000, %esi         # imm = 0x400000
movq %r14, %rdi
callq 0x10f0
cmpl $-0x1, %eax
je 0x1317
movl %ebx, %edi
callq 0x10d0
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
retq
leaq 0xd54(%rip), %rdi       # 0x2060
jmp 0x131e
leaq 0xd27(%rip), %rdi       # 0x203c
jmp 0x131e
leaq 0xcfa(%rip), %rdi       # 0x2018
callq 0x1060
xorl %edi, %edi
callq 0x1140
nop