LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: main
int main(int argc, char **argv)
{
    if (argc < 2) FAILED(1, "");

    char *profile = NULL, *bookmark = NULL;
    unsigned int flag = 0x0;
    int c = 0;

    while ((c = getopt(argc, argv, "p:utcbsd")) != -1) {
        switch (c) {
            case 'p': /* profile path */
                flag |= FLAG_P;
                profile = strdup(optarg);
                break;
            case 'u': /* url */
                flag |= FLAG_U;
                break;
            case 't': /* title */
                flag |= FLAG_T;
                break;
            case 'c': /* current session */
                flag |= FLAG_C;
                break;
            case 'b': /* bookmark */
                flag |= FLAG_B;
                break;
            case 's': /* session json */
                flag |= FLAG_S;
                break;
            case 'd': /* bookmark json */
                flag |= FLAG_D;
                break;
            case '?':
                if (optopt == 'p')
                    FAILED(1, "");
                break;
            default:
                break;
        }
    }

    if (!profile)
        profile = get_firefox_profile();

    if (flag & (FLAG_U | FLAG_T | FLAG_C | FLAG_S))
        get_tabs(profile, flag);

    if (flag & (FLAG_B | FLAG_D)) {
        bookmark = get_bookmark_file(profile);
        get_bookmarks(bookmark, flag);
        free(bookmark);
    }

    free(profile);
    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x2, %edi
jl 0xaf76
movq %rsi, %r14
movl %edi, %r15d
movq $0x0, (%rsp)
leaq 0x7197(%rip), %r12      # 0x1201c
movq 0xb144(%rip), %r13      # 0x15fd0
leaq 0x7171(%rip), %rbx      # 0x12004
xorl %ebp, %ebp
movl %r15d, %edi
movq %r14, %rsi
movq %r12, %rdx
callq 0x11c0
cmpl $0x62, %eax
jg 0xaeb7
cmpl $0x3f, %eax
je 0xaee0
cmpl $0x62, %eax
jne 0xaefb
orl $0x10, %ebp
jmp 0xae95
leal -0x70(%rax), %ecx
cmpl $0x5, %ecx
ja 0xaeec
movslq (%rbx,%rcx,4), %rax
addq %rbx, %rax
jmpq *%rax
orl $0x1, %ebp
movq 0xb0ee(%rip), %rax      # 0x15fc0
movq (%rax), %rdi
callq 0x1200
movq %rax, (%rsp)
jmp 0xae95
cmpl $0x70, (%r13)
jne 0xae95
jmp 0xaf76
cmpl $0x63, %eax
je 0xaf11
cmpl $0x64, %eax
jne 0xae95
orl $0x40, %ebp
jmp 0xae95
cmpl $-0x1, %eax
jne 0xae95
jmp 0xaf19
orl $0x4, %ebp
jmp 0xae95
orl $0x2, %ebp
jmp 0xae95
orl $0x20, %ebp
jmp 0xae95
orl $0x8, %ebp
jmp 0xae95
movq (%rsp), %rbx
testq %rbx, %rbx
jne 0xaf2a
callq 0xafe7
movq %rax, %rbx
testb $0x2e, %bpl
je 0xaf3a
movq %rbx, %rdi
movl %ebp, %esi
callq 0xb143
testb $0x50, %bpl
je 0xaf5d
movq %rbx, %rdi
callq 0xb23b
movq %rax, %r14
movq %rax, %rdi
movl %ebp, %esi
callq 0xb3a9
movq %r14, %rdi
callq 0x1230
movq %rbx, %rdi
callq 0x1230
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xaf85
movl $0x1, %edi
callq 0x11e0
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: usage
static void usage(void)
{
    printf("Usage fflz4:\n");
    printf("-u\tSession urls\n");
    printf("-t\tSession titles\n");
    printf("-c\tActive title & url. Can be limited with -u or -t\n");
    printf("-b\tBookmarks title & url saved in toolbar. Can be limited with -u or -t\n");
    printf("-s\tRaw session json\n");
    printf("-d\tRaw bookmarks json\n");
    printf("-p\t(Optional) Provide path to firefox profile. Default: /home/<user>/.mozilla/firefox/<xxxxxx.default>/\n");
}

// Assembly:
pushq %rax
leaq 0x729c(%rip), %rdi      # 0x12229
callq 0x1050
leaq 0x729d(%rip), %rdi      # 0x12236
callq 0x1050
leaq 0x72a1(%rip), %rdi      # 0x12246
callq 0x1050
leaq 0x72a7(%rip), %rdi      # 0x12258
callq 0x1050
leaq 0x72cf(%rip), %rdi      # 0x1228c
callq 0x1050
leaq 0x730b(%rip), %rdi      # 0x122d4
callq 0x1050
leaq 0x7313(%rip), %rdi      # 0x122e8
callq 0x1050
leaq 0x731d(%rip), %rdi      # 0x122fe
popq %rax
jmp 0x1050
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: get_firefox_profile
char *get_firefox_profile(void)
{
    char *home = NULL, *source = NULL, *result_path = NULL;
    char path[4096] = {0}, profile[256] = {0};
    size_t SIZE = 0;
    int len = 0;

    home = getenv("HOME");
    if (!home) FAILED(0, "Get $HOME failed\n");

    sprintf(path, "%s/.mozilla/firefox/profiles.ini", home);
    source = get_file_content(path, "r", 0, &SIZE);

    /* get firefox profile */
    for (const char *tok = strtok(source, "\n"); tok && *tok; tok = strtok(NULL, "\n")) {
        if (strstr(tok, "Path")) {
            char *r = strstr(tok, "=");
            size_t pos = r-tok+1, len = strlen(tok);
            size_t j = 0;
            for (size_t i = pos; i < len; ++i) {
                profile[j++] = tok[i];
            }
            profile[j] = '\0';
            break;
        }
    }

    if (strlen(profile))
        len = asprintf(&result_path, "%s/.mozilla/firefox/%s/", home, profile);

    if (!len) FAILED(0, "Get profile path failed\n");

    free(source);
    return result_path;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1110, %rsp           # imm = 0x1110
movq $0x0, (%rsp)
leaq 0x110(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x10c0
leaq 0x10(%rsp), %rdi
movl $0x100, %edx            # imm = 0x100
xorl %esi, %esi
callq 0x10c0
leaq 0x7048(%rip), %rdi      # 0x12073
callq 0x1030
testq %rax, %rax
je 0xb13e
movq %rax, %rbx
leaq 0x7047(%rip), %rsi      # 0x1208a
leaq 0x110(%rsp), %r14
movq %r14, %rdi
movq %rax, %rdx
xorl %eax, %eax
callq 0x11d0
leaq 0x716d(%rip), %rsi      # 0x121cc
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
xorl %edx, %edx
callq 0xb588
movq %rax, %r14
leaq 0x7131(%rip), %rsi      # 0x121a9
movq %rax, %rdi
callq 0x11b0
testq %rax, %rax
je 0xb0be
movq %rax, %r15
leaq 0x701c(%rip), %r12      # 0x120ab
leaq 0x7113(%rip), %r13      # 0x121a9
cmpb $0x0, (%r15)
je 0xb0be
movq %r15, %rdi
movq %r12, %rsi
callq 0x1210
testq %rax, %rax
jne 0xb0c3
xorl %edi, %edi
movq %r13, %rsi
callq 0x11b0
movq %rax, %r15
testq %rax, %rax
jne 0xb096
callq 0x1250
movq %r15, %rdi
movl $0x3d, %esi
callq 0x10b0
movq %rax, %r12
subq %r15, %r12
movq %r15, %rdi
callq 0x10a0
incq %r12
xorl %ecx, %ecx
cmpq %rax, %r12
jae 0xb0f8
movb (%r15,%r12), %dl
movb %dl, 0x10(%rsp,%rcx)
incq %rcx
incq %r12
jmp 0xb0e3
movb $0x0, 0x10(%rsp,%rcx)
cmpb $0x0, 0x10(%rsp)
je 0xb0be
leaq 0x6fa5(%rip), %rsi      # 0x120b0
movq %rsp, %rdi
leaq 0x10(%rsp), %rcx
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1180
testl %eax, %eax
je 0xb0be
movq %r14, %rdi
callq 0x1230
movq (%rsp), %rax
addq $0x1110, %rsp           # imm = 0x1110
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x1275
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: get_tabs
void get_tabs(const char *path, const unsigned int flag)
{
    cJSON *json = NULL;
    char *buf = NULL, *result = NULL;
    int len = 0;

    len = path[strlen(path)-1] == '/' ? asprintf(&buf, "%s%s/%s", path, SESSION, TABS) : asprintf(&buf, "%s/%s/%s", path, SESSION, TABS);
    if (!len) FAILED(0, "Not enough memory\n");

    result = extract_jsonlz4(buf);
    if (!result) FAILED(0, "Failed to read jsonlz4 at: %s\n", buf);

    json = cJSON_Parse(result);
    if (!json) goto cleanup;

    if (flag & FLAG_S) {
        char *js = cJSON_Print(json);
        fprintf(stdout, "%s\n", js);
        free(js);
        goto cleanup;
    }

    const cJSON *windows = cJSON_GetObjectItemCaseSensitive(json, "windows");
    if (!cJSON_IsArray(windows)) goto cleanup;

    print_tabs(windows, flag);

cleanup:
    if (json) cJSON_Delete(json);
    free(buf);
    free(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movq %rsp, %r14
movq $0x0, (%r14)
callq 0x10a0
cmpb $0x2f, -0x1(%rbx,%rax)
leaq 0x6ff6(%rip), %rax      # 0x12160
leaq 0x6ff7(%rip), %rsi      # 0x12168
cmoveq %rax, %rsi
leaq 0x7087(%rip), %rcx      # 0x12203
leaq 0x7095(%rip), %r8       # 0x12218
movq %r14, %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1180
testl %eax, %eax
je 0xb236
movq (%rsp), %rdi
callq 0xb4fe
movq %rax, %rbx
movq %rax, %rdi
callq 0xf1f4
testq %rax, %rax
je 0xb21a
movq %rax, %r14
testb $0x20, %bpl
jne 0xb1e4
leaq 0x6fb0(%rip), %rsi      # 0x12171
movq %r14, %rdi
callq 0xf9f9
movq %rax, %r15
movq %rax, %rdi
callq 0x10c42
testl %eax, %eax
je 0xb212
movq %r15, %rdi
movl %ebp, %esi
callq 0xb62a
jmp 0xb212
movq %r14, %rdi
callq 0xf1fd
movq %rax, %r15
movq 0xadc2(%rip), %rax      # 0x15fb8
movq (%rax), %rdi
leaq 0x6fae(%rip), %rsi      # 0x121ae
movq %r15, %rdx
xorl %eax, %eax
callq 0x1100
movq %r15, %rdi
callq 0x1230
movq %r14, %rdi
callq 0xec68
movq (%rsp), %rdi
callq 0x1230
movq %rbx, %rdi
callq 0x1230
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
callq 0x129a
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: get_bookmark_file
char *get_bookmark_file(const char *path)
{
    char *buf = NULL, *result = NULL, *p = NULL;
    int len = 0;
    char filep[4096] = {0};
    time_t t1 = 0, t2 = -1;
    struct dirent *entry;
    DIR *dp;

    len = path[strlen(path)-1] == '/'? asprintf(&buf, "%s%s/", path, BOOKMARK) : asprintf(&buf, "%s/%s/", path, BOOKMARK);
    if (!len) FAILED(0, "Not enough memory\n");

    dp = opendir(buf);
    if (!dp) FAILED(0, "Open directory failed at: %s\n", buf);

    while ((entry = readdir(dp))) {
        if (strstr(entry->d_name, "bookmarks")) {
            sprintf(filep, "%s%s", buf, entry->d_name);
            t1 = get_last_modified(filep);
            if (t2 == -1) {
                t2 = t1;
                p = filep;
            }
            else if (t1 > t2) {
                t2 = t1;
                p = filep;
            }
        }
    }

    result = strdup(p);
    if (!result) FAILED(0, "Get bookmark file failed\n");

    closedir(dp);
    free(buf);
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10a8, %rsp           # imm = 0x10A8
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq $0x0, (%r15)
leaq 0xa0(%rsp), %rbx
movl $0x1000, %edx           # imm = 0x1000
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10c0
movq %r14, %rdi
callq 0x10a0
cmpb $0x2f, -0x1(%r14,%rax)
leaq 0x6e5a(%rip), %rax      # 0x120e1
leaq 0x6e59(%rip), %rsi      # 0x120e7
cmoveq %rax, %rsi
leaq 0x6f5a(%rip), %rcx      # 0x121f3
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x1180
testl %eax, %eax
je 0xb395
movq 0x8(%rsp), %rdi
callq 0x1090
testq %rax, %rax
je 0xb39a
movq %rax, %r14
movq %rax, %rdi
callq 0x1150
testq %rax, %rax
je 0xb35b
movq %rax, %r13
movq $-0x1, %rbp
leaq 0x6e26(%rip), %r12      # 0x1210c
xorl %r15d, %r15d
addq $0x13, %r13
movq %r13, %rdi
movq %r12, %rsi
callq 0x1210
testq %rax, %rax
je 0xb349
movq 0x8(%rsp), %rdx
movq %rbx, %rdi
leaq 0x6e0a(%rip), %rsi      # 0x12116
movq %r13, %rcx
xorl %eax, %eax
callq 0x11d0
movq %rbx, %rdi
leaq 0x10(%rsp), %rsi
callq 0x1120
testl %eax, %eax
jne 0xb32e
movq 0x68(%rsp), %rax
jmp 0xb330
xorl %eax, %eax
cmpq $-0x1, %rbp
je 0xb343
cmpq %rbp, %rax
cmovgq %rax, %rbp
cmovgq %rbx, %r15
jmp 0xb349
movq %rax, %rbp
movq %rbx, %r15
movq %r14, %rdi
callq 0x1150
movq %rax, %r13
testq %rax, %rax
jne 0xb2e9
jmp 0xb35e
xorl %r15d, %r15d
movq %r15, %rdi
callq 0x1200
testq %rax, %rax
je 0xb3a4
movq %rax, %rbx
movq %r14, %rdi
callq 0x10d0
movq 0x8(%rsp), %rdi
callq 0x1230
movq %rbx, %rax
addq $0x10a8, %rsp           # imm = 0x10A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x130b
leaq 0x8(%rsp), %rdi
callq 0x12e4
callq 0x12bf
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: get_bookmarks
void get_bookmarks(const char *path, const unsigned int flag)
{
    cJSON *json = NULL;
    char *result = NULL;

    result = extract_jsonlz4(path);
    if (!result) FAILED(0, "Failed to read jsonlz4 at: %s\n", path);

    json = cJSON_Parse(result);
    if (!json) goto cleanup;

    if (flag & FLAG_D) {
        char *js = cJSON_Print(json);
        fprintf(stdout, "%s\n", js);
        free(js);
        goto cleanup;
    }

    const cJSON *children = cJSON_GetObjectItemCaseSensitive(json, "children");
    if (!cJSON_IsArray(children)) goto cleanup;

    const cJSON *child = NULL;

    /* get bookmarks toolbar */
    cJSON_ArrayForEach(child, children) {
        const cJSON *root = cJSON_GetObjectItemCaseSensitive(child, "root");
        if (cJSON_IsString(root)) {
            if (!strcmp(root->valuestring, "toolbarFolder")) {
                children = cJSON_GetObjectItemCaseSensitive(child, "children");
                break;
            }
        }
    }

    if (cJSON_IsArray(children))
        print_bookmarks(child, children, flag);
    else
        FAILED(0, "Failed to get bookmarks toolbar\n");

cleanup:
    if (json) cJSON_Delete(json);
    free(result);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebp
callq 0xb4fe
movq %rax, %rbx
movq %rax, %rdi
callq 0xf1f4
testq %rax, %rax
je 0xb4bd
movq %rax, %r14
testb $0x40, %bpl
jne 0xb454
leaq 0x6dd3(%rip), %rsi      # 0x121b2
movq %r14, %rdi
callq 0xf9f9
movq %rax, %r15
movq %rax, %rdi
callq 0x10c42
testl %eax, %eax
je 0xb4b5
testq %r15, %r15
je 0xb484
movq 0x10(%r15), %r12
testq %r12, %r12
je 0xb49f
movl %ebp, 0x4(%rsp)
leaq 0x6da0(%rip), %r13      # 0x121bb
movq %r12, %rdi
movq %r13, %rsi
callq 0xf9f9
movq %rax, %rbp
movq %rax, %rdi
callq 0xebb2
testl %eax, %eax
je 0xb449
movq 0x20(%rbp), %rdi
leaq 0x6d80(%rip), %rsi      # 0x121c0
callq 0x10f0
testl %eax, %eax
je 0xb489
movq (%r12), %r12
testq %r12, %r12
jne 0xb41b
jmp 0xb49b
movq %r14, %rdi
callq 0xf1fd
movq %rax, %r15
movq 0xab52(%rip), %rax      # 0x15fb8
movq (%rax), %rdi
leaq 0x6d3e(%rip), %rsi      # 0x121ae
movq %r15, %rdx
xorl %eax, %eax
callq 0x1100
movq %r15, %rdi
callq 0x1230
jmp 0xb4b5
xorl %r15d, %r15d
jmp 0xb49f
leaq 0x6d22(%rip), %rsi      # 0x121b2
movq %r12, %rdi
callq 0xf9f9
movq %rax, %r15
movl 0x4(%rsp), %ebp
movq %r15, %rdi
callq 0x10c42
testl %eax, %eax
je 0xb4d3
movq %r15, %rsi
movl %ebp, %edx
callq 0xb953
movq %r14, %rdi
callq 0xec68
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1230
callq 0x1330
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: extract_jsonlz4
char *extract_jsonlz4(const char *path)
{
    size_t SIZE = 0;
    unsigned int dst_size;
    const int hdr_size = sizeof(unsigned int);
    char *source = NULL, *result = NULL;

    /* read file */
    /* skip "mozLz40\0" header */
    source = get_file_content(path, "rb", 8, &SIZE);

    memcpy(&dst_size, source, 4);
    if (dst_size > INT_MAX) FAILED(0, "Invalid size in header: 0x%x\n", dst_size);

    result = calloc(dst_size+1, sizeof(char));
    if (!result) FAILED(0, "Not enough memory\n");

    int osize = LZ4_decompress_safe(source + hdr_size, result, SIZE - hdr_size, dst_size);
    if (osize < 0) FAILED(0, "Corrupt input at byte %d\n", -osize);

    free(source);
    return result;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0x6b0b(%rip), %rsi      # 0x12025
movl $0x8, %edx
callq 0xb588
movl (%rax), %r14d
testl %r14d, %r14d
js 0xb574
movq %rax, %rbx
leaq 0x1(%r14), %rdi
movl $0x1, %esi
callq 0x10e0
testq %rax, %rax
je 0xb57c
movq %rax, %r15
leaq 0x4(%rbx), %rdi
movl 0x8(%rsp), %edx
addl $-0x4, %edx
movq %rax, %rsi
movl %r14d, %ecx
callq 0x844d
testl %eax, %eax
js 0xb581
movq %rbx, %rdi
callq 0x1230
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
movl %r14d, %edi
callq 0x139f
callq 0x137a
movl %eax, %edi
callq 0x1355
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/fflz4.c
// Function: print_bookmarks
void print_bookmarks(const cJSON *child, const cJSON *children, const unsigned int flag)
{
    cJSON_ArrayForEach(child, children) {
        const cJSON *url = cJSON_GetObjectItemCaseSensitive(child, "uri");
        const cJSON *deep = cJSON_GetObjectItemCaseSensitive(child, "children");

        if (cJSON_IsString(url)) {
            const cJSON *title = cJSON_GetObjectItemCaseSensitive(child, "title");

            if (((flag & (FLAG_T | FLAG_U)) == 0) && cJSON_IsString(title))
                fprintf(stdout, "%s\n%s\n\n", title->valuestring, url->valuestring);
            if (flag & FLAG_U)
                fprintf(stdout, "%s\n", url->valuestring);
            if ((flag & FLAG_T) && cJSON_IsString(title))
                fprintf(stdout, "%s\n", title->valuestring);
        }
        else if (cJSON_IsArray(deep)) {
            print_bookmarks(child, deep, flag);
        }
    }
}

// Assembly:
testq %rsi, %rsi
je 0xba73
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq 0x10(%rsi), %r14
testq %r14, %r14
je 0xba65
movl %edx, %ebx
leaq 0x6872(%rip), %r15      # 0x121ef
leaq 0x682e(%rip), %r12      # 0x121b2
movq %r14, %rdi
movq %r15, %rsi
callq 0xf9f9
movq %rax, %r13
movq %r14, %rdi
movq %r12, %rsi
callq 0xf9f9
movq %rax, %rbp
movq %r13, %rdi
callq 0xebb2
testl %eax, %eax
je 0xba43
movq %r14, %rdi
leaq 0x67df(%rip), %rsi      # 0x12199
callq 0xf9f9
movq %rax, %rbp
testb $0x6, %bl
jne 0xb9f3
movq %rbp, %rdi
callq 0xebb2
testl %eax, %eax
je 0xb9f3
movq 0xa5de(%rip), %rax      # 0x15fb8
movq (%rax), %rdi
movq 0x20(%rbp), %rdx
movq 0x20(%r13), %rcx
leaq 0x67b7(%rip), %rsi      # 0x121a3
xorl %eax, %eax
callq 0x1100
testb $0x2, %bl
je 0xba14
movq 0xa5b9(%rip), %rax      # 0x15fb8
movq (%rax), %rdi
movq 0x20(%r13), %rdx
leaq 0x67a1(%rip), %rsi      # 0x121ae
xorl %eax, %eax
callq 0x1100
testb $0x4, %bl
je 0xba59
movq %rbp, %rdi
callq 0xebb2
testl %eax, %eax
je 0xba59
movq 0xa58c(%rip), %rax      # 0x15fb8
movq (%rax), %rdi
movq 0x20(%rbp), %rdx
leaq 0x6774(%rip), %rsi      # 0x121ae
xorl %eax, %eax
callq 0x1100
jmp 0xba59
movq %rbp, %rdi
callq 0x10c42
testl %eax, %eax
je 0xba59
movq %rbp, %rsi
movl %ebx, %edx
callq 0xb953
movq (%r14), %r14
testq %r14, %r14
jne 0xb984
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/./lib/lz4/lz4.c
// Function: LZ4_loadDict
int LZ4_loadDict (LZ4_stream_t* LZ4_dict, const char* dictionary, int dictSize)
{
    LZ4_stream_t_internal* dict = &LZ4_dict->internal_donotuse;
    const tableType_t tableType = byU32;
    const BYTE* p = (const BYTE*)dictionary;
    const BYTE* const dictEnd = p + dictSize;
    const BYTE* base;

    DEBUGLOG(4, "LZ4_loadDict (%i bytes from %p into %p)", dictSize, dictionary, LZ4_dict);

    /* It's necessary to reset the context,
     * and not just continue it with prepareTable()
     * to avoid any risk of generating overflowing matchIndex
     * when compressing using this dictionary */
    LZ4_resetStream(LZ4_dict);

    /* We always increment the offset by 64 KB, since, if the dict is longer,
     * we truncate it to the last 64k, and if it's shorter, we still want to
     * advance by a whole window length so we can provide the guarantee that
     * there are only valid offsets in the window, which allows an optimization
     * in LZ4_compress_fast_continue() where it uses noDictIssue even when the
     * dictionary isn't a full 64k. */
    dict->currentOffset += 64 KB;

    if (dictSize < (int)HASH_UNIT) {
        return 0;
    }

    if ((dictEnd - p) > 64 KB) p = dictEnd - 64 KB;
    base = dictEnd - dict->currentOffset;
    dict->dictionary = p;
    dict->dictSize = (U32)(dictEnd - p);
    dict->tableType = tableType;

    while (p <= dictEnd-HASH_UNIT) {
        LZ4_putPosition(p, dict->hashTable, tableType, base);
        p+=3;
    }

    return (int)dict->dictSize;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
xorl %ebx, %ebx
movl $0x4020, %edx           # imm = 0x4020
xorl %esi, %esi
callq 0x10c0
movl $0x10000, 0x4000(%r14) # imm = 0x10000
cmpl $0x8, %ebp
jl 0xc87e
movl %ebp, %esi
leaq (%r15,%rsi), %rbx
cmpl $0x10001, %ebp          # imm = 0x10001
leaq -0x10000(%r15,%rsi), %rax
cmovbq %r15, %rax
movq %rax, 0x4008(%r14)
subl %eax, %ebx
movl %ebx, 0x4018(%r14)
movw $0x2, 0x4006(%r14)
leaq (%r15,%rsi), %rcx
addq $-0x8, %rcx
cmpq %rcx, %rax
ja 0xc87e
cmpq $0x10001, %rsi          # imm = 0x10001
movl $0x10000, %edx          # imm = 0x10000
cmovaeq %rsi, %rdx
subl %ebp, %edx
movabsq $-0x30e4432345000000, %rsi # imm = 0xCF1BBCDCBB000000
movq (%rax), %rdi
imulq %rsi, %rdi
shrq $0x34, %rdi
movl %edx, (%r14,%rdi,4)
addq $0x3, %rax
addl $0x3, %edx
cmpq %rcx, %rax
jbe 0xc863
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/./lib/lz4/lz4.c
// Function: LZ4_renormDictT
static void LZ4_renormDictT(LZ4_stream_t_internal* LZ4_dict, int nextSize)
{
    assert(nextSize >= 0);
    if (LZ4_dict->currentOffset + (unsigned)nextSize > 0x80000000) {   /* potential ptrdiff_t overflow (32-bits mode) */
        /* rescale hash table */
        U32 const delta = LZ4_dict->currentOffset - 64 KB;
        const BYTE* dictEnd = LZ4_dict->dictionary + LZ4_dict->dictSize;
        int i;
        DEBUGLOG(4, "LZ4_renormDictT");
        for (i=0; i<LZ4_HASH_SIZE_U32; i++) {
            if (LZ4_dict->hashTable[i] < delta) LZ4_dict->hashTable[i]=0;
            else LZ4_dict->hashTable[i] -= delta;
        }
        LZ4_dict->currentOffset = 64 KB;
        if (LZ4_dict->dictSize > 64 KB) LZ4_dict->dictSize = 64 KB;
        LZ4_dict->dictionary = dictEnd - LZ4_dict->dictSize;
    }
}

// Assembly:
movl 0x4000(%rdi), %edx
addl %edx, %esi
cmpl $0x80000001, %esi       # imm = 0x80000001
jb 0xc976
movq 0x4008(%rdi), %rax
movl 0x4018(%rdi), %ecx
addl $0xffff0000, %edx       # imm = 0xFFFF0000
movd %edx, %xmm0
pshufd $0x0, %xmm0, %xmm0      # xmm0 = xmm0[0,0,0,0]
xorl %edx, %edx
movdqa 0x5a63(%rip), %xmm1     # 0x12370
movdqa %xmm0, %xmm2
pxor %xmm1, %xmm2
movdqu (%rdi,%rdx,4), %xmm3
movdqa %xmm3, %xmm4
pxor %xmm1, %xmm4
pcmpgtd %xmm2, %xmm4
psubd %xmm0, %xmm3
pand %xmm4, %xmm3
movdqu %xmm3, (%rdi,%rdx,4)
addq $0x4, %rdx
cmpq $0x1000, %rdx           # imm = 0x1000
jne 0xc915
addq %rcx, %rax
movl $0x10000, 0x4000(%rdi)  # imm = 0x10000
movl 0x4018(%rdi), %ecx
cmpl $0x10001, %ecx          # imm = 0x10001
jb 0xc96a
movl $0x10000, 0x4018(%rdi)  # imm = 0x10000
movl $0x10000, %ecx          # imm = 0x10000
movl %ecx, %ecx
subq %rcx, %rax
movq %rax, 0x4008(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O3/Aethlas[P]fflz4/./lib/lz4/lz4.c
// Function: LZ4_memcpy_using_offset
LZ4_FORCE_O2_INLINE_GCC_PPC64LE void
LZ4_memcpy_using_offset(BYTE* dstPtr, const BYTE* srcPtr, BYTE* dstEnd, const size_t offset)
{
    BYTE v[8];

    assert(dstEnd >= dstPtr + MINMATCH);
    LZ4_write32(dstPtr, 0);   /* silence an msan warning when offset==0 */

    switch(offset) {
    case 1:
        memset(v, *srcPtr, 8);
        break;
    case 2:
        memcpy(v, srcPtr, 2);
        memcpy(&v[2], srcPtr, 2);
        memcpy(&v[4], &v[0], 4);
        break;
    case 4:
        memcpy(v, srcPtr, 4);
        memcpy(&v[4], srcPtr, 4);
        break;
    default:
        LZ4_memcpy_using_offset_base(dstPtr, srcPtr, dstEnd, offset);
        return;
    }

    memcpy(dstPtr, v, 8);
    dstPtr += 8;
    while (dstPtr < dstEnd) {
        memcpy(dstPtr, v, 8);
        dstPtr += 8;
    }
}

// Assembly:
movl $0x0, (%rdi)
cmpq $0x4, %rcx
je 0xeb14
cmpq $0x2, %rcx
je 0xeb08
cmpq $0x1, %rcx
jne 0xeb26
movzbl (%rsi), %eax
imull $0x1010101, %eax, %eax  # imm = 0x1010101
jmp 0xeb16
movzwl (%rsi), %ecx
movl %ecx, %eax
shll $0x10, %eax
orl %ecx, %eax
jmp 0xeb16
movl (%rsi), %eax
movl %eax, (%rdi)
movl %eax, 0x4(%rdi)
addq $0x8, %rdi
cmpq %rdx, %rdi
jb 0xeb16
jmp 0xeb8c
cmpq $0x7, %rcx
ja 0xeb68
movb (%rsi), %al
movb %al, (%rdi)
movb 0x1(%rsi), %al
movb %al, 0x1(%rdi)
movb 0x2(%rsi), %al
movb %al, 0x2(%rdi)
movb 0x3(%rsi), %al
movb %al, 0x3(%rdi)
leaq 0x3847(%rip), %rax      # 0x12390
movl (%rax,%rcx,4), %r8d
leaq (%rsi,%r8), %rax
movl (%rsi,%r8), %esi
movl %esi, 0x4(%rdi)
leaq 0x3851(%rip), %rsi      # 0x123b0
movslq (%rsi,%rcx,4), %rcx
subq %rcx, %rax
jmp 0xeb75
movq (%rsi), %rax
movq %rax, (%rdi)
addq $0x8, %rsi
movq %rsi, %rax
addq $0x8, %rdi
movq (%rax), %rcx
movq %rcx, (%rdi)
addq $0x8, %rdi
addq $0x8, %rax
cmpq %rdx, %rdi
jb 0xeb79
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/ender672[P]liboil/oil_libjpeg.c
// Function: oil_libjpeg_init
int oil_libjpeg_init(struct oil_libjpeg *ol,
	struct jpeg_decompress_struct *dinfo, int out_width, int out_height)
{
	int ret;
	enum oil_colorspace cs;

	ol->dinfo = dinfo;

	cs = jpeg_cs_to_oil(dinfo->out_color_space);
	if (cs == OIL_CS_UNKNOWN) {
		return -1;
	}

	ol->inbuf = malloc(dinfo->output_width * dinfo->output_components);
	if (!ol->inbuf) {
		return -2;
	}

	ret = oil_scale_init(&ol->os, dinfo->output_height, out_height,
		dinfo->output_width, out_width, cs);
	if (ret!=0) {
		free(ol->inbuf);
		return ret;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, 0x58(%rdi)
movl 0x40(%rsi), %eax
decl %eax
movl $0xffffffff, %r12d      # imm = 0xFFFFFFFF
cmpl $0x8, %eax
ja 0x4744
movl %ecx, %r14d
movl $0x14b, %ecx            # imm = 0x14B
btl %eax, %ecx
jae 0x4744
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %rbx
movl %eax, %eax
leaq 0x1abb(%rip), %rcx      # 0x61a4
movl (%rcx,%rax,4), %r12d
movl 0x88(%rsi), %r13d
movl 0x94(%rsi), %edi
imull %r13d, %edi
callq 0x20e0
movq %rax, 0x60(%rbx)
testq %rax, %rax
je 0x4739
movl 0x8c(%r15), %esi
movq %rbx, %rdi
movl %r14d, %edx
movl %r13d, %ecx
movl %ebp, %r8d
movl %r12d, %r9d
callq 0x27f8
testl %eax, %eax
je 0x4741
movl %eax, %r12d
movq 0x60(%rbx), %rdi
callq 0x21b0
jmp 0x4744
movl $0xfffffffe, %r12d      # imm = 0xFFFFFFFE
jmp 0x4744
xorl %r12d, %r12d
movl %r12d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/ender672[P]liboil/oil_libjpeg.c
// Function: oil_libjpeg_read_scanline
void oil_libjpeg_read_scanline(struct oil_libjpeg *ol, unsigned char *outbuf)
{
	while (oil_scale_slots(&ol->os)) {
		jpeg_read_scanlines(ol->dinfo, &ol->inbuf, 1);
		oil_scale_in(&ol->os, ol->inbuf);
	}
	oil_scale_out(&ol->os, outbuf);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x2e1d
testl %eax, %eax
je 0x47c8
leaq 0x60(%r14), %r15
movq 0x58(%r14), %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2290
movq 0x60(%r14), %rsi
movq %r14, %rdi
callq 0x2e4f
movq %r14, %rdi
callq 0x2e1d
testl %eax, %eax
jne 0x479f
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3ad0
// File: /workspace/github_c_makefile_star2_O3/ender672[P]liboil/oil_libpng.c
// Function: oil_libpng_init
int oil_libpng_init(struct oil_libpng *ol, png_structp rpng, png_infop rinfo,
	int out_width, int out_height)
{
	int ret, in_width, in_height, buf_len;
	enum oil_colorspace cs;

	ol->rpng = rpng;
	ol->rinfo = rinfo;
	ol->in_vpos = 0;
	ol->inbuf = NULL;
	ol->inimage = NULL;

	cs = png_cs_to_oil(png_get_color_type(rpng, rinfo));
	if (cs == OIL_CS_UNKNOWN) {
		return -1;
	}

	in_width = png_get_image_width(rpng, rinfo);
	in_height = png_get_image_height(rpng, rinfo);
	ret = oil_scale_init(&ol->os, in_height, out_height, in_width,
		out_width, cs);
	if (ret!=0) {
		free(ol->inbuf);
		return ret;
	}

	buf_len = png_get_rowbytes(rpng, rinfo);
	switch (png_get_interlace_type(rpng, rinfo)) {
	case PNG_INTERLACE_NONE:
		ol->inbuf = malloc(buf_len);
		if (!ol->inbuf) {
			oil_scale_free(&ol->os);
			return -2;
		}
		break;
	case PNG_INTERLACE_ADAM7:
		ol->inimage = alloc_full_image_buf(in_height, buf_len);
		if (!ol->inimage) {
			oil_scale_free(&ol->os);
			return -2;
		}
		png_read_image(rpng, ol->inimage);
		break;
	}

	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r12d
movl %ecx, %r13d
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, 0x58(%rdi)
movq %rdx, 0x60(%rdi)
movl $0x0, 0x68(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rdi)
movq %rsi, %rdi
movq %rdx, %rsi
callq 0x2140
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpb $0x6, %al
ja 0x48ab
movzbl %al, %eax
movl $0x55, %ecx
btl %eax, %ecx
jae 0x48ab
leaq 0x70(%rbx), %rcx
movq %rcx, 0x8(%rsp)
leaq 0x198c(%rip), %rcx      # 0x61ec
movl (%rcx,%rax,4), %eax
movl %eax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2130
movl %eax, %ebp
movq %r14, %rdi
movq %r15, %rsi
callq 0x2300
movq %rbx, %rdi
movl %eax, 0x14(%rsp)
movl %eax, %esi
movl %r12d, %edx
movl %ebp, %ecx
movl %r13d, %r8d
movl (%rsp), %r9d
callq 0x27f8
testl %eax, %eax
je 0x48bc
movl %eax, %ebp
movq 0x8(%rsp), %rax
movq (%rax), %rdi
callq 0x21b0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x14(%rsp), %r13d
movq 0x8(%rsp), %r12
movq %r14, %rdi
movq %r15, %rsi
callq 0x2230
movq %rax, (%rsp)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2200
xorl %ebp, %ebp
cmpb $0x1, %al
je 0x4904
movzbl %al, %eax
testl %eax, %eax
jne 0x48ab
movslq (%rsp), %rdi
callq 0x20e0
movq %rax, (%r12)
testq %rax, %rax
jne 0x48ab
jmp 0x498b
movslq %r13d, %rdi
shlq $0x3, %rdi
callq 0x20e0
testq %rax, %rax
je 0x4983
movq %rax, %r15
testl %r13d, %r13d
jle 0x4947
movslq (%rsp), %r12
movl %r13d, %eax
movq %rax, 0x8(%rsp)
xorl %r13d, %r13d
movq %r12, %rdi
callq 0x20e0
movq %rax, (%r15,%r13,8)
testq %rax, %rax
je 0x495b
incq %r13
cmpq %r13, 0x8(%rsp)
jne 0x492c
movq %r15, 0x78(%rbx)
movq %r14, %rdi
movq %r15, %rsi
callq 0x2310
jmp 0x48ab
cmpq $0x2, %r13
jb 0x497b
decq %r13
movl %r13d, %r14d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x21b0
incq %r12
cmpq %r12, %r14
jne 0x496a
movq %r15, %rdi
callq 0x21b0
movq $0x0, 0x78(%rbx)
movq %rbx, %rdi
callq 0x2aaf
movl $0xfffffffe, %ebp       # imm = 0xFFFFFFFE
jmp 0x48ab
// File: /workspace/github_c_makefile_star2_O3/ender672[P]liboil/oil_libpng.c
// Function: oil_libpng_free
void oil_libpng_free(struct oil_libpng *ol)
{
	if (ol->inbuf) {
		free(ol->inbuf);
	}
	if (ol->inimage) {
		free_full_image_buf(ol->inimage, ol->os.in_height);
	}
	oil_scale_free(&ol->os);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rdi), %rdi
testq %rdi, %rdi
je 0x49cd
callq 0x21b0
movq 0x78(%rbx), %r14
testq %r14, %r14
je 0x49fa
movslq (%rbx), %r15
testq %r15, %r15
jle 0x49f2
xorl %r12d, %r12d
movq (%r14,%r12,8), %rdi
callq 0x21b0
incq %r12
cmpq %r12, %r15
jne 0x49e1
movq %r14, %rdi
callq 0x21b0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x2aaf
// File: /workspace/github_c_makefile_star2_O3/ender672[P]liboil/oil_libpng.c
// Function: oil_libpng_read_scanline
void oil_libpng_read_scanline(struct oil_libpng *ol, unsigned char *outbuf)
{
	switch (png_get_interlace_type(ol->rpng, ol->rinfo)) {
	case PNG_INTERLACE_NONE:
		read_scanline(ol);
		break;
	case PNG_INTERLACE_ADAM7:
		read_scanline_interlaced(ol);
		break;
	}
	oil_scale_out(&ol->os, outbuf);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x58(%rdi), %rdi
movq 0x60(%r14), %rsi
callq 0x2200
cmpb $0x1, %al
je 0x4a75
movzbl %al, %eax
testl %eax, %eax
je 0x4a4c
jmp 0x4a81
movq 0x58(%r14), %rdi
movq 0x70(%r14), %rsi
xorl %edx, %edx
callq 0x2060
movq 0x70(%r14), %rsi
movq %r14, %rdi
callq 0x2e4f
movq %r14, %rdi
callq 0x2e1d
testl %eax, %eax
jne 0x4a31
jmp 0x4a81
movq 0x78(%r14), %rax
movslq 0x68(%r14), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0x68(%r14)
movq (%rax,%rcx,8), %rsi
movq %r14, %rdi
callq 0x2e4f
movq %r14, %rdi
callq 0x2e1d
testl %eax, %eax
jne 0x4a5a
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x3ad0
nop
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: mtgp64_init
int mtgp64_init(mtgp64_ref_t *mtgp64,
		const mtgp64_params_ref_t *para, uint64_t seed) {
    int i;
    int size = para->mexp / 64 + 1;
    uint64_t hidden_seed;
    uint64_t tmp;
    mtgp64_status_ref_t *st;

    st = (mtgp64_status_ref_t *)malloc(sizeof(mtgp64_status_ref_t)
				     + sizeof(uint64_t) * size);
    if (st == NULL) {
	return -1;
    }
    hidden_seed = para->tbl[2] ^ (para->tbl[3] << 16);
    tmp = hidden_seed >> 32;
    tmp += tmp >> 16;
    tmp += tmp >> 8;
    memset(st->array, tmp & 0xff, sizeof(uint64_t) * size);
    mtgp64->params = *para;
    mtgp64->status = st;
    st->size = size;
    st->idx = size - 1;
    st->array[0] = seed;
    st->array[1] = hidden_seed;
    for (i = 1; i < size; i++) {
	st->array[i] ^= UINT64_C(6364136223846793005)
	    * (st->array[i - 1]
	       ^ (st->array[i - 1] >> 62)) + i;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movl (%rsi), %r13d
leal 0x3f(%r13), %eax
testl %r13d, %r13d
cmovnsl %r13d, %eax
movq %rdi, %r12
sarl $0x6, %eax
movslq %eax, %rbp
leaq 0x10(,%rbp,8), %rdi
callq 0x10d0
testq %rax, %rax
je 0x12d1
movq %rax, %r14
leal 0x1(%rbp), %eax
movl %eax, 0xc(%rsp)
leaq 0x8(,%rbp,8), %rdx
movq %r12, 0x10(%rsp)
movq 0x28(%r15), %r12
shlq $0x10, %r12
xorq 0x20(%r15), %r12
movq %r12, %rax
shrq $0x20, %rax
movq %r12, %rcx
shrq $0x30, %rcx
addq %rax, %rcx
movq %rcx, %rsi
shrq $0x8, %rsi
addl %ecx, %esi
movq %r14, %rdi
addq $0x8, %rdi
callq 0x1090
movl $0xe, %ecx
movq 0x10(%rsp), %rax
movq %rax, %rdi
movq %r15, %rsi
rep  movsq (%rsi), %es:(%rdi)
movl 0xc(%rsp), %ecx
movq %r14, 0x70(%rax)
movl %ecx, (%r14)
movl %ebp, 0x4(%r14)
movq %rbx, 0x8(%r14)
movq %r12, 0x10(%r14)
xorl %eax, %eax
cmpl $0x40, %r13d
jl 0x12d6
movl %ecx, %ecx
movl $0x1, %edx
movabsq $0x5851f42d4c957f2d, %rsi # imm = 0x5851F42D4C957F2D
movq %rbx, %rdi
shrq $0x3e, %rdi
xorq %rbx, %rdi
imulq %rsi, %rdi
addq %rdx, %rdi
xorq 0x8(%r14,%rdx,8), %rdi
movq %rdi, 0x8(%r14,%rdx,8)
incq %rdx
movq %rdi, %rbx
cmpq %rdx, %rcx
jne 0x12ac
jmp 0x12d6
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: mtgp64_print_idstring
void mtgp64_print_idstring(const mtgp64_ref_t *mtgp64, FILE *fp) {
    int i;
    fprintf(fp, "mtgp64:%d:", mtgp64->params.mexp);
    for (i = 0; i < 20; i++) {
	fprintf(fp, "%02x", (unsigned int)mtgp64->params.poly_sha1[i]);
    }
    fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl (%rdi), %edx
leaq 0x16ab(%rip), %rsi      # 0x3018
movq %rbx, %rdi
xorl %eax, %eax
callq 0x10b0
leaq 0x16a5(%rip), %r15      # 0x3023
xorl %r12d, %r12d
movzbl 0x58(%r14,%r12), %edx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x10b0
incq %r12
cmpq $0x14, %r12
jne 0x1981
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x10a0
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: mtgp64_genrand_uint64
static void next_state(mtgp64_ref_t *mtgp64) {
    uint64_t *array = mtgp64->status->array;
    int idx;
    int size = mtgp64->status->size;
    uint64_t x;
    uint64_t y;
    uint64_t r;
    uint32_t xh;
    uint32_t xl;
    uint32_t yh;
    uint32_t yl;

    mtgp64->status->idx += 1;
    if (mtgp64->status->idx >= size) {
	mtgp64->status->idx = 0;
    }
    idx = mtgp64->status->idx;
    x = (array[idx] & mtgp64->params.mask) ^ array[(idx + 1) % size];
    y = array[(idx + mtgp64->params.pos) % size];
    xh = (uint32_t)(x >> 32);
    xl = (uint32_t)(x & 0xffffffffU);
    yh = (uint32_t)(y >> 32);
    yl = (uint32_t)(y & 0xffffffffU);
    xh ^= xh << mtgp64->params.sh1;
    xl ^= xl << mtgp64->params.sh1;
    yh = xl ^ (yh >> mtgp64->params.sh2);
    yl = xh ^ (yl >> mtgp64->params.sh2);
    r = ((uint64_t)yh << 32) | yl;
    if (yl & 1) {
	r ^= mtgp64->params.tbl[0];
    }
    if (yl & 2) {
	r ^= mtgp64->params.tbl[1];
    }
    if (yl & 4) {
	r ^= mtgp64->params.tbl[2];
    }
    if (yl & 8) {
	r ^= mtgp64->params.tbl[3];
    }
    array[idx] = r;
}

// Assembly:
pushq %rbp
pushq %rbx
movq 0x70(%rdi), %rsi
movl (%rsi), %ecx
movl 0x4(%rsi), %eax
incl %eax
xorl %edx, %edx
cmpl %ecx, %eax
cmovll %eax, %edx
movl %edx, 0x4(%rsi)
movslq %edx, %r8
movq 0x50(%rdi), %r10
andq 0x8(%rsi,%r8,8), %r10
leal 0x1(%r8), %eax
cltd
idivl %ecx
movslq %edx, %rax
xorq 0x8(%rsi,%rax,8), %r10
movl 0x4(%rdi), %r9d
leal (%r9,%r8), %eax
cltd
idivl %ecx
movslq %edx, %rax
movq 0x8(%rsi,%rax,8), %rax
movq %r10, %rdx
shrq $0x20, %rdx
movb 0x8(%rdi), %cl
movl %edx, %r11d
shll %cl, %r11d
movq %rax, %rbx
shrq $0x20, %rbx
movl %r10d, %ebp
shll %cl, %ebp
movb 0xc(%rdi), %cl
shrl %cl, %ebx
xorl %ebp, %ebx
xorl %r10d, %ebx
shrl %cl, %eax
xorl %edx, %eax
xorl %r11d, %eax
shlq $0x20, %rbx
leaq (%rax,%rbx), %rcx
testb $0x1, %al
je 0x1a37
xorq 0x10(%rdi), %rcx
testb $0x2, %al
je 0x1a3f
xorq 0x18(%rdi), %rcx
testb $0x4, %al
je 0x1a47
xorq 0x20(%rdi), %rcx
testb $0x8, %al
je 0x1a4f
xorq 0x28(%rdi), %rcx
movq %rcx, 0x8(%rsi,%r8,8)
movq 0x70(%rdi), %rsi
movslq 0x4(%rsi), %rax
movq 0x8(%rsi,%rax,8), %rcx
addl %r9d, %eax
decl %eax
cltd
idivl (%rsi)
movslq %edx, %rax
movq 0x8(%rsi,%rax,8), %rax
movq %rax, %rdx
shrq $0x10, %rdx
xorq %rax, %rdx
movq %rdx, %rax
shrq $0x8, %rax
xorq %rdx, %rax
testb $0x1, %al
je 0x1a8d
xorq 0x30(%rdi), %rcx
testb $0x2, %al
je 0x1a95
xorq 0x38(%rdi), %rcx
testb $0x4, %al
je 0x1a9d
xorq 0x40(%rdi), %rcx
testb $0x8, %al
je 0x1aa5
xorq 0x48(%rdi), %rcx
movq %rcx, %rax
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: mtgp64_genrand_close1_open2
double mtgp64_genrand_close1_open2(mtgp64_ref_t *mtgp64) {
    union {
	uint64_t u;
	double d;
    } x;
    x.u = mtgp64_genrand_uint64(mtgp64);
    x.u = (x.u >> 12) | UINT64_C(0x3ff0000000000000);
    return x.d;
}

// Assembly:
pushq %rax
callq 0x19b5
shrq $0xc, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
orq %rax, %rcx
movq %rcx, %xmm0
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: mtgp64_genrand_open_open
double mtgp64_genrand_open_open(mtgp64_ref_t *mtgp64) {
    union {
	uint64_t u;
	double d;
    } x;
    x.u = mtgp64_genrand_uint64(mtgp64);
    x.u = (x.u >> 12) | UINT64_C(0x3ff0000000000001);
    return x.d - 1.0;
}

// Assembly:
pushq %rax
callq 0x19b5
shrq $0xc, %rax
movabsq $0x3ff0000000000001, %rcx # imm = 0x3FF0000000000001
orq %rax, %rcx
movq %rcx, %xmm0
addsd 0x14cb(%rip), %xmm0     # 0x3008
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: print_uint64
void print_uint64(mtgp64_ref_t *mtgp64, int count) {
    int i;
    for (i = 0; i < count; i++) {
	printf("%016"PRIx64" ", mtgp64_genrand_uint64(mtgp64));
	if (i % 3 == 2) {
	    printf("\n");
	}
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x1bb1
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movl $0x2, %ebp
leaq 0x14c9(%rip), %r15      # 0x3028
xorl %r13d, %r13d
movl %r13d, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %r12d
movq %r14, %rdi
callq 0x19b5
movq %r15, %rdi
movq %rax, %rsi
xorl %eax, %eax
callq 0x1080
addl %ebp, %r12d
jne 0x1b9a
movl $0xa, %edi
callq 0x1040
incl %r13d
decl %ebp
decl %ebx
jne 0x1b62
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: print_close1_open2
void print_close1_open2(mtgp64_ref_t *mtgp64, int count) {
    int i;
    for (i = 0; i < count; i++) {
	printf("%.18f ", mtgp64_genrand_close1_open2(mtgp64));
	if (i % 3 == 2) {
	    printf("\n");
	}
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x1c43
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0x144e(%rip), %r15      # 0x3030
movl %ebp, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %r13d
movq %r14, %rdi
callq 0x19b5
shrq $0xc, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
orq %rcx, %rax
movq %rax, %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x1080
addl %r12d, %r13d
jne 0x1c2c
movl $0xa, %edi
callq 0x1040
incl %ebp
decl %r12d
decl %ebx
jne 0x1be2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: print_close_open
void print_close_open(mtgp64_ref_t *mtgp64, int count) {
    int i;
    for (i = 0; i < count; i++) {
	printf("%.18f ", mtgp64_genrand_close_open(mtgp64));
	if (i % 3 == 2) {
	    printf("\n");
	}
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x1cdd
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0x13bc(%rip), %r15      # 0x3030
movl %ebp, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %r13d
movq %r14, %rdi
callq 0x19b5
shrq $0xc, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
orq %rcx, %rax
movq %rax, %xmm0
addsd 0x135b(%rip), %xmm0     # 0x3008
movq %r15, %rdi
movb $0x1, %al
callq 0x1080
addl %r12d, %r13d
jne 0x1cc6
movl $0xa, %edi
callq 0x1040
incl %ebp
decl %r12d
decl %ebx
jne 0x1c74
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: print_open_close
void print_open_close(mtgp64_ref_t *mtgp64, int count) {
    int i;
    for (i = 0; i < count; i++) {
	printf("%.18f ", mtgp64_genrand_open_close(mtgp64));
	if (i % 3 == 2) {
	    printf("\n");
	}
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x1d7b
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0x1322(%rip), %r15      # 0x3030
movl %ebp, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %r13d
movq %r14, %rdi
callq 0x19b5
shrq $0xc, %rax
movabsq $0x3ff0000000000000, %rcx # imm = 0x3FF0000000000000
orq %rcx, %rax
movq %rax, %xmm1
movsd 0x12c9(%rip), %xmm0     # 0x3010
subsd %xmm1, %xmm0
movq %r15, %rdi
movb $0x1, %al
callq 0x1080
addl %r12d, %r13d
jne 0x1d64
movl $0xa, %edi
callq 0x1040
incl %ebp
decl %r12d
decl %ebx
jne 0x1d0e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/MersenneTwister-Lab[P]MTGP/mtgp64-ref.c
// Function: print_open_open
void print_open_open(mtgp64_ref_t *mtgp64, int count) {
    int i;
    for (i = 0; i < count; i++) {
	printf("%.18f ", mtgp64_genrand_open_open(mtgp64));
	if (i % 3 == 2) {
	    printf("\n");
	}
    }
    printf("\n");
}

// Assembly:
testl %esi, %esi
jle 0x1e15
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
xorl %ebp, %ebp
movl $0x2, %r12d
leaq 0x1284(%rip), %r15      # 0x3030
movl %ebp, %eax
movl $0xaaaaaaab, %ecx       # imm = 0xAAAAAAAB
imulq %rcx, %rax
shrq $0x21, %rax
leal (%rax,%rax,2), %r13d
movq %r14, %rdi
callq 0x19b5
shrq $0xc, %rax
movabsq $0x3ff0000000000001, %rcx # imm = 0x3FF0000000000001
orq %rcx, %rax
movq %rax, %xmm0
addsd 0x1223(%rip), %xmm0     # 0x3008
movq %r15, %rdi
movb $0x1, %al
callq 0x1080
addl %r12d, %r13d
jne 0x1dfe
movl $0xa, %edi
callq 0x1040
incl %ebp
decl %r12d
decl %ebx
jne 0x1dac
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl $0xa, %edi
jmp 0x1040
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/many-one/test/spin.c
// Function: thread1
void *thread1(void *arg) {
	while(run == 1) {
		dthread_spin_lock(&lock);
        c++;
		dthread_spin_unlock(&lock);

		c1++;
    }
    return NULL;
}

// Assembly:
cmpq $0x1, 0x27c8(%rip)      # 0x4098
jne 0x190d
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2829(%rip), %rbx      # 0x4108
movq %rbx, %rdi
callq 0x1758
incq 0x27f2(%rip)            # 0x40e0
movq %rbx, %rdi
callq 0x1782
incq 0x27eb(%rip)            # 0x40e8
cmpq $0x1, 0x2793(%rip)      # 0x4098
je 0x18df
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/many-one/test/spin.c
// Function: thread2
void *thread2(void *arg) {
	while(run == 1) {
        dthread_spin_lock(&lock);
        c++;
		dthread_spin_unlock(&lock);
		c2++;
    }
    return NULL;
}

// Assembly:
cmpq $0x1, 0x2780(%rip)      # 0x4098
jne 0x1955
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x27e1(%rip), %rbx      # 0x4108
movq %rbx, %rdi
callq 0x1758
incq 0x27aa(%rip)            # 0x40e0
movq %rbx, %rdi
callq 0x1782
incq 0x27ab(%rip)            # 0x40f0
cmpq $0x1, 0x274b(%rip)      # 0x4098
je 0x1927
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/many-one/test/spin.c
// Function: thread3
void *thread3(void *arg) {
	while(run == 1) {
        dthread_spin_lock(&lock);
        c++;
		dthread_spin_unlock(&lock);
		c3++;
    }
    return NULL;
}

// Assembly:
cmpq $0x1, 0x2738(%rip)      # 0x4098
jne 0x199d
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2799(%rip), %rbx      # 0x4108
movq %rbx, %rdi
callq 0x1758
incq 0x2762(%rip)            # 0x40e0
movq %rbx, %rdi
callq 0x1782
incq 0x276b(%rip)            # 0x40f8
cmpq $0x1, 0x2703(%rip)      # 0x4098
je 0x196f
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/many-one/test/spin.c
// Function: thread4
void *thread4(void *arg) {
	while(run == 1) {
        dthread_spin_lock(&lock);
        c++;
		dthread_spin_unlock(&lock);
		c4++;
    }
    return NULL;
}

// Assembly:
cmpq $0x1, 0x26f0(%rip)      # 0x4098
jne 0x19e5
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
leaq 0x2751(%rip), %rbx      # 0x4108
movq %rbx, %rdi
callq 0x1758
incq 0x271a(%rip)            # 0x40e0
movq %rbx, %rdi
callq 0x1782
incq 0x272b(%rip)            # 0x4100
cmpq $0x1, 0x26bb(%rip)      # 0x4098
je 0x19b7
addq $0x8, %rsp
popq %rbx
popq %rbp
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O3/deepika9294[P]Threading-Library/many-one/test/spin.c
// Function: main
int main() {
	dthread_t th1, th2, th3, th4; 
    dthread_init();
	dthread_spin_init(&lock);
    printf("\n\n");

	dthread_create(&th1, thread1, NULL);
	dthread_create(&th2, thread2, NULL);
	dthread_create(&th3, thread3, NULL);
	dthread_create(&th4, thread4, NULL);

	for(int i = 0; i < 100000000; i++);
	run = 0;
	dthread_join(th1, NULL);
	dthread_join(th2, NULL);
	dthread_join(th3, NULL);
	dthread_join(th4, NULL);


	if(c == c1 + c2 + c3 + c4) {
		printf(GREEN "**PASSED**: Spin lock test for race problem between 4 threads\n" NONE);
	}
	else {
		printf(RED "**FAILED**: Spin lock test for race problem between 4 threads\n" NONE);
	}
    // printf("\n%ld %ld %ld %ld %ld %ld\n", c, c1+c2+c3+c4 , c1, c2, c3, c4);

	
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
callq 0x120c
leaq 0x2705(%rip), %rdi      # 0x4108
callq 0x174a
leaq 0x6ba(%rip), %rdi       # 0x20c9
callq 0x1050
leaq -0x153(%rip), %rsi      # 0x18c8
leaq -0x40(%rbp), %rbx
movq %rbx, %rdi
xorl %edx, %edx
callq 0x1518
leaq -0x120(%rip), %rsi      # 0x1910
leaq -0x38(%rbp), %r14
movq %r14, %rdi
xorl %edx, %edx
callq 0x1518
leaq -0xed(%rip), %rsi       # 0x1958
leaq -0x30(%rbp), %r15
movq %r15, %rdi
xorl %edx, %edx
callq 0x1518
leaq -0xba(%rip), %rsi       # 0x19a0
leaq -0x28(%rbp), %r12
movq %r12, %rdi
xorl %edx, %edx
callq 0x1518
movq $0x0, 0x2625(%rip) # 0x4098
movq (%rbx), %rdi
xorl %esi, %esi
callq 0x1667
movq (%r14), %rdi
xorl %esi, %esi
callq 0x1667
movq (%r15), %rdi
xorl %esi, %esi
callq 0x1667
movq (%r12), %rdi
xorl %esi, %esi
callq 0x1667
movq 0x264d(%rip), %rax      # 0x40f0
addq 0x263e(%rip), %rax      # 0x40e8
addq 0x2647(%rip), %rax      # 0x40f8
addq 0x2648(%rip), %rax      # 0x4100
cmpq %rax, 0x2621(%rip)      # 0x40e0
leaq 0x56b(%rip), %rax       # 0x2031
leaq 0x5b0(%rip), %rdi       # 0x207d
cmoveq %rax, %rdi
xorl %eax, %eax
callq 0x1080
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nopw (%rax,%rax)