// File: /workspace/github_cpp_makefile_star2_O1/maplechori[P]stata-reader-writer/SQLite.cpp
// Function: SQLite::write(Context&)
bool SQLite::write(Context & ctx) {
    char *zErrMsg = 0;
    int rc;
    stringstream sql_query;
    sqlite3_stmt *stmt = NULL;

    


    rc = sqlite3_exec(db,  "create table variables ("
                           "varpos integer primary key asc,"
                           "varname varchar(255),"
                           "vartype integer,"
                           "varformat varchar(20),"
                           "valuelabel varchar(255),"
                           "variablelabel varchar(255));" , NULL, 0, &zErrMsg);
    
    if( rc != SQLITE_OK )
    {
      cerr << "SQL error: " << zErrMsg << endl;
      sqlite3_free(zErrMsg);
      return false;
    }

    sql_query.str("");

    rc = sqlite3_prepare_v2(db, "INSERT INTO VARIABLES (VARPOS, VARNAME, VARTYPE, VARFORMAT, VALUELABEL, VARIABLELABEL ) VALUES ( NULL, ?, ?, ?, ?, ? )", -1, &stmt, NULL);

    if (rc != SQLITE_OK) {
        cerr << "SQLError prepare failed: " << sqlite3_errmsg(db) << endl;
        return false;
    } 

    sqlite3_exec(db, "BEGIN TRANSACTION", NULL, NULL, &zErrMsg);

    for (int j = 0; j < ctx.vList.size(); j++)
    {
        rc = sqlite3_bind_text(stmt, 1, ((StataVariables)*ctx.vList[j]).varname.c_str(), ((StataVariables)*ctx.vList[j]).varname.length(), SQLITE_STATIC);

        if (rc != SQLITE_OK) {
            cerr << "SQLError: varname bind failed: " << sqlite3_errmsg(db) << endl;
            return false;
        }

        rc = sqlite3_bind_int(stmt, 2, ((StataVariables)*ctx.vList[j]).type);

        if (rc != SQLITE_OK) {
            cerr << "SQLError: type bind failed: " << sqlite3_errmsg(db) << endl;
            return false;
        }

        rc = sqlite3_bind_text(stmt, 3, ((StataVariables)*ctx.vList[j]).format.c_str(), ((StataVariables)*ctx.vList[j]).format.length(), SQLITE_STATIC);

        if (rc != SQLITE_OK) {
            cerr << "SQLError: format bind failed: " << sqlite3_errmsg(db) << endl;
            return false;
        }

        rc = sqlite3_bind_text(stmt, 4, ((StataVariables)*ctx.vList[j]).vallbl.c_str(), ((StataVariables)*ctx.vList[j]).vallbl.length(), SQLITE_STATIC);

        if (rc != SQLITE_OK) {
            cerr << "SQLError: vallbl bind failed: " << sqlite3_errmsg(db) << endl;
            return false;
        }

        rc = sqlite3_bind_text(stmt, 5, ((StataVariables)*ctx.vList[j]).varlbl.c_str(), ((StataVariables)*ctx.vList[j]).varlbl.length(), SQLITE_STATIC);

        if (rc != SQLITE_OK) {
            cerr << "SQLError: varlbl bind failed: " << sqlite3_errmsg(db) << endl;
            return false;
        }
        
        rc =  sqlite3_step(stmt);

        if( rc != SQLITE_DONE )
        {
            cerr << "SQL error: "  << sqlite3_errmsg(db) << endl;
            return false;
        }
                    
        sqlite3_clear_bindings(stmt);    /* Clear bindings */
        sqlite3_reset(stmt);
    

    }  

    sqlite3_exec(db, "END TRANSACTION", NULL, NULL, &zErrMsg);

  
    rc = sqlite3_exec(db,  "create table vardata ("
                           "obs integer,"
                           "varpos integer,"
                           "value blob,"
                           "sizer int);" , NULL, 0, &zErrMsg);
    
    if( rc != SQLITE_OK )
    {
      cerr << "SQL error: " << zErrMsg << endl;
      sqlite3_free(zErrMsg);
      return false;
    }

    sqlite3_exec(db, "BEGIN TRANSACTION", NULL, NULL, &zErrMsg);

    rc = sqlite3_prepare_v2(db, "INSERT INTO VARDATA ( OBS, VARPOS, VALUE, SIZER ) VALUES ( ?, ?, ?, ? )", -1, &stmt, NULL);
    
    if (rc != SQLITE_OK) {
        cerr << "SQLError prepare failed: " << sqlite3_errmsg(db) << endl;
        return false;
    } 
    else 
    {
    
        for (int k = 0; k < ctx.vData.size(); k++)
        {
            for (int j = 0; j < ctx.vList.size(); j++)
            {
                int sz = 0;
                rc = sqlite3_bind_int(stmt, 1, k+1);

                
                if (rc != SQLITE_OK) {
                    cerr << "SQLError: obs bind failed: " << sqlite3_errmsg(db) << endl;
                    return false;
                }

                rc = sqlite3_bind_int(stmt, 2, j+1);
                if (rc != SQLITE_OK) {
                    cerr << "SQLError: varpos bind failed: " << sqlite3_errmsg(db) << endl;
                    return false;
                }                 
                
                switch(ctx.vList[j]->type)
                {
                    case ST_STRL:
                        cout << "Strl " << endl;             
                        break;
                    case ST_DOUBLE:  
                        sz=8;
                        break;
                    case ST_FLOAT:
                        sz=4;
                        break;
                    case ST_LONG:
                        sz=4;
                        break;
                    case ST_INT:
                        sz=2;
                        break;
                    case ST_BYTE:
                        sz=1;
                        break;
                    default: 
                        sz=strlen((*ctx.vData[k])[j]);
                        break;
                }                  

                rc = sqlite3_bind_blob(stmt,3, (*ctx.vData[k])[j], sz, SQLITE_STATIC);
                
                if (rc != SQLITE_OK) {
                    cerr << "SQLError blob bind failed: " << sqlite3_errmsg(db) << endl;
                    return false;
                } 

                rc = sqlite3_bind_int(stmt, 4, sz);
                if (rc != SQLITE_OK) {
                    cerr << "SQLError: sizer bind failed: " << sqlite3_errmsg(db) << endl;
                    return false;
                } 
                
                rc =  sqlite3_step(stmt);

                if( rc != SQLITE_DONE )
                {
                    cerr << "SQL error: "  << sqlite3_errmsg(db) << endl;
                    return false;
                }
                    
                sqlite3_clear_bindings(stmt);    /* Clear bindings */
                sqlite3_reset(stmt);
            }
        }
    } 
    
    sqlite3_exec(db, "END TRANSACTION", NULL, NULL, &zErrMsg);
    sqlite3_finalize(stmt);    
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rsi, %r14
movq %rdi, %r12
xorl %ebx, %ebx
leaq -0x48(%rbp), %r15
movq %rbx, (%r15)
leaq -0x2e8(%rbp), %rdi
callq 0x7250
movq %rbx, -0x38(%rbp)
movq 0x8(%r12), %rdi
leaq 0x2c35(%rip), %rsi      # 0x11c1c
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x7430
testl %eax, %eax
je 0xf03e
movq 0x9ff2(%rip), %rbx      # 0x18ff0
leaq 0x2cbe(%rip), %rsi      # 0x11cc3
movl $0xb, %edx
movq %rbx, %rdi
callq 0x73b0
movq -0x48(%rbp), %r14
testq %r14, %r14
je 0xf109
movq %r14, %rdi
callq 0x7160
movq 0x9fc2(%rip), %rdi      # 0x18ff0
movq %r14, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xf120
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x20cf(%rip), %rdx      # 0x1111f
leaq -0xd8(%rbp), %rdi
movq %rdx, %rsi
callq 0x8ede
leaq -0x2d0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x74b0
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf094
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
movq 0x8(%r12), %rdi
leaq 0x2c2f(%rip), %rsi      # 0x11ccf
leaq -0x38(%rbp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x72f0
testl %eax, %eax
je 0xf159
movq 0x9f30(%rip), %r14      # 0x18ff0
leaq 0x2c7f(%rip), %rsi      # 0x11d46
movl $0x19, %edx
movq %r14, %rdi
callq 0x73b0
movq 0x8(%r12), %rdi
callq 0x7310
movq %rax, %rbx
testq %rax, %rax
je 0xf8e1
movq %rbx, %rdi
callq 0x7160
movq 0x9ef7(%rip), %rdi      # 0x18ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xf8f9
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x7560
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x9eb2(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
movq -0x48(%rbp), %rdi
callq 0x73d0
jmp 0xf924
movq 0x8(%r12), %rdi
leaq 0x2bfb(%rip), %rsi      # 0x11d60
leaq -0x48(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movq %r12, -0x40(%rbp)
movq 0xc0(%r14), %rax
cmpq %rax, 0xc8(%r14)
je 0xf85e
xorl %ebx, %ebx
leaq -0x160(%rbp), %r12
xorl %r15d, %r15d
movq %r15, -0x50(%rbp)
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0x38(%rbp), %r15
leaq -0xd8(%rbp), %rdi
callq 0xffde
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0xd8(%rbp), %r13
movq %r12, %rdi
callq 0xffde
movl -0x158(%rbp), %ecx
movq %r15, %rdi
movl $0x1, %esi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r15d
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xf218
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xf23a
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xf25c
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0xf27e
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf297
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf2b3
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xf2d5
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf2f7
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r15d, %r15d
jne 0xfa19
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0x38(%rbp), %r15
leaq -0xd8(%rbp), %rdi
callq 0xffde
movl -0xb8(%rbp), %edx
movq %r15, %rdi
movl $0x2, %esi
callq 0x7040
movl %eax, %r15d
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf353
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf36f
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xf391
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf3b3
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r15d, %r15d
jne 0xfa40
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0x38(%rbp), %r15
leaq -0xd8(%rbp), %rdi
callq 0xffde
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0xb0(%rbp), %r13
movq %r12, %rdi
callq 0xffde
movl -0x130(%rbp), %ecx
movq %r15, %rdi
movl $0x3, %esi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r15d
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xf441
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xf463
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xf485
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0xf4a7
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf4c0
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf4dc
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xf4fe
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf520
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r15d, %r15d
jne 0xfa67
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0x38(%rbp), %r15
leaq -0xd8(%rbp), %rdi
callq 0xffde
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq -0x90(%rbp), %r13
movq %r12, %rdi
callq 0xffde
movl -0x110(%rbp), %ecx
movq %r15, %rdi
movl $0x4, %esi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r13d
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
je 0xf5ae
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
je 0xf5d0
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xf5f2
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0xf614
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf62d
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf649
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xf66b
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf68d
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
movl $0x1e, %edx
testl %r13d, %r13d
jne 0xfb02
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq %r14, %r15
movq -0x38(%rbp), %r13
leaq -0xd8(%rbp), %rdi
callq 0xffde
movq 0xc0(%r15), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfeb7
movq %r12, %r14
movq -0x70(%rbp), %r12
movq %r14, %rdi
callq 0xffde
movl -0xf0(%rbp), %ecx
movq %r13, %rdi
movl $0x5, %esi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r13d
movq -0xf8(%rbp), %rdi
leaq -0xe8(%rbp), %rax
cmpq %rax, %rdi
movq %r14, %r12
je 0xf726
movq -0xe8(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x118(%rbp), %rdi
leaq -0x108(%rbp), %rax
cmpq %rax, %rdi
movq %r15, %r14
je 0xf74b
movq -0x108(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x138(%rbp), %rdi
leaq -0x128(%rbp), %rax
cmpq %rax, %rdi
je 0xf76d
movq -0x128(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x160(%rbp), %rdi
leaq -0x150(%rbp), %rax
cmpq %rax, %rdi
je 0xf78f
movq -0x150(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0xf7a8
movq -0x60(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0xf7c4
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0xf7e6
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xf808
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r13d, %r13d
jne 0xfb0b
movq -0x38(%rbp), %rdi
callq 0x7460
cmpl $0x65, %eax
jne 0xfb19
movq -0x38(%rbp), %rdi
callq 0x7620
movq -0x50(%rbp), %r15
movq -0x38(%rbp), %rdi
callq 0x7110
incq %r15
movq 0xc0(%r14), %rax
movq 0xc8(%r14), %rcx
subq %rax, %rcx
sarq $0x4, %rcx
addq $0x10, %rbx
cmpq %r15, %rcx
ja 0xf196
movq -0x40(%rbp), %rbx
movq 0x8(%rbx), %rdi
leaq 0x259f(%rip), %rsi      # 0x11e0c
leaq -0x48(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movq 0x8(%rbx), %rdi
leaq 0x2597(%rip), %rsi      # 0x11e1c
leaq -0x48(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
testl %eax, %eax
je 0xf959
movq 0x974f(%rip), %rbx      # 0x18ff0
leaq 0x241b(%rip), %rsi      # 0x11cc3
movl $0xb, %edx
movq %rbx, %rdi
callq 0x73b0
movq -0x48(%rbp), %r14
testq %r14, %r14
je 0xf9d2
movq %r14, %rdi
callq 0x7160
movq 0x971f(%rip), %rdi      # 0x18ff0
movq %r14, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xf9e9
movq (%r14), %rax
movq -0x18(%rax), %rax
leaq (%r14,%rax), %rdi
movl 0x20(%r14,%rax), %esi
orl $0x1, %esi
callq 0x7560
movq (%r14), %rax
addq -0x18(%rax), %r14
movq %r14, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x96d9(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
xorl %ebx, %ebx
movq 0x965b(%rip), %rsi      # 0x18f88
leaq -0x2e8(%rbp), %rdi
callq 0x7280
leaq -0x268(%rbp), %rdi
callq 0x7100
movl %ebx, %eax
addq $0x2c8, %rsp            # imm = 0x2C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
leaq 0x23fc(%rip), %rsi      # 0x11d60
leaq -0x48(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movq 0x8(%rbx), %rdi
leaq 0x24e8(%rip), %rsi      # 0x11e64
leaq -0x38(%rbp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x72f0
testl %eax, %eax
je 0xfb5a
movq 0x9654(%rip), %rdi      # 0x18ff0
leaq 0x23a3(%rip), %rsi      # 0x11d46
movl $0x19, %edx
callq 0x73b0
movq 0x8(%rbx), %rdi
callq 0x7310
movq 0x9633(%rip), %rdi      # 0x18ff0
movq %rax, %rsi
callq 0x7320
movq %rax, %rdi
callq 0x7170
jmp 0xf924
movq (%rbx), %rax
movq -0x18(%rax), %rax
leaq (%rbx,%rax), %rdi
movl 0x20(%rbx,%rax), %esi
orl $0x1, %esi
callq 0x7560
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x95e9(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
jmp 0xf14b
movq 0x95d0(%rip), %rdi      # 0x18ff0
leaq 0x234b(%rip), %rsi      # 0x11d72
movl $0x1f, %edx
callq 0x73b0
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xfa8c
movq 0x95a9(%rip), %rdi      # 0x18ff0
leaq 0x2344(%rip), %rsi      # 0x11d92
movl $0x1c, %edx
callq 0x73b0
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xfa8c
movq 0x9582(%rip), %rdi      # 0x18ff0
leaq 0x233a(%rip), %rsi      # 0x11daf
movl $0x1e, %edx
callq 0x73b0
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
movq %rax, %rbx
testq %rax, %rax
je 0xfab0
movq %rbx, %rdi
callq 0x7160
movq 0x954d(%rip), %rdi      # 0x18ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xface
movq 0x9539(%rip), %rax      # 0x18ff0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x7560
movq 0x951b(%rip), %rdi      # 0x18ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x9500(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
jmp 0xf924
leaq 0x22c5(%rip), %rsi      # 0x11dce
jmp 0xfb25
leaq 0x22db(%rip), %rsi      # 0x11ded
movl $0x1e, %edx
jmp 0xfb25
movl $0xb, %edx
leaq 0x219e(%rip), %rsi      # 0x11cc3
movq 0x94c4(%rip), %rdi      # 0x18ff0
callq 0x73b0
movq -0x40(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
movq 0x94ab(%rip), %rdi      # 0x18ff0
movq %rax, %rsi
callq 0x7320
movq %rax, %rdi
callq 0x7170
jmp 0xf924
movq 0xe0(%r14), %rax
cmpq 0xd8(%r14), %rax
setne %al
je 0xfe8f
xorl %r13d, %r13d
movb %al, -0x29(%rbp)
leaq 0x1(%r13), %rax
movq %rax, -0x50(%rbp)
xorl %r15d, %r15d
xorl %ebx, %ebx
movq 0xc8(%r14), %rax
subq 0xc0(%r14), %rax
sarq $0x4, %rax
cmpq %rbx, %rax
jbe 0xfd0e
movq -0x38(%rbp), %rdi
movl $0x1, %esi
movq -0x50(%rbp), %rdx
callq 0x7040
testl %eax, %eax
jne 0xfd3c
movq -0x38(%rbp), %rdi
leal 0x1(%rbx), %edx
movl $0x2, %esi
callq 0x7040
testl %eax, %eax
jne 0xfd6a
movq 0xc0(%r14), %rax
movq (%rax,%r15), %rax
testq %rax, %rax
je 0xfed6
movl 0x20(%rax), %eax
leal -0xfff6(%rax), %ecx
cmpl $0x4, %ecx
ja 0xfc0f
leaq 0x2005(%rip), %rdx      # 0x11c00
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl $0x4, %r12d
jmp 0xfc97
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xfc65
movl $0x5, %edx
movq 0x939e(%rip), %rdi      # 0x18fc0
leaq 0x22be(%rip), %rsi      # 0x11ee7
callq 0x73b0
movq 0x938b(%rip), %rcx      # 0x18fc0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x936d(%rip), %rdi      # 0x18fc0
callq 0x7050
xorl %r12d, %r12d
movq %rax, %rdi
callq 0x7230
jmp 0xfc97
movq 0xd8(%r14), %rax
movq (%rax,%r13,8), %rax
movq (%rax), %rax
movq (%rax,%rbx,8), %rdi
callq 0x7160
movq %rax, %r12
jmp 0xfc97
movl $0x1, %r12d
jmp 0xfc97
movl $0x8, %r12d
jmp 0xfc97
movl $0x2, %r12d
movq -0x38(%rbp), %rdi
movq 0xd8(%r14), %rax
movq (%rax,%r13,8), %rax
movq (%rax), %rax
movq (%rax,%rbx,8), %rdx
movl $0x3, %esi
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x70e0
testl %eax, %eax
jne 0xfd95
movq -0x38(%rbp), %rdi
movl $0x4, %esi
movl %r12d, %edx
callq 0x7040
testl %eax, %eax
jne 0xfdc0
movq -0x38(%rbp), %rdi
callq 0x7460
cmpl $0x65, %eax
jne 0xfdeb
movq -0x38(%rbp), %rdi
callq 0x7620
movq -0x38(%rbp), %rdi
addq $0x10, %r15
incq %rbx
callq 0x7110
jmp 0xfb84
movq 0xe0(%r14), %rax
subq 0xd8(%r14), %rax
sarq $0x3, %rax
movq -0x50(%rbp), %rcx
movq %rcx, %r13
cmpq %rcx, %rax
seta %al
movq -0x40(%rbp), %rbx
ja 0xfb74
jmp 0xfe8f
movq 0x92ad(%rip), %rdi      # 0x18ff0
leaq 0x2162(%rip), %rsi      # 0x11eac
movl $0x1b, %edx
callq 0x73b0
movq -0x40(%rbp), %rbx
movb -0x29(%rbp), %r15b
movq 0x8(%rbx), %rdi
callq 0x7310
jmp 0xfe14
movq 0x927f(%rip), %rdi      # 0x18ff0
leaq 0x2150(%rip), %rsi      # 0x11ec8
movl $0x1e, %edx
callq 0x73b0
movq -0x40(%rbp), %rbx
movb -0x29(%rbp), %r15b
movq 0x8(%rbx), %rdi
callq 0x7310
jmp 0xfe14
movq 0x9254(%rip), %rdi      # 0x18ff0
leaq 0x214a(%rip), %rsi      # 0x11eed
movl $0x1b, %edx
callq 0x73b0
movq -0x40(%rbp), %rbx
movb -0x29(%rbp), %r15b
movq 0x8(%rbx), %rdi
callq 0x7310
jmp 0xfe14
movq 0x9229(%rip), %rdi      # 0x18ff0
leaq 0x213b(%rip), %rsi      # 0x11f09
movl $0x1d, %edx
callq 0x73b0
movq -0x40(%rbp), %rbx
movb -0x29(%rbp), %r15b
movq 0x8(%rbx), %rdi
callq 0x7310
jmp 0xfe14
movq 0x91fe(%rip), %rdi      # 0x18ff0
leaq 0x1eca(%rip), %rsi      # 0x11cc3
movl $0xb, %edx
callq 0x73b0
movq -0x40(%rbp), %rbx
movb -0x29(%rbp), %r15b
movq 0x8(%rbx), %rdi
callq 0x7310
movq %rax, %r14
testq %rax, %rax
je 0xfe38
movq %r14, %rdi
callq 0x7160
movq 0x91c5(%rip), %rdi      # 0x18ff0
movq %r14, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xfe56
movq 0x91b1(%rip), %rax      # 0x18ff0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
leaq (%rax,%rcx), %rdi
movl 0x20(%rax,%rcx), %esi
orl $0x1, %esi
callq 0x7560
movq 0x9193(%rip), %rdi      # 0x18ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x9178(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
testb $0x1, %r15b
jne 0xf924
movq 0x8(%rbx), %rdi
leaq 0x1f72(%rip), %rsi      # 0x11e0c
leaq -0x48(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movb $0x1, %bl
movq -0x38(%rbp), %rdi
callq 0x7540
jmp 0xf926
leaq 0x19f7(%rip), %rdi      # 0x118b5
leaq 0x19f8(%rip), %rsi      # 0x118bd
leaq 0x2074(%rip), %rcx      # 0x11f40
movl $0x2d2, %edx            # imm = 0x2D2
callq 0x7210
leaq 0x19d8(%rip), %rdi      # 0x118b5
leaq 0x19d9(%rip), %rsi      # 0x118bd
leaq 0x19fe(%rip), %rcx      # 0x118e9
movl $0x2d8, %edx            # imm = 0x2D8
callq 0x7210
jmp 0xff60
jmp 0xff60
movq %rax, %rbx
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xff63
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x7340
jmp 0xff63
jmp 0xff60
jmp 0xff60
jmp 0xff60
jmp 0xff3a
jmp 0xff4b
jmp 0xff3a
jmp 0xff4b
jmp 0xff60
jmp 0xff3a
jmp 0xff4b
jmp 0xff60
jmp 0xff4b
jmp 0xff60
movq %rax, %rbx
leaq -0x160(%rbp), %rdi
callq 0x100de
jmp 0xff4e
movq %rax, %rbx
leaq -0xd8(%rbp), %rdi
callq 0x100de
jmp 0xff63
jmp 0xff60
jmp 0xff60
movq %rax, %rbx
movq 0x901e(%rip), %rsi      # 0x18f88
leaq -0x2e8(%rbp), %rdi
callq 0x7280
leaq -0x268(%rbp), %rdi
callq 0x7100
movq %rbx, %rdi
callq 0x75b0