// File: /workspace/github_c_makefile_star2_O0/stanfordnlp[P]GloVe/src/glove.c
// Function: save_params
int save_params(int nb_iter) {
    /*
     * nb_iter is the number of iteration (= a full pass through the cooccurrence matrix).
     *   nb_iter  > 0 => checkpointing the intermediate parameters, so nb_iter is in the filename of output file.
     *   nb_iter == 0 => checkpointing the initial parameters
     *   else         => saving the final paramters, so nb_iter is ignored.
     */

    long long a, b;
    char format[20];
    char output_file[MAX_STRING_LENGTH+20], output_file_gsq[MAX_STRING_LENGTH+20];
    char *word = malloc(sizeof(char) * MAX_STRING_LENGTH + 1);
    if (NULL == word) {
        return 1;
    }
    FILE *fid, *fout;
    FILE *fgs = NULL;
    
    if (use_binary > 0 || nb_iter == 0) {
        // Save parameters in binary file
        // note: always save initial parameters in binary, as the reading code expects binary
        if (nb_iter < 0)
            sprintf(output_file,"%s.bin",save_W_file);
        else
            sprintf(output_file,"%s.%03d.bin",save_W_file,nb_iter);

        fout = fopen(output_file,"wb");
        if (fout == NULL) {log_file_loading_error("weights file", save_W_file); free(word); return 1;}
        for (a = 0; a < 2 * vocab_size * (vector_size + 1); a++) fwrite(&W[a], sizeof(real), 1,fout);
        fclose(fout);
        if (save_gradsq > 0) {
            if (nb_iter < 0)
                sprintf(output_file_gsq,"%s.bin",save_gradsq_file);
            else
                sprintf(output_file_gsq,"%s.%03d.bin",save_gradsq_file,nb_iter);

            fgs = fopen(output_file_gsq,"wb");
            if (fgs == NULL) {log_file_loading_error("gradsq file", save_gradsq_file); free(word); return 1;}
            for (a = 0; a < 2 * vocab_size * (vector_size + 1); a++) fwrite(&gradsq[a], sizeof(real), 1,fgs);
            fclose(fgs);
        }
    }
    if (use_binary != 1) { // Save parameters in text file
        if (nb_iter < 0)
            sprintf(output_file,"%s.txt",save_W_file);
        else
            sprintf(output_file,"%s.%03d.txt",save_W_file,nb_iter);
        if (save_gradsq > 0) {
            if (nb_iter < 0)
                sprintf(output_file_gsq,"%s.txt",save_gradsq_file);
            else
                sprintf(output_file_gsq,"%s.%03d.txt",save_gradsq_file,nb_iter);

            fgs = fopen(output_file_gsq,"wb");
            if (fgs == NULL) {log_file_loading_error("gradsq file", save_gradsq_file); free(word); return 1;}
        }
        fout = fopen(output_file,"wb");
        if (fout == NULL) {log_file_loading_error("weights file", save_W_file); free(word); return 1;}
        fid = fopen(vocab_file, "r");
        sprintf(format,"%%%ds",MAX_STRING_LENGTH);
        if (fid == NULL) {log_file_loading_error("vocab file", vocab_file); free(word); fclose(fout); return 1;}
        if (write_header) fprintf(fout, "%lld %d\n", vocab_size, vector_size);
        for (a = 0; a < vocab_size; a++) {
            if (fscanf(fid,format,word) == 0) {free(word); fclose(fid); fclose(fout); return 1;}
            // input vocab cannot contain special <unk> keyword
            if (strcmp(word, "<unk>") == 0) {free(word); fclose(fid); fclose(fout);  return 1;}
            fprintf(fout, "%s",word);
            if (model == 0) { // Save all parameters (including bias)
                for (b = 0; b < (vector_size + 1); b++) fprintf(fout," %lf", W[a * (vector_size + 1) + b]);
                for (b = 0; b < (vector_size + 1); b++) fprintf(fout," %lf", W[(vocab_size + a) * (vector_size + 1) + b]);
            }
            if (model == 1) // Save only "word" vectors (without bias)
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", W[a * (vector_size + 1) + b]);
            if (model == 2) // Save "word + context word" vectors (without bias)
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", W[a * (vector_size + 1) + b] + W[(vocab_size + a) * (vector_size + 1) + b]);
            if (model == 3) { // Save "word" and "context" vectors (without bias; row-concatenated)
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", W[a * (vector_size + 1) + b]);
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", W[(vocab_size + a) * (vector_size + 1) + b]);
            }
            fprintf(fout,"\n");
            if (save_gradsq > 0) { // Save gradsq
                fprintf(fgs, "%s",word);
                for (b = 0; b < (vector_size + 1); b++) fprintf(fgs," %lf", gradsq[a * (vector_size + 1) + b]);
                for (b = 0; b < (vector_size + 1); b++) fprintf(fgs," %lf", gradsq[(vocab_size + a) * (vector_size + 1) + b]);
                fprintf(fgs,"\n");
            }
            if (fscanf(fid,format,word) == 0) {
                // Eat irrelevant frequency entry
                fclose(fout);
                fclose(fid);
                free(word); 
                return 1;
                } 
        }

        if (use_unk_vec) {
            real* unk_vec = (real*)calloc((vector_size + 1), sizeof(real));
            real* unk_context = (real*)calloc((vector_size + 1), sizeof(real));
            strcpy(word, "<unk>");

            long long num_rare_words = vocab_size < 100 ? vocab_size : 100;

            for (a = vocab_size - num_rare_words; a < vocab_size; a++) {
                for (b = 0; b < (vector_size + 1); b++) {
                    unk_vec[b] += W[a * (vector_size + 1) + b] / num_rare_words;
                    unk_context[b] += W[(vocab_size + a) * (vector_size + 1) + b] / num_rare_words;
                }
            }

            fprintf(fout, "%s",word);
            if (model == 0) { // Save all parameters (including bias)
                for (b = 0; b < (vector_size + 1); b++) fprintf(fout," %lf", unk_vec[b]);
                for (b = 0; b < (vector_size + 1); b++) fprintf(fout," %lf", unk_context[b]);
            }
            if (model == 1) // Save only "word" vectors (without bias)
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", unk_vec[b]);
            if (model == 2) // Save "word + context word" vectors (without bias)
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", unk_vec[b] + unk_context[b]);
            if (model == 3) { // Save "word" and "context" vectors (without bias; row-concatenated)
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", unk_vec[b]);
                for (b = 0; b < vector_size; b++) fprintf(fout," %lf", unk_context[b]);
            }
            fprintf(fout,"\n");

            free(unk_vec);
            free(unk_context);
        }

        fclose(fid);
        fclose(fout);
        if (save_gradsq > 0) fclose(fgs);
    }
    free(word);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x870, %rsp            # imm = 0x870
movl %edi, -0x8(%rbp)
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x1180
movq %rax, -0x838(%rbp)
xorl %eax, %eax
cmpq -0x838(%rbp), %rax
jne 0x2046
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
movq $0x0, -0x850(%rbp)
cmpl $0x0, 0x6144(%rip)      # 0x819c
jg 0x2064
cmpl $0x0, -0x8(%rbp)
jne 0x2271
cmpl $0x0, -0x8(%rbp)
jge 0x2088
leaq -0x430(%rbp), %rdi
leaq 0x30f2(%rip), %rsi      # 0x516a
leaq 0x6d31(%rip), %rdx      # 0x8db0
movb $0x0, %al
callq 0x11f0
jmp 0x20a7
leaq -0x430(%rbp), %rdi
movl -0x8(%rbp), %ecx
leaq 0x30d8(%rip), %rsi      # 0x5171
leaq 0x6d10(%rip), %rdx      # 0x8db0
movb $0x0, %al
callq 0x11f0
leaq -0x430(%rbp), %rdi
leaq 0x30c8(%rip), %rsi      # 0x517d
callq 0x11d0
movq %rax, -0x848(%rbp)
cmpq $0x0, -0x848(%rbp)
jne 0x20f6
leaq 0x30ae(%rip), %rdi      # 0x5180
leaq 0x6cd7(%rip), %rsi      # 0x8db0
callq 0x4120
movq -0x838(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x60a7(%rip), %rcx      # 0x81b0
shlq %rcx
movl 0x6046(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
cmpq %rcx, %rax
jge 0x2157
movq 0x6090(%rip), %rdi      # 0x81b8
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x848(%rbp), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x1210
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x20fe
movq -0x848(%rbp), %rdi
callq 0x10d0
cmpl $0x0, 0x602e(%rip)      # 0x8198
jle 0x226f
cmpl $0x0, -0x8(%rbp)
jge 0x2194
leaq -0x830(%rbp), %rdi
leaq 0x2fe6(%rip), %rsi      # 0x516a
leaq 0x7015(%rip), %rdx      # 0x91a0
movb $0x0, %al
callq 0x11f0
jmp 0x21b3
leaq -0x830(%rbp), %rdi
movl -0x8(%rbp), %ecx
leaq 0x2fcc(%rip), %rsi      # 0x5171
leaq 0x6ff4(%rip), %rdx      # 0x91a0
movb $0x0, %al
callq 0x11f0
leaq -0x830(%rbp), %rdi
leaq 0x2fbc(%rip), %rsi      # 0x517d
callq 0x11d0
movq %rax, -0x850(%rbp)
cmpq $0x0, -0x850(%rbp)
jne 0x2202
leaq 0x2faf(%rip), %rdi      # 0x518d
leaq 0x6fbb(%rip), %rsi      # 0x91a0
callq 0x4120
movq -0x838(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x5f9b(%rip), %rcx      # 0x81b0
shlq %rcx
movl 0x5f3a(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
cmpq %rcx, %rax
jge 0x2263
movq 0x5f8c(%rip), %rdi      # 0x81c0
movq -0x10(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x850(%rbp), %rcx
movl $0x8, %esi
movl $0x1, %edx
callq 0x1210
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x220a
movq -0x850(%rbp), %rdi
callq 0x10d0
jmp 0x2271
cmpl $0x1, 0x5f24(%rip)      # 0x819c
je 0x2d67
cmpl $0x0, -0x8(%rbp)
jge 0x22a2
leaq -0x430(%rbp), %rdi
leaq 0x2f07(%rip), %rsi      # 0x5199
leaq 0x6b17(%rip), %rdx      # 0x8db0
movb $0x0, %al
callq 0x11f0
jmp 0x22c1
leaq -0x430(%rbp), %rdi
movl -0x8(%rbp), %ecx
leaq 0x2eed(%rip), %rsi      # 0x51a0
leaq 0x6af6(%rip), %rdx      # 0x8db0
movb $0x0, %al
callq 0x11f0
cmpl $0x0, 0x5ed0(%rip)      # 0x8198
jle 0x2362
cmpl $0x0, -0x8(%rbp)
jge 0x22f2
leaq -0x830(%rbp), %rdi
leaq 0x2eb7(%rip), %rsi      # 0x5199
leaq 0x6eb7(%rip), %rdx      # 0x91a0
movb $0x0, %al
callq 0x11f0
jmp 0x2311
leaq -0x830(%rbp), %rdi
movl -0x8(%rbp), %ecx
leaq 0x2e9d(%rip), %rsi      # 0x51a0
leaq 0x6e96(%rip), %rdx      # 0x91a0
movb $0x0, %al
callq 0x11f0
leaq -0x830(%rbp), %rdi
leaq 0x2e5e(%rip), %rsi      # 0x517d
callq 0x11d0
movq %rax, -0x850(%rbp)
cmpq $0x0, -0x850(%rbp)
jne 0x2360
leaq 0x2e51(%rip), %rdi      # 0x518d
leaq 0x6e5d(%rip), %rsi      # 0x91a0
callq 0x4120
movq -0x838(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
jmp 0x2362
leaq -0x430(%rbp), %rdi
leaq 0x2e0d(%rip), %rsi      # 0x517d
callq 0x11d0
movq %rax, -0x848(%rbp)
cmpq $0x0, -0x848(%rbp)
jne 0x23b1
leaq 0x2df3(%rip), %rdi      # 0x5180
leaq 0x6a1c(%rip), %rsi      # 0x8db0
callq 0x4120
movq -0x838(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
leaq 0x71d8(%rip), %rdi      # 0x9590
leaq 0x3a8b(%rip), %rsi      # 0x5e4a
callq 0x11d0
movq %rax, -0x840(%rbp)
leaq -0x30(%rbp), %rdi
leaq 0x2dd6(%rip), %rsi      # 0x51ac
movl $0x3e8, %edx            # imm = 0x3E8
movb $0x0, %al
callq 0x11f0
cmpq $0x0, -0x840(%rbp)
jne 0x2423
leaq 0x2dbf(%rip), %rdi      # 0x51b2
leaq 0x7196(%rip), %rsi      # 0x9590
callq 0x4120
movq -0x838(%rbp), %rdi
callq 0x1030
movq -0x848(%rbp), %rdi
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
cmpl $0x0, 0x5d66(%rip)      # 0x8190
je 0x244e
movq -0x848(%rbp), %rdi
movq 0x5d76(%rip), %rdx      # 0x81b0
movl 0x5d18(%rip), %ecx      # 0x8158
leaq 0x2d76(%rip), %rsi      # 0x51bd
movb $0x0, %al
callq 0x1140
movq $0x0, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x5d4f(%rip), %rax      # 0x81b0
jge 0x2954
movq -0x840(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq -0x838(%rbp), %rdx
movb $0x0, %al
callq 0x1080
cmpl $0x0, %eax
jne 0x24b5
movq -0x838(%rbp), %rdi
callq 0x1030
movq -0x840(%rbp), %rdi
callq 0x10d0
movq -0x848(%rbp), %rdi
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
movq -0x838(%rbp), %rdi
leaq 0x2d03(%rip), %rsi      # 0x51c6
callq 0x1130
cmpl $0x0, %eax
jne 0x24fd
movq -0x838(%rbp), %rdi
callq 0x1030
movq -0x840(%rbp), %rdi
callq 0x10d0
movq -0x848(%rbp), %rdi
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
movq -0x848(%rbp), %rdi
movq -0x838(%rbp), %rdx
leaq 0x2cba(%rip), %rsi      # 0x51cc
movb $0x0, %al
callq 0x1140
cmpl $0x0, 0x5c3c(%rip)      # 0x815c
jne 0x25f7
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x5c20(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x258a
movq -0x848(%rbp), %rdi
movq 0x5c67(%rip), %rax      # 0x81b8
movq -0x10(%rbp), %rcx
movl 0x5bfd(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2c5a(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x252e
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x5bbc(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x25f5
movq -0x848(%rbp), %rdi
movq 0x5c03(%rip), %rax      # 0x81b8
movq 0x5bf4(%rip), %rcx      # 0x81b0
addq -0x10(%rbp), %rcx
movl 0x5b92(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2bef(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2592
jmp 0x25f7
cmpl $0x1, 0x5b5e(%rip)      # 0x815c
jne 0x2661
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x5b45(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x265f
movq -0x848(%rbp), %rdi
movq 0x5b92(%rip), %rax      # 0x81b8
movq -0x10(%rbp), %rcx
movl 0x5b28(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2b85(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2608
jmp 0x2661
cmpl $0x2, 0x5af4(%rip)      # 0x815c
jne 0x26fd
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x5ad7(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x26fb
movq -0x848(%rbp), %rdi
movq 0x5b24(%rip), %rax      # 0x81b8
movq -0x10(%rbp), %rcx
movl 0x5aba(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq 0x5b00(%rip), %rax      # 0x81b8
movq 0x5af1(%rip), %rcx      # 0x81b0
addq -0x10(%rbp), %rcx
movl 0x5a8f(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
leaq 0x2aec(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2676
jmp 0x26fd
cmpl $0x3, 0x5a58(%rip)      # 0x815c
jne 0x27d1
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x5a3b(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x2769
movq -0x848(%rbp), %rdi
movq 0x5a88(%rip), %rax      # 0x81b8
movq -0x10(%rbp), %rcx
movl 0x5a1e(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2a7b(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2712
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x59dc(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x27cf
movq -0x848(%rbp), %rdi
movq 0x5a29(%rip), %rax      # 0x81b8
movq 0x5a1a(%rip), %rcx      # 0x81b0
addq -0x10(%rbp), %rcx
movl 0x59b8(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2a15(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2771
jmp 0x27d1
movq -0x848(%rbp), %rdi
leaq 0x2b6a(%rip), %rsi      # 0x5349
movb $0x0, %al
callq 0x1140
cmpl $0x0, 0x59ab(%rip)      # 0x8198
jle 0x28f3
movq -0x850(%rbp), %rdi
movq -0x838(%rbp), %rdx
leaq 0x29c4(%rip), %rsi      # 0x51cc
movb $0x0, %al
callq 0x1140
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x5937(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x2873
movq -0x850(%rbp), %rdi
movq 0x5986(%rip), %rax      # 0x81c0
movq -0x10(%rbp), %rcx
movl 0x5914(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2971(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2817
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x58d3(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x28de
movq -0x850(%rbp), %rdi
movq 0x5922(%rip), %rax      # 0x81c0
movq 0x590b(%rip), %rcx      # 0x81b0
addq -0x10(%rbp), %rcx
movl 0x58a9(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2906(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x287b
movq -0x850(%rbp), %rdi
leaq 0x2a5d(%rip), %rsi      # 0x5349
movb $0x0, %al
callq 0x1140
movq -0x840(%rbp), %rdi
leaq -0x30(%rbp), %rsi
movq -0x838(%rbp), %rdx
movb $0x0, %al
callq 0x1080
cmpl $0x0, %eax
jne 0x2941
movq -0x848(%rbp), %rdi
callq 0x10d0
movq -0x840(%rbp), %rdi
callq 0x10d0
movq -0x838(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
jmp 0x2d7a
jmp 0x2943
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x2456
cmpl $0x0, 0x57f1(%rip)      # 0x814c
je 0x2d38
movl 0x57f1(%rip), %eax      # 0x8158
addl $0x1, %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x1120
movq %rax, -0x858(%rbp)
movl 0x57d4(%rip), %eax      # 0x8158
addl $0x1, %eax
movslq %eax, %rdi
movl $0x8, %esi
callq 0x1120
movq %rax, -0x860(%rbp)
movq -0x838(%rbp), %rdi
leaq 0x281d(%rip), %rsi      # 0x51c6
callq 0x1060
cmpq $0x64, 0x57fa(%rip)     # 0x81b0
jge 0x29c8
movq 0x57f1(%rip), %rax      # 0x81b0
movq %rax, -0x870(%rbp)
jmp 0x29d6
movl $0x64, %eax
movq %rax, -0x870(%rbp)
jmp 0x29d6
movq -0x870(%rbp), %rax
movq %rax, -0x868(%rbp)
movq 0x57c5(%rip), %rax      # 0x81b0
subq -0x868(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq 0x57af(%rip), %rax      # 0x81b0
jge 0x2adf
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x573f(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x2acc
movq 0x5789(%rip), %rax      # 0x81b8
movq -0x10(%rbp), %rcx
movl 0x571f(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdq -0x868(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x858(%rbp), %rax
movq -0x18(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq 0x5743(%rip), %rax      # 0x81b8
movq 0x5734(%rip), %rcx      # 0x81b0
addq -0x10(%rbp), %rcx
movl 0x56d2(%rip), %edx      # 0x8158
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
addq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
cvtsi2sdq -0x868(%rbp), %xmm1
divsd %xmm1, %xmm0
movq -0x860(%rbp), %rax
movq -0x18(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
movsd %xmm0, (%rax,%rcx,8)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2a0f
jmp 0x2ace
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x29f6
movq -0x848(%rbp), %rdi
movq -0x838(%rbp), %rdx
leaq 0x26d8(%rip), %rsi      # 0x51cc
movb $0x0, %al
callq 0x1140
cmpl $0x0, 0x565a(%rip)      # 0x815c
jne 0x2baa
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x563e(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x2b58
movq -0x848(%rbp), %rdi
movq -0x858(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x268c(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2b10
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl 0x55ee(%rip), %ecx      # 0x8158
addl $0x1, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x2ba8
movq -0x848(%rbp), %rdi
movq -0x860(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x263c(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2b60
jmp 0x2baa
cmpl $0x1, 0x55ab(%rip)      # 0x815c
jne 0x2c00
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x5592(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x2bfe
movq -0x848(%rbp), %rdi
movq -0x858(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x25e6(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2bbb
jmp 0x2c00
cmpl $0x2, 0x5555(%rip)      # 0x815c
jne 0x2c66
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x553c(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x2c64
movq -0x848(%rbp), %rdi
movq -0x858(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movq -0x860(%rbp), %rax
movq -0x18(%rbp), %rcx
addsd (%rax,%rcx,8), %xmm0
leaq 0x2580(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2c11
jmp 0x2c66
cmpl $0x3, 0x54ef(%rip)      # 0x815c
jne 0x2d0b
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x54d2(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x2cbe
movq -0x848(%rbp), %rdi
movq -0x858(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x2526(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2c7b
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movslq 0x5487(%rip), %rcx      # 0x8158
cmpq %rcx, %rax
jge 0x2d09
movq -0x848(%rbp), %rdi
movq -0x860(%rbp), %rax
movq -0x18(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
leaq 0x24db(%rip), %rsi      # 0x51cf
movb $0x1, %al
callq 0x1140
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x2cc6
jmp 0x2d0b
movq -0x848(%rbp), %rdi
leaq 0x2630(%rip), %rsi      # 0x5349
movb $0x0, %al
callq 0x1140
movq -0x858(%rbp), %rdi
callq 0x1030
movq -0x860(%rbp), %rdi
callq 0x1030
movq -0x840(%rbp), %rdi
callq 0x10d0
movq -0x848(%rbp), %rdi
callq 0x10d0
cmpl $0x0, 0x5441(%rip)      # 0x8198
jle 0x2d65
movq -0x850(%rbp), %rdi
callq 0x10d0
jmp 0x2d67
movq -0x838(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x870, %rsp            # imm = 0x870
popq %rbp
retq
nopw %cs:(%rax,%rax)