// File: tomfunkhouser[P]gaps/apps/conf2sfl/conf2sfl.cpp
// Function: CloseSurfelScene(gaps::R3SurfelScene*)
static int
CloseSurfelScene(R3SurfelScene *scene)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Print statistics
  if (print_verbose) {
    printf("Closing scene ...\n");
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Objects = %d\n", scene->NObjects());
    printf("  # Labels = %d\n", scene->NLabels());
    printf("  # Assignments = %d\n", scene->NLabelAssignments());
    printf("  # Features = %d\n", scene->NFeatures());
    printf("  # Scans = %d\n", scene->NScans());
    printf("  # Images = %d\n", scene->NImages());
    printf("  # Nodes = %d\n", scene->Tree()->NNodes());
    printf("  # Nodes = %d\n", scene->Tree()->NNodes());
    printf("  # Blocks = %d\n", scene->Tree()->Database()->NBlocks());
    printf("  # Surfels = %lld\n", scene->Tree()->Database()->NSurfels());
    fflush(stdout);
  }

  // Close surfel scene files
  if (!scene->CloseFile()) {
    delete scene;
    return 0;
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x18(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x172a30
leaq 0x8(%rsp), %rdi
callq 0x1ec90
cmpl $0x0, 0x24ddc8(%rip)    # 0x26881c
je 0x1abc4
leaq 0x1e2b69(%rip), %rdi    # 0x1fd5ca
movb $0x0, %al
callq 0x16090
leaq 0x8(%rsp), %rdi
callq 0x172af0
leaq 0x1e27e2(%rip), %rdi    # 0x1fd25b
movb $0x1, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1ed00
movl %eax, %esi
leaq 0x1e282f(%rip), %rdi    # 0x1fd2c2
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1ed20
movl %eax, %esi
leaq 0x1e2827(%rip), %rdi    # 0x1fd2d4
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1ed40
movl %eax, %esi
leaq 0x1e281e(%rip), %rdi    # 0x1fd2e5
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1ed60
movl %eax, %esi
leaq 0x1e281a(%rip), %rdi    # 0x1fd2fb
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1ed80
movl %eax, %esi
leaq 0x1e2813(%rip), %rdi    # 0x1fd30e
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1eda0
movl %eax, %esi
leaq 0x1e275d(%rip), %rdi    # 0x1fd272
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1edc0
movq %rax, %rdi
callq 0x1edd0
movl %eax, %esi
leaq 0x1e27e7(%rip), %rdi    # 0x1fd31e
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1edc0
movq %rax, %rdi
callq 0x1edd0
movl %eax, %esi
leaq 0x1e27c5(%rip), %rdi    # 0x1fd31e
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1edc0
movq %rax, %rdi
callq 0x1edf0
movq %rax, %rdi
callq 0x1ee00
movl %eax, %esi
leaq 0x1e27ab(%rip), %rdi    # 0x1fd32e
movb $0x0, %al
callq 0x16090
movq 0x18(%rsp), %rdi
callq 0x1edc0
movq %rax, %rdi
callq 0x1edf0
movq %rax, %rdi
callq 0x1ee20
movq %rax, %rsi
leaq 0x1e2791(%rip), %rdi    # 0x1fd33f
movb $0x0, %al
callq 0x16090
movq 0x2443d4(%rip), %rax    # 0x25ef90
movq (%rax), %rdi
callq 0x168c0
movq 0x18(%rsp), %rdi
movq (%rdi), %rax
xorl %ecx, %ecx
movl %ecx, %esi
callq *0xf8(%rax)
cmpl $0x0, %eax
jne 0x1abfe
movq 0x18(%rsp), %rax
movq %rax, (%rsp)
cmpq $0x0, %rax
je 0x1abf4
movq (%rsp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x0, 0x24(%rsp)
jmp 0x1ac06
movl $0x1, 0x24(%rsp)
movl 0x24(%rsp), %eax
addq $0x28, %rsp
retq
nop