LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./point.cc
// Function: point::transform(xform&)
inline void point::transform ( xform &m ) {
  int i, n;
  float t[4];

  assert( nc < 5 );
  for( n = 0; n < nc; n++ )
    t[n] = c[n];
  while( n < 3 )
    t[n++] = 0;
  if( n < 4 )
    t[n++] = 1;
  for( i = 0; i < nc; i++ )
    c[i] = m.rowmult( i, t );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl 0x8(%rdi), %eax
cmpl $0x4, %eax
jg 0x2c04
movq %rsi, %rbx
movq %rdi, %r14
xorl %edx, %edx
testl %eax, %eax
movl $0x0, %ecx
cmovgl %eax, %ecx
cmpq %rdx, %rcx
je 0x2bb8
movss 0xc(%r14,%rdx,4), %xmm0
movss %xmm0, (%rsp,%rdx,4)
incq %rdx
jmp 0x2b9b
andl $0x0, (%rsp,%rcx,4)
incq %rcx
cmpq $0x2, %rcx
jbe 0x2bb1
cmpq $0x3, %rcx
jne 0x2bcc
movl $0x3f800000, 0xc(%rsp)  # imm = 0x3F800000
xorl %r15d, %r15d
movq %rsp, %r12
cltq
cmpq %rax, %r15
jge 0x2bf8
movq (%rbx), %rax
movq %rbx, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq *0x20(%rax)
movss %xmm0, 0xc(%r14,%r15,4)
incq %r15
movl 0x8(%r14), %eax
jmp 0x2bd2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x350c(%rip), %rdi      # 0x6117
leaq 0x3484(%rip), %rsi      # 0x6096
leaq 0x3505(%rip), %rcx      # 0x611e
movl $0x92, %edx
callq 0x2070
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./point.cc
// Function: point::vproduct(point)
inline point point::vproduct( point p ) {
  int i;
  point r(nc);

  assert( nc == p.nc );
  for( i = 0; i < nc; i++ )
    r.c[i] = c[i] * p.c[i];
  return r;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
movl 0x8(%rsi), %esi
callq 0x2ee8
movl 0x8(%r15), %eax
cmpl 0x8(%rbx), %eax
jne 0x2d27
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
cmpq %rcx, %rax
je 0x2d1e
movss 0xc(%r15,%rcx,4), %xmm0
mulss 0xc(%rbx,%rcx,4), %xmm0
movss %xmm0, 0xc(%r14,%rcx,4)
incq %rcx
jmp 0x2d00
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x3392(%rip), %rdi      # 0x60c0
leaq 0x3361(%rip), %rsi      # 0x6096
leaq 0x346a(%rip), %rcx      # 0x61a6
movl $0xb2, %edx
callq 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./point.cc
// Function: point::mag2()
inline float point::mag2( void ) {
  int i;
  float r;

  r = 0.0;
  for( i = 0; i < nc ; i++ )
    r += c[i] * c[i];
  return r;
}

// Assembly:
movl 0x8(%rdi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
xorps %xmm0, %xmm0
cmpq %rcx, %rax
je 0x2d89
movss 0xc(%rdi,%rcx,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %rcx
jmp 0x2d71
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./point.cc
// Function: point::dilation(float)
inline point point::dilation( float n ) {
  int i;
  point r(nc + 1);

  for( i = 0; i < nc; i++ )
    r.c[i] = c[i];
  r.c[nc] = n;
  return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %esi
incl %esi
callq 0x2ee8
movslq 0x8(%r14), %rax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
cmpq %rcx, %rdx
je 0x2e89
movss 0xc(%r14,%rcx,4), %xmm0
movss %xmm0, 0xc(%rbx,%rcx,4)
incq %rcx
jmp 0x2e72
movss 0x4(%rsp), %xmm0
movss %xmm0, 0xc(%rbx,%rax,4)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./point.cc
// Function: point::contraction()
inline point point::contraction( void ) {
  int i;
  point r( nc - 1 );

  for( i = 0; i < nc - 1; i++ )
    r.c[i] = c[i];
  return r;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rsi), %esi
decl %esi
callq 0x2ee8
movslq 0x8(%r14), %rax
decq %rax
xorl %ecx, %ecx
cmpq %rax, %rcx
jge 0x2ed4
movss 0xc(%r14,%rcx,4), %xmm0
movss %xmm0, 0xc(%rbx,%rcx,4)
incq %rcx
jmp 0x2ebd
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./model.cc
// Function: model::model(point&, light&, object&, point&)
inline model::model( point &p, light &l, object &o, point &p2 ) :
 eye( p ), thelight( l ), scene( o ), bg( p2 ) {
  object *op;

  maxdepth = 10;
  for( op = &scene; op; op = op->next() )
    op->tune_texture( *this );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdi, %rbx
movq %rsi, (%rdi)
movq %rdx, 0x8(%rdi)
movq %rcx, 0x10(%rdi)
movq %r8, 0x18(%rdi)
movl $0xa, 0x20(%rdi)
testq %r14, %r14
je 0x2f8e
movq (%r14), %rax
movq %r14, %rdi
movq %rbx, %rsi
callq *(%rax)
movq (%r14), %rax
movq %r14, %rdi
callq *0x30(%rax)
movq %rax, %r14
jmp 0x2f70
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::intersect(ray, intersection&)
int poly::intersect( ray r, intersection &s ) {
  float b, t;
  
  r.transform( toi );
  
  // now we have the ray in object coords...
  point rd( r.d() );
  point ro( r.o() );
  
  b = Z( rd );
  if( fabs( b ) < TINY ) {
    // ray is parallel to plane, so no hit
    return 0;
  }
  t = -Z( ro ) / b;
  if( t < TINY ) {
    // ray is behind plane, so no hit
    return 0;
  }
  point i( ro + (rd * t) );
#if DEBUGLEVEL > 0
  assert( fabs( Z(i) ) < TINY );
#endif  
  if( !contains( i ) ) {
    // ray is outside poly
    return 0;
  }
#if DEBUGLEVEL > 0
  assert( cnormal );
#endif
  s.normal = new point( *cnormal );
  s.at = new point( X(i), Y(i) );
  s.t = t;

  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
leaq 0xc0(%rdi), %rsi
movq %r15, %rdi
callq 0x4384
leaq 0x28(%r15), %rsi
leaq 0x60(%rsp), %r12
movq %r12, %rdi
callq 0x2808
addq $0x8, %r15
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
callq 0x2808
movq %r12, %rdi
callq 0x3797
movaps 0x2f8a(%rip), %xmm1     # 0x62a0
andps %xmm0, %xmm1
cvtss2sd %xmm1, %xmm1
xorl %ebp, %ebp
movsd 0x2d39(%rip), %xmm2     # 0x6060
ucomisd %xmm1, %xmm2
ja 0x3421
leaq 0x40(%rsp), %rdi
movaps %xmm0, 0x10(%rsp)
callq 0x3797
xorps 0x2cf9(%rip), %xmm0     # 0x6040
divss 0x10(%rsp), %xmm0
cvtss2sd %xmm0, %xmm1
movsd 0x2d07(%rip), %xmm2     # 0x6060
ucomisd %xmm1, %xmm2
ja 0x3421
leaq 0x80(%rsp), %r15
leaq 0x60(%rsp), %rsi
movq %r15, %rdi
movaps %xmm0, 0x10(%rsp)
callq 0x2b4c
leaq 0x20(%rsp), %r12
leaq 0x40(%rsp), %rsi
movq %r12, %rdi
movq %r15, %rdx
callq 0x2a5c
movq (%r14), %rax
movq %r14, %rdi
movq %r12, %rsi
callq *0x58(%rax)
testl %eax, %eax
je 0x341f
pushq $0x20
popq %r15
movq %r15, %rdi
callq 0x20d0
movq %rax, %r12
movq 0x158(%r14), %rsi
movq %rax, %rdi
callq 0x2808
movq %r12, 0x8(%rbx)
movq %r15, %rdi
callq 0x20d0
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x3713
movss %xmm0, 0xc(%rsp)
leaq 0x20(%rsp), %rdi
callq 0x3754
leaq 0x6458(%rip), %rax      # 0x9848
movq %rax, (%r14)
movl $0x2, 0x8(%r14)
movss 0xc(%rsp), %xmm1
movss %xmm1, 0xc(%r14)
movss %xmm0, 0x10(%r14)
movq %r14, 0x10(%rbx)
movaps 0x10(%rsp), %xmm0
movss %xmm0, (%rbx)
pushq $0x1
popq %rbp
jmp 0x3421
xorl %ebp, %ebp
movl %ebp, %eax
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
pushq $0x20
popq %rsi
movq %r14, %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::poly(int, texture*)
poly::poly( int n, texture *t )
 : object( t ), to( XFORM_IDENTITY ), toi( XFORM_IDENTITY ) {
  int i;
  typedef point *pp;

  np = n;
  dp = 0;
  p = new pp[ np ];
  for( i = 0; i < np; i++ )
    p[i] = 0;
  cnormal = 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %r14d
movq %rdi, %rbx
movq %rdx, %rsi
callq 0x4358
leaq 0x6534(%rip), %rax      # 0x9998
movq %rax, (%rbx)
leaq 0x28(%rbx), %rdi
xorl %r15d, %r15d
xorl %esi, %esi
callq 0x3cc0
leaq 0xc0(%rbx), %rdi
xorl %esi, %esi
callq 0x3cc0
movl %r14d, 0x18(%rbx)
andl $0x0, 0x1c(%rbx)
movl %r14d, %eax
shlq $0x3, %rax
testl %r14d, %r14d
pushq $-0x1
popq %rdi
cmovnsq %rax, %rdi
cmovlel %r15d, %r14d
callq 0x2030
movq %rax, 0x20(%rbx)
cmpq %r15, %r14
je 0x34bc
movq 0x20(%rbx), %rax
andq $0x0, (%rax,%r15,8)
incq %r15
jmp 0x34a9
andq $0x0, 0x158(%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::poly(poly const&)
poly::poly( const poly &q ) : object( q.ot ), to( q.to ), toi( q.toi ) {
  int i;
  typedef point *pp;

  np = q.np;
  dp = q.dp;
  p = new pp[ np ];
  for( i = 0; i < np; i++ )
    if( q.p[i] )
      p[i] = new point( *q.p[i] );
    else
      p[i] = 0;
  cnormal = 0;
  if( q.cnormal )
    cnormal = new point( *q.cnormal );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rsi
callq 0x4358
leaq 0x64ad(%rip), %rax      # 0x9998
movq %rax, (%rbx)
leaq 0x28(%rbx), %rdi
leaq 0x28(%r14), %rsi
callq 0x4162
movl $0xc0, %esi
leaq (%rbx,%rsi), %rdi
addq %r14, %rsi
callq 0x4162
movq 0x18(%r14), %r12
movq %r12, 0x18(%rbx)
movslq %r12d, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
xorl %r13d, %r13d
pushq $0x20
popq %r15
movslq %r12d, %rax
cmpq %rax, %r13
jge 0x3580
movq 0x20(%r14), %rbp
cmpq $0x0, (%rbp,%r13,8)
je 0x3572
movq %r15, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rbp,%r13,8), %rsi
movq %rax, %rdi
callq 0x2808
movq 0x20(%rbx), %rax
movq %r12, (%rax,%r13,8)
movl 0x18(%rbx), %r12d
jmp 0x357b
movq 0x20(%rbx), %rax
andq $0x0, (%rax,%r13,8)
incq %r13
jmp 0x3538
andq $0x0, 0x158(%rbx)
movq 0x158(%r14), %r14
testq %r14, %r14
je 0x35b1
pushq $0x20
popq %rdi
callq 0x20d0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2808
movq %r15, 0x158(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::operator=(poly const&)
void poly::operator= ( const poly &q ) {
  int i;
  typedef point *pp;

  // out with the old
  for( i = 0; i < np; i++ )
    if( p[i] )
      delete p[i];
  delete p;
  if( cnormal )
    delete cnormal;
  // in with the new
  np = q.np;
  dp = q.dp;
  p = new pp[ np ];
  for( i = 0; i < np; i++ )
    if( q.p[i] )
      p[i] = new point( *q.p[i] );
    else
      p[i] = 0;
  cnormal = 0;
  if( q.cnormal )
    cnormal = new point( *q.cnormal );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
xorl %r15d, %r15d
movslq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r15
jge 0x35f5
movq (%rdi,%r15,8), %rdi
testq %rdi, %rdi
je 0x35f0
movq (%rdi), %rax
callq *0x18(%rax)
incq %r15
jmp 0x35d4
pushq $0x8
popq %rsi
callq 0x20e0
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
je 0x360f
movq (%rdi), %rax
callq *0x18(%rax)
movq 0x18(%r14), %r12
movq %r12, 0x18(%rbx)
movslq %r12d, %rax
leaq (,%rax,8), %rcx
testl %eax, %eax
pushq $-0x1
popq %rdi
cmovnsq %rcx, %rdi
callq 0x2030
movq %rax, 0x20(%rbx)
xorl %r13d, %r13d
pushq $0x20
popq %r15
movslq %r12d, %rax
cmpq %rax, %r13
jge 0x3683
movq 0x20(%r14), %rbp
cmpq $0x0, (%rbp,%r13,8)
je 0x3675
movq %r15, %rdi
callq 0x20d0
movq %rax, %r12
movq (%rbp,%r13,8), %rsi
movq %rax, %rdi
callq 0x2808
movq 0x20(%rbx), %rax
movq %r12, (%rax,%r13,8)
movl 0x18(%rbx), %r12d
jmp 0x367e
movq 0x20(%rbx), %rax
andq $0x0, (%rax,%r13,8)
incq %r13
jmp 0x363b
andq $0x0, 0x158(%rbx)
movq 0x158(%r14), %r14
testq %r14, %r14
je 0x36b4
pushq $0x20
popq %rdi
callq 0x20d0
movq %rax, %r15
movq %rax, %rdi
movq %r14, %rsi
callq 0x2808
movq %r15, 0x158(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::complete()
void poly::complete( void ) {
  int i;

  for( i = 0; i < np; i++ )
    assert( p[i] );
  cnormal = inormal();
#if DEBUGLEVEL > 2
  printf( "new poly: %d\n", np );
  for( i = 0; i < np; i++ ) {
    point q( *p[i] );

    q.dilate( 0 );
    q.transform( to );
    printf( "\t%f %f %f\n", q[0], q[1], q[2] );
  }
#endif
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movslq 0x18(%rdi), %rax
movq 0x20(%rdi), %rcx
xorl %edx, %edx
cmpq %rax, %rdx
jge 0x3701
cmpq $0x0, (%rcx,%rdx,8)
leaq 0x1(%rdx), %rdx
jne 0x36d2
leaq 0x2bc7(%rip), %rdi      # 0x62b0
leaq 0x2bc5(%rip), %rsi      # 0x62b5
leaq 0x2bc6(%rip), %rcx      # 0x62bd
movl $0xb0, %edx
callq 0x2070
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x60(%rax)
movq %rax, 0x158(%rbx)
popq %rbx
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::~poly()
inline poly::~poly() {
  int i;

  if( np ) {
    for( i = 0; i < np; i++ )
      if( p[i] )
        delete p[i];
    delete p;
  }
  if( cnormal )
    delete( cnormal );
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x61b0(%rip), %rax      # 0x9998
movq %rax, (%rdi)
movl 0x18(%rdi), %eax
testl %eax, %eax
je 0x3820
xorl %r14d, %r14d
movslq %eax, %rcx
movq 0x20(%rbx), %rdi
cmpq %rcx, %r14
jge 0x3818
movq (%rdi,%r14,8), %rdi
testq %rdi, %rdi
je 0x3813
movq (%rdi), %rax
callq *0x18(%rax)
movl 0x18(%rbx), %eax
incq %r14
jmp 0x37f5
pushq $0x8
popq %rsi
callq 0x20e0
movq 0x158(%rbx), %rdi
testq %rdi, %rdi
je 0x3839
movq (%rdi), %rax
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *0x18(%rax)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::set(int, point&)
inline poly & poly::set( int i, point & f ) {
  point **p = ref(i);

  assert( !(*p) );
  if( dp )
    assert( dp == f.d() );
  else
    dp = f.d();
  *p = new point( f );
  return (*this);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %r14
movq %rdi, %rbx
movq (%rdi), %rax
callq *0x48(%rax)
cmpq $0x0, (%rax)
jne 0x3a69
movq %rax, %r15
movl 0x1c(%rbx), %ebp
movq (%r14), %rax
movq %r14, %rdi
callq *0xe8(%rax)
testl %ebp, %ebp
je 0x3a41
cmpl %eax, %ebp
je 0x3a44
leaq 0x29b1(%rip), %rdi      # 0x63da
leaq 0x2885(%rip), %rsi      # 0x62b5
leaq 0x297d(%rip), %rcx      # 0x63b4
movl $0xe0, %edx
callq 0x2070
movl %eax, 0x1c(%rbx)
pushq $0x20
popq %rdi
callq 0x20d0
movq %rax, %r12
movq %rax, %rdi
movq %r14, %rsi
callq 0x2808
movq %r12, (%r15)
movq %rbx, %rax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x293e(%rip), %rdi      # 0x63ae
leaq 0x283e(%rip), %rsi      # 0x62b5
leaq 0x2936(%rip), %rcx      # 0x63b4
movl $0xde, %edx
callq 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::dilate(float)
inline void poly::dilate( float n ) {
  int i;

  for( i = 0; i < np; i++ )
    if( p[i] )
      p[i]->dilate( n );
  dp++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x18(%rbx), %rax
cmpq %rax, %r14
jge 0x3ad4
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x3acf
movq (%rdi), %rax
movss 0x4(%rsp), %xmm0
callq *0xd0(%rax)
incq %r14
jmp 0x3aaa
incl 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/poly.cc
// Function: poly::contract()
inline void poly::contract( void ) {
  int i;

  for( i = 0; i < np; i++ )
    if( p[i] )
      p[i]->contract();
  dp--;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
movslq 0x18(%rbx), %rax
cmpq %rax, %r14
jge 0x3b0e
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
testq %rdi, %rdi
je 0x3b09
movq (%rdi), %rax
callq *0xe0(%rax)
incq %r14
jmp 0x3aea
decl 0x1c(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./xform.cc
// Function: xform::operator*=(xform)
inline void xform::operator*= ( xform n ) {
  int i, j, k;
  xform l(*this);

  for( i = 0; i < 4; i++ )
    for( j = 0; j < 4; j++ ) {
      (*m)[i][j] = (*n.m)[i][0] * (*l.m)[0][j];
      for( k = 1; k < 4; k++ )
        (*m)[i][j] += (*n.m)[i][k] * (*l.m)[k][j];
    }
  for( i = 0; i < 4; i++ )
    for( j = 0; j < 4; j++ ) {
      (*mi)[i][j] = (*l.mi)[i][0] * (*n.mi)[0][j];
      for( k = 1; k < 4; k++ )
        (*mi)[i][j] += (*l.mi)[i][k] * (*n.mi)[k][j];
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x4162
movq 0x8(%r14), %rax
movq 0x8(%r15), %rcx
movq 0x8(%rbx), %rdx
xorl %esi, %esi
pushq $0x4
popq %rdi
movq %rax, %r8
cmpq $0x4, %rsi
je 0x3bc0
movq %rsi, %r9
shlq $0x4, %r9
leaq (%rax,%r9), %r10
addq %rdx, %r9
movq %rcx, %r11
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x3bb7
movss (%r10), %xmm0
mulss (%rcx,%r15,4), %xmm0
leaq (%r9,%r15,4), %r12
movss %xmm0, (%r12)
movq %rdi, %r13
cmpq $0x10, %r13
je 0x3bae
movss (%r8,%r13), %xmm1
mulss (%r11,%r13,4), %xmm1
addss %xmm1, %xmm0
movss %xmm0, (%r12)
addq $0x4, %r13
jmp 0x3b8c
incq %r15
addq $0x4, %r11
jmp 0x3b6e
incq %rsi
addq $0x10, %r8
jmp 0x3b54
movq 0x18(%rsp), %rax
movq 0x10(%r14), %rcx
movq 0x10(%rbx), %rdx
xorl %esi, %esi
pushq $0x4
popq %rdi
movq %rax, %r8
cmpq $0x4, %rsi
je 0x3c3d
movq %rsi, %r9
shlq $0x4, %r9
leaq (%rax,%r9), %r10
addq %rdx, %r9
movq %rcx, %r11
xorl %ebx, %ebx
cmpq $0x4, %rbx
je 0x3c34
movss (%r10), %xmm0
mulss (%rcx,%rbx,4), %xmm0
leaq (%r9,%rbx,4), %r14
movss %xmm0, (%r14)
movq %rdi, %r15
cmpq $0x10, %r15
je 0x3c2b
movss (%r8,%r15), %xmm1
mulss (%r11,%r15,4), %xmm1
addss %xmm1, %xmm0
movss %xmm0, (%r14)
addq $0x4, %r15
jmp 0x3c0a
incq %rbx
addq $0x4, %r11
jmp 0x3bee
incq %rsi
addq $0x10, %r8
jmp 0x3bd5
addq $0xa0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/./xform.cc
// Function: xform::operator=(xform const&)
inline void xform::operator=( const xform &t ) {
  int i, j;

  m = &mv;
  mi = &miv;
  for( i = 0; i < 4; i++ )
    for( j = 0; j < 4; j++ ) {
      (*m)[i][j] = (*t.m)[i][j];
      (*mi)[i][j] = (*t.mi)[i][j];
    }
}

// Assembly:
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
leaq 0x58(%rdi), %rax
movq %rax, 0x10(%rdi)
movq 0x8(%rsi), %rcx
movq 0x10(%rsi), %rdx
xorl %esi, %esi
cmpq $0x4, %rsi
je 0x3cbf
xorl %edi, %edi
cmpq $0x4, %rdi
je 0x3cae
movss (%rcx,%rdi,4), %xmm0
movss %xmm0, -0x40(%rax,%rdi,4)
movss (%rdx,%rdi,4), %xmm0
movss %xmm0, (%rax,%rdi,4)
incq %rdi
jmp 0x3c8e
incq %rsi
addq $0x10, %rcx
addq $0x10, %rax
addq $0x10, %rdx
jmp 0x3c86
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/xform.cc
// Function: xform::xform(xform_types)
xform::xform( enum xform_types t ) {
  int i, j;

  assert( t == XFORM_IDENTITY );
  m = &mv;
  mi = &miv;
  for( i = 0; i < 4; i++ )
    for( j = 0; j < 4; j++ ) {
      (*m)[i][j] = (i == j);
      (*mi)[i][j] = (i == j);
    }
}

// Assembly:
pushq %rax
leaq 0x5d98(%rip), %rax      # 0x9a60
movq %rax, (%rdi)
testl %esi, %esi
jne 0x3d1d
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
leaq 0x58(%rdi), %rax
movq %rax, 0x10(%rdi)
xorl %ecx, %ecx
movss 0x231b(%rip), %xmm0     # 0x6004
cmpq $0x4, %rcx
je 0x3d1b
xorl %edx, %edx
cmpq $0x4, %rdx
je 0x3d12
movaps %xmm0, %xmm1
cmpq %rdx, %rcx
je 0x3d02
xorps %xmm1, %xmm1
movss %xmm1, -0x40(%rax,%rdx,4)
movss %xmm1, (%rax,%rdx,4)
incq %rdx
jmp 0x3cf1
incq %rcx
addq $0x10, %rax
jmp 0x3ce9
popq %rax
retq
leaq 0x26dc(%rip), %rdi      # 0x6400
leaq 0x26e9(%rip), %rsi      # 0x6414
leaq 0x26eb(%rip), %rcx      # 0x641d
pushq $0xe
popq %rdx
callq 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/xform.cc
// Function: xform::xform(xform const&)
xform::xform( const xform &t ) {
  int i, j;

  m = &mv;
  mi = &miv;
  for( i = 0; i < 4; i++ )
    for( j = 0; j < 4; j++ ) {
      (*m)[i][j] = (*t.m)[i][j];
      (*mi)[i][j] = (*t.mi)[i][j];
    }
}

// Assembly:
leaq 0x58f7(%rip), %rax      # 0x9a60
movq %rax, (%rdi)
leaq 0x18(%rdi), %rax
movq %rax, 0x8(%rdi)
leaq 0x58(%rdi), %rax
movq %rax, 0x10(%rdi)
movq 0x8(%rsi), %rcx
movq 0x10(%rsi), %rdx
xorl %esi, %esi
cmpq $0x4, %rsi
je 0x41bf
xorl %edi, %edi
cmpq $0x4, %rdi
je 0x41ae
movss (%rcx,%rdi,4), %xmm0
movss %xmm0, -0x40(%rax,%rdi,4)
movss (%rdx,%rdi,4), %xmm0
movss %xmm0, (%rax,%rdi,4)
incq %rdi
jmp 0x418e
incq %rsi
addq $0x10, %rcx
addq $0x10, %rax
addq $0x10, %rdx
jmp 0x4186
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/xform.cc
// Function: xform::row(int)
inline point xform::row( int i ) {
  int k;
  point p(4);

  for( k = 0; k < 4; k++ )
    p.set( k, (*m)[i][k] );
  return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x5653(%rip), %rax      # 0x9848
movq %rax, (%rdi)
movl $0x4, 0x8(%rdi)
movslq %edx, %r12
shlq $0x4, %r12
xorl %r15d, %r15d
cmpq $0x4, %r15
je 0x423c
movq 0x8(%r14), %rax
addq %r12, %rax
movss (%rax,%r15,4), %xmm0
movss %xmm0, 0x4(%rsp)
movq (%rbx), %rax
movq %rbx, %rdi
movl %r15d, %esi
callq *(%rax)
movss 0x4(%rsp), %xmm0
movss %xmm0, (%rax)
incq %r15
jmp 0x4209
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/xform.cc
// Function: xform::col(int)
inline point xform::col( int j ) {
  int i;
  point p(4);

  for( i = 0; i < 4; i++ )
    p.set( j, (*m)[i][j] );
  return p;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x10, %rsp
movl %edx, %ebx
movq %rsi, %r15
movq %rdi, %r14
leaq 0x559e(%rip), %rax      # 0x9848
movq %rax, (%rdi)
movl $0x4, 0x8(%rdi)
movslq %edx, %r12
shlq $0x2, %r12
xorl %r13d, %r13d
cmpq $0x40, %r13
je 0x42f2
movq 0x8(%r15), %rax
addq %r12, %rax
movss (%r13,%rax), %xmm0
movss %xmm0, 0xc(%rsp)
movq (%r14), %rax
movq %r14, %rdi
movl %ebx, %esi
callq *(%rax)
movss 0xc(%rsp), %xmm0
movss %xmm0, (%rax)
addq $0x10, %r13
jmp 0x42be
movq %r14, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/ray.cc
// Function: ray::transform(xform&)
void ray::transform( xform &t ) {
  point dorg(0.0,0.0,0.0);

  ro.transform( t );
  dorg.transform( t );
  rd.transform( t );
  rd -= dorg;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x40, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x54ae(%rip), %rax      # 0x9848
leaq 0x20(%rsp), %r15
movq %rax, (%r15)
movl $0x3, 0x8(%r15)
andq $0x0, 0xc(%r15)
andl $0x0, 0x14(%r15)
addq $0x8, %rdi
callq 0x2b76
movq %r15, %rdi
movq %r14, %rsi
callq 0x2b76
addq $0x28, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2b76
movq %rsp, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x2808
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2ae0
addq $0x40, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/board_texture.cc
// Function: board_texture::board_texture(board_texture const&)
inline point board_texture::value( point &at, point &gc, point &normal,
 model &m, int depth ) {
  int x = (int) floor( X( at ) );
  int y = (int) floor( Y( at ) );

  if( (x & 1) ^ (y & 1) )
    return red_texture->value( at, gc, normal, m, depth );
  else
    return black_texture->value( at, gc, normal, m, depth );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x60, %rsp
leaq 0x4e5e(%rip), %r8       # 0x9848
leaq 0x40(%rsp), %rax
movq %r8, (%rax)
pushq $0x3
popq %r9
movl %r9d, 0x8(%rax)
andq $0x0, 0xc(%rax)
andl $0x0, 0x14(%rax)
leaq 0x20(%rsp), %rdx
movq %r8, (%rdx)
movl %r9d, 0x8(%rdx)
andq $0x0, 0xc(%rdx)
andl $0x0, 0x14(%rdx)
movq %rsi, %r14
movq %rsp, %rcx
movq %r8, (%rcx)
movl %r9d, 0x8(%rcx)
andq $0x0, 0xc(%rcx)
movq %rdi, %rbx
andl $0x0, 0x14(%rcx)
xorps %xmm0, %xmm0
movq %rax, %rsi
callq 0x4428
leaq 0x51cd(%rip), %rax      # 0x9c10
movq %rax, (%rbx)
pushq $0x70
popq %rdi
callq 0x20d0
movq %rax, %r15
movq 0x70(%r14), %rsi
movq %rax, %rdi
callq 0x4482
movq %r15, 0x70(%rbx)
pushq $0x70
popq %rdi
callq 0x20d0
movq %rax, %r15
movq 0x78(%r14), %rsi
movq %rax, %rdi
callq 0x4482
movq %r15, 0x78(%rbx)
addq $0x60, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x4a88
movq %rax, %r14
pushq $0x70
popq %rsi
movq %r15, %rdi
callq 0x20e0
jmp 0x4a9b
movq %rax, %r14
movq %rbx, %rdi
callq 0x44d0
movq %r14, %rdi
callq 0x2180
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/board_texture.cc
// Function: board_texture::tune_texture(model&)
texture *board_texture::tune_texture( model &m ) {
  assert( red_texture );
  assert( black_texture );

  texture *nr = red_texture->tune_texture( m );
  texture *nb = black_texture->tune_texture( m );
  return new board_texture( nr, nb );
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
movq 0x70(%rdi), %rdi
testq %rdi, %rdi
je 0x4b22
cmpq $0x0, 0x78(%r14)
je 0x4b3b
movq %rsi, %rbx
movq (%rdi), %rax
callq *0x10(%rax)
movq %rax, %r15
movq 0x78(%r14), %rdi
movq (%rdi), %rax
movq %rbx, %rsi
callq *0x10(%rax)
movq %rax, %r14
movl $0x80, %edi
callq 0x20d0
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0x4954
movq %rbx, %rax
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1a05(%rip), %rdi      # 0x652e
leaq 0x1a0a(%rip), %rsi      # 0x653a
leaq 0x1a14(%rip), %rcx      # 0x654b
pushq $0x1d
jmp 0x4b52
leaq 0x1a3f(%rip), %rdi      # 0x6581
leaq 0x19f1(%rip), %rsi      # 0x653a
leaq 0x19fb(%rip), %rcx      # 0x654b
pushq $0x1e
popq %rdx
callq 0x2070
movq %rax, %r14
movl $0x80, %esi
movq %rbx, %rdi
callq 0x20e0
movq %r14, %rdi
callq 0x2180
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/output.cc
// Function: output::output(char*, char*, int, int)
output::output( char *fn, char *ext, int w, int h ) {
  xsize = w;
  ysize = h;
  name = new char[ strlen( fn ) + strlen( ext ) + 1 ];
  (void) strcpy( name, fn );
  (void) strcat( name, ext );
  outfile = fopen( name, "w" );
  if( !outfile ) {
    perror( "fopen" );
    assert( 0 );
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x4ff4(%rip), %rax      # 0x9c60
movq %rax, (%rdi)
movl %ecx, 0x8(%rdi)
movl %r8d, 0xc(%rdi)
movq %rsi, %rdi
callq 0x2050
movq %rax, %r12
movq %r14, %rdi
callq 0x2050
leaq (%r12,%rax), %rdi
incq %rdi
callq 0x2030
movq %rax, %r12
movq %rax, 0x10(%rbx)
movq %rax, %rdi
movq %r15, %rsi
callq 0x20b0
movq %r12, %rdi
movq %r14, %rsi
callq 0x2190
leaq 0x18fb(%rip), %rsi      # 0x65b4
movq %r12, %rdi
callq 0x20f0
movq %rax, 0x18(%rbx)
testq %rax, %rax
je 0x4cd6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x18d9(%rip), %rdi      # 0x65b6
callq 0x2090
leaq 0x15fa(%rip), %rdi      # 0x62e3
leaq 0x1a0d(%rip), %rsi      # 0x66fd
leaq 0x18c5(%rip), %rcx      # 0x65bc
pushq $0x1f
popq %rdx
callq 0x2070
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/ppm_output.cc
// Function: ppm_output::putpixel(int, int, point&)
inline void ppm_output::putpixel( int x, int y, point &c ) {
  unsigned char r = gamma(R(c));
  unsigned char g = gamma(G(c));
  unsigned char b = gamma(B(c));

  assert( x < xsize && curx == x && cury == y );
  curx++;
#if DEBUGLEVEL > 3
  printf( "output: %f %f %f\n", c[0], c[1], c[2] );
#endif
  fputc( r, outfile );
  fputc( g, outfile );
  fputc( b, outfile );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x4edb
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movl %eax, %r15d
movq %r13, %rdi
callq 0x4f1d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movl %eax, %r12d
movq %r13, %rdi
callq 0x4f60
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
cmpl %ebp, 0x8(%rbx)
jle 0x4e76
cmpl %ebp, 0x20(%rbx)
jne 0x4e76
cmpl %r14d, 0x24(%rbx)
jne 0x4e76
movl %eax, %r13d
incl %ebp
movl %ebp, 0x20(%rbx)
movzbl %r15b, %edi
movq 0x18(%rbx), %rsi
callq 0x2100
movzbl %r12b, %edi
movq 0x18(%rbx), %rsi
callq 0x2100
movzbl %r13b, %edi
movq 0x18(%rbx), %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2100
leaq 0x1782(%rip), %rdi      # 0x65ff
leaq 0x1875(%rip), %rsi      # 0x66f9
leaq 0x1798(%rip), %rcx      # 0x6623
pushq $0x3b
popq %rdx
callq 0x2070
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/ppm_output.cc
// Function: ppm_output::flushrow(int)
inline void ppm_output::flushrow( int y ) {
  assert( y < ysize && cury == y );
  cury++;
  curx = 0;
#if DEBUGLEVEL == 2
  if( !(y % 10) )
#endif
#if DEBUGLEVEL >= 2
    printf( "output row: %d\n", y );
#endif
}

// Assembly:
cmpl %esi, 0xc(%rdi)
jle 0x4ea8
cmpl %esi, 0x24(%rdi)
jne 0x4ea8
incl %esi
movl %esi, 0x24(%rdi)
andl $0x0, 0x20(%rdi)
retq
pushq %rax
leaq 0x17e6(%rip), %rdi      # 0x6696
leaq 0x1842(%rip), %rsi      # 0x66f9
leaq 0x17ef(%rip), %rcx      # 0x66ad
pushq $0x2a
popq %rdx
callq 0x2070
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/oldppm_output.cc
// Function: oldppm_output::putpixel(int, int, point&)
inline void oldppm_output::putpixel( int x, int y, point &c ) {
  unsigned char r = gamma(R(c));
  unsigned char g = gamma(G(c));
  unsigned char b = gamma(B(c));

  assert( x < xsize && curx == x && cury == y );
  curx++;
#if DEBUGLEVEL > 3
  printf( "output: %f %f %f\n", c[0], c[1], c[2] );
#endif
  fprintf( outfile, "%3d ", r );
  fprintf( outfile, "%3d ", g );
  fprintf( outfile, "%3d ", b );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r13
movl %edx, %r14d
movl %esi, %ebp
movq %rdi, %rbx
movq %rcx, %rdi
callq 0x4edb
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movl %eax, %r15d
movq %r13, %rdi
callq 0x4f1d
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
movl %eax, %r12d
movq %r13, %rdi
callq 0x4f60
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x28(%rax)
cmpl %ebp, 0x8(%rbx)
jle 0x509c
cmpl %ebp, 0x20(%rbx)
jne 0x509c
cmpl %r14d, 0x24(%rbx)
jne 0x509c
movl %eax, %r13d
incl %ebp
movl %ebp, 0x20(%rbx)
movq 0x18(%rbx), %rdi
movzbl %r15b, %edx
leaq 0x16df(%rip), %r14      # 0x673f
movq %r14, %rsi
xorl %eax, %eax
callq 0x2130
movq 0x18(%rbx), %rdi
movzbl %r12b, %edx
movq %r14, %rsi
xorl %eax, %eax
callq 0x2130
movq 0x18(%rbx), %rdi
movzbl %r13b, %edx
movq %r14, %rsi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2130
leaq 0x155c(%rip), %rdi      # 0x65ff
leaq 0x164c(%rip), %rsi      # 0x66f6
leaq 0x1656(%rip), %rcx      # 0x6707
pushq $0x24
popq %rdx
callq 0x2070
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/oldppm_output.cc
// Function: oldppm_output::flushrow(int)
inline void oldppm_output::flushrow( int y ) {
  assert( y < ysize && cury == y );
  cury++;
  curx = 0;
#if DEBUGLEVEL == 2
  if( !(y % 10) )
#endif
#if DEBUGLEVEL >= 2
    printf( "output row: %d\n", y );
#endif
  fprintf( outfile, "\n" );
}

// Assembly:
cmpl %esi, 0xc(%rdi)
jle 0x50d9
cmpl %esi, 0x24(%rdi)
jne 0x50d9
incl %esi
movl %esi, 0x24(%rdi)
andl $0x0, 0x20(%rdi)
movq 0x18(%rdi), %rsi
pushq $0xa
popq %rdi
jmp 0x2100
pushq %rax
leaq 0x15b5(%rip), %rdi      # 0x6696
leaq 0x160e(%rip), %rsi      # 0x66f6
leaq 0x1655(%rip), %rcx      # 0x6744
pushq $0x30
popq %rdx
callq 0x2070
nop
// File: /workspace/github_cpp_makefile_star2_O2/BartMassey[P]ancient-raytracer/frandom.c
// Function: fnurandom2
double fnurandom2( double centricity ) {
  double x = frandom() * 2;
  int sign = 1;

  if( x > 1 ) {
    x -= 1;
    sign = -1;
  }
  return sign * pow( x, 1 / (1 - centricity) );
}

// Assembly:
subq $0x28, %rsp
movsd %xmm0, 0x8(%rsp)
callq 0x5cec
movapd %xmm0, %xmm2
addsd %xmm0, %xmm2
movapd %xmm2, 0x10(%rsp)
movsd 0xb46(%rip), %xmm1      # 0x68a8
addsd %xmm2, %xmm1
movsd 0x832(%rip), %xmm3      # 0x65a0
movapd %xmm3, %xmm0
cmpltsd %xmm2, %xmm0
andpd %xmm0, %xmm1
andnpd %xmm2, %xmm0
orpd %xmm1, %xmm0
movapd %xmm3, %xmm2
subsd 0x8(%rsp), %xmm2
movapd %xmm3, %xmm1
divsd %xmm2, %xmm1
callq 0x2170
movapd 0x10(%rsp), %xmm1
ucomisd 0x7f8(%rip), %xmm1      # 0x65a0
jbe 0x5db2
xorpd 0xafe(%rip), %xmm0      # 0x68b0
addq $0x28, %rsp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/aes_upload.cpp
// Function: md5sum(char*, int, char*)
void md5sum(char *data, int size, char *hash)
{
	MD5_CTX ctx;
	unsigned char digest[16] = { 0 };

	memset(&ctx, 0, sizeof(MD5_CTX));
	MD5_Init(&ctx);
	MD5_Update(&ctx, data, size);
	MD5_Final(digest, &ctx);

	for (int i = 0; i < 16; ++i)
	{
		sprintf(&hash[i * 2], "%02x", (unsigned int)digest[i]);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdx, %rbx
movl %esi, %r14d
movq %rdi, %r15
xorps %xmm0, %xmm0
leaq -0x40(%rbp), %r12
movaps %xmm0, (%r12)
leaq -0xa0(%rbp), %r13
movaps %xmm0, (%r13)
movaps %xmm0, 0x10(%r13)
movaps %xmm0, 0x20(%r13)
movaps %xmm0, 0x30(%r13)
movaps %xmm0, 0x40(%r13)
movups %xmm0, 0x4c(%r13)
movq %r13, %rdi
callq 0x21a0
movslq %r14d, %rdx
movq %r13, %rdi
movq %r15, %rsi
callq 0x22f0
movq %r12, %rdi
movq %r13, %rsi
callq 0x2250
leaq 0xb75(%rip), %r14       # 0x3004
xorl %r15d, %r15d
cmpq $0x10, %r15
je 0x24b4
movzbl -0x40(%rbp,%r15), %edx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x2080
incq %r15
addq $0x2, %rbx
jmp 0x2492
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/aes_upload.cpp
// Function: rsa_encrypt(char*, unsigned char*, int, unsigned char*, unsigned int&)
int rsa_encrypt(char *public_key_filename, unsigned char *data, int data_len, unsigned char *encrypted, unsigned int &encrypted_length)
{
	unsigned char *pubkey = NULL;
	unsigned int size;

	pubkey = (unsigned char *)get_file(public_key_filename, &size);
	if (pubkey == NULL)
	{
		printf("Failed to open public key\r\n");
		return -1;
	}

	if (data_len > 245)
	{
		printf("Cannot encrypt more than 245 bytes with RSA 2048 bit key\r\n");
		delete [] pubkey;
		return -1;
	}

	RSA *rsa = createRSA(pubkey, true);
	encrypted_length = RSA_public_encrypt(data_len, data, encrypted, rsa, RSA_PKCS1_PADDING);
	if (encrypted_length == -1)
	{
		char err[130];

		ERR_load_crypto_strings();
		ERR_error_string(ERR_get_error(), err);
		printf("ERROR: %s\n", err);
		delete [] pubkey;
		return -1;
	}
	RSA_free(rsa);
	delete [] pubkey;

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %r8, %r14
movq %rcx, %r15
movl %edx, %r13d
movq %rsi, %r12
leaq -0x2c(%rbp), %rsi
callq 0x24c3
testq %rax, %rax
je 0x263d
movq %rax, %rbx
cmpl $0xf6, %r13d
jl 0x264b
leaq 0xb3a(%rip), %rdi       # 0x3170
callq 0x22a0
jmp 0x26bc
leaq 0xb66(%rip), %rdi       # 0x31aa
callq 0x22a0
jmp 0x26c4
pushq $0x1
popq %rsi
movq %rbx, %rdi
callq 0x2571
movl %r13d, %edi
movq %r12, %rsi
movq %r15, %rdx
movq %rax, %r15
movq %rax, %rcx
pushq $0x1
popq %r8
callq 0x2190
movl %eax, (%r14)
cmpl $-0x1, %eax
je 0x268a
movq %r15, %rdi
callq 0x2210
movq %rbx, %rdi
callq 0x2260
xorl %eax, %eax
jmp 0x26c7
pushq $0x2
popq %rdi
xorl %esi, %esi
callq 0x2110
callq 0x2270
leaq -0xb0(%rbp), %r14
movq %rax, %rdi
movq %r14, %rsi
callq 0x20c0
leaq 0x988(%rip), %rdi       # 0x303a
movq %r14, %rsi
xorl %eax, %eax
callq 0x2050
movq %rbx, %rdi
callq 0x2260
pushq $-0x1
popq %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/aes_upload.cpp
// Function: aes_encrypt(unsigned char*, unsigned char*, unsigned char*, int, unsigned char*&, unsigned int&)
int aes_encrypt(unsigned char *key, unsigned char *iv, unsigned char *data, int data_size, unsigned char *&ciphertext, unsigned int &ciphertext_len)
{
	ciphertext = (unsigned char *)malloc( (data_size / 16 + 1) * 16 );
	if (ciphertext == NULL)
	{
		perror("malloc failed");
		return -1;
	}

	printf("Using key %s iv %s\r\n", key, iv);

	ciphertext_len = encrypt(data, data_size, key, iv, ciphertext);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r13
movq %r8, %rbx
movl %ecx, %r15d
movq %rdx, -0x30(%rbp)
movq %rsi, %r14
movq %rdi, %r12
pushq $0x10
popq %rcx
movl %r15d, %eax
cltd
idivl %ecx
shll $0x4, %eax
addl $0x10, %eax
movslq %eax, %rdi
callq 0x2280
movq %rax, (%rbx)
testq %rax, %rax
je 0x280e
leaq 0x87c(%rip), %rdi       # 0x3053
movq %r12, %rsi
movq %r14, %rdx
xorl %eax, %eax
callq 0x2050
movq (%rbx), %r8
movq -0x30(%rbp), %rdi
movl %r15d, %esi
movq %r12, %rdx
movq %r14, %rcx
callq 0x26f1
movl %eax, (%r13)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x830(%rip), %rdi       # 0x3045
callq 0x21c0
pushq $-0x1
popq %rax
jmp 0x27ff
// File: /workspace/github_cpp_makefile_star2_O2/akw0088[P]openssl/aes_upload.cpp
// Function: main
int main(int argc, char *argv[])
{
	unsigned short port = 65535;

	if (argc < 5)
	{
		printf("Usage: aes_upload filename port key iv public_key\r\n");
		printf("Example: aes_upload file.tgz 65535 01234567890123456789012345678901 0123456789012345 id_rsa.openssl.pub\r\n");
		return 0;
	}

	port = atoi(argv[2]);
	unsigned char *key = (unsigned char *)argv[3];
	unsigned char *iv = (unsigned char *)argv[4];
	unsigned char *pubkey = (unsigned char *)argv[5];

	printf("Attempting to upload %s to client connecting on port %d\r\n", argv[1], (int)port);
	aes_file_upload(argv[1], port, key, iv, pubkey);

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x4, %edi
jg 0x2c0c
leaq 0x644(%rip), %rdi       # 0x323d
callq 0x22a0
leaq 0x66b(%rip), %rdi       # 0x3270
callq 0x22a0
jmp 0x2c52
movq %rsi, %rbx
movq 0x10(%rsi), %rdi
callq 0x22b0
movq 0x8(%rbx), %rsi
movq 0x18(%rbx), %r14
movq 0x20(%rbx), %r15
movq 0x28(%rbx), %r12
movzwl %ax, %r13d
leaq 0x503(%rip), %rdi       # 0x3136
movl %r13d, %edx
xorl %eax, %eax
callq 0x2050
movq 0x8(%rbx), %rdi
movl %r13d, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x281f
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH02_VariablesAndBasicTypes/examples/inits.cc
// Function: main
int main() {

	int v1(1024);    // direct-initialization, functional form
	int v2{1024};    // direct-initialization, list initializer form
	int v3 = 1024;   // copy-initialization
	int v4 = {1024}; // copy-initialization, list initializer form


	// alternative ways to initialize string from a character string literal
	std::string titleA = "C++ Primer, 5th Ed.";
	std::string titleB("C++ Primer, 5th Ed.");
	std::string all_nines(10, '9');  // all_nines = "9999999999"

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x68, %rsp
leaq 0xbd5(%rip), %rbx       # 0x2006
leaq -0x68(%rbp), %rdi
leaq -0x48(%rbp), %rdx
movq %rbx, %rsi
callq 0x1030
leaq -0x48(%rbp), %rdi
leaq -0x28(%rbp), %rdx
movq %rbx, %rsi
callq 0x1030
leaq -0x18(%rbp), %rax
movq %rax, -0x10(%rax)
leaq -0x28(%rbp), %rdi
pushq $0xa
popq %rsi
pushq $0x39
popq %rdx
callq 0x10a0
leaq -0x28(%rbp), %rdi
callq 0x1040
leaq -0x48(%rbp), %rdi
callq 0x1040
leaq -0x68(%rbp), %rdi
callq 0x1040
xorl %eax, %eax
addq $0x68, %rsp
popq %rbx
popq %rbp
retq
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0x1040
jmp 0x149d
movq %rax, %rbx
leaq -0x68(%rbp), %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x1110
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30_main.cc
// Function: runQueries(std::basic_ifstream<char, std::char_traits<char>>&)
void runQueries(ifstream& infile)
{
	TextQuery tq(infile);

	while (true) {
		cout << "enter word to look for, or q to quite: ";
		string s;

		if (!(cin >> s) || s == "q")
			break;
		print(cout, tq.query(s)) << endl;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rdi, %rsi
leaq -0x88(%rbp), %rdi
callq 0x2784
movq 0x4b82(%rip), %r14      # 0x6fc8
leaq 0x1bb7(%rip), %r15      # 0x4004
movq 0x4b84(%rip), %r12      # 0x6fd8
leaq -0x48(%rbp), %r13
leaq -0xc8(%rbp), %rbx
movq %r14, %rdi
movq %r15, %rsi
callq 0x2180
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
andq $0x0, -0x40(%rbp)
movb $0x0, -0x38(%rbp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x21f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x24de
movq %r13, %rdi
leaq 0x1b8e(%rip), %rsi      # 0x402c
callq 0x25ea
testb %al, %al
jne 0x24de
movq %rbx, %rdi
leaq -0x88(%rbp), %rsi
movq %r13, %rdx
callq 0x2a1e
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2c1f
movq %rax, %rdi
callq 0x20d0
movq %rbx, %rdi
callq 0x25fa
movq %r13, %rdi
callq 0x20b0
jmp 0x245f
leaq -0x48(%rbp), %rdi
callq 0x20b0
leaq -0x88(%rbp), %rdi
callq 0x2624
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2507
movq %rax, %rbx
jmp 0x2520
movq %rax, %rbx
jmp 0x2529
movq %rax, %rbx
leaq -0xc8(%rbp), %rdi
callq 0x25fa
leaq -0x48(%rbp), %rdi
callq 0x20b0
leaq -0x88(%rbp), %rdi
callq 0x2624
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30_main.cc
// Function: main
int main(int argc, char const *argv[])
{
	ifstream infile;

	// Test data CH12_DynamicMemory/examples/data/storyDataFile
	if (argc < 2 || !(infile.open(argv[1]), infile)) {
		cerr << "No input file!" << endl;
		return EXIT_FAILURE;
	}
	runQueries(infile);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x210, %rsp            # imm = 0x210
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x218(%rbp), %rdi
callq 0x21c0
cmpl $0x2, %r14d
jl 0x258b
movq 0x8(%rbx), %rsi
leaq -0x218(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x20f0
movq -0x218(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x1f8(%rbp,%rax)
je 0x25c3
movq 0x4a5e(%rip), %rdi      # 0x6ff0
leaq 0x1a95(%rip), %rsi      # 0x402e
callq 0x2180
movq %rax, %rdi
callq 0x20d0
pushq $0x1
popq %rbx
leaq -0x218(%rbp), %rdi
callq 0x2060
movl %ebx, %eax
addq $0x210, %rsp            # imm = 0x210
popq %rbx
popq %r14
popq %rbp
retq
xorl %ebx, %ebx
leaq -0x218(%rbp), %rdi
callq 0x241c
jmp 0x25a9
movq %rax, %rbx
leaq -0x218(%rbp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2280
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30.cc
// Function: TextQuery::TextQuery(std::basic_ifstream<char, std::char_traits<char>>&)
TextQuery::TextQuery(ifstream& is) : file(new vector<string>)
{
	string text;
	while (getline(is, text)) {
		file->push_back(text);
		int n = file->size() - 1;
		istringstream line(text);
		string word;
		while (line >> word) {
			word = clean_str(word);
			/**
			 * if the key is not already present,
			 * a new element is created and inserted
			 * into the map for that key.
			*/
			auto& lines = wm[word];
			if (!lines)
				lines.reset(new set<line_no>);
			lines->insert(n);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rsi, -0x38(%rbp)
movq %rdi, %rbx
pushq $0x18
popq %rdi
callq 0x2190
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2f72
leaq 0x18(%rbx), %rax
andl $0x0, 0x18(%rbx)
andq $0x0, 0x20(%rbx)
movq %rax, 0x28(%rbx)
movq %rax, 0x30(%rbx)
andq $0x0, 0x38(%rbx)
movq %rbx, -0x30(%rbp)
leaq 0x10(%rbx), %r14
leaq -0x70(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x80(%rbp), %rsi
leaq -0x60(%rbp), %r15
leaq -0xa0(%rbp), %r12
movq -0x38(%rbp), %rdi
callq 0x2050
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x292f
movq -0x30(%rbp), %rax
movq (%rax), %rdi
leaq -0x80(%rbp), %rbx
movq %rbx, %rsi
callq 0x2dd0
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rcx
movq %rcx, -0x40(%rbp)
movq 0x8(%rax), %r13
leaq -0x220(%rbp), %rdi
movq %rbx, %rsi
pushq $0x8
popq %rdx
callq 0x2270
subq -0x40(%rbp), %r13
leaq -0x50(%rbp), %rax
movq %rax, -0x60(%rbp)
andq $0x0, -0x58(%rbp)
movb $0x0, -0x50(%rbp)
shlq $0x1b, %r13
movabsq $-0x100000000, %rax     # imm = 0xFFFFFFFF00000000
addq %rax, %r13
sarq $0x20, %r13
leaq -0x220(%rbp), %rdi
movq %r15, %rsi
callq 0x21f0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x2912
movq %r12, %rdi
movq %r15, %rsi
callq 0x2996
movq %r15, %rdi
movq %r12, %rsi
callq 0x21e0
movq %r12, %rdi
callq 0x20b0
movq %r14, %rdi
movq %r15, %rsi
callq 0x2e0c
movq %rax, %rbx
movq (%rax), %rdi
testq %rdi, %rdi
jne 0x28fe
pushq $0x30
popq %rdi
callq 0x2190
movq %rax, %rcx
addq $0x8, %rcx
andl $0x0, 0x8(%rax)
andq $0x0, 0x10(%rax)
movq %rcx, 0x18(%rax)
movq %rcx, 0x20(%rax)
andq $0x0, 0x28(%rax)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2e76
movq (%rbx), %rdi
movq %r13, -0xa0(%rbp)
movq %r12, %rsi
callq 0x383c
jmp 0x287a
movq %r15, %rdi
callq 0x20b0
leaq -0x220(%rbp), %rdi
callq 0x20c0
leaq -0x80(%rbp), %rsi
jmp 0x27fe
leaq -0x80(%rbp), %rdi
callq 0x20b0
addq $0x1f8, %rsp            # imm = 0x1F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x294c
movq %rax, %rbx
jmp 0x296f
jmp 0x2957
jmp 0x2957
jmp 0x2957
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0x20b0
leaq -0x220(%rbp), %rdi
callq 0x20c0
leaq -0x80(%rbp), %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x26e6
movq -0x30(%rbp), %rdi
addq $0x8, %rdi
callq 0x2648
movq %rbx, %rdi
callq 0x2280
nop
// File: /workspace/github_cpp_makefile_star2_O2/iZhangHui[P]CppPrimer/CH12_DynamicMemory/exercises/ex12_27_30.cc
// Function: TextQuery::clean_str(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
string TextQuery::clean_str(const string& word)
{
	string ret;
	for (auto it = word.begin(); it != word.end(); ++it) {
		if (!ispunct(*it))
			ret += tolower(*it);
	}
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x10(%rdi), %rax
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movq %rsi, %r14
movb $0x0, 0x10(%rdi)
movq (%rsi), %r13
movq %r13, %r12
movq 0x8(%r14), %rax
addq %r13, %rax
cmpq %rax, %r12
je 0x29f8
movsbl (%r12), %r15d
movl %r15d, %edi
callq 0x22a0
testl %eax, %eax
jne 0x29f3
movl %r15d, %edi
callq 0x2220
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2150
movq (%r14), %r13
incq %r12
jmp 0x29c0
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
movq %rbx, %rdi
callq 0x20b0
movq %r14, %rdi
callq 0x2280
nop