// File: /workspace/github_c_makefile_star2_O1/stanfordnlp[P]GloVe/src/shuffle.c
// Function: main
int main(int argc, char **argv) {
    int i;
    
    if (argc == 2 &&
        (!scmp(argv[1], "-h") || !scmp(argv[1], "-help") || !scmp(argv[1], "--help"))) {
        printf("Tool to shuffle entries of word-word cooccurrence files\n");
        printf("Author: Jeffrey Pennington (jpennin@stanford.edu)\n\n");
        printf("Usage options:\n");
        printf("\t-verbose <int>\n");
        printf("\t\tSet verbosity: 0, 1, or 2 (default)\n");
        printf("\t-memory <float>\n");
        printf("\t\tSoft limit for memory consumption, in GB; default 4.0\n");
        printf("\t-array-size <int>\n");
        printf("\t\tLimit to length <int> the buffer which stores chunks of data to shuffle before writing to disk. \n\t\tThis value overrides that which is automatically produced by '-memory'.\n");
        printf("\t-temp-file <file>\n");
        printf("\t\tFilename, excluding extension, for temporary files; default temp_shuffle\n");
        printf("\t-seed <int>\n");
        printf("\t\tRandom seed to use.  If not set, will be randomized using current time.");
        printf("\nExample usage: (assuming 'cooccurrence.bin' has been produced by 'coccur')\n");
        printf("./shuffle -verbose 2 -memory 8.0 < cooccurrence.bin > cooccurrence.shuf.bin\n");
        return 0;
    }

    file_head = malloc(sizeof(char) * MAX_STRING_LENGTH);
    if ((i = find_arg((char *)"-verbose", argc, argv)) > 0) verbose = atoi(argv[i + 1]);
    if ((i = find_arg((char *)"-temp-file", argc, argv)) > 0) strcpy(file_head, argv[i + 1]);
    else strcpy(file_head, (char *)"temp_shuffle");
    if ((i = find_arg((char *)"-memory", argc, argv)) > 0) memory_limit = atof(argv[i + 1]);
    array_size = (long long) (0.95 * (real)memory_limit * 1073741824/(sizeof(CREC)));
    if ((i = find_arg((char *)"-array-size", argc, argv)) > 0) array_size = atoll(argv[i + 1]);
    if ((i = find_arg((char *)"-seed", argc, argv)) > 0) seed = atoi(argv[i + 1]);
    const int returned_value = shuffle_by_chunks();
    free(file_head);
    return returned_value;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %rbx
movl %edi, %ebp
cmpl $0x2, %edi
jne 0x1c76
movq 0x8(%rbx), %rdi
leaq 0x5b8(%rip), %rsi       # 0x2136
callq 0x1c90
testl %eax, %eax
je 0x1bb3
movq 0x8(%rbx), %rdi
leaq 0x5a8(%rip), %rsi       # 0x213a
callq 0x1c90
testl %eax, %eax
je 0x1bb3
movq 0x8(%rbx), %rdi
leaq 0x593(%rip), %rsi       # 0x2139
callq 0x1c90
testl %eax, %eax
jne 0x1c76
leaq 0x5fe(%rip), %rdi       # 0x21b8
callq 0x1070
leaq 0x62a(%rip), %rdi       # 0x21f0
callq 0x1070
leaq 0x651(%rip), %rdi       # 0x2223
callq 0x1070
leaq 0x654(%rip), %rdi       # 0x2232
callq 0x1070
leaq 0x658(%rip), %rdi       # 0x2242
callq 0x1070
leaq 0x672(%rip), %rdi       # 0x2268
callq 0x1070
leaq 0x677(%rip), %rdi       # 0x2279
callq 0x1070
leaq 0x6a3(%rip), %rdi       # 0x22b1
callq 0x1070
leaq 0x6aa(%rip), %rdi       # 0x22c4
callq 0x1070
leaq 0x74b(%rip), %rdi       # 0x2371
callq 0x1070
leaq 0x752(%rip), %rdi       # 0x2384
callq 0x1070
leaq 0x791(%rip), %rdi       # 0x23cf
callq 0x1070
leaq 0x4f6(%rip), %rdi       # 0x2140
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10c0
leaq 0x782(%rip), %rdi       # 0x23dc
callq 0x1070
leaq 0x7c2(%rip), %rdi       # 0x2428
callq 0x1070
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xc(%rsp), %r14
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x153e
movl (%r14), %ebx
jmp 0x1c6b
nopl (%rax)