LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/trie.cpp
// Function: Trie::addWord(char const*, unsigned int, unsigned int, unsigned char)
void
Trie::addWord(const char *w, unsigned wordLen, unsigned id, unsigned char type) {
  
  unsigned i;
  char c;
  TrieNode *parent, *child;
  parent = root;

  //  cout << w << "\t" << mem - root << "\t";

  // traverse the tree, allocing as needed
  for (i=0; i < wordLen && *w; ++i, ++w) {
    c = *w;
    if (c == 'A') {
      if (parent->a == NULL) {
	parent->a = ++mem;
      }
      child = parent->a;
    } else if (c == 'C') {
      if (parent->c == NULL) {
	parent->c = ++mem;
      }
      child = parent->c;
    } else if (c == 'G') {
      if (parent->g == NULL) {
	parent->g = ++mem;
      }
      child = parent->g;
    } else {
      if (parent->t == NULL) {
	parent->t = ++mem;
      }
      child = parent->t;
    }
    
    parent = child;
  }

  if (parent->id == NULL) {
    parent->id = new vector<unsigned>;
    parent->type = new vector<unsigned char>;
    parent->id->push_back(id);
    parent->type->push_back(type);
  } else {
    // ensure that each type/id pair is only added once    
    for (i=0; i < parent->id->size(); ++i) {
      if (parent->id->at(i) == id &&
          parent->type->at(i) == type)
        return;
    }

    parent->id->push_back(id);
    parent->type->push_back(type);    


  }


  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebx
movl %ecx, %ebp
movl %ecx, 0xc(%rsp)
movb %bl, 0xb(%rsp)
movq (%rdi), %r15
movq 0x8(%rdi), %rax
movl %edx, %ecx
xorl %edx, %edx
cmpl %edx, %ecx
je 0x896d
movzbl (%rsi,%rdx), %r8d
cmpl $0x41, %r8d
je 0x8940
cmpl $0x43, %r8d
je 0x8931
cmpl $0x47, %r8d
je 0x894a
testl %r8d, %r8d
je 0x896d
movq 0x18(%r15), %r8
testq %r8, %r8
jne 0x8965
addq $0x18, %r15
jmp 0x8957
movq 0x8(%r15), %r8
testq %r8, %r8
jne 0x8965
addq $0x8, %r15
jmp 0x8957
movq (%r15), %r8
testq %r8, %r8
jne 0x8965
jmp 0x8957
movq 0x10(%r15), %r8
testq %r8, %r8
jne 0x8965
addq $0x10, %r15
addq $0x30, %rax
movq %rax, 0x8(%rdi)
movq %rax, (%r15)
movq %rax, %r8
incq %rdx
movq %r8, %r15
jmp 0x8902
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x89b5
leaq 0x28(%r15), %r12
xorl %r14d, %r14d
movl %r14d, %r14d
movq 0x8(%rdi), %rax
subq (%rdi), %rax
sarq $0x2, %rax
cmpq %r14, %rax
jbe 0x89ee
movq %r14, %rsi
callq 0x9648
cmpl %ebp, (%rax)
jne 0x89ac
movq (%r12), %rdi
movq %r14, %rsi
callq 0x962a
cmpb %bl, (%rax)
je 0x8a06
incl %r14d
movq 0x20(%r15), %rdi
jmp 0x897d
pushq $0x18
popq %rbx
movq %rbx, %rdi
callq 0x3260
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0x20(%r15)
movq %rbx, %rdi
callq 0x3260
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x28(%r15), %r12
movq %rax, 0x28(%r15)
movq 0x20(%r15), %rdi
leaq 0xc(%rsp), %rsi
callq 0x6194
movq (%r12), %rdi
leaq 0xb(%rsp), %rsi
callq 0x966a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/trie.cpp
// Function: Trie::addWordRC(char const*, unsigned int, unsigned int, unsigned char)
void
Trie::addWordRC(const char *w, unsigned wordLen, unsigned id, unsigned char type) {
  
  unsigned i;
  char c;
  TrieNode *parent, *child;
  parent = root;

  //  cout << w << "\t" << mem - root << "\t";

  // traverse the tree, allocing as needed
  for (i=wordLen; i > 0; --i) {
    c = w[i-1];

    if (c == 'A') {
      if (parent->t == NULL) {
        parent->t = ++mem;
      }
      child = parent->t;

    } else if (c == 'C') {
      if (parent->g == NULL) {
        parent->g = ++mem;
      }
      child = parent->g;
    } else if (c == 'G') {
      if (parent->c == NULL) {
        parent->c = ++mem;
      }
      child = parent->c;
    } else {
      if (parent->a == NULL) {
        parent->a = ++mem;
      }
      child = parent->a;
    }
    
    parent = child;
  }

  if (parent->id == NULL) {
    parent->id = new vector<unsigned>;
    parent->type = new vector<unsigned char>;
    parent->id->push_back(id);
    parent->type->push_back(type);
  } else {
    // ensure that each type/id pair is only added once    
    for (i=0; i < parent->id->size(); ++i) {
      if (parent->id->at(i) == id &&
          parent->type->at(i) == type)
        return;
    }

    parent->id->push_back(id);
    parent->type->push_back(type);    

  }


  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %r8d, %ebx
movl %ecx, %ebp
movl %ecx, 0xc(%rsp)
movb %bl, 0xb(%rsp)
movq (%rdi), %r15
movq 0x8(%rdi), %rax
movl %edx, %ecx
decq %rcx
cmpq $-0x1, %rcx
je 0x8aa3
movzbl (%rsi,%rcx), %edx
cmpl $0x47, %edx
je 0x8a68
cmpl $0x43, %edx
je 0x8a5d
cmpl $0x41, %edx
jne 0x8a73
movq 0x18(%r15), %rdx
testq %rdx, %rdx
jne 0x8a7b
jmp 0x8a83
movq 0x10(%r15), %rdx
testq %rdx, %rdx
jne 0x8a7b
jmp 0x8a89
movq 0x8(%r15), %rdx
testq %rdx, %rdx
jne 0x8a7b
jmp 0x8a8f
movq (%r15), %rdx
testq %rdx, %rdx
je 0x8a93
decq %rcx
movq %rdx, %r15
jmp 0x8a39
addq $0x18, %r15
jmp 0x8a93
addq $0x10, %r15
jmp 0x8a93
addq $0x8, %r15
addq $0x30, %rax
movq %rax, 0x8(%rdi)
movq %rax, (%r15)
movq %rax, %r15
jmp 0x8a36
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x8aeb
leaq 0x28(%r15), %r12
xorl %r14d, %r14d
movl %r14d, %r14d
movq 0x8(%rdi), %rax
subq (%rdi), %rax
sarq $0x2, %rax
cmpq %r14, %rax
jbe 0x8b24
movq %r14, %rsi
callq 0x9648
cmpl %ebp, (%rax)
jne 0x8ae2
movq (%r12), %rdi
movq %r14, %rsi
callq 0x962a
cmpb %bl, (%rax)
je 0x8b3c
incl %r14d
movq 0x20(%r15), %rdi
jmp 0x8ab3
pushq $0x18
popq %rbx
movq %rbx, %rdi
callq 0x3260
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, 0x20(%r15)
movq %rbx, %rdi
callq 0x3260
andq $0x0, 0x10(%rax)
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
leaq 0x28(%r15), %r12
movq %rax, 0x28(%r15)
movq 0x20(%r15), %rdi
leaq 0xc(%rsp), %rsi
callq 0x6194
movq (%r12), %rdi
leaq 0xb(%rsp), %rsi
callq 0x966a
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/Ahhgust[P]STRaitRazor/trie.cpp
// Function: Trie::~Trie()
Trie::~Trie() {
  unsigned i;
  TrieNode *n = root;
  for (i=0; i < numNodes; ++i, ++n) {
    if ((*n).id != NULL) {
      delete((*n).id);
      delete((*n).type);
    }
  }

  delete [] root;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %r12
addq $0x28, %r12
xorl %ebp, %ebp
pushq $0x18
popq %r14
cmpl 0x10(%rbx), %ebp
jae 0x8ba8
movq -0x8(%r12), %r15
testq %r15, %r15
je 0x8ba0
movq %r15, %rdi
callq 0x744c
movq %r15, %rdi
movq %r14, %rsi
callq 0x3270
movq (%r12), %r15
testq %r15, %r15
je 0x8b95
movq %r15, %rdi
callq 0x770a
movq %r15, %rdi
movq %r14, %rsi
callq 0x3270
incl %ebp
addq $0x30, %r12
jmp 0x8b62
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x8bbd
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3300
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: getch()
char getch(){char b=0;struct termios o={};fflush(stdout);if(tcgetattr(0,&o)<0)
perror("tcsetattr()");o.c_lflag&=~ICANON;o.c_lflag&=~ECHO;o.c_cc[VMIN]=1;o.c_cc[
VTIME]=0;if(tcsetattr(0,TCSANOW,&o)<0)perror("tcsetattr ICANON");if(read(0,&b,1)
<0)perror("read()");o.c_lflag|=ICANON;o.c_lflag|=ECHO;if(tcsetattr(0,TCSADRAIN,&
o)<0)perror("tcsetattr ~ICANON");return b;}

// Assembly:
pushq %rbx
subq $0x50, %rsp
movb $0x0, 0xf(%rsp)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movups %xmm0, 0x2c(%rbx)
movaps %xmm0, 0x20(%rbx)
movaps %xmm0, 0x10(%rbx)
movaps %xmm0, (%rbx)
movq 0x4ba4(%rip), %rax      # 0x6fb8
movq (%rax), %rdi
callq 0x2190
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2160
testl %eax, %eax
js 0x247b
leaq 0x10(%rsp), %rdx
andb $-0xb, 0xc(%rdx)
movw $0x100, 0x16(%rdx)      # imm = 0x100
xorl %edi, %edi
xorl %esi, %esi
callq 0x21c0
testl %eax, %eax
js 0x2489
leaq 0xf(%rsp), %rsi
pushq $0x1
popq %rdx
xorl %edi, %edi
callq 0x2230
testq %rax, %rax
js 0x2497
leaq 0x10(%rsp), %rdx
orb $0xa, 0xc(%rdx)
pushq $0x1
popq %rsi
xorl %edi, %edi
callq 0x21c0
testl %eax, %eax
js 0x24a5
movb 0xf(%rsp), %al
addq $0x50, %rsp
popq %rbx
retq
leaq 0x1c16(%rip), %rdi      # 0x4098
callq 0x2110
jmp 0x242a
leaq 0x1c14(%rip), %rdi      # 0x40a4
callq 0x2110
jmp 0x2446
leaq 0x1c17(%rip), %rdi      # 0x40b5
callq 0x2110
jmp 0x245a
leaq 0x1c10(%rip), %rdi      # 0x40bc
callq 0x2110
jmp 0x2471
// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: signalhandler(int)
void signalhandler(int sig){
	switch(sig){
	case SIGINT:
		if(animate)moveto(L->getoutputx(),L->getoutputy());
		exit(2);
	case SIGUSR1:
		animatedelay+=100000; //100ms extra
		break;
	}
}

// Assembly:
cmpl $0xa, %edi
je 0x24ea
cmpl $0x2, %edi
je 0x24f5
retq
addl $0x186a0, 0x4c9c(%rip)  # imm = 0x186A0
retq
pushq %rax
cmpb $0x1, 0x4c97(%rip)      # 0x7194
jne 0x2511
movq 0x4c92(%rip), %rax      # 0x7198
movl 0x48(%rax), %edi
movl 0x4c(%rax), %esi
callq 0x24b3
pushq $0x2
popq %rdi
callq 0x21b0
// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: Level::Level(std::basic_ifstream<char, std::char_traits<char>>&)
Level(ifstream &cf){
		code.resize(10); //some nice starting amount
		int i,maxlen=0;
		for(i=0;cf.good();i++){
			if(i+1>(int)code.size())code.resize(code.size()*2);
			getline(cf,code[i]);
			if((int)code[i].size()>maxlen)maxlen=code[i].size();
		}
		if(&cf!=&cin)cf.close();
		code.resize(i);
		for(i=0;i<(int)code.size();i++)code[i].resize(maxlen,' ');
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x30(%rdi), %r14
xorps %xmm0, %xmm0
movups %xmm0, 0x30(%rdi)
movups %xmm0, 0x20(%rdi)
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
andq $0x0, 0x40(%rdi)
pushq $0xa
popq %rsi
movq %r14, %rdi
callq 0x2ac0
xorl %r13d, %r13d
xorl %r12d, %r12d
xorl %ebp, %ebp
movq (%r15), %rax
movq -0x18(%rax), %rax
cmpl $0x0, 0x20(%r15,%rax)
jne 0x2881
movq 0x30(%rbx), %rsi
movq 0x38(%rbx), %rax
subq %rsi, %rax
movq %rax, %rcx
shrq $0x5, %rcx
movslq %ecx, %rcx
cmpq %rcx, %r12
jl 0x2860
sarq $0x4, %rax
movq %r14, %rdi
movq %rax, %rsi
callq 0x2ac0
movq (%r14), %rsi
addq %r13, %rsi
movq %r15, %rdi
callq 0x2040
movq (%r14), %rax
movl 0x8(%rax,%r13), %eax
cmpl %eax, %ebp
cmovlel %eax, %ebp
addq $0x20, %r13
incq %r12
jmp 0x2825
cmpq 0x4758(%rip), %r15      # 0x6fe0
je 0x2892
movq %r15, %rdi
callq 0x2050
movl %r12d, %esi
movq %r14, %rdi
callq 0x2ac0
movl %ebp, %r15d
xorl %r12d, %r12d
pushq $0x20
popq %rbp
xorl %r13d, %r13d
movq 0x30(%rbx), %rdi
movq 0x38(%rbx), %rax
subq %rdi, %rax
shrq $0x5, %rax
cltq
cmpq %rax, %r13
jge 0x28d5
addq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
callq 0x2090
incq %r13
addq $0x20, %r12
jmp 0x28a9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x28ea
jmp 0x28ea
jmp 0x28ea
movq %rax, %r15
movq %r14, %rdi
callq 0x29ee
movq %rbx, %rdi
callq 0x2a10
movq %r15, %rdi
callq 0x22a0
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: Level::play()
void play(void){
		mario *m=new mario;
		memory.resizepos(300);
		memory.resizeneg(300);
		m->ipx=0; m->ipy=0;
		m->dir=DIRRIGHT;
		m->walking=true;
		m->skip=false;
		m->memp=0;
		if(animate){
			printf("\x1B[1J");
			moveto(0,0);
			print();
			inputy=code.size(); //input comes first line under the code in animation mode
			outputx=0;
			outputy=inputy+2; //output comes under the input line, under "Output:"
			tapex=code[0].size()+1; //tape comes to the right of the code
			moveto(0,outputy-1);
			printf("\x1B[34;1mOutput:\x1B[0m"); fflush(stdout);
			moveto(outputx,outputy);
		}
		while(execcommandStep(m));
	}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
pushq $0x14
popq %rdi
callq 0x2130
movq %rax, %r14
movq %rbx, %rdi
movl $0x12c, %esi            # imm = 0x12C
xorl %edx, %edx
callq 0x2d06
movq %rbx, %rdi
movl $0x12c, %esi            # imm = 0x12C
xorl %edx, %edx
callq 0x2d1c
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movw $0x1, 0x10(%r14)
cmpb $0x1, 0x4849(%rip)      # 0x7194
jne 0x29c1
leaq 0x1a39(%rip), %rdi      # 0x438d
xorl %eax, %eax
callq 0x2030
xorl %edi, %edi
xorl %esi, %esi
callq 0x24b3
movq %rbx, %rdi
callq 0x2d36
movq 0x30(%rbx), %rax
movq 0x38(%rbx), %rsi
subq %rax, %rsi
shrq $0x5, %rsi
movl %esi, 0x50(%rbx)
andl $0x0, 0x48(%rbx)
leal 0x2(%rsi), %ecx
movl %ecx, 0x4c(%rbx)
movl 0x8(%rax), %eax
incl %eax
movl %eax, 0x54(%rbx)
incl %esi
xorl %edi, %edi
callq 0x24b3
leaq 0x19f2(%rip), %rdi      # 0x4392
xorl %eax, %eax
callq 0x2030
movq 0x460a(%rip), %rax      # 0x6fb8
movq (%rax), %rdi
callq 0x2190
movl 0x48(%rbx), %edi
movl 0x4c(%rbx), %esi
callq 0x24b3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2d5e
testb %al, %al
jne 0x29c1
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: Level::animationFrameEnd(mario*, int, int, char)
void animationFrameEnd(mario *m,int x,int y,char c){
		usleep(animatedelay);
		moveto(x,y);
		printf("%c",c); fflush(stdout);
		moveto(outputx,outputy);
		if(animateShowTape)drawTape(m);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %r8d, %ebp
movl %ecx, %r15d
movl %edx, %r12d
movq %rsi, %rbx
movq %rdi, %r14
movl 0x33f5(%rip), %edi      # 0x7190
callq 0x2210
movl %r12d, %edi
movl %r15d, %esi
callq 0x24b3
movl %ebp, %edi
callq 0x21f0
movq 0x31ff(%rip), %rax      # 0x6fb8
movq (%rax), %rdi
callq 0x2190
movl 0x48(%r14), %edi
movl 0x4c(%r14), %esi
callq 0x24b3
cmpb $0x1, 0x33c0(%rip)      # 0x7195
jne 0x3dea
movq %r14, %rdi
movq %rbx, %rsi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3df4
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/tomsmeding[P]MarioLANG/mariolang.cpp
// Function: Level::drawTape(mario*)
void drawTape(mario *m){
		static int minidx=-1,maxidx=-1;
		static bool inited=false;
		int i,intwidth;
		char printf_format[20];
		if(!inited){
			inited=true;
			minidx=0;
			maxidx=0;
		}
		if(m->memp<minidx)minidx=m->memp;
		if(m->memp>maxidx)maxidx=m->memp;
		intwidth=max(1+log10(minidx==0?0.1:-minidx),log10(maxidx==0?1:maxidx))+1;
		printf("\x1B[34m"); fflush(stdout); //blue
		snprintf(printf_format,20,"%%%dd%%c %%d",intwidth);
		// fprintf(stderr,"%s",printf_format);
		// exit(0);
		for(i=minidx;i<=maxidx;i++){
			moveto(tapex,i-minidx);
			printf("\x1B[0K"); fflush(stdout);
			printf(printf_format,i,m->memp==i?'#':'.',memory[i]); fflush(stdout);
		}
		printf("\x1B[0m"); fflush(stdout);
		moveto(outputx,outputy);
	}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, %r14
movq %rdi, %rbx
cmpb $0x1, 0x3392(%rip)      # 0x71a1
jne 0x3e19
movl 0x3359(%rip), %eax      # 0x7170
jmp 0x3e30
movb $0x1, 0x3381(%rip)      # 0x71a1
andl $0x0, 0x3349(%rip)      # 0x7170
andl $0x0, 0x3346(%rip)      # 0x7174
xorl %eax, %eax
movl 0x8(%r14), %ecx
cmpl %eax, %ecx
jge 0x3e40
movl %ecx, 0x3332(%rip)      # 0x7170
movl %ecx, %eax
cmpl 0x332e(%rip), %ecx      # 0x7174
jle 0x3e4e
movl %ecx, 0x3326(%rip)      # 0x7174
testl %eax, %eax
je 0x3e5a
negl %eax
cvtsi2sd %eax, %xmm0
jmp 0x3e62
movsd 0x226(%rip), %xmm0      # 0x4088
callq 0x20d0
addsd 0x221(%rip), %xmm0      # 0x4090
movsd %xmm0, 0x8(%rsp)
movl 0x32f9(%rip), %edi      # 0x7174
cmpl $0x1, %edi
adcl $0x0, %edi
callq 0x3f84
maxsd 0x8(%rsp), %xmm0
addsd 0x1fc(%rip), %xmm0      # 0x4090
cvttsd2si %xmm0, %ebp
leaq 0x77b(%rip), %rdi       # 0x461a
xorl %eax, %eax
callq 0x2030
movq 0x310b(%rip), %r13      # 0x6fb8
movq (%r13), %rdi
callq 0x2190
leaq 0x763(%rip), %rdx       # 0x4620
leaq 0x10(%rsp), %rdi
pushq $0x14
popq %rsi
movl %ebp, %ecx
xorl %eax, %eax
callq 0x2270
movl 0x329c(%rip), %ebp      # 0x7170
movl %ebp, %r15d
notl %r15d
pushq $0x2e
popq %r12
cmpl 0x3290(%rip), %ebp      # 0x7174
jg 0x3f54
movl 0x54(%rbx), %edi
movl %ebp, %esi
subl 0x327f(%rip), %esi      # 0x7170
callq 0x24b3
leaq 0x730(%rip), %rdi       # 0x462d
xorl %eax, %eax
callq 0x2030
movq (%r13), %rdi
callq 0x2190
cmpl 0x8(%r14), %ebp
movl %r12d, %edx
pushq $0x23
popq %rax
cmovel %eax, %edx
movl %r15d, %eax
shlq $0x2, %rax
addq 0x18(%rbx), %rax
movl %ebp, %ecx
shlq $0x2, %rcx
addq (%rbx), %rcx
testl %ebp, %ebp
cmovsq %rax, %rcx
movl (%rcx), %ecx
leaq 0x10(%rsp), %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x2030
movq (%r13), %rdi
callq 0x2190
incl %ebp
decl %r15d
jmp 0x3ede
leaq 0x445(%rip), %rdi       # 0x43a0
xorl %eax, %eax
callq 0x2030
movq (%r13), %rdi
callq 0x2190
movl 0x48(%rbx), %edi
movl 0x4c(%rbx), %esi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x24b3
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: SkipList::fastFindNode(int)
int SkipList::fastFindNode(int key) {
  node* pred = head;
  int lFound = -1;
  for (int level = pred->topLevel-1; level >= 0; level--) {
	node* curr;
	curr = pred->nexts[level][FANOUT-1].nxt;
	inc();
	while (key > pred->nexts[level][FANOUT-1].prefix) {
	  pred = curr;
	  curr = pred->nexts[level][FANOUT-1].nxt;
	  inc();
	}
	if (lFound == -1 && key == pred->nexts[level][FANOUT-1].prefix) {
	  return level;
	}

	// pred.key is less than key, curr.key is greater than key.
	int k = 0;
	while (key > pred->nexts[level][k].prefix) {
	  k++;
	}
	//assert(k < FANOUT);
	if (k != 0) {
	  if (lFound == -1 && key == pred->nexts[level][k-1].prefix) {
		return level;
	  }
	  pred = pred->nexts[level][k-1].nxt;
	  inc();
	}
  }
  return lFound;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq (%rdi), %rbx
movl 0x4(%rbx), %ecx
movl 0x1c(%rdi), %edx
movl 0x18(%rdi), %r8d
leal -0x1(%rcx), %r9d
movabsq $-0x200000000, %rax     # imm = 0xFFFFFFFE00000000
movabsq $0x100000000, %r11      # imm = 0x100000000
testl %ecx, %ecx
jle 0x1358
movl %r9d, %r15d
shlq $0x6, %r15
decq %rcx
movl %ecx, %r14d
shlq $0x6, %r14
movq 0x40(%rbx,%r14), %r13
cmpl $0x1, %edx
jne 0x12db
incl %r8d
movl %r8d, 0x18(%rdi)
movq %rbx, %r12
movq %r13, %rbx
leaq 0x8(%r12), %r13
cmpl %esi, 0x38(%r12,%r14)
jge 0x12fc
movq 0x40(%rbx,%r14), %r13
movq %rbx, %r12
cmpl $0x1, %edx
jne 0x12de
jmp 0x12d4
je 0x1354
addq %r12, %r15
addq $0x8, %r15
xorl %ebp, %ebp
movq %rax, %rbx
movq %rbp, %r10
addq %r11, %rbx
addq $0x10, %rbp
cmpl %esi, (%r15,%r10)
jl 0x130a
cmpq $0x10, %rbp
je 0x1349
addq %r14, %r13
movq %rbx, %r10
sarq $0x1c, %r10
cmpl %esi, (%r10,%r13)
je 0x1354
sarq $0x20, %rbx
shlq $0x4, %rbx
movq 0x8(%rbx,%r13), %r12
cmpl $0x1, %edx
jne 0x1349
incl %r8d
movl %r8d, 0x18(%rdi)
decl %r9d
movq %r12, %rbx
jmp 0x12b1
movl %ecx, %eax
jmp 0x135d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: SkipList::findNode(int, node* (*) [4], node* (*) [4])
int SkipList::findNode(int key, node* preds[][FANOUT], node* succs[][FANOUT]) {
  node* pred = head;
  int lFound = -1;
  for (int level = pred->topLevel-1; level >= 0; level--) {
	node* curr;
	curr = pred->nexts[level][FANOUT-1].nxt;
	inc();
	while (key > pred->nexts[level][FANOUT-1].prefix) {
	  pred = curr;
	  curr = pred->nexts[level][FANOUT-1].nxt;
	  inc();
	}
	preds[level][FANOUT-1] = pred;
	succs[level][FANOUT-1] = curr;
	if (lFound == -1 && key == pred->nexts[level][FANOUT-1].prefix) {
	  lFound = level;
	  continue;
	}

	// pred.key is less than key, curr.key is greater than key.
	int k = 0;
	while (key > pred->nexts[level][k].prefix) {
	  k++;
	}
	//assert(k < FANOUT);
	if (k != 0) {
	  if (lFound == -1 && key == pred->nexts[level][k-1].prefix) {
		lFound = level;
	  }
	  pred = pred->nexts[level][k-1].nxt;
	  inc();
	}
	// for (int k = 0; k < FANOUT; k++) {
	//   if (pred->nexts[level][k].nxt == NULL) {
	// 	continue;
	//   }
	//   if (key >= pred->nexts[level][k].prefix) {
	// 	//		preds[level][k] = pred->nexts[level][k].nxt;
	// 	continue;
	//   } else {
	// 	if (k != 0) {
	// 	  if (lFound == -1 && key == pred->nexts[level][k-1].prefix) {
	// 		lFound = level;
	// 	  }
	// 	  pred = pred->nexts[level][k-1].nxt;
	// 	  inc();
	// 	}
	//   }
	//   succs[level][k] = pred->nexts[level][k].nxt;
	// }
  }
  return lFound;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, -0x8(%rsp)
movq %rdx, -0x10(%rsp)
movq (%rdi), %r14
movl 0x4(%r14), %r8d
movl 0x1c(%rdi), %r9d
movl 0x18(%rdi), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movabsq $0x100000000, %rbx      # imm = 0x100000000
leal -0x1(%r8), %r15d
testl %r8d, %r8d
jle 0x14b3
movl %r15d, %r13d
shlq $0x6, %r13
decq %r8
movl %r8d, %ebp
movq %rbp, %r12
shlq $0x6, %r12
movq 0x40(%r14,%r12), %r10
cmpl $0x1, %r9d
jne 0x13f2
incl %ecx
movl %ecx, 0x18(%rdi)
movq %r10, %r11
movl 0x38(%r14,%r12), %r10d
cmpl %esi, %r10d
jge 0x1412
movq 0x40(%r11,%r12), %r10
movq %r11, %r14
cmpl $0x1, %r9d
jne 0x13f2
movq %r11, %r14
jmp 0x13ed
shlq $0x5, %rbp
movq -0x10(%rsp), %rdx
movq %r14, 0x18(%rdx,%rbp)
movq -0x8(%rsp), %rdx
movq %r11, 0x18(%rdx,%rbp)
cmpl $-0x1, %eax
jne 0x1434
cmpl %esi, %r10d
je 0x14ab
leaq 0x8(%r14), %rdx
leaq (%r14,%r13), %r10
addq $0x8, %r10
xorl %r11d, %r11d
movabsq $-0x200000000, %r13     # imm = 0xFFFFFFFE00000000
movq %r11, %rbp
addq %rbx, %r13
addq $0x10, %r11
cmpl %esi, (%r10,%rbp)
jl 0x144d
decl %r15d
cmpq $0x10, %r11
je 0x13c5
sarq $0x20, %r13
cmpl $-0x1, %eax
jne 0x148b
leaq (%rdx,%r12), %rax
movq %r13, %r10
shlq $0x4, %r10
cmpl %esi, (%r10,%rax)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovel %r8d, %eax
addq %r12, %rdx
shlq $0x4, %r13
movq 0x8(%r13,%rdx), %r14
cmpl $0x1, %r9d
jne 0x13c1
incl %ecx
movl %ecx, 0x18(%rdi)
jmp 0x13c1
movl %r8d, %eax
jmp 0x13c1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: SkipList::insert(int)
int SkipList::insert(int key) {
  node *preds[max_level][FANOUT], *succs[max_level][FANOUT];
  int found = findNode(key, preds, succs);
  if (found != -1) return 0;
  node* add = new node();
  add->key = key;
  int topLevel = randomLevel(max_level);
  for (int i = 0; i < topLevel; i++) {
	add->nexts[i][FANOUT-1].nxt = succs[i][FANOUT-1];
	add->nexts[i][FANOUT-1].prefix = succs[i][FANOUT-1]->key;
	preds[i][FANOUT-1]->nexts[i][FANOUT-1].nxt = add;
	preds[i][FANOUT-1]->nexts[i][FANOUT-1].prefix = key;
	for (int k = 0; k < FANOUT-1; k++) {
	  if (preds[i][FANOUT-1]->nexts[i][k].prefix > key) {
		add->nexts[i][k].nxt = preds[i][FANOUT-1]->nexts[i][k].nxt;
		add->nexts[i][k].prefix = preds[i][FANOUT-1]->nexts[i][k].prefix;
		preds[i][k]->nexts[i][k].nxt = NULL;
		preds[i][k]->nexts[i][k].prefix = 0;
	  }
	}
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r12
movl 0x14(%rdi), %eax
movq %rsp, %r14
shlq $0x5, %rax
subq %rax, %r14
movq %r14, %rsp
movq %rsp, %r15
subq %rax, %r15
movq %r15, %rsp
movq %r14, %rdx
movq %r15, %rcx
callq 0x1390
xorl %ecx, %ecx
cmpl $-0x1, %eax
jne 0x15ce
movl $0x348, %edi            # imm = 0x348
callq 0x10d0
movq %r12, -0x30(%rbp)
movq %rax, %r12
xorl %r13d, %r13d
movl $0x348, %edx            # imm = 0x348
movq %rax, %rdi
xorl %esi, %esi
callq 0x1060
movl %ebx, (%r12)
movq -0x30(%rbp), %rax
movl 0x14(%rax), %edi
callq 0x1368
leaq 0x8(%r12), %rdx
testl %eax, %eax
cmovlel %r13d, %eax
movq %r12, %rsi
addq $0x10, %rsi
pushq $0x10
popq %rdi
movq %r14, %r8
cmpq %rax, %r13
je 0x15cb
movq %r13, %r9
shlq $0x5, %r9
movq 0x18(%r15,%r9), %r10
movq %r13, %r11
shlq $0x6, %r11
movq %r10, 0x38(%rdx,%r11)
movl (%r10), %r10d
movl %r10d, 0x30(%rdx,%r11)
movq 0x18(%r14,%r9), %r9
movq %r12, 0x40(%r9,%r11)
movl %ebx, 0x38(%r9,%r11)
addq %rdi, %r9
xorl %r10d, %r10d
cmpq $0x18, %r10
je 0x15ba
movl -0x8(%r9,%r10,2), %r11d
cmpl %ebx, %r11d
jle 0x15b4
movq (%r9,%r10,2), %rcx
movq %rcx, (%rsi,%r10,2)
movl %r11d, -0x8(%rsi,%r10,2)
movq (%r8,%r10), %rcx
addq %rdi, %rcx
andq $0x0, (%rcx,%r10,2)
andl $0x0, -0x8(%rcx,%r10,2)
addq $0x8, %r10
jmp 0x1585
incq %r13
addq $0x20, %r8
addq $0x40, %rdi
addq $0x40, %rsi
jmp 0x154b
pushq $0x1
popq %rcx
movl %ecx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: insert_test(SkipList*)
int insert_test(SkipList* sk) {
  assert (sk->lookup(99) <= 0);
  assert (sk->insert(99) > 0);
  assert (sk->lookup(99) > 0);
  assert (sk->insert(99) <= 0);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
pushq $0x63
popq %rsi
callq 0x1274
testl %eax, %eax
jne 0x19ad
pushq $0x63
popq %rsi
movq %rbx, %rdi
callq 0x14be
testl %eax, %eax
jne 0x19cc
leaq 0x6c6(%rip), %rdi       # 0x205b
leaq 0x690(%rip), %rsi       # 0x202c
leaq 0x69c(%rip), %rcx       # 0x203f
movl $0x116, %edx            # imm = 0x116
callq 0x1070
leaq 0x664(%rip), %rdi       # 0x2018
leaq 0x671(%rip), %rsi       # 0x202c
leaq 0x67d(%rip), %rcx       # 0x203f
movl $0x115, %edx            # imm = 0x115
callq 0x1070
pushq $0x63
popq %rsi
movq %rbx, %rdi
callq 0x1274
testl %eax, %eax
jne 0x19fa
leaq 0x68c(%rip), %rdi       # 0x206e
leaq 0x643(%rip), %rsi       # 0x202c
leaq 0x64f(%rip), %rcx       # 0x203f
movl $0x117, %edx            # imm = 0x117
callq 0x1070
pushq $0x63
popq %rsi
movq %rbx, %rdi
callq 0x14be
leaq 0x675(%rip), %rdi       # 0x2081
leaq 0x619(%rip), %rsi       # 0x202c
leaq 0x625(%rip), %rcx       # 0x203f
movl $0x118, %edx            # imm = 0x118
callq 0x1070
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: basic_test(SkipList*)
int basic_test(SkipList* sk) {
  for (int i = 0; i < 16; i++) {
	assert (sk->lookup(i) > 0);
  }
  assert (sk->lookup(99) <= 0);
  printf("PASSED\n");
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %ebp, %ebp
cmpl $0x10, %ebp
je 0x1a60
movq %rbx, %rdi
movl %ebp, %esi
callq 0x1274
incl %ebp
testl %eax, %eax
jne 0x1a2c
leaq 0x64d(%rip), %rdi       # 0x2095
leaq 0x5dd(%rip), %rsi       # 0x202c
leaq 0x651(%rip), %rcx       # 0x20a7
movl $0x11d, %edx            # imm = 0x11D
callq 0x1070
pushq $0x63
popq %rsi
movq %rbx, %rdi
callq 0x1274
testl %eax, %eax
je 0x1a8e
leaq 0x5a2(%rip), %rdi       # 0x2018
leaq 0x5af(%rip), %rsi       # 0x202c
leaq 0x623(%rip), %rcx       # 0x20a7
movl $0x11f, %edx            # imm = 0x11F
callq 0x1070
leaq 0x6b9(%rip), %rdi       # 0x214e
callq 0x1100
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: SkipList::printlist()
void SkipList::printlist() {
  node* ptr = head;
  while (ptr != tail) {
	printf("[K:%02d ", ptr->key);
	printf("N: %02d ", ptr->nexts[0][0].nxt->key);
	for (int j = 1; j < ptr->topLevel; j++) {
	  printf("N: ");
	  for (int k = 0; k < FANOUT; k++) {
		printf("%02d ", ptr->nexts[j][k].nxt->key);
	  }
	}
	printf("]\n");
	ptr = ptr->nexts[0][0].nxt;
  }
  printf("]\n");
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
leaq 0x625(%rip), %r12       # 0x20d4
leaq 0x618(%rip), %r13       # 0x20ce
movq %rdi, 0x8(%rsp)
movq (%rdi), %r15
movq 0x8(%rsp), %rax
cmpq 0x8(%rax), %r15
je 0x1b54
movl (%r15), %esi
leaq 0x5eb(%rip), %rdi       # 0x20c2
xorl %eax, %eax
callq 0x1040
leaq 0x10(%r15), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%r15), %rax
movl (%rax), %esi
leaq 0x5d7(%rip), %rdi       # 0x20cb
xorl %eax, %eax
callq 0x1040
leaq 0x50(%r15), %rbp
pushq $0x1
popq %r14
movslq 0x4(%r15), %rax
cmpq %rax, %r14
jge 0x1b3e
movq %r12, %rdi
xorl %eax, %eax
callq 0x1040
xorl %ebx, %ebx
cmpq $0x40, %rbx
je 0x1b35
movq (%rbp,%rbx), %rax
movl (%rax), %esi
movq %r13, %rdi
xorl %eax, %eax
callq 0x1040
addq $0x10, %rbx
jmp 0x1b18
incq %r14
addq $0x40, %rbp
jmp 0x1b03
leaq 0x610(%rip), %rdi       # 0x2155
callq 0x1100
movq 0x10(%rsp), %rdi
jmp 0x1abb
leaq 0x5fa(%rip), %rdi       # 0x2155
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1100
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: SkipList::pretty_print_skiplist()
void SkipList::pretty_print_skiplist() {
  node* ptr = head;
  while (ptr != 0) {
	if (ptr != head) {
	  for (int i = 0; i < ptr->topLevel; i++) {
		printf("   V   ");
	  }
	  for (int i = ptr->topLevel; i < max_level; i++) {
		printf("   |   ");
	  }
	}
	printf("\n");
	if (ptr == tail) {
	  for (int i = 0; i < max_level; i++) {
		printf("[K:ND] ");
	  }
	  printf("\n");
	  return;
	}
	for (int i = 0; i < ptr->topLevel; i++) {
	  printf("[K:%02d] ", ptr->key);
	}
	for (int i = ptr->topLevel; i < max_level; i++) {
	  printf("   |   ");
	}
	printf("\n");
	
	for (int i = 0; i < ptr->topLevel; i++) {
	  printf("[P:");
	  if (ptr->nexts[i][FANOUT-1].prefix == INT_MAX) {
		printf("ND");
	  } else {		
		printf("%02d", ptr->nexts[i][FANOUT-1].prefix);
	  }
	  printf("] ");
	}
	for (int i = ptr->topLevel; i < max_level; i++) {
	  printf("   |   ");
	}
	printf("\n");
	for (int i = 0; i < max_level; i++) {
	  printf("   |   ");
	}
	printf ("\n");
	ptr = ptr->nexts[0][FANOUT-1].nxt;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r13
pushq $0xa
popq %r12
leaq 0x559(%rip), %r15       # 0x20e0
movq %rdi, %rbx
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x1cbd
cmpq (%r13), %rbx
je 0x1bcc
xorl %r14d, %r14d
movl 0x4(%rbx), %ebp
cmpl %ebp, %r14d
jge 0x1bc6
leaq 0x52a(%rip), %rdi       # 0x20d8
xorl %eax, %eax
callq 0x1040
incl %r14d
jmp 0x1b9f
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
incl %ebp
cmpl 0x14(%r13), %ebp
jl 0x1bba
movl %r12d, %edi
callq 0x10f0
cmpq 0x8(%r13), %rbx
je 0x1ccc
xorl %ebp, %ebp
movl 0x4(%rbx), %r14d
cmpl %r14d, %ebp
jge 0x1c0a
movl (%rbx), %esi
leaq 0x4fe(%rip), %rdi       # 0x20f0
xorl %eax, %eax
callq 0x1040
incl %ebp
jmp 0x1be0
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
incl %r14d
cmpl 0x14(%r13), %r14d
jl 0x1bfd
movl %r12d, %edi
callq 0x10f0
leaq 0x38(%rbx), %r14
xorl %r12d, %r12d
movslq 0x4(%rbx), %rbp
cmpq %rbp, %r12
jge 0x1c76
leaq 0x4cb(%rip), %rdi       # 0x20fa
xorl %eax, %eax
callq 0x1040
movl (%r14), %esi
cmpl $0x7fffffff, %esi       # imm = 0x7FFFFFFF
jne 0x1c51
leaq 0x4b6(%rip), %rdi       # 0x20fe
xorl %eax, %eax
callq 0x1040
jmp 0x1c5f
leaq 0x4a9(%rip), %rdi       # 0x2101
xorl %eax, %eax
callq 0x1040
leaq 0x487(%rip), %rdi       # 0x20ed
xorl %eax, %eax
callq 0x1040
incq %r12
addq $0x40, %r14
jmp 0x1c1f
pushq $0xa
popq %r12
cmpl 0x14(%r13), %ebp
jge 0x1c8e
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
incl %ebp
jmp 0x1c7a
movl %r12d, %edi
callq 0x10f0
xorl %ebp, %ebp
cmpl 0x14(%r13), %ebp
jge 0x1cac
movq %r15, %rdi
xorl %eax, %eax
callq 0x1040
incl %ebp
jmp 0x1c98
movl %r12d, %edi
callq 0x10f0
addq $0x40, %rbx
jmp 0x1b8a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x415(%rip), %r14       # 0x20e8
xorl %ebx, %ebx
cmpl 0x14(%r13), %ebx
jge 0x1ce9
movq %r14, %rdi
xorl %eax, %eax
callq 0x1040
incl %ebx
jmp 0x1cd5
pushq $0xa
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10f0
// File: /workspace/github_cpp_makefile_star2_O2/narula[P]skiplists/skiplist-fanout.cc
// Function: main
int main(int argc, char** argv) {
  srand(time(NULL));
  int LIST_SIZE = atoi(argv[1]);
  int ITERATIONS = 10000;
  int maxl = floor(log(LIST_SIZE)/log(4))+1;
  SkipList* stest2 = SkipList::init_list(LIST_SIZE, maxl);
  assert(stest2);
  if (LIST_SIZE < 99) {
	basic_test(stest2);
	stest2->pretty_print_skiplist();
  }
  stest2->enable_counts();
  timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  time_t start = ts.tv_sec*1000000000 + ts.tv_nsec;
  for (int i = 0; i < ITERATIONS; i++) {
	int key = (rand() % LIST_SIZE);
	if (ITERATIONS < 50) printf("key: %d\n", key);
	stest2->lookup(key);
  }
  clock_gettime(CLOCK_MONOTONIC, &ts);
  stest2->disable_counts();
  time_t lookup_time = ts.tv_sec*1000000000 + ts.tv_nsec;
  printf("lookupns: %ld; itr: %d; size: %d; levels: %d; probability: %d; ptr: %d\n", 
		 (lookup_time-start)/(ITERATIONS), ITERATIONS, LIST_SIZE, maxl, FANOUT, stest2->get_ptr_count());
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
xorl %edi, %edi
callq 0x10b0
movl %eax, %edi
callq 0x10c0
movq 0x8(%rbx), %rdi
callq 0x1110
movl %eax, %ebx
movl %eax, %edi
callq 0x1e0d
divsd 0x2d0(%rip), %xmm0      # 0x2008
callq 0x1120
addsd 0x2cb(%rip), %xmm0      # 0x2010
cvttsd2si %xmm0, %ebp
movl %ebx, %edi
movl %ebp, %esi
callq 0x15e0
movq %rax, %r14
cmpl $0x62, %ebx
jle 0x1e05
movl $0x1, 0x1c(%r14)
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x10a0
movq (%r15), %r13
movq 0x8(%r15), %r12
movl $0x2710, %r15d          # imm = 0x2710
subl $0x1, %r15d
jb 0x1d9d
callq 0x1050
cltd
idivl %ebx
movq %r14, %rdi
movl %edx, %esi
callq 0x1274
jmp 0x1d83
pushq $0x1
popq %rdi
leaq 0x8(%rsp), %r15
movq %r15, %rsi
callq 0x10a0
movq (%r15), %rax
subq %r13, %rax
movq 0x8(%r15), %rcx
subq %r12, %rcx
imulq $0x3b9aca00, %rax, %rax # imm = 0x3B9ACA00
addq %rcx, %rax
movl $0x2710, %ecx           # imm = 0x2710
cqto
idivq %rcx
movl 0x18(%r14), %ecx
movl %ecx, (%rsp)
leaq 0x32a(%rip), %rdi       # 0x2106
pushq $0x4
popq %r9
movq %rax, %rsi
movl $0x2710, %edx           # imm = 0x2710
movl %ebx, %ecx
movl %ebp, %r8d
xorl %eax, %eax
callq 0x1040
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x1a24
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::add(Picture const&, int, int) const
Picture add(const Picture & other, int voff, int hoff) const {
	Picture ret = *this;
	for (int i = max(0, voff); i < min(height, height+voff); ++i)
	for (int j = max(0, hoff); j < min(width, width+hoff); ++j) {
            int pixel = other.p(i-voff,j-hoff);
            if (decontrast != -1) {
                // Experiment with decontrasting dot gain (useful for adding to the mean)
                double pivot = decontrast ? decontrast*other.weight : other.find_knee(true);
                if (pixel <= pivot) {
                    pixel = lround(pixel*255*other.weight/pivot);
                } else {
                    pixel = lround(255*other.weight + (pivot - pixel)/2);
                }
            }
            ret.p(i,j) += pixel; 
	}
        ret.weight += other.weight;
	return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r14d
movl %ecx, %r12d
movq %rdx, %r15
movq %rdi, %rbx
movq %rsi, 0x10(%rsp)
callq 0x1b9a
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %edx
cmovgl %r12d, %edx
testl %r14d, %r14d
cmovgl %r14d, %eax
movq %rax, 0x18(%rsp)
movl %edx, %ebp
movq %r12, 0x20(%rsp)
subl %r12d, %ebp
movq %r14, 0x30(%rsp)
negl %r14d
movq %r14, 0x28(%rsp)
movq 0x10(%rsp), %rax
movl 0x24(%rax), %eax
movq 0x20(%rsp), %rcx
addl %eax, %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
cmpl %eax, %edx
jge 0x1d07
movl %edx, 0xc(%rsp)
movslq %edx, %r13
movq 0x18(%rsp), %r14
movq 0x10(%rsp), %rax
movl 0x20(%rax), %eax
movq 0x30(%rsp), %rcx
addl %eax, %ecx
cmpl %eax, %ecx
cmovll %ecx, %eax
cmpl %eax, %r14d
jge 0x1cfa
movl 0x20(%r15), %eax
imull %ebp, %eax
movq 0x28(%rsp), %rcx
addl %r14d, %ecx
addl %ecx, %eax
cltq
movq (%r15), %rcx
movl (%rcx,%rax,4), %r12d
movl 0x7494(%rip), %eax      # 0x9108
cmpl $-0x1, %eax
je 0x1ce0
testl %eax, %eax
jne 0x1c8e
movq %r15, %rdi
pushq $0x1
popq %rsi
callq 0x1e80
cvtsi2sd %eax, %xmm1
jmp 0x1c98
cvtsi2sd %eax, %xmm1
mulsd 0x18(%r15), %xmm1
cvtsi2sd %r12d, %xmm0
ucomisd %xmm0, %xmm1
jae 0x1cc3
subsd %xmm0, %xmm1
mulsd 0x3359(%rip), %xmm1     # 0x5008
movsd 0x18(%r15), %xmm0
mulsd 0x3353(%rip), %xmm0     # 0x5010
addsd %xmm1, %xmm0
jmp 0x1cd8
imull $0xff, %r12d, %eax
cvtsi2sd %eax, %xmm0
mulsd 0x18(%r15), %xmm0
divsd %xmm1, %xmm0
callq 0x1030
movq %rax, %r12
movslq 0x20(%rbx), %rax
imulq %r13, %rax
addq %r14, %rax
movq (%rbx), %rcx
addl %r12d, (%rcx,%rax,4)
incq %r14
jmp 0x1c37
movl 0xc(%rsp), %edx
incl %edx
incl %ebp
jmp 0x1c0f
movsd 0x18(%r15), %xmm0
addsd 0x18(%rbx), %xmm0
movsd %xmm0, 0x18(%rbx)
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x256e
movq %r14, %rdi
callq 0x11b0
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::divide()
Picture divide() {
	Picture ret = *this;
	for (int i = 0; i < height; ++i)
            for (int j = 0; j < width; ++j)
		ret.p(i,j) = (ret.p(i,j) + (weight+1)/2)/weight;
        ret.weight = 1;
	return ret;
    }

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1b9a
xorl %eax, %eax
movsd 0x329f(%rip), %xmm0     # 0x5018
movsd 0x3287(%rip), %xmm1     # 0x5008
cmpl 0x24(%r14), %eax
jge 0x1dd1
movq (%rbx), %rcx
movsd 0x18(%r14), %xmm2
movapd %xmm2, %xmm3
addsd %xmm0, %xmm3
mulsd %xmm1, %xmm3
movslq %eax, %rdx
xorl %esi, %esi
cmpl 0x20(%r14), %esi
jge 0x1dcd
movslq 0x20(%rbx), %rdi
imulq %rdx, %rdi
addq %rsi, %rdi
cvtsi2sdl (%rcx,%rdi,4), %xmm4
addsd %xmm3, %xmm4
divsd %xmm2, %xmm4
cvttsd2si %xmm4, %r8d
movl %r8d, (%rcx,%rdi,4)
incq %rsi
jmp 0x1da1
incl %eax
jmp 0x1d81
movabsq $0x3ff0000000000000, %rax # imm = 0x3FF0000000000000
movq %rax, 0x18(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::dump(_IO_FILE*) const
void dump(FILE * f) const {
	fprintf(f, "P5\n%d %d\n255\n", width, height);
	for (int i = 0; i < height; ++i) {
            for (int j = 0; j < width; ++j)
                putc(255-(p(i,j)+weight/2)/weight, f);
	}
        fclose(f);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x20(%rdi), %edx
movl 0x24(%rdi), %ecx
leaq 0x3293(%rip), %rsi      # 0x5097
xorl %ebp, %ebp
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1140
cmpl 0x24(%r14), %ebp
jge 0x1e6d
xorl %r15d, %r15d
movl 0x20(%r14), %eax
cmpl %eax, %r15d
jge 0x1e69
imull %ebp, %eax
addl %r15d, %eax
cltq
movq (%r14), %rcx
cvtsi2sdl (%rcx,%rax,4), %xmm0
movsd 0x18(%r14), %xmm1
movapd %xmm1, %xmm2
mulsd 0x31c4(%rip), %xmm2     # 0x5008
addsd %xmm0, %xmm2
divsd %xmm1, %xmm2
movsd 0x31bc(%rip), %xmm0     # 0x5010
subsd %xmm2, %xmm0
cvttsd2si %xmm0, %edi
movq %rbx, %rsi
callq 0x11d0
incl %r15d
jmp 0x1e19
incl %ebp
jmp 0x1e10
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x10d0
nop
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::find_knee(bool) const
int find_knee(bool upper) const {
        vector<int> pixels = *this;
        if (upper) {
            std::sort(pixels.begin(), pixels.end(), std::greater<int>());
        } else {
            std::sort(pixels.begin(), pixels.end());
        }
        // The background/flush color ends where the normalized histogram derivative
        // is greater than 1 for the first time. 
        int totpix = pixels.size();
        int range = std::abs(pixels.back()-pixels.front());
        int grouplen = totpix/(range+1);
        // We've found the knee when the mean of the current group differs
        // from the mean of the previous group by more than weight.
        double prev = std::accumulate(pixels.begin(), pixels.begin()+grouplen, 0)/(double)grouplen;
        for (int i = 1; i < range; ++i) {
            double cur = std::accumulate(pixels.begin()+i*grouplen, pixels.begin()+(i+1)*grouplen, 0)/(double)grouplen;
            if (upper ? cur < prev-weight : cur > prev+weight) {
                 return prev;
            }
            cur = prev;
        }
        // Nothing interesting found, return the median
        return pixels[totpix/2];
    }

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebx
movq %rdi, %r14
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %r14, %rsi
callq 0x2660
movq (%r15), %rdi
movq 0x8(%r15), %rsi
testl %ebx, %ebx
je 0x1eb0
callq 0x26ad
jmp 0x1eb5
callq 0x2aad
movq 0x8(%rsp), %rsi
movq 0x10(%rsp), %rcx
movl -0x4(%rcx), %eax
subq %rsi, %rcx
shrq $0x2, %rcx
subl (%rsi), %eax
movl %eax, %r8d
negl %r8d
cmovsl %eax, %r8d
leal 0x1(%r8), %edi
movl %ecx, %eax
cltd
idivl %edi
movslq %eax, %rdx
leaq (%rsi,%rdx,4), %rdi
shlq $0x2, %rdx
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r9, %rdx
je 0x1efe
addl (%rsi,%r9), %r10d
addq $0x4, %r9
jmp 0x1eef
cvtsi2sd %r10d, %xmm0
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd 0x18(%r14), %xmm4
movapd %xmm0, %xmm2
addsd %xmm4, %xmm2
movapd %xmm0, %xmm3
subsd %xmm4, %xmm3
movl %r8d, %eax
pushq $0x1
popq %r8
cmpq %rax, %r8
jae 0x1f65
incq %r8
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpq %r9, %rdx
je 0x1f45
addl (%rdi,%r9), %r10d
addq $0x4, %r9
jmp 0x1f36
cvtsi2sd %r10d, %xmm4
divsd %xmm1, %xmm4
testb %bl, %bl
je 0x1f5a
ucomisd %xmm4, %xmm3
jbe 0x1f60
jmp 0x1f74
ucomisd %xmm2, %xmm4
ja 0x1f74
addq %rdx, %rdi
jmp 0x1f28
pushq $0x2
popq %rdi
movl %ecx, %eax
cltd
idivl %edi
cltq
movl (%rsi,%rax,4), %ebx
jmp 0x1f78
cvttsd2si %xmm0, %ebx
leaq 0x8(%rsp), %rdi
callq 0x256e
movl %ebx, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x256e
movq %rbx, %rdi
callq 0x11b0
nop
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::contrast(int, int)
Picture contrast(int pivot, int power) {
        Picture ret = *this;
        if (weight == 0.0) return ret;
        double knee = pivot/255.0;
        for (int i = 0; i < height; ++i)
            for (int j = 0; j < width; ++j) {
                double v = p(i,j)/(weight*255.0);
                if (v <= knee) {
                    v = pow(v/knee/2, power)/pow(0.5, power-1);
                } else {
                    v = 1-pow((1-v)/(1-knee)/2, power)/pow(0.5, power-1);
                }
                ret.p(i,j) = lround(v*255*weight);
            }
        return ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %ecx, %ebp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
callq 0x1b9a
movsd 0x18(%r14), %xmm0
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0x1fe6
jp 0x1fe6
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cvtsi2sd %r15d, %xmm2
divsd 0x301d(%rip), %xmm2     # 0x5010
cvtsi2sd %ebp, %xmm0
movsd %xmm0, 0x8(%rsp)
decl %ebp
cvtsi2sd %ebp, %xmm0
xorpd 0x3025(%rip), %xmm0     # 0x5030
movapd %xmm0, 0x20(%rsp)
movsd 0x2fff(%rip), %xmm0     # 0x5018
subsd %xmm2, %xmm0
movsd %xmm0, 0x10(%rsp)
xorl %r15d, %r15d
movsd %xmm2, 0x18(%rsp)
cmpl 0x24(%r14), %r15d
jge 0x1fd4
movslq %r15d, %r12
xorl %r13d, %r13d
movl 0x20(%r14), %eax
cmpl %eax, %r13d
jge 0x2124
imull %r15d, %eax
addl %r13d, %eax
cltq
movq (%r14), %rcx
cvtsi2sdl (%rcx,%rax,4), %xmm0
movsd 0x18(%r14), %xmm1
mulsd 0x2fac(%rip), %xmm1     # 0x5010
divsd %xmm1, %xmm0
ucomisd %xmm0, %xmm2
jae 0x20be
movsd 0x2fa2(%rip), %xmm1     # 0x5018
subsd %xmm0, %xmm1
divsd 0x10(%rsp), %xmm1
mulsd 0x2f80(%rip), %xmm1     # 0x5008
movapd %xmm1, %xmm0
movsd 0x8(%rsp), %xmm1
callq 0x11a0
movsd %xmm0, (%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x10c0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movsd 0x2f60(%rip), %xmm0     # 0x5018
subsd %xmm1, %xmm0
jmp 0x20f2
divsd %xmm2, %xmm0
mulsd 0x2f3e(%rip), %xmm0     # 0x5008
movsd 0x8(%rsp), %xmm1
callq 0x11a0
movsd %xmm0, (%rsp)
movapd 0x20(%rsp), %xmm0
callq 0x10c0
movsd (%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
mulsd 0x2f16(%rip), %xmm0     # 0x5010
mulsd 0x18(%r14), %xmm0
callq 0x1030
movslq 0x20(%rbx), %rcx
imulq %r12, %rcx
addq %r13, %rcx
movq (%rbx), %rdx
movl %eax, (%rdx,%rcx,4)
incq %r13
movsd 0x18(%rsp), %xmm2
jmp 0x2038
incl %r15d
jmp 0x202c
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::mse(Picture const&, int, int) const
double mse(const Picture & other, int voff, int hoff) const {
	unsigned totpix = 0;
	double sum = 0.0;
	for (int i = max(0, voff); i < min(height, height+voff); ++i) {
            for (int j = std::max(0, hoff); j < min(width, width+hoff); ++j) {
                double diff=p(i,j)/weight - other.p(i-voff,j-hoff)/other.weight;
                sum += diff*diff;
                ++totpix;
            }
        }
	return sum / pow(totpix, msepower);
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
xorl %eax, %eax
testl %edx, %edx
movl $0x0, %r8d
cmovgl %edx, %r8d
movl 0x24(%rdi), %r15d
leal (%r15,%rdx), %r9d
cmpl %r15d, %r9d
cmovll %r9d, %r15d
testl %ecx, %ecx
movl $0x0, %r9d
cmovgl %ecx, %r9d
movslq 0x20(%rdi), %r10
leal (%r10,%rcx), %ebp
cmpl %r10d, %ebp
cmovgel %r10d, %ebp
movupd 0x18(%rdi), %xmm0
movslq 0x20(%rsi), %r11
movq (%rsi), %rbx
movslq %ebp, %r14
movslq %r15d, %r15
movhpd 0x18(%rsi), %xmm0       # xmm0 = xmm0[0],mem[0]
movq %r10, %rsi
imulq %r8, %rsi
shlq $0x2, %rsi
addq (%rdi), %rsi
movslq %edx, %rdx
shlq $0x2, %r10
negl %ecx
xorpd %xmm3, %xmm3
cmpq %r15, %r8
jge 0x2252
movq %r8, %rdi
subq %rdx, %rdi
imulq %r11, %rdi
leaq (%rbx,%rdi,4), %rdi
movq %r9, %r12
cmpq %r14, %r12
jge 0x224a
leal (%rcx,%r12), %ebp
movslq %ebp, %r13
movss (%rsi,%r12,4), %xmm1
movss (%rdi,%r13,4), %xmm2
unpcklps %xmm2, %xmm1            # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
cvtdq2pd %xmm1, %xmm1
divpd %xmm0, %xmm1
movapd %xmm1, %xmm2
unpckhpd %xmm1, %xmm2            # xmm2 = xmm2[1],xmm1[1]
subsd %xmm2, %xmm1
mulsd %xmm1, %xmm1
addsd %xmm1, %xmm3
incl %eax
incq %r12
jmp 0x220c
incq %r8
addq %r10, %rsi
jmp 0x21f6
movl %eax, %eax
cvtsi2sd %rax, %xmm0
movsd 0x6eaf(%rip), %xmm1     # 0x9110
movapd %xmm3, (%rsp)
callq 0x11a0
movapd (%rsp), %xmm1
divsd %xmm0, %xmm1
movapd %xmm1, %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/leobru[P]ACPUfont/averager.cc
// Function: Picture::best_offset(Picture const&, int&, int&) const
double best_offset(const Picture & other, int & voff, int & hoff) const {
	// Compute average distances for all offsets up to size/3
	double minmse = 10e38;
	for (int i = -height/3; i <= height/3; ++i) 
	for (int j = -width/3; j <= width/3; ++j) {
		double curmse = mse(other, i, j);
		if (curmse < minmse) {
			// fprintf(stderr, "MSE = %.3f voff=%d hoff=%d\n", curmse, i, j);
			minmse = curmse;
			voff = i;
			hoff = j;
		}
	}
	// fprintf(stderr, "Best offsets are %d %d\n", voff, hoff);
        return minmse;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movl 0x24(%rdi), %ecx
pushq $-0x3
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movl %eax, %ebp
movsd 0x2d67(%rip), %xmm0     # 0x5020
movsd %xmm0, 0x8(%rsp)
pushq $0x3
popq %rbx
movl %ecx, %eax
cltd
idivl %ebx
cmpl %eax, %ebp
jg 0x2325
movl 0x20(%r12), %ecx
movl %ecx, %eax
cltd
pushq $-0x3
popq %rsi
idivl %esi
movl %eax, %r13d
movl %ecx, %eax
cltd
idivl %ebx
cmpl %eax, %r13d
jg 0x231c
movq %r12, %rdi
movq %r15, %rsi
movl %ebp, %edx
movl %r13d, %ecx
callq 0x217e
movsd 0x8(%rsp), %xmm1
ucomisd %xmm0, %xmm1
jbe 0x2312
movl %ebp, (%r14)
movq 0x10(%rsp), %rax
movl %r13d, (%rax)
movsd %xmm0, 0x8(%rsp)
incl %r13d
movl 0x20(%r12), %ecx
jmp 0x22db
incl %ebp
movl 0x24(%r12), %ecx
jmp 0x22c2
movsd 0x8(%rsp), %xmm0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq