LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6be2
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %rbx
movq %rax, %rdi
callq 0x5b52
leaq 0x8(%r12), %rsi
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x6c76
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 0x6852
movq (%rdi), %rax
callq *0x38(%rax)
testq %r13, %r13
je 0x6861
movq (%r13), %rax
movq %r13, %rdi
callq *0x38(%rax)
movq %rsp, %rdi
callq 0x5ea4
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %r14
testq %r13, %r13
je 0x68a0
movq (%r13), %rax
movq %r13, %rdi
callq *0x38(%rax)
jmp 0x68a0
jmp 0x689d
movq %rax, %r14
movq %rbx, %rdi
callq 0x3200
jmp 0x68a0
movq %rax, %r14
movq %rsp, %rdi
callq 0x5ea4
movq %r14, %rdi
callq 0x3370
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6be2
pushq $0x28
popq %rdi
callq 0x3220
movq %rax, %rbx
movq %rax, %rdi
callq 0x5b52
leaq 0x8(%r15), %rsi
movq %rbx, %rdi
addq $0x8, %rdi
callq 0x6c76
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 0x692b
movq (%rdi), %rax
callq *0x38(%rax)
testq %r12, %r12
je 0x693a
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
leaq 0x8(%rsp), %rdi
callq 0x5ea4
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rax, %r14
testq %r12, %r12
je 0x6979
movq (%r12), %rax
movq %r12, %rdi
callq *0x38(%rax)
jmp 0x6979
jmp 0x6976
movq %rax, %r14
movq %rbx, %rdi
callq 0x3200
jmp 0x6979
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x5ea4
movq %r14, %rdi
callq 0x3370
nop
// File: /workspace/github_cpp_makefile_star2_O2/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, 0x20(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq 0x28c0(%rip), %rsi      # 0x927a
movq %rsp, %rdi
callq 0x33b0
movq 0x8(%r14), %r15
movq 0x10(%r14), %rbx
xorl %ebp, %ebp
leaq 0x28(%rsp), %r12
movq %rsp, %r13
cmpq %rbx, %r15
je 0x6a28
movq (%r15), %rax
movq %r12, %rdi
movq %r15, %rsi
callq *0x20(%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0x33c0
movq %r12, %rdi
callq 0x3130
movq 0x10(%r14), %rax
subq 0x8(%r14), %rax
cqto
pushq $0x28
popq %rcx
idivq %rcx
decq %rax
cmpq %rax, %rbp
jae 0x6a1f
movq %r13, %rdi
leaq 0x2863(%rip), %rsi      # 0x927d
callq 0x33b0
incq %rbp
addq $0x28, %r15
jmp 0x69d4
leaq 0x284d(%rip), %rsi      # 0x927c
movq %rsp, %rdi
callq 0x33b0
movq 0x20(%r14), %rsi
movq (%rsi), %rax
leaq 0x28(%rsp), %rdi
callq *0x20(%rax)
movq %rsp, %rdi
leaq 0x28(%rsp), %rsi
callq 0x33c0
movq 0x20(%rsp), %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
leaq 0x10(%rbx), %rax
movq %rax, (%rbx)
movq (%rsp), %rcx
leaq 0x10(%rsp), %rdx
cmpq %rdx, %rcx
je 0x6a85
movq %rcx, (%rbx)
movq 0x10(%rsp), %rax
movq %rax, 0x10(%rbx)
jmp 0x6a8b
movups (%rdx), %xmm0
movups %xmm0, (%rax)
movq %rsp, %rdi
movq 0x8(%rdi), %rax
movq %rax, 0x8(%rbx)
movq %rdx, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
callq 0x3130
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x6ac8
jmp 0x6ac3
jmp 0x6ac3
jmp 0x6ac3
jmp 0x6ac3
movq %rax, %rbx
jmp 0x6ad5
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3130
movq %rsp, %rdi
callq 0x3130
movq %rbx, %rdi
callq 0x3370
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x6b3e
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 0x6b3e
cmpq %r12, %r15
je 0x6b4e
movq (%r14), %rax
movq %r14, %rdi
movq %r15, %rsi
callq *0x28(%rax)
testb %al, %al
je 0x6b3e
addq $0x28, %r14
addq $0x28, %r15
jmp 0x6b1f
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 0x6b40
movq (%r14), %rdi
movq (%rdi), %rax
movq %rdi, %rsi
callq *0x28(%rax)
addq $0x8, %r14
testb %al, %al
jne 0x6b5a
jmp 0x6b40
// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %rdi, %rbx
movq %rsp, %r14
movq %r14, %rdi
movq %rdx, %rsi
callq 0x6d3e
movq 0x8(%r15), %r12
movq 0x10(%r15), %r13
leaq 0x8(%rsp), %r15
cmpq %r13, %r12
je 0x6c3a
addq $0x8, %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x6fac
cmpq %r15, %rax
je 0x6c34
movq %r14, %rdi
movq %rax, %rsi
callq 0x7022
addq $0x20, %r12
jmp 0x6c10
movq %rbx, %rdi
addq $0x8, %rdi
movq %r15, %rsi
callq 0x7070
movq %rsp, %rdi
callq 0x5ea4
movq %rbx, %rax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x5ea4
movq %rbx, %rdi
callq 0x3370
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x48cc(%rip), %rsi      # 0x9000
pushq $-0x1
popq %rbx
movq %rbx, %rdi
callq 0x42d0
movq 0x9872(%rip), %rcx      # 0xdfb8
movq %rax, (%rcx)
leaq 0x48b5(%rip), %rsi      # 0x9005
movq %rbx, %rdi
callq 0x42d0
movq 0x97c9(%rip), %rcx      # 0xdf28
movq %rax, (%rcx)
leaq 0x48a3(%rip), %rdi      # 0x900c
movl $0x106, %esi            # imm = 0x106
callq 0x44a0
movq %rax, %rbx
leaq 0x489f(%rip), %rsi      # 0x901c
movq %rax, %rdi
callq 0x42d0
movq 0x977c(%rip), %rcx      # 0xdf08
movq %rax, (%rcx)
leaq 0x4895(%rip), %rsi      # 0x902b
movq %rbx, %rdi
callq 0x42d0
movq 0x9833(%rip), %rcx      # 0xdfd8
movq %rax, (%rcx)
leaq 0x4889(%rip), %rsi      # 0x9038
movq %rbx, %rdi
callq 0x42d0
movq 0x977a(%rip), %rcx      # 0xdf38
movq %rax, (%rcx)
popq %rbx
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4240
movq %rax, %rbx
leaq 0x97ab(%rip), %rdi      # 0xdf80
callq 0x45c0
movslq (%rax), %rax
imulq $0x1028, %rax, %rax     # imm = 0x1028
addq %rbx, %rax
addq $0x68, %rax
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4500
movl %eax, %ebx
leaq 0x47fc(%rip), %rdi      # 0x9070
movq %rsp, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x4360
leaq 0x96f7(%rip), %rdi      # 0xdf80
callq 0x45c0
movl (%rax), %ebp
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq 0x100(%rsp), %r14
xorl %r15d, %r15d
cmpq %r15, %rbx
je 0x491f
movq 0x200(%rsp,%r15,8), %r12
decq %r12
callq 0x4200
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
leaq 0x47b6(%rip), %rdx      # 0x907f
movl %ebp, %ecx
movl %r15d, %r8d
movq %r12, %r9
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %r13
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r13, %rsi
movq %rax, %rdx
callq 0x4100
movq %r14, %rdi
leaq 0x47ac(%rip), %rsi      # 0x90b1
movq %rsp, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x4070
movq %r14, %rdi
callq 0x4260
incq %r15
jmp 0x48a5
addq $0xa08, %rsp            # imm = 0xA08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x961a(%rip), %rbx      # 0xdf58
cmpl $0x0, (%rbx)
je 0x4945
popq %rbx
retq
movl $0x1, (%rbx)
callq 0x4170
callq 0x41b0
xorl %edi, %edi
callq 0x42b0
movl %eax, %edi
callq 0x4310
callq 0x4110
movq %rax, %rdi
callq 0x45a0
movl $0x2, (%rbx)
callq 0x42c0
callq 0x4240
movq %rax, %rdi
callq 0x4440
callq 0x40d0
movq %rax, %rdi
popq %rbx
jmp 0x40a0
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %rax
testq %rdi, %rdi
je 0x49d5
movq 0x95b2(%rip), %rax      # 0xdf58
cmpl $0x2, (%rax)
jne 0x49d5
movq %rdi, %rbx
callq 0x4110
cmpq %rbx, (%rax)
ja 0x49dd
cmpq %rbx, 0x8(%rax)
jb 0x49dd
callq 0x4110
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4350
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x40d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4470
testb %al, %al
je 0x4a08
callq 0x40d0
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4520
callq 0x4200
movq %rax, %r14
callq 0x4280
movq %rbx, (%rsp)
leaq 0x49c0(%rip), %rdx      # 0x93e0
leaq 0x46ea(%rip), %r8       # 0x9111
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x116, %r9d            # imm = 0x116
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x4100
// File: /workspace/github_cpp_makefile_star2_O2/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 0x94e4(%rip), %rax      # 0xdf58
cmpl $0x2, (%rax)
je 0x4a7e
callq 0x4320
cmpq $0x80001, %rbx          # imm = 0x80001
jb 0x4aa2
movq 0x946a(%rip), %rax      # 0xdef8
incq (%rax)
callq 0x40d0
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x4540
callq 0x4110
movq %rax, %rdi
movq %rbx, %rsi
popq %rbx
jmp 0x44c0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4380
testq %rax, %rax
je 0x4ad6
movq %rax, %rdi
xorl %esi, %esi
movq %rbx, %rdx
popq %rbx
jmp 0x4180
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
movq %rsi, %r14
movq %rdi, %rbx
movq 0x946e(%rip), %rax      # 0xdf58
cmpl $0x2, (%rax)
je 0x4af4
callq 0x4320
testq %rbx, %rbx
je 0x4b20
testq %r14, %r14
je 0x4b2d
callq 0x4110
cmpq %rbx, (%rax)
ja 0x4b3c
cmpq %rbx, 0x8(%rax)
jb 0x4b3c
callq 0x4110
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4140
jmp 0x4b60
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x4290
movq %rbx, %rdi
callq 0x41c0
xorl %ebx, %ebx
jmp 0x4bec
callq 0x40d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4470
testb %al, %al
je 0x4b94
callq 0x40d0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x4450
movq %rax, %r15
cmpq $-0x1, %rax
je 0x4b94
cmpq %r14, %r15
jae 0x4bec
movq %r14, %rdi
callq 0x4290
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x4250
movq %rbx, %rdi
callq 0x41c0
movq %r14, %rbx
jmp 0x4bec
callq 0x4200
movq %rax, %r14
callq 0x4280
leaq 0x4877(%rip), %rdx      # 0x941f
leaq 0x4562(%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 0x4560
callq 0x4200
movq %rax, %r14
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4100
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4d15
movq %rsi, %r14
movq %rdi, %rbx
cmpq $0x80001, %rsi          # imm = 0x80001
jb 0x4d1d
movq 0x9204(%rip), %rax      # 0xdef8
incq (%rax)
callq 0x40d0
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x44b0
xorl %r14d, %r14d
jmp 0x4da2
addq %rbx, %r14
callq 0x4110
movq %rax, %rdi
movq %r14, %rsi
callq 0x44c0
movq %rax, %r15
xorl %edx, %edx
divq %rbx
subq %rdx, %rbx
leaq (%rbx,%r15), %r14
callq 0x4200
movq %rax, %r12
callq 0x4280
subq $0x8, %rsp
leaq 0x475f(%rip), %rdx      # 0x94b6
leaq 0x43b3(%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 0x4560
addq $0x20, %rsp
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
andl $0x0, 0x38(%rdi)
andl $0x0, 0x4(%rdi)
xorl %r14d, %r14d
xorl %esi, %esi
callq 0x42e0
leaq 0x40(%rbx), %rdi
movl $0x81400, %edx          # imm = 0x81400
xorl %esi, %esi
callq 0x4180
leaq 0x50(%rbx), %rax
cmpq $0x80, %r14
je 0x5b4a
movb $0x1, -0x10(%rax)
movl %r14d, (%rax)
incq %r14
addq $0x1028, %rax           # imm = 0x1028
jmp 0x5b2f
movq %rbx, %rdi
callq 0x4480
addq $0x8, %rbx
movq 0x838b(%rip), %rsi      # 0xdee8
movq 0x8414(%rip), %rdx      # 0xdf78
movl $0x500, %ecx            # imm = 0x500
movq %rbx, %rdi
callq 0x4300
callq 0x4280
movq %rsp, %rsi
movq %rax, (%rsi)
pushq $0x8
popq %rdx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x43a0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x8331(%rip), %rdi      # 0xdf80
callq 0x45c0
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
pushq $0x4
popq %rdx
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 0x4200
movq %rax, %r15
callq 0x4280
movl 0x10(%r14), %r10d
leaq 0x4086(%rip), %rdx      # 0x9d3b
leaq 0x38be(%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 0x4560
addq $0x20, %rsp
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
movq %r14, %rdi
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
jmp 0x4570
nop
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x8
popq %rdx
leaq 0x8(%rsp), %rcx
movq %r14, %rdi
movq %rax, %rsi
callq 0x41e0
testb %al, %al
je 0x5f18
addq $0xc, %rbx
movq %rbx, %rdi
callq 0x4270
leaq 0x10(%rsp), %rsi
pushq $0x8
popq %rdx
movq %r14, %rdi
callq 0x4050
movq %rbx, %rdi
callq 0x4090
movq 0x8(%rsp), %rax
movq (%rax), %rdi
movq 0x18(%rax), %rsi
callq 0x41a0
movq 0x8(%rsp), %rdi
movq 0x80aa(%rip), %rax      # 0xdfb8
callq *(%rax)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
callq 0x4200
movq 0x10(%rsp), %rcx
leaq 0x4707(%rip), %rdx      # 0xa630
movl $0x1000, %esi           # imm = 0x1000
movq %rax, %rdi
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
callq 0x4630
pushq $-0x1
popq %rdi
callq 0x43e0
// File: /workspace/github_cpp_makefile_star2_O2/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 %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
xorl %r12d, %r12d
leaq 0x8(%rsp), %r14
leaq 0x10(%rsp), %r15
movq %r14, %rdx
movq %r15, %rcx
xorl %r8d, %r8d
callq 0x4610
movq (%r15), %rax
subq %rbx, %rax
cmoveq %r12, %rax
movq (%r14), %rcx
addq 0x20(%rcx), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x60ee
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 0x7f3a(%rip), %rax      # 0xdf28
pushq $0x28
popq %rdi
movq %rdx, 0x8(%rsp)
callq *(%rax)
movq %rax, %r12
pushq $-0x1
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x4400
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 0x4270
addq $0x10, %rbp
leaq 0x10(%rsp), %rsi
movq %rbx, (%rsi)
pushq $0x8
popq %rdx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x41f0
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 0x4200
movq %rax, %r14
callq 0x4280
subq $0x8, %rsp
leaq 0x46e9(%rip), %rdx      # 0xa773
leaq 0x469d(%rip), %r8       # 0xa72e
pushq $0x6b
popq %r9
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0x0, %eax
pushq 0x20(%r12)
pushq %r15
pushq %r13
pushq %rbp
pushq %rbx
callq 0x4560
addq $0x30, %rsp
callq 0x4200
movq %rax, %r14
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4100
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x4625(%rip), %rdi      # 0xa71a
leaq 0x4632(%rip), %rsi      # 0xa72e
leaq 0x4638(%rip), %rcx      # 0xa73b
pushq $0x55
popq %rdx
callq 0x4220
// File: /workspace/github_cpp_makefile_star2_O2/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 0x4270
movq %rbx, %rdi
callq 0x41d0
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 0x7d97(%rip), %rax      # 0xdf08
movq 0x7e38(%rip), %rdx      # 0xdfb0
movq %r14, %rdi
movq 0x8(%rsp), %rsi
movq %r15, %rcx
callq *(%rax)
testl %eax, %eax
jne 0x61ca
movq (%r14), %rax
movq %rax, 0x8(%r15)
movq %rbx, %rdi
callq 0x4270
leaq 0x8(%rbx), %rdi
movq (%r14), %rax
leaq 0x10(%rsp), %rsi
movq %rax, (%rsi)
pushq $0x8
popq %rdx
movl %ebp, %ecx
callq 0x40f0
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 0x4200
movq %rax, %rbx
callq 0x4280
leaq 0x46c1(%rip), %rdx      # 0xa89f
leaq 0x3a12(%rip), %r8       # 0x9bf7
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %rdi
movq %rax, %rcx
movl $0xcb, %r9d
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
pushq $-0x1
popq %rdi
callq 0x43e0
// File: /workspace/github_cpp_makefile_star2_O2/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 0x7d99(%rip), %rax      # 0xdfd8
movq %rsi, %rdi
movq %rdx, %rsi
callq *(%rax)
movl %eax, %ebp
testl %eax, %eax
jne 0x62f5
leaq 0xc(%rsp), %r15
orl $-0x1, (%r15)
movq %rbx, %rdi
callq 0x4270
leaq 0x8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movq %r14, (%rsi)
pushq $0x8
popq %rdx
movq %r15, %rcx
callq 0x4430
testb %al, %al
je 0x6290
movslq 0xc(%rsp), %rax
imulq $0x1028, %rax, %rax     # imm = 0x1028
movb $0x1, 0x40(%rbx,%rax)
jmp 0x62ea
callq 0x4200
movq %rax, %r15
callq 0x4280
movq %r14, (%rsp)
leaq 0x46d5(%rip), %rdx      # 0xa97d
leaq 0x3948(%rip), %r8       # 0x9bf7
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rax, %rcx
movl $0xf2, %r9d
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %r14
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4100
decl 0x38(%rbx)
movq %rbx, %rdi
callq 0x4090
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/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 0x659b
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 0x64c5
movq 0x8(%rbx), %rcx
movq %rcx, 0x20(%rbx)
decq %rax
movq %rax, 0x38(%rbx)
cmpq %rcx, 0x18(%rbx)
jne 0x6528
callq 0x4200
movq %rax, %r14
callq 0x4280
leaq 0x30a3(%rip), %rdx      # 0x9589
leaq 0x308d(%rip), %r8       # 0x957a
movl $0x1000, %esi           # imm = 0x1000
movq %r14, %rdi
movq %rax, %rcx
movl $0xde, %r9d
xorl %eax, %eax
callq 0x4560
callq 0x4200
movq %rax, %r14
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4100
callq 0x4200
movq %rax, %r14
callq 0x4280
leaq 0x3085(%rip), %rdx      # 0x95c1
leaq 0x3037(%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 0x4560
addq $0x30, %rsp
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
movq (%r15), %rax
popq %rbx
popq %r14
popq %r15
retq
xorl %eax, %eax
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::allocShadowMem(unsigned long)
void allocShadowMem(size_t numObjectsInHeap) {
			// Use one byte for each heap object
      size_t totalShadowMemSize = numObjectsInHeap;
      _shadowMemBegin = (char *)MM::mmapAllocatePrivate(totalShadowMemSize);
      _shadowMemEnd = _shadowMemBegin + totalShadowMemSize;
			madvise(_shadowMemBegin, totalShadowMemSize, MADV_NOHUGEPAGE);
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
pushq $-0x1
popq %rdx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x4400
movq %rax, 0x10(%r14)
leaq (%rax,%rbx), %rcx
movq %rcx, 0x18(%r14)
pushq $0xf
popq %rdx
movq %rax, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x43d0
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./bibopheap.hh
// Function: BibopHeap::allocFreeArea(unsigned long)
void allocFreeArea(size_t numObjectsInHeap) {
			// Use eight bytes for each heap object
      size_t totalFreeAreaSize = numObjectsInHeap * sizeof(void *);
      _freeAreaBegin = (char *)MM::mmapAllocatePrivate(totalFreeAreaSize);
      _freeAreaEnd = _freeAreaBegin + totalFreeAreaSize;
			madvise(_freeAreaBegin, totalFreeAreaSize, MADV_NOHUGEPAGE);
	}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq (,%rsi,8), %r15
pushq $-0x1
popq %rdx
movq %r15, %rdi
xorl %esi, %esi
callq 0x4400
movq %rax, 0x20(%r14)
leaq (%rax,%rbx,8), %rcx
movq %rcx, 0x28(%r14)
pushq $0xf
popq %rdx
movq %rax, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x43d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x7948(%rip), %r15      # 0xdfa8
movq (%r15), %rdi
movq %rdi, %rax
shrq $0x10, %rax
andq $-0x8, %rax
subq %rax, %rdi
andq $-0x8, %rdi
xorl %r12d, %r12d
pushq $-0x1
popq %rdx
xorl %esi, %esi
callq 0x4400
movq %rax, %r14
movq (%r15), %r15
shrq $0x4, %r15
addq $0xa1b80, %rbx          # imm = 0xA1B80
cmpq $0x800, %r12            # imm = 0x800
je 0x66b8
leaq (%rbx,%r12), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x43b0
leaq (%r14,%r15,8), %r14
shrq %r15
subq $-0x80, %r12
jmp 0x6693
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/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
pushq $0x3
popq %rdx
movq %rbx, %rdi
movl %r15d, %ecx
xorl %r9d, %r9d
callq 0x4600
cmpq $-0x1, %rax
je 0x6d04
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
callq 0x4200
movq %rax, %r12
callq 0x4280
movq %rax, %r13
callq 0x4030
movl (%rax), %edi
callq 0x40e0
movq %rax, %r10
subq $0x8, %rsp
leaq 0x2b9a(%rip), %rdx      # 0x98c8
leaq 0x2c07(%rip), %r8       # 0x993c
pushq $0x3c
popq %r9
movl $0x1000, %esi           # imm = 0x1000
movq %r12, %rdi
movq %r13, %rcx
xorl %eax, %eax
pushq %r15
pushq $0x3
pushq %r14
pushq %rbx
pushq %r10
callq 0x4560
addq $0x30, %rsp
callq 0x4200
movq %rax, %rbx
callq 0x4200
movq %rax, %rdi
callq 0x4130
pushq $0x2
popq %rdi
movq %rbx, %rsi
movq %rax, %rdx
callq 0x4100
pushq $-0x1
popq %rdi
callq 0x43e0
nop
// File: /workspace/github_cpp_makefile_star2_O2/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 0x41d0
testl %eax, %eax
jne 0x6d9e
leaq 0x40(%rbx), %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x4060
leaq 0x2e46(%rip), %rdi      # 0x9beb
leaq 0x2e4b(%rip), %rsi      # 0x9bf7
leaq 0x2e51(%rip), %rcx      # 0x9c04
pushq $0x57
popq %rdx
callq 0x4220
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::initialize(unsigned long (*)(void*, unsigned long), bool (*)(void*, void*, unsigned long), unsigned long)
void initialize(hashFuncPtr hfunc, keycmpFuncPtr kcmp, const size_t size = 4096) {
    _entries = NULL;
    _bucketsUsed = 0;
    _buckets = size;

    if(hfunc == NULL || kcmp == NULL) {
      //PRINF("Hashfunc or kcmp should not be null\n");
      abort();
    }

    // Initialize those functions.
    _hashfunc = hfunc;
    _keycmp = kcmp;

    // Allocated predefined size.
    _entries = (struct HashEntry*)SourceHeap::allocate(size * sizeof(struct HashEntry));
    //    PRINF("hashmap initialization at %p pid %d index %d\n", &_initialized,getpid(),
    // getThreadIndex());
    //    PRINF("hashmap initialization _entries %p\n", _entries);

    // Initialize all of these _entries.
    struct HashEntry* entry;
    for(size_t i = 0; i < size; i++) {
      entry = getHashEntry(i);
      entry->initialize();
    }
    _initialized = true;
  }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
andq $0x0, 0x8(%rdi)
andq $0x0, 0x18(%rdi)
movq %rcx, 0x10(%rdi)
testq %rsi, %rsi
je 0x6e34
testq %rdx, %rdx
je 0x6e34
movq %rdi, %rbx
movq %rcx, %r14
movq %rsi, 0x28(%rdi)
movq %rdx, 0x20(%rdi)
imulq $0x18, %rcx, %rdi
movq 0x7137(%rip), %rax      # 0xdf28
callq *(%rax)
movq %rax, 0x8(%rbx)
movq 0x10(%rbx), %rax
xorl %ecx, %ecx
xorl %edx, %edx
xorl %esi, %esi
cmpq %rsi, %r14
je 0x6e29
movq 0x8(%rbx), %rdi
addq %rdx, %rdi
cmpq %rsi, %rax
cmovbeq %rcx, %rdi
andq $0x0, 0x10(%rdi)
movq %rdi, (%rdi)
movq %rdi, 0x8(%rdi)
incq %rsi
addq $0x18, %rdx
jmp 0x6e01
movb $0x1, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x4190
nop
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashfuncs.hh
// Function: HashFuncs::hashAddr(void*, unsigned long)
static size_t hashAddr(void* addr, size_t) {
    unsigned long key = (unsigned long)addr;
    key ^= (key << 15) ^ 0xcd7dcd7d;
    key ^= (key >> 10);
    key ^= (key << 3);
    key ^= (key >> 6);
    key ^= (key << 2) + (key << 14);
    key ^= (key >> 16);
    return key;
  }

// Assembly:
movq %rdi, %rax
shlq $0xf, %rax
xorq %rdi, %rax
movl $0xcd7dcd7d, %ecx       # imm = 0xCD7DCD7D
xorq %rax, %rcx
movq %rcx, %rax
shrq $0xa, %rax
xorq %rcx, %rax
leaq (,%rax,8), %rcx
xorq %rax, %rcx
movq %rcx, %rax
shrq $0x6, %rax
xorq %rcx, %rax
imulq $0x4004, %rax, %rcx     # imm = 0x4004
xorq %rax, %rcx
movq %rcx, %rax
shrq $0x10, %rax
xorq %rcx, %rax
retq
// File: /workspace/github_cpp_makefile_star2_O2/UTSASRG[P]Guarder/./hashmap.hh
// Function: HashMap<void*, int, HeapAllocator>::insert(void* const&, unsigned long, int)
void insert(const KeyType& key, size_t keylen, ValueType value) {
    if(_initialized != true) {
      //PRINT("process %d index %d: initialized at  %p hashmap is not true\n", getpid(),
      //      getThreadIndex(), &_initialized);
    }

    assert(_initialized == true);
    size_t hindex = hashIndex(key, keylen);
    // PRINF("Insert entry:  before inserting\n");
    struct HashEntry* first = getHashEntry(hindex);

    // PRINF("Insert entry: key %p\n", key);
    insertEntry(first, key, keylen, value);
  }

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
cmpb $0x0, (%rdi)
je 0x6ed7
movl %ecx, %ebx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq (%rsi), %rdi
movq %rdx, %rsi
callq *0x28(%r12)
xorl %edx, %edx
divq 0x10(%r12)
imulq $0x18, %rdx, %rsi
addq 0x8(%r12), %rsi
movq %r12, %rdi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x42f0
leaq 0x2da6(%rip), %rdi      # 0x9c84
leaq 0x2db4(%rip), %rsi      # 0x9c99
leaq 0x2dba(%rip), %rcx      # 0x9ca6
movl $0x9f, %edx
callq 0x4220