// File: tomfunkhouser[P]gaps/apps/gapsview/gapsview.cpp
// Function: DrawData(int)
static void
DrawData(int color_scheme)
{
  // Draw pointsets
  for (int m = 0; m < pointsets.NEntries(); m++) {
    if ((selected_model_index >= 0) && (m != selected_model_index)) continue;
    R3PointSet *pointset = pointsets[m];
    if (!pointset) continue;
    DrawPointSet(pointset, m, color_scheme);
  }
  
  // Draw scenes
  for (int m = 0; m < scenes.NEntries(); m++) {
    if ((selected_model_index >= 0) && (m != selected_model_index)) continue;
    R3Scene *scene = scenes[m];
    if (!scene) continue;
    DrawScene(scene, m, color_scheme);
  }
  
  // Draw meshes
  for (int m = 0; m < meshes.NEntries(); m++) {
    if ((selected_model_index >= 0) && (m != selected_model_index)) continue;
    R3Mesh *mesh = meshes[m];
    if (!mesh) continue;
    DrawMesh(mesh, m, color_scheme);
  }
  
  // Draw grids
  for (int m = 0; m < grids.NEntries(); m++) {
    if ((selected_model_index >= 0) && (m != selected_model_index)) continue;
    R3Grid *grid = grids[m];
    if (!grid) continue;
    DrawGrid(grid, m, color_scheme);
  }
  
  // Draw SFL scenes
  for (int m = 0; m < sfls.NEntries(); m++) {
    if ((selected_model_index >= 0) && (m != selected_model_index)) continue;
    R3SurfelScene *sfl = sfls[m];
    if (!sfl) continue;
    DrawSFL(sfl, m, color_scheme);
  }

  // Draw GSV scenes
  for (int m = 0; m < gsvs.NEntries(); m++) {
    if ((selected_model_index >= 0) && (m != selected_model_index)) continue;
    GSVScene *gsv = gsvs[m];
    if (!gsv) continue;
    DrawGSV(gsv, m, color_scheme);
  }
}

// Assembly:
subq $0x78, %rsp
movl %edi, 0x74(%rsp)
movl $0x0, 0x70(%rsp)
movl 0x70(%rsp), %eax
movl %eax, 0x14(%rsp)
leaq 0x2cda69(%rip), %rdi    # 0x2fe7f8
callq 0x38730
movl %eax, %ecx
movl 0x14(%rsp), %eax
cmpl %ecx, %eax
jge 0x30df6
cmpl $0x0, 0x2cdf1f(%rip)    # 0x2fecc4
jl 0x30db5
movl 0x70(%rsp), %eax
cmpl 0x2cdf13(%rip), %eax    # 0x2fecc4
je 0x30db5
jmp 0x30de9
movl 0x70(%rsp), %esi
leaq 0x2cda38(%rip), %rdi    # 0x2fe7f8
callq 0x387c0
movq (%rax), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x68(%rsp)
jne 0x30dd7
jmp 0x30de9
movq 0x68(%rsp), %rdi
movl 0x70(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x313a0
movl 0x70(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x70(%rsp)
jmp 0x30d80
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
movl %eax, 0x10(%rsp)
leaq 0x2cd9cb(%rip), %rdi    # 0x2fe7d8
callq 0x38730
movl %eax, %ecx
movl 0x10(%rsp), %eax
cmpl %ecx, %eax
jge 0x30e74
cmpl $0x0, 0x2cdea1(%rip)    # 0x2fecc4
jl 0x30e33
movl 0x64(%rsp), %eax
cmpl 0x2cde95(%rip), %eax    # 0x2fecc4
je 0x30e33
jmp 0x30e67
movl 0x64(%rsp), %esi
leaq 0x2cd99a(%rip), %rdi    # 0x2fe7d8
callq 0x38740
movq (%rax), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x58(%rsp)
jne 0x30e55
jmp 0x30e67
movq 0x58(%rsp), %rdi
movl 0x64(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x31610
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x30dfe
movl $0x0, 0x54(%rsp)
movl 0x54(%rsp), %eax
movl %eax, 0xc(%rsp)
leaq 0x2cd95d(%rip), %rdi    # 0x2fe7e8
callq 0x38730
movl %eax, %ecx
movl 0xc(%rsp), %eax
cmpl %ecx, %eax
jge 0x30ef2
cmpl $0x0, 0x2cde23(%rip)    # 0x2fecc4
jl 0x30eb1
movl 0x54(%rsp), %eax
cmpl 0x2cde17(%rip), %eax    # 0x2fecc4
je 0x30eb1
jmp 0x30ee5
movl 0x54(%rsp), %esi
leaq 0x2cd92c(%rip), %rdi    # 0x2fe7e8
callq 0x38780
movq (%rax), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0x48(%rsp)
jne 0x30ed3
jmp 0x30ee5
movq 0x48(%rsp), %rdi
movl 0x54(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x316e0
movl 0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x54(%rsp)
jmp 0x30e7c
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
movl %eax, 0x8(%rsp)
leaq 0x2cd8ff(%rip), %rdi    # 0x2fe808
callq 0x38730
movl %eax, %ecx
movl 0x8(%rsp), %eax
cmpl %ecx, %eax
jge 0x30f70
cmpl $0x0, 0x2cdda5(%rip)    # 0x2fecc4
jl 0x30f2f
movl 0x44(%rsp), %eax
cmpl 0x2cdd99(%rip), %eax    # 0x2fecc4
je 0x30f2f
jmp 0x30f63
movl 0x44(%rsp), %esi
leaq 0x2cd8ce(%rip), %rdi    # 0x2fe808
callq 0x38800
movq (%rax), %rax
movq %rax, 0x38(%rsp)
cmpq $0x0, 0x38(%rsp)
jne 0x30f51
jmp 0x30f63
movq 0x38(%rsp), %rdi
movl 0x44(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x31c10
movl 0x44(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x44(%rsp)
jmp 0x30efa
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
movl %eax, 0x4(%rsp)
leaq 0x2cd891(%rip), %rdi    # 0x2fe818
callq 0x38730
movl %eax, %ecx
movl 0x4(%rsp), %eax
cmpl %ecx, %eax
jge 0x30fee
cmpl $0x0, 0x2cdd27(%rip)    # 0x2fecc4
jl 0x30fad
movl 0x34(%rsp), %eax
cmpl 0x2cdd1b(%rip), %eax    # 0x2fecc4
je 0x30fad
jmp 0x30fe1
movl 0x34(%rsp), %esi
leaq 0x2cd860(%rip), %rdi    # 0x2fe818
callq 0x388e0
movq (%rax), %rax
movq %rax, 0x28(%rsp)
cmpq $0x0, 0x28(%rsp)
jne 0x30fcf
jmp 0x30fe1
movq 0x28(%rsp), %rdi
movl 0x34(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x31f80
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0x30f78
movl $0x0, 0x24(%rsp)
movl 0x24(%rsp), %eax
movl %eax, (%rsp)
leaq 0x2cd824(%rip), %rdi    # 0x2fe828
callq 0x38730
movl %eax, %ecx
movl (%rsp), %eax
cmpl %ecx, %eax
jge 0x3106a
cmpl $0x0, 0x2cdcab(%rip)    # 0x2fecc4
jl 0x31029
movl 0x24(%rsp), %eax
cmpl 0x2cdc9f(%rip), %eax    # 0x2fecc4
je 0x31029
jmp 0x3105d
movl 0x24(%rsp), %esi
leaq 0x2cd7f4(%rip), %rdi    # 0x2fe828
callq 0x38920
movq (%rax), %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
jne 0x3104b
jmp 0x3105d
movq 0x18(%rsp), %rdi
movl 0x24(%rsp), %esi
movl 0x74(%rsp), %edx
callq 0x32d70
movl 0x24(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
jmp 0x30ff6
addq $0x78, %rsp
retq
nop