// File: /workspace/github_cpp_makefile_star2_O3/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 $0x2b8, %rsp            # imm = 0x2B8
movq %rsi, %r14
movq %rdi, %r12
xorl %ebx, %ebx
leaq -0x40(%rbp), %r15
movq %rbx, (%r15)
leaq -0x2e0(%rbp), %rdi
callq 0x7250
movq %rbx, -0x30(%rbp)
movq 0x8(%r12), %rdi
leaq 0x2cb5(%rip), %rsi      # 0x11c1c
xorl %edx, %edx
xorl %ecx, %ecx
movq %r15, %r8
callq 0x7430
testl %eax, %eax
je 0xefbb
movq 0xa072(%rip), %rdi      # 0x18ff0
leaq 0x2d3e(%rip), %rsi      # 0x11cc3
movl $0xb, %edx
callq 0x73b0
movq -0x40(%rbp), %rbx
testq %rbx, %rbx
je 0xf086
movq %rbx, %rdi
callq 0x7160
movq 0xa045(%rip), %rdi      # 0x18ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xf0a4
leaq -0xc0(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x2136(%rip), %rdx      # 0x11103
leaq -0xd0(%rbp), %rdi
movq %rdx, %rsi
callq 0x8eb8
leaq -0x2c8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x74b0
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xf011
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
movq 0x8(%r12), %rdi
leaq 0x2cb2(%rip), %rsi      # 0x11ccf
leaq -0x30(%rbp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x72f0
testl %eax, %eax
je 0xf0e1
movq 0x9fb3(%rip), %r14      # 0x18ff0
leaq 0x2d02(%rip), %rsi      # 0x11d46
movl $0x19, %edx
movq %r14, %rdi
callq 0x73b0
movq 0x8(%r12), %rdi
callq 0x7310
movq %rax, %rbx
testq %rax, %rax
je 0xf83f
movq %rbx, %rdi
callq 0x7160
movq 0x9f7a(%rip), %rdi      # 0x18ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xf857
movq 0x9f63(%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 0x9f45(%rip), %rdi      # 0x18ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x9f2a(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
movq -0x40(%rbp), %rdi
callq 0x73d0
jmp 0xf882
movq 0x8(%r12), %rdi
leaq 0x2c73(%rip), %rsi      # 0x11d60
leaq -0x40(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movq %r12, -0x38(%rbp)
movq 0xc0(%r14), %rax
cmpq %rax, 0xc8(%r14)
je 0xf7e6
xorl %ebx, %ebx
leaq -0x158(%rbp), %r12
xorl %r15d, %r15d
movq %r15, -0x48(%rbp)
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0x30(%rbp), %r15
leaq -0xd0(%rbp), %rdi
callq 0xfed0
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0xd0(%rbp), %r13
movq %r12, %rdi
callq 0xfed0
movl -0x150(%rbp), %ecx
movq %r15, %rdi
movl $0x1, %esi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r15d
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xf1a0
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xf1c2
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xf1e4
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0xf206
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf21f
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xf23b
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xf25d
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xf27f
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r15d, %r15d
jne 0xf930
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0x30(%rbp), %r15
leaq -0xd0(%rbp), %rdi
callq 0xfed0
movl -0xb0(%rbp), %edx
movq %r15, %rdi
movl $0x2, %esi
callq 0x7040
movl %eax, %r15d
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf2db
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xf2f7
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xf319
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xf33b
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r15d, %r15d
jne 0xf957
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0x30(%rbp), %r15
leaq -0xd0(%rbp), %rdi
callq 0xfed0
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0xa8(%rbp), %r13
movq %r12, %rdi
callq 0xfed0
movl -0x128(%rbp), %ecx
movq %r15, %rdi
movl $0x3, %esi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r15d
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xf3c9
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xf3eb
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xf40d
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0xf42f
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf448
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xf464
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xf486
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xf4a8
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r15d, %r15d
jne 0xf97e
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0x30(%rbp), %r15
leaq -0xd0(%rbp), %rdi
callq 0xfed0
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq -0x88(%rbp), %r13
movq %r12, %rdi
callq 0xfed0
movl -0x108(%rbp), %ecx
movq %r15, %rdi
movl $0x4, %esi
movq %r13, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r13d
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
je 0xf536
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
je 0xf558
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xf57a
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0xf59c
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf5b5
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xf5d1
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xf5f3
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xf615
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
movl $0x1e, %edx
testl %r13d, %r13d
jne 0xfa19
movq 0xc0(%r14), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq %r14, %r15
movq -0x30(%rbp), %r13
leaq -0xd0(%rbp), %rdi
callq 0xfed0
movq 0xc0(%r15), %rax
movq (%rax,%rbx), %rsi
testq %rsi, %rsi
je 0xfda8
movq %r12, %r14
movq -0x68(%rbp), %r12
movq %r14, %rdi
callq 0xfed0
movl -0xe8(%rbp), %ecx
movq %r13, %rdi
movl $0x5, %esi
movq %r12, %rdx
xorl %r8d, %r8d
callq 0x72c0
movl %eax, %r13d
movq -0xf0(%rbp), %rdi
leaq -0xe0(%rbp), %rax
cmpq %rax, %rdi
movq %r14, %r12
je 0xf6ae
movq -0xe0(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x110(%rbp), %rdi
leaq -0x100(%rbp), %rax
cmpq %rax, %rdi
movq %r15, %r14
je 0xf6d3
movq -0x100(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x130(%rbp), %rdi
leaq -0x120(%rbp), %rax
cmpq %rax, %rdi
je 0xf6f5
movq -0x120(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x158(%rbp), %rdi
leaq -0x148(%rbp), %rax
cmpq %rax, %rdi
je 0xf717
movq -0x148(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0xf730
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0x88(%rbp), %rdi
leaq -0x78(%rbp), %rax
cmpq %rax, %rdi
je 0xf74c
movq -0x78(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xa8(%rbp), %rdi
leaq -0x98(%rbp), %rax
cmpq %rax, %rdi
je 0xf76e
movq -0x98(%rbp), %rsi
incq %rsi
callq 0x7340
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xf790
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
testl %r13d, %r13d
jne 0xfa22
movq -0x30(%rbp), %rdi
callq 0x7460
cmpl $0x65, %eax
jne 0xfa30
movq -0x30(%rbp), %rdi
callq 0x7620
movq -0x48(%rbp), %r15
movq -0x30(%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 0xf11e
movq -0x38(%rbp), %rbx
movq 0x8(%rbx), %rdi
leaq 0x2617(%rip), %rsi      # 0x11e0c
leaq -0x40(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movq 0x8(%rbx), %rdi
leaq 0x260f(%rip), %rsi      # 0x11e1c
leaq -0x40(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
testl %eax, %eax
je 0xf8b7
movq 0x97c7(%rip), %rdi      # 0x18ff0
leaq 0x2493(%rip), %rsi      # 0x11cc3
movl $0xb, %edx
callq 0x73b0
jmp 0xef8f
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 0x977b(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
xorl %ebx, %ebx
movq 0x96fd(%rip), %rsi      # 0x18f88
leaq -0x2e0(%rbp), %rdi
callq 0x7280
leaq -0x260(%rbp), %rdi
callq 0x7100
movl %ebx, %eax
addq $0x2b8, %rsp            # imm = 0x2B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rbx), %rdi
leaq 0x249e(%rip), %rsi      # 0x11d60
leaq -0x40(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movq 0x8(%rbx), %rdi
leaq 0x258a(%rip), %rsi      # 0x11e64
leaq -0x30(%rbp), %rcx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %r8d, %r8d
callq 0x72f0
testl %eax, %eax
je 0xfa71
movq 0x96f6(%rip), %rdi      # 0x18ff0
leaq 0x2445(%rip), %rsi      # 0x11d46
movl $0x19, %edx
callq 0x73b0
movq 0x8(%rbx), %rdi
callq 0x7310
movq 0x96d5(%rip), %rdi      # 0x18ff0
movq %rax, %rsi
callq 0x7320
movq %rax, %rdi
callq 0x7170
jmp 0xf882
movq 0x96b9(%rip), %rdi      # 0x18ff0
leaq 0x2434(%rip), %rsi      # 0x11d72
movl $0x1f, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xf9a3
movq 0x9692(%rip), %rdi      # 0x18ff0
leaq 0x242d(%rip), %rsi      # 0x11d92
movl $0x1c, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xf9a3
movq 0x966b(%rip), %rdi      # 0x18ff0
leaq 0x2423(%rip), %rsi      # 0x11daf
movl $0x1e, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
movq %rax, %rbx
testq %rax, %rax
je 0xf9c7
movq %rbx, %rdi
callq 0x7160
movq 0x9636(%rip), %rdi      # 0x18ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xf9e5
movq 0x9622(%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 0x9604(%rip), %rdi      # 0x18ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x95e9(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
jmp 0xf882
leaq 0x23ae(%rip), %rsi      # 0x11dce
jmp 0xfa3c
leaq 0x23c4(%rip), %rsi      # 0x11ded
movl $0x1e, %edx
jmp 0xfa3c
movl $0xb, %edx
leaq 0x2287(%rip), %rsi      # 0x11cc3
movq 0x95ad(%rip), %rdi      # 0x18ff0
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
movq 0x9594(%rip), %rdi      # 0x18ff0
movq %rax, %rsi
callq 0x7320
movq %rax, %rdi
callq 0x7170
jmp 0xf882
movq 0xe0(%r14), %rax
cmpq 0xd8(%r14), %rax
je 0xfc42
xorl %ebx, %ebx
leaq 0x1(%rbx), %rax
movq %rax, -0x48(%rbp)
xorl %r15d, %r15d
xorl %r13d, %r13d
movq 0xc8(%r14), %rax
subq 0xc0(%r14), %rax
sarq $0x4, %rax
cmpq %r13, %rax
jbe 0xfc20
movq -0x30(%rbp), %rdi
movl $0x1, %esi
movq -0x48(%rbp), %rdx
callq 0x7040
testl %eax, %eax
jne 0xfc6e
movq -0x30(%rbp), %rdi
leal 0x1(%r13), %edx
movl $0x2, %esi
callq 0x7040
testl %eax, %eax
jne 0xfc98
movq 0xc0(%r14), %rax
movq (%rax,%r15), %rax
testq %rax, %rax
je 0xfdc7
movl 0x20(%rax), %eax
leal -0xfff6(%rax), %ecx
cmpl $0x4, %ecx
ja 0xfb21
leaq 0x20f3(%rip), %rdx      # 0x11c00
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
movl $0x4, %r12d
jmp 0xfba9
cmpl $0x8000, %eax           # imm = 0x8000
jne 0xfb77
movl $0x5, %edx
movq 0x948c(%rip), %rdi      # 0x18fc0
leaq 0x23ac(%rip), %rsi      # 0x11ee7
callq 0x73b0
movq 0x9479(%rip), %rcx      # 0x18fc0
movq (%rcx), %rax
movq -0x18(%rax), %rdi
addq %rcx, %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x945b(%rip), %rdi      # 0x18fc0
callq 0x7050
xorl %r12d, %r12d
movq %rax, %rdi
callq 0x7230
jmp 0xfba9
movq 0xd8(%r14), %rax
movq (%rax,%rbx,8), %rax
movq (%rax), %rax
movq (%rax,%r13,8), %rdi
callq 0x7160
movq %rax, %r12
jmp 0xfba9
movl $0x1, %r12d
jmp 0xfba9
movl $0x8, %r12d
jmp 0xfba9
movl $0x2, %r12d
movq -0x30(%rbp), %rdi
movq 0xd8(%r14), %rax
movq (%rax,%rbx,8), %rax
movq (%rax), %rax
movq (%rax,%r13,8), %rdx
movl $0x3, %esi
movl %r12d, %ecx
xorl %r8d, %r8d
callq 0x70e0
testl %eax, %eax
jne 0xfcbf
movq -0x30(%rbp), %rdi
movl $0x4, %esi
movl %r12d, %edx
callq 0x7040
testl %eax, %eax
jne 0xfce6
movq -0x30(%rbp), %rdi
callq 0x7460
cmpl $0x65, %eax
jne 0xfd0d
movq -0x30(%rbp), %rdi
callq 0x7620
movq -0x30(%rbp), %rdi
addq $0x10, %r15
incq %r13
callq 0x7110
jmp 0xfa95
movq 0xe0(%r14), %rax
subq 0xd8(%r14), %rax
sarq $0x3, %rax
movq -0x48(%rbp), %rcx
movq %rcx, %rbx
cmpq %rcx, %rax
ja 0xfa87
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x21bb(%rip), %rsi      # 0x11e0c
leaq -0x40(%rbp), %r8
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x7430
movb $0x1, %bl
movq -0x30(%rbp), %rdi
callq 0x7540
jmp 0xf884
movq 0x937b(%rip), %rdi      # 0x18ff0
leaq 0x2230(%rip), %rsi      # 0x11eac
movl $0x1b, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xfd32
movq 0x9351(%rip), %rdi      # 0x18ff0
leaq 0x2222(%rip), %rsi      # 0x11ec8
movl $0x1e, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xfd32
movq 0x932a(%rip), %rdi      # 0x18ff0
leaq 0x2220(%rip), %rsi      # 0x11eed
movl $0x1b, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xfd32
movq 0x9303(%rip), %rdi      # 0x18ff0
leaq 0x2215(%rip), %rsi      # 0x11f09
movl $0x1d, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
jmp 0xfd32
movq 0x92dc(%rip), %rdi      # 0x18ff0
leaq 0x1fa8(%rip), %rsi      # 0x11cc3
movl $0xb, %edx
callq 0x73b0
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7310
movq %rax, %rbx
testq %rax, %rax
je 0xfd56
movq %rbx, %rdi
callq 0x7160
movq 0x92a7(%rip), %rdi      # 0x18ff0
movq %rbx, %rsi
movq %rax, %rdx
callq 0x73b0
jmp 0xfd74
movq 0x9293(%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 0x9275(%rip), %rdi      # 0x18ff0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x7300
movsbl %al, %esi
movq 0x925a(%rip), %rdi      # 0x18ff0
callq 0x7050
movq %rax, %rdi
callq 0x7230
jmp 0xf882
leaq 0x1b06(%rip), %rdi      # 0x118b5
leaq 0x1b07(%rip), %rsi      # 0x118bd
leaq 0x2183(%rip), %rcx      # 0x11f40
movl $0x2d2, %edx            # imm = 0x2D2
callq 0x7210
leaq 0x1ae7(%rip), %rdi      # 0x118b5
leaq 0x1ae8(%rip), %rsi      # 0x118bd
leaq 0x1b0d(%rip), %rcx      # 0x118e9
movl $0x2d8, %edx            # imm = 0x2D8
callq 0x7210
jmp 0xfe51
jmp 0xfe51
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
leaq -0xc0(%rbp), %rax
cmpq %rax, %rdi
je 0xfe54
movq -0xc0(%rbp), %rsi
incq %rsi
callq 0x7340
jmp 0xfe54
jmp 0xfe51
jmp 0xfe51
jmp 0xfe51
jmp 0xfe2b
jmp 0xfe3c
jmp 0xfe2b
jmp 0xfe3c
jmp 0xfe51
jmp 0xfe2b
jmp 0xfe3c
jmp 0xfe51
jmp 0xfe3c
jmp 0xfe51
movq %rax, %rbx
leaq -0x158(%rbp), %rdi
callq 0xffd0
jmp 0xfe3f
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
callq 0xffd0
jmp 0xfe54
jmp 0xfe51
jmp 0xfe51
movq %rax, %rbx
movq 0x912d(%rip), %rsi      # 0x18f88
leaq -0x2e0(%rbp), %rdi
callq 0x7280
leaq -0x260(%rbp), %rdi
callq 0x7100
movq %rbx, %rdi
callq 0x75b0
nop