// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVSegment.cpp
// Function: gaps::GSVSegment::Print(_IO_FILE*, char const*, char const*) const
void GSVSegment::
Print(FILE *fp, const char *prefix, const char *suffix) const
{
  // Check fp
  if (!fp) fp = stdout;

  // Print segment 
  if (prefix) fprintf(fp, "%s", prefix);
  fprintf(fp, "Segment %d:", run_index);
  if (suffix) fprintf(fp, "%s", suffix);
  fprintf(fp, "\n");

  // Add indentation to prefix
  char indented_prefix[1024];
  sprintf(indented_prefix, "%s  ", prefix);

  // Print surveys
  for (int i = 0; i < NSurveys(); i++) {
    GSVSurvey *survey = Survey(i);
    survey->Print(fp, indented_prefix, suffix);
  }

  // Print tapestries
  for (int i = 0; i < NTapestries(); i++) {
    GSVTapestry *tapestry = Tapestry(i);
    tapestry->Print(fp, indented_prefix, suffix);
  }

  // Print panorama
  for (int i = 0; i < NPanoramas(); i++) {
    GSVPanorama *panorama = Panorama(i);
    panorama->Print(fp, indented_prefix, suffix);
  }
}

// Assembly:
subq $0x478, %rsp            # imm = 0x478
movq %rdi, 0x470(%rsp)
movq %rsi, 0x468(%rsp)
movq %rdx, 0x460(%rsp)
movq %rcx, 0x458(%rsp)
movq 0x470(%rsp), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x468(%rsp)
jne 0x49401
movq 0x2a5bd2(%rip), %rax    # 0x2eefc8
movq (%rax), %rax
movq %rax, 0x468(%rsp)
cmpq $0x0, 0x460(%rsp)
je 0x4942a
movq 0x468(%rsp), %rdi
movq 0x460(%rsp), %rdx
leaq 0x236e04(%rip), %rsi    # 0x280227
movb $0x0, %al
callq 0x293c0
movq 0x18(%rsp), %rax
movq 0x468(%rsp), %rdi
movl 0x18(%rax), %edx
leaq 0x21db8f(%rip), %rsi    # 0x266fd0
movb $0x0, %al
callq 0x293c0
cmpq $0x0, 0x458(%rsp)
je 0x49471
movq 0x468(%rsp), %rdi
movq 0x458(%rsp), %rdx
leaq 0x236dbd(%rip), %rsi    # 0x280227
movb $0x0, %al
callq 0x293c0
movq 0x468(%rsp), %rdi
leaq 0x21d986(%rip), %rsi    # 0x266e06
movb $0x0, %al
callq 0x293c0
leaq 0x50(%rsp), %rdi
movq 0x460(%rsp), %rdx
leaq 0x21d65b(%rip), %rsi    # 0x266af6
movb $0x0, %al
callq 0x2a280
movl $0x0, 0x4c(%rsp)
movq 0x18(%rsp), %rdi
movl 0x4c(%rsp), %eax
movl %eax, 0x14(%rsp)
callq 0x3a030
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x49506
movq 0x18(%rsp), %rdi
movl 0x4c(%rsp), %esi
callq 0x3a050
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
movq 0x468(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq 0x458(%rsp), %rcx
movq (%rdi), %rax
callq *0x18(%rax)
movl 0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4c(%rsp)
jmp 0x494aa
movl $0x0, 0x3c(%rsp)
movq 0x18(%rsp), %rdi
movl 0x3c(%rsp), %eax
movl %eax, 0x10(%rsp)
callq 0x44b60
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jge 0x4956a
movq 0x18(%rsp), %rdi
movl 0x3c(%rsp), %esi
callq 0x44810
movq %rax, 0x30(%rsp)
movq 0x30(%rsp), %rdi
movq 0x468(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq 0x458(%rsp), %rcx
movq (%rdi), %rax
callq *0x18(%rax)
movl 0x3c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x3c(%rsp)
jmp 0x4950e
movl $0x0, 0x2c(%rsp)
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %eax
movl %eax, 0xc(%rsp)
callq 0x3a290
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x495ce
movq 0x18(%rsp), %rdi
movl 0x2c(%rsp), %esi
callq 0x3a2b0
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x468(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movq 0x458(%rsp), %rcx
movq (%rdi), %rax
callq *0x18(%rax)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x49572
addq $0x478, %rsp            # imm = 0x478
retq
nopw %cs:(%rax,%rax)