// File: /workspace/github_cpp_makefile_star2_O3/baziotis[P]minijava-cpp/typecheck.cpp
// Function: MainTypeCheckVisitor::visit(IfStatement*)
void MainTypeCheckVisitor::visit(IfStatement *if_stmt) {
    LOG_SCOPE;
    debug_print("MainTypeCheck::IfStatement:\n");
    Type *condty = if_stmt->cond->accept(this);
    poison_stmt(condty);
    if (condty != this->type_table.bool_type) {
        typecheck_error(if_stmt->loc, "In if statement, the ",
                        "condition expression must have `boolean` type but has: `",
                        condty->name(), "`");
    }
    /// Codegen ///
    llvalue_t cond = __expr_context.llval;
    // Handle constant condition. Eliminate the branch
    // and elide the never-executed body.
    if (cond.kind == LLVALUE::CONST) {
        // Elide either the `if` body or the `else` body
        // depending on the condition constant value.
        // Assume that the user does not want to type-
        // check the elided body (IIRC if(0) in Java
        // works like #ifdef 0 in C).
        if (cond.val) {
            assert(if_stmt->then);
            if_stmt->then->accept(this);
        } else {
            assert(if_stmt->else_);
            if_stmt->else_->accept(this);
        }
        return;
    }
    
    // Generate the 3 labels used. According to the condition,
    // we either go to if_lbl or else_lbl. Both bodies at the end
    // should jump to end_lbl.
    llvm_label_t if_lbl, else_lbl, end_lbl;
    long lbl = gen_lbl();
    if_lbl.construct("if", lbl);
    else_lbl.construct("else", lbl);
    end_lbl.construct("if_end", lbl);
    
    // Emit a comparison and branch
    /*
    llvalue_t cmp_res;
    cmp_res.kind = LLVALUE::REG;
    cmp_res.reg = gen_reg();
    emit("    %%%ld = icmp eq i1 %%%ld, 1\n", cmp_res.reg, cond.reg);
    */
    llvm_branch_cond(cond, if_lbl, else_lbl);

    /*
    //// Algorithm for emission of phi nodes ////
    
    -- A couple of important info --
    Note that this compiler does not use the classic load / store model.
    Clang / LDC and generally most of the LLVM front-ends, whenever we
    use a variable, they load it from memory. And when they assign to
    a variable, they store to. Implementing this model is simple - just
    `alloca` every local variable and use its memory. For parameters, because
    they come in registers, we just `alloca` a copy of them as well.
    This is simple and effective for all kinds of reasons:
    1) First and foremost, because of its simplicity, bugs are less likely to happen.
    2) Debuggers have an easier time when they know that the memory for a variable
       is in a specific place in memory.
    3) LLVM will remove them anyway in optimized builds.

    But I tried to do something better, for locals (variables and params), I tried
    to use registers only by wrapping them in llvalue_t. That scheme makes
    constant-folding and constant-propagation easy.
    An example:
    a = 2;  // underneath, an llvalue is created, which is of kind CONST
    b = a;  // now, `llval` for the local `b` is the previous CONST llvalue and so on.

    However, with this scheme, problems are introduced with conditional code.
    Let's say we have this:
    if (cond) {
        a = 2;
    } else {
        a = 3;
    }

    What llvalue should `a` get? 2 or 3 ? We can't know at compile-time (assuming
    that `cond` is not known at compile-time).
    What we have to do is emit a phi node, i.e. this code above should translate to:
    
        icmp cond, 1
        br i1 cond, if1, else1
    if1:
        br if_end1
    else1:
        br if_end1
    if_end1:
        %1 = phi [ 2, if1 ], [ 3, else1 ]

    Now, the `llval` for the local `a` is the llvalue of kind REG, where its `reg`
    is 1 (i.e. %1).
    So, now the question is how do we generate these phi nodes.
    
    -- The algorithm --
    We have 2 places where we need this scheme: ifs and whiles. Let's explain
    `if` and you'll get the point.
    Note that an `if` is always followed by an `else`. Thus, we always will go either
    to the `if` body or the `else` body. As such, let's say we want to correctly
    emit code for local `a`. There are 4 cases:
    1) Neither of the 2 bodies assignes to `a`. This is the simplest case, keep
       its current `llval`.
    2) The `if` body _only_ assigns to it. Then, keep the (last) value that it
       assigns and then emit a phi node between this assigned value and the
       previous / initial value. For example:
       a = 2;
       if (cond) {
           a = 3;
       } else {
           // No assignment to `a`
       }
       emit a phi node between 2 and 3 for `a`.

    3) The `else` body _only_ assigns to it. Just as case 2)
    4) Both assign to it. Then, emit a phi node between the 2 assigned values.

    So, there are a couple of things we have to do. First of all, track for each
    `if` statement the assignments in its bodies. We keep a TrackAssignment
    for each local of the function, so a TrackAssignmentBuf.
    We use a TrackAssignmentBuf for each nesting level of the function, _not_ for
    every if. For example:
    if () {
        if () {
        }
        ...
        if () {  <-- We can reuse the same buffer for this if as we're finished with
                     with the above. However we can't use it for the outer if because
                     that's still on the run.
        }
    }

    Actually, we keep 2 buffers for each nesting level. One for the if body and
    one for the else. Because we want to save them separately so we can then
    apply the 4 cases above.
    
    Assuming we have those buffers, on the _return_ of processing the
    `if` and `else` bodies, we apply the 4 cases below.
    */

    assert(if_stmt->then);
    assert(if_stmt->else_);

    __expr_context.nesting_level += 1;
    debug_print("IfStatement nesting level: %d\n", __expr_context.nesting_level);
    
    int nesting_level = __expr_context.nesting_level;
    size_t locals_len = __expr_context.method->locals.len;
    // If we surpassed max nesting level, allocate 2 new buffers.
    if (nesting_level > __expr_context.max_nesting_level) {
        __expr_context.max_nesting_level = nesting_level;
        TrackAssignmentBuf if_buf, else_buf;
        if_buf.reserve(locals_len);
        else_buf.reserve(locals_len);
        __expr_context.if_bufs.push(if_buf);
        __expr_context.else_bufs.push(else_buf);
    }
    Method *method = __expr_context.method;
      
    // Note: You'll see the `nesting_level - 1` a lot below. The reason
    // for the -1 is that if you think about, we don't need to keep
    // assignment info for level 0. So, the 0th buffers are for nesting
    // level 1 etc.

    // Clear the 2 buffers in the current nesting level
    for (size_t i = 0; i != locals_len; ++i) {
        TrackAssignment tasgn;
        tasgn.assigned = false;
        // TODO: There might be a better way to decide about this.
        // Essentially, if we're in the first nesting level, we can just get
        // the local value. But if not, then we have to take from the previous level
        // as the `llval` of the local might have changed but we don't want this new value:
        /*
        if (cond) {
            a = new A();  // let's say %5
        } else {
            // Now, `llval` of `a` is %5 but we don't want that.
            if (cond) {
            } else {
                a = new A();
            }
        }
        */
        if (nesting_level > 1) {
            if (__expr_context.in_if) {
                tasgn.llval = __expr_context.if_bufs[nesting_level - 2][i].llval;
            } else {
                tasgn.llval = __expr_context.else_bufs[nesting_level - 2][i].llval;
            }
        } else {
            tasgn.llval = method->locals[i]->llval;
        }
        Local *local = method->locals[i];
        __expr_context.if_bufs[nesting_level - 1][i] = tasgn;
        __expr_context.else_bufs[nesting_level - 1][i] = tasgn;
    }
    
    // Save if we're currently inside an if or an else.
    bool save_in_if = __expr_context.in_if;
    llvm_gen_lbl(if_lbl);
    __expr_context.in_if = true;
    if_stmt->then->accept(this);

    // 2 bufs that track assignments for the 2 bodies we just processed (if and else)
    TrackAssignmentBuf if_buf = __expr_context.if_bufs[nesting_level - 1];
    TrackAssignmentBuf else_buf = __expr_context.else_bufs[nesting_level - 1];
    
    // Before moving to `else`, if `if` assigned, we want to _revert_ the choice,
    // because the `else` may use a variable before assign it. Consider this:
    // a = 0;
    // if (...) {
    //   a = 2;  // This was visited first and now `a->llval` is 2.
    // } else {
    //   b = a;  // Here, we use `a` before we assign to it, so `b` will get `2`,
    //           // which is wrong.
    // }
    // TODO: That was a hacky choice as I found the bug. This bug might mean
    // that we want to revisit a bigger part of the algorithm.
    for (size_t i = 0; i < method->locals.len; ++i) {
        bool assigned_if = if_buf[i].assigned;
        if (assigned_if) {
            Local *local = method->locals[i];
            local->llval = else_buf[i].llval;
        }
    }

    // Save the last label in if, because this is the label / basic block
    // from which we jump to the `end_lbl`. And we need this info
    // for the emission of the phi node.
    llvm_label_t save_last_lbl_in_if = __expr_context.curr_lbl;
    llvm_branch(end_lbl);
    llvm_gen_lbl(else_lbl);
    __expr_context.in_if = false;
    if_stmt->else_->accept(this);
    // Save the last label in `else` for the same reason as above.
    llvm_label_t save_last_lbl_in_else = __expr_context.curr_lbl;
    llvm_branch(end_lbl);
    llvm_gen_lbl(end_lbl);
    __expr_context.in_if = save_in_if;
    
    // Go through all the locals and apply the 4 cases above.
    for (size_t i = 0; i < method->locals.len; ++i) {
        bool assigned_if = if_buf[i].assigned;
        bool assigned_else = else_buf[i].assigned;
        if (assigned_if || assigned_else) {
            Local *local = method->locals[i];
            // If only one of them assigned to it, then the initial
            // value is on the _other_ buffer. If both bodies
            // assigned to it, then just emit the nodes between the 2.
            // So, in any case, emit a phi node between the 2.
            // Note: Because there's no `if` without `else`, we will
            // always go to either one of the 2.
            llvalue_t if_value = if_buf[i].llval;
            llvalue_t else_value = else_buf[i].llval;
            llvalue_t new_val = llvm_phi_node(local->type, if_value, else_value,
                                              save_last_lbl_in_if,
                                              save_last_lbl_in_else);
            // Save the new val for the local
            local->llval = new_val;
            // Pass on the previous nesting level. If we have an assignment
            // in an enclosed level, then we have in its outer as well.
            if (nesting_level > 1) {
                if (__expr_context.in_if) {
                    __expr_context.if_bufs[nesting_level - 2][i].assigned = true;
                    __expr_context.if_bufs[nesting_level - 2][i].llval = new_val;
                } else {
                    __expr_context.else_bufs[nesting_level - 2][i].assigned = true;
                    __expr_context.else_bufs[nesting_level - 2][i].llval = new_val;
                }
            }
        } /* else {
            // Do nothing, no assignment was involved.
        } */
    }
    __expr_context.nesting_level -= 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x4f(%rsp), %rdi
callq 0x34c8
leaq 0x653a(%rip), %rdi      # 0x143c6
xorl %eax, %eax
callq 0x3539
movq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0xb31c
cmpl $0x0, 0x4(%rax)
je 0xe553
cmpq 0x8(%r14), %rax
je 0xded9
movl 0xc(%rbx), %ebp
movq %rax, %rdi
callq 0x83da
leaq 0x6522(%rip), %rsi      # 0x143e3
leaq 0x6531(%rip), %rdx      # 0x143f9
leaq 0x4a82(%rip), %r8       # 0x12951
movl %ebp, %edi
movq %rax, %rcx
callq 0x8bb7
leaq 0xcad8(%rip), %r13      # 0x1a9b8
movl 0x8(%r13), %ebp
movups 0xc(%r13), %xmm0
movaps %xmm0, 0x110(%rsp)
movl 0x1c(%r13), %eax
movl %eax, 0x120(%rsp)
movq 0x20(%r13), %xmm0
cmpl $0x1, %ebp
jne 0xdf3f
movd %xmm0, %eax
testl %eax, %eax
je 0xe541
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
jne 0xe54a
leaq 0x650b(%rip), %rdi      # 0x14432
leaq 0x54d0(%rip), %rsi      # 0x133fe
leaq 0x650b(%rip), %rcx      # 0x14440
movl $0x648, %edx            # imm = 0x648
callq 0x20b0
movdqa %xmm0, 0xc0(%rsp)
movq %r14, 0x88(%rsp)
xorl %eax, %eax
movq %rax, 0x98(%rsp)
movq %rax, 0x90(%rsp)
movq %rax, 0x78(%rsp)
callq 0x476a
movq %rax, %r15
leaq 0x521d(%rip), %rsi      # 0x13193
leaq 0x98(%rsp), %rdi
movq %rax, %rdx
callq 0xf93e
leaq 0x5201(%rip), %rsi      # 0x1318e
leaq 0x90(%rsp), %rdi
movq %r15, %rdx
callq 0xf93e
leaq 0x64db(%rip), %rsi      # 0x1447f
leaq 0x78(%rsp), %rdi
movq %r15, %rdx
callq 0xf93e
movl %ebp, 0x128(%rsp)
movaps 0x110(%rsp), %xmm0
movups %xmm0, 0x12c(%rsp)
movl 0x120(%rsp), %eax
movl %eax, 0x13c(%rsp)
movaps 0xc0(%rsp), %xmm0
movlps %xmm0, 0x140(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
movdqu 0x128(%rsp), %xmm0
movups 0x138(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movdqu %xmm0, (%rsp)
callq 0x5448
cmpq $0x0, 0x18(%rbx)
je 0xe56f
cmpq $0x0, 0x20(%rbx)
je 0xe58e
movl 0x30(%r13), %esi
incl %esi
movl %esi, 0x30(%r13)
leaq 0x6449(%rip), %rdi      # 0x14486
xorl %eax, %eax
callq 0x3539
movl 0x30(%r13), %ebp
movq 0x28(%r13), %r12
movq 0x38(%r12), %r15
cmpl 0x34(%r13), %ebp
jle 0xe152
movl %ebp, 0x34(%r13)
xorl %eax, %eax
leaq 0xa0(%rsp), %rdi
movq %rax, 0x10(%rdi)
pxor %xmm0, %xmm0
movdqa %xmm0, (%rdi)
movq %rax, 0xe0(%rsp)
movdqa %xmm0, 0xd0(%rsp)
movq %r15, %rsi
callq 0xf9e6
leaq 0xd0(%rsp), %rdi
movq %r15, %rsi
callq 0xf9e6
movq 0xb0(%rsp), %rax
movq %rax, 0x60(%rsp)
movaps 0xa0(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x48(%r13), %rax
leaq 0x1(%rax), %r12
cmpq 0x40(%r13), %r12
jbe 0xe0d6
leaq 0x40(%r13), %rdi
movq %r12, %rsi
callq 0x10302
movq 0x48(%r13), %rax
movq 0x50(%r13), %rcx
leaq (%rax,%rax,2), %rax
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
movaps 0x50(%rsp), %xmm0
movups %xmm0, (%rcx,%rax,8)
movq %r12, 0x48(%r13)
movq 0xe0(%rsp), %rax
movq %rax, 0x60(%rsp)
movaps 0xd0(%rsp), %xmm0
movaps %xmm0, 0x50(%rsp)
movq 0x60(%r13), %rax
leaq 0x1(%rax), %r12
cmpq 0x58(%r13), %r12
jbe 0xe12d
leaq 0x58(%r13), %rdi
movq %r12, %rsi
callq 0x10302
movq 0x60(%r13), %rax
movq 0x68(%r13), %rcx
leaq (%rax,%rax,2), %rax
movq 0x60(%rsp), %rdx
movq %rdx, 0x10(%rcx,%rax,8)
movdqa 0x50(%rsp), %xmm0
movdqu %xmm0, (%rcx,%rax,8)
movq %r12, 0x60(%r13)
movq 0x28(%r13), %r12
movslq %ebp, %r14
testq %r15, %r15
je 0xe2c9
leaq -0x1(%r14), %rsi
movl $0x10, %eax
xorl %ecx, %ecx
leaq (,%rbp,2), %rdx
addq %rbp, %rdx
shlq $0x3, %rsi
leaq (%rsi,%rsi,2), %rsi
xorl %edi, %edi
cmpl $0x2, %ebp
jl 0xe1b6
cmpb $0x1, 0x38(%r13)
jne 0xe1df
movq 0x50(%r13), %r8
movq -0x20(%r8,%rdx,8), %r10
leaq (%r10,%rax), %r9
addq $0x4, %r9
addq %rax, %r10
movl -0x14(%r9), %r8d
movq -0x10(%r9), %r11
movq %r11, 0x50(%rsp)
movl -0x8(%r9), %r11d
movl %r11d, 0x58(%rsp)
jmp 0xe215
movq 0x30(%r12), %r8
movq (%r8,%rdi,8), %r9
movl 0x10(%r9), %r8d
movl 0x1c(%r9), %r10d
movl %r10d, 0x58(%rsp)
movq 0x14(%r9), %r10
movq %r10, 0x50(%rsp)
leaq 0x20(%r9), %r10
addq $0x24, %r9
jmp 0xe215
movq 0x68(%r13), %r8
movq -0x20(%r8,%rdx,8), %r9
leaq (%rdi,%rdi,4), %r11
movl -0x10(%r9,%rax), %r8d
movq -0xc(%r9,%rax), %r10
movq %r10, 0x50(%rsp)
movl -0x4(%r9,%rax), %r10d
movl %r10d, 0x58(%rsp)
leaq (%r9,%r11,8), %r10
addq $0x10, %r10
leaq (%r9,%r11,8), %r9
addq $0x14, %r9
movl (%r10), %r10d
movl 0x8(%r9), %r11d
movl %r11d, 0xa8(%rsp)
movq (%r9), %r9
movq %r9, 0xa0(%rsp)
movq 0x50(%r13), %r9
movq 0x10(%r9,%rsi), %r9
movl %r8d, -0x10(%r9,%rax)
movq 0x50(%rsp), %r11
movq %r11, -0xc(%r9,%rax)
movl 0x58(%rsp), %r11d
movl %r11d, -0x4(%r9,%rax)
movl %r10d, (%r9,%rax)
movq 0xa0(%rsp), %r11
movq %r11, 0x4(%r9,%rax)
movl 0xa8(%rsp), %r11d
movl %r11d, 0xc(%r9,%rax)
movb %cl, 0x10(%r9,%rax)
movq 0x68(%r13), %r9
movq 0x10(%r9,%rsi), %r9
movl %r8d, -0x10(%r9,%rax)
movq 0x50(%rsp), %r8
movq %r8, -0xc(%r9,%rax)
movl 0x58(%rsp), %r8d
movl %r8d, -0x4(%r9,%rax)
movl %r10d, (%r9,%rax)
movq 0xa0(%rsp), %r8
movq %r8, 0x4(%r9,%rax)
movl 0xa8(%rsp), %r8d
movl %r8d, 0xc(%r9,%rax)
movb %cl, 0x10(%r9,%rax)
incq %rdi
addq $0x28, %rax
cmpq %rdi, %r15
jne 0xe17e
movq %rbp, 0xc0(%rsp)
movb 0x38(%r13), %al
movb %al, 0x80(%rsp)
movq 0x98(%rsp), %rdi
callq 0x542a
movq 0x88(%rsp), %r15
movb $0x1, 0x38(%r13)
movq 0x18(%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x18(%rax)
leaq (%r14,%r14,2), %rax
movq 0x50(%r13), %rcx
movq 0x68(%r13), %rdx
movq -0x8(%rcx,%rax,8), %r14
movq -0x8(%rdx,%rax,8), %rbp
movq 0x38(%r12), %rcx
testq %rcx, %rcx
je 0xe35d
xorl %eax, %eax
xorl %edx, %edx
cmpb $0x1, 0x20(%r14,%rax)
jne 0xe351
movq 0x30(%r12), %rcx
movq (%rcx,%rdx,8), %rcx
movdqu (%rbp,%rax), %xmm0
movups 0x10(%rbp,%rax), %xmm1
movups %xmm1, 0x20(%rcx)
movdqu %xmm0, 0x10(%rcx)
movq 0x38(%r12), %rcx
incq %rdx
addq $0x28, %rax
cmpq %rcx, %rdx
jb 0xe327
movq (%r13), %rax
movq %rax, 0x108(%rsp)
movq 0x78(%rsp), %rdi
callq 0x54c9
movq 0x90(%rsp), %rdi
callq 0x542a
movb $0x0, 0x38(%r13)
movq 0x20(%rbx), %rdi
movq (%rdi), %rax
movq %r15, %rsi
callq *0x18(%rax)
movq (%r13), %rax
movq %rax, 0x88(%rsp)
movq 0x78(%rsp), %rdi
callq 0x54c9
movq 0x78(%rsp), %rdi
callq 0x542a
movb 0x80(%rsp), %al
movb %al, 0x38(%r13)
movq 0x38(%r12), %rax
testq %rax, %rax
je 0xe535
movl $0x4, %r13d
xorl %r15d, %r15d
leaq 0xc5dd(%rip), %rcx      # 0x1a9b8
leaq 0x50(%rcx), %rdx
movq %rdx, 0x80(%rsp)
addq $0x68, %rcx
movq %rcx, 0x100(%rsp)
movq 0xc0(%rsp), %rcx
leaq (%rcx,%rcx,2), %rcx
movq %rcx, 0xf8(%rsp)
cmpb $0x0, (%r14,%r13,8)
jne 0xe41a
cmpb $0x1, (%rbp,%r13,8)
jne 0xe525
leaq (%r14,%r13,8), %rax
addq $-0x20, %rax
leaq -0x20(%rbp,%r13,8), %rcx
movq 0x30(%r12), %rdx
movq (%rdx,%r15,8), %rbx
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movaps %xmm1, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
movups (%rcx), %xmm0
movups 0x10(%rcx), %xmm1
movaps %xmm1, 0xb0(%rsp)
movaps %xmm0, 0xa0(%rsp)
movq 0x8(%rbx), %rsi
movaps 0xa0(%rsp), %xmm0
movaps 0xb0(%rsp), %xmm1
movups %xmm1, 0x30(%rsp)
movups %xmm0, 0x20(%rsp)
movaps 0x50(%rsp), %xmm0
movaps 0x60(%rsp), %xmm1
movups %xmm1, 0x10(%rsp)
movups %xmm0, (%rsp)
leaq 0xd0(%rsp), %rdi
movq 0x108(%rsp), %rdx
movq 0x88(%rsp), %rcx
movq $-0x1, %r8
callq 0x54ff
movdqu 0xd0(%rsp), %xmm0
movups 0xe0(%rsp), %xmm1
movups %xmm1, 0x20(%rbx)
movdqu %xmm0, 0x10(%rbx)
cmpl $0x2, 0xc0(%rsp)
jl 0xe520
leaq 0xc4e0(%rip), %rax      # 0x1a9b8
cmpb $0x0, 0x38(%rax)
movq 0x100(%rsp), %rax
cmovneq 0x80(%rsp), %rax
movq (%rax), %rax
movq 0xf8(%rsp), %rcx
movq -0x20(%rax,%rcx,8), %rax
movb $0x1, (%rax,%r13,8)
movdqu 0xd0(%rsp), %xmm0
movups 0xe0(%rsp), %xmm1
movdqu %xmm0, -0x20(%rax,%r13,8)
movups %xmm1, -0x10(%rax,%r13,8)
movq 0x38(%r12), %rax
incq %r15
addq $0x5, %r13
cmpq %rax, %r15
jb 0xe407
leaq 0xc47c(%rip), %rax      # 0x1a9b8
decl 0x30(%rax)
jmp 0xe553
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0xe5ad
movq (%rdi), %rax
movq %r14, %rsi
callq *0x18(%rax)
leaq 0x4f(%rsp), %rdi
callq 0x34dc
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x5ebc(%rip), %rdi      # 0x14432
leaq 0x4e81(%rip), %rsi      # 0x133fe
leaq 0x5ebc(%rip), %rcx      # 0x14440
movl $0x6c0, %edx            # imm = 0x6C0
callq 0x20b0
leaq 0x5edb(%rip), %rdi      # 0x14470
leaq 0x4e62(%rip), %rsi      # 0x133fe
leaq 0x5e9d(%rip), %rcx      # 0x14440
movl $0x6c1, %edx            # imm = 0x6C1
callq 0x20b0
leaq 0x5ebc(%rip), %rdi      # 0x14470
leaq 0x4e43(%rip), %rsi      # 0x133fe
leaq 0x5e7e(%rip), %rcx      # 0x14440
movl $0x64b, %edx            # imm = 0x64B
callq 0x20b0
jmp 0xe5dc
jmp 0xe5dc
jmp 0xe5dc
jmp 0xe5dc
jmp 0xe5dc
jmp 0xe5dc
jmp 0xe5dc
jmp 0xe5dc
movq %rax, %rbx
leaq 0x4f(%rsp), %rdi
callq 0x34dc
movq %rbx, %rdi
callq 0x21c0