LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::variable::local_replace(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, internal_data::expr const*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, internal_data::expr const*>>> const&, bool&) const
expr *local_replace(const variable_map &map, bool &mod) const{
            auto iter = map.find(str);
            if(iter != map.end()){
                mod = true;
                return iter->second->copy();
            }else{
                return copy();
            }
        }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x8(%rdi), %rsi
movq %r15, %rdi
callq 0x71ee
addq $0x8, %r15
cmpq %r15, %rax
je 0x7149
movb $0x1, (%rbx)
movq 0x40(%rax), %rdi
movq (%rdi), %rax
jmp 0x714f
movq (%r14), %rax
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0x8(%rax)
nop
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lambda::copy() const
expr *copy() const{
            lambda *r = new lambda;
            for(auto iter = variable_seq.begin(); iter != variable_seq.end(); ++iter){
                variable v;
                v.str = iter->str;
                r->variable_seq.push_back(v);
            }
            for(auto iter = get_seq()->vec.begin(); iter != get_seq()->vec.end(); ++iter){
                r->get_seq()->push_back(std::move(std::unique_ptr<expr>((*iter)->copy())));
            }
            return r;
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
movl $0x28, %edi
callq 0x3220
movq %rax, %rbx
movq %rax, %rdi
callq 0x671a
movq 0x8(%r14), %rbp
cmpq 0x10(%r14), %rbp
je 0x73d8
leaq 0x28(%rsp), %r15
movq %rbx, %r12
addq $0x8, %r12
leaq 0x7911(%rip), %r13      # 0xec98
movq %r13, 0x10(%rsp)
movq %r15, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movb $0x0, 0x28(%rsp)
leaq 0x8(%rbp), %rsi
leaq 0x18(%rsp), %rdi
callq 0x3150
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
callq 0x66b2
movq %r13, 0x10(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x73ce
callq 0x31f0
addq $0x28, %rbp
cmpq 0x10(%r14), %rbp
jne 0x7387
movq 0x20(%r14), %rax
movq 0x8(%rax), %r13
cmpq 0x10(%rax), %r13
je 0x7434
leaq 0x8(%rsp), %r15
movq 0x20(%rbx), %r12
movq (%r13), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq %rax, 0x8(%rsp)
addq $0x8, %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x83da
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x741d
movq (%rdi), %rax
callq *0x38(%rax)
movq $0x0, 0x8(%rsp)
addq $0x8, %r13
movq 0x20(%r14), %rax
cmpq 0x10(%rax), %r13
jne 0x73eb
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
jmp 0x747e
movq %rax, %r14
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x7461
movq (%rdi), %rax
callq *0x38(%rax)
movq $0x0, 0x8(%rsp)
jmp 0x7483
movq %rax, %r14
movq %r13, 0x10(%rsp)
movq 0x18(%rsp), %rdi
cmpq %r15, %rdi
je 0x7483
callq 0x31f0
movq %r14, %rdi
callq 0x3360
nop
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lambda::replace(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, internal_data::expr const*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, internal_data::expr const*>>> const&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::unique_ptr<internal_data::expr, std::default_delete<internal_data::expr>>, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, std::unique_ptr<internal_data::expr, std::default_delete<internal_data::expr>>>>> const&, bool&) const
expr *replace(const variable_map &map, const expr_lookup_table &global_map, bool &mod) const{
            variable_map dropped_map = make_dropped_map(map);
            lambda *lam = new lambda;
            lam->variable_seq = variable_seq;
            std::unique_ptr<expr> seq_prime(seq->copy());
            lam->seq.swap(seq_prime);
            std::unique_ptr<expr> f(seq->replace(dropped_map, global_map, mod));
            f.swap(lam->seq);
            return lam;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %rdx
movq %rdi, %r12
movq %rsp, %rdi
movq %r12, %rsi
callq 0x78f8
movl $0x28, %edi
callq 0x3220
movq %rax, %rbx
movq %rax, %rdi
callq 0x671a
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x79e8
movq 0x20(%r12), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rbx), %r13
movq %rax, 0x20(%rbx)
movq 0x20(%r12), %rdi
movq (%rdi), %rax
movq %rsp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq *0x10(%rax)
movq 0x20(%rbx), %rdi
movq %rax, 0x20(%rbx)
testq %rdi, %rdi
je 0x7510
movq (%rdi), %rax
callq *0x38(%rax)
testq %r13, %r13
je 0x751f
movq (%r13), %rax
movq %r13, %rdi
callq *0x38(%rax)
movq %rsp, %rdi
callq 0x6a4a
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
testq %r13, %r13
je 0x755e
movq (%r13), %rax
movq %r13, %rdi
callq *0x38(%rax)
jmp 0x755e
jmp 0x755b
movq %rax, %r14
movq %rbx, %rdi
callq 0x31f0
jmp 0x755e
movq %rax, %r14
movq %rsp, %rdi
callq 0x6a4a
movq %r14, %rdi
callq 0x3360
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lambda::local_replace(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, internal_data::expr const*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, internal_data::expr const*>>> const&, bool&) const
virtual expr *local_replace(const variable_map &map, bool &mod) const{
            variable_map dropped_map = make_dropped_map(map);
            lambda *lam = new lambda;
            lam->variable_seq = variable_seq;
            std::unique_ptr<expr> seq_prime(seq->copy());
            lam->seq.swap(seq_prime);
            std::unique_ptr<expr> f(seq->local_replace(dropped_map, mod));
            f.swap(lam->seq);
            return lam;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdx, %r14
movq %rsi, %rdx
movq %rdi, %r15
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x78f8
movl $0x28, %edi
callq 0x3220
movq %rax, %rbx
movq %rax, %rdi
callq 0x671a
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x79e8
movq 0x20(%r15), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x20(%rbx), %r12
movq %rax, 0x20(%rbx)
movq 0x20(%r15), %rdi
movq (%rdi), %rax
leaq 0x8(%rsp), %rsi
movq %r14, %rdx
callq *0x18(%rax)
movq 0x20(%rbx), %rdi
movq %rax, 0x20(%rbx)
testq %rdi, %rdi
je 0x75eb
movq (%rdi), %rax
callq *0x38(%rax)
testq %r12, %r12
je 0x75fa
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
leaq 0x8(%rsp), %rdi
callq 0x6a4a
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
testq %r12, %r12
je 0x7639
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
jmp 0x7639
jmp 0x7636
movq %rax, %r14
movq %rbx, %rdi
callq 0x31f0
jmp 0x7639
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x6a4a
movq %r14, %rdi
callq 0x3360
nop
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lambda::to_str[abi:cxx11]() const
std::string to_str() const{
            std::string r;
            r += "/";
            std::size_t count = 0;
            for(auto &i : variable_seq){
                r += i.to_str();
                if(count < variable_seq.size() - 1){
                    r += " ";
                }
                ++count;
            }
            r += ". ";
            r += seq->to_str();
            return std::move(r);
        }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %r14
movq %rdi, 0x40(%rsp)
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x2c27(%rip), %rsi      # 0xa2a4
leaq 0x20(%rsp), %rdi
callq 0x33b0
movq 0x8(%r14), %r15
movq 0x10(%r14), %rbp
cmpq %rbp, %r15
je 0x7708
xorl %ebx, %ebx
leaq 0x20(%rsp), %r13
movabsq $-0x3333333333333333, %r12 # imm = 0xCCCCCCCCCCCCCCCD
movq (%r15), %rax
movq %rsp, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
movq %r13, %rdi
callq 0x30d0
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x76d5
callq 0x31f0
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
sarq $0x3, %rax
imulq %r12, %rax
decq %rax
cmpq %rax, %rbx
jae 0x76fc
movq %r13, %rdi
leaq 0x2bb0(%rip), %rsi      # 0xa2a7
callq 0x33b0
incq %rbx
addq $0x28, %r15
cmpq %rbp, %r15
jne 0x76a5
leaq 0x2b97(%rip), %rsi      # 0xa2a6
leaq 0x20(%rsp), %rdi
callq 0x33b0
movq 0x20(%r14), %rsi
movq (%rsi), %rax
movq %rsp, %rdi
callq *0x20(%rax)
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0x20(%rsp), %rdi
callq 0x30d0
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x774c
callq 0x31f0
movq 0x40(%rsp), %rax
leaq 0x10(%rax), %rsi
movq %rsi, (%rax)
movq 0x20(%rsp), %rcx
leaq 0x30(%rsp), %rdx
cmpq %rdx, %rcx
je 0x7775
movq %rcx, (%rax)
movq 0x30(%rsp), %rcx
movq %rcx, 0x10(%rax)
jmp 0x777b
movups (%rdx), %xmm0
movups %xmm0, (%rsi)
movq 0x28(%rsp), %rcx
movq %rcx, 0x8(%rax)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x10(%rsp), %rax
movq -0x10(%rax), %rdi
jmp 0x77ba
jmp 0x77a9
jmp 0x77a9
jmp 0x77a9
jmp 0x77a9
movq %rax, %r14
jmp 0x77c4
movq %rax, %r14
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x77c4
callq 0x31f0
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x77d8
callq 0x31f0
movq %r14, %rdi
callq 0x3360
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lambda::equal(internal_data::expr const*) const
bool equal(const expr *other) const{
            if(other->get_kind() != expr::kind::lambda){
                return false;
            }
            const lambda *other_seq = static_cast<const lambda*>(other);
            if(variable_seq.size() != other_seq->variable_seq.size()){
                return false;
            }
            {
                auto iter = variable_seq.begin();
                for(auto &i : other_seq->variable_seq){
                    if(!iter->equal(&i)){
                        return false;
                    }
                    ++iter;
                }
            }
            const sequence *s = static_cast<const sequence*>(seq.get());
            const sequence *other_s = static_cast<const sequence*>(other_seq->seq.get());
            auto iter = s->vec.begin();
            for(auto &i : other_s->vec){
                if(!i->equal(&*i)){
                    return false;
                }
                ++iter;
            }
            return true;
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
movq (%rsi), %rax
movq %rsi, %rdi
callq *(%rax)
cmpl $0x2, %eax
jne 0x7838
movq 0x8(%r15), %r14
movq 0x10(%r15), %rax
subq %r14, %rax
movq 0x8(%rbx), %r15
movq 0x10(%rbx), %r12
movq %r12, %rcx
subq %r15, %rcx
cmpq %rcx, %rax
jne 0x7838
cmpq %r12, %r15
je 0x7848
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x28(%rax)
testb %al, %al
je 0x7838
addq $0x28, %r14
addq $0x28, %r15
jmp 0x7819
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x20(%rbx), %rax
movq 0x8(%rax), %r14
movq 0x10(%rax), %r15
cmpq %r15, %r14
sete %bl
je 0x783a
movq (%r14), %rdi
movq (%rdi), %rax
movq %rdi, %rsi
callq *0x28(%rax)
testb %al, %al
je 0x783a
addq $0x8, %r14
cmpq %r15, %r14
sete %bl
je 0x783a
movq (%r14), %rdi
movq (%rdi), %rax
movq %rdi, %rsi
callq *0x28(%rax)
addq $0x8, %r14
testb %al, %al
jne 0x7870
jmp 0x783a
// File: /workspace/github_cpp_makefile_star2_O1/pointwiseproduct[P]untyped_lambda/untyped_lambda.cpp
// Function: internal_data::lambda::make_dropped_map(std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, internal_data::expr const*, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, internal_data::expr const*>>> const&) const
variable_map make_dropped_map(const variable_map &map) const{
            variable_map dropped_map = map;
            for(const variable &var_seq_iter : variable_seq){
                auto iter = dropped_map.find(var_seq_iter.str);
                if(iter != dropped_map.end()){
                    dropped_map.erase(iter);
                }
            }
            return std::move(dropped_map);
        }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x7b4e
movq 0x8(%r14), %r15
movq 0x10(%r14), %r12
cmpq %r12, %r15
je 0x7950
leaq 0x8(%rsp), %r13
movq %rsp, %r14
leaq 0x8(%r15), %rsi
movq %r14, %rdi
callq 0x7d70
cmpq %r13, %rax
je 0x7947
movq %r14, %rdi
movq %rax, %rsi
callq 0x7dfa
addq $0x28, %r15
cmpq %r12, %r15
jne 0x792b
leaq 0x8(%rbx), %rax
movq 0x10(%rsp), %rcx
testq %rcx, %rcx
je 0x7996
leaq 0x8(%rsp), %rdx
movl (%rdx), %esi
movl %esi, 0x8(%rbx)
movq %rcx, 0x10(%rbx)
movups 0x10(%rdx), %xmm0
movups %xmm0, 0x18(%rbx)
movq %rax, 0x8(%rcx)
leaq 0x28(%rsp), %rax
movq (%rax), %rcx
movq %rcx, 0x28(%rbx)
movq $0x0, -0x18(%rax)
movq %rdx, -0x10(%rax)
movq %rdx, -0x8(%rax)
jmp 0x79b4
movl $0x0, 0x8(%rbx)
movq $0x0, 0x10(%rbx)
movq %rax, 0x18(%rbx)
movq %rax, 0x20(%rbx)
movq %rbx, %rax
addq $0x28, %rax
movq $0x0, (%rax)
movq %rsp, %rdi
callq 0x6a4a
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x6a4a
movq %rbx, %rdi
callq 0x3360
nop
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/real.cpp
// Function: Real::initializer()
void initializer() {
		INIT_WRAPPER(free, RTLD_NEXT);
//		INIT_WRAPPER(calloc, RTLD_NEXT);
		INIT_WRAPPER(malloc, RTLD_NEXT);
//		INIT_WRAPPER(realloc, RTLD_NEXT);
		
		// FIXME about the flags
		void *pthread_handle = dlopen("libpthread.so.0", RTLD_NOW | RTLD_GLOBAL | RTLD_NOLOAD);
		INIT_WRAPPER(pthread_create, pthread_handle);
		INIT_WRAPPER(pthread_join, pthread_handle);
		INIT_WRAPPER(pthread_kill, pthread_handle);
	}

// Assembly:
pushq %rbx
leaq 0x484c(%rip), %rsi      # 0x9000
movq $-0x1, %rdi
callq 0x4290
movq 0x87f1(%rip), %rcx      # 0xcfb8
movq %rax, (%rcx)
leaq 0x4834(%rip), %rsi      # 0x9005
movq $-0x1, %rdi
callq 0x4290
movq 0x8744(%rip), %rcx      # 0xcf28
movq %rax, (%rcx)
leaq 0x481e(%rip), %rdi      # 0x900c
movl $0x106, %esi            # imm = 0x106
callq 0x43f0
movq %rax, %rbx
leaq 0x481a(%rip), %rsi      # 0x901c
movq %rax, %rdi
callq 0x4290
movq 0x86f7(%rip), %rcx      # 0xcf08
movq %rax, (%rcx)
leaq 0x4810(%rip), %rsi      # 0x902b
movq %rbx, %rdi
callq 0x4290
movq 0x87ae(%rip), %rcx      # 0xcfd8
movq %rax, (%rcx)
leaq 0x4804(%rip), %rsi      # 0x9038
movq %rbx, %rdi
callq 0x4290
movq 0x86f5(%rip), %rcx      # 0xcf38
movq %rax, (%rcx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/xthread.cpp
// Function: getThreadBuffer()
char * getThreadBuffer() {
	#ifdef CUSTOMIZED_STACK
	thread_t * current = xthread::getInstance().getThread(getThreadIndex(&current));
	#else
 	thread_t * current = xthread::getInstance().getThread();
	#endif
	return current->outputBuf;
}

// Assembly:
pushq %rbx
callq 0x4210
movq %rax, %rbx
leaq 0x8727(%rip), %rdi      # 0xcf80
callq 0x44f0
movslq (%rax), %rax
imulq $0x1028, %rax, %rax     # imm = 0x1028
addq %rbx, %rax
addq $0x68, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./errmsg.hh
// Function: printCallStack()
void printCallStack(){
  void* array[256];
  int frames = backtrace(array, 256);

  char main_exe[FILENAMELENGTH];
  readlink("/proc/self/exe", main_exe, FILENAMELENGTH);

#ifdef CUSTOMIZED_STACK
  int threadIndex = getThreadIndex(&frames);
#else
  int threadIndex = getThreadIndex();
#endif

  char buf[256];
  for(int i = 0; i < frames; i++) {
    void* addr = (void*)((unsigned long)array[i] - PREV_INSTRUCTION_OFFSET);
    PRINT("\tThread %d: callstack frame %d: %p\t", threadIndex, i, addr);
    sprintf(buf, "addr2line -a -i -e %s %p", main_exe, addr);
    system(buf);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa08, %rsp            # imm = 0xA08
leaq 0x200(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x4440
movl %eax, %ebp
leaq 0x47ac(%rip), %rdi      # 0x9070
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x4310
leaq 0x86a7(%rip), %rdi      # 0xcf80
callq 0x44f0
testl %ebp, %ebp
jle 0x4972
movl (%rax), %ebx
movl %ebp, %r13d
leaq 0x100(%rsp), %r12
xorl %ebp, %ebp
movq 0x200(%rsp,%rbp,8), %r14
decq %r14
callq 0x41e0
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x4768(%rip), %rdx      # 0x907f
movl %ebx, %ecx
movl %ebp, %r8d
movq %r14, %r9
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r15
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r15, %rsi
movq %rax, %rdx
callq 0x40f0
movq %r12, %rdi
leaq 0x475c(%rip), %rsi      # 0x90b1
movq %rsp, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x4070
movq %r12, %rdi
callq 0x4230
incq %rbp
cmpq %rbp, %r13
jne 0x48f8
addq $0xa08, %rsp            # imm = 0xA08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: heapinitialize()
void heapinitialize() {
	if(heapInitStatus == E_HEAP_INIT_NOT) {
		heapInitStatus = E_HEAP_INIT_WORKING;
		parseEnvOpts();
		#ifndef NDEBUG
		debugPrintOptions();
		#endif
    SRAND(time(NULL));
		BibopHeap::getInstance().initialize();
		heapInitStatus = E_HEAP_INIT_DONE;
		// The following function will invoke dlopen and will call malloc in the end.
		// Thus, it is putted in the end so that it won't fail
		Real::initializer();
		xthread::getInstance().initialize();
		BigHeap::getInstance().initBigHeap();
	} else {
			while(heapInitStatus != E_HEAP_INIT_DONE);
	}
}

// Assembly:
pushq %rbx
movq 0x85c7(%rip), %rbx      # 0xcf58
cmpl $0x0, (%rbx)
je 0x4998
popq %rbx
retq
movl $0x1, (%rbx)
callq 0x4150
callq 0x4190
xorl %edi, %edi
callq 0x4270
movl %eax, %edi
callq 0x42c0
callq 0x4100
movq %rax, %rdi
callq 0x44d0
movl $0x2, (%rbx)
callq 0x4280
callq 0x4210
movq %rax, %rdi
callq 0x43b0
callq 0x40c0
movq %rax, %rbx
leaq 0xc(%rax), %rdi
xorl %esi, %esi
callq 0x42a0
addq $0x10, %rbx
movq 0x84ef(%rip), %rsi      # 0xcee8
movq 0x8578(%rip), %rdx      # 0xcf78
movl $0x500, %ecx            # imm = 0x500
movq %rbx, %rdi
popq %rbx
jmp 0x4080
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: xxfree
void xxfree(void * ptr) {
		if(ptr == NULL || heapInitStatus != E_HEAP_INIT_DONE) {
			return;
		}

    if(BibopHeap::getInstance().isSmallObject(ptr)) {
        BibopHeap::getInstance().freeSmallObject(ptr);
    } else if(BigHeap::getInstance().isLargeObject(ptr)) {
        BigHeap::getInstance().deallocateToBigHeap(ptr);
    } else {
        PRERR("invalid free on address %p", ptr);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x4aea
movq 0x8533(%rip), %rax      # 0xcf58
cmpl $0x2, (%rax)
jne 0x4aea
movq %rdi, %rbx
callq 0x4100
cmpq %rbx, (%rax)
ja 0x4a58
cmpq %rbx, 0x8(%rax)
jb 0x4a58
callq 0x4100
movq %rax, %rdi
movq %rbx, %rsi
addq $0x18, %rsp
popq %rbx
popq %r14
jmp 0x4300
callq 0x40c0
leaq 0x10(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x10(%rax), %rdi
leaq 0x8(%rsp), %rcx
movl $0x8, %edx
callq 0x41c0
testb %al, %al
je 0x4a8e
callq 0x40c0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4460
jmp 0x4aea
callq 0x41e0
movq %rax, %r14
callq 0x4250
movq %rbx, (%rsp)
leaq 0x493a(%rip), %rdx      # 0x93e0
leaq 0x4664(%rip), %r8       # 0x9111
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x116, %r9d            # imm = 0x116
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: xxmalloc
void * xxmalloc(size_t size) {
    if(heapInitStatus != E_HEAP_INIT_DONE) {
			heapinitialize();
    }

		// Calculate the proper bag size needed to fulfill this request
		if(IF_CANARY_CONDITION) {
			numLargeObjects++;
			return BigHeap::getInstance().allocateAtBigHeap(size);
		} else {
			return BibopHeap::getInstance().allocateSmallObject(size);
		}

		return NULL;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x845b(%rip), %rax      # 0xcf58
cmpl $0x2, (%rax)
je 0x4b07
callq 0x42d0
cmpq $0x80001, %rbx          # imm = 0x80001
jb 0x4b30
movq 0x83e1(%rip), %rax      # 0xcef8
incq (%rax)
callq 0x40c0
movl $0x10, %esi
movq %rax, %rdi
movq %rbx, %rdx
popq %rbx
jmp 0x4400
callq 0x4100
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x4410
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: xxcalloc
void * xxcalloc(size_t nelem, size_t elsize) {
	void * ptr = NULL;
	ptr = malloc(nelem * elsize);
	if(ptr != NULL) {
		memset(ptr, 0, nelem * elsize);
	}
	return ptr;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
imulq %rsi, %rbx
movq %rbx, %rdi
callq 0x4320
testq %rax, %rax
je 0x4b64
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x4160
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: xxrealloc
void * xxrealloc(void * ptr, size_t sz) {
		// We can't really support this library call when the allocator
		// is uninitialized; this is because there is no way for us to
		// determine the actual size of an object given only its
		// starting address using the temporary allocator.
    if(heapInitStatus != E_HEAP_INIT_DONE) {
        heapinitialize();
    }

		// If the pointer is null, call is equivalent to malloc(sz).
		if(ptr == NULL) {
				return xxmalloc(sz);
		}

		// If the pointer is non-null and size is zero, call is equivalent
		// to free(ptr).
		if(sz == 0) {
				xxfree(ptr);
				return NULL;
		}

		// If the object is unknown to us, return NULL to indicate error.
		size_t oldSize = -1;
    if(BibopHeap::getInstance().isSmallObject(ptr)) {
        oldSize = BibopHeap::getInstance().getObjectSize(ptr);
    } else if(BigHeap::getInstance().isLargeObject(ptr)) {
        oldSize = BigHeap::getInstance().getObjectSize(ptr);
    }

		if(oldSize == -1) {
				PRERR("realloc called with unknown object");
				return NULL;
		}

		// If the requested new size is less than
		// or equal to the old size, simply return the object as-is.
		if(oldSize >= sz) {
				return ptr;
		}

		void * newObject = xxmalloc(sz);
		memcpy(newObject, ptr, oldSize);
		xxfree(ptr);
		return newObject;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x83dc(%rip), %rax      # 0xcf58
cmpl $0x2, (%rax)
je 0x4b86
callq 0x42d0
testq %rbx, %rbx
je 0x4bb5
testq %r14, %r14
je 0x4bc6
callq 0x4100
cmpq %rbx, (%rax)
ja 0x4bd5
cmpq %rbx, 0x8(%rax)
jb 0x4bd5
callq 0x4100
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4130
movq %rax, %r15
jmp 0x4c2d
movq %r14, %rdi
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
jmp 0x4260
movq %rbx, %rdi
callq 0x41a0
xorl %ebx, %ebx
jmp 0x4cbc
callq 0x40c0
leaq 0x8(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x10(%rax), %rdi
movq %rsp, %rcx
movl $0x8, %edx
callq 0x41c0
movq $-0x1, %r15
testb %al, %al
je 0x4c2d
callq 0x40c0
leaq 0x8(%rsp), %rsi
movq %rbx, (%rsi)
leaq 0x10(%rax), %rdi
movq %rsp, %rcx
movl $0x8, %edx
callq 0x41c0
testb %al, %al
je 0x4c2a
movq (%rsp), %rax
movq 0x20(%rax), %r15
jmp 0x4c2d
xorl %r15d, %r15d
cmpq $-0x1, %r15
je 0x4c62
cmpq %r14, %r15
jae 0x4cbc
movq %r14, %rdi
callq 0x4260
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4220
movq %rbx, %rdi
callq 0x41a0
movq %r14, %rbx
jmp 0x4cbc
callq 0x41e0
movq %rax, %r14
callq 0x4250
leaq 0x47a9(%rip), %rdx      # 0x941f
leaq 0x4494(%rip), %r8       # 0x9111
xorl %ebx, %ebx
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x141, %r9d            # imm = 0x141
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r14
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40f0
movq %rbx, %rax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/libguarder.cpp
// Function: xxmemalign
void * xxmemalign(size_t alignment, size_t size) {
		if(size == 0) {
			return NULL;
		}

		// Calculate the proper bag size needed to fulfill this request
		if(size > LARGE_OBJECT_THRESHOLD) {
			numLargeObjects++;
			return BigHeap::getInstance().allocateAlignedAtBigHeap(alignment, size);
		} else {
			size_t allocObjectSize = alignment + size;
			uintptr_t object = (uintptr_t)BibopHeap::getInstance().allocateSmallObject(allocObjectSize);
			unsigned long residualBytes = alignment - (object % alignment);
			void * alignedObject = (void *)(object + residualBytes);
			PRDBG("memalign: original object @ 0x%lx, residual bytes=%lu, aligned object @ %p",
							object, residualBytes, alignedObject);
			return alignedObject;
		}

		return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x4ded
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x80001, %rsi          # imm = 0x80001
jb 0x4df5
movq 0x812c(%rip), %rax      # 0xcef8
incq (%rax)
callq 0x40c0
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4400
xorl %r14d, %r14d
jmp 0x4e7c
addq %rbx, %r14
callq 0x4100
movq %rax, %rdi
movq %r14, %rsi
callq 0x4410
movq %rax, %r15
xorl %edx, %edx
divq %rbx
subq %rdx, %rbx
leaq (%rbx,%r15), %r14
callq 0x41e0
movq %rax, %r12
callq 0x4250
subq $0x8, %rsp
leaq 0x4687(%rip), %rdx      # 0x94b6
leaq 0x42db(%rip), %r8       # 0x9111
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %rax, %rcx
movl $0x176, %r9d            # imm = 0x176
xorl %eax, %eax
pushq %r14
pushq %rbx
pushq %r15
callq 0x4490
addq $0x20, %rsp
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::initialize()
void initialize() {
		_aliveThreads = 0;
    _threadIndex = 0;

		// Initialize the spin_lock
		pthread_spin_init(&_spin_lock, PTHREAD_PROCESS_PRIVATE);

    thread_t * thread;

    // Shared the threads information.
    memset(&_threads, 0, sizeof(_threads));

		// Initialize all 
    for(int i = 0; i < MAX_ALIVE_THREADS; i++) {
				thread = &_threads[i];

				// Those information that are only initialized once.
				thread->available = true;
				thread->index = i;
		}

		// Now we will intialize the initial thread
		initializeInitialThread();

		_xmap.initialize(HashFuncs::hashAddr, HashFuncs::compareAddr, THREAD_MAP_SIZE);
		_xmap.insert((void*)pthread_self(), sizeof(void*), 0);
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movl %r14d, 0x38(%rdi)
movl %r14d, 0x4(%rdi)
xorl %esi, %esi
callq 0x42a0
leaq 0x40(%rbx), %rdi
movl $0x81400, %edx          # imm = 0x81400
xorl %esi, %esi
callq 0x4160
leaq 0x50(%rbx), %rax
movb $0x1, -0x10(%rax)
movl %r14d, (%rax)
incq %r14
addq $0x1028, %rax           # imm = 0x1028
cmpq $0x80, %r14
jne 0x5c95
movq %rbx, %rdi
callq 0x43d0
addq $0x8, %rbx
movq 0x7227(%rip), %rsi      # 0xcee8
movq 0x72b0(%rip), %rdx      # 0xcf78
movl $0x500, %ecx            # imm = 0x500
movq %rbx, %rdi
callq 0x42b0
callq 0x4250
movq %rsp, %rsi
movq %rax, (%rsi)
movl $0x8, %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x4340
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::allocateSmallObject(unsigned long)
void * allocateSmallObject(size_t sz) {
		//PRDBG("allocateSmallObject(%zu)", sz);

		#ifdef CUSTOMIZED_STACK
		int threadIndex = getThreadIndex(&sz);
		#else
		int threadIndex = getThreadIndex();
		#endif

    #ifdef USE_CANARY
    sz++;   // make room for the buffer overflow canary
    #endif

		unsigned classSizePower;
    if(sz <= BIBOP_MIN_BLOCK_SIZE) {
      classSizePower = LOG2(BIBOP_MIN_BLOCK_SIZE);
    } else {
      classSizePower = N_64BITS - __builtin_clzl(sz - 1);
    }

		PerThreadMap& curMap = _threadMap[threadIndex]; 
		unsigned bagNum = curMap.getBagNum(classSizePower);
		BibopObjCache& curCache = _bagCache[threadIndex][bagNum]; 

		PRDBG("allocateSmallObject(%zu): threadIndex = %d, bagNum = %d, class size = %u",
						sz, threadIndex, bagNum, curCache.getClassSize());

		void * object = curCache.malloc();

		return object;
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x724f(%rip), %rdi      # 0xcf80
callq 0x44f0
movslq (%rax), %r12
leaq -0x1(%rbx), %rax
bsrq %rax, %rax
xorq $-0x40, %rax
addq $0x41, %rax
imulq $0x32, %r12, %rcx
addq %r14, %rcx
cmpq $0x11, %rbx
movl $0x4, %edx
cmovaeq %rax, %rdx
movzbl 0x4c(%rdx,%rcx), %r13d
movq %r12, %rax
shlq $0xb, %rax
addq %r14, %rax
movl %r13d, %ecx
shll $0x7, %ecx
leaq (%rcx,%rax), %r14
addq $0x41980, %r14          # imm = 0x41980
callq 0x41e0
movq %rax, %r15
callq 0x4250
movl 0x10(%r14), %r10d
leaq 0x3fa2(%rip), %rdx      # 0x9d3b
leaq 0x37da(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rax, %rcx
movl $0x3fa, %r9d            # imm = 0x3FA
xorl %eax, %eax
pushq %r10
pushq %r13
pushq %r12
pushq %rbx
callq 0x4490
addq $0x20, %rsp
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x44a0
nop
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bigheap.hh
// Function: BigHeap::deallocateToBigHeap(void*)
void deallocateToBigHeap(void * ptr) {
    bigObjectStatus * objStatus;
		if(!_xmap.find(ptr, sizeof(void *), &objStatus)) {
			PRINT("invalid or double free on address %p", ptr);
      printCallStack();
      exit(-1);
		}

		//PRDBG("BigHeap freed %p (begins @ %p), size %zu (actual %zu), objStatus @ %p",
		//				ptr, objStatus->start, objStatus->size, objStatus->pageUpSize, objStatus);
		acquireGlobalLock();
		_xmap.erase(ptr, sizeof(void *));
		releaseGlobalLock();
		MM::mmapDeallocate(objStatus->actualStart, objStatus->pageUpSize);
		HeapAllocator::deallocate(objStatus);
	}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
leaq 0x10(%rsp), %rax
movq %rsi, (%rax)
leaq 0x10(%rdi), %r14
leaq 0x8(%rsp), %rcx
movl $0x8, %edx
movq %r14, %rdi
movq %rax, %rsi
callq 0x41c0
testb %al, %al
je 0x60a2
addq $0xc, %rbx
movq %rbx, %rdi
callq 0x4240
leaq 0x10(%rsp), %rsi
movl $0x8, %edx
movq %r14, %rdi
callq 0x4050
movq %rbx, %rdi
callq 0x4090
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rax), %rsi
callq 0x4180
movq 0x8(%rsp), %rdi
movq 0x6f20(%rip), %rax      # 0xcfb8
callq *(%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x41e0
movq 0x10(%rsp), %rcx
leaq 0x457d(%rip), %rdx      # 0xa630
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
callq 0x4540
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4370
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::getObjectSize(void*)
size_t getObjectSize(void * addr) {
    void * objectStartAddr;
    PerThreadBag * bag;
    (void)getShadowObjectInfo(addr, &bag, &objectStartAddr);

    size_t classSize = bag->classSize;

    if(objectStartAddr != addr) {
        ptrdiff_t offset = (uintptr_t)addr - (uintptr_t)objectStartAddr;
        classSize -= offset;
    }

    #ifdef USE_CANARY
    return (classSize - 1);
    #else
    return classSize;
    #endif
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movq %rdi, %rbx
movq (%rdi), %r15
movq %rsi, %r12
subq %r15, %r12
movq 0x6e50(%rip), %rax      # 0xcf68
movb (%rax), %cl
movq %r12, %r13
shrq %cl, %r13
movb 0x38(%rdi), %cl
movq %r12, %rdx
shrq %cl, %rdx
andq 0x40(%rdi), %r13
imulq $0x32, %rdx, %rcx
shlq $0xb, %rdx
leaq (%rdi,%rdx), %rbp
addq $0x1980, %rbp           # imm = 0x1980
movl %r13d, %edx
shlq $0x7, %r13
leaq (%rdi,%rcx), %rax
addq $0x4c, %rax
movzbl 0x22(%rdx,%rax), %r14d
leaq 0x6e23(%rip), %rdi      # 0xcf80
callq 0x44f0
movl (%rax), %ecx
imulq $0x32, %rcx, %rax
addq %rbx, %rax
addq $0x4c, %rax
movzbl (%r14,%rax), %edx
movq 0x28(%r13,%rbp), %rax
notq %rax
movq 0x6e62(%rip), %rsi      # 0xcfe8
andq (%rsi), %rax
addq 0x38(%r13,%rbp), %r15
andq %r12, %rax
addq %rax, %r15
shll $0x7, %edx
shlq $0xb, %rcx
xorl %eax, %eax
subq (%rsp), %r15
cmovneq %r15, %rax
addq %rbx, %rcx
addq $0x1980, %rcx           # imm = 0x1980
addq 0x20(%rdx,%rcx), %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bigheap.hh
// Function: BigHeap::allocateAlignedAtBigHeap(unsigned long, unsigned long)
void * allocateAlignedAtBigHeap(size_t alignment, size_t size) {
		assert(IF_CANARY_CONDITION);

		size_t pageUpSize = alignup(alignment + size, PageSize);
		size_t slackSize = pageUpSize - size;
		bigObjectStatus * objStatus = (bigObjectStatus *)HeapAllocator::allocate(sizeof(bigObjectStatus));
		void * ptr = MM::mmapAllocatePrivate(pageUpSize, NULL);

		uintptr_t userStartPtr = (uintptr_t)ptr + slackSize;
		size_t residualBytes = userStartPtr % alignment;
		userStartPtr -= residualBytes;

		acquireGlobalLock();
    _xmap.insert((void *)userStartPtr, sizeof(void *), objStatus);
		releaseGlobalLock();

		objStatus->actualStart = ptr;
		objStatus->userStart = (void *)userStartPtr;
		objStatus->pageUpSize = pageUpSize;
		objStatus->usableSize = size + residualBytes;
		objStatus->size = size;

		PRDBG("BigHeap returning 0x%lx (begins @ %p), size %zu (actual %zu, usable %zu)",
						userStartPtr, ptr, size, pageUpSize, objStatus->usableSize);
		return (void *)userStartPtr;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpq $0x80000, %rdx          # imm = 0x80000
jbe 0x630d
movq %rsi, %r13
movq %rdi, %rbp
leaq (%rsi,%rdx), %r15
addq $0xfff, %r15            # imm = 0xFFF
andq $-0x1000, %r15          # imm = 0xF000
movq %r15, %rbx
subq %rdx, %rbx
movq 0x6d24(%rip), %rax      # 0xcf28
movl $0x28, %edi
movq %rdx, 0x8(%rsp)
callq *(%rax)
movq %rax, %r12
xorl %edi, %edi
movq %r15, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x43c0
movq %rax, (%rsp)
addq %rax, %rbx
movq %rbx, %rax
xorl %edx, %edx
divq %r13
movq %rdx, %r13
subq %rdx, %rbx
leaq 0xc(%rbp), %r14
movq %r14, %rdi
callq 0x4240
addq $0x10, %rbp
leaq 0x10(%rsp), %rsi
movq %rbx, (%rsi)
movl $0x8, %edx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x41d0
movq %r14, %rdi
callq 0x4090
movq (%rsp), %rbp
movq %rbp, (%r12)
movq %rbx, 0x8(%r12)
movq %r15, 0x18(%r12)
movq 0x8(%rsp), %rax
addq %rax, %r13
movq %r13, 0x20(%r12)
movq %rax, 0x10(%r12)
movq %rax, %r13
callq 0x41e0
movq %rax, %r14
callq 0x4250
subq $0x8, %rsp
leaq 0x44cb(%rip), %rdx      # 0xa773
leaq 0x447f(%rip), %r8       # 0xa72e
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x6b, %r9d
xorl %eax, %eax
pushq 0x20(%r12)
pushq %r15
pushq %r13
pushq %rbp
pushq %rbx
callq 0x4490
addq $0x30, %rsp
callq 0x41e0
movq %rax, %r14
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40f0
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4406(%rip), %rdi      # 0xa71a
leaq 0x4413(%rip), %rsi      # 0xa72e
leaq 0x4419(%rip), %rcx      # 0xa73b
movl $0x55, %edx
callq 0x4200
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::thread_create(unsigned long*, pthread_attr_t const*, void* (*)(void*), void*)
int thread_create(pthread_t * tid, const pthread_attr_t * attr, threadFunction * fn, void * arg) {
		acquireGlobalLock();
		int tindex = allocThreadIndex();
		releaseGlobalLock();

		// Acquire the thread structure.
		thread_t* children = getThread(tindex);	
		children->startArg = arg;
		children->startRoutine = fn;
		children->index = tindex;

		#ifdef CUSTOMIZED_STACK
		pthread_attr_t iattr;
		if(attr == NULL) {
			pthread_attr_init(&iattr);
		} else {
			memcpy(&iattr, attr, sizeof(pthread_attr_t));
		}
		pthread_attr_setstack(&iattr, (void*)(globalStackAddr + (intptr_t)tindex * STACK_SIZE + GUARD_PAGE_SIZE), STACK_SIZE - 2 * GUARD_PAGE_SIZE);
		/* Guard pages have already been setted before main()
		if(0 != mprotect((void*)(childrenStackStart + STACK_SIZE - GUARD_PAGE_SIZE), GUARD_PAGE_SIZE, PROT_NONE)
				|| 0 != mprotect((void*)childrenStackStart, GUARD_PAGE_SIZE, PROT_NONE)) {
			fprintf(stderr, "Failed to set guard page for thread#%d\n", tindex);
			abort();
		}
		*/

		int result = Real::pthread_create(tid, &iattr, xthread::startThread, (void *)children);
		#else
		int result = Real::pthread_create(tid, attr, xthread::startThread, (void *)children);
		#endif

		if(result) {
			FATAL("thread_create failure");
		}
		
		// Setting up this in the main thread so that
		// pthread_join can always find its pthread_t. 
		// Otherwise, it can fail because the child have set this value.
		children->pthreadt = *tid;
		acquireGlobalLock();
		_xmap.insertIfAbsent((void*)*tid, sizeof(void*), tindex);
		releaseGlobalLock();
		return result;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, %r12
movq %rcx, %r13
movq %rdx, 0x8(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
callq 0x4240
movq %rbx, %rdi
callq 0x41b0
movl %eax, %ebp
movq %rbx, %rdi
callq 0x4090
movslq %ebp, %rax
imulq $0x1028, %rax, %rax     # imm = 0x1028
leaq (%rbx,%rax), %r15
addq $0x40, %r15
movq %r12, 0x20(%r15)
movq %r13, 0x18(%r15)
movl %ebp, 0x10(%r15)
movq 0x6b75(%rip), %rax      # 0xcf08
movq 0x6c16(%rip), %rdx      # 0xcfb0
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rcx
callq *(%rax)
testl %eax, %eax
jne 0x63ee
movq (%r14), %rax
movq %rax, 0x8(%r15)
movq %rbx, %rdi
callq 0x4240
leaq 0x8(%rbx), %rdi
movq (%r14), %rax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
movl $0x8, %edx
movl %ebp, %ecx
callq 0x40e0
movq %rbx, %rdi
callq 0x4090
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x41e0
movq %rax, %rbx
callq 0x4250
leaq 0x449d(%rip), %rdx      # 0xa89f
leaq 0x37ee(%rip), %r8       # 0x9bf7
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0xcb, %r9d
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4370
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::thread_join(unsigned long, void**)
int thread_join(pthread_t tid, void ** retval) {
		int joinretval;
		if((joinretval = Real::pthread_join(tid, retval)) == 0) {
				int joinee = -1;

				acquireGlobalLock();
				if(!_xmap.find((void *)tid, sizeof(void *), &joinee)) {
						PRERR("Cannot find joinee index for thread %p", (void *)tid);
				} else {
						_threads[joinee].available = true;
				}
				_aliveThreads--;
				releaseGlobalLock();
		}
		return joinretval;
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x6b71(%rip), %rax      # 0xcfd8
movq %rsi, %rdi
movq %rdx, %rsi
callq *(%rax)
movl %eax, %ebp
testl %eax, %eax
jne 0x6524
leaq 0xc(%rsp), %r15
movl $0xffffffff, (%r15)     # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x4240
leaq 0x8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
movl $0x8, %edx
movq %r15, %rcx
callq 0x43a0
testb %al, %al
je 0x64bd
movslq 0xc(%rsp), %rax
imulq $0x1028, %rax, %rax     # imm = 0x1028
movb $0x1, 0x40(%rbx,%rax)
jmp 0x6519
callq 0x41e0
movq %rax, %r15
callq 0x4250
movq %r14, (%rsp)
leaq 0x44a8(%rip), %rdx      # 0xa97d
leaq 0x371b(%rip), %r8       # 0x9bf7
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rax, %rcx
movl $0xf2, %r9d
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r14
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40f0
decl 0x38(%rbx)
movq %rbx, %rdi
callq 0x4090
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::BibopFreeCache::getNext()
inline void * getNext() {
							if(_numFreeObjects == 0) {
									#ifdef USE_GLOBAL_FREE_CACHE
									// Repopulate from the global free cache, if possible
									if(_myGlobalFreeCache) {
											if(repopulate() == 0) {
													return NULL;
											}
									} else {
											return NULL;
									}
									#else
									return NULL;
									#endif
							}

							void ** oldTail = (void **)_tail;

							_tail += POINTER_SIZE;
							if(_tail == _endaddr) {
									// do wrap-around on _tail
									_tail = _startaddr;
							}

							_numFreeObjects--;
							if(_head == _tail) {
									PRDBG("free cache is now empty");
							}

							PRDBG("freeCache->getNext(): retval=%p, this=%p, _numFreeObjects=%lu, _capacity=%lu, _start=0x%lx, _end=0x%lx",
											*oldTail, this, _numFreeObjects, _capacity, _startaddr, _endaddr);
							return *oldTail;
					}

// Assembly:
movq 0x38(%rdi), %rax
testq %rax, %rax
je 0x6789
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x20(%rdi), %r15
leaq 0x8(%r15), %rcx
movq %rcx, 0x20(%rdi)
cmpq 0x10(%rdi), %rcx
jne 0x66ab
movq 0x8(%rbx), %rcx
movq %rcx, 0x20(%rbx)
decq %rax
movq %rax, 0x38(%rbx)
movq 0x18(%rbx), %rax
cmpq 0x20(%rbx), %rax
jne 0x6714
callq 0x41e0
movq %rax, %r14
callq 0x4250
leaq 0x2eb9(%rip), %rdx      # 0x9589
leaq 0x2ea3(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0xde, %r9d
xorl %eax, %eax
callq 0x4490
callq 0x41e0
movq %rax, %r14
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %r14, %rsi
movq %rax, %rdx
callq 0x40f0
callq 0x41e0
movq %rax, %r14
callq 0x4250
leaq 0x2e99(%rip), %rdx      # 0x95c1
leaq 0x2e4b(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0xe2, %r9d
xorl %eax, %eax
pushq 0x10(%rbx)
pushq 0x8(%rbx)
pushq 0x28(%rbx)
pushq 0x38(%rbx)
pushq %rbx
pushq (%r15)
callq 0x4490
addq $0x30, %rsp
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movq (%r15), %rax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::allocGlobalFreeCache(unsigned int)
void allocGlobalFreeCache(unsigned numObjectsInHeap) {
			unsigned minClassSizePower = LOG2(BIBOP_MIN_BLOCK_SIZE);
			unsigned numClassSizePowers = BIBOP_NUM_BAGS + minClassSizePower - 1;
			unsigned long approxNumObjectsInSubHeap = (_bibopBagSize / (BIBOP_MIN_BLOCK_SIZE >> 1)) -
					(_bibopBagSize / (1U << numClassSizePowers));
			unsigned shiftBits;

			size_t globalFreeCacheSize = approxNumObjectsInSubHeap * sizeof(uintptr_t);
			uintptr_t myFreeCacheStart = (uintptr_t)MM::mmapAllocatePrivate(globalFreeCacheSize);

      unsigned long numObjectsInClass = _bibopBagSize / BIBOP_MIN_BLOCK_SIZE;
			for(shiftBits = minClassSizePower; shiftBits <= numClassSizePowers; shiftBits++) {
					_globalFreeCache[shiftBits].initialize(myFreeCacheStart, numObjectsInClass);
					myFreeCacheStart += (numObjectsInClass * POINTER_SIZE);
					numObjectsInClass >>= 1;
			}
	}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x680a(%rip), %r15      # 0xcfa8
movq (%r15), %rsi
movq %rsi, %rax
shrq $0x10, %rax
andq $-0x8, %rax
subq %rax, %rsi
andq $-0x8, %rsi
xorl %edi, %edi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
callq 0x43c0
movq %rax, %r14
movq (%r15), %r15
shrq $0x4, %r15
addq $0xa1bc0, %rbx          # imm = 0xA1BC0
movl $0x10, %r12d
movq %rbx, %rdi
xorl %esi, %esi
callq 0x42a0
movq %r14, -0x38(%rbx)
leaq (%r14,%r15,8), %rax
movq %rax, -0x30(%rbx)
movq %r14, -0x28(%rbx)
movq %r14, -0x20(%rbx)
movq %r15, -0x18(%rbx)
xorps %xmm0, %xmm0
movaps %xmm0, -0x10(%rbx)
shrq %r15
subq $-0x80, %rbx
movq %rax, %r14
decq %r12
jne 0x67d8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./mm.hh
// Function: MM::allocate(bool, unsigned long, int, void*)
static void* allocate(bool isShared, size_t sz, int fd, void* startaddr) {
    int protInfo = PROT_READ | PROT_WRITE;
    int sharedInfo = isShared ? MAP_SHARED : MAP_PRIVATE;
    sharedInfo |= ((fd == -1) ? MAP_ANONYMOUS : 0);
    sharedInfo |= ((startaddr != (void*)0) ? MAP_FIXED : 0);
    sharedInfo |= MAP_NORESERVE;

    void* ptr = mmap(startaddr, sz, protInfo, sharedInfo, fd, 0);
    if(ptr == MAP_FAILED) {
      FATAL("Couldn't do mmap (%s) : startaddr %p, sz %lx, protInfo=%d, sharedInfo=%d",
            strerror(errno), startaddr, sz, protInfo, sharedInfo);
    }

    return ptr;
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %rbx
movl %edx, %r8d
movq %rsi, %r14
xorl %eax, %eax
testq %rcx, %rcx
setne %al
xorl %ecx, %ecx
cmpl $-0x1, %edx
sete %cl
shll $0x5, %ecx
shll $0x4, %eax
subl %edi, %ecx
leal (%rcx,%rax), %r15d
addl $0x4002, %r15d          # imm = 0x4002
movq %rbx, %rdi
movl $0x3, %edx
movl %r15d, %ecx
xorl %r9d, %r9d
callq 0x4520
cmpq $-0x1, %rax
je 0x6e5a
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x41e0
movq %rax, %r12
callq 0x4250
movq %rax, %r13
callq 0x4030
movl (%rax), %edi
callq 0x40d0
movq %rax, %r10
subq $0x8, %rsp
leaq 0x2a44(%rip), %rdx      # 0x98c8
leaq 0x2ab1(%rip), %r8       # 0x993c
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %r13, %rcx
movl $0x3c, %r9d
xorl %eax, %eax
pushq %r15
pushq $0x3
pushq %r14
pushq %rbx
pushq %r10
callq 0x4490
addq $0x30, %rsp
callq 0x41e0
movq %rax, %rbx
callq 0x41e0
movq %rax, %rdi
callq 0x4120
movl $0x2, %edi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x40f0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x4370
nop
// File: /workspace/github_cpp_makefile_star2_O1/UTSASRG[P]Guarder/./xthread.hh
// Function: xthread::initializeInitialThread()
void initializeInitialThread(void) {
		int tindex = allocThreadIndex();
   	assert(tindex == 0);

		thread_t * thread = getThread(tindex);
	
		// Initial myself, like threadIndex, tid
		initializeCurrentThread(thread);
	}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x41b0
testl %eax, %eax
jne 0x6efa
leaq 0x40(%rbx), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x4060
leaq 0x2cea(%rip), %rdi      # 0x9beb
leaq 0x2cef(%rip), %rsi      # 0x9bf7
leaq 0x2cf5(%rip), %rcx      # 0x9c04
movl $0x57, %edx
callq 0x4200
nop