LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/util.c
// Function: xlink_set_add
void *xlink_set_add(xlink_set *set, const void *value) {
  xlink_entry entry;
  int index;
  if (set->size + 1 > set->capacity*set->load) {
    xlink_set_resize(set, set->capacity << 1);
  }
  entry.hash = set->hash_code(value);
  index = xlink_set_index(set, entry.hash);
  entry.down = set->table[index];
  XLINK_ERROR(
   xlink_list_length(&set->entries) != xlink_list_length(&set->values),
   ("Invalid xlink_set state, entries length = %i but values length = %i\n",
   xlink_list_length(&set->entries), xlink_list_length(&set->values)));
  xlink_list_add(&set->entries, &entry);
  xlink_list_add(&set->values, value);
  set->table[index] = xlink_list_length(&set->entries);
  set->size++;
  return xlink_list_get(&set->values, set->table[index] - 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x20(%rdi), %eax
incl %eax
cvtsi2ss %eax, %xmm0
movl 0x10(%rdi), %esi
cvtsi2ss %esi, %xmm1
mulss 0x14(%rdi), %xmm1
ucomiss %xmm1, %xmm0
jbe 0x98ee
addl %esi, %esi
movq %rbx, %rdi
callq 0x97da
movq %r14, %rdi
callq *(%rbx)
movl %eax, (%rsp)
xorl %edx, %edx
divl 0x10(%rbx)
movq 0x18(%rbx), %rax
movslq %edx, %r12
movl (%rax,%r12,4), %eax
movl %eax, 0x4(%rsp)
movl 0x38(%rbx), %esi
movl 0x50(%rbx), %edx
cmpl %edx, %esi
jne 0x9956
leaq 0x40(%rbx), %r15
leaq 0x28(%rbx), %rdi
movq %rsp, %rsi
callq 0x93e4
movq %r15, %rdi
movq %r14, %rsi
callq 0x93e4
movl 0x38(%rbx), %eax
movq 0x18(%rbx), %rcx
movl %eax, (%rcx,%r12,4)
incl 0x20(%rbx)
movl (%rcx,%r12,4), %esi
decl %esi
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x9366
leaq 0x28a2(%rip), %rdi      # 0xc1ff
xorl %eax, %eax
callq 0x22ef
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x21f0
// File: /workspace/github_c_makefile_star2_O1/negge[P]xlink/src/util.c
// Function: xlink_set_get
void *xlink_set_get(xlink_set *set, void *key) {
  unsigned int hash;
  int index;
  hash = set->hash_code(key);
  index = set->table[xlink_set_index(set, hash)];
  while (index != 0) {
    xlink_entry *entry;
    void *value;
    entry = xlink_list_get(&set->entries, index - 1);
    value = xlink_list_get(&set->values, index - 1);
    if (set->equals == NULL ||
     (entry->hash == hash && set->equals(key, value))) {
      return value;
    }
    index = entry->down;
  }
  return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq %rsi, 0x10(%rsp)
movq %rsi, %rdi
callq *(%r14)
movq 0x18(%r14), %rcx
movl %eax, 0xc(%rsp)
xorl %edx, %edx
divl 0x10(%r14)
movslq %edx, %rax
movl (%rcx,%rax,4), %ebx
leaq 0x28(%r14), %r15
leaq 0x40(%r14), %r12
testl %ebx, %ebx
je 0x9ba1
leal -0x1(%rbx), %r13d
movq %r15, %rdi
movl %r13d, %esi
callq 0x9366
movq %rax, %rbp
movq %r12, %rdi
movl %r13d, %esi
callq 0x9366
movq %rax, %r13
movq 0x8(%r14), %rax
testq %rax, %rax
je 0x9b8e
movl 0xc(%rsp), %ecx
cmpl %ecx, (%rbp)
jne 0x9b96
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq *%rax
testl %eax, %eax
je 0x9b96
xorl %eax, %eax
movq %r13, (%rsp)
jmp 0x9b9b
movl 0x4(%rbp), %ebx
movb $0x1, %al
testb %al, %al
jne 0x9b4a
jmp 0x9ba9
movq $0x0, (%rsp)
movq (%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: test_check_EOF
static int test_check_EOF(char *name, int expected) {
    BGZF *bgz = try_bgzf_open(name, "r", __func__);
    int eof;
    if (!bgz) return -1;
    eof = bgzf_check_EOF(bgz);
    if (eof != expected) {
        fprintf(stderr, "%s : Unexpected result %d from bgzf_check_EOF on %s; "
                "expected %d\n",
                __func__, eof, name, expected);
        bgzf_close(bgz);
        return -1;
    }

    return try_bgzf_close(&bgz, name, __func__, 0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %r14
leaq 0x9163f(%rip), %rsi     # 0x98344
leaq 0x8d354(%rip), %rdx     # 0x94060
callq 0x85b7
movq %rax, (%rsp)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x6d44
movq %rax, %r15
movq %rax, %rdi
callq 0xbf3a
cmpl %ebp, %eax
jne 0x6d51
leaq 0x8d32b(%rip), %rdx     # 0x94060
movq %rsp, %rdi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x861b
movl %eax, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xae288(%rip), %rcx     # 0xb4fe0
movq (%rcx), %rdi
leaq 0x8d30d(%rip), %rsi     # 0x9406f
leaq 0x8d2f7(%rip), %rdx     # 0x94060
movl %eax, %ecx
movq %r14, %r8
movl %ebp, %r9d
xorl %eax, %eax
callq 0x4700
movq %r15, %rdi
callq 0xbc44
jmp 0x6d44
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_fopen
static FILE * try_fopen(const char *name, const char *mode) {
    FILE *f = fopen(name, mode);
    if (!f) {
        fprintf(stderr, "Couldn't open %s : %s\n", name, strerror(errno));
        return NULL;
    }
    return f;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x45a0
testq %rax, %rax
je 0x85ab
popq %rbx
retq
movq %rbx, %rdi
callq 0x4b19
xorl %eax, %eax
jmp 0x85a9
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_open
static BGZF * try_bgzf_open(const char *name, const char *mode,
                            const char *func) {
    BGZF * bgz = bgzf_open(name, mode);
    if (!bgz) {
        fprintf(stderr, "%s : Couldn't bgzf_open %s with mode %s : %s\n",
                func, name, mode, strerror(errno));
        return NULL;
    }
    return bgz;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
callq 0x8c45
movq %rax, %r12
testq %rax, %rax
je 0x85e3
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0xac9f6(%rip), %rax     # 0xb4fe0
movq (%rax), %r13
callq 0x4050
movl (%rax), %edi
callq 0x4140
leaq 0x8bab1(%rip), %rsi     # 0x940b1
xorl %r12d, %r12d
movq %r13, %rdi
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x4700
jmp 0x85d6
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_close
static int try_bgzf_close(BGZF **bgz, const char *name, const char *func, int expected_fail) {
    BGZF *to_close = *bgz;
    *bgz = NULL;
    if (bgzf_close(to_close) != 0) {
        if (!expected_fail)
            fprintf(stderr, "%s : bgzf_close failed on %s%s%s\n",
                    func, name,
                    errno ? " : " : "",
                    errno ? strerror(errno) : "");
        return -1;
    } else if (expected_fail) {
        fprintf(stderr, "%s : bgzf_close worked on %s, but expected failure\n",
                func, name);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %ecx, %r15d
movq %rdx, %r14
movq %rsi, %rbx
movq (%rdi), %rax
movq $0x0, (%rdi)
movq %rax, %rdi
callq 0xbc44
testl %eax, %eax
je 0x8658
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %r15d, %r15d
jne 0x865f
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4b54
jmp 0x865f
xorl %ebp, %ebp
testl %r15d, %r15d
jne 0x866c
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xac96d(%rip), %rax     # 0xb4fe0
movq (%rax), %rdi
leaq 0x8ba88(%rip), %rsi     # 0x94105
xorl %ebp, %ebp
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4700
jmp 0x865f
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_read
static ssize_t try_bgzf_read(BGZF *fp, void *data, size_t length,
                             const char *name, const char *func) {
    ssize_t got = bgzf_read_small(fp, data, length);
    if (got < 0) {
        fprintf(stderr, "%s : Error from bgzf_read %s : %s\n",
                func, name, strerror(errno));
    }
    return got;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r12
movslq 0x8(%rdi), %rcx
movslq 0x10(%rdi), %rax
subq %rax, %rcx
cmpq %rdx, %rcx
jle 0x86d1
addq 0x28(%r12), %rax
movq %rsi, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x43b0
addl %r15d, 0x10(%r12)
addq %r15, 0x20(%r12)
jmp 0x86df
movq %r12, %rdi
movq %r15, %rdx
callq 0xa6fd
movq %rax, %r15
testq %r15, %r15
js 0x86f3
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4bb6
jmp 0x86e4
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_fread
static ssize_t try_fread(FILE *in, void *buf, size_t len,
                         const char *func, const char *fname) {
    size_t got = fread(buf, 1, len, in);
    if (got == 0 && ferror(in)) {
        fprintf(stderr, "%s : Error reading from %s : %s\n",
                func, fname, strerror(errno));
        return -1;
    }
    return got;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdx, %r14
movq %rsi, %rax
movq %rdi, %r12
movl $0x1, %esi
movl $0x8000, %edx           # imm = 0x8000
movq %rax, %rdi
movq %r12, %rcx
callq 0x4790
movq %rax, %r15
testq %rax, %rax
jne 0x873d
movq %r12, %rdi
callq 0x4950
testl %eax, %eax
jne 0x874c
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4bf6
movq $-0x1, %r15
jmp 0x873d
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: compare_buffers
static int compare_buffers(const unsigned char *b1, const unsigned char *b2,
                           size_t l1, size_t l2,
                           const char *name1, const char *name2,
                           const char *func) {
    if (l1 != l2) {
        fprintf(stderr, "%s : EOF on %s\n", func, l1 < l2 ? name1 : name2);
        return -1;
    }
    if (memcmp(b1, b2, l1) != 0) {
        fprintf(stderr, "%s : difference between %s and %s\n",
                func, name1, name2);
        return -1;
    }

    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %r9, %rbx
movq %r8, %r15
movq 0x20(%rsp), %r14
cmpq %rcx, %rdx
jne 0x8788
callq 0x44c0
movl %eax, %ecx
xorl %eax, %eax
testl %ecx, %ecx
jne 0x87ac
popq %rbx
popq %r14
popq %r15
retq
movq 0xac851(%rip), %rax     # 0xb4fe0
movq (%rax), %rdi
cmovbq %r15, %rbx
leaq 0x8b9ea(%rip), %rsi     # 0x94187
movq %r14, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x4700
jmp 0x87cd
movq 0xac82d(%rip), %rax     # 0xb4fe0
movq (%rax), %rdi
leaq 0x8b9da(%rip), %rsi     # 0x94197
movq %r14, %rdx
movq %r15, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x4700
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x8782
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_dopen
static BGZF * try_bgzf_dopen(const char *name, const char *mode,
                             const char *func) {
    BGZF *bgz = NULL;
    int fd = open(name, hfile_oflags(mode), 0666);
    if (fd < 0) {
        fprintf(stderr, "%s : Failed to open %s with mode %s : %s\n",
                func, name, mode, strerror(errno));
        return NULL;
    }

    bgz = bgzf_dopen(fd, mode);
    if (!bgz) {
        fprintf(stderr, "%s : bgzf_dopen failed on %s mode %s : %s\n",
                func, name, mode, strerror(errno));
        close(fd);
        return NULL;
    }

    return bgz;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movq %rsi, %rdi
callq 0xdfb4
movq %r14, %rdi
movl %eax, %esi
movl $0x1b6, %edx            # imm = 0x1B6
xorl %eax, %eax
callq 0x4320
testl %eax, %eax
js 0x8811
movl %eax, %ebp
movl %eax, %edi
movq %rbx, %rsi
callq 0x9245
testq %rax, %rax
je 0x881e
popq %rbx
popq %r14
popq %rbp
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4c8f
jmp 0x882b
movq %r14, %rdi
movq %rbx, %rsi
movl %ebp, %edx
callq 0x4c36
xorl %eax, %eax
jmp 0x880c
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_hopen
static BGZF * try_bgzf_hopen(const char *name, const char *mode,
                          const char *func) {
    hFILE *hfp = hopen(name, mode);
    BGZF *bgz = NULL;

    if (!hfp) {
        fprintf(stderr, "%s : hopen failed on %s mode %s : %s\n",
                func, name, mode, strerror(errno));
        return NULL;
    }

    bgz = bgzf_hopen(hfp, mode);
    if (!bgz) {
        fprintf(stderr, "%s : bgzf_hopen failed on %s mode %s : %s\n",
                func, name, mode, strerror(errno));
        hclose_abruptly(hfp);
        return NULL;
    }

    return bgz;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
xorl %eax, %eax
callq 0xe7b4
testq %rax, %rax
je 0x885f
movq %rax, %r15
movq %rax, %rdi
movq %rbx, %rsi
callq 0x92fa
testq %rax, %rax
je 0x886c
popq %rbx
popq %r14
popq %r15
retq
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4d31
jmp 0x887a
movq %r14, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4cd6
xorl %eax, %eax
jmp 0x8859
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_write
static ssize_t try_bgzf_write(BGZF *fp, const void *data, size_t length,
                              const char *name, const char *func) {
    ssize_t put = bgzf_write_small(fp, data, length);
    if (put < (ssize_t) length) {
        fprintf(stderr, "%s : %s %s : %s\n",
                func, put < 0 ? "Error writing to" : "Short write on",
                name, strerror(errno));
        return -1;
    }

    return put;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %r8, %r14
movq %rcx, %rbx
movq %rdx, %r15
movq %rdi, %r12
testb $0x40, 0x3(%rdi)
je 0x88e8
movslq 0x10(%r12), %rdi
movl $0xff00, %eax           # imm = 0xFF00
subq %rdi, %rax
cmpq %r15, %rax
jbe 0x88e8
addq 0x28(%r12), %rdi
movq %r15, %rdx
callq 0x43b0
addl %r15d, 0x10(%r12)
movq %r15, %rax
jmp 0x88f3
movq %r12, %rdi
movq %r15, %rdx
callq 0xb85b
cmpq %r15, %rax
jl 0x8904
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x4db3
movq $-0x1, %rax
jmp 0x88f8
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_useek
static int try_bgzf_useek(BGZF *fp, long uoffset, int where,
                          const char *name, const char *func) {
    if (bgzf_useek(fp, uoffset, where) < 0) {
        fprintf(stderr, "%s : Error from bgzf_useek(%s, %ld, %d) : %s\n",
                func, name, uoffset, where, strerror(errno));
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
xorl %ebp, %ebp
xorl %edx, %edx
callq 0xcda7
testl %eax, %eax
js 0x89b8
movl %ebp, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xac621(%rip), %rax     # 0xb4fe0
movq (%rax), %r12
callq 0x4050
movl (%rax), %edi
callq 0x4140
movq %rax, (%rsp)
leaq 0x8ba78(%rip), %rsi     # 0x94451
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
movq %rbx, %r8
xorl %r9d, %r9d
xorl %eax, %eax
callq 0x4700
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x89a9
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_getc
static int try_bgzf_getc(BGZF *fp, size_t pos, int expected,
                         const char *name, const char *func) {
    int c = bgzf_getc(fp);
    if (c != expected) {
        fprintf(stderr,
                "%s : Unexpected value (%d) from bgzf_getc on %s pos %zu; "
                "expected %d\n",
                func, c, name, pos, expected);
        return -1;
    }
    return c;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %r8, %r15
movq %rcx, %rbx
movl %edx, %ebp
movq %rsi, %r14
callq 0xc34c
cmpl %ebp, %eax
jne 0x8a1c
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq 0xac5bd(%rip), %rcx     # 0xb4fe0
movq (%rcx), %rdi
movl %ebp, (%rsp)
leaq 0x8ba4f(%rip), %rsi     # 0x9447f
movq %r15, %rdx
movl %eax, %ecx
movq %rbx, %r8
movq %r14, %r9
xorl %eax, %eax
callq 0x4700
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x8a11
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_tell
static int64_t try_bgzf_tell(BGZF *fp, const char *name, const char *func) {
    int64_t told = bgzf_tell(fp);
    if (told < 0) {
        fprintf(stderr, "%s : %s %s : %s\n",
                func, "Error telling in",
                name, strerror(errno));
        return -1;
    }

    return told;
}

// Assembly:
movq 0x18(%rdi), %rax
shlq $0x10, %rax
js 0x8a5b
movzwl 0x10(%rdi), %ecx
orq %rcx, %rax
retq
pushq %rax
movq %rdx, %rdi
callq 0x4ec8
movq $-0x1, %rax
addq $0x8, %rsp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test_bgzf.c
// Function: try_bgzf_tell_expect
static int64_t try_bgzf_tell_expect(BGZF *fp, int64_t expected, const char *name, const char *func) {
    int64_t told = try_bgzf_tell(fp, name, func);
    if (told != expected) {
        fprintf(stderr, "%s : Unexpected value (%" PRId64 ") from bgzf_tell on %s; "
                "expected %" PRId64 "\n",
                func, told, name, expected);
        return -1;
    }
    return told;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rcx, %r15
movq %rdx, %r14
movq %rsi, %rbx
movq %rdx, %rsi
movq %rcx, %rdx
callq 0x8a49
cmpq %rbx, %rax
jne 0x8ac5
popq %rbx
popq %r14
popq %r15
retq
movq 0xac514(%rip), %rcx     # 0xb4fe0
movq (%rcx), %rdi
leaq 0x8ba41(%rip), %rsi     # 0x94517
movq %r15, %rdx
movq %rax, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x4700
movq $-0x1, %rax
jmp 0x8abf
nop
// File: /workspace/github_c_makefile_star2_O1/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_int_atomic_swap.c
// Function: shmem_int_atomic_swap
int shmem_int_atomic_swap( int* ptr, int val, int pe)
{
	int* remote_ptr = (int*)shmem_ptr((void*)ptr, pe ); 
	long* x = (long*)shmem_ptr((void*)&__shmem.lock_atomic_int, pe);
	__set_spin_lock(x);
	int r = *remote_ptr;
	*remote_ptr = val;
	__clear_spin_lock(x);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebx
movl %esi, %ebp
movl %edx, %esi
callq 0x1c2c
movq %rax, %r14
leaq 0x326c(%rip), %rdi      # 0x61f0
addq $0x10, %rdi
movl %ebx, %esi
callq 0x1c2c
movq %rax, %rbx
movq %rax, %rdi
callq 0x3233
movl (%r14), %r15d
movl %ebp, (%r14)
movq %rbx, %rdi
callq 0x3224
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/giometti[P]mastering_UNIX_programming/chapter_04/link.c
// Function: main
int main(int argc, char *argv[])
{
	int ret;

	if (argc < 3) {
		fprintf(stderr, "usage: %s <oldfile> <newfile>\n",
			argv[0]);
		return -1;
	}

	printf("linking %s to %s\n", argv[1], argv[2]);
	ret = link(argv[1], argv[2]);
	if (ret < 0) {
		perror("link");
		return -1;
	}

	return 0;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
cmpl $0x2, %edi
jle 0x11cb
movq 0x8(%r14), %rsi
movq 0x10(%r14), %rdx
leaq 0xe7c(%rip), %rdi       # 0x2023
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x1030
movq 0x8(%r14), %rdi
movq 0x10(%r14), %rsi
callq 0x1060
testl %eax, %eax
js 0x11d5
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %r14, %rdi
callq 0x1080
jmp 0x11e1
leaq 0xe59(%rip), %rdi       # 0x2035
callq 0x1050
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x11c1
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict_pair__init
SH_dict_pair*
SH_dict_pair__init(SH_Key* key, SH_Item* value, int* err) {
	SH_dict_pair* obj;

	__cascade(err, (SH_dict_pair*)0);

	obj = (SH_dict_pair*)malloc(sizeof(SH_dict_pair));
	if ((SH_dict_pair*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_dict_pair*)0;
	}

	obj->key = key;
	obj->value = value;

	__clear(err);
	return obj;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rdx, %rdx
je 0x11d8
cmpl $0x0, (%rbx)
je 0x11d8
xorl %eax, %eax
jmp 0x1200
movl $0x10, %edi
callq 0x1090
testq %rax, %rax
je 0x11f2
xorl %ecx, %ecx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
jmp 0x11f9
movl $0x80000001, %ecx       # imm = 0x80000001
xorl %eax, %eax
testq %rbx, %rbx
je 0x1200
movl %ecx, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict_pair__destroy
void
SH_dict_pair__destroy(SH_dict_pair* obj, sh_bool_t recursive, int* err) {
	__cascade(err,);
	if (recursive) {
		SH_Key__destroy(obj->key, err);
		SH_Item__destroy(obj->value, recursive, err);
	}
	free(obj);
	__clear(err);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
testq %rdx, %rdx
je 0x121c
cmpl $0x0, (%rbx)
jne 0x124f
testb %bpl, %bpl
je 0x123c
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x1040
movq 0x8(%r14), %rdi
movzbl %bpl, %esi
movq %rbx, %rdx
callq 0x1060
movq %r14, %rdi
callq 0x1030
testq %rbx, %rbx
je 0x124f
movl $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict_bucket__init
SH_dict_bucket*
SH_dict_bucket__init(int *err) {
	SH_dict_bucket* obj;

	__cascade(err, (SH_dict_bucket*)0);

	obj = (SH_dict_bucket*)calloc(sizeof(SH_dict_bucket), 1);
	if ((SH_dict_bucket*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_dict_bucket*)0;
	}

	__clear(err);
	return obj;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1266
cmpl $0x0, (%rbx)
je 0x1266
xorl %eax, %eax
jmp 0x1289
movl $0x30, %edi
movl $0x1, %esi
callq 0x1080
testq %rbx, %rbx
je 0x1289
xorl %ecx, %ecx
testq %rax, %rax
movl $0x80000001, %edx       # imm = 0x80000001
cmovnel %ecx, %edx
movl %edx, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict_bucket__destroy
void
SH_dict_bucket__destroy(SH_dict_bucket* obj, sh_bool_t recursive, int* err) {
	__cascade(err,);
	if ((SH_dict_bucket*)0 != obj->next) {
		SH_dict_bucket__destroy(obj->next, recursive, err);
	}
	while (obj->num > (size_t)0) {
		obj->num --;
		SH_dict_pair__destroy(obj->pairs[obj->num], recursive, err);
	}
	free(obj);
	__clear(err);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x129f
cmpl $0x0, (%rbx)
jne 0x12e8
movq 0x28(%r14), %rdi
movzbl %sil, %ebp
testq %rdi, %rdi
je 0x12cd
movl %ebp, %esi
movq %rbx, %rdx
callq 0x10c0
jmp 0x12cd
leaq -0x1(%rax), %rcx
movq %rcx, (%r14)
movq (%r14,%rax,8), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x1070
movq (%r14), %rax
testq %rax, %rax
jne 0x12b8
movq %r14, %rdi
callq 0x1030
testq %rbx, %rbx
je 0x12e8
movl $0x0, (%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict_bucket__add
void
SH_dict_bucket__add(SH_dict_bucket* obj, SH_dict_pair* pair, int* err) {
	__cascade(err,);
	while (obj->num >= SH_dict_bucket_size) {
		if ((SH_dict_bucket*)0 == obj->next) {
			obj->next = SH_dict_bucket__init(err);
			if (err) return;
		}
		obj = obj->next;
	}
	obj->pairs[obj->num] = pair;
	obj->num ++;

	__clear(err);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
testq %rdx, %rdx
je 0x1305
cmpl $0x0, (%rbx)
jne 0x134a
movq (%r15), %rax
cmpq $0x4, %rax
jb 0x1333
cmpq $0x0, 0x28(%r15)
jne 0x1326
movq %rbx, %rdi
callq 0x10e0
movq %rax, 0x28(%r15)
testq %rbx, %rbx
jne 0x134a
movq 0x28(%r15), %r15
movq (%r15), %rax
cmpq $0x3, %rax
ja 0x130e
leaq 0x1(%rax), %rcx
movq %r14, 0x8(%r15,%rax,8)
movq %rcx, (%r15)
testq %rbx, %rbx
je 0x134a
movl $0x0, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict__init
SH_dict*
SH_dict__init(int* err) {
	SH_dict* obj;

	__cascade(err, (SH_dict*)0);

	obj = (SH_dict*)calloc(sizeof(SH_dict), 1);
	if ((SH_dict*)0 == obj) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (SH_dict*)0;
	}

	__clear(err);
	return obj;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x1362
cmpl $0x0, (%rbx)
je 0x1362
xorl %eax, %eax
jmp 0x1385
movl $0x808, %edi            # imm = 0x808
movl $0x1, %esi
callq 0x1080
testq %rbx, %rbx
je 0x1385
xorl %ecx, %ecx
testq %rax, %rax
movl $0x80000001, %edx       # imm = 0x80000001
cmovnel %ecx, %edx
movl %edx, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict__destroy
void
SH_dict__destroy(SH_dict* obj, sh_bool_t recursive, int* err) {
	__cascade(err,);
	if ((SH_dict_bucket*)0 != obj->_list) {
		SH_dict_bucket__destroy(obj->_list, recursive, err);
	}
	free(obj);
	__clear(err);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rdi, %r14
testq %rdx, %rdx
je 0x139b
cmpl $0x0, (%rbx)
jne 0x13c6
movq 0x800(%r14), %rdi
testq %rdi, %rdi
je 0x13b3
movzbl %sil, %esi
movq %rbx, %rdx
callq 0x10c0
movq %r14, %rdi
callq 0x1030
testq %rbx, %rbx
je 0x13c6
movl $0x0, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict__get
SH_Item*
SH_dict__get(SH_dict* obj, SH_Key* key, int* err) {
	size_t i;
	uint8_t hash;
	SH_dict_bucket* bucket;
	SH_dict_pair* pair;

	hash = SH_Key__hash(key, err);
	bucket = obj->_hash[hash];

	__cascade(err, (SH_Item*)0);

	while ((SH_dict_bucket*)0 != bucket) {
		for (i = 0; /*i < SH_dict_bucket_size &&*/ i < bucket->num; i++) {
			pair = bucket->pairs[i];
			if (SH_Key__equal(key, pair->key, 0)) { /*FIXME: err?*/
				__clear(err);
				return pair->value;
			}
		}
		bucket = bucket->next;
	}

	/* not found, but no error */
	__clear(err);
	return (SH_Item*)0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x10b0
movzbl %al, %eax
movq (%r15,%rax,8), %r15
testq %rbx, %rbx
je 0x142a
cmpl $0x0, (%rbx)
jne 0x143a
jmp 0x142a
cmpq $0x0, (%r15)
je 0x1426
xorl %r12d, %r12d
movq 0x8(%r15,%r12,8), %r13
movq (%r13), %rsi
movq %r14, %rdi
xorl %edx, %edx
callq 0x1050
testb %al, %al
jne 0x143e
incq %r12
cmpq (%r15), %r12
jb 0x1407
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x13fe
testq %rbx, %rbx
je 0x143a
movl $0x0, (%rbx)
xorl %eax, %eax
jmp 0x144d
testq %rbx, %rbx
je 0x1449
movl $0x0, (%rbx)
movq 0x8(%r13), %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict__count
size_t
SH_dict__count(SH_dict* obj, int* err) {
	SH_dict_bucket* bucket;
	size_t n = 0;

	__cascade(err, (size_t)0);

	bucket = obj->_list;
	while ((SH_dict_bucket*)0 != bucket) {
		n += bucket->num;
		bucket = bucket->next;
	}

	__clear(err);
	return n;
}

// Assembly:
testq %rsi, %rsi
je 0x1464
cmpl $0x0, (%rsi)
je 0x1464
xorl %eax, %eax
retq
movq 0x800(%rdi), %rcx
xorl %eax, %eax
testq %rcx, %rcx
je 0x147b
addq (%rcx), %rax
movq 0x28(%rcx), %rcx
jmp 0x146d
testq %rsi, %rsi
je 0x1486
movl $0x0, (%rsi)
retq
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/_dict.c
// Function: SH_dict__add
void
SH_dict__add(SH_dict* obj, SH_Key* key, SH_Item* value, int* err) {
	SH_dict_pair* pair;
	uint8_t hash;

	__cascade(err,);

	pair = SH_dict_pair__init(key, value, err);
	__cascade(err,);

	/* add it to the _hash array */

	hash = SH_Key__hash(pair->key, err);
	if ((SH_dict_bucket*)0 == obj->_hash[hash]) {
		obj->_hash[hash] = SH_dict_bucket__init(err);
		__cascade(err,);
	}
	SH_dict_bucket__add(obj->_hash[hash], pair, err);
	__cascade(err,);

	/* add it to the _list list */

	if ((SH_dict_bucket*)0 == obj->_list) {
		obj->_list = SH_dict_bucket__init(err);
		__cascade(err,);
	}
	SH_dict_bucket__add(obj->_list, pair, err);
	__cascade(err,); /* FIXME are we left in a broken state? */
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movq %rdi, %r14
testq %rcx, %rcx
je 0x14a3
cmpl $0x0, (%rbx)
jne 0x1559
movq %rsi, %rdi
movq %rdx, %rsi
movq %rbx, %rdx
callq 0x10d0
movq %rax, %r15
testq %rbx, %rbx
je 0x14c2
cmpl $0x0, (%rbx)
jne 0x1559
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x10b0
movzbl %al, %r12d
cmpq $0x0, (%r14,%r12,8)
je 0x14f3
movq (%r14,%r12,8), %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x10a0
testq %rbx, %rbx
je 0x1519
cmpl $0x0, (%rbx)
jne 0x1559
jmp 0x1519
movq %rbx, %rdi
callq 0x10e0
movq %rax, (%r14,%r12,8)
testq %rbx, %rbx
je 0x150b
cmpl $0x0, (%rbx)
jne 0x1559
jmp 0x14d8
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rdx
callq 0x10a0
cmpq $0x0, 0x800(%r14)
je 0x1540
movq 0x800(%r14), %rdi
movq %r15, %rsi
movq %rbx, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10a0
movq %rbx, %rdi
callq 0x10e0
movq %rax, 0x800(%r14)
testq %rbx, %rbx
je 0x1565
cmpl $0x0, (%rbx)
je 0x1523
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %rdi
jmp 0x152a
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_12/itoa.c
// Function: main
int main(void)
{
  int n = -1234;
  char str[MAXLEN];

  int_to_array(n, str);
  printf("%s\n", str);

  n = -7676;

  int_to_array(n, str);
  printf("%s", str);

  return 0;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
movq %rsp, %rbx
movl $0xfffffb2e, %edi       # imm = 0xFFFFFB2E
movq %rbx, %rsi
callq 0x118f
movq %rbx, %rdi
callq 0x1030
movl $0xffffe204, %edi       # imm = 0xFFFFE204
movq %rbx, %rsi
callq 0x118f
leaq 0xe87(%rip), %rdi       # 0x2004
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_12/itoa.c
// Function: int_to_array
void int_to_array(int n, char str[])
{
  static int i = 0;

  if (n)
  {
    if(n < 0){
      i = 0;
      str[i++] = '-';
      n *= -1;
    }

    int d = n % 10;
    n /= 10;


    int_to_array(n, str);
 

    str[i++] = d + '0';
    str[i] = '\0';
  }
}

// Assembly:
testl %edi, %edi
je 0x11ef
pushq %rbp
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %ebp
jns 0x11ac
movl $0x1, 0x2e95(%rip)      # 0x403c
movb $0x2d, (%rbx)
negl %ebp
movl %ebp, %eax
movl $0xcccccccd, %edi       # imm = 0xCCCCCCCD
imulq %rax, %rdi
shrq $0x23, %rdi
leal (%rdi,%rdi), %eax
leal (%rax,%rax,4), %eax
subl %eax, %ebp
movq %rbx, %rsi
callq 0x118f
orb $0x30, %bpl
movslq 0x2e66(%rip), %rax      # 0x403c
leaq 0x1(%rax), %rcx
movl %ecx, 0x2e5c(%rip)      # 0x403c
movb %bpl, (%rbx,%rax)
movb $0x0, 0x1(%rbx,%rax)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mloar[P]charset/toucs.c
// Function: charset_to_unicode
int charset_to_unicode(const char **input, int *inlen,
		       wchar_t *output, int outlen,
		       int charset, charset_state *state,
		       const wchar_t *errstr, int errlen)
{
    charset_spec const *spec = charset_find_spec(charset);
    charset_state localstate = CHARSET_INIT_STATE;
    struct unicode_emit_param param;

    param.output = output;
    param.outlen = outlen;
    param.errstr = errstr;
    param.errlen = errlen;
    param.writtenlen = 0;
    param.stopped = 0;

    if (state)
	localstate = *state;	       /* structure copy */

    while (*inlen > 0) {
	int lenbefore = param.writtenlen;
	spec->read(spec, (unsigned char)**input, &localstate,
		   unicode_emit, &param);
	if (param.stopped) {
	    /*
	     * The emit function has _tried_ to output some
	     * characters, but ran up against the end of the
	     * buffer. Leave immediately, and return what happened
	     * _before_ attempting to process this character.
	     */
	    return lenbefore;
	}
	if (state)
	    *state = localstate;   /* structure copy */
	(*input)++;
	(*inlen)--;
    }

    return param.writtenlen;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movl %ecx, %ebp
movq %rdx, %r13
movq %rsi, %r14
movq %rdi, %r15
movl %r8d, %edi
callq 0x675c
movq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq %r13, (%rsp)
movl %ebp, 0x8(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x10(%rsp)
movl 0x78(%rsp), %eax
movl %eax, 0x18(%rsp)
xorl %eax, %eax
movl %eax, 0xc(%rsp)
movl %eax, 0x1c(%rsp)
testq %rbx, %rbx
je 0x6808
movups (%rbx), %xmm0
movaps %xmm0, 0x20(%rsp)
movq %rbx, 0x30(%rsp)
movq %rsp, %r13
cmpl $0x0, (%r14)
movl 0xc(%rsp), %ebp
jle 0x685f
movq (%r15), %rax
movzbl (%rax), %esi
movq %r12, %rdi
leaq 0x20(%rsp), %rdx
leaq 0x41(%rip), %rcx        # 0x6870
movq %r13, %r8
callq *0x8(%r12)
movl 0x1c(%rsp), %eax
testl %eax, %eax
jne 0x6859
movq 0x30(%rsp), %rcx
testq %rcx, %rcx
je 0x6851
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rcx)
incq (%r15)
decl (%r14)
movl %ebx, %ebp
movl %ebp, %ebx
testl %eax, %eax
je 0x6810
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mloar[P]charset/toucs.c
// Function: unicode_emit
static void unicode_emit(void *ctx, long int output)
{
    struct unicode_emit_param *param = (struct unicode_emit_param *)ctx;
    wchar_t outval;
    wchar_t const *p;
    int outlen;

    if (output == ERROR) {
	if (param->errstr) {
	    p = param->errstr;
	    outlen = param->errlen;
	} else {
	    outval = 0xFFFD;	       /* U+FFFD REPLACEMENT CHARACTER */
	    p = &outval;
	    outlen = 1;
	}
    } else {
	outval = output;
	p = &outval;
	outlen = 1;
    }

    if (param->outlen < 0 || param->outlen >= outlen) {
	while (outlen > 0) {
	    if (param->output)
		*param->output++ = *p++;
	    if (param->outlen > 0)
		param->outlen--;
	    outlen--;
	    param->writtenlen++;
	}
    } else {
	param->stopped = 1;
    }
}

// Assembly:
cmpq $0xffff, %rsi           # imm = 0xFFFF
jne 0x6887
movq 0x10(%rdi), %rax
testq %rax, %rax
je 0x6890
movl 0x18(%rdi), %ecx
jmp 0x68a0
leaq -0x4(%rsp), %rax
movl %esi, (%rax)
jmp 0x689b
leaq -0x4(%rsp), %rax
movl $0xfffd, (%rax)         # imm = 0xFFFD
movl $0x1, %ecx
movl 0x8(%rdi), %edx
testl %edx, %edx
setns %sil
cmpl %ecx, %edx
setl %dl
testb %dl, %sil
je 0x68bb
movl $0x1, 0x1c(%rdi)
retq
testl %ecx, %ecx
jle 0x68f1
movq (%rdi), %rdx
incl %ecx
testq %rdx, %rdx
je 0x68db
movl (%rax), %esi
addq $0x4, %rax
leaq 0x4(%rdx), %r8
movq %r8, (%rdi)
movl %esi, (%rdx)
movq %r8, %rdx
movl 0x8(%rdi), %esi
testl %esi, %esi
jle 0x68e7
decl %esi
movl %esi, 0x8(%rdi)
incl 0xc(%rdi)
decl %ecx
cmpl $0x1, %ecx
jg 0x68c4
retq
nop
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/tests/recovery.c
// Function: main
int main(void)
{
	run("Control", scen_control);
	run("Instant fail", scen_instant_fail);

	run("Fail after checkpoint", scen_after_check);
	run("Fail mid-checkpoint", scen_mid_check);
	run("Fail on meta", scen_meta_check);

	run("Cascade fail after checkpoint", scen_after_cascade);
	run("Cascade fail mid-checkpoint", scen_mid_cascade);

	run("Metadata dump failure", scen_meta_fail);

	run("Bad day", scen_bad_day);

	return 0;
}

// Assembly:
pushq %rax
leaq 0x1e98(%rip), %rdi      # 0x4004
leaq 0x165(%rip), %rsi       # 0x22d8
callq 0x2214
leaq 0x1e8d(%rip), %rdi      # 0x400c
leaq 0x153(%rip), %rsi       # 0x22d9
callq 0x2214
leaq 0x1e87(%rip), %rdi      # 0x4019
leaq 0x147(%rip), %rsi       # 0x22e0
callq 0x2214
leaq 0x1e8a(%rip), %rdi      # 0x402f
leaq 0x140(%rip), %rsi       # 0x22ec
callq 0x2214
leaq 0x1e8b(%rip), %rdi      # 0x4043
leaq 0x139(%rip), %rsi       # 0x22f8
callq 0x2214
leaq 0x1e85(%rip), %rdi      # 0x4050
leaq 0x132(%rip), %rsi       # 0x2304
callq 0x2214
leaq 0x1e90(%rip), %rdi      # 0x406e
leaq 0x14b(%rip), %rsi       # 0x2330
callq 0x2214
leaq 0x1e99(%rip), %rdi      # 0x408a
leaq 0x155(%rip), %rsi       # 0x234d
callq 0x2214
leaq 0x1e9c(%rip), %rdi      # 0x40a0
leaq 0x15a(%rip), %rsi       # 0x2365
callq 0x2214
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O1/dlbeer[P]dhara/tests/recovery.c
// Function: run
static void run(const char *name, void (*scen)(void))
{
	uint8_t page_buf[1 << sim_nand.log2_page_size];
	struct dhara_journal journal;

	printf("========================================"
	       "================================\n"
	       "%s\n"
	       "========================================"
	       "================================\n\n", name);

	sim_reset();
	dhara_journal_init(&journal, &sim_nand, page_buf);

	/* All tests are tuned for this value */
	assert(journal.log2_ppc == 2);

	scen();

	jt_enqueue_sequence(&journal, 0, 30);
	jt_dequeue_sequence(&journal, 0, 30);

	sim_dump();
	printf("\n");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq 0x1f76(%rip), %r14      # 0x41a0
movb (%r14), %cl
movl $0x1, %eax
shlq %cl, %rax
movq %rsi, %rbx
movq %rdi, %rsi
addq $0xf, %rax
andq $-0x10, %rax
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
leaq 0x1e55(%rip), %rdi      # 0x40a8
xorl %eax, %eax
callq 0x1070
callq 0x238c
leaq -0x58(%rbp), %r12
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x12ec
cmpb $0x2, 0x10(%r12)
jne 0x22b9
callq *%rbx
leaq -0x58(%rbp), %rbx
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1e, %edx
callq 0x2c14
movq %rbx, %rdi
xorl %esi, %esi
movl $0x1e, %edx
callq 0x2ece
callq 0x2836
movl $0xa, %edi
callq 0x1030
leaq -0x20(%rbp), %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e7f(%rip), %rdi      # 0x413f
leaq 0x1e8e(%rip), %rsi      # 0x4155
leaq 0x1e98(%rip), %rcx      # 0x4166
movl $0x25, %edx
callq 0x1080
// File: /workspace/github_c_makefile_star2_O1/ethinethin[P]Secret/main.c
// Function: main
void splash_screen(void)
{
	printf("\n--------------------------------------------------------------------------------\n");
	printf("Welcome to %s (game engine %s)\n",TITLE,ENGINE);
	printf("--------------------------------------------------------------------------------\n");
	printf("What lies in the mysterious forest on the edge of a small village? Myths and\n");
	printf("legends have been told for centuries, but no-one has yet figured it out. Will\n");
	printf("you be the one to finally solve this riddle? Good luck!\n");
	printf("--------------------------------------------------------------------------------\n");
	printf("To learn how to play, type: help\n");
	printf("--------------------------------------------------------------------------------\n");

}

// Assembly:
pushq %rbx
leaq 0x3ca2(%rip), %rdi      # 0x7046
callq 0x3090
leaq 0x3c54(%rip), %rdi      # 0x7004
leaq 0x3c6d(%rip), %rsi      # 0x7024
leaq 0x3c7b(%rip), %rdx      # 0x7039
xorl %eax, %eax
callq 0x30f0
leaq 0x3c7b(%rip), %rbx      # 0x7047
movq %rbx, %rdi
callq 0x3090
leaq 0x3cbd(%rip), %rdi      # 0x7098
callq 0x3090
leaq 0x3cfe(%rip), %rdi      # 0x70e5
callq 0x3090
leaq 0x3d40(%rip), %rdi      # 0x7133
callq 0x3090
movq %rbx, %rdi
callq 0x3090
leaq 0x3d64(%rip), %rdi      # 0x716b
callq 0x3090
movq %rbx, %rdi
callq 0x3090
callq 0x3420
xorl %eax, %eax
popq %rbx
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/ethinethin[P]Secret/input.c
// Function: completion
void completion(const char *buf, linenoiseCompletions *lc) {
	if (buf[0] == 'w') {
		linenoiseAddCompletion(lc,"walk ");
		linenoiseAddCompletion(lc,"west");
	} else if (buf[0] == 'g') {
		linenoiseAddCompletion(lc,"go ");
		linenoiseAddCompletion(lc,"get ");
	} else if (buf[0] == 'm') {
		linenoiseAddCompletion(lc,"move ");
	} else if (buf[0] == 'n') {
		linenoiseAddCompletion(lc,"north");
	} else if (buf[0] == 's') {
		linenoiseAddCompletion(lc,"south");
		linenoiseAddCompletion(lc,"search");
	} else if (buf[0] == 'l') {
		linenoiseAddCompletion(lc,"look");
	} else if (buf[0] == 't') {
		linenoiseAddCompletion(lc,"take ");
	} else if (buf[0] == 'd') {
		linenoiseAddCompletion(lc,"drop ");
	} else if (buf[0] == 'i') {
		linenoiseAddCompletion(lc,"inventory");
	} else if (buf[0] == 'u') {
		linenoiseAddCompletion(lc,"use ");
	} else if (buf[0] == 'q') {
		linenoiseAddCompletion(lc,"quit");
	} else if (buf[0] == 'h') {
		linenoiseAddCompletion(lc,"help");
	} else if (buf[0] == 'e') {
		linenoiseAddCompletion(lc,"exit");
		linenoiseAddCompletion(lc,"east");
	} else if (buf[0] == 'f') {
		linenoiseAddCompletion(lc,"find");
	}
}

// Assembly:
pushq %rbx
movzbl (%rdi), %eax
addl $-0x64, %eax
cmpl $0x13, %eax
ja 0x3c65
movq %rsi, %rbx
leaq 0x35f7(%rip), %rcx      # 0x718c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x36ee(%rip), %rsi      # 0x7293
jmp 0x3c5c
leaq 0x36c7(%rip), %rsi      # 0x7278
movq %rbx, %rdi
callq 0x3c9d
leaq 0x3652(%rip), %rsi      # 0x7212
jmp 0x3c5c
leaq 0x5206(%rip), %rsi      # 0x8dd2
movq %rbx, %rdi
callq 0x3c9d
leaq 0x364c(%rip), %rsi      # 0x7227
jmp 0x3c5c
leaq 0x35a3(%rip), %rsi      # 0x7187
jmp 0x3c5c
leaq 0x36ac(%rip), %rsi      # 0x7299
jmp 0x3c5c
leaq 0x363f(%rip), %rsi      # 0x7235
jmp 0x3c5c
leaq 0x368e(%rip), %rsi      # 0x728d
jmp 0x3c5c
leaq 0x3676(%rip), %rsi      # 0x727e
movq %rbx, %rdi
callq 0x3c9d
leaq 0x366b(%rip), %rsi      # 0x7282
jmp 0x3c5c
leaq 0x360e(%rip), %rsi      # 0x722e
jmp 0x3c5c
leaq 0x35c5(%rip), %rsi      # 0x71ee
movq %rbx, %rdi
callq 0x3c9d
leaq 0x35d5(%rip), %rsi      # 0x720d
jmp 0x3c5c
leaq 0x35b4(%rip), %rsi      # 0x71f5
jmp 0x3c5c
leaq 0x363d(%rip), %rsi      # 0x7287
jmp 0x3c5c
leaq 0x3596(%rip), %rsi      # 0x71e9
jmp 0x3c5c
leaq 0x35ab(%rip), %rsi      # 0x7207
movq %rbx, %rdi
popq %rbx
jmp 0x3c9d
popq %rbx
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ethinethin[P]Secret/rooms.c
// Function: move
extern void move(char *direction)
{
	int dir;

	putchar('\n');

	/* figure out direction */
	if (direction == NULL) {
		printf("Walk where?\n");
		return;
	} else if (strcmp(direction,"north") == 0) {
		dir = 0;
	} else if (strcmp(direction,"east") == 0) {
		dir = 1;
	} else if (strcmp(direction,"south") == 0) {
		dir = 2;
	} else if (strcmp(direction,"west") == 0) {
		dir = 3;
	} else {
		printf("Walk where?\n");
		return;
	}

	/* move */
	if (locations[current_room].walk_to[dir] != -1) {
		printf("%s\n",locations[current_room].walk_desc[dir]);
		current_room = locations[current_room].walk_to[dir];
		room_name();
		look_room();
	} else {
		printf("You cannot walk %s.\n",direction);
	}

}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl $0xa, %edi
callq 0x3050
testq %rbx, %rbx
je 0x5766
leaq 0x1ae6(%rip), %rsi      # 0x7207
movq %rbx, %rdi
callq 0x3170
testl %eax, %eax
je 0x5777
leaq 0x1ad9(%rip), %rsi      # 0x720d
movq %rbx, %rdi
callq 0x3170
testl %eax, %eax
je 0x577c
leaq 0x368b(%rip), %rsi      # 0x8dd2
movq %rbx, %rdi
callq 0x3170
testl %eax, %eax
je 0x5784
leaq 0x1ab8(%rip), %rsi      # 0x7212
movq %rbx, %rdi
callq 0x3170
testl %eax, %eax
je 0x578c
leaq 0x4392(%rip), %rdi      # 0x9aff
popq %rbx
popq %r14
popq %r15
jmp 0x3090
xorl %r14d, %r14d
jmp 0x5792
movl $0x1, %r14d
jmp 0x5792
movl $0x2, %r14d
jmp 0x5792
movl $0x3, %r14d
movslq 0xa483(%rip), %rax      # 0xfc1c
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
leaq 0x89c8(%rip), %r15      # 0xe170
addq %r15, %rax
cmpl $-0x1, 0x18(%rax,%r14,4)
je 0x57ff
movq 0x28(%rax,%r14,8), %rdi
callq 0x3090
movslq 0xa458(%rip), %rax      # 0xfc1c
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
addq %r15, %rax
movslq 0x18(%rax,%r14,4), %rax
movl %eax, 0xa442(%rip)      # 0xfc1c
leaq (%rax,%rax,4), %rax
shlq $0x4, %rax
movq 0x8(%rax,%r15), %rsi
leaq 0x2150(%rip), %rdi      # 0x793e
xorl %eax, %eax
callq 0x30f0
popq %rbx
popq %r14
popq %r15
jmp 0x5648
leaq 0x213d(%rip), %rdi      # 0x7943
movq %rbx, %rsi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x30f0
// File: /workspace/github_c_makefile_star2_O1/ethinethin[P]Secret/items.c
// Function: room_items
extern void room_items(int room_id)
{
	int i;
	for(i = 0; items[i].item_id != -1; i++) {
		if (items[i].location == room_id && items[i].hidden == NO)
			printf("%s\n",items[i].item_desc_floor);
	}
}

// Assembly:
cmpl $-0x1, 0x9399(%rip)     # 0xec10
je 0x58ad
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
leaq 0x93c2(%rip), %r14      # 0xec48
cmpl %ebx, -0x8(%r14)
jne 0x589c
cmpl $0x0, -0x10(%r14)
jne 0x589c
movq -0x20(%r14), %rdi
callq 0x3090
cmpl $-0x1, (%r14)
leaq 0x38(%r14), %r14
jne 0x5886
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/ethinethin[P]Secret/items.c
// Function: search
extern void search(int room_id)
{
	int i;
	int count;

	putchar('\n');

	if (search_desc())
		printf("You carefully search the area. ");

	for (count = 0, i = 0; items[i].item_id != -1; i++) {
		if (items[i].location == room_id && items[i].hidden == YES) {
			if (count > 0)
				printf("\nYou also found the ");
			else
				printf("You found the ");
			count++;
			if (items[i].item_adj != NULL)
				printf("%s ",items[i].item_adj);
			printf("%s! ",items[i].item_name);
			items[i].hidden = NO;
			items[i].location = -1;
			inventory[i] = 1;
		}
	}
	if (count == 0)
		printf("You didn't find anything.\n");
	else
		putchar('\n');
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edi, %ebx
movl $0xa, %edi
callq 0x3050
callq 0x5815
testl %eax, %eax
je 0x58dc
leaq 0x4f55(%rip), %rdi      # 0xa82a
xorl %eax, %eax
callq 0x30f0
cmpl $-0x1, 0x932d(%rip)     # 0xec10
je 0x5990
leaq 0xa330(%rip), %r12      # 0xfc20
leaq 0x9351(%rip), %rbp      # 0xec48
leaq 0x4f61(%rip), %r15      # 0xa85f
leaq 0x4f69(%rip), %r14      # 0xa86e
xorl %r13d, %r13d
cmpl %ebx, -0x8(%rbp)
jne 0x5966
cmpl $0x1, -0x10(%rbp)
jne 0x5966
testl %r13d, %r13d
movq %r15, %rdi
leaq 0x4f2a(%rip), %rax      # 0xa84a
cmovgq %rax, %rdi
xorl %eax, %eax
callq 0x30f0
movq -0x28(%rbp), %rsi
testq %rsi, %rsi
je 0x5942
leaq 0x201d(%rip), %rdi      # 0x7958
xorl %eax, %eax
callq 0x30f0
incl %r13d
movq -0x30(%rbp), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x30f0
movl $0x0, -0x10(%rbp)
movl $0xffffffff, -0x8(%rbp) # imm = 0xFFFFFFFF
movb $0x1, (%r12)
incq %r12
cmpl $-0x1, (%rbp)
leaq 0x38(%rbp), %rbp
jne 0x5908
testl %r13d, %r13d
je 0x5990
movl $0xa, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3050
leaq 0x4f7d(%rip), %rdi      # 0xa914
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3090
// File: /workspace/github_c_makefile_star2_O1/ethinethin[P]Secret/items.c
// Function: list_inv
extern void list_inv(void)
{
	int i;
	int count;

	printf("\nInventory:\n");
	for (count = 0, i = 0; items[i].item_id != -1; i++) {
		if (inventory[i] == YES) {
			count++;
			putchar('\t');
			if (items[i].item_adj != NULL)
				printf("%s ",items[i].item_adj);
			printf("%s\n",items[i].item_name);
		}
	}
	if (count == 0)
		printf("\tnothing.\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
leaq 0x4f76(%rip), %rdi      # 0xa92e
callq 0x3090
cmpl $-0x1, 0x924c(%rip)     # 0xec10
je 0x5a27
leaq 0xa253(%rip), %r14      # 0xfc20
leaq 0x9244(%rip), %r15      # 0xec18
leaq 0x1f7d(%rip), %rbx      # 0x7958
xorl %ebp, %ebp
cmpb $0x1, (%r14)
jne 0x5a0a
movl $0x9, %edi
callq 0x3050
movq 0x8(%r15), %rsi
testq %rsi, %rsi
je 0x5a00
movq %rbx, %rdi
xorl %eax, %eax
callq 0x30f0
incl %ebp
movq (%r15), %rdi
callq 0x3090
incq %r14
cmpl $-0x1, 0x30(%r15)
leaq 0x38(%r15), %r15
jne 0x59dd
testl %ebp, %ebp
je 0x5a27
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4f0c(%rip), %rdi      # 0xa93a
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x3090