// File: /workspace/github_c_makefile_star2_O3/buptlxb[P]xRay/src/taint_block.cpp
// Function: TaintBlock::TaintBlock(BasicBlock*)
TaintBlock::TaintBlock(BasicBlock *bb)
{
    if (bb->isVisited())
        return;
    bb->setVisited(true);
    bBlocks.push_back(bb);
    const vector<DISASM> &insts = bb->getInsts();
    for (BasicBlock::ConstRevDisasmIter iter = insts.rbegin(); iter != insts.rend(); iter++) {

//        printf("%s (%d %d %d) (%d %d %d) (%d %d %d)\n", iter->CompleteInstr, iter->Argument1.ArgType, iter->Argument1.ArgSize, iter->Argument1.ArgPosition, iter->Argument2.ArgType, iter->Argument2.ArgSize, iter->Argument2.ArgPosition, iter->Argument3.ArgType, iter->Argument3.ArgSize, iter->Argument3.ArgPosition);
        if (IS_WRITE_GPR(iter->Argument1)) {
            define.insert(iter->Argument1);
        } else if (IS_READ_GPR(iter->Argument1)) {
            use.insert(iter->Argument1);
        }

        if (IS_WRITE_GPR(iter->Argument2)) {
            define.insert(iter->Argument2);
        } else if (IS_READ_GPR(iter->Argument2)) {
            use.insert(iter->Argument2);
        }

        if (IS_WRITE_GPR(iter->Argument3)) {
            define.insert(iter->Argument3);
        } else if (IS_READ_GPR(iter->Argument3)) {
            use.insert(iter->Argument3);
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, 0x8(%rsp)
leaq 0x50(%rdi), %rax
xorl %ecx, %ecx
movl %ecx, 0x50(%rdi)
movq %rcx, 0x58(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, (%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x30(%rdi)
movq %rcx, 0x40(%rdi)
movq %rax, 0x60(%rdi)
movq %rax, 0x68(%rdi)
movq %rcx, 0x70(%rdi)
leaq 0x80(%rdi), %rax
movl %ecx, 0x80(%rdi)
movq %rcx, 0x88(%rdi)
movq %rax, 0x90(%rdi)
movq %rax, 0x98(%rdi)
movq %rcx, 0xa0(%rdi)
leaq 0xb0(%rdi), %rax
movl %ecx, 0xb0(%rdi)
movq %rcx, 0xb8(%rdi)
movq %rax, 0xc0(%rdi)
movq %rax, 0xc8(%rdi)
movq %rcx, 0xd0(%rdi)
cmpb $0x0, 0x5a(%rsi)
jne 0xaf49
movq %rdi, %rbx
leaq 0x78(%rdi), %r14
leaq 0xa8(%rdi), %r15
movb $0x1, 0x5a(%rsi)
leaq 0x8(%rsp), %rdx
xorl %esi, %esi
callq 0x8cb6
movq 0x8(%rsp), %r13
movq 0x8(%r13), %r12
cmpq (%r13), %r12
je 0xaf49
addq $-0x1f1, %r12           # imm = 0xFE0F
movl 0x4c(%r12), %eax
cmpl $0x1, %eax
je 0xaea3
cmpl $0x2, %eax
jne 0xaeb6
testb $0x2, 0x42(%r12)
movq %r15, %rdi
jne 0xaeae
jmp 0xaeb6
testb $0x2, 0x42(%r12)
movq %r14, %rdi
je 0xaeb6
movq %r12, %rsi
callq 0xb30c
movl 0xb4(%r12), %eax
cmpl $0x1, %eax
je 0xaed8
cmpl $0x2, %eax
jne 0xaef0
testb $0x2, 0xaa(%r12)
movq %r15, %rdi
jne 0xaee6
jmp 0xaef0
testb $0x2, 0xaa(%r12)
movq %r14, %rdi
je 0xaef0
leaq 0x68(%r12), %rsi
callq 0xb30c
movl 0x11c(%r12), %eax
cmpl $0x1, %eax
je 0xaf12
cmpl $0x2, %eax
jne 0xaf2d
testb $0x2, 0x112(%r12)
movq %r15, %rdi
jne 0xaf20
jmp 0xaf2d
testb $0x2, 0x112(%r12)
movq %r14, %rdi
je 0xaf2d
leaq 0xd0(%r12), %rsi
callq 0xb30c
leaq -0x28d(%r12), %rax
addq $-0x9c, %r12
cmpq (%r13), %r12
movq %rax, %r12
jne 0xae87
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
jmp 0xaf59
movq %rax, %r12
leaq 0x48(%rbx), %r13
movq %r15, %rdi
callq 0xb206
movq %r14, %rdi
callq 0xb206
movq %r13, %rdi
callq 0xb256
movq 0x30(%rbx), %rdi
testq %rdi, %rdi
je 0xaf8d
movq 0x40(%rbx), %rsi
subq %rdi, %rsi
callq 0x8170
movq 0x18(%rbx), %rdi
testq %rdi, %rdi
je 0xafa2
movq 0x28(%rbx), %rsi
subq %rdi, %rsi
callq 0x8170
movq (%rbx), %rdi
testq %rdi, %rdi
je 0xafb6
movq 0x10(%rbx), %rsi
subq %rdi, %rsi
callq 0x8170
movq %r12, %rdi
callq 0x8270