LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: Ellipse::judge(std::pair<float, float> const&, bool*) const
bool Ellipse::judge(const Fpair& pt, bool *val) const {
	bool gov = false;
	if(tlim.first <= TimeNow && TimeNow < tlim.second)
		if(lower <= pt && pt <= upper) {
			float dx = pt.first - pc0.first, dy = pt.second - pc0.second;
			gov = (pow(dx*v.first + dy*v.second, 2)/asq + pow(-dx*v.second + dy*v.first, 2)/bsq < 1);
		}
	if(val!=nullptr) *val = !(gov^solid);
	return gov;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movb $0x0, -0x19(%rbp)
movss 0x40(%rax), %xmm1
movss 0x25c4f(%rip), %xmm0    # 0x2e28c
ucomiss %xmm1, %xmm0
jb 0x876f
movq -0x30(%rbp), %rax
movss 0x25c3a(%rip), %xmm1    # 0x2e28c
movss 0x44(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x876f
movq -0x30(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
callq 0xa5d0
testb $0x1, %al
jne 0x867a
jmp 0x876d
movq -0x30(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x38, %rsi
callq 0xa5d0
testb $0x1, %al
jne 0x8694
jmp 0x876d
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movss (%rcx), %xmm0
subss 0x78(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movss 0x4(%rcx), %xmm0
subss 0x7c(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x20(%rbp), %xmm0
movss 0x80(%rax), %xmm2
movss -0x24(%rbp), %xmm1
mulss 0x84(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movl $0x2, %edi
callq 0xb730
movq -0x30(%rbp), %rax
movss 0x88(%rax), %xmm1
cvtss2sd %xmm1, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movss -0x20(%rbp), %xmm0
movd %xmm0, %ecx
xorl $0x80000000, %ecx       # imm = 0x80000000
movd %ecx, %xmm0
movss 0x84(%rax), %xmm2
movss -0x24(%rbp), %xmm1
mulss 0x80(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movl $0x2, %edi
callq 0xb730
movq -0x30(%rbp), %rax
movsd -0x38(%rbp), %xmm1
movss 0x8c(%rax), %xmm2
cvtss2sd %xmm2, %xmm2
divsd %xmm2, %xmm0
addsd %xmm0, %xmm1
movsd 0x19917(%rip), %xmm0    # 0x22078
ucomisd %xmm1, %xmm0
seta %al
andb $0x1, %al
movb %al, -0x19(%rbp)
jmp 0x876f
cmpq $0x0, -0x18(%rbp)
je 0x87a2
movq -0x30(%rbp), %rcx
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x94(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
setne %cl
xorb $-0x1, %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: Ellipse::rotate(float, std::pair<float, float> const&)
Ellipse* Ellipse::rotate(float dangle, const Fpair& pr) {
	rot_pt_pt({&pc0, &pc}, pr, dangle);
	angle += dangle;
	v = {cos(angle), sin(angle)};
	this->set_lim();
	return this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq %rax, %rcx
addq $0x78, %rcx
movq %rcx, -0x38(%rbp)
addq $0x28, %rax
movq %rax, -0x30(%rbp)
leaq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x2, -0x20(%rbp)
movq -0x18(%rbp), %rdx
movss -0xc(%rbp), %xmm0
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0xb260
movq -0x50(%rbp), %rax
movss -0xc(%rbp), %xmm0
addss 0x90(%rax), %xmm0
movss %xmm0, 0x90(%rax)
movss 0x90(%rax), %xmm0
callq 0xae80
movq -0x50(%rbp), %rax
movss %xmm0, -0x44(%rbp)
movss 0x90(%rax), %xmm0
callq 0xaea0
movss %xmm0, -0x48(%rbp)
leaq -0x40(%rbp), %rdi
leaq -0x44(%rbp), %rsi
leaq -0x48(%rbp), %rdx
callq 0xaec0
movq -0x50(%rbp), %rdi
addq $0x80, %rdi
leaq -0x40(%rbp), %rsi
callq 0xa750
movq -0x50(%rbp), %rdi
callq 0x8120
movq -0x50(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: Ellipse::scale(float, std::pair<float, float> const&)
Ellipse* Ellipse::scale(float rate, const Fpair& ps) {
	float rate2 = rate*rate;
	asq *= rate2; bsq *= rate2;
	scl_pt_pt({&pc0, &pc, &lower, &upper}, ps, rate);
	if(rate < 0) swap(lower, upper);
	return this;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movss %xmm0, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movss -0xc(%rbp), %xmm0
mulss -0xc(%rbp), %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
mulss 0x88(%rax), %xmm0
movss %xmm0, 0x88(%rax)
movss -0x1c(%rbp), %xmm0
mulss 0x8c(%rax), %xmm0
movss %xmm0, 0x8c(%rax)
movq %rax, %rcx
addq $0x78, %rcx
movq %rcx, -0x50(%rbp)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, -0x48(%rbp)
movq %rax, %rcx
addq $0x30, %rcx
movq %rcx, -0x40(%rbp)
addq $0x38, %rax
movq %rax, -0x38(%rbp)
leaq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x4, -0x28(%rbp)
movq -0x18(%rbp), %rdx
movss -0xc(%rbp), %xmm0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0xb3c0
xorps %xmm0, %xmm0
ucomiss -0xc(%rbp), %xmm0
jbe 0x8a42
movq -0x58(%rbp), %rsi
movq %rsi, %rdi
addq $0x30, %rdi
addq $0x38, %rsi
callq 0xb480
movq -0x58(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: EllArc::judge(std::pair<float, float> const&, bool*) const
bool EllArc::judge(const Fpair& pt, bool *val) const {
	bool gov = false;
	if(tlim.first <= TimeNow && TimeNow < tlim.second)
		if(lower <= pt && pt <= upper) {
			float dx = pt.first - pc0.first, dy = pt.second - pc0.second, x = dx*v.first + dy*v.second, y = -dx*v.second + dy*v.first, dist2 = x*x/asq + y*y/bsq, ang;
			if(dist2 < 1 && dist2 >= 1-width) {
				ang = atan2(y, x);
				if(ang >= anglim1 && ang <= anglim2) gov = true;
			}
		}
	if(val!=nullptr) *val = !(gov^solid);
	return gov;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movb $0x0, -0x19(%rbp)
movss 0x40(%rax), %xmm1
movss 0x2504f(%rip), %xmm0    # 0x2e28c
ucomiss %xmm1, %xmm0
jb 0x93b8
movq -0x40(%rbp), %rax
movss 0x2503a(%rip), %xmm1    # 0x2e28c
movss 0x44(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x93b8
movq -0x40(%rbp), %rdi
addq $0x30, %rdi
movq -0x10(%rbp), %rsi
callq 0xa5d0
testb $0x1, %al
jne 0x927a
jmp 0x93b6
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rdi
addq $0x38, %rsi
callq 0xa5d0
testb $0x1, %al
jne 0x9294
jmp 0x93b6
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
movss (%rcx), %xmm0
subss 0x78(%rax), %xmm0
movss %xmm0, -0x20(%rbp)
movq -0x10(%rbp), %rcx
movss 0x4(%rcx), %xmm0
subss 0x7c(%rax), %xmm0
movss %xmm0, -0x24(%rbp)
movss -0x20(%rbp), %xmm0
movss 0x80(%rax), %xmm2
movss -0x24(%rbp), %xmm1
mulss 0x84(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x20(%rbp), %xmm0
movd %xmm0, %ecx
xorl $0x80000000, %ecx       # imm = 0x80000000
movd %ecx, %xmm0
movss 0x84(%rax), %xmm2
movss -0x24(%rbp), %xmm1
mulss 0x80(%rax), %xmm1
mulss %xmm2, %xmm0
addss %xmm1, %xmm0
movss %xmm0, -0x2c(%rbp)
movss -0x28(%rbp), %xmm0
mulss -0x28(%rbp), %xmm0
divss 0x88(%rax), %xmm0
movss -0x2c(%rbp), %xmm1
mulss -0x2c(%rbp), %xmm1
divss 0x8c(%rax), %xmm1
addss %xmm1, %xmm0
movss %xmm0, -0x30(%rbp)
movss 0x18cf2(%rip), %xmm0    # 0x22040
ucomiss -0x30(%rbp), %xmm0
jbe 0x93b4
movq -0x40(%rbp), %rax
movss -0x30(%rbp), %xmm0
movss 0x18cdb(%rip), %xmm1    # 0x22040
subss 0x98(%rax), %xmm1
ucomiss %xmm1, %xmm0
jb 0x93b4
movss -0x2c(%rbp), %xmm0
movss -0x28(%rbp), %xmm1
callq 0xb8e0
movq -0x40(%rbp), %rax
movss %xmm0, -0x34(%rbp)
movss -0x34(%rbp), %xmm0
ucomiss 0x9c(%rax), %xmm0
jb 0x93b2
movq -0x40(%rbp), %rax
movss -0x34(%rbp), %xmm1
movss 0xa0(%rax), %xmm0
ucomiss %xmm1, %xmm0
jb 0x93b2
movb $0x1, -0x19(%rbp)
jmp 0x93b4
jmp 0x93b6
jmp 0x93b8
cmpq $0x0, -0x18(%rbp)
je 0x93eb
movq -0x40(%rbp), %rcx
movb -0x19(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movb 0x94(%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
xorl %ecx, %eax
cmpl $0x0, %eax
setne %cl
xorb $-0x1, %cl
movq -0x18(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
movb -0x19(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: Displace::act(Obj*)
void Displace::act(Obj* p) {
	if(tlim.first < TimeNow && TimeNow < tlim.second) {
		switch(motor_type) {
			case Type::incre:
				p->displace(motor(TimeNow - tlim.first));
				break;
			case Type::relpos:
				state2 = motor(TimeNow - tlim.first);
				p->displace(state2 - state1);
				state1 = state2;
				break;
			case Type::abspos:
				p->place(motor(TimeNow - tlim.first));
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movss 0x8(%rax), %xmm1
movss 0x24d17(%rip), %xmm0    # 0x2e28c
ucomiss %xmm1, %xmm0
jbe 0x96bf
movq -0x38(%rbp), %rax
movss 0x24d02(%rip), %xmm1    # 0x2e28c
movss 0xc(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x96bf
movq -0x38(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x3c(%rbp)
testl %eax, %eax
je 0x95c3
jmp 0x95a8
movl -0x3c(%rbp), %eax
subl $0x1, %eax
je 0x9604
jmp 0x95b2
movl -0x3c(%rbp), %eax
subl $0x2, %eax
je 0x9681
jmp 0x96bd
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movq %rax, %rdi
addq $0x10, %rdi
movss 0x24cae(%rip), %xmm0    # 0x2e28c
movss 0x8(%rax), %xmm1
subss %xmm1, %xmm0
callq 0xba10
movq -0x48(%rbp), %rdi
movlpd %xmm0, -0x18(%rbp)
movq (%rdi), %rax
leaq -0x18(%rbp), %rsi
callq *0x30(%rax)
jmp 0x96bd
movq -0x38(%rbp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movss 0x24c75(%rip), %xmm0    # 0x2e28c
movss 0x8(%rax), %xmm1
subss %xmm1, %xmm0
callq 0xba10
movq -0x38(%rbp), %rdi
movlpd %xmm0, -0x20(%rbp)
addq $0x3c, %rdi
movq %rdi, -0x58(%rbp)
leaq -0x20(%rbp), %rsi
callq 0xa750
movq -0x58(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
addq $0x34, %rsi
callq 0xa8b0
movq -0x50(%rbp), %rdi
movlpd %xmm0, -0x28(%rbp)
movq (%rdi), %rax
leaq -0x28(%rbp), %rsi
callq *0x30(%rax)
movq -0x38(%rbp), %rdi
movq %rdi, %rsi
addq $0x3c, %rsi
addq $0x34, %rdi
callq 0xa840
jmp 0x96bd
movq -0x38(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x60(%rbp)
movq %rax, %rdi
addq $0x10, %rdi
movss 0x24bf0(%rip), %xmm0    # 0x2e28c
movss 0x8(%rax), %xmm1
subss %xmm1, %xmm0
callq 0xba10
movq -0x60(%rbp), %rdi
movlpd %xmm0, -0x30(%rbp)
movq (%rdi), %rax
leaq -0x30(%rbp), %rsi
callq *0x38(%rax)
jmp 0x96bf
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: Rotate::act(Obj*)
void Rotate::act(Obj* p) {
	if(tlim.first < TimeNow && TimeNow < tlim.second) {
		if(motor_type == Type::incre) p->rotate(motor(TimeNow - tlim.first));
		else if(motor_type == Type::relpos) {
			state2 = motor(TimeNow - tlim.first);
			p->rotate(state2 - state1);
			state1 = state2;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movss 0x8(%rax), %xmm1
movss 0x24a17(%rip), %xmm0    # 0x2e28c
ucomiss %xmm1, %xmm0
jbe 0x9929
movq -0x18(%rbp), %rax
movss 0x24a02(%rip), %xmm1    # 0x2e28c
movss 0xc(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x9929
movq -0x18(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x98d3
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rdi
addq $0x10, %rdi
movss 0x249cf(%rip), %xmm0    # 0x2e28c
subss 0x8(%rax), %xmm0
callq 0xbbc0
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x48(%rax)
jmp 0x9927
movq -0x18(%rbp), %rax
cmpl $0x1, 0x30(%rax)
jne 0x9925
movq -0x18(%rbp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movss 0x2499c(%rip), %xmm0    # 0x2e28c
subss 0x8(%rax), %xmm0
callq 0xbbc0
movq -0x18(%rbp), %rax
movss %xmm0, 0x38(%rax)
movq -0x10(%rbp), %rdi
movss 0x38(%rax), %xmm0
subss 0x34(%rax), %xmm0
movq (%rdi), %rax
callq *0x48(%rax)
movq -0x18(%rbp), %rax
movss 0x38(%rax), %xmm0
movss %xmm0, 0x34(%rax)
jmp 0x9927
jmp 0x9929
addq $0x20, %rsp
popq %rbp
retq
nop
// File: changliu00[P]ascii-animation/ascii-anim.cpp
// Function: Scale::act(Obj*)
void Scale::act(Obj* p) {
	if(tlim.first < TimeNow && TimeNow < tlim.second) {
		if(motor_type == Type::incre) p->scale(motor(TimeNow - tlim.first));
		else {
			state2 = motor(TimeNow - tlim.first);
			p->scale(state2 / state1);
			state1 = state2;
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movss 0x8(%rax), %xmm1
movss 0x247f7(%rip), %xmm0    # 0x2e28c
ucomiss %xmm1, %xmm0
jbe 0x9b3d
movq -0x18(%rbp), %rax
movss 0x247e2(%rip), %xmm1    # 0x2e28c
movss 0xc(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0x9b3d
movq -0x18(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jne 0x9af3
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, -0x20(%rbp)
movq %rax, %rdi
addq $0x10, %rdi
movss 0x247af(%rip), %xmm0    # 0x2e28c
subss 0x8(%rax), %xmm0
callq 0xbbc0
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
jmp 0x9b3b
movq -0x18(%rbp), %rax
movq %rax, %rdi
addq $0x10, %rdi
movss 0x24786(%rip), %xmm0    # 0x2e28c
subss 0x8(%rax), %xmm0
callq 0xbbc0
movq -0x18(%rbp), %rax
movss %xmm0, 0x38(%rax)
movq -0x10(%rbp), %rdi
movss 0x38(%rax), %xmm0
divss 0x34(%rax), %xmm0
movq (%rdi), %rax
callq *0x58(%rax)
movq -0x18(%rbp), %rax
movss 0x38(%rax), %xmm0
movss %xmm0, 0x34(%rax)
jmp 0x9b3d
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: changliu00[P]ascii-animation/./ascii-anim.h
// Function: union_pt(std::pair<float, float>&, std::pair<float, float>&, std::pair<float, float> const&, std::pair<float, float> const&)
inline void union_pt(Fpair& lower1, Fpair& upper1, const Fpair& lower2, const Fpair& upper2) {
	if(lower2.first < lower1.first) lower1.first = lower2.first;
	if(lower2.second < lower1.second) lower1.second = lower2.second;
	if(upper1.first < upper2.first) upper1.first = upper2.first;
	if(upper1.second < upper2.second) upper1.second = upper2.second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movss (%rax), %xmm1
movq -0x8(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xa7b9
movq -0x18(%rbp), %rax
movss (%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xa7e2
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x10(%rbp), %rax
movss (%rax), %xmm1
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xa807
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, (%rax)
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xa830
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: changliu00[P]ascii-animation/./ascii-anim.h
// Function: intersect_pt(std::pair<float, float>&, std::pair<float, float>&, std::pair<float, float> const&, std::pair<float, float> const&)
inline void intersect_pt(Fpair& lower1, Fpair& upper1, const Fpair& lower2, const Fpair& upper2) {
	if(lower1.first < lower2.first) lower1.first = lower2.first;
	if(lower1.second < lower2.second) lower1.second = lower2.second;
	if(upper2.first < upper1.first) upper1.first = upper2.first;
	if(upper2.second < upper1.second) upper1.second = upper2.second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movss (%rax), %xmm1
movq -0x18(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xab29
movq -0x18(%rbp), %rax
movss (%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, (%rax)
movq -0x8(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xab52
movq -0x18(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x4(%rax)
movq -0x20(%rbp), %rax
movss (%rax), %xmm1
movq -0x10(%rbp), %rax
movss (%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xab77
movq -0x20(%rbp), %rax
movss (%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, (%rax)
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm1
movq -0x10(%rbp), %rax
movss 0x4(%rax), %xmm0
ucomiss %xmm1, %xmm0
jbe 0xaba0
movq -0x20(%rbp), %rax
movss 0x4(%rax), %xmm0
movq -0x10(%rbp), %rax
movss %xmm0, 0x4(%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: changliu00[P]ascii-animation/./ascii-anim.h
// Function: rot_pt_pt(std::initializer_list<std::pair<float, float>*>, std::pair<float, float> const&, float)
inline void rot_pt_pt(std::initializer_list<Fpair*> il, const Fpair& p0, float dangle) {
	Fpair v = {cos(dangle), -sin(dangle)}, pd;
	for(auto ppt: il) {
		pd = (*ppt) - p0;
		(*ppt) = Fpair{v * pd, cross(v, pd)} + p0;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x8(%rbp)
movq %rdx, -0x18(%rbp)
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x4460
movsd %xmm0, -0x30(%rbp)
movss -0x1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x4060
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm0, -0x38(%rbp)
leaq -0x24(%rbp), %rdi
leaq -0x30(%rbp), %rsi
leaq -0x38(%rbp), %rdx
callq 0xd330
leaq -0x40(%rbp), %rdi
callq 0xb9f0
leaq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rdi
callq 0xda40
movq %rax, -0x50(%rbp)
movq -0x48(%rbp), %rdi
callq 0xda60
movq %rax, -0x58(%rbp)
movq -0x50(%rbp), %rax
cmpq -0x58(%rbp), %rax
je 0xb3b3
movq -0x50(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa8b0
movlpd %xmm0, -0x68(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x90(%rbp)
leaq -0x68(%rbp), %rsi
callq 0xa750
movq -0x90(%rbp), %rsi
leaq -0x24(%rbp), %rdi
movq %rdi, -0x98(%rbp)
callq 0xaf60
movq -0x98(%rbp), %rdi
movq -0x90(%rbp), %rsi
movss %xmm0, -0x7c(%rbp)
callq 0xb030
movss %xmm0, -0x80(%rbp)
leaq -0x78(%rbp), %rdi
movq %rdi, -0x88(%rbp)
leaq -0x7c(%rbp), %rsi
leaq -0x80(%rbp), %rdx
callq 0xaec0
movq -0x88(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xb1b0
movlpd %xmm0, -0x70(%rbp)
movq -0x60(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xa750
movq -0x50(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
jmp 0xb2f5
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: MITRECND[P]snugglefish/src/snugglefish.cpp
// Function: cpu_count()
uint32_t cpu_count(){
    long procs = -1;

    //This only works on some *nixes TODO figure out which systems don't support this call
    procs = sysconf(_SC_NPROCESSORS_ONLN);
    if (procs < 1){
        cerr << "Unable to get CPU count, defaulting to 1 -- Error: " 
             << strerror(errno) << endl;
        return 1;
    }
    return (uint32_t) procs;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq $-0x1, -0x10(%rbp)
movl $0x54, %edi
callq 0xe1e0
movq %rax, -0x10(%rbp)
cmpq $0x1, -0x10(%rbp)
jge 0xe9ac
movq 0x1267c(%rip), %rdi     # 0x20fe8
leaq 0xb70d(%rip), %rsi      # 0x1a080
callq 0xe2f0
movq %rax, -0x18(%rbp)
callq 0xe050
movl (%rax), %edi
callq 0xe0d0
movq -0x18(%rbp), %rdi
movq %rax, %rsi
callq 0xe2f0
movq %rax, %rdi
movq 0x125f2(%rip), %rsi     # 0x20f90
callq 0xe340
movl $0x1, -0x4(%rbp)
jmp 0xe9b3
movq -0x10(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: MITRECND[P]snugglefish/src/snugglefish.cpp
// Function: handler(int)
void handler(int sig) {
  void *array[10];
  int size;

  // get void*'s for all entries on the stack
  size = backtrace(array, 10);

  // print out all the frames to stderr
  fprintf(stderr, "Error: signal %d:\n", sig);
  backtrace_symbols_fd(array, size, 2);
  exit(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
leaq -0x60(%rbp), %rdi
movl $0xa, %esi
callq 0xe4d0
movl %eax, -0x64(%rbp)
movq 0x125d5(%rip), %rax     # 0x20fb8
movq (%rax), %rdi
movl -0x4(%rbp), %edx
leaq 0xb6c4(%rip), %rsi      # 0x1a0b4
movb $0x0, %al
callq 0xe490
leaq -0x60(%rbp), %rdi
movl -0x64(%rbp), %esi
movl $0x2, %edx
callq 0xe510
movl $0x1, %edi
callq 0xe3c0
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/snugglefish.cpp
// Function: search(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int, unsigned int)
vector<string>* search(string indexFileName, string searchString, uint32_t ngramSize, uint32_t threads){
	vector<string>* ret;
	nGramSearch searcher(ngramSize, indexFileName, threads);
    vector<uint64_t>* ngrams = searcher.stringToNGrams(searchString);
	ret = searcher.searchNGrams(*ngrams);

    delete ngrams;
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rsi, %rax
movq %rdi, %rsi
movq %rax, -0xf8(%rbp)
movq %rsi, -0x8(%rbp)
movq %rax, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0xec(%rbp)
leaq -0x90(%rbp), %rdi
movq %rdi, -0xe8(%rbp)
callq 0xe130
movl -0xec(%rbp), %esi
movq -0xe8(%rbp), %rdx
movl -0x18(%rbp), %ecx
leaq -0x70(%rbp), %rdi
callq 0x12930
jmp 0xfd8d
leaq -0x90(%rbp), %rdi
callq 0xe1d0
movq -0xf8(%rbp), %rsi
leaq -0xc8(%rbp), %rdi
callq 0xe130
jmp 0xfdae
leaq -0x70(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x12b70
movq %rax, -0x100(%rbp)
jmp 0xfdc7
leaq -0xc8(%rbp), %rdi
callq 0xe1d0
movq -0x100(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
callq 0x10610
jmp 0xfdf6
leaq -0x70(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x12c70
movq %rax, -0x108(%rbp)
jmp 0xfe0f
movq -0x108(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x10700
movq -0xa8(%rbp), %rax
movq %rax, -0x110(%rbp)
cmpq $0x0, %rax
je 0xfe57
movq -0x110(%rbp), %rdi
callq 0x10700
movq -0x110(%rbp), %rdi
movl $0x18, %esi
callq 0xe310
movq -0x20(%rbp), %rax
movq %rax, -0x118(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x12b20
movq -0x118(%rbp), %rax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xe1d0
jmp 0xfef6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
jmp 0xfeed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0xe1d0
jmp 0xfeed
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x98(%rbp)
movl %eax, -0x9c(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0x10700
leaq -0x70(%rbp), %rdi
callq 0x12b20
movq -0x98(%rbp), %rdi
callq 0xe5d0
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/snugglefish.cpp
// Function: printStats(snugglefish::nGramIndex*, unsigned long, unsigned long)
void printStats(nGramIndex* indexer, uint64_t processed, uint64_t listsize){
    uint64_t total;
    uint64_t session;
    uint64_t indexes;
    bool flushing;
    indexer->getStats(total, session, indexes, flushing);

    uint64_t percent = ((double) processed / listsize) * 100;

    cerr << "\r";
    cerr << "Processed: " << percent << "% -- " << processed << "/" << listsize;

    if(flushing){
        cerr << " (Flushing ... )"; 
    }else{
        cerr << "                "; 
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
leaq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rcx
leaq -0x31(%rbp), %r8
callq 0x158e0
movaps 0xa10c(%rip), %xmm3     # 0x1a050
movq -0x10(%rbp), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0xa10b(%rip), %xmm2     # 0x1a060
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x18(%rbp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd 0xa0e8(%rip), %xmm1     # 0x1a070
mulsd %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0xa0d5(%rip), %xmm1     # 0x1a078
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x40(%rbp)
movq 0x1102b(%rip), %rdi     # 0x20fe8
leaq 0xa67b(%rip), %rsi      # 0x1a63f
callq 0xe2f0
movq 0x11018(%rip), %rdi     # 0x20fe8
leaq 0xa66a(%rip), %rsi      # 0x1a641
callq 0xe2f0
movq %rax, %rdi
movq -0x40(%rbp), %rsi
callq 0xe0b0
movq %rax, %rdi
leaq 0xa65b(%rip), %rsi      # 0x1a64d
callq 0xe2f0
movq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0xe0b0
movq %rax, %rdi
leaq 0xa646(%rip), %rsi      # 0x1a653
callq 0xe2f0
movq %rax, %rdi
movq -0x18(%rbp), %rsi
callq 0xe0b0
testb $0x1, -0x31(%rbp)
je 0x10039
movq 0x10fbd(%rip), %rdi     # 0x20fe8
leaq 0xa623(%rip), %rsi      # 0x1a655
callq 0xe2f0
jmp 0x1004c
movq 0x10fa8(%rip), %rdi     # 0x20fe8
leaq 0xa61f(%rip), %rsi      # 0x1a666
callq 0xe2f0
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/nGramSearch.cpp
// Function: snugglefish::nGramSearch::nGramSearch(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
nGramSearch::nGramSearch( uint32_t ngramLength, string indexFileName)
    :nGramBase(ngramLength, indexFileName),numThreads(1) {

    masterFile = new smFile(baseFileName, ngramLength);

    if (!masterFile->exists()){
        //some error
    }else{
        masterFile->open('r');
    }


    numIndexFiles = masterFile->getNumIndexFiles();
    numFiles = masterFile->getNumFiles();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdx, -0x90(%rbp)
movl %esi, %eax
movq -0x90(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x7c(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0xe130
movq -0x88(%rbp), %rdi
movl -0x7c(%rbp), %esi
movq -0x78(%rbp), %rdx
callq 0x12450
jmp 0x12799
leaq -0x38(%rbp), %rdi
callq 0xe1d0
movq -0x88(%rbp), %rax
movl $0x1, 0x38(%rax)
movl $0x58, %edi
callq 0xe300
movq %rax, -0x98(%rbp)
jmp 0x127c3
movq -0x88(%rbp), %rsi
movb $0x1, -0x69(%rbp)
addq $0x8, %rsi
leaq -0x68(%rbp), %rdi
callq 0xe130
jmp 0x127dd
movq -0x98(%rbp), %rdi
movzbl -0xc(%rbp), %edx
leaq -0x68(%rbp), %rsi
callq 0x19250
jmp 0x127f3
movq -0x88(%rbp), %rax
movq -0x98(%rbp), %rcx
movb $0x0, -0x69(%rbp)
movq %rcx, 0x40(%rax)
leaq -0x68(%rbp), %rdi
callq 0xe1d0
movq -0x88(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x18650
movb %al, -0x99(%rbp)
jmp 0x1282a
movb -0x99(%rbp), %al
testb $0x1, %al
jne 0x128a4
jmp 0x12836
jmp 0x128bd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xe1d0
jmp 0x1291b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x1290f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12889
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xe1d0
testb $0x1, -0x69(%rbp)
jne 0x12891
jmp 0x128a2
movq -0x98(%rbp), %rdi
movl $0x58, %esi
callq 0xe310
jmp 0x1290f
movq -0x88(%rbp), %rax
movq 0x40(%rax), %rdi
movl $0x72, %esi
callq 0x19500
jmp 0x128bb
jmp 0x128bd
movq -0x88(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x13690
movl %eax, -0xa0(%rbp)
jmp 0x128d5
movq -0x88(%rbp), %rax
movl -0xa0(%rbp), %ecx
movl %ecx, 0x48(%rax)
movq 0x40(%rax), %rdi
callq 0x136b0
movl %eax, -0xa4(%rbp)
jmp 0x128f6
movq -0x88(%rbp), %rax
movl -0xa4(%rbp), %ecx
movl %ecx, 0x4c(%rax)
addq $0xb0, %rsp
popq %rbp
retq
movq -0x88(%rbp), %rdi
callq 0x136d0
movq -0x40(%rbp), %rdi
callq 0xe5d0
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/nGramSearch.cpp
// Function: snugglefish::nGramSearch::nGramSearch(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
nGramSearch::nGramSearch( uint32_t ngramLength, string indexFileName, uint32_t threads)
    :nGramBase(ngramLength, indexFileName),numThreads(threads) {

    masterFile = new smFile(baseFileName, ngramLength);

    if (!masterFile->exists()){
        //some error
    }else{
        masterFile->open('r');
    }


    numIndexFiles = masterFile->getNumIndexFiles();
    numFiles = masterFile->getNumFiles();
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdx, -0x98(%rbp)
movl %esi, %eax
movq -0x98(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movl %eax, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x84(%rbp)
leaq -0x40(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0xe130
movq -0x90(%rbp), %rdi
movl -0x84(%rbp), %esi
movq -0x80(%rbp), %rdx
callq 0x12450
jmp 0x12992
leaq -0x40(%rbp), %rdi
callq 0xe1d0
movq -0x90(%rbp), %rax
movl -0x1c(%rbp), %ecx
movl %ecx, 0x38(%rax)
movl $0x58, %edi
callq 0xe300
movq %rax, -0xa0(%rbp)
jmp 0x129bb
movq -0x90(%rbp), %rsi
movb $0x1, -0x71(%rbp)
addq $0x8, %rsi
leaq -0x70(%rbp), %rdi
callq 0xe130
jmp 0x129d5
movq -0xa0(%rbp), %rdi
movzbl -0xc(%rbp), %edx
leaq -0x70(%rbp), %rsi
callq 0x19250
jmp 0x129eb
movq -0x90(%rbp), %rax
movq -0xa0(%rbp), %rcx
movb $0x0, -0x71(%rbp)
movq %rcx, 0x40(%rax)
leaq -0x70(%rbp), %rdi
callq 0xe1d0
movq -0x90(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x18650
movb %al, -0xa1(%rbp)
jmp 0x12a22
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x12a9c
jmp 0x12a2e
jmp 0x12ab5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xe1d0
jmp 0x12b13
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x12b07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x12a81
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xe1d0
testb $0x1, -0x71(%rbp)
jne 0x12a89
jmp 0x12a9a
movq -0xa0(%rbp), %rdi
movl $0x58, %esi
callq 0xe310
jmp 0x12b07
movq -0x90(%rbp), %rax
movq 0x40(%rax), %rdi
movl $0x72, %esi
callq 0x19500
jmp 0x12ab3
jmp 0x12ab5
movq -0x90(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x13690
movl %eax, -0xa8(%rbp)
jmp 0x12acd
movq -0x90(%rbp), %rax
movl -0xa8(%rbp), %ecx
movl %ecx, 0x48(%rax)
movq 0x40(%rax), %rdi
callq 0x136b0
movl %eax, -0xac(%rbp)
jmp 0x12aee
movq -0x90(%rbp), %rax
movl -0xac(%rbp), %ecx
movl %ecx, 0x4c(%rax)
addq $0xb0, %rsp
popq %rbp
retq
movq -0x90(%rbp), %rdi
callq 0x136d0
movq -0x48(%rbp), %rdi
callq 0xe5d0
nopl (%rax)
// File: MITRECND[P]snugglefish/src/nGramSearch.cpp
// Function: snugglefish::nGramSearch::stringToNGrams(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
vector<uint64_t>* nGramSearch::stringToNGrams(string searchString){
    uint64_t nGram;
    vector <uint64_t>* ngrams = new vector<uint64_t>;


    for(size_t i = 0; i + ngramLength - 1 < searchString.length(); i++){
        nGram = 0;
        for(size_t j = 0; j < ngramLength; j++){
	    // (1 << (8*j)) is equivalent to pow(256,j)
            nGram += (unsigned char)searchString[i+j] * (1 << (8*j));
        }
        ngrams->push_back(nGram);
    }

    return ngrams;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rsi, -0x48(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x18, %edi
callq 0xe300
movq %rax, %rdi
movq %rdi, -0x38(%rbp)
callq 0x136f0
movq -0x38(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x48(%rbp), %rdi
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movzbl 0x28(%rcx), %ecx
addq %rcx, %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
callq 0xe4f0
movq %rax, %rcx
movq -0x50(%rbp), %rax
cmpq %rcx, %rax
jae 0x12c5d
movq $0x0, -0x18(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rcx
movq -0x30(%rbp), %rax
movzbl 0x28(%rcx), %ecx
cmpq %rcx, %rax
jae 0x12c3f
movq -0x48(%rbp), %rdi
movq -0x28(%rbp), %rsi
addq -0x30(%rbp), %rsi
callq 0xe670
movzbl (%rax), %eax
movq -0x30(%rbp), %rcx
shlq $0x3, %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
imull %ecx, %eax
cltq
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x12bee
movq -0x20(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x13710
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x12bb2
movq -0x20(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::~nGramIndex()
nGramIndex::~nGramIndex(){
    
	this->flushAll();
	for(uint64_t i = 0; i < maxNgram; i++){
		delete this->output_buffer[i].elements;
	}
	delete[] output_buffer;    

    delete masterFile;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
callq 0x15460
jmp 0x1538b
movq $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
cmpq 0x30(%rcx), %rax
jae 0x153e9
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq -0x10(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x153d9
movq -0x20(%rbp), %rdi
callq 0x13860
movq -0x20(%rbp), %rdi
movl $0x18, %esi
callq 0xe310
jmp 0x153db
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x15393
movq -0x18(%rbp), %rax
movq 0x40(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x15404
movq -0x28(%rbp), %rdi
callq 0xe420
movq -0x18(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
je 0x1542d
movq -0x30(%rbp), %rdi
callq 0x192b0
movq -0x30(%rbp), %rdi
movl $0x58, %esi
callq 0xe310
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
callq 0x10540
movq -0x18(%rbp), %rdi
callq 0x136d0
addq $0x30, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x105e0
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::flushAll()
void nGramIndex::flushAll(){
    flushing = true;
    if(fileNameList.size()){
        ngram_t_indexfcount num_files = fileNameList.size();
        //By updating the master file last, this set can be queried
        //while creating a new index set
        flushIndex(num_files);
        flushMaster();

        numSessionFilesProcessed += num_files;
    }
    flushing = false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movb $0x1, 0x69(%rdi)
addq $0x50, %rdi
callq 0x105a0
cmpq $0x0, %rax
je 0x154c1
movq -0x18(%rbp), %rdi
addq $0x50, %rdi
callq 0x105a0
movq -0x18(%rbp), %rdi
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %esi
callq 0x15680
movq -0x18(%rbp), %rdi
callq 0x15830
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
addq 0x80(%rax), %rcx
movq %rcx, 0x80(%rax)
movq -0x18(%rbp), %rax
movb $0x0, 0x69(%rax)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::flushIndex(unsigned int)
void nGramIndex::flushIndex(ngram_t_indexfcount num_files){
    //Create the files
    indexSet* tIndex = new indexSet(baseFileName.c_str(), masterFile->getNumIndexFiles(), ngramLength);
    tIndex->create(num_files);

    uint64_t bytes_flushed = 0;

    for(uint32_t i = 0; i < maxNgram; i++){ //iterate through every ngram
        bytes_flushed += output_buffer[i].elements_size * sizeof(ngram_t_fidtype);
        tIndex->addNGrams(i, this->output_buffer[i].elements);
        output_buffer[i].elements_size = 0;

        if (output_buffer[i].elements->size() != 0)
            cout << "Not Zero" << endl;
    }

    buffer_memory_usage = 0;

    tIndex->close();
    delete tIndex;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movl $0x68, %edi
callq 0xe300
movq -0x48(%rbp), %rdi
movq %rax, -0x50(%rbp)
addq $0x8, %rdi
callq 0xe120
movq %rax, %rcx
movq -0x48(%rbp), %rax
movq %rcx, -0x40(%rbp)
movq 0x70(%rax), %rdi
callq 0x13690
movl %eax, -0x38(%rbp)
jmp 0x156cb
movl -0x38(%rbp), %edx
movq -0x40(%rbp), %rsi
movq -0x50(%rbp), %rdi
movq -0x48(%rbp), %rax
movzbl 0x28(%rax), %ecx
callq 0x18690
jmp 0x156e5
movq -0x50(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x188b0
movq $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x48(%rbp), %rcx
movl -0x34(%rbp), %eax
cmpq 0x30(%rcx), %rax
jae 0x157de
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq (%rcx), %rcx
shlq $0x2, %rcx
addq -0x30(%rbp), %rcx
movq %rcx, -0x30(%rbp)
movq -0x18(%rbp), %rdi
movl -0x34(%rbp), %esi
movq 0x40(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
callq 0x19050
movq -0x48(%rbp), %rax
movq 0x40(%rax), %rcx
movl -0x34(%rbp), %edx
shlq $0x4, %rdx
addq %rdx, %rcx
movq $0x0, (%rcx)
movq 0x40(%rax), %rax
movl -0x34(%rbp), %ecx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x15a20
cmpq $0x0, %rax
je 0x157ce
movq 0xb81b(%rip), %rdi      # 0x20fb0
leaq 0x4f65(%rip), %rsi      # 0x1a701
callq 0xe2f0
movq %rax, %rdi
movq 0xb7e5(%rip), %rsi      # 0x20f90
callq 0xe340
jmp 0x157ce
movq -0x50(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x68, %esi
callq 0xe310
jmp 0x1581e
jmp 0x157d0
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x15708
movq -0x48(%rbp), %rax
movq $0x0, 0x48(%rax)
movq -0x18(%rbp), %rdi
callq 0x18800
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, %rax
je 0x15818
movq -0x58(%rbp), %rdi
callq 0x18740
movq -0x58(%rbp), %rdi
movl $0x68, %esi
callq 0xe310
addq $0x60, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0xe5d0
nopw (%rax,%rax)
// File: MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::flushMaster()
void nGramIndex::flushMaster(){
    //Write FileNames to File ID file
    ngram_t_indexfcount num_files = (ngram_t_indexfcount) fileNameList.size();

    if (!num_files){
        return;
    }

    for(unsigned long i = 0; i < num_files; i++){
        masterFile->addFileId(fileNameList[i].c_str());
    }

    //Clear the vector
    fileNameList.clear();

    //Update filid with new value
    masterFile->updateIndexFileCount(masterFile->getNumIndexFiles() + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x20(%rbp)
addq $0x50, %rdi
callq 0x105a0
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x15858
jmp 0x158d7
movq $0x0, -0x18(%rbp)
movq -0x18(%rbp), %rax
movl -0xc(%rbp), %ecx
cmpq %rcx, %rax
jae 0x158a7
movq -0x20(%rbp), %rdi
movq 0x70(%rdi), %rax
movq %rax, -0x28(%rbp)
addq $0x50, %rdi
movq -0x18(%rbp), %rsi
callq 0x105c0
movq %rax, %rdi
callq 0xe120
movq -0x28(%rbp), %rdi
movq %rax, %rsi
callq 0x19690
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x15860
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
callq 0x15a00
movq -0x20(%rbp), %rax
movq 0x70(%rax), %rcx
movq %rcx, -0x30(%rbp)
movq 0x70(%rax), %rdi
callq 0x13690
movq -0x30(%rbp), %rdi
movl %eax, %esi
addl $0x1, %esi
callq 0x19740
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: MITRECND[P]snugglefish/src/nGramIndex.cpp
// Function: snugglefish::nGramIndex::getStats(unsigned long&, unsigned long&, unsigned long&, bool&)
void nGramIndex::getStats(uint64_t& totalFiles, uint64_t& sessionFiles, uint64_t& indexFiles, bool& flushing){
    totalFiles = masterFile->getNumFiles();
    sessionFiles = numSessionFilesProcessed;
    indexFiles = masterFile->getNumIndexFiles();
    flushing = this->flushing;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq 0x70(%rax), %rdi
callq 0x136b0
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq -0x10(%rbp), %rcx
movq %rdx, (%rcx)
movq 0x80(%rax), %rdx
movq -0x18(%rbp), %rcx
movq %rdx, (%rcx)
movq 0x70(%rax), %rdi
callq 0x13690
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, %ecx
movl %ecx, %edx
movq -0x20(%rbp), %rcx
movq %rdx, (%rcx)
movb 0x69(%rax), %cl
movq -0x28(%rbp), %rax
andb $0x1, %cl
movb %cl, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: MITRECND[P]snugglefish/src/fileIndexer.cpp
// Function: snugglefish::fileIndexer::fileIndexer(unsigned char)
fileIndexer::fileIndexer(uint8_t ngramLength):
filesProcessed(0)
{

    if(ngramLength == 3  || ngramLength == 4){
        this->ngramLength = ngramLength;
        this->maxNgram = ((uint64_t) (1) << (8*ngramLength));
        this->pagesize = getpagesize();
    }
    else {
        throw std::runtime_error("Ngram len must be either 3 or 4");
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, (%rax)
movzbl -0x9(%rbp), %eax
cmpl $0x3, %eax
je 0x15cf3
movzbl -0x9(%rbp), %eax
cmpl $0x4, %eax
jne 0x15d26
movq -0x28(%rbp), %rax
movzbl -0x9(%rbp), %ecx
movl %ecx, 0x8(%rax)
movzbl -0x9(%rbp), %ecx
shll $0x3, %ecx
movl %ecx, %ecx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
movq %rcx, 0x10(%rax)
callq 0xe610
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, 0x18(%rax)
jmp 0x15d76
movl $0x10, %edi
callq 0xe170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x30(%rbp)
leaq 0x49c9(%rip), %rsi      # 0x1a70a
callq 0xe100
jmp 0x15d48
movq -0x30(%rbp), %rdi
movq 0xb29d(%rip), %rsi      # 0x20ff0
movq 0xb24e(%rip), %rdx      # 0x20fa8
callq 0xe5b0
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
callq 0xe230
jmp 0x15d7c
addq $0x30, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0xe5d0
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/fileIndexer.cpp
// Function: snugglefish::fileIndexer::processNgrams(unsigned char*, unsigned long, bool*)
void fileIndexer::processNgrams(unsigned char* buf, uint64_t fileSize, bool ngramList[]){
    //TODO update with byte array
    uint64_t nGram = 0;
    uint64_t i, j;
    for(i = 0; ((i + this->ngramLength) - 1) < fileSize; i++){
        nGram = 0;
       // creates an ngram using the formula buf[i] + buf[i+1]*256 
       // + buf[i+2]*256*256
        for(j = 0; j < this->ngramLength; j++){
            // (1 <<(8*j)) is equivalent to pow(256,j)
           nGram += (unsigned char)buf[i+j] * (1 << (8*j));
        }
        if(nGram >= this->maxNgram){
            throw std::runtime_error("Ngram greater than maxNgram");
        }
        ngramList[nGram] = 1;
    }

    return;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x50(%rbp), %rcx
movq -0x30(%rbp), %rax
movl 0x8(%rcx), %ecx
addq %rcx, %rax
subq $0x1, %rax
cmpq -0x18(%rbp), %rax
jae 0x16233
movq $0x0, -0x28(%rbp)
movq $0x0, -0x38(%rbp)
movq -0x50(%rbp), %rcx
movq -0x38(%rbp), %rax
movl 0x8(%rcx), %ecx
cmpq %rcx, %rax
jae 0x161b8
movq -0x10(%rbp), %rax
movq -0x30(%rbp), %rcx
addq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movq -0x38(%rbp), %rcx
shlq $0x3, %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
imull %ecx, %eax
cltq
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1616c
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
cmpq 0x10(%rcx), %rax
jb 0x16216
movl $0x10, %edi
callq 0xe170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x58(%rbp)
leaq 0x4563(%rip), %rsi      # 0x1a744
callq 0xe100
jmp 0x161e8
movq -0x58(%rbp), %rdi
movq 0xadfd(%rip), %rsi      # 0x20ff0
movq 0xadae(%rip), %rdx      # 0x20fa8
callq 0xe5b0
movq -0x58(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0xe230
jmp 0x16239
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movb $0x1, (%rax,%rcx)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x16140
addq $0x60, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0xe5d0
nopw %cs:(%rax,%rax)
// File: MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::file(char const*, unsigned long)
file::file(const char* fileName, size_t buffersize){
    this->bufferparam = buffersize;

    this->buffer = NULL;
    this->buffersize = 0;
    this->bufferused = 0;

    this->fd = 0;
    this->mmapFile = 0;
    this->size = 0;

    this->filename = (char*) malloc(sizeof(char) * (strlen(fileName) + 1));
    strncpy(this->filename, fileName, strlen(fileName) + 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rcx
movq %rcx, 0x38(%rax)
movq $0x0, 0x20(%rax)
movq $0x0, 0x28(%rax)
movq $0x0, 0x30(%rax)
movl $0x0, 0xc(%rax)
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rdi
callq 0xe140
movq %rax, %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
callq 0xe440
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0xe140
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq %rax, %rdx
addq $0x1, %rdx
callq 0xe180
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::~file()
file::~file(){
    //File Descriptor is not zero
    if(this->fd){
        this->close();
    }
    
    if (this->filename != NULL){
        free(this->filename);
    }

    if (this->buffer){
        free(this->buffer);
        this->buffer = NULL;
        this->buffersize = this->bufferused = 0;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpl $0x0, 0xc(%rax)
je 0x17b77
movq -0x10(%rbp), %rdi
callq 0x17bd0
jmp 0x17b75
jmp 0x17b77
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x17b8d
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0xe3b0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x17bc1
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xe3b0
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x28(%rax)
addq $0x10, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x105e0
nop
// File: MITRECND[P]snugglefish/src/file.cpp
// Function: snugglefish::file::close()
bool file::close(){
    if (!this->fd){ // already closed?
        return true;
    }

    this->flush(); 

    //Close the mmap if opened
    if (this->mmapFile){
        munmap(this->mmapFile, this->size); 
        this->mmapFile = 0;
        this->size = 0;
    }

    //Free the write buffer if allocated
    if (this->buffer){
        free(this->buffer);
        this->buffer = NULL;
        this->buffersize = this->bufferused = 0;
    }

    int32_t retval = ::close(this->fd);
    if(retval){//non zero
        cerr << "Error Closing File: " << this->filename << " -- Error: " << strerror(errno) << endl;
        throw runtime_error("Closing File");
    }

    this->fd = 0;

    return true;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, 0xc(%rax)
jne 0x17bf3
movb $0x1, -0x1(%rbp)
jmp 0x17d34
movq -0x30(%rbp), %rdi
callq 0x18260
movq -0x30(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x17c2c
movq -0x30(%rbp), %rax
movq 0x10(%rax), %rdi
movq 0x18(%rax), %rsi
callq 0xe1b0
movq -0x30(%rbp), %rax
movq $0x0, 0x10(%rax)
movq $0x0, 0x18(%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x17c60
movq -0x30(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0xe3b0
movq -0x30(%rbp), %rax
movq $0x0, 0x20(%rax)
movq $0x0, 0x30(%rax)
movq $0x0, 0x28(%rax)
movq -0x30(%rbp), %rax
movl 0xc(%rax), %edi
callq 0xe650
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x17d25
movq 0x9368(%rip), %rdi      # 0x20fe8
leaq 0x2b68(%rip), %rsi      # 0x1a7ef
callq 0xe2f0
movq %rax, %rdi
movq -0x30(%rbp), %rax
movq (%rax), %rsi
callq 0xe2f0
movq %rax, %rdi
leaq 0x2403(%rip), %rsi      # 0x1a0a8
callq 0xe2f0
movq %rax, -0x40(%rbp)
callq 0xe050
movl (%rax), %edi
callq 0xe0d0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xe2f0
movq %rax, %rdi
movq 0x92c0(%rip), %rsi      # 0x20f90
callq 0xe340
movl $0x10, %edi
callq 0xe170
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
leaq 0x2b14(%rip), %rsi      # 0x1a804
callq 0xe100
jmp 0x17cf7
movq -0x38(%rbp), %rdi
movq 0x92ee(%rip), %rsi      # 0x20ff0
movq 0x929f(%rip), %rdx      # 0x20fa8
callq 0xe5b0
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xe230
jmp 0x17d3f
movq -0x30(%rbp), %rax
movl $0x0, 0xc(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0xe5d0
nopl (%rax,%rax)