// File: /workspace/github_c_makefile_star2_O2/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 0x2c65
leaq 0x1ad7(%rip), %rdi      # 0x44a6
callq 0x1090
leaq 0x1aff(%rip), %rdi      # 0x44da
callq 0x1090
leaq 0x1b26(%rip), %rdi      # 0x450d
callq 0x1090
leaq 0x1b29(%rip), %rdi      # 0x451c
callq 0x1090
leaq 0x1b2d(%rip), %rdi      # 0x452c
callq 0x1090
leaq 0x1b47(%rip), %rdi      # 0x4552
callq 0x1090
leaq 0x1b50(%rip), %rdi      # 0x4567
callq 0x1090
leaq 0x1b93(%rip), %rdi      # 0x45b6
callq 0x1090
leaq 0x1b9b(%rip), %rdi      # 0x45ca
callq 0x1090
leaq 0x1bdc(%rip), %rdi      # 0x4617
callq 0x1090
leaq 0x1be0(%rip), %rdi      # 0x4627
callq 0x1090
leaq 0x1bf3(%rip), %rdi      # 0x4646
callq 0x1090
leaq 0x1bf4(%rip), %rdi      # 0x4653
callq 0x1090
leaq 0x1c14(%rip), %rdi      # 0x467f
callq 0x1090
leaq 0x1c16(%rip), %rdi      # 0x468d
callq 0x1090
leaq 0x1c30(%rip), %rdi      # 0x46b3
callq 0x1090
leaq 0x1c34(%rip), %rdi      # 0x46c3
callq 0x1090
leaq 0x1c64(%rip), %rdi      # 0x46ff
callq 0x1090
leaq 0x1c68(%rip), %rdi      # 0x470f
callq 0x1090
leaq 0x1c9f(%rip), %rdi      # 0x4752
callq 0x1090
leaq 0x1c9f(%rip), %rdi      # 0x475e
callq 0x1090
leaq 0x1cf8(%rip), %rdi      # 0x47c3
callq 0x1090
leaq 0x1cfb(%rip), %rdi      # 0x47d2
callq 0x1090
leaq 0x1d37(%rip), %rdi      # 0x481a
callq 0x1090
leaq 0x1d39(%rip), %rdi      # 0x4828
callq 0x1090
leaq 0x1d6e(%rip), %rdi      # 0x4869
callq 0x1090
leaq 0x1db8(%rip), %rdi      # 0x48bf
callq 0x1090
leaq 0x1dde(%rip), %rdi      # 0x48f1
callq 0x1090
leaq 0x1e1b(%rip), %rdi      # 0x493a
callq 0x1090
leaq 0x1e99(%rip), %rdi      # 0x49c4
callq 0x1090
leaq 0x1ea1(%rip), %rdi      # 0x49d8
callq 0x1090
leaq 0x1f0c(%rip), %rdi      # 0x4a4f
callq 0x1090
leaq 0x1f14(%rip), %rdi      # 0x4a63
callq 0x1090
leaq 0x1f6e(%rip), %rdi      # 0x4ac9
callq 0x1090
leaq 0x1f75(%rip), %rdi      # 0x4adc
callq 0x1090
leaq 0x1fb2(%rip), %rdi      # 0x4b25
callq 0x1090
leaq 0x1fbb(%rip), %rdi      # 0x4b3a
callq 0x1090
leaq 0x1ffc(%rip), %rdi      # 0x4b87
callq 0x1090
leaq 0x2004(%rip), %rdi      # 0x4b9b
callq 0x1090
leaq 0x2053(%rip), %rdi      # 0x4bf6
callq 0x1090
leaq 0x2060(%rip), %rdi      # 0x4c0f
callq 0x1090
leaq 0x2092(%rip), %rdi      # 0x4c4d
callq 0x1090
leaq 0x209e(%rip), %rdi      # 0x4c65
callq 0x1090
leaq 0x20d5(%rip), %rdi      # 0x4ca8
callq 0x1090
leaq 0x20e1(%rip), %rdi      # 0x4cc0
callq 0x1090
leaq 0x2133(%rip), %rdi      # 0x4d1e
callq 0x1090
leaq 0x2140(%rip), %rdi      # 0x4d37
callq 0x1090
leaq 0x21a6(%rip), %rdi      # 0x4da9
callq 0x1090
leaq 0x21b3(%rip), %rdi      # 0x4dc2
callq 0x1090
leaq 0x21f2(%rip), %rdi      # 0x4e0d
callq 0x1090
leaq 0x2200(%rip), %rdi      # 0x4e27
callq 0x1090
leaq 0x226c(%rip), %rdi      # 0x4e9f
callq 0x1090
leaq 0x16c0(%rip), %rdi      # 0x42ff
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x10f0
leaq 0x225d(%rip), %rdi      # 0x4eac
callq 0x1090
leaq 0x2261(%rip), %rdi      # 0x4ebc
callq 0x1090
jmp 0x313d
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x16d8(%rip), %rdi      # 0x4349
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2c91
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x451f(%rip)      # 0x71b0
leaq 0x16bf(%rip), %rdi      # 0x4357
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2cb8
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x44a8(%rip)      # 0x7160
leaq 0x16a1(%rip), %rdi      # 0x4360
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2cdf
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4491(%rip)      # 0x7170
leaq 0x1687(%rip), %rdi      # 0x436d
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2d06
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4466(%rip)      # 0x716c
leaq 0x1666(%rip), %rdi      # 0x4373
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2d2f
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x443b(%rip)      # 0x7168
jmp 0x2d35
movl 0x4433(%rip), %eax      # 0x7168
movslq %eax, %rdi
shlq $0x3, %rdi
callq 0x11b0
movq %rax, 0x5078(%rip)      # 0x7dc0
leaq 0x162d(%rip), %rdi      # 0x437c
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2d71
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x440f(%rip)     # 0x7180
leaq 0x160b(%rip), %rdi      # 0x4383
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2d9a
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x43ee(%rip)     # 0x7188
leaq 0x15e9(%rip), %rdi      # 0x438a
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2dc3
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x43b5(%rip)     # 0x7178
leaq 0x1989(%rip), %rdi      # 0x4753
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2dec
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x10b0
movsd %xmm0, 0x43a4(%rip)     # 0x7190
leaq 0x159c(%rip), %rdi      # 0x438f
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2e13
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x43a9(%rip)      # 0x71bc
leaq 0x157d(%rip), %rdi      # 0x4397
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2e3c
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x433a(%rip)      # 0x7174
jmp 0x2e42
movl 0x4332(%rip), %eax      # 0x7174
cmpl $0x2, %eax
jb 0x2e51
movl $0x2, 0x4323(%rip)      # 0x7174
leaq 0x1546(%rip), %rdi      # 0x439e
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2e78
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4340(%rip)      # 0x71b8
leaq 0x152c(%rip), %rdi      # 0x43ab
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2ea2
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x5715(%rip), %rdi      # 0x85b0
callq 0x1060
jmp 0x2ebc
movabsq $0x78742e6261636f76, %rax # imm = 0x78742E6261636F76
movq %rax, 0x56fd(%rip)      # 0x85b0
movw $0x74, 0x56fc(%rip)     # 0x85b8
leaq 0x14f4(%rip), %rdi      # 0x43b7
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2ee6
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x4ef1(%rip), %rdi      # 0x7dd0
callq 0x1060
jmp 0x2ef7
movabsq $0x73726f74636576, %rax # imm = 0x73726F74636576
movq %rax, 0x4ed9(%rip)      # 0x7dd0
leaq 0x152a(%rip), %rdi      # 0x4428
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2f2b
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x52a6(%rip), %rdi      # 0x81c0
callq 0x1060
movl $0x1, 0x428f(%rip)      # 0x71b8
jmp 0x2f48
cmpl $0x0, 0x4286(%rip)      # 0x71b8
jle 0x2f48
movl $0x717364, 0x5285(%rip) # imm = 0x717364
movl $0x64617267, 0x5278(%rip) # imm = 0x64617267
leaq 0x1473(%rip), %rdi      # 0x43c2
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2f72
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x4a65(%rip), %rdi      # 0x79d0
callq 0x1060
jmp 0x2f91
movups 0x1ac0(%rip), %xmm0     # 0x4a39
movaps %xmm0, 0x4a50(%rip)     # 0x79d0
movabsq $0x6e69622e667568, %rax # imm = 0x6E69622E667568
movq %rax, 0x4a4d(%rip)      # 0x79de
leaq 0x1436(%rip), %rdi      # 0x43ce
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2fb8
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x4208(%rip)      # 0x71c0
leaq 0x1421(%rip), %rdi      # 0x43e0
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x2fe2
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x4215(%rip), %rdi      # 0x71f0
callq 0x1060
jmp 0x2ff0
movups 0x1408(%rip), %xmm0     # 0x43f1
movaps %xmm0, 0x4200(%rip)     # 0x71f0
leaq 0x140a(%rip), %rdi      # 0x4401
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x3017
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x41ad(%rip)      # 0x71c4
leaq 0x13f4(%rip), %rdi      # 0x4412
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x303e
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x418a(%rip)      # 0x71c8
leaq 0x13de(%rip), %rdi      # 0x4423
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x3068
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rsi
leaq 0x457f(%rip), %rdi      # 0x75e0
callq 0x1060
jmp 0x308a
movabsq $0x6e69622e303030, %rax # imm = 0x6E69622E303030
movq %rax, 0x456e(%rip)      # 0x75e7
movabsq $0x302e717364617267, %rax # imm = 0x302E717364617267
movq %rax, 0x4556(%rip)      # 0x75e0
leaq 0x13b3(%rip), %rdi      # 0x4444
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x30b1
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x411b(%rip)      # 0x71cc
leaq 0x139e(%rip), %rdi      # 0x4456
movl %ebp, %esi
movq %rbx, %rdx
callq 0x32e8
testl %eax, %eax
jle 0x30d8
movl %eax, %eax
movq 0x8(%rbx,%rax,8), %rdi
callq 0x1210
movl %eax, 0x40dc(%rip)      # 0x71b4
andq $0x0, 0x40f0(%rip)      # 0x71d0
leaq 0x54c9(%rip), %rdi      # 0x85b0
leaq 0x1267(%rip), %rsi      # 0x4355
callq 0x1200
testq %rax, %rax
je 0x3152
movq %rax, %rbx
movq %rbx, %rdi
callq 0x1280
cmpl $0xa, %eax
je 0x310f
cmpl $-0x1, %eax
jne 0x30fb
jmp 0x3118
incq 0x40ba(%rip)            # 0x71d0
jmp 0x30fb
movq %rbx, %rdi
callq 0x10e0
cmpq $0x0, 0x40a8(%rip)      # 0x71d0
je 0x3180
callq 0x2578
movl %eax, %ebx
movq 0x4c88(%rip), %rdi      # 0x7dc0
callq 0x1030
movq 0x4094(%rip), %rdi      # 0x71d8
callq 0x1030
leaq 0x4090(%rip), %rax      # 0x71e0
jmp 0x316f
leaq 0x1079(%rip), %rdi      # 0x41d2
leaq 0x5450(%rip), %rsi      # 0x85b0
callq 0x33e1
pushq $0x1
popq %rbx
leaq 0x4c51(%rip), %rax      # 0x7dc0
movq (%rax), %rdi
callq 0x1030
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x3e71(%rip), %rax      # 0x6ff8
movq (%rax), %rdi
leaq 0x12cb(%rip), %rsi      # 0x445c
leaq 0x5418(%rip), %rdx      # 0x85b0
xorl %eax, %eax
callq 0x1170
jmp 0x3165
nopl (%rax)