LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: ncbi[P]amr/seq.cpp
// Function: Seq_sp::KmerIndex::dna2code(Seq_sp::Dna const&)
size_t KmerIndex::dna2code (const Dna &dna)
{
  size_t code = 0;
  for (const char c : dna. seq)
  {
    code *= 4;
    size_t delta = 0;
    switch (c)
    {
      case 'a': delta = 0; break;
      case 'c': delta = 1; break;
      case 'g': delta = 2; break;
      case 't': delta = 3; break;
      default: throw runtime_error ("Unknown nucleotide: " + to_string (c));
    }
    code += delta;
  }
  return code;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq $0x0, 0x88(%rsp)
movq 0x90(%rsp), %rax
addq $0x28, %rax
movq %rax, 0x80(%rsp)
movq 0x80(%rsp), %rdi
callq 0xd6d0
movq %rax, 0x78(%rsp)
movq 0x80(%rsp), %rdi
callq 0xddf0
movq %rax, 0x70(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x4c7b0
testb $0x1, %al
jne 0xd116b
jmp 0xd12e0
leaq 0x78(%rsp), %rdi
callq 0x4c7f0
movb (%rax), %al
movb %al, 0x6f(%rsp)
movq 0x88(%rsp), %rax
shlq $0x2, %rax
movq %rax, 0x88(%rsp)
movq $0x0, 0x60(%rsp)
movsbl 0x6f(%rsp), %eax
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, 0x8(%rsp)
subl $0x13, %eax
ja 0xd11f9
movq 0x8(%rsp), %rax
leaq 0x170ec(%rip), %rcx     # 0xe82a4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq $0x0, 0x60(%rsp)
jmp 0xd12bc
movq $0x1, 0x60(%rsp)
jmp 0xd12bc
movq $0x2, 0x60(%rsp)
jmp 0xd12bc
movq $0x3, 0x60(%rsp)
jmp 0xd12bc
movb $0x1, 0x13(%rsp)
movl $0x10, %edi
callq 0xd3b0
movq %rax, (%rsp)
movsbl 0x6f(%rsp), %esi
leaq 0x20(%rsp), %rdi
callq 0x11600
jmp 0xd121d
leaq 0x18a4c(%rip), %rsi     # 0xe9c70
leaq 0x40(%rsp), %rdi
leaq 0x20(%rsp), %rdx
callq 0x12260
jmp 0xd1235
movq (%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xdbf0
jmp 0xd1245
movq (%rsp), %rdi
movb $0x0, 0x13(%rsp)
movq 0x4ed9b(%rip), %rsi     # 0x11fff0
movq 0x4ed14(%rip), %rdx     # 0x11ff70
callq 0xdcd0
jmp 0xd12fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
jmp 0xd12a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
jmp 0xd129e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x18(%rsp)
movl %eax, 0x14(%rsp)
leaq 0x40(%rsp), %rdi
callq 0xdf08
leaq 0x20(%rsp), %rdi
callq 0xdf08
testb $0x1, 0x13(%rsp)
jne 0xd12b1
jmp 0xd12ba
movq (%rsp), %rdi
callq 0xd570
jmp 0xd12f0
movq 0x60(%rsp), %rax
addq 0x88(%rsp), %rax
movq %rax, 0x88(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x4c880
jmp 0xd1153
movq 0x88(%rsp), %rax
addq $0x98, %rsp
retq
movq 0x18(%rsp), %rdi
callq 0xdd40
nopw (%rax,%rax)
// File: ncbi[P]amr/seq.cpp
// Function: Seq_sp::KmerIndex::getKmers()
size_t KmerIndex::getKmers ()
{
  size_t kmers = 0;
  f. seekg ((streamoff) code2addr (0));
  Progress prog (code_max, progressSize);  
  Addr addr = nil;
  FOR (size_t, i, code_max)
  {
    prog ();
    readBin (f, addr);
    if (addr != nil)
      kmers++;
  }
  return kmers;
}

// Assembly:
subq $0x98, %rsp
movq %rdi, 0x90(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x10(%rsp)
movq $0x0, 0x88(%rsp)
addq $0x28, %rax
movq %rax, 0x8(%rsp)
xorl %eax, %eax
movl %eax, %edi
callq 0xd9090
movq %rax, %rsi
leaq 0x78(%rsp), %rdi
callq 0x4d0e0
movq 0x8(%rsp), %rdi
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
callq 0xd960
movq 0x10(%rsp), %rax
movq 0x248(%rax), %rsi
leaq 0x38(%rsp), %rdi
movl $0xf4240, %edx          # imm = 0xF4240
callq 0x27200
movq $-0x1, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movq 0x10(%rsp), %rcx
movq 0x28(%rsp), %rax
cmpq 0x248(%rcx), %rax
jae 0xd1413
leaq 0x4f8cb(%rip), %rsi     # 0x120c70
leaq 0x38(%rsp), %rdi
callq 0x24550
jmp 0xd13b1
movq 0x10(%rsp), %rdi
addq $0x28, %rdi
leaq 0x30(%rsp), %rsi
callq 0xd8f80
jmp 0xd13c6
cmpq $-0x1, 0x30(%rsp)
je 0xd13fe
movq 0x88(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x88(%rsp)
jmp 0xd13fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
leaq 0x38(%rsp), %rdi
callq 0x27580
jmp 0xd1435
jmp 0xd1400
movq 0x28(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x28(%rsp)
jmp 0xd138b
movq 0x88(%rsp), %rax
movq %rax, (%rsp)
leaq 0x38(%rsp), %rdi
callq 0x27580
movq (%rsp), %rax
addq $0x98, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0xdd40
nop
// File: ncbi[P]amr/./seq.hpp
// Function: Seq_sp::Seq::qc() const
void qc () const override
    { if (! qc_on)
        return;
      qcName ();
    	qcAlphabet ();
    }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x486ee(%rip), %rax     # 0x120c58
testb $0x1, (%rax)
jne 0xd8571
jmp 0xd8585
movq 0x8(%rsp), %rdi
callq 0xa9af0
movq 0x8(%rsp), %rdi
callq 0xaa120
addq $0x18, %rsp
retq
nopw (%rax,%rax)
// File: ncbi[P]amr/./seq.hpp
// Function: Seq_sp::Cds::getOverlap(Seq_sp::Cds const&) const
size_t getOverlap (const Cds &other) const
    // Symmetric
    { if (other. left () >= right ())
    		return 0;
    	if (left () >= other. right ())
    		return 0;
    	if (left () <= other. left ())
    		return getOverlap_ (other);
    	return other. getOverlap_ (*this);
    }

// Assembly:
subq $0x38, %rsp
movq %rdi, 0x28(%rsp)
movq %rsi, 0x20(%rsp)
movq 0x28(%rsp), %rax
movq %rax, 0x10(%rsp)
movq 0x20(%rsp), %rdi
callq 0xd88d0
movq 0x10(%rsp), %rdi
movq %rax, 0x18(%rsp)
callq 0xd88f0
movq %rax, %rcx
movq 0x18(%rsp), %rax
cmpq %rcx, %rax
jb 0xd8979
movq $0x0, 0x30(%rsp)
jmp 0xd89f8
movq 0x10(%rsp), %rdi
callq 0xd88d0
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0xd88f0
movq %rax, %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
jb 0xd89aa
movq $0x0, 0x30(%rsp)
jmp 0xd89f8
movq 0x10(%rsp), %rdi
callq 0xd88d0
movq %rax, (%rsp)
movq 0x20(%rsp), %rdi
callq 0xd88d0
movq %rax, %rcx
movq (%rsp), %rax
cmpq %rcx, %rax
ja 0xd89e4
movq 0x10(%rsp), %rdi
movq 0x20(%rsp), %rsi
callq 0xc02e0
movq %rax, 0x30(%rsp)
jmp 0xd89f8
movq 0x10(%rsp), %rsi
movq 0x20(%rsp), %rdi
callq 0xc02e0
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rax
addq $0x38, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ncbi[P]amr/./seq.hpp
// Function: Seq_sp::PeptideOrf::saveText(std::ostream&) const
void saveText (ostream &os) const override
	  { os         << translationStart 
	  	   << '\t' << (int) strand 
	  	   << '\t' << start 
	  	   << '\t' << stop 
	  	   << '\t' << startM
	  	   << '\t' << stopTerminator;
	  }

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movq 0x8(%rax), %rsi
callq 0xd180
movq %rax, %rdi
movl $0x9, %esi
callq 0xd870
movq %rax, %rdi
movq (%rsp), %rax
movsbl 0x10(%rax), %esi
callq 0xdd00
movq %rax, %rdi
movl $0x9, %esi
callq 0xd870
movq %rax, %rdi
movq (%rsp), %rax
movq 0x18(%rax), %rsi
callq 0xd180
movq %rax, %rdi
movl $0x9, %esi
callq 0xd870
movq %rax, %rdi
movq (%rsp), %rax
movq 0x28(%rax), %rsi
callq 0xd180
movq %rax, %rdi
movl $0x9, %esi
callq 0xd870
movq %rax, %rdi
movq (%rsp), %rax
movb 0x20(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0xdd60
movq %rax, %rdi
movl $0x9, %esi
callq 0xd870
movq %rax, %rdi
movq (%rsp), %rax
movb 0x30(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0xdd60
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: ctSkennerton[P]fxtract/util/sock_x.c
// Function: main
int main(void)
{
    int     s, port;

    s = sock_bind(NULL, 0);             // (any i/f, any port)
    sock_addr(s, NULL, &port, NULL, 0);
    if (!fork()) push(sock_connect("127.0.0.1", port, 0));
    double  tt = pull(sock_accept(s));
    close(s);

    s = sock_create(SockPath);
    if (!fork()) push(sock_open(SockPath));
    double  tu = pull(sock_accept(s));
    close(s);

    // Compare to a std unix pipe (i.e. unix socket without the socket layer).
    int     p[2];
    pipe(p);
    if (!fork()) push(p[1]);
    close(p[1]);
    double  tp = pull(p[0]);

    fprintf(stderr, "%dMB tt=%.3f tu=%.3f tp=%.3f\n", BYTES/1024*COUNT/1024, tt, tu, tp);

    unlink(SockPath);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
xorl %eax, %eax
movl %eax, %edi
xorl %esi, %esi
callq 0x5b40
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %edi
xorl %eax, %eax
movl %eax, %ecx
leaq -0xc(%rbp), %rdx
xorl %r8d, %r8d
movq %rcx, %rsi
callq 0x6fd0
callq 0x30a0
cmpl $0x0, %eax
jne 0x3695
movl -0xc(%rbp), %esi
leaq 0x597d(%rip), %rdi      # 0x9004
xorl %edx, %edx
callq 0x61b0
movl %eax, %edi
callq 0x3770
movl -0x8(%rbp), %edi
callq 0x5dd0
movl %eax, %edi
callq 0x37c0
movsd %xmm0, -0x18(%rbp)
movl -0x8(%rbp), %edi
callq 0x3530
leaq 0x8bf8(%rip), %rdi      # 0xc2b0
callq 0x5e60
movl %eax, -0x8(%rbp)
callq 0x30a0
cmpl $0x0, %eax
jne 0x36dd
leaq 0x8bdf(%rip), %rdi      # 0xc2b0
callq 0x6010
movl %eax, %edi
callq 0x3770
movl -0x8(%rbp), %edi
callq 0x5dd0
movl %eax, %edi
callq 0x37c0
movsd %xmm0, -0x20(%rbp)
movl -0x8(%rbp), %edi
callq 0x3530
leaq -0x28(%rbp), %rdi
callq 0x3400
callq 0x30a0
cmpl $0x0, %eax
jne 0x3714
movl -0x24(%rbp), %edi
callq 0x3770
movl -0x24(%rbp), %edi
callq 0x3530
movl -0x28(%rbp), %edi
callq 0x37c0
movsd %xmm0, -0x30(%rbp)
movq 0x88b0(%rip), %rax      # 0xbfe0
movq (%rax), %rdi
movsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
movsd -0x30(%rbp), %xmm2
leaq 0x58c5(%rip), %rsi      # 0x900e
movl $0x400, %edx            # imm = 0x400
movb $0x3, %al
callq 0x3430
leaq 0x8b54(%rip), %rdi      # 0xc2b0
callq 0x3150
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: ctSkennerton[P]fxtract/util/sock_x.c
// Function: pull
static double pull(int fd) 
{ 
    double  t = tick();
    while (0 < read(fd, buf, BYTES));
    close(fd);
    return tick() - t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
callq 0x5840
movsd %xmm0, -0x10(%rbp)
movl -0x4(%rbp), %edi
leaq 0x90f1(%rip), %rsi      # 0xc8d0
movl $0x8000, %edx           # imm = 0x8000
callq 0x3440
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jge 0x37f5
jmp 0x37d5
movl -0x4(%rbp), %edi
callq 0x3530
callq 0x5840
subsd -0x10(%rbp), %xmm0
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: iZhangHui[P]CppPrimer/CH17_SpecializedLibraryFacilities/examples/rand4.cc
// Function: main
int main()
{
	default_random_engine e;  // generates unsigned random integers
	// uniformly distributed from 0 to 1 inclusive
	uniform_real_distribution<double> u(0,1);
	for (size_t i = 0; i < 10; ++i)
    	cout << u(e) << " ";
	cout << endl;

	// empty <> signify we want to use the default result type
	uniform_real_distribution<> u2(0,1); // generates double by default
	default_random_engine e2;
	for (size_t i = 0; i < 10; ++i)
    	cout << u2(e2) << " ";  // should generate the same sequence 
	cout << endl;

	default_random_engine e3;
	// uniformly distributed from 0 to 9 inclusive
	uniform_int_distribution<unsigned> u3(0,9);
	for (size_t i = 0; i < 100; ++i)
    	cout << u3(e3) << ((i != 99)? " ": "");
	cout << endl;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
leaq -0x10(%rbp), %rdi
callq 0x1380
leaq -0x20(%rbp), %rdi
xorps %xmm0, %xmm0
movsd 0xdf1(%rip), %xmm1      # 0x2008
callq 0x13a0
movq $0x0, -0x28(%rbp)
cmpq $0xa, -0x28(%rbp)
jae 0x1261
leaq -0x20(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x13d0
movq 0x2d99(%rip), %rdi      # 0x3fd8
callq 0x10a0
movq %rax, %rdi
leaq 0xdf2(%rip), %rsi       # 0x2040
callq 0x1060
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x1224
movq 0x2d70(%rip), %rdi      # 0x3fd8
movq 0x2d59(%rip), %rsi      # 0x3fc8
callq 0x1070
leaq -0x38(%rbp), %rdi
xorps %xmm0, %xmm0
movsd 0xd85(%rip), %xmm1      # 0x2008
callq 0x13a0
leaq -0x40(%rbp), %rdi
callq 0x1380
movq $0x0, -0x48(%rbp)
cmpq $0xa, -0x48(%rbp)
jae 0x12d6
leaq -0x38(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x13d0
movq 0x2d24(%rip), %rdi      # 0x3fd8
callq 0x10a0
movq %rax, %rdi
leaq 0xd7d(%rip), %rsi       # 0x2040
callq 0x1060
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
jmp 0x1299
movq 0x2cfb(%rip), %rdi      # 0x3fd8
movq 0x2ce4(%rip), %rsi      # 0x3fc8
callq 0x1070
leaq -0x50(%rbp), %rdi
callq 0x1380
leaq -0x58(%rbp), %rdi
xorl %esi, %esi
movl $0x9, %edx
callq 0x1400
movq $0x0, -0x60(%rbp)
cmpq $0x64, -0x60(%rbp)
jae 0x135c
leaq -0x58(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x1430
movl %eax, %esi
movq 0x2cb1(%rip), %rdi      # 0x3fd8
callq 0x1080
movq %rax, %rdi
movq -0x60(%rbp), %rcx
leaq 0xd07(%rip), %rsi       # 0x2041
leaq 0xcff(%rip), %rax       # 0x2040
cmpq $0x63, %rcx
cmovneq %rax, %rsi
callq 0x1060
movq -0x60(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x60(%rbp)
jmp 0x130a
movq 0x2c75(%rip), %rdi      # 0x3fd8
movq 0x2c5e(%rip), %rsi      # 0x3fc8
callq 0x1070
xorl %eax, %eax
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: iZhangHui[P]CppPrimer/CH02_VariablesAndBasicTypes/examples/escape.cc
// Function: main
int main() {
	std::cout << '\n';       // prints a newline
	std::cout << "\tHi!\n";  // prints a tab followd by "Hi!" and a newline
	std::cout << "Hi \x4dO\115!\n"; // prints Hi MOM! followed by a newline
	std::cout << '\115' << '\n';    // prints M followed by a newline

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
movq 0x2e12(%rip), %rdi      # 0x3fd8
movl $0xa, %esi
callq 0x1050
movq 0x2e01(%rip), %rdi      # 0x3fd8
leaq 0xe26(%rip), %rsi       # 0x2004
callq 0x1040
movq 0x2dee(%rip), %rdi      # 0x3fd8
leaq 0xe19(%rip), %rsi       # 0x200a
callq 0x1040
movq 0x2ddb(%rip), %rdi      # 0x3fd8
movl $0x4d, %esi
callq 0x1050
movq %rax, %rdi
movl $0xa, %esi
callq 0x1050
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::GPIO::InitOutputs(unsigned int)
uint32_t GPIO::InitOutputs(uint32_t outputs) {
  if (gpio_port_ == NULL) {
    fprintf(stderr, "Attempt to init outputs but not yet Init()-ialized.\n");
    return 0;
  }

#ifdef ADAFRUIT_RGBMATRIX_HAT_PWM
  // Hack: the user soldered together GPIO 18 (new OE) with GPIO 4 (old OE).
  // We want to make extra sure that, whatever the outside system set as pinmux,
  // the old OE is not also set as output so that these GPIO outputs don't fight
  // each other.
  // So explicitly set this particular pin as input.
  INP_GPIO(4);
#endif

  outputs &= kValidBits;   // Sanitize input.
  output_bits_ = outputs;
  for (uint32_t b = 0; b <= 27; ++b) {
    if (outputs & (1 << b)) {
      INP_GPIO(b);   // for writing, we first need to set as input.
      OUT_GPIO(b);
    }
  }
  return output_bits_;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x26a2
movq 0xb95b(%rip), %rax      # 0xdfe0
movq (%rax), %rdi
leaq 0x6a03(%rip), %rsi      # 0x9092
movb $0x0, %al
callq 0x2210
movl $0x0, -0x4(%rbp)
jmp 0x2776
movq -0x20(%rbp), %rax
movl -0x14(%rbp), %ecx
andl $0xfffffff, %ecx        # imm = 0xFFFFFFF
movl %ecx, -0x14(%rbp)
movl -0x14(%rbp), %ecx
movl %ecx, (%rax)
movl $0x0, -0x18(%rbp)
cmpl $0x1b, -0x18(%rbp)
ja 0x276d
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x275d
movl -0x18(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movq -0x20(%rbp), %rax
imull $0x3, %edx, %ecx
movl $0x7, %esi
shll %cl, %esi
xorl $-0x1, %esi
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x18(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movq -0x30(%rbp), %rax
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
andl %esi, %edx
movl %edx, (%rax,%rcx,4)
movl -0x18(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movq -0x20(%rbp), %rax
imull $0x3, %edx, %ecx
movl $0x1, %esi
shll %cl, %esi
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x18(%rbp), %eax
movl $0xa, %ecx
xorl %edx, %edx
divl %ecx
movl %eax, %ecx
movq -0x28(%rbp), %rax
movl %ecx, %ecx
movl (%rax,%rcx,4), %edx
orl %esi, %edx
movl %edx, (%rax,%rcx,4)
jmp 0x275f
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x26be
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::GPIO::Init()
bool GPIO::Init() {
  gpio_port_ = mmap_bcm_register(IsRaspberryPi2(), GPIO_REGISTER_OFFSET);
  if (gpio_port_ == NULL) {
    return false;
  }
  gpio_set_bits_ = gpio_port_ + (0x1C / sizeof(uint32_t));
  gpio_clr_bits_ = gpio_port_ + (0x28 / sizeof(uint32_t));
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
callq 0x28d0
movzbl %al, %edi
andl $0x1, %edi
movl $0x200000, %esi         # imm = 0x200000
callq 0x27f0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
cmpq $0x0, 0x8(%rax)
jne 0x27c1
movb $0x0, -0x1(%rbp)
jmp 0x27e1
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rcx
addq $0x1c, %rcx
movq %rcx, 0x10(%rax)
movq 0x8(%rax), %rcx
addq $0x28, %rcx
movq %rcx, 0x18(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::mmap_bcm_register(bool, long)
static uint32_t *mmap_bcm_register(bool isRPi2, off_t register_offset) {
  const off_t base = (isRPi2 ? BCM2709_PERI_BASE : BCM2708_PERI_BASE);

  int mem_fd;
  if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0) {
    perror("can't open /dev/mem: ");
    return NULL;
  }

  uint32_t *result =
    (uint32_t*) mmap(NULL,                  // Any adddress in our space will do
                     REGISTER_BLOCK_SIZE,   // Map length
                     PROT_READ|PROT_WRITE,  // Enable r/w on GPIO registers.
                     MAP_SHARED,
                     mem_fd,                // File to map
                     base + register_offset // Offset to bcm register
                     );
  close(mem_fd);

  if (result == MAP_FAILED) {
    fprintf(stderr, "mmap error %p\n", result);
    return NULL;
  }
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dil, %al
andb $0x1, %al
movb %al, -0x9(%rbp)
movq %rsi, -0x18(%rbp)
movb -0x9(%rbp), %dl
movl $0x20000000, %eax       # imm = 0x20000000
movl $0x3f000000, %ecx       # imm = 0x3F000000
testb $0x1, %dl
cmovnel %ecx, %eax
cltq
movq %rax, -0x20(%rbp)
leaq 0x68a3(%rip), %rdi      # 0x90c7
movl $0x101002, %esi         # imm = 0x101002
movb $0x0, %al
callq 0x2130
movl %eax, -0x24(%rbp)
cmpl $0x0, %eax
jge 0x284e
leaq 0x6891(%rip), %rdi      # 0x90d0
callq 0x2160
movq $0x0, -0x8(%rbp)
jmp 0x28b9
movl -0x24(%rbp), %r8d
movq -0x20(%rbp), %r9
addq -0x18(%rbp), %r9
xorl %eax, %eax
movl %eax, %edi
movl $0x1000, %esi           # imm = 0x1000
movl $0x3, %edx
movl $0x1, %ecx
callq 0x22c0
movq %rax, -0x30(%rbp)
movl -0x24(%rbp), %edi
callq 0x2300
movq $-0x1, %rax
cmpq %rax, -0x30(%rbp)
jne 0x28b1
movq 0xb74e(%rip), %rax      # 0xdfe0
movq (%rax), %rdi
movq -0x30(%rbp), %rdx
leaq 0x6846(%rip), %rsi      # 0x90e6
movb $0x0, %al
callq 0x2210
movq $0x0, -0x8(%rbp)
jmp 0x28b9
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::IsRaspberryPi2()
static bool IsRaspberryPi2() {
  // TODO: there must be a better, more robust way. Can we ask the processor ?
  char buffer[2048];
  const int fd = open("/proc/cmdline", O_RDONLY);
  ssize_t r = read(fd, buffer, sizeof(buffer) - 1); // returns all in one read.
  buffer[r >= 0 ? r : 0] = '\0';
  close(fd);
  const char *mem_size_key;
  uint64_t mem_size = 0;
  if ((mem_size_key = strstr(buffer, "mem_size=")) != NULL
      && (sscanf(mem_size_key + strlen("mem_size="), "%" PRIx64, &mem_size) == 1)
      && (mem_size == 0x3F000000)) {
    return true;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x840, %rsp            # imm = 0x840
leaq 0x6813(%rip), %rdi      # 0x90f5
xorl %esi, %esi
movb $0x0, %al
callq 0x2130
movl %eax, -0x814(%rbp)
movl -0x814(%rbp), %edi
leaq -0x810(%rbp), %rsi
movl $0x7ff, %edx            # imm = 0x7FF
callq 0x2220
movq %rax, -0x820(%rbp)
cmpq $0x0, -0x820(%rbp)
jl 0x2929
movq -0x820(%rbp), %rax
movq %rax, -0x838(%rbp)
jmp 0x2934
xorl %eax, %eax
movq %rax, -0x838(%rbp)
jmp 0x2934
movq -0x838(%rbp), %rax
movb $0x0, -0x810(%rbp,%rax)
movl -0x814(%rbp), %edi
callq 0x2300
movq $0x0, -0x830(%rbp)
leaq -0x810(%rbp), %rdi
leaq 0x679c(%rip), %rsi      # 0x9103
callq 0x2060
movq %rax, -0x828(%rbp)
cmpq $0x0, %rax
je 0x29b1
movq -0x828(%rbp), %rdi
addq $0x9, %rdi
leaq 0x6782(%rip), %rsi      # 0x910d
leaq -0x830(%rbp), %rdx
movb $0x0, %al
callq 0x2190
cmpl $0x1, %eax
jne 0x29b1
cmpq $0x3f000000, -0x830(%rbp) # imm = 0x3F000000
jne 0x29b1
movb $0x1, -0x1(%rbp)
jmp 0x29b5
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x840, %rsp            # imm = 0x840
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::PinPulser::Create(rgb_matrix::GPIO*, unsigned int, std::vector<int, std::allocator<int>> const&)
PinPulser *PinPulser::Create(GPIO *io, uint32_t gpio_mask,
                             const std::vector<int> &nano_wait_spec) {
  // The only implementation so far.
  if (!Timers::Init()) return NULL;
  if (HardwarePinPulser::CanHandle(gpio_mask)) {
    return new HardwarePinPulser(gpio_mask, nano_wait_spec);
  } else {
    return new TimerBasedPinPulser(io, gpio_mask, nano_wait_spec);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
callq 0x2ab0
testb $0x1, %al
jne 0x29f9
movq $0x0, -0x8(%rbp)
jmp 0x2a9b
movl -0x14(%rbp), %edi
callq 0x2b30
testb $0x1, %al
jne 0x2a07
jmp 0x2a4f
movl $0x58, %edi
callq 0x21a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x2b50
jmp 0x2a29
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2a9b
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x58, %esi
callq 0x21b0
jmp 0x2aa5
movl $0x30, %edi
callq 0x21a0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rcx
callq 0x2e40
jmp 0x2a75
movq -0x40(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x2a9b
movq -0x40(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
movl $0x30, %esi
callq 0x21b0
jmp 0x2aa5
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x28(%rbp), %rdi
callq 0x22b0
nop
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::(anonymous namespace)::Timers::Init()
bool Timers::Init() {
  const bool isRPi2 = IsRaspberryPi2();
  uint32_t *timereg = mmap_bcm_register(isRPi2, COUNTER_1Mhz_REGISTER_OFFSET);
  if (timereg == NULL) {
    return false;
  }
  timer1Mhz = timereg + 1;

  busy_sleep_impl = isRPi2 ? sleep_nanos_rpi_2 : sleep_nanos_rpi_1;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
callq 0x28d0
andb $0x1, %al
movb %al, -0x2(%rbp)
movb -0x2(%rbp), %al
movl $0x3000, %esi           # imm = 0x3000
andb $0x1, %al
movzbl %al, %edi
callq 0x27f0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x2ae5
movb $0x0, -0x1(%rbp)
jmp 0x2b23
movq -0x10(%rbp), %rax
addq $0x4, %rax
movq %rax, 0xb6c4(%rip)      # 0xe1b8
testb $0x1, -0x2(%rbp)
je 0x2b07
leaq 0x3bf(%rip), %rax       # 0x2ec0
movq %rax, -0x18(%rbp)
jmp 0x2b14
leaq 0x3f2(%rip), %rax       # 0x2f00
movq %rax, -0x18(%rbp)
jmp 0x2b14
movq -0x18(%rbp), %rax
movq %rax, 0xb681(%rip)      # 0xe1a0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::(anonymous namespace)::sleep_nanos_rpi_1(long)
static void sleep_nanos_rpi_1(long nanos) {
  if (nanos < 70) return;
  // The following loop is determined empirically on a 700Mhz RPi
  for (uint32_t i = (nanos - 70) >> 2; i != 0; --i) {
    asm("nop");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
cmpq $0x46, -0x8(%rbp)
jge 0x2f11
jmp 0x2f32
movq -0x8(%rbp), %rax
subq $0x46, %rax
sarq $0x2, %rax
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x2f32
nop
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x2f20
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::(anonymous namespace)::HardwarePinPulser::InitPWMDivider(unsigned int)
void InitPWMDivider(uint32_t divider) {
    assert(divider < (1<<12));  // we only have 12 bits.

    pwm_reg_[PWM_CTL] = PWM_CTL_USEF1 | PWM_CTL_POLA1 | PWM_CTL_CLRF1;

    // reset PWM clock
    clk_reg_[CLK_PWMCTL] = CLK_PASSWD | CLK_CTL_KILL;

    // set PWM clock source as 500 MHz PLLD
    clk_reg_[CLK_PWMCTL] = CLK_PASSWD | CLK_CTL_SRC(CLK_CTL_SRC_PLLD);

    // set PWM clock divider
    clk_reg_[CLK_PWMDIV] = CLK_PASSWD | CLK_DIV_DIVI(divider) | CLK_DIV_DIVF(0);

    // enable PWM clock
    clk_reg_[CLK_PWMCTL] = CLK_PASSWD | CLK_CTL_ENAB | CLK_CTL_SRC(CLK_CTL_SRC_PLLD);
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpl $0x1000, -0xc(%rbp)     # imm = 0x1000
jae 0x2fd2
jmp 0x2ff1
leaq 0x61ff(%rip), %rdi      # 0x91d8
leaq 0x6141(%rip), %rsi      # 0x9121
movl $0x175, %edx            # imm = 0x175
leaq 0x61fe(%rip), %rcx      # 0x91ea
callq 0x2110
movq -0x18(%rbp), %rax
movq 0x38(%rax), %rcx
movl $0x70, (%rcx)
movq 0x48(%rax), %rcx
movl $0x5a000020, 0xa0(%rcx) # imm = 0x5A000020
movq 0x48(%rax), %rcx
movl $0x5a000006, 0xa0(%rcx) # imm = 0x5A000006
movl -0xc(%rbp), %edx
shll $0xc, %edx
orl $0x5a000000, %edx       # imm = 0x5A000000
orl $0x0, %edx
movq 0x48(%rax), %rcx
movl %edx, 0xa4(%rcx)
movq 0x48(%rax), %rax
movl $0x5a000016, 0xa0(%rax) # imm = 0x5A000016
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::(anonymous namespace)::HardwarePinPulser::WaitPulseFinished()
virtual void WaitPulseFinished() {
    // Determine how long we already spent and sleep to get close to the
    // actual end-time of our sleep period.
    // (substract 25 usec, as this is the OS overhead).
    const uint32_t elapsed_usec = *timer1Mhz - start_time_;
    const int to_sleep = sleep_hint_ - elapsed_usec - 25;
    if (to_sleep > 0) {
      struct timespec sleep_time = { 0, 1000 * to_sleep };
      nanosleep(&sleep_time, NULL);
    }
    while ((pwm_reg_[PWM_STA] & PWM_STA_EMPT1) == 0) {
      // busy wait until done.
    }
    pwm_reg_[PWM_CTL] = PWM_CTL_USEF1 | PWM_CTL_POLA1 | PWM_CTL_CLRF1;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq 0xaf0d(%rip), %rcx      # 0xe1b8
movl (%rcx), %ecx
subl 0x50(%rax), %ecx
movl %ecx, -0xc(%rbp)
movl 0x54(%rax), %eax
subl -0xc(%rbp), %eax
subl $0x19, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jle 0x32e7
movq $0x0, -0x20(%rbp)
imull $0x3e8, -0x10(%rbp), %eax # imm = 0x3E8
cltq
movq %rax, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2090
jmp 0x32e9
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movl 0x4(%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x32fe
jmp 0x32e9
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
movl $0x70, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/gpio.cc
// Function: rgb_matrix::(anonymous namespace)::Timers::sleep_nanos(long)
void Timers::sleep_nanos(long nanos) {
  // For smaller durations, we go straight to busy wait.

  // For larger duration, we use nanosleep() to give the operating system
  // a chance to do something else.
  // However, these timings have a lot of jitter, so we do a two way
  // approach: we use nanosleep(), but for some shorter time period so
  // that we can tolerate some jitter (also, we need at least an offset of
  // 20usec as the nanosleep implementations on RPi actually have such offset).
  //
  // We use the global 1Mhz hardware timer to measure the actual time period
  // that has passed, and then inch forward for the remaining time with
  // busy wait.
  if (nanos > 30000) {
    const uint32_t before = *timer1Mhz;
    struct timespec sleep_time = { 0, nanos - 25000 };
    nanosleep(&sleep_time, NULL);
    const uint32_t after = *timer1Mhz;
    const long nanoseconds_passed = 1000 * (uint32_t)(after - before);
    if (nanoseconds_passed > nanos) {
      return;  // darn, missed it.
    } else {
      nanos -= nanoseconds_passed; // remaining time with busy-loop
    }
  }

  busy_sleep_impl(nanos);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x7530, -0x8(%rbp)     # imm = 0x7530
jle 0x3470
movq 0xadab(%rip), %rax      # 0xe1b8
movl (%rax), %eax
movl %eax, -0xc(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
subq $0x61a8, %rax           # imm = 0x61A8
movq %rax, -0x18(%rbp)
leaq -0x20(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2090
movq 0xad7c(%rip), %rax      # 0xe1b8
movl (%rax), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
subl -0xc(%rbp), %eax
imull $0x3e8, %eax, %eax      # imm = 0x3E8
movl %eax, %eax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
cmpq -0x8(%rbp), %rax
jle 0x345f
jmp 0x347d
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x8(%rbp)
jmp 0x3470
movq 0xad29(%rip), %rax      # 0xe1a0
movq -0x8(%rbp), %rdi
callq *%rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::RGBMatrix(rgb_matrix::GPIO*, int, int, int)
RGBMatrix::RGBMatrix(GPIO *io, int rows, int chained_displays,
                     int parallel_displays)
  : rows_(rows), chained_displays_(chained_displays),
    parallel_displays_(parallel_displays),
    io_(NULL), updater_(NULL) {
  SetTransformer(NULL);
  active_ = CreateFrameCanvas();
  Clear();
  SetGPIO(io);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl %r8d, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x40(%rbp)
callq 0x5ce0
movq -0x40(%rbp), %rdi
leaq 0x89ee(%rip), %rax      # 0xdbd0
movq %rax, (%rdi)
movl -0x14(%rbp), %eax
movl %eax, 0x8(%rdi)
movl -0x18(%rbp), %eax
movl %eax, 0xc(%rdi)
movl -0x1c(%rbp), %eax
movl %eax, 0x10(%rdi)
movq $0x0, 0x20(%rdi)
addq $0x28, %rdi
movq %rdi, -0x38(%rbp)
callq 0x5d00
jmp 0x520e
movq -0x40(%rbp), %rdi
movq $0x0, 0x50(%rdi)
addq $0x58, %rdi
movq %rdi, -0x48(%rbp)
callq 0x5d20
movq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x52b0
jmp 0x5236
movq -0x40(%rbp), %rdi
callq 0x5340
movq %rax, -0x50(%rbp)
jmp 0x5245
movq -0x40(%rbp), %rdi
movq -0x50(%rbp), %rax
movq %rax, 0x18(%rdi)
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
jmp 0x525c
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x54c0
jmp 0x526b
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
jmp 0x529d
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
callq 0x5d40
movq -0x38(%rbp), %rdi
callq 0x5da0
movq -0x40(%rbp), %rdi
callq 0x61c0
movq -0x28(%rbp), %rdi
callq 0x22b0
nop
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::SetTransformer(rgb_matrix::CanvasTransformer*)
void RGBMatrix::SetTransformer(CanvasTransformer *transformer) {
  if (transformer == NULL) {
    static NullTransformer null_transformer;   // global instance sufficient.
    transformer_ = &null_transformer;
  } else {
    transformer_ = transformer;
  }
}

// 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)
cmpq $0x0, -0x10(%rbp)
jne 0x5320
cmpb $0x0, 0x8eea(%rip)      # 0xe1c0
jne 0x530f
leaq 0x8ee1(%rip), %rdi      # 0xe1c0
callq 0x22d0
cmpl $0x0, %eax
je 0x530f
leaq 0x430(%rip), %rdi       # 0x5720
leaq 0x8eb1(%rip), %rsi      # 0xe1a8
leaq 0x8e92(%rip), %rdx      # 0xe190
callq 0x2170
leaq 0x8eb6(%rip), %rdi      # 0xe1c0
callq 0x2100
movq -0x18(%rbp), %rax
leaq 0x8e8e(%rip), %rcx      # 0xe1a8
movq %rcx, 0x70(%rax)
jmp 0x532c
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x70(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::CreateFrameCanvas()
FrameCanvas *RGBMatrix::CreateFrameCanvas() {
  FrameCanvas *result =
    new FrameCanvas(new internal::Framebuffer(rows_, 32 * chained_displays_,
                                              parallel_displays_));
  if (created_frames_.empty()) {
    // First time. Get defaults from initial Framebuffer.
    pwm_bits_ = result->framebuffer()->pwmbits();
    do_luminance_correct_ = result->framebuffer()->luminance_correct();
    brightness_ = result->framebuffer()->brightness();
  } else {
    result->framebuffer()->SetPWMBits(pwm_bits_);
    result->framebuffer()->set_luminance_correct(do_luminance_correct_);
    result->framebuffer()->SetBrightness(brightness_);
  }
  created_frames_.push_back(result);
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movl $0x10, %edi
callq 0x21a0
movq %rax, -0x30(%rbp)
movl $0x28, %edi
callq 0x21a0
movq %rax, -0x28(%rbp)
jmp 0x5372
movq -0x28(%rbp), %rdi
movq -0x38(%rbp), %rax
movl 0x8(%rax), %esi
movl 0xc(%rax), %edx
shll $0x5, %edx
movl 0x10(%rax), %ecx
callq 0x6df0
jmp 0x538d
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdi
callq 0x5f20
jmp 0x539c
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rax
movq %rax, -0x10(%rbp)
addq $0x58, %rdi
callq 0x5f60
testb $0x1, %al
jne 0x53ba
jmp 0x5448
movq -0x10(%rbp), %rdi
callq 0x5e00
movq %rax, %rdi
callq 0x5fa0
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, 0x14(%rax)
movq -0x10(%rbp), %rdi
callq 0x5e00
movq %rax, %rdi
callq 0x5fc0
movb %al, %cl
movq -0x38(%rbp), %rax
andb $0x1, %cl
movb %cl, 0x15(%rax)
movq -0x10(%rbp), %rdi
callq 0x5e00
movq %rax, %rdi
callq 0x5fe0
movb %al, %cl
movq -0x38(%rbp), %rax
movb %cl, 0x16(%rax)
jmp 0x5497
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
jmp 0x5438
movq -0x28(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0x28, %esi
callq 0x21b0
movq -0x30(%rbp), %rdi
movl $0x10, %esi
callq 0x21b0
jmp 0x54b2
movq -0x10(%rbp), %rdi
callq 0x5e00
movq %rax, %rdi
movq -0x38(%rbp), %rax
movzbl 0x14(%rax), %esi
callq 0x7290
movq -0x10(%rbp), %rdi
callq 0x5e00
movq %rax, %rdi
movq -0x38(%rbp), %rax
movb 0x15(%rax), %al
andb $0x1, %al
movzbl %al, %esi
callq 0x6000
movq -0x10(%rbp), %rdi
callq 0x5e00
movq %rax, %rdi
movq -0x38(%rbp), %rax
movzbl 0x16(%rax), %esi
callq 0x6020
movq -0x38(%rbp), %rdi
addq $0x58, %rdi
leaq -0x10(%rbp), %rsi
callq 0x6080
movq -0x10(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
movq -0x18(%rbp), %rdi
callq 0x22b0
nopl (%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::SetGPIO(rgb_matrix::GPIO*)
void RGBMatrix::SetGPIO(GPIO *io) {
  if (io == NULL) return;  // nothing to set.
  if (io_ != NULL) return;  // already set.
  io_ = io;
  internal::Framebuffer::InitGPIO(io_, parallel_displays_);
  updater_ = new UpdateThread(io_, active_);
  // If we have multiple processors, the kernel
  // jumps around between these, creating some global flicker.
  // So let's tie it to the last CPU available.
  // The Raspberry Pi2 has 4 cores, our attempt to bind it to
  //   core #3 will succeed.
  // The Raspberry Pi1 only has one core, so this affinity
  //   call will simply fail and we keep using the only core.
  updater_->Start(99, (1<<3));  // Prio: high. Also: put on last CPU.
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x54e1
jmp 0x554d
movq -0x28(%rbp), %rax
cmpq $0x0, 0x20(%rax)
je 0x54ee
jmp 0x554d
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq 0x20(%rax), %rdi
movl 0x10(%rax), %esi
callq 0x6ff0
movl $0xb8, %edi
callq 0x21a0
movq %rax, %rdi
movq -0x28(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x30(%rbp)
movq 0x18(%rax), %rdx
movq 0x20(%rax), %rsi
callq 0x5e60
jmp 0x552d
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movq %rcx, 0x50(%rax)
movq 0x50(%rax), %rdi
movq (%rdi), %rax
movl $0x63, %esi
movl $0x8, %edx
callq *0x10(%rax)
addq $0x30, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x18(%rbp)
movl %eax, -0x1c(%rbp)
movl $0xb8, %esi
callq 0x21b0
movq -0x18(%rbp), %rdi
callq 0x22b0
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::~RGBMatrix()
RGBMatrix::~RGBMatrix() {
  updater_->Stop();
  updater_->WaitStopped();
  delete updater_;

  // Make sure LEDs are off.
  active_->Clear();
  active_->framebuffer()->DumpToMatrix(io_);

  for (size_t i = 0; i < created_frames_.size(); ++i) {
    delete created_frames_[i];
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0x8635(%rip), %rcx      # 0xdbd0
movq %rcx, (%rax)
movq 0x50(%rax), %rdi
callq 0x5dc0
jmp 0x55a9
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x8310
jmp 0x55b8
movq -0x18(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
je 0x55d4
movq -0x20(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
movq (%rdi), %rax
movq 0x28(%rax), %rax
callq *%rax
jmp 0x55e7
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x5e00
movq %rax, -0x28(%rbp)
jmp 0x55fa
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rsi
callq 0x7c40
jmp 0x560d
movq $0x0, -0x10(%rbp)
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
addq $0x58, %rdi
callq 0x5e20
movq %rax, %rcx
movq -0x30(%rbp), %rax
cmpq %rcx, %rax
jae 0x566e
movq -0x18(%rbp), %rdi
addq $0x58, %rdi
movq -0x10(%rbp), %rsi
callq 0x5e40
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, %rax
je 0x565e
movq -0x38(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x5660
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x5615
movq -0x18(%rbp), %rdi
addq $0x58, %rdi
callq 0x5d40
movq -0x18(%rbp), %rdi
addq $0x28, %rdi
callq 0x5da0
movq -0x18(%rbp), %rdi
callq 0x61c0
addq $0x40, %rsp
popq %rbp
retq
movq %rax, %rdi
callq 0x3e10
nop
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::SetPWMBits(unsigned char)
bool RGBMatrix::SetPWMBits(uint8_t value) {
  const bool success = active_->framebuffer()->SetPWMBits(value);
  if (success) {
    pwm_bits_ = value;
  }
  return success;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq 0x18(%rax), %rdi
callq 0x5e00
movq %rax, %rdi
movzbl -0x9(%rbp), %esi
callq 0x7290
andb $0x1, %al
movb %al, -0xa(%rbp)
testb $0x1, -0xa(%rbp)
je 0x5784
movq -0x18(%rbp), %rax
movb -0x9(%rbp), %cl
movb %cl, 0x14(%rax)
movb -0xa(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nop
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::UpdateThread::SwapOnVSync(rgb_matrix::FrameCanvas*)
FrameCanvas *SwapOnVSync(FrameCanvas *other) {
    MutexLock l(&frame_sync_);
    FrameCanvas *previous = current_frame_;
    next_frame_ = other;
    frame_sync_.WaitOn(&frame_done_);
    return previous;
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rsi
movq %rsi, -0x40(%rbp)
addq $0x50, %rsi
movq %rsi, -0x38(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x6290
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdi
movq 0xa8(%rsi), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq %rax, 0xb0(%rsi)
addq $0x78, %rsi
callq 0x6490
jmp 0x6142
movq -0x20(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x62c0
movq -0x48(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x62c0
movq -0x28(%rbp), %rdi
callq 0x22b0
nopl (%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/led-matrix.cc
// Function: rgb_matrix::RGBMatrix::UpdateThread::Run()
virtual void Run() {
    while (running()) {
#ifdef SHOW_REFRESH_RATE
      struct timeval start, end;
      gettimeofday(&start, NULL);
#endif

      current_frame_->framebuffer()->DumpToMatrix(io_);

      {
        MutexLock l(&frame_sync_);
        if (next_frame_ != NULL) {
          current_frame_ = next_frame_;
          next_frame_ = NULL;
        }
        pthread_cond_signal(&frame_done_);
      }

#ifdef SHOW_REFRESH_RATE
      gettimeofday(&end, NULL);
      int64_t usec = ((uint64_t)end.tv_sec * 1000000 + end.tv_usec)
        - ((int64_t)start.tv_sec * 1000000 + start.tv_usec);
      printf("\b\b\b\b\b\b\b\b%6.1fHz", 1e6 / usec);
#endif
    }
  }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
callq 0x6450
testb $0x1, %al
jne 0x63d3
jmp 0x644a
movq -0x18(%rbp), %rax
movq 0xa8(%rax), %rdi
callq 0x5e00
movq %rax, %rdi
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rsi
callq 0x7c40
movq -0x18(%rbp), %rsi
addq $0x50, %rsi
leaq -0x10(%rbp), %rdi
callq 0x6290
movq -0x18(%rbp), %rax
cmpq $0x0, 0xb0(%rax)
je 0x642f
movq -0x18(%rbp), %rax
movq 0xb0(%rax), %rcx
movq %rcx, 0xa8(%rax)
movq $0x0, 0xb0(%rax)
movq -0x18(%rbp), %rdi
addq $0x78, %rdi
callq 0x2030
leaq -0x10(%rbp), %rdi
callq 0x62c0
jmp 0x63c4
addq $0x20, %rsp
popq %rbp
retq
// File: eggnot[P]pixel_camera/matrix/lib/framebuffer.cc
// Function: rgb_matrix::internal::Framebuffer::Framebuffer(int, int, int)
Framebuffer::Framebuffer(int rows, int columns, int parallel)
  : rows_(rows),
    parallel_(parallel),
    height_(rows * parallel),
    columns_(columns),
    pwm_bits_(kBitPlanes), do_luminance_correct_(true), brightness_(100),
    double_rows_(rows / SUB_PANELS_), row_mask_(double_rows_ - 1) {
  bitplane_buffer_ = new IoBits [double_rows_ * columns_ * kBitPlanes];
  Clear();
  assert(rows_ <= 32);
  assert(parallel >= 1 && parallel <= 3);
#ifdef ONLY_SINGLE_CHAIN
  if (parallel > 1) {
    fprintf(stderr, "ONLY_SINGLE_CHAIN is defined, but parallel > 1 given\n");
    assert(parallel == 1);
  }
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq -0x8(%rbp), %rcx
movq %rcx, -0x48(%rbp)
movl -0xc(%rbp), %eax
movl %eax, (%rcx)
movl -0x14(%rbp), %eax
movl %eax, 0x4(%rcx)
movl -0xc(%rbp), %eax
imull -0x14(%rbp), %eax
movl %eax, 0x8(%rcx)
movl -0x10(%rbp), %eax
movl %eax, 0xc(%rcx)
movb $0xb, 0x10(%rcx)
movb $0x1, 0x11(%rcx)
movb $0x64, 0x12(%rcx)
movl -0xc(%rbp), %eax
movl $0x2, %esi
cltd
idivl %esi
movl %eax, 0x14(%rcx)
movl 0x14(%rcx), %eax
subl $0x1, %eax
movb %al, 0x18(%rcx)
movl 0x14(%rcx), %eax
imull 0xc(%rcx), %eax
imull $0xb, %eax, %eax
cltq
movq %rax, -0x38(%rbp)
movl $0x4, %ecx
mulq %rcx
movq %rax, %rdi
seto %cl
movq $-0x1, %rax
testb $0x1, %cl
cmovneq %rax, %rdi
movq %rdi, -0x40(%rbp)
callq 0x2040
movq %rax, %rcx
movq -0x38(%rbp), %rax
movq %rcx, -0x30(%rbp)
cmpq $0x0, %rax
je 0x6ecf
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rdx
shlq $0x2, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x58(%rbp)
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq %rdi, -0x60(%rbp)
callq 0x80f0
jmp 0x6eba
movq -0x58(%rbp), %rcx
movq -0x60(%rbp), %rax
addq $0x4, %rax
cmpq %rcx, %rax
movq %rax, -0x50(%rbp)
jne 0x6eab
movq -0x48(%rbp), %rdi
movq -0x30(%rbp), %rax
movq %rax, 0x20(%rdi)
callq 0x6f80
movq -0x48(%rbp), %rax
cmpl $0x20, (%rax)
jg 0x6eeb
jmp 0x6f25
leaq 0x244e(%rip), %rdi      # 0x9340
leaq 0x2453(%rip), %rsi      # 0x934c
movl $0x46, %edx
leaq 0x2456(%rip), %rcx      # 0x935b
callq 0x2110
movq -0x40(%rbp), %rsi
movq -0x30(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0x22f0
jmp 0x6f6a
xorl %eax, %eax
cmpl $0x1, -0x14(%rbp)
movb %al, -0x61(%rbp)
jl 0x6f3a
cmpl $0x3, -0x14(%rbp)
setle %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x6f43
jmp 0x6f45
jmp 0x6f64
leaq 0x244d(%rip), %rdi      # 0x9399
leaq 0x23f9(%rip), %rsi      # 0x934c
movl $0x47, %edx
leaq 0x23fc(%rip), %rcx      # 0x935b
callq 0x2110
addq $0x70, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x22b0
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/framebuffer.cc
// Function: rgb_matrix::internal::Framebuffer::Clear()
void Framebuffer::Clear() {
#ifdef INVERSE_RGB_DISPLAY_COLORS
  Fill(0, 0, 0);
#else
  memset(bitplane_buffer_, 0,
         sizeof(*bitplane_buffer_) * double_rows_ * columns_ * kBitPlanes);
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rcx
movq 0x20(%rcx), %rdi
movslq 0x14(%rcx), %rax
shlq $0x2, %rax
movslq 0xc(%rcx), %rcx
imulq %rcx, %rax
imulq $0xb, %rax, %rdx
xorl %esi, %esi
callq 0x20e0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/framebuffer.cc
// Function: rgb_matrix::internal::Framebuffer::SetPWMBits(unsigned char)
bool Framebuffer::SetPWMBits(uint8_t value) {
  if (value < 1 || value > kBitPlanes)
    return false;
  pwm_bits_ = value;
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x1, %eax
jl 0x72b8
movzbl -0x11(%rbp), %eax
cmpl $0xb, %eax
jle 0x72be
movb $0x0, -0x1(%rbp)
jmp 0x72cc
movq -0x20(%rbp), %rax
movb -0x11(%rbp), %cl
movb %cl, 0x10(%rax)
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: eggnot[P]pixel_camera/matrix/lib/framebuffer.cc
// Function: rgb_matrix::internal::CreateLuminanceCIE1931LookupTable()
static uint16_t *CreateLuminanceCIE1931LookupTable() {
  uint16_t *result = new uint16_t[256 * 100];
  for (int i = 0; i < 256; ++i)
    for (int j = 0; j < 100; ++j)
      result[i * 100 + j] = luminance_cie1931(i, j + 1);

  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0xc800, %edi           # imm = 0xC800
callq 0x2040
movq %rax, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
cmpl $0x100, -0xc(%rbp)      # imm = 0x100
jge 0x8016
movl $0x0, -0x10(%rbp)
cmpl $0x64, -0x10(%rbp)
jge 0x8009
movl -0xc(%rbp), %eax
movb %al, %cl
movl -0x10(%rbp), %eax
addl $0x1, %eax
movzbl %cl, %edi
movzbl %al, %esi
callq 0x8020
movw %ax, %dx
movq -0x8(%rbp), %rax
imull $0x64, -0xc(%rbp), %ecx
addl -0x10(%rbp), %ecx
movslq %ecx, %rcx
movw %dx, (%rax,%rcx,2)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x7fcd
jmp 0x800b
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7fbd
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
// File: eggnot[P]pixel_camera/matrix/lib/framebuffer.cc
// Function: rgb_matrix::internal::Framebuffer::MapColor(unsigned char)
inline uint16_t Framebuffer::MapColor(uint8_t c) {
#ifdef INVERSE_RGB_DISPLAY_COLORS
#  define COLOR_OUT_BITS(x) (x) ^ 0xffff
#else
#  define COLOR_OUT_BITS(x) (x)
#endif

  if (do_luminance_correct_) {
    static uint16_t *luminance_lookup = CreateLuminanceCIE1931LookupTable();
    return COLOR_OUT_BITS(luminance_lookup[c * 100 + (brightness_ - 1)]);
  } else {
    // simple scale down the color value
    c = c * brightness_ / 100;

    enum {shift = kBitPlanes - 8};  //constexpr; shift to be left aligned.
    return COLOR_OUT_BITS((shift > 0) ? (c << shift) : (c >> -shift));
  }

#undef COLOR_OUT_BITS
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
testb $0x1, 0x11(%rax)
je 0x81ae
cmpb $0x0, 0x60a1(%rip)      # 0xe1d8
jne 0x816c
leaq 0x6098(%rip), %rdi      # 0xe1d8
callq 0x22d0
cmpl $0x0, %eax
je 0x816c
callq 0x7fa0
movq %rax, -0x38(%rbp)
jmp 0x8155
movq -0x38(%rbp), %rax
movq %rax, 0x6070(%rip)      # 0xe1d0
leaq 0x6071(%rip), %rdi      # 0xe1d8
callq 0x2100
movq -0x30(%rbp), %rdx
movq 0x6059(%rip), %rax      # 0xe1d0
movzbl -0x11(%rbp), %ecx
imull $0x64, %ecx, %ecx
movzbl 0x12(%rdx), %edx
subl $0x1, %edx
addl %edx, %ecx
movslq %ecx, %rcx
movw (%rax,%rcx,2), %ax
movw %ax, -0x2(%rbp)
jmp 0x81d3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq 0x6031(%rip), %rdi      # 0xe1d8
callq 0x20f0
jmp 0x81dd
movq -0x30(%rbp), %rcx
movzbl -0x11(%rbp), %eax
movzbl 0x12(%rcx), %ecx
imull %ecx, %eax
movl $0x64, %ecx
cltd
idivl %ecx
movb %al, -0x11(%rbp)
movzbl -0x11(%rbp), %eax
shll $0x3, %eax
movw %ax, -0x2(%rbp)
movw -0x2(%rbp), %ax
addq $0x40, %rsp
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0x22b0
nopw %cs:(%rax,%rax)