// File: /workspace/github_cpp_makefile_star2_O1/BartMassey[P]ancient-raytracer/fast_texture.cc
// Function: fast_texture::value(point&, point&, point&, model&, int)
point fast_texture::value( point &at, point &gc, point &normal,
 model &m, int depth ) {
  point result( ka );  // ambient term
  point lv( (pl - gc).unit() );  // unit vector from target toward light
  
  // diffuse term
  float fd = lv * normal;
  if( fd > TINY )
    result += kd.vproduct( pli ) * fd;
    
  // specular terms
  point pt = (gc - pe).unit();  // unit vector from eye toward target
  point ps = pt - normal * ( ( pt * normal ) * 2.0 );  // specular direction

  // specular diffusion term
  float fs = ps * lv;
  if( fs > 0 ) {
    fs = exp( ns * log( fs ) );
    if( fs > TINY )
        result += ks.vproduct( pli ) * fs;
  }
  
  // ray tracing term
  return result + ks.vproduct( trace( ray( gc, ps ), m, depth ).contraction() );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a8, %rsp            # imm = 0x2A8
movq %r9, 0xe0(%rsp)
movq %r8, %rbp
movq %rcx, %r12
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x6f40(%rip), %rax      # 0xc848
movq %rax, 0xa0(%rsp)
movslq 0x10(%rsi), %r13
movl %r13d, 0xa8(%rsp)
testq %r13, %r13
jle 0x593a
leaq 0x14(%r14), %rsi
leaq 0xac(%rsp), %rdi
leaq (,%r13,4), %rdx
callq 0x20a0
movslq 0x8(%r12), %r15
testq %r15, %r15
jle 0x595e
leaq 0xc(%r12), %rsi
leaq (,%r15,4), %rdx
leaq 0x294(%rsp), %rdi
callq 0x20a0
movq %r12, 0x30(%rsp)
leaq 0x6ede(%rip), %rax      # 0xc848
movq %rax, 0x40(%rsp)
movslq 0x78(%r14), %r12
movl %r12d, 0x48(%rsp)
testq %r12, %r12
jle 0x5993
leaq 0x7c(%r14), %rsi
leaq 0x4c(%rsp), %rdi
leaq (,%r12,4), %rdx
callq 0x20a0
testl %r15d, %r15d
movq %rbp, 0x8(%rsp)
jle 0x5a11
leaq (,%r15,4), %rbp
leaq 0x1c(%rsp), %rdi
leaq 0x6e97(%rip), %rax      # 0xc848
movq %rax, -0xc(%rdi)
movl %r15d, -0x4(%rdi)
leaq 0x294(%rsp), %rsi
movq %rbp, %rdx
callq 0x20a0
xorl %eax, %eax
movaps 0x365e(%rip), %xmm0     # 0x9030
movss 0x1c(%rsp,%rax,4), %xmm1
xorps %xmm0, %xmm1
movss %xmm1, 0x1c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x59d2
leaq 0x6c(%rsp), %rdi
leaq 0x6e53(%rip), %rax      # 0xc848
movq %rax, -0xc(%rdi)
movl %r15d, -0x4(%rdi)
leaq 0x1c(%rsp), %rsi
movq %rbp, %rdx
callq 0x20a0
movq 0x8(%rsp), %rbp
jmp 0x5a2c
leaq 0x6e30(%rip), %rax      # 0xc848
movq %rax, 0x10(%rsp)
movl %r15d, 0x18(%rsp)
movq %rax, 0x60(%rsp)
movl %r15d, 0x68(%rsp)
cmpl 0x68(%rsp), %r12d
jne 0x6339
testl %r12d, %r12d
jle 0x5aae
xorl %eax, %eax
movss 0x6c(%rsp,%rax,4), %xmm0
addss 0x4c(%rsp,%rax,4), %xmm0
movss %xmm0, 0x4c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r12
jne 0x5a3e
leaq 0x6de9(%rip), %rax      # 0xc848
movq %rax, 0x80(%rsp)
movl %r12d, 0x88(%rsp)
testl %r12d, %r12d
jle 0x5ac5
leaq 0x4c(%rsp), %rsi
leaq 0x8c(%rsp), %rdi
leaq (,%r12,4), %rdx
callq 0x20a0
xorps %xmm0, %xmm0
xorl %eax, %eax
movss 0x8c(%rsp,%rax,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq %rax, %r12
jne 0x5a93
jmp 0x5ac8
leaq 0x6d93(%rip), %rax      # 0xc848
movq %rax, 0x80(%rsp)
movl %r12d, 0x88(%rsp)
xorps %xmm0, %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jb 0x5ad6
sqrtss %xmm0, %xmm0
jmp 0x5adb
callq 0x21c0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
ucomisd 0x3536(%rip), %xmm1     # 0x9020
jbe 0x6358
testl %r12d, %r12d
jle 0x5b21
movss 0x350b(%rip), %xmm1     # 0x9008
divss %xmm0, %xmm1
xorl %eax, %eax
movss 0x8c(%rsp,%rax,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x8c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r12
jne 0x5b03
leaq 0x6d20(%rip), %rax      # 0xc848
movq %rax, 0x270(%rsp)
movslq 0x8(%rbp), %r15
movl %r15d, 0x278(%rsp)
testq %r15, %r15
jle 0x5b5a
leaq 0xc(%rbp), %rsi
leaq 0x27c(%rsp), %rdi
leaq (,%r15,4), %rdx
callq 0x20a0
cmpl %r15d, %r12d
jne 0x6377
xorps %xmm1, %xmm1
testl %r12d, %r12d
jle 0x5b8b
xorl %eax, %eax
movss 0x8c(%rsp,%rax,4), %xmm0
mulss 0x27c(%rsp,%rax,4), %xmm0
addss %xmm0, %xmm1
incq %rax
cmpq %rax, %r12
jne 0x5b6d
xorps %xmm0, %xmm0
cvtss2sd %xmm1, %xmm0
ucomisd 0x3486(%rip), %xmm0     # 0x9020
jbe 0x5ccf
leaq 0x6ca1(%rip), %rax      # 0xc848
movq %rax, 0x250(%rsp)
movslq 0x98(%r14), %rbp
movl %ebp, 0x258(%rsp)
testq %rbp, %rbp
movss %xmm1, 0x3c(%rsp)
jle 0x5be4
leaq 0x9c(%r14), %rsi
leaq 0x25c(%rsp), %rdi
leaq (,%rbp,4), %rdx
callq 0x20a0
movl 0x30(%r14), %r15d
leaq 0x6c59(%rip), %rax      # 0xc848
movq %rax, 0x10(%rsp)
leal -0x1(%r15), %eax
cmpl $0x4, %eax
jae 0x6396
movl %r15d, 0x18(%rsp)
cmpl %ebp, %r15d
jne 0x63b5
testl %r15d, %r15d
jle 0x5c85
leaq 0x1c(%rsp), %rsi
xorl %eax, %eax
movss 0x34(%r14,%rax,4), %xmm0
mulss 0x25c(%rsp,%rax,4), %xmm0
movss %xmm0, 0x1c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x5c1b
leaq 0x114(%rsp), %rdi
leaq 0x6c00(%rip), %rax      # 0xc848
movq %rax, -0xc(%rdi)
movl %r15d, -0x4(%rdi)
leaq (,%r15,4), %rdx
callq 0x20a0
xorl %eax, %eax
movss 0x3c(%rsp), %xmm1
movss 0x114(%rsp,%rax,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x114(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x5c65
jmp 0x5c9c
leaq 0x6bbc(%rip), %rax      # 0xc848
movq %rax, 0x108(%rsp)
movl %r15d, 0x110(%rsp)
cmpl %r15d, %r13d
jne 0x6339
testl %r13d, %r13d
jle 0x5ccf
xorl %eax, %eax
movss 0x114(%rsp,%rax,4), %xmm0
addss 0xac(%rsp,%rax,4), %xmm0
movss %xmm0, 0xac(%rsp,%rax,4)
incq %rax
cmpq %rax, %r13
jne 0x5cac
leaq 0x6b72(%rip), %r13      # 0xc848
movq %r13, 0x230(%rsp)
movslq 0xb8(%r14), %rdx
movl %edx, 0x238(%rsp)
testq %rdx, %rdx
jle 0x5d09
leaq 0xbc(%r14), %rsi
leaq 0x23c(%rsp), %rdi
shlq $0x2, %rdx
callq 0x20a0
movq 0x30(%rsp), %rsi
movq (%rsi), %rax
leaq 0x10(%rsp), %r15
leaq 0x230(%rsp), %rdx
movq %r15, %rdi
callq *0x50(%rax)
movq %r13, 0x40(%rsp)
movslq 0x8(%r15), %rbp
movl %ebp, 0x48(%rsp)
xorps %xmm2, %xmm2
xorps %xmm0, %xmm0
testq %rbp, %rbp
jle 0x5d71
leaq 0x1c(%rsp), %rsi
leaq 0x4c(%rsp), %rdi
leaq (,%rbp,4), %rdx
callq 0x20a0
xorps %xmm2, %xmm2
xorps %xmm0, %xmm0
xorl %eax, %eax
movss 0x4c(%rsp,%rax,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq %rax, %rbp
jne 0x5d5b
ucomiss %xmm2, %xmm0
jb 0x5d7c
sqrtss %xmm0, %xmm0
jmp 0x5d81
callq 0x21c0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
ucomisd 0x3290(%rip), %xmm1     # 0x9020
jbe 0x6358
testl %ebp, %ebp
jle 0x5dc0
movss 0x3266(%rip), %xmm1     # 0x9008
divss %xmm0, %xmm1
xorl %eax, %eax
movss 0x4c(%rsp,%rax,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0x4c(%rsp,%rax,4)
incq %rax
cmpq %rax, %rbp
jne 0x5da8
movq %r13, 0x1f0(%rsp)
movq 0x8(%rsp), %rax
movslq 0x8(%rax), %r15
movl %r15d, 0x1f8(%rsp)
testq %r15, %r15
jle 0x5df7
leaq 0xc(%rax), %rsi
leaq 0x1fc(%rsp), %rdi
leaq (,%r15,4), %rdx
callq 0x20a0
cmpl %r15d, %ebp
jne 0x6377
testl %ebp, %ebp
jle 0x5e6a
xorps %xmm0, %xmm0
xorl %eax, %eax
movss 0x4c(%rsp,%rax,4), %xmm1
mulss 0x1fc(%rsp,%rax,4), %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq %rax, %rbp
jne 0x5e09
addss %xmm0, %xmm0
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
leaq 0x210(%rsp), %rdi
callq *0x78(%rax)
movq %r13, 0xc0(%rsp)
movl %ebp, 0xc8(%rsp)
testl %ebp, %ebp
jle 0x5e8f
leaq 0x4c(%rsp), %rsi
leaq 0xcc(%rsp), %rdi
leaq (,%rbp,4), %rdx
callq 0x20a0
jmp 0x5e8f
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
leaq 0x210(%rsp), %rdi
xorps %xmm0, %xmm0
callq *0x78(%rax)
movq %r13, 0xc0(%rsp)
movl %ebp, 0xc8(%rsp)
movslq 0x218(%rsp), %r15
testq %r15, %r15
jle 0x5f07
leaq 0x21c(%rsp), %rsi
movq %r13, %rax
leaq (,%r15,4), %r13
leaq 0x1c(%rsp), %rdi
movq %rax, -0xc(%rdi)
movl %r15d, -0x4(%rdi)
movq %r13, %rdx
callq 0x20a0
xorl %eax, %eax
movaps 0x3163(%rip), %xmm0     # 0x9030
movss 0x1c(%rsp,%rax,4), %xmm1
xorps %xmm0, %xmm1
movss %xmm1, 0x1c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x5ecd
leaq 0x6c(%rsp), %rdi
leaq 0x6958(%rip), %rax      # 0xc848
movq %rax, -0xc(%rdi)
movl %r15d, -0x4(%rdi)
leaq 0x1c(%rsp), %rsi
movq %r13, %rdx
callq 0x20a0
jmp 0x5f1b
movq %r13, 0x10(%rsp)
movl %r15d, 0x18(%rsp)
movq %r13, 0x60(%rsp)
movl %r15d, 0x68(%rsp)
cmpl 0x68(%rsp), %ebp
jne 0x6339
testl %ebp, %ebp
leaq 0x691a(%rip), %r13      # 0xc848
jle 0x5f52
xorl %eax, %eax
movss 0x6c(%rsp,%rax,4), %xmm0
addss 0xcc(%rsp,%rax,4), %xmm0
movss %xmm0, 0xcc(%rsp,%rax,4)
incq %rax
cmpq %rax, %rbp
jne 0x5f32
movq %r13, 0x1d0(%rsp)
movl %r12d, 0x1d8(%rsp)
testl %r12d, %r12d
jle 0x5f83
leaq 0x8c(%rsp), %rsi
leaq 0x1dc(%rsp), %rdi
movq %r12, %rdx
shlq $0x2, %rdx
callq 0x20a0
cmpl %r12d, %ebp
jne 0x6377
xorps %xmm1, %xmm1
xorps %xmm0, %xmm0
testl %ebp, %ebp
movq 0x30(%rsp), %r12
jle 0x5fbb
xorl %eax, %eax
movss 0xcc(%rsp,%rax,4), %xmm2
mulss 0x1dc(%rsp,%rax,4), %xmm2
addss %xmm2, %xmm0
incq %rax
cmpq %rax, %rbp
jne 0x5f9d
ucomiss %xmm1, %xmm0
jbe 0x6114
movss 0x68(%r14), %xmm1
movss %xmm1, 0x8(%rsp)
callq 0x21d0
mulss 0x8(%rsp), %xmm0
callq 0x2170
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
ucomisd 0x3031(%rip), %xmm1     # 0x9020
jbe 0x6114
movq %r13, 0x1b0(%rsp)
movslq 0x98(%r14), %r12
movl %r12d, 0x1b8(%rsp)
testq %r12, %r12
movss %xmm0, 0x8(%rsp)
jle 0x6033
leaq 0x9c(%r14), %rsi
leaq 0x1bc(%rsp), %rdi
leaq (,%r12,4), %rdx
callq 0x20a0
movl 0x50(%r14), %r15d
movq %r13, 0x10(%rsp)
leal -0x1(%r15), %eax
cmpl $0x4, %eax
jae 0x6396
movl %r15d, 0x18(%rsp)
cmpl %r12d, %r15d
jne 0x63b5
testl %r15d, %r15d
movq 0x30(%rsp), %r12
jle 0x60cb
leaq 0x1c(%rsp), %rsi
xorl %eax, %eax
movss 0x54(%r14,%rax,4), %xmm0
mulss 0x1bc(%rsp,%rax,4), %xmm0
movss %xmm0, 0x1c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x6068
leaq 0xf4(%rsp), %rdi
movq %r13, -0xc(%rdi)
movl %r15d, -0x4(%rdi)
leaq (,%r15,4), %rdx
callq 0x20a0
xorl %eax, %eax
movss 0x8(%rsp), %xmm1
movss 0xf4(%rsp,%rax,4), %xmm0
mulss %xmm1, %xmm0
movss %xmm0, 0xf4(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x60ab
jmp 0x60db
movq %r13, 0xe8(%rsp)
movl %r15d, 0xf0(%rsp)
movl 0xa8(%rsp), %eax
cmpl %r15d, %eax
jne 0x6339
testl %eax, %eax
jle 0x6114
xorl %ecx, %ecx
movss 0xf4(%rsp,%rcx,4), %xmm0
addss 0xac(%rsp,%rcx,4), %xmm0
movss %xmm0, 0xac(%rsp,%rcx,4)
incq %rcx
cmpq %rcx, %rax
jne 0x60f1
leaq 0x6a0d(%rip), %rax      # 0xcb28
addq $0x10, %rax
movq %rax, 0x128(%rsp)
movq %r13, 0x130(%rsp)
movslq 0x8(%r12), %rdx
movl %edx, 0x138(%rsp)
testq %rdx, %rdx
jle 0x6158
addq $0xc, %r12
leaq 0x13c(%rsp), %rdi
shlq $0x2, %rdx
movq %r12, %rsi
callq 0x20a0
movq %r13, 0x150(%rsp)
movl %ebp, 0x158(%rsp)
xorps %xmm2, %xmm2
xorps %xmm0, %xmm0
testl %ebp, %ebp
jle 0x61af
leaq 0xcc(%rsp), %rsi
leaq 0x15c(%rsp), %rdi
leaq (,%rbp,4), %rdx
callq 0x20a0
xorps %xmm2, %xmm2
xorps %xmm0, %xmm0
xorl %eax, %eax
movss 0x15c(%rsp,%rax,4), %xmm1
mulss %xmm1, %xmm1
addss %xmm1, %xmm0
incq %rax
cmpq %rax, %rbp
jne 0x6196
ucomiss %xmm2, %xmm0
jb 0x61ba
sqrtss %xmm0, %xmm0
jmp 0x61bf
callq 0x21c0
xorps %xmm1, %xmm1
cvtss2sd %xmm0, %xmm1
ucomisd 0x2e52(%rip), %xmm1     # 0x9020
jbe 0x6358
movl 0x2e0(%rsp), %ebp
leaq 0x150(%rsp), %rdi
movss 0x2e1d(%rip), %xmm1     # 0x9008
divss %xmm0, %xmm1
movq (%rdi), %rax
movaps %xmm1, %xmm0
callq *0x70(%rax)
leaq 0x60(%rsp), %r15
leaq 0x128(%rsp), %rsi
movq %r15, %rdi
movq 0xe0(%rsp), %rdx
movl %ebp, %ecx
callq 0x233c
movl 0x8(%r15), %eax
movq %r13, 0x170(%rsp)
leal -0x2(%rax), %ecx
cmpl $0x4, %ecx
jae 0x6396
leal -0x1(%rax), %ebp
movl %ebp, 0x178(%rsp)
cmpl $0x2, %eax
jl 0x6256
leaq 0x6c(%rsp), %rsi
leaq 0x17c(%rsp), %rdi
movl %ebp, %edx
shlq $0x2, %rdx
callq 0x20a0
movl 0x50(%r14), %r15d
movq %r13, 0x190(%rsp)
leal -0x1(%r15), %eax
cmpl $0x4, %eax
jae 0x6396
movl %r15d, 0x198(%rsp)
cmpl %ebp, %r15d
jne 0x63b5
testl %r15d, %r15d
jle 0x62a8
xorl %eax, %eax
movss 0x54(%r14,%rax,4), %xmm0
mulss 0x17c(%rsp,%rax,4), %xmm0
movss %xmm0, 0x19c(%rsp,%rax,4)
incq %rax
cmpq %rax, %r15
jne 0x6287
movq %r13, (%rbx)
movslq 0xa8(%rsp), %r14
movl %r14d, 0x8(%rbx)
testq %r14, %r14
jle 0x62d5
leaq 0xac(%rsp), %rsi
leaq 0xc(%rbx), %rdi
leaq (,%r14,4), %rdx
callq 0x20a0
movq %r13, 0x10(%rsp)
movl %r15d, 0x18(%rsp)
testl %r15d, %r15d
jle 0x62fe
leaq 0x19c(%rsp), %rsi
leaq 0x1c(%rsp), %rdi
leaq (,%r15,4), %rdx
callq 0x20a0
cmpl %r15d, %r14d
jne 0x6339
testl %r14d, %r14d
jle 0x6324
xorl %eax, %eax
movss 0x1c(%rsp,%rax,4), %xmm0
addss 0xc(%rbx,%rax,4), %xmm0
movss %xmm0, 0xc(%rbx,%rax,4)
incq %rax
cmpq %rax, %r14
jne 0x630a
movq %rbx, %rax
addq $0x2a8, %rsp            # imm = 0x2A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2d58(%rip), %rdi      # 0x9098
leaq 0x2d27(%rip), %rsi      # 0x906e
leaq 0x2d7b(%rip), %rcx      # 0x90c9
movl $0x66, %edx
callq 0x2080
leaq 0x2e44(%rip), %rdi      # 0x91a3
leaq 0x2d08(%rip), %rsi      # 0x906e
leaq 0x2e3f(%rip), %rcx      # 0x91ac
movl $0xc9, %edx
callq 0x2080
leaq 0x2d1a(%rip), %rdi      # 0x9098
leaq 0x2ce9(%rip), %rsi      # 0x906e
leaq 0x2d17(%rip), %rcx      # 0x90a3
movl $0x4f, %edx
callq 0x2080
leaq 0x2dbb(%rip), %rdi      # 0x9158
leaq 0x2cca(%rip), %rsi      # 0x906e
leaq 0x2dc1(%rip), %rcx      # 0x916c
movl $0x1a, %edx
callq 0x2080
leaq 0x2cdc(%rip), %rdi      # 0x9098
leaq 0x2cab(%rip), %rsi      # 0x906e
leaq 0x2db4(%rip), %rcx      # 0x917e
movl $0xb2, %edx
callq 0x2080