// File: tomfunkhouser[P]gaps/apps/conf2conf/conf2conf.cpp
// Function: Transform(gaps::RGBDConfiguration*, gaps::R4Matrix const&)
static int
Transform(RGBDConfiguration *configuration, const R4Matrix& matrix)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();
  if (print_verbose) {
    printf("Transforming ...\n");
    fflush(stdout);
  }

  // Transform all images
  R3Affine transformation(matrix, 0);
  for (int i = 0; i < configuration->NImages(); i++) {
    RGBDImage *image = configuration->Image(i);
    image->Transform(transformation);
  }

  // Print statistics
  if (print_verbose) {
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Images = %d\n", configuration->NImages());
    printf("  Matrix =\n    %g %g %g %g\n    %g %g %g %g\n    %g %g %g %g\n    %g %g %g %g\n",
      matrix[0][0], matrix[0][1], matrix[0][2], matrix[0][3],
      matrix[1][0], matrix[1][1], matrix[1][2], matrix[1][3],
      matrix[2][0], matrix[2][1], matrix[2][2], matrix[2][3],
      matrix[3][0], matrix[3][1], matrix[3][2], matrix[3][3]);
    fflush(stdout);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x2a8, %rsp            # imm = 0x2A8
movq %rdi, 0x2a0(%rsp)
movq %rsi, 0x298(%rsp)
leaq 0x288(%rsp), %rdi
callq 0xdaa10
leaq 0x288(%rsp), %rdi
callq 0x19c20
cmpl $0x0, 0x19a420(%rip)    # 0x1b1fe8
je 0x17be7
leaq 0x14e900(%rip), %rdi    # 0x1664d1
movb $0x0, %al
callq 0x12090
movq 0x1993b1(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
movq 0x298(%rsp), %rsi
leaq 0x178(%rsp), %rdi
xorl %edx, %edx
callq 0x7fbb0
movl $0x0, 0x174(%rsp)
movl 0x174(%rsp), %eax
movl %eax, 0x158(%rsp)
movq 0x2a0(%rsp), %rdi
callq 0x19c40
movl %eax, %ecx
movl 0x158(%rsp), %eax
cmpl %ecx, %eax
jge 0x17cbf
movq 0x2a0(%rsp), %rdi
movl 0x174(%rsp), %esi
callq 0x19c90
movq %rax, 0x150(%rsp)
jmp 0x17c53
movq 0x150(%rsp), %rax
movq %rax, 0x168(%rsp)
movq 0x168(%rsp), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
leaq 0x178(%rsp), %rsi
callq *%rax
jmp 0x17c81
jmp 0x17c83
movl 0x174(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x174(%rsp)
jmp 0x17c09
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x160(%rsp)
movl %eax, 0x15c(%rsp)
leaq 0x178(%rsp), %rdi
callq 0x7fc50
jmp 0x18102
cmpl $0x0, 0x19a322(%rip)    # 0x1b1fe8
je 0x180e8
leaq 0x288(%rsp), %rdi
callq 0xdaad0
movsd %xmm0, 0x148(%rsp)
jmp 0x17ce4
movsd 0x148(%rsp), %xmm0
leaq 0x14e5fe(%rip), %rdi    # 0x1662f2
movb $0x1, %al
callq 0x12090
jmp 0x17cfd
movq 0x2a0(%rsp), %rdi
callq 0x19c40
movl %eax, %esi
leaq 0x14e5f6(%rip), %rdi    # 0x166309
xorl %eax, %eax
callq 0x12090
jmp 0x17d1c
movq 0x298(%rsp), %rdi
xorl %esi, %esi
callq 0x1a6e0
movq %rax, 0x140(%rsp)
jmp 0x17d35
movq 0x140(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x130(%rsp)
movq 0x298(%rsp), %rdi
xorl %esi, %esi
callq 0x1a6e0
movq %rax, 0x138(%rsp)
jmp 0x17d63
movq 0x138(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x120(%rsp)
movq 0x298(%rsp), %rdi
xorl %esi, %esi
callq 0x1a6e0
movq %rax, 0x128(%rsp)
jmp 0x17d92
movq 0x128(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x110(%rsp)
movq 0x298(%rsp), %rdi
xorl %esi, %esi
callq 0x1a6e0
movq %rax, 0x118(%rsp)
jmp 0x17dc1
movq 0x118(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x100(%rsp)
movq 0x298(%rsp), %rdi
movl $0x1, %esi
callq 0x1a6e0
movq %rax, 0x108(%rsp)
jmp 0x17df3
movq 0x108(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xf0(%rsp)
movq 0x298(%rsp), %rdi
movl $0x1, %esi
callq 0x1a6e0
movq %rax, 0xf8(%rsp)
jmp 0x17e24
movq 0xf8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xe0(%rsp)
movq 0x298(%rsp), %rdi
movl $0x1, %esi
callq 0x1a6e0
movq %rax, 0xe8(%rsp)
jmp 0x17e56
movq 0xe8(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0xd0(%rsp)
movq 0x298(%rsp), %rdi
movl $0x1, %esi
callq 0x1a6e0
movq %rax, 0xd8(%rsp)
jmp 0x17e88
movq 0xd8(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0xc0(%rsp)
movq 0x298(%rsp), %rdi
movl $0x2, %esi
callq 0x1a6e0
movq %rax, 0xc8(%rsp)
jmp 0x17eba
movq 0xc8(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0xb0(%rsp)
movq 0x298(%rsp), %rdi
movl $0x2, %esi
callq 0x1a6e0
movq %rax, 0xb8(%rsp)
jmp 0x17eeb
movq 0xb8(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0xa0(%rsp)
movq 0x298(%rsp), %rdi
movl $0x2, %esi
callq 0x1a6e0
movq %rax, 0xa8(%rsp)
jmp 0x17f1d
movq 0xa8(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x298(%rsp), %rdi
movl $0x2, %esi
callq 0x1a6e0
movq %rax, 0x98(%rsp)
jmp 0x17f4f
movq 0x98(%rsp), %rax
movsd 0x18(%rax), %xmm0
movsd %xmm0, 0x80(%rsp)
movq 0x298(%rsp), %rdi
movl $0x3, %esi
callq 0x1a6e0
movq %rax, 0x88(%rsp)
jmp 0x17f81
movq 0x88(%rsp), %rax
movsd (%rax), %xmm0
movsd %xmm0, 0x70(%rsp)
movq 0x298(%rsp), %rdi
movl $0x3, %esi
callq 0x1a6e0
movq %rax, 0x78(%rsp)
jmp 0x17fac
movq 0x78(%rsp), %rax
movsd 0x8(%rax), %xmm0
movsd %xmm0, 0x60(%rsp)
movq 0x298(%rsp), %rdi
movl $0x3, %esi
callq 0x1a6e0
movq %rax, 0x68(%rsp)
jmp 0x17fd5
movq 0x68(%rsp), %rax
movsd 0x10(%rax), %xmm0
movsd %xmm0, 0x50(%rsp)
movq 0x298(%rsp), %rdi
movl $0x3, %esi
callq 0x1a6e0
movq %rax, 0x58(%rsp)
jmp 0x17ffe
movsd 0xc0(%rsp), %xmm7
movsd 0xd0(%rsp), %xmm6
movsd 0xe0(%rsp), %xmm5
movsd 0xf0(%rsp), %xmm4
movsd 0x100(%rsp), %xmm3
movsd 0x110(%rsp), %xmm2
movsd 0x120(%rsp), %xmm1
movsd 0x130(%rsp), %xmm0
movsd 0xb0(%rsp), %xmm8
movsd 0xa0(%rsp), %xmm9
movsd 0x90(%rsp), %xmm10
movsd 0x80(%rsp), %xmm11
movsd 0x70(%rsp), %xmm12
movsd 0x60(%rsp), %xmm13
movsd 0x50(%rsp), %xmm14
movq 0x58(%rsp), %rax
movsd 0x18(%rax), %xmm15
movq %rsp, %rax
movq %rax, 0x48(%rsp)
movsd %xmm15, 0x38(%rax)
movsd %xmm14, 0x30(%rax)
movsd %xmm13, 0x28(%rax)
movsd %xmm12, 0x20(%rax)
movsd %xmm11, 0x18(%rax)
movsd %xmm10, 0x10(%rax)
movsd %xmm9, 0x8(%rax)
movsd %xmm8, (%rax)
leaq 0x14e417(%rip), %rdi    # 0x1664e3
movb $0x8, %al
callq 0x12090
jmp 0x180d5
movq 0x198eb4(%rip), %rax    # 0x1b0f90
movq (%rax), %rdi
callq 0x12850
jmp 0x180e6
jmp 0x180e8
leaq 0x178(%rsp), %rdi
callq 0x7fc50
movl $0x1, %eax
addq $0x2a8, %rsp            # imm = 0x2A8
retq
movq 0x160(%rsp), %rdi
callq 0x12c20
nop