// File: /workspace/github_c_makefile_star2_O3/stanfordnlp[P]GloVe/src/glove.c
// Function: main
int main(int argc, char **argv) {
    int i;
    FILE *fid;
    int result = 0;
    
    if (argc == 1) {
        printf("GloVe: Global Vectors for Word Representation, v0.2\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-write-header <int>\n");
        printf("\t\tIf 1, write vocab_size/vector_size as first line. Do nothing if 0 (default).\n");
        printf("\t-vector-size <int>\n");
        printf("\t\tDimension of word vector representations (excluding bias term); default 50\n");
        printf("\t-threads <int>\n");
        printf("\t\tNumber of threads; default 8\n");
        printf("\t-iter <int>\n");
        printf("\t\tNumber of training iterations; default 25\n");
        printf("\t-eta <float>\n");
        printf("\t\tInitial learning rate; default 0.05\n");
        printf("\t-alpha <float>\n");
        printf("\t\tParameter in exponent of weighting function; default 0.75\n");
        printf("\t-x-max <float>\n");
        printf("\t\tParameter specifying cutoff in weighting function; default 100.0\n");
        printf("\t-grad-clip\n");
        printf("\t\tGradient components clipping parameter. Values will be clipped to [-grad-clip, grad-clip] interval\n");
        printf("\t-binary <int>\n");
        printf("\t\tSave output in binary format (0: text, 1: binary, 2: both); default 0\n");
        printf("\t-model <int>\n");
        printf("\t\tModel for word vector output (for text output only); default 2\n");
        printf("\t\t   0: output all data, for both word and context word vectors, including bias terms\n");
        printf("\t\t   1: output word vectors, excluding bias terms\n");
        printf("\t\t   2: output word vectors + context word vectors, excluding bias terms\n");
        printf("\t\t   3: output word vectors and context word vectors, excluding bias terms; context word vectors are row-concatenated to the word vectors\n");
        printf("\t-input-file <file>\n");
        printf("\t\tBinary input file of shuffled cooccurrence data (produced by 'cooccur' and 'shuffle'); default cooccurrence.shuf.bin\n");
        printf("\t-vocab-file <file>\n");
        printf("\t\tFile containing vocabulary (truncated unigram counts, produced by 'vocab_count'); default vocab.txt\n");
        printf("\t-save-file <file>\n");
        printf("\t\tFilename, excluding extension, for word vector output; default vectors\n");
        printf("\t-gradsq-file <file>\n");
        printf("\t\tFilename, excluding extension, for squared gradient output; default gradsq\n");
        printf("\t-save-gradsq <int>\n");
        printf("\t\tSave accumulated squared gradients; default 0 (off); ignored if gradsq-file is specified\n");
        printf("\t-checkpoint-every <int>\n");
        printf("\t\tCheckpoint a  model every <int> iterations; default 0 (off)\n");
        printf("\t-load-init-param <int>\n");
        printf("\t\tLoad initial parameters from -init-param-file; default 0 (false)\n");
        printf("\t-save-init-param <int>\n");
        printf("\t\tSave initial parameters (i.e., checkpoint the model before any training); default 0 (false)\n");
        printf("\t-init-param-file <file>\n");
        printf("\t\tBinary initial parameters file to be loaded if -load-init-params is 1; (default is to look for vectors.000.bin)\n");
        printf("\t-load-init-gradsq <int>\n");
        printf("\t\tLoad initial squared gradients from -init-gradsq-file; default 0 (false)\n");
        printf("\t-init-gradsq-file <file>\n");
        printf("\t\tBinary initial squared gradients file to be loaded if -load-init-gradsq is 1; (default is to look for gradsq.000.bin)\n");
        printf("\t-seed <int>\n");
        printf("\t\tRandom seed to use.  If not set, will be randomized using current time.");
        printf("\nExample usage:\n");
        printf("./glove -input-file cooccurrence.shuf.bin -vocab-file vocab.txt -save-file vectors -gradsq-file gradsq -verbose 2 -vector-size 100 -threads 16 -alpha 0.75 -x-max 100.0 -eta 0.05 -binary 2 -model 2\n\n");
        result = 0;
    } else {
        if ((i = find_arg((char *)"-write-header", argc, argv)) > 0) write_header = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-verbose", argc, argv)) > 0) verbose = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-vector-size", argc, argv)) > 0) vector_size = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-iter", argc, argv)) > 0) num_iter = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-threads", argc, argv)) > 0) num_threads = atoi(argv[i + 1]);
        cost = malloc(sizeof(real) * num_threads);
        if ((i = find_arg((char *)"-alpha", argc, argv)) > 0) alpha = atof(argv[i + 1]);
        if ((i = find_arg((char *)"-x-max", argc, argv)) > 0) x_max = atof(argv[i + 1]);
        if ((i = find_arg((char *)"-eta", argc, argv)) > 0) eta = atof(argv[i + 1]);
        if ((i = find_arg((char *)"-grad-clip", argc, argv)) > 0) grad_clip_value = atof(argv[i + 1]);
        if ((i = find_arg((char *)"-binary", argc, argv)) > 0) use_binary = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-model", argc, argv)) > 0) model = atoi(argv[i + 1]);
        if (model != 0 && model != 1) model = 2;
        if ((i = find_arg((char *)"-save-gradsq", argc, argv)) > 0) save_gradsq = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-vocab-file", argc, argv)) > 0) strcpy(vocab_file, argv[i + 1]);
        else strcpy(vocab_file, (char *)"vocab.txt");
        if ((i = find_arg((char *)"-save-file", argc, argv)) > 0) strcpy(save_W_file, argv[i + 1]);
        else strcpy(save_W_file, (char *)"vectors");
        if ((i = find_arg((char *)"-gradsq-file", argc, argv)) > 0) {
            strcpy(save_gradsq_file, argv[i + 1]);
            save_gradsq = 1;
        }
        else if (save_gradsq > 0) strcpy(save_gradsq_file, (char *)"gradsq");
        if ((i = find_arg((char *)"-input-file", argc, argv)) > 0) strcpy(input_file, argv[i + 1]);
        else strcpy(input_file, (char *)"cooccurrence.shuf.bin");
        if ((i = find_arg((char *)"-checkpoint-every", argc, argv)) > 0) checkpoint_every = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-init-param-file", argc, argv)) > 0) strcpy(init_param_file, argv[i + 1]);
        else strcpy(init_param_file, (char *)"vectors.000.bin");
        if ((i = find_arg((char *)"-load-init-param", argc, argv)) > 0) load_init_param = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-save-init-param", argc, argv)) > 0) save_init_param = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-init-gradsq-file", argc, argv)) > 0) strcpy(init_gradsq_file, argv[i + 1]);
        else strcpy(init_gradsq_file, (char *)"gradsq.000.bin");
        if ((i = find_arg((char *)"-load-init-gradsq", argc, argv)) > 0) load_init_gradsq = atoi(argv[i + 1]);
        if ((i = find_arg((char *)"-seed", argc, argv)) > 0) seed = atoi(argv[i + 1]);
        
        vocab_size = 0;
        fid = fopen(vocab_file, "r");
        if (fid == NULL) {log_file_loading_error("vocab file", vocab_file); free(cost); return 1;}
        while ((i = getc(fid)) != EOF) if (i == '\n') vocab_size++; // Count number of entries in vocab_file
        fclose(fid);
        if (vocab_size == 0) {fprintf(stderr, "Unable to find any vocab entries in vocab file %s.\n", vocab_file); free(cost); return 1;}
        result = train_glove();
        free(cost);
    }
    free(W);
    free(gradsq);

    return result;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
cmpl $0x1, %edi
jne 0x2e6b
leaq 0x1904(%rip), %rdi      # 0x44c6
callq 0x1090
leaq 0x192c(%rip), %rdi      # 0x44fa
callq 0x1090
leaq 0x1953(%rip), %rdi      # 0x452d
callq 0x1090
leaq 0x1956(%rip), %rdi      # 0x453c
callq 0x1090
leaq 0x195a(%rip), %rdi      # 0x454c
callq 0x1090
leaq 0x1974(%rip), %rdi      # 0x4572
callq 0x1090
leaq 0x197d(%rip), %rdi      # 0x4587
callq 0x1090
leaq 0x19c0(%rip), %rdi      # 0x45d6
callq 0x1090
leaq 0x19c8(%rip), %rdi      # 0x45ea
callq 0x1090
leaq 0x1a09(%rip), %rdi      # 0x4637
callq 0x1090
leaq 0x1a0d(%rip), %rdi      # 0x4647
callq 0x1090
leaq 0x1a20(%rip), %rdi      # 0x4666
callq 0x1090
leaq 0x1a21(%rip), %rdi      # 0x4673
callq 0x1090
leaq 0x1a41(%rip), %rdi      # 0x469f
callq 0x1090
leaq 0x1a43(%rip), %rdi      # 0x46ad
callq 0x1090
leaq 0x1a5d(%rip), %rdi      # 0x46d3
callq 0x1090
leaq 0x1a61(%rip), %rdi      # 0x46e3
callq 0x1090
leaq 0x1a91(%rip), %rdi      # 0x471f
callq 0x1090
leaq 0x1a95(%rip), %rdi      # 0x472f
callq 0x1090
leaq 0x1acc(%rip), %rdi      # 0x4772
callq 0x1090
leaq 0x1acc(%rip), %rdi      # 0x477e
callq 0x1090
leaq 0x1b25(%rip), %rdi      # 0x47e3
callq 0x1090
leaq 0x1b28(%rip), %rdi      # 0x47f2
callq 0x1090
leaq 0x1b64(%rip), %rdi      # 0x483a
callq 0x1090
leaq 0x1b66(%rip), %rdi      # 0x4848
callq 0x1090
leaq 0x1b9b(%rip), %rdi      # 0x4889
callq 0x1090
leaq 0x1be5(%rip), %rdi      # 0x48df
callq 0x1090
leaq 0x1c0b(%rip), %rdi      # 0x4911
callq 0x1090
leaq 0x1c48(%rip), %rdi      # 0x495a
callq 0x1090
leaq 0x1cc6(%rip), %rdi      # 0x49e4
callq 0x1090
leaq 0x1cce(%rip), %rdi      # 0x49f8
callq 0x1090
leaq 0x1d39(%rip), %rdi      # 0x4a6f
callq 0x1090
leaq 0x1d41(%rip), %rdi      # 0x4a83
callq 0x1090
leaq 0x1d9b(%rip), %rdi      # 0x4ae9
callq 0x1090
leaq 0x1da2(%rip), %rdi      # 0x4afc
callq 0x1090
leaq 0x1ddf(%rip), %rdi      # 0x4b45
callq 0x1090
leaq 0x1de8(%rip), %rdi      # 0x4b5a
callq 0x1090
leaq 0x1e29(%rip), %rdi      # 0x4ba7
callq 0x1090
leaq 0x1e31(%rip), %rdi      # 0x4bbb
callq 0x1090
leaq 0x1e80(%rip), %rdi      # 0x4c16
callq 0x1090
leaq 0x1e8d(%rip), %rdi      # 0x4c2f
callq 0x1090
leaq 0x1ebf(%rip), %rdi      # 0x4c6d
callq 0x1090
leaq 0x1ecb(%rip), %rdi      # 0x4c85
callq 0x1090
leaq 0x1f02(%rip), %rdi      # 0x4cc8
callq 0x1090
leaq 0x1f0e(%rip), %rdi      # 0x4ce0
callq 0x1090
leaq 0x1f60(%rip), %rdi      # 0x4d3e
callq 0x1090
leaq 0x1f6d(%rip), %rdi      # 0x4d57
callq 0x1090
leaq 0x1fd3(%rip), %rdi      # 0x4dc9
callq 0x1090
leaq 0x1fe0(%rip), %rdi      # 0x4de2
callq 0x1090
leaq 0x201f(%rip), %rdi      # 0x4e2d
callq 0x1090
leaq 0x202d(%rip), %rdi      # 0x4e47
callq 0x1090
leaq 0x2099(%rip), %rdi      # 0x4ebf
callq 0x1090
leaq 0x14ed(%rip), %rdi      # 0x431f
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10f0
leaq 0x208a(%rip), %rdi      # 0x4ecc
callq 0x1090
leaq 0x208e(%rip), %rdi      # 0x4edc
callq 0x1090
movq 0x437e(%rip), %rdi      # 0x71d8
callq 0x1030
leaq 0x437a(%rip), %rax      # 0x71e0
jmp 0x3320
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x14f2(%rip), %rdi      # 0x4369
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2e97
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4319(%rip)      # 0x71b0
leaq 0x14d9(%rip), %rdi      # 0x4377
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2ebe
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x42a2(%rip)      # 0x7160
leaq 0x14bb(%rip), %rdi      # 0x4380
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2ee5
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x428b(%rip)      # 0x7170
leaq 0x14a1(%rip), %rdi      # 0x438d
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2f0c
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4260(%rip)      # 0x716c
leaq 0x1480(%rip), %rdi      # 0x4393
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2f35
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4235(%rip)      # 0x7168
jmp 0x2f3b
movl 0x422d(%rip), %eax      # 0x7168
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x11b0
movq %rax, 0x4e72(%rip)      # 0x7dc0
leaq 0x1447(%rip), %rdi      # 0x439c
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2f77
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x4209(%rip)     # 0x7180
leaq 0x1425(%rip), %rdi      # 0x43a3
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2fa0
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x41e8(%rip)     # 0x7188
leaq 0x1403(%rip), %rdi      # 0x43aa
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2fc9
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x41af(%rip)     # 0x7178
leaq 0x17a3(%rip), %rdi      # 0x4773
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x2ff2
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x419e(%rip)     # 0x7190
leaq 0x13b6(%rip), %rdi      # 0x43af
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x3019
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x41a3(%rip)      # 0x71bc
leaq 0x1397(%rip), %rdi      # 0x43b7
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x3042
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4134(%rip)      # 0x7174
jmp 0x3048
movl 0x412c(%rip), %eax      # 0x7174
cmpl $0x2, %eax
jb 0x3057
movl $0x2, 0x411d(%rip)      # 0x7174
leaq 0x1360(%rip), %rdi      # 0x43be
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x307e
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x413a(%rip)      # 0x71b8
leaq 0x1346(%rip), %rdi      # 0x43cb
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x30a8
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x550f(%rip), %rdi      # 0x85b0
callq 0x1060
jmp 0x30c2
movabsq $0x78742e6261636f76, %rax # imm = 0x78742E6261636F76
movq %rax, 0x54f7(%rip)      # 0x85b0
movw $0x74, 0x54f6(%rip)     # 0x85b8
leaq 0x130e(%rip), %rdi      # 0x43d7
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x30ec
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x4ceb(%rip), %rdi      # 0x7dd0
callq 0x1060
jmp 0x30fd
movabsq $0x73726f74636576, %rax # imm = 0x73726F74636576
movq %rax, 0x4cd3(%rip)      # 0x7dd0
leaq 0x1344(%rip), %rdi      # 0x4448
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x3131
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x50a0(%rip), %rdi      # 0x81c0
callq 0x1060
movl $0x1, 0x4089(%rip)      # 0x71b8
jmp 0x314e
cmpl $0x0, 0x4080(%rip)      # 0x71b8
jle 0x314e
movl $0x717364, 0x507f(%rip) # imm = 0x717364
movl $0x64617267, 0x5072(%rip) # imm = 0x64617267
leaq 0x128d(%rip), %rdi      # 0x43e2
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x3178
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x485f(%rip), %rdi      # 0x79d0
callq 0x1060
jmp 0x3197
movups 0x18da(%rip), %xmm0     # 0x4a59
movaps %xmm0, 0x484a(%rip)     # 0x79d0
movabsq $0x6e69622e667568, %rax # imm = 0x6E69622E667568
movq %rax, 0x4847(%rip)      # 0x79de
leaq 0x1250(%rip), %rdi      # 0x43ee
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x31be
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4002(%rip)      # 0x71c0
leaq 0x123b(%rip), %rdi      # 0x4400
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x31e8
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x400f(%rip), %rdi      # 0x71f0
callq 0x1060
jmp 0x31f6
movups 0x1222(%rip), %xmm0     # 0x4411
movaps %xmm0, 0x3ffa(%rip)     # 0x71f0
leaq 0x1224(%rip), %rdi      # 0x4421
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x321d
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x3fa7(%rip)      # 0x71c4
leaq 0x120e(%rip), %rdi      # 0x4432
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x3244
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x3f84(%rip)      # 0x71c8
leaq 0x11f8(%rip), %rdi      # 0x4443
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x326e
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x4379(%rip), %rdi      # 0x75e0
callq 0x1060
jmp 0x3290
movabsq $0x6e69622e303030, %rax # imm = 0x6E69622E303030
movq %rax, 0x4368(%rip)      # 0x75e7
movabsq $0x302e717364617267, %rax # imm = 0x302E717364617267
movq %rax, 0x4350(%rip)      # 0x75e0
leaq 0x11cd(%rip), %rdi      # 0x4464
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x32b7
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x3f15(%rip)      # 0x71cc
leaq 0x11b8(%rip), %rdi      # 0x4476
movl %ebp, %esi
movq %rbx, %rdx
callq 0x34ce
testl %eax, %eax
jle 0x32de
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x3ed6(%rip)      # 0x71b4
movq $0x0, 0x3ee7(%rip) # 0x71d0
leaq 0x52c0(%rip), %rdi      # 0x85b0
leaq 0x107e(%rip), %rsi      # 0x4375
callq 0x1200
testq %rax, %rax
jne 0x3331
leaq 0xeea(%rip), %rdi       # 0x41f2
leaq 0x52a1(%rip), %rsi      # 0x85b0
callq 0x1969
movl $0x1, %ebx
leaq 0x4aa0(%rip), %rax      # 0x7dc0
movq (%rax), %rdi
callq 0x1030
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
movq %rbx, %rdi
callq 0x1280
cmpl $0xa, %eax
je 0x3348
cmpl $-0x1, %eax
jne 0x3334
jmp 0x3351
incq 0x3e81(%rip)            # 0x71d0
jmp 0x3334
movq %rbx, %rdi
callq 0x10e0
cmpq $0x0, 0x3e6f(%rip)      # 0x71d0
jne 0x336a
callq 0x194a
jmp 0x3314
callq 0x1489
movl %eax, %ebx
movq 0x4a48(%rip), %rdi      # 0x7dc0
callq 0x1030
jmp 0x2e53
nop