// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jne 0x1c1d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1634(%rip), %rsi      # 0x3133
callq 0x1dc0
cmpl $0x0, %eax
je 0x1b3f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x161f(%rip), %rsi      # 0x3137
callq 0x1dc0
cmpl $0x0, %eax
je 0x1b3f
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1605(%rip), %rsi      # 0x3136
callq 0x1dc0
cmpl $0x0, %eax
jne 0x1c1d
leaq 0x15f7(%rip), %rdi      # 0x313d
movb $0x0, %al
callq 0x10b0
leaq 0x1622(%rip), %rdi      # 0x3176
movb $0x0, %al
callq 0x10b0
leaq 0x1648(%rip), %rdi      # 0x31aa
movb $0x0, %al
callq 0x10b0
leaq 0x164a(%rip), %rdi      # 0x31ba
movb $0x0, %al
callq 0x10b0
leaq 0x164d(%rip), %rdi      # 0x31cb
movb $0x0, %al
callq 0x10b0
leaq 0x1666(%rip), %rdi      # 0x31f2
movb $0x0, %al
callq 0x10b0
leaq 0x166a(%rip), %rdi      # 0x3204
movb $0x0, %al
callq 0x10b0
leaq 0x1695(%rip), %rdi      # 0x323d
movb $0x0, %al
callq 0x10b0
leaq 0x169b(%rip), %rdi      # 0x3251
movb $0x0, %al
callq 0x10b0
leaq 0x173b(%rip), %rdi      # 0x32ff
movb $0x0, %al
callq 0x10b0
leaq 0x1741(%rip), %rdi      # 0x3313
movb $0x0, %al
callq 0x10b0
leaq 0x177f(%rip), %rdi      # 0x335f
movb $0x0, %al
callq 0x10b0
leaq 0x177f(%rip), %rdi      # 0x336d
movb $0x0, %al
callq 0x10b0
leaq 0x17bb(%rip), %rdi      # 0x33b7
movb $0x0, %al
callq 0x10b0
leaq 0x17fa(%rip), %rdi      # 0x3404
movb $0x0, %al
callq 0x10b0
movl $0x0, -0x4(%rbp)
jmp 0x1da8
movl $0x3e8, %edi            # imm = 0x3E8
callq 0x1130
movq %rax, 0x34e2(%rip)      # 0x5110
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x1815(%rip), %rdi      # 0x3451
callq 0x2090
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jle 0x1c65
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1160
movl %eax, 0x3483(%rip)      # 0x50e8
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x17e7(%rip), %rdi      # 0x345a
callq 0x2090
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jle 0x1c9f
movq 0x3489(%rip), %rdi      # 0x5110
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
callq 0x1060
jmp 0x1cb2
movq 0x346a(%rip), %rdi      # 0x5110
leaq 0x17b8(%rip), %rsi      # 0x3465
callq 0x1060
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x17b2(%rip), %rdi      # 0x3472
callq 0x2090
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jle 0x1ceb
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1080
movsd %xmm0, 0x340d(%rip)     # 0x50f8
movsd 0x1325(%rip), %xmm0     # 0x3018
mulsd 0x33fd(%rip), %xmm0     # 0x50f8
movsd 0x130d(%rip), %xmm1     # 0x3010
mulsd %xmm1, %xmm0
movsd 0x12f9(%rip), %xmm1     # 0x3008
divsd %xmm1, %xmm0
cvttsd2si %xmm0, %rax
movq %rax, 0x33d1(%rip)      # 0x50f0
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x174d(%rip), %rdi      # 0x347a
callq 0x2090
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jle 0x1d57
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x10f0
movq %rax, 0x3399(%rip)      # 0x50f0
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x1721(%rip), %rdi      # 0x3486
callq 0x2090
movl %eax, -0x14(%rbp)
cmpl $0x0, %eax
jle 0x1d8e
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1160
movl %eax, 0x337a(%rip)      # 0x5108
callq 0x1780
movl %eax, -0x18(%rbp)
movq 0x3373(%rip), %rdi      # 0x5110
callq 0x1030
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax,%rax)