// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x838, %rsp            # imm = 0x838
movl %edi, %r15d
movl $0x3e9, %edi            # imm = 0x3E9
callq 0x11b0
movl $0x1, %ebp
testq %rax, %rax
je 0x2b5e
movq %rax, %rbx
testl %r15d, %r15d
movq %rax, (%rsp)
je 0x22af
cmpl $0x0, 0x4f63(%rip)      # 0x71bc
jg 0x22af
xorl %r14d, %r14d
testl %r15d, %r15d
js 0x22dd
leaq 0x1f76(%rip), %rsi      # 0x41e0
leaq 0x5b5f(%rip), %rdx      # 0x7dd0
leaq 0x430(%rsp), %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1220
cmpl $0x0, 0x4f2e(%rip)      # 0x71b8
jle 0x233a
leaq 0x1f49(%rip), %rsi      # 0x41e0
leaq 0x5f22(%rip), %rdx      # 0x81c0
leaq 0x30(%rsp), %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1220
jmp 0x231d
testl %r15d, %r15d
js 0x2976
leaq 0x1ef2(%rip), %rsi      # 0x41b1
leaq 0x5b0a(%rip), %rdx      # 0x7dd0
leaq 0x430(%rsp), %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1220
jmp 0x2993
leaq 0x1ef5(%rip), %rsi      # 0x41d9
leaq 0x5ae5(%rip), %rdx      # 0x7dd0
leaq 0x430(%rsp), %rdi
xorl %eax, %eax
callq 0x1220
cmpl $0x0, 0x4eb7(%rip)      # 0x71b8
jle 0x233a
leaq 0x1ecf(%rip), %rsi      # 0x41d9
leaq 0x5eaf(%rip), %rdx      # 0x81c0
leaq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x1220
leaq 0x1e99(%rip), %rsi      # 0x41bd
leaq 0x30(%rsp), %rdi
callq 0x1200
movq %rax, %r14
testq %rax, %rax
je 0x2b43
leaq 0x1e7c(%rip), %rsi      # 0x41bd
leaq 0x430(%rsp), %rdi
callq 0x1200
testq %rax, %rax
je 0x2a44
movq %rax, %r15
leaq 0x624f(%rip), %rdi      # 0x85b0
leaq 0x200d(%rip), %rsi      # 0x4375
callq 0x1200
movq %rax, %r12
leaq 0x1e75(%rip), %rsi      # 0x41ec
leaq 0x10(%rsp), %rdi
movl $0x3e8, %edx            # imm = 0x3E8
xorl %eax, %eax
callq 0x1220
movq %r12, 0x8(%rsp)
testq %r12, %r12
je 0x2a5f
cmpl $0x0, 0x4e13(%rip)      # 0x71b0
je 0x23bd
movq 0x4e2a(%rip), %rdx      # 0x71d0
movl 0x4dc4(%rip), %ecx      # 0x7170
leaq 0x1e4a(%rip), %rsi      # 0x41fd
movq %r15, %rdi
xorl %eax, %eax
callq 0x1170
movq 0x4e0c(%rip), %rbx      # 0x71d0
testq %rbx, %rbx
jle 0x26cf
leaq 0x1e38(%rip), %r13      # 0x420c
xorl %r12d, %r12d
xorl %ebp, %ebp
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq (%rsp), %rbx
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1080
testl %eax, %eax
je 0x2b72
movq %rbx, %rdi
leaq 0x1e03(%rip), %rsi      # 0x4206
callq 0x1160
testl %eax, %eax
je 0x2b72
movq %rbx, %rdi
movq %r15, %rsi
callq 0x1100
movl 0x4d53(%rip), %ecx      # 0x7174
movl 0x4d49(%rip), %eax      # 0x7170
testl %ecx, %ecx
jne 0x24b5
testl %eax, %eax
js 0x24af
incq %rax
movq %rax, %rcx
xorl %ebx, %ebx
imulq %r12, %rcx
addq 0x4d92(%rip), %rcx      # 0x71d8
movsd (%rcx,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4d0e(%rip), %rax      # 0x7170
leaq 0x1(%rax), %rcx
cmpq %rcx, %rbx
jl 0x243b
testl %eax, %eax
js 0x24af
xorl %ebx, %ebx
movq 0x4d58(%rip), %rax      # 0x71d0
addq %rbp, %rax
imulq %rcx, %rax
shlq $0x3, %rax
addq 0x4d4e(%rip), %rax      # 0x71d8
movsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4cca(%rip), %rax      # 0x7170
leaq 0x1(%rax), %rcx
cmpq %rcx, %rbx
jl 0x2471
movl 0x4cbf(%rip), %ecx      # 0x7174
cmpl $0x1, %ecx
sete %dl
testl %eax, %eax
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2502
xorl %ebx, %ebx
incl %eax
cltq
imulq %r12, %rax
addq 0x4cfd(%rip), %rax      # 0x71d8
movsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4c79(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x24cc
movl 0x4c72(%rip), %ecx      # 0x7174
cmpl $0x2, %ecx
jne 0x2564
testl %eax, %eax
jle 0x25e3
xorl %ebx, %ebx
movq 0x4cc0(%rip), %rcx      # 0x71d8
incl %eax
cltq
movq %r12, %rdx
imulq %rax, %rdx
addq %rcx, %rdx
movsd (%rdx,%rbx,8), %xmm0
movq 0x4c9e(%rip), %rdx      # 0x71d0
addq %rbp, %rdx
imulq %rax, %rdx
leaq (%rcx,%rdx,8), %rax
addsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4c17(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x2511
movl 0x4c10(%rip), %ecx      # 0x7174
cmpl $0x3, %ecx
jne 0x25e3
testl %eax, %eax
jle 0x25e3
xorl %ebx, %ebx
incl %eax
cltq
imulq %r12, %rax
addq 0x4c5a(%rip), %rax      # 0x71d8
movsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4bd6(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x256f
testl %eax, %eax
jle 0x25e3
xorl %ebx, %ebx
incl %eax
cltq
movq 0x4c20(%rip), %rcx      # 0x71d0
addq %rbp, %rcx
imulq %rax, %rcx
shlq $0x3, %rcx
addq 0x4c16(%rip), %rcx      # 0x71d8
movsd (%rcx,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4b92(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x25a5
movl $0xa, %edi
movq %r15, %rsi
callq 0x1130
cmpl $0x0, 0x4bc1(%rip)      # 0x71b8
jle 0x2698
movq (%rsp), %rdi
movq %r14, %rsi
callq 0x1100
movl 0x4b61(%rip), %eax      # 0x7170
testl %eax, %eax
js 0x268b
incq %rax
xorl %ebx, %ebx
imulq %r12, %rax
addq 0x4bbd(%rip), %rax      # 0x71e0
movsd (%rax,%rbx,8), %xmm0
movq %r14, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4b31(%rip), %rcx      # 0x7170
leaq 0x1(%rcx), %rax
cmpq %rax, %rbx
jl 0x2618
testl %ecx, %ecx
js 0x268b
xorl %ebx, %ebx
movq 0x4b7b(%rip), %rcx      # 0x71d0
addq %rbp, %rcx
imulq %rax, %rcx
shlq $0x3, %rcx
addq 0x4b79(%rip), %rcx      # 0x71e0
movsd (%rcx,%rbx,8), %xmm0
movq %r14, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4aed(%rip), %rax      # 0x7170
incq %rax
cmpq %rax, %rbx
jl 0x264e
movl $0xa, %edi
movq %r14, %rsi
callq 0x1130
movq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq (%rsp), %rbx
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1080
testl %eax, %eax
je 0x2b8e
incq %rbp
movq 0x4b0e(%rip), %rbx      # 0x71d0
addq $0x8, %r12
cmpq %rbx, %rbp
jl 0x23d9
cmpl $0x0, 0x4a8e(%rip)      # 0x7164
je 0x2946
movslq 0x4a8d(%rip), %rbp      # 0x7170
leaq 0x1(%rbp), %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0x1150
movq %rax, %r13
movl $0x8, %esi
movq %r12, %rdi
callq 0x1150
movq %rbp, %r9
movq %rax, %rbp
movq (%rsp), %rax
movl $0x6b6e753c, (%rax)     # imm = 0x6B6E753C
movw $0x3e, 0x4(%rax)
testq %rbx, %rbx
jle 0x27b0
cmpq $0x64, %rbx
movl $0x64, %esi
cmovbq %rbx, %rsi
movq %rbx, %rax
subq %rsi, %rax
movq 0x4a9b(%rip), %rdi      # 0x71d8
xorps %xmm0, %xmm0
cvtsi2sd %rsi, %xmm0
movq %rax, %rcx
imulq %r12, %rcx
leaq (%rdi,%rcx,8), %rcx
leaq 0x8(,%r9,8), %rdx
leaq (%rbx,%rbx), %r8
subq %rsi, %r8
imulq %r12, %r8
leaq (%rdi,%r8,8), %rsi
testl %r9d, %r9d
js 0x27a2
xorl %edi, %edi
movsd (%rcx,%rdi,8), %xmm1
divsd %xmm0, %xmm1
addsd (%r13,%rdi,8), %xmm1
movsd %xmm1, (%r13,%rdi,8)
movsd (%rsi,%rdi,8), %xmm1
divsd %xmm0, %xmm1
addsd (%rbp,%rdi,8), %xmm1
movsd %xmm1, (%rbp,%rdi,8)
incq %rdi
cmpq %rdi, %r12
jne 0x276e
incq %rax
addq %rdx, %rcx
addq %rdx, %rsi
cmpq %rbx, %rax
jl 0x2767
movq (%rsp), %rdi
movq %r15, %rsi
callq 0x1100
movl 0x49b2(%rip), %ecx      # 0x7174
movl 0x49a8(%rip), %eax      # 0x7170
testl %ecx, %ecx
jne 0x2839
testl %eax, %eax
js 0x2833
xorl %ebx, %ebx
leaq 0x1a33(%rip), %r12      # 0x420c
movsd (%r13,%rbx,8), %xmm0
movq %r15, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4979(%rip), %rax      # 0x7170
leaq 0x1(%rax), %rcx
cmpq %rcx, %rbx
jl 0x27d9
testl %eax, %eax
js 0x2833
xorl %ebx, %ebx
leaq 0x19ff(%rip), %r12      # 0x420c
movsd (%rbp,%rbx,8), %xmm0
movq %r15, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x4946(%rip), %rax      # 0x7170
leaq 0x1(%rax), %rcx
cmpq %rcx, %rbx
jl 0x280d
movl 0x493b(%rip), %ecx      # 0x7174
cmpl $0x1, %ecx
sete %dl
testl %eax, %eax
setg %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x2880
xorl %ebx, %ebx
leaq 0x19b5(%rip), %r12      # 0x420c
movsd (%r13,%rbx,8), %xmm0
movq %r15, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x48fb(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x2857
movl 0x48f4(%rip), %ecx      # 0x7174
cmpl $0x2, %ecx
jne 0x28c5
testl %eax, %eax
jle 0x2929
xorl %ebx, %ebx
leaq 0x1976(%rip), %r12      # 0x420c
movsd (%r13,%rbx,8), %xmm0
addsd (%rbp,%rbx,8), %xmm0
movq %r15, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x48b6(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x2896
movl 0x48af(%rip), %ecx      # 0x7174
cmpl $0x3, %ecx
jne 0x2929
testl %eax, %eax
jle 0x2929
xorl %ebx, %ebx
leaq 0x1935(%rip), %r12      # 0x420c
movsd (%r13,%rbx,8), %xmm0
movq %r15, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x487b(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x28d7
testl %eax, %eax
jle 0x2929
xorl %ebx, %ebx
leaq 0x1905(%rip), %r12      # 0x420c
movsd (%rbp,%rbx,8), %xmm0
movq %r15, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1170
incq %rbx
movslq 0x484c(%rip), %rax      # 0x7170
cmpq %rax, %rbx
jl 0x2907
movl $0xa, %edi
movq %r15, %rsi
callq 0x1130
movq %r13, %rdi
callq 0x1030
movq %rbp, %rdi
callq 0x1030
movq 0x8(%rsp), %rdi
callq 0x10e0
movq %r15, %rdi
callq 0x10e0
cmpl $0x0, 0x4859(%rip)      # 0x71b8
movq (%rsp), %rbx
jle 0x2b37
movq %r14, %rdi
callq 0x10e0
jmp 0x2b37
leaq 0x182d(%rip), %rsi      # 0x41aa
leaq 0x544c(%rip), %rdx      # 0x7dd0
leaq 0x430(%rsp), %rdi
xorl %eax, %eax
callq 0x1220
leaq 0x1823(%rip), %rsi      # 0x41bd
leaq 0x430(%rsp), %rdi
callq 0x1200
testq %rax, %rax
je 0x2a44
movq %rax, %r14
movslq 0x47b6(%rip), %rax      # 0x7170
incq %rax
imulq 0x480b(%rip), %rax      # 0x71d0
addq %rax, %rax
testq %rax, %rax
jle 0x2a0f
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x47ff(%rip), %rdi      # 0x71d8
addq %rbx, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x1240
movslq 0x477b(%rip), %rax      # 0x7170
incq %rax
imulq 0x47d0(%rip), %rax      # 0x71d0
incq %r12
addq %rax, %rax
addq $0x8, %rbx
cmpq %rax, %r12
jl 0x29d2
movq %r14, %rdi
callq 0x10e0
cmpl $0x0, 0x479a(%rip)      # 0x71b8
jle 0x2a57
testl %r15d, %r15d
js 0x2a87
leaq 0x1785(%rip), %rsi      # 0x41b1
leaq 0x578d(%rip), %rdx      # 0x81c0
leaq 0x30(%rsp), %rdi
movl %r15d, %ecx
xorl %eax, %eax
callq 0x1220
jmp 0x2aa1
leaq 0x1775(%rip), %rdi      # 0x41c0
leaq 0x537e(%rip), %rsi      # 0x7dd0
jmp 0x2b51
xorl %r14d, %r14d
jmp 0x2b26
leaq 0x178c(%rip), %rdi      # 0x41f2
leaq 0x5b43(%rip), %rsi      # 0x85b0
callq 0x1969
movq %rbx, %rdi
callq 0x1030
movq %r15, %rdi
callq 0x10e0
jmp 0x2b5e
leaq 0x171c(%rip), %rsi      # 0x41aa
leaq 0x572b(%rip), %rdx      # 0x81c0
leaq 0x30(%rsp), %rdi
xorl %eax, %eax
callq 0x1220
movq (%rsp), %rbx
leaq 0x1711(%rip), %rsi      # 0x41bd
leaq 0x30(%rsp), %rdi
callq 0x1200
testq %rax, %rax
je 0x2b43
movq %rax, %r14
movslq 0x46a7(%rip), %rax      # 0x7170
incq %rax
imulq 0x46fc(%rip), %rax      # 0x71d0
addq %rax, %rax
testq %rax, %rax
jle 0x2b1e
xorl %ebx, %ebx
xorl %r12d, %r12d
movq 0x46f8(%rip), %rdi      # 0x71e0
addq %rbx, %rdi
movl $0x8, %esi
movl $0x1, %edx
movq %r14, %rcx
callq 0x1240
movslq 0x466c(%rip), %rax      # 0x7170
incq %rax
imulq 0x46c1(%rip), %rax      # 0x71d0
incq %r12
addq %rax, %rax
addq $0x8, %rbx
cmpq %rax, %r12
jl 0x2ae1
movq %r14, %rdi
callq 0x10e0
cmpl $0x1, 0x468f(%rip)      # 0x71bc
movq (%rsp), %rbx
jne 0x225e
movq %rbx, %rdi
callq 0x1030
xorl %ebp, %ebp
jmp 0x2b5e
leaq 0x1683(%rip), %rdi      # 0x41cd
leaq 0x566f(%rip), %rsi      # 0x81c0
callq 0x1969
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x838, %rsp            # imm = 0x838
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x1030
movq 0x8(%rsp), %rdi
callq 0x10e0
movq %r15, %rdi
callq 0x10e0
jmp 0x2ba8
movq %r15, %rdi
callq 0x10e0
movq 0x8(%rsp), %rdi
callq 0x10e0
movq %rbx, %rdi
callq 0x1030
movl $0x1, %ebp
jmp 0x2b5e