// File: tomfunkhouser[P]gaps/pkgs/GSV/GSVScene.cpp
// Function: gaps::GSVScene::CreateCacheDataDirectory(char const*, gaps::GSVRun*) const
int GSVScene::
CreateCacheDataDirectory(const char *subdirectory, GSVRun *run) const
{
  // Check cache directory name
  if (!cache_data_directory_name) return 0;

  // Create the cache subdirectory
  if (subdirectory && (strlen(subdirectory) > 0)) {
    char cmd[4096];
    if (run->Name()) sprintf(cmd, "mkdir -p %s/%s/%s", cache_data_directory_name, subdirectory, run->Name());
    else sprintf(cmd, "mkdir -p %s/%s/Run%d", cache_data_directory_name, subdirectory, run->SceneIndex());
    system(cmd);
  }
  else if (run) {
    char cmd[4096];
    if (run->Name()) sprintf(cmd, "mkdir -p %s/run_data/%s", cache_data_directory_name, run->Name());
    else sprintf(cmd, "mkdir -p %s/run_data/Run%d", cache_data_directory_name, run->SceneIndex());
    system(cmd);
  }
  else {
    char cmd[4096];
    sprintf(cmd, "mkdir -p %s", cache_data_directory_name);
    system(cmd);
  }

  // Return success
  return 1;
}

// Assembly:
subq $0x3088, %rsp           # imm = 0x3088
movq %rdi, 0x3078(%rsp)
movq %rsi, 0x3070(%rsp)
movq %rdx, 0x3068(%rsp)
movq 0x3078(%rsp), %rax
movq %rax, 0x58(%rsp)
cmpq $0x0, 0x28(%rax)
jne 0x3bae3
movl $0x0, 0x3084(%rsp)
jmp 0x3bcc5
cmpq $0x0, 0x3070(%rsp)
je 0x3bbda
movq 0x3070(%rsp), %rdi
callq 0x29760
cmpq $0x0, %rax
jbe 0x3bbda
movq 0x3068(%rsp), %rdi
callq 0x44310
cmpq $0x0, %rax
je 0x3bb73
movq 0x58(%rsp), %rax
leaq 0x2060(%rsp), %rcx
movq %rcx, 0x40(%rsp)
movq 0x28(%rax), %rax
movq %rax, 0x48(%rsp)
movq 0x3070(%rsp), %rax
movq %rax, 0x50(%rsp)
movq 0x3068(%rsp), %rdi
callq 0x44310
movq 0x40(%rsp), %rdi
movq 0x48(%rsp), %rdx
movq 0x50(%rsp), %rcx
movq %rax, %r8
leaq 0x22af91(%rip), %rsi    # 0x266afb
movb $0x0, %al
callq 0x2a280
jmp 0x3bbc8
movq 0x58(%rsp), %rax
leaq 0x2060(%rsp), %rcx
movq %rcx, 0x28(%rsp)
movq 0x28(%rax), %rax
movq %rax, 0x30(%rsp)
movq 0x3070(%rsp), %rax
movq %rax, 0x38(%rsp)
movq 0x3068(%rsp), %rdi
callq 0x443f0
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
movq 0x38(%rsp), %rcx
movl %eax, %r8d
leaq 0x22af4c(%rip), %rsi    # 0x266b0d
movb $0x0, %al
callq 0x2a280
leaq 0x2060(%rsp), %rdi
callq 0x2a560
jmp 0x3bcba
cmpq $0x0, 0x3068(%rsp)
je 0x3bc92
movq 0x3068(%rsp), %rdi
callq 0x44310
cmpq $0x0, %rax
je 0x3bc41
movq 0x58(%rsp), %rax
leaq 0x1060(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq 0x28(%rax), %rax
movq %rax, 0x20(%rsp)
movq 0x3068(%rsp), %rdi
callq 0x44310
movq 0x18(%rsp), %rdi
movq 0x20(%rsp), %rdx
movq %rax, %rcx
leaq 0x22aeea(%rip), %rsi    # 0x266b22
movb $0x0, %al
callq 0x2a280
jmp 0x3bc83
movq 0x58(%rsp), %rax
leaq 0x1060(%rsp), %rcx
movq %rcx, 0x8(%rsp)
movq 0x28(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x3068(%rsp), %rdi
callq 0x443f0
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %rdx
movl %eax, %ecx
leaq 0x22aebe(%rip), %rsi    # 0x266b3a
movb $0x0, %al
callq 0x2a280
leaq 0x1060(%rsp), %rdi
callq 0x2a560
jmp 0x3bcb8
movq 0x58(%rsp), %rax
leaq 0x60(%rsp), %rdi
movq 0x28(%rax), %rdx
leaq 0x22aeae(%rip), %rsi    # 0x266b55
movb $0x0, %al
callq 0x2a280
leaq 0x60(%rsp), %rdi
callq 0x2a560
jmp 0x3bcba
movl $0x1, 0x3084(%rsp)
movl 0x3084(%rsp), %eax
addq $0x3088, %rsp           # imm = 0x3088
retq
nopw %cs:(%rax,%rax)