// File: ncbi[P]amr/common.cpp
// Function: Common_sp::Dir::create()
size_t Dir::create ()
{
  if (items. empty ())
    return 0;

  const string path (get ());

  const Filetype ft = getFiletype (path, true);
  switch (ft)
  {
    case Filetype::dir: return 0;
    case Filetype::none: break;
    default: throw runtime_error ("Cannot create directory " + strQuote (path) + " because it is a " + filetype2name (ft));
  }

  const string item (items. popBack ());
  if (item. empty ())
  {
    ASSERT (items. empty ());
    throw runtime_error ("Cannot create the root directory");
  }
  const size_t n = create ();
  items << item;
  if (mkdir (path. c_str (), 0777) != 0)  // PAR
    throw runtime_error ("Cannot create directory " + strQuote (path));

  return n + 1;
}

// Assembly:
subq $0x2c8, %rsp            # imm = 0x2C8
movq %rdi, 0x2b8(%rsp)
movq 0x2b8(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x2e190
testb $0x1, %al
jne 0x47497
jmp 0x474a8
movq $0x0, 0x2c0(%rsp)
jmp 0x47be2
movq 0x50(%rsp), %rsi
leaq 0x298(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0x2e8c0
movq 0x40(%rsp), %rdi
movl $0x1, %esi
callq 0x43f40
movl %eax, 0x4c(%rsp)
jmp 0x474d4
movl 0x4c(%rsp), %eax
movl %eax, 0x294(%rsp)
movl 0x294(%rsp), %eax
movl %eax, 0x3c(%rsp)
testl %eax, %eax
je 0x47530
jmp 0x474f0
movl 0x3c(%rsp), %eax
subl $0x1, %eax
je 0x47514
jmp 0x47535
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x47bd3
movq $0x0, 0x2c0(%rsp)
movl $0x1, 0x280(%rsp)
jmp 0x47bc4
jmp 0x476f6
movb $0x1, 0x1df(%rsp)
movl $0x10, %edi
callq 0xc3b0
movq %rax, 0x30(%rsp)
leaq 0x200(%rsp), %rdi
leaq 0x298(%rsp), %rsi
movl $0x22, %edx
callq 0x424f0
jmp 0x47568
leaq 0x86951(%rip), %rsi     # 0xcdec0
leaq 0x220(%rsp), %rdi
leaq 0x200(%rsp), %rdx
callq 0x2a340
jmp 0x47586
leaq 0x86a6f(%rip), %rdx     # 0xcdffc
leaq 0x240(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x2a2f0
jmp 0x475a4
movl 0x294(%rsp), %esi
leaq 0x1e0(%rsp), %rdi
callq 0x457c0
jmp 0x475ba
leaq 0x260(%rsp), %rdi
leaq 0x240(%rsp), %rsi
leaq 0x1e0(%rsp), %rdx
callq 0x2dde0
jmp 0x475d9
movq 0x30(%rsp), %rdi
leaq 0x260(%rsp), %rsi
callq 0xcbb0
jmp 0x475ed
movq 0x30(%rsp), %rdi
movb $0x0, 0x1df(%rsp)
movq 0xbe9ef(%rip), %rsi     # 0x105ff0
movq 0xbe968(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x47bff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x476db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x476ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x476c1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x476b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x476a7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
leaq 0x260(%rsp), %rdi
callq 0xce98
leaq 0x1e0(%rsp), %rdi
callq 0xce98
leaq 0x240(%rsp), %rdi
callq 0xce98
leaq 0x220(%rsp), %rdi
callq 0xce98
leaq 0x200(%rsp), %rdi
callq 0xce98
testb $0x1, 0x1df(%rsp)
jne 0x476e7
jmp 0x476f1
movq 0x30(%rsp), %rdi
callq 0xc580
jmp 0x47bd3
movq 0x50(%rsp), %rsi
leaq 0x1b8(%rsp), %rdi
callq 0x73f40
jmp 0x4770a
leaq 0x1b8(%rsp), %rdi
callq 0xcc10
testb $0x1, %al
jne 0x47720
jmp 0x47a4c
callq 0xc090
movq 0x50(%rsp), %rdi
movl $0x0, (%rax)
callq 0x2e190
movb %al, 0x2f(%rsp)
jmp 0x4773b
movb 0x2f(%rsp), %al
testb $0x1, %al
jne 0x479e9
jmp 0x47749
callq 0xc8c0
cmpl $0x0, %eax
jne 0x479df
leaq 0x117(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xcd00
movq 0x20(%rsp), %rdx
leaq 0x862a4(%rip), %rsi     # 0xcda19
leaq 0x118(%rsp), %rdi
callq 0x29fd0
jmp 0x47784
leaq 0xf0(%rsp), %rdi
movl $0x5b8, %esi            # imm = 0x5B8
callq 0x2ded0
jmp 0x47798
leaq 0x138(%rsp), %rdi
leaq 0x118(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
callq 0x2dde0
jmp 0x477b7
leaq 0x843e3(%rip), %rdx     # 0xcbba1
leaq 0x158(%rsp), %rdi
leaq 0x138(%rsp), %rsi
callq 0x2a2f0
jmp 0x477d5
leaq 0xaf(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0xcd00
movq 0x18(%rsp), %rdx
leaq 0x8681b(%rip), %rsi     # 0xce00e
leaq 0xb0(%rsp), %rdi
callq 0x29fd0
jmp 0x47802
leaq 0x8620d(%rip), %rdx     # 0xcda16
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x2a2f0
jmp 0x47820
leaq 0x178(%rsp), %rdi
leaq 0x158(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x2dde0
jmp 0x4783f
leaq 0x867e8(%rip), %rdx     # 0xce02e
leaq 0x198(%rsp), %rdi
leaq 0x178(%rsp), %rsi
callq 0x2a2f0
jmp 0x4785d
leaq 0x198(%rsp), %rdi
callq 0x3e9b0
jmp 0x4786c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x47bb5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x479cd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x479c0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x479b3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x479a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x4798c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x4797f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x47972
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x47965
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
leaq 0x198(%rsp), %rdi
callq 0xce98
leaq 0x178(%rsp), %rdi
callq 0xce98
leaq 0xd0(%rsp), %rdi
callq 0xce98
leaq 0xb0(%rsp), %rdi
callq 0xce98
leaq 0xaf(%rsp), %rdi
callq 0xc7a0
leaq 0x158(%rsp), %rdi
callq 0xce98
leaq 0x138(%rsp), %rdi
callq 0xce98
leaq 0xf0(%rsp), %rdi
callq 0xce98
leaq 0x118(%rsp), %rdi
callq 0xce98
leaq 0x117(%rsp), %rdi
callq 0xc7a0
jmp 0x47bb5
movl $0x1, %edi
callq 0xc8d0
movl $0x10, %edi
callq 0xc3b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x10(%rsp)
leaq 0x86639(%rip), %rsi     # 0xce03e
callq 0xc2e0
jmp 0x47a0c
movq 0x10(%rsp), %rdi
movq 0xbe5d8(%rip), %rsi     # 0x105ff0
movq 0xbe551(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x47bff
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
callq 0xc580
jmp 0x47bb5
movq 0x50(%rsp), %rdi
callq 0x47470
movq %rax, 0x8(%rsp)
jmp 0x47a5d
movq 0x50(%rsp), %rdi
movq 0x8(%rsp), %rax
movq %rax, 0xa0(%rsp)
leaq 0x1b8(%rsp), %rsi
callq 0x74020
jmp 0x47a7e
leaq 0x298(%rsp), %rdi
callq 0xc300
movq %rax, %rdi
movl $0x1ff, %esi            # imm = 0x1FF
callq 0xc380
cmpl $0x0, %eax
je 0x47b87
movb $0x1, 0x5f(%rsp)
movl $0x10, %edi
callq 0xc3b0
movq %rax, (%rsp)
leaq 0x60(%rsp), %rdi
leaq 0x298(%rsp), %rsi
movl $0x22, %edx
callq 0x424f0
jmp 0x47acd
leaq 0x863ec(%rip), %rsi     # 0xcdec0
leaq 0x80(%rsp), %rdi
leaq 0x60(%rsp), %rdx
callq 0x2a340
jmp 0x47ae8
movq (%rsp), %rdi
leaq 0x80(%rsp), %rsi
callq 0xcbb0
jmp 0x47afb
movq (%rsp), %rdi
movb $0x0, 0x5f(%rsp)
movq 0xbe4e5(%rip), %rsi     # 0x105ff0
movq 0xbe45e(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x47bff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x47b73
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
jmp 0x47b69
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x288(%rsp)
movl %eax, 0x284(%rsp)
leaq 0x80(%rsp), %rdi
callq 0xce98
leaq 0x60(%rsp), %rdi
callq 0xce98
testb $0x1, 0x5f(%rsp)
jne 0x47b7c
jmp 0x47b85
movq (%rsp), %rdi
callq 0xc580
jmp 0x47bb5
movq 0xa0(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x2c0(%rsp)
movl $0x1, 0x280(%rsp)
leaq 0x1b8(%rsp), %rdi
callq 0xce98
jmp 0x47bc4
leaq 0x1b8(%rsp), %rdi
callq 0xce98
jmp 0x47bd3
leaq 0x298(%rsp), %rdi
callq 0xce98
jmp 0x47be2
leaq 0x298(%rsp), %rdi
callq 0xce98
jmp 0x47bf2
movq 0x2c0(%rsp), %rax
addq $0x2c8, %rsp            # imm = 0x2C8
retq
movq 0x288(%rsp), %rdi
callq 0xccf0
nop