// File: cphinton42[P]hinton-language/src/check.cpp
// Function: do_typecheck_job(Context*, Job)
bool do_typecheck_job(Context *ctx, Job job)
{
    Expr_AST *type = job.typecheck.type;
    AST *ast = job.typecheck.ast;
    
    switch(ast->type)
    {
        case AST_Type::decl_ast: {
            Decl_AST *decl_ast = static_cast<Decl_AST*>(ast);
            assert(type == nullptr);
            return typecheck_decl(ctx, job.stage, decl_ast);
        } break;
        case AST_Type::block_ast: {
            Block_AST *block_ast = static_cast<Block_AST*>(ast);
            assert(type == nullptr);
            for(u64 i = 0; i < block_ast->statements.count; ++i)
            {
                auto job = make_typecheck_job(nullptr, block_ast->statements[i]);
                do_typecheck_job(ctx, job);
            }
            return true;
        } break;
        case AST_Type::while_ast: {
            While_AST *while_ast = static_cast<While_AST*>(ast);
            assert(type == nullptr);
            
            auto job = make_typecheck_job(&boollike_t_ast, while_ast->guard);
            do_typecheck_job(ctx, job);
            job = make_typecheck_job(nullptr, while_ast->body);
            do_typecheck_job(ctx, job);
            return true;
        } break;
        case AST_Type::for_ast: {
            For_AST *for_ast = static_cast<For_AST*>(ast);
            assert(type == nullptr);
            
            if(for_ast->flags & FOR_FLAG_OVER_ARRAY)
            {
                // TODO: once built-in arrays are a thing, check this
                report_error("For loop over array not yet supported at type level", for_ast);
                ctx->success = false;
            }
            else
            {
                // TODO: find best type? (change to u64 if out of range for s64?)
                // If ints can't downcast, it might be a pain for 'it' to be big
                set_resolved_type(for_ast->induction_var, &s64_t_ast);
                
                auto job = make_typecheck_job(&intlike_t_ast, for_ast->low_expr);
                do_typecheck_job(ctx, job);
                job = make_typecheck_job(&intlike_t_ast, for_ast->high_expr);
                do_typecheck_job(ctx, job);
            }
            
            auto job = make_typecheck_job(nullptr, for_ast->body);
            do_typecheck_job(ctx, job);
            return true;
        } break;
        case AST_Type::if_ast: {
            If_AST *if_ast = static_cast<If_AST*>(ast);
            assert(type == nullptr);
            
            auto job = make_typecheck_job(&boollike_t_ast, if_ast->guard);
            do_typecheck_job(ctx, job);
            job = make_typecheck_job(nullptr, if_ast->then_block);
            do_typecheck_job(ctx, job);
            if(if_ast->else_block)
            {
                job = make_typecheck_job(nullptr, if_ast->else_block);
                do_typecheck_job(ctx, job);
            }
            return true;
        } break;
        case AST_Type::assign_ast: {
            Assign_AST *assign_ast = static_cast<Assign_AST*>(ast);
            assert(type == nullptr);
            return typecheck_assign(ctx, job.stage, assign_ast);
        } break;
        case AST_Type::return_ast: {
            Return_AST *return_ast = static_cast<Return_AST*>(ast);
            assert(type == nullptr);
            assert(job.stage == 0);
            return typecheck_return(ctx, return_ast);
        } break;
        
        case AST_Type::ident_ast: {
            Ident_AST *ident_ast = static_cast<Ident_AST*>(ast);
            return typecheck_ident(ctx, job.stage, type, ident_ast);
        } break;
        case AST_Type::function_type_ast: {
            Function_Type_AST *function_type_ast = static_cast<Function_Type_AST*>(ast);
            return typecheck_function_type(ctx, job.stage, type, function_type_ast);
        } break;
        case AST_Type::function_ast: {
            Function_AST *function_ast = static_cast<Function_AST*>(ast);
            return typecheck_function(ctx, job.stage, type, function_ast);
        } break;
        case AST_Type::function_call_ast: {
            Function_Call_AST *function_call_ast = static_cast<Function_Call_AST*>(ast);
            return typecheck_function_call(ctx, job.stage, type, function_call_ast);
        } break;
        case AST_Type::access_ast: {
            Access_AST *access_ast = static_cast<Access_AST*>(ast);
            return typecheck_access(ctx, job.stage, type, access_ast);
        } break;
        case AST_Type::binary_operator_ast: {
            Binary_Operator_AST *binop_ast = static_cast<Binary_Operator_AST*>(ast);
            return typecheck_binop_ast(ctx, job.stage, type, binop_ast);
        } break;
        case AST_Type::number_ast: {
            Number_AST *number_ast = static_cast<Number_AST*>(ast);
            assert(job.stage == 0);
            return typecheck_number(ctx, type, number_ast);
        } break;
        case AST_Type::enum_ast: {
            Enum_AST *enum_ast = static_cast<Enum_AST*>(ast);
            return typecheck_enum(ctx, job.stage, type, enum_ast);
        } break;
        case AST_Type::struct_ast: {
            Struct_AST *struct_ast = static_cast<Struct_AST*>(ast);
            return typecheck_struct(ctx, job.stage, type, struct_ast);
        } break;
        case AST_Type::unary_ast: {
            Unary_Operator_AST *unop_ast = static_cast<Unary_Operator_AST*>(ast);
            return typecheck_unary(ctx, job.stage, type, unop_ast);
        } break;
        case AST_Type::primitive_ast: {
            Primitive_AST *prim_ast = static_cast<Primitive_AST*>(ast);
            assert(job.stage == 0);
            return typecheck_primitive(ctx, type, prim_ast);
        } break;
        case AST_Type::string_ast: {
            String_AST *string_ast = static_cast<String_AST*>(ast);
            assert(job.stage == 0);
            return typecheck_string(ctx, type, string_ast);
        } break;
        case AST_Type::bool_ast: {
            Bool_AST *bool_ast = static_cast<Bool_AST*>(ast);
            assert(job.stage == 0);
            return typecheck_bool(ctx, type, bool_ast);
        } break;
    }
    
    assert(false);
    return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
leaq 0x10(%rbp), %rax
movq %rax, -0x288(%rbp)
movq %rdi, -0x10(%rbp)
movq 0x8(%rax), %rcx
movq %rcx, -0x18(%rbp)
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movzwl (%rax), %eax
movq %rax, -0x280(%rbp)
subq $0x13, %rax
ja 0x55c4
movq -0x280(%rbp), %rax
leaq 0x144d0(%rip), %rcx     # 0x19060
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4baa
jmp 0x4bc9
leaq 0x15365(%rip), %rdi     # 0x19f16
leaq 0x15334(%rip), %rsi     # 0x19eec
movl $0x5c, %edx
leaq 0x15362(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x288(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x28(%rbp), %rdx
callq 0x5620
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4bfb
jmp 0x4c1a
leaq 0x15314(%rip), %rdi     # 0x19f16
leaq 0x152e3(%rip), %rsi     # 0x19eec
movl $0x61, %edx
leaq 0x15311(%rip), %rcx     # 0x19f26
callq 0x3080
movq $0x0, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jae 0x4c9f
movq -0x30(%rbp), %rdi
addq $0x10, %rdi
movq -0x38(%rbp), %rsi
callq 0x16fe0
movq (%rax), %rdx
leaq -0x50(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x4a80
movq -0x10(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq -0x68(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x4c22
movb $0x1, -0x1(%rbp)
jmp 0x55e3
movq -0x20(%rbp), %rax
movq %rax, -0x70(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4cb9
jmp 0x4cd8
leaq 0x15256(%rip), %rdi     # 0x19f16
leaq 0x15225(%rip), %rsi     # 0x19eec
movl $0x6b, %edx
leaq 0x15253(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x70(%rbp), %rax
movq 0x10(%rax), %rdx
leaq -0x88(%rbp), %rdi
leaq 0x1b2a2(%rip), %rsi     # 0x1ff90
xorl %ecx, %ecx
callq 0x4a80
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x98(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0x90(%rbp)
leaq -0xa0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movq -0x70(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0xb8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x4a80
movq -0xb8(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x78(%rbp)
movq -0x10(%rbp), %rdi
movq -0x88(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0x78(%rbp), %rax
movq %rax, -0xc0(%rbp)
leaq -0xd0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movb $0x1, -0x1(%rbp)
jmp 0x55e3
movq -0x20(%rbp), %rax
movq %rax, -0xd8(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4dea
jmp 0x4e09
leaq 0x15125(%rip), %rdi     # 0x19f16
leaq 0x150f4(%rip), %rsi     # 0x19eec
movl $0x75, %edx
leaq 0x15122(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0xd8(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x8, %eax
cmpl $0x0, %eax
je 0x4e3c
movq -0xd8(%rbp), %rsi
leaq 0x15122(%rip), %rdi     # 0x19f4c
callq 0x4950
movq -0x10(%rbp), %rax
movb $0x0, 0x10(%rax)
jmp 0x4f63
movq -0xd8(%rbp), %rax
movq 0x10(%rax), %rdi
leaq 0x1af62(%rip), %rsi     # 0x1fdb0
callq 0x3be0
movq -0xd8(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0xf0(%rbp), %rdi
leaq 0x1b0ac(%rip), %rsi     # 0x1ff18
xorl %ecx, %ecx
callq 0x4a80
movq -0x10(%rbp), %rdi
movq -0xf0(%rbp), %rax
movq %rax, -0x108(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x100(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x108(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movq -0xd8(%rbp), %rax
movq 0x20(%rax), %rdx
leaq -0x120(%rbp), %rdi
leaq 0x1b039(%rip), %rsi     # 0x1ff18
xorl %ecx, %ecx
callq 0x4a80
movq -0x120(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xe0(%rbp)
movq -0x10(%rbp), %rdi
movq -0xf0(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0xe8(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0xe0(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq -0x138(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movq -0xd8(%rbp), %rax
movq 0x28(%rax), %rdx
leaq -0x150(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x4a80
movq -0x10(%rbp), %rdi
movq -0x150(%rbp), %rax
movq %rax, -0x168(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x160(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq -0x168(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movb $0x1, -0x1(%rbp)
jmp 0x55e3
movq -0x20(%rbp), %rax
movq %rax, -0x170(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x4ff0
jmp 0x500f
leaq 0x14f1f(%rip), %rdi     # 0x19f16
leaq 0x14eee(%rip), %rsi     # 0x19eec
movl $0x8f, %edx
leaq 0x14f1c(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x170(%rbp), %rax
movq 0x10(%rax), %rdx
leaq -0x188(%rbp), %rdi
leaq 0x1af68(%rip), %rsi     # 0x1ff90
xorl %ecx, %ecx
callq 0x4a80
movq -0x10(%rbp), %rdi
movq -0x188(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x190(%rbp)
leaq -0x1a0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movq -0x170(%rbp), %rax
movq 0x18(%rax), %rdx
leaq -0x1b8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x4a80
movq -0x1b8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x1b0(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x1a8(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x10(%rbp), %rdi
movq -0x188(%rbp), %rax
movq %rax, -0x1d0(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x1c8(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x1c0(%rbp)
leaq -0x1d0(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movq -0x170(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x51c8
movq -0x170(%rbp), %rax
movq 0x20(%rax), %rdx
leaq -0x1e8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %ecx, %ecx
callq 0x4a80
movq -0x1e8(%rbp), %rax
movq %rax, -0x188(%rbp)
movq -0x1e0(%rbp), %rax
movq %rax, -0x180(%rbp)
movq -0x1d8(%rbp), %rax
movq %rax, -0x178(%rbp)
movq -0x10(%rbp), %rdi
movq -0x188(%rbp), %rax
movq %rax, -0x200(%rbp)
movq -0x180(%rbp), %rax
movq %rax, -0x1f8(%rbp)
movq -0x178(%rbp), %rax
movq %rax, -0x1f0(%rbp)
leaq -0x200(%rbp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x4b40
movb $0x1, -0x1(%rbp)
jmp 0x55e3
movq -0x20(%rbp), %rax
movq %rax, -0x208(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x51e5
jmp 0x5204
leaq 0x14d2a(%rip), %rdi     # 0x19f16
leaq 0x14cf9(%rip), %rsi     # 0x19eec
movl $0x9e, %edx
leaq 0x14d27(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x288(%rbp), %rax
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x208(%rbp), %rdx
callq 0x5910
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x20(%rbp), %rax
movq %rax, -0x210(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x523c
jmp 0x525b
leaq 0x14cd3(%rip), %rdi     # 0x19f16
leaq 0x14ca2(%rip), %rsi     # 0x19eec
movl $0xa3, %edx
leaq 0x14cd0(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x288(%rbp), %rax
cmpl $0x0, 0x4(%rax)
jne 0x526a
jmp 0x5289
leaq 0x14d0f(%rip), %rdi     # 0x19f80
leaq 0x14c74(%rip), %rsi     # 0x19eec
movl $0xa4, %edx
leaq 0x14ca2(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
callq 0x5c10
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x218(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x218(%rbp), %rcx
callq 0x5dc0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x220(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x220(%rbp), %rcx
callq 0x5fe0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x228(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x228(%rbp), %rcx
callq 0x62b0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x230(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x230(%rbp), %rcx
callq 0x6a10
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x238(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x238(%rbp), %rcx
callq 0x6e50
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x240(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x240(%rbp), %rcx
callq 0x7220
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x248(%rbp)
cmpl $0x0, 0x4(%rax)
jne 0x53ef
jmp 0x540e
leaq 0x14b8a(%rip), %rdi     # 0x19f80
leaq 0x14aef(%rip), %rsi     # 0x19eec
movl $0xc2, %edx
leaq 0x14b1d(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x248(%rbp), %rdx
callq 0x7c50
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x250(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x250(%rbp), %rcx
callq 0x8020
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x258(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x258(%rbp), %rcx
callq 0x81e0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x260(%rbp)
movq -0x10(%rbp), %rdi
movl 0x4(%rax), %esi
movq -0x18(%rbp), %rdx
movq -0x260(%rbp), %rcx
callq 0x8440
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x268(%rbp)
cmpl $0x0, 0x4(%rax)
jne 0x54df
jmp 0x54fe
leaq 0x14a9a(%rip), %rdi     # 0x19f80
leaq 0x149ff(%rip), %rsi     # 0x19eec
movl $0xd3, %edx
leaq 0x14a2d(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x268(%rbp), %rdx
callq 0x8d00
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x270(%rbp)
cmpl $0x0, 0x4(%rax)
jne 0x5536
jmp 0x5555
leaq 0x14a43(%rip), %rdi     # 0x19f80
leaq 0x149a8(%rip), %rsi     # 0x19eec
movl $0xd8, %edx
leaq 0x149d6(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x270(%rbp), %rdx
callq 0x8e00
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
movq -0x288(%rbp), %rax
movq -0x20(%rbp), %rcx
movq %rcx, -0x278(%rbp)
cmpl $0x0, 0x4(%rax)
jne 0x558a
jmp 0x55a9
leaq 0x149ef(%rip), %rdi     # 0x19f80
leaq 0x14954(%rip), %rsi     # 0x19eec
movl $0xdd, %edx
leaq 0x14982(%rip), %rcx     # 0x19f26
callq 0x3080
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x8e40
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x55e3
leaq 0x14857(%rip), %rdi     # 0x19e22
leaq 0x1491a(%rip), %rsi     # 0x19eec
movl $0xe2, %edx
leaq 0x14948(%rip), %rcx     # 0x19f26
callq 0x3080
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
nopw %cs:(%rax,%rax)