// File: ncbi[P]amr/common.cpp
// Function: Common_sp::setSymlink(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, bool)
void setSymlink (string fromFName,
                 const string &toFName,
                 bool fromPathIsAbsolute)
{ 
  ASSERT (! fromFName. empty ());
  ASSERT (! toFName. empty ());
  const string err (string ("Cannot make ") + (fromPathIsAbsolute ? "an absolute" : "a relative") + " symlink for " + strQuote (fromFName) + " as " + strQuote (toFName));
  if (fromPathIsAbsolute)
    fromFName = path2canonical (fromFName);
  else
  { 
    if (fromFName [0] == '/')
      throw runtime_error (err + " because " + strQuote (fromFName) + " is absolute");
    const Dir dir (toFName);
    const string absPath (dir. getParent () + "/" + fromFName);
    if (getFiletype (absPath, false) == Filetype::none)
      throw runtime_error (err + " because " + strQuote (absPath) + " does not exist");
  }
  if (symlink (fromFName. c_str (), toFName. c_str ()))
    throw runtime_error (err);
}

// Assembly:
subq $0x558, %rsp            # imm = 0x558
movq %rdi, 0x58(%rsp)
movb %dl, %al
movq %rdi, 0x550(%rsp)
movq %rsi, 0x548(%rsp)
andb $0x1, %al
movb %al, 0x547(%rsp)
callq 0xc090
movq 0x58(%rsp), %rdi
movl $0x0, (%rax)
callq 0xcc10
testb $0x1, %al
jne 0x47c45
jmp 0x47ecc
callq 0xc8c0
cmpl $0x0, %eax
jne 0x47ec2
leaq 0x49f(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xcd00
movq 0x50(%rsp), %rdx
leaq 0x85da8(%rip), %rsi     # 0xcda19
leaq 0x4a0(%rsp), %rdi
callq 0x29fd0
jmp 0x47c80
leaq 0x468(%rsp), %rdi
movl $0x5cd, %esi            # imm = 0x5CD
callq 0x2ded0
jmp 0x47c94
leaq 0x4c0(%rsp), %rdi
leaq 0x4a0(%rsp), %rsi
leaq 0x468(%rsp), %rdx
callq 0x2dde0
jmp 0x47cb3
leaq 0x83ee7(%rip), %rdx     # 0xcbba1
leaq 0x4e0(%rsp), %rdi
leaq 0x4c0(%rsp), %rsi
callq 0x2a2f0
jmp 0x47cd1
leaq 0x427(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xcd00
movq 0x48(%rsp), %rdx
leaq 0x86370(%rip), %rsi     # 0xce05f
leaq 0x428(%rsp), %rdi
callq 0x29fd0
jmp 0x47cfe
leaq 0x85d11(%rip), %rdx     # 0xcda16
leaq 0x448(%rsp), %rdi
leaq 0x428(%rsp), %rsi
callq 0x2a2f0
jmp 0x47d1c
leaq 0x500(%rsp), %rdi
leaq 0x4e0(%rsp), %rsi
leaq 0x448(%rsp), %rdx
callq 0x2dde0
jmp 0x47d3b
leaq 0x86356(%rip), %rdx     # 0xce098
leaq 0x520(%rsp), %rdi
leaq 0x500(%rsp), %rsi
callq 0x2a2f0
jmp 0x47d59
leaq 0x520(%rsp), %rdi
callq 0x3e9b0
jmp 0x47d68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47eb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47ea3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47e96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47e89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47e6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47e62
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47e55
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x47e48
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
leaq 0x520(%rsp), %rdi
callq 0xce98
leaq 0x500(%rsp), %rdi
callq 0xce98
leaq 0x448(%rsp), %rdi
callq 0xce98
leaq 0x428(%rsp), %rdi
callq 0xce98
leaq 0x427(%rsp), %rdi
callq 0xc7a0
leaq 0x4e0(%rsp), %rdi
callq 0xce98
leaq 0x4c0(%rsp), %rdi
callq 0xce98
leaq 0x468(%rsp), %rdi
callq 0xce98
leaq 0x4a0(%rsp), %rdi
callq 0xce98
leaq 0x49f(%rsp), %rdi
callq 0xc7a0
jmp 0x4898e
movl $0x1, %edi
callq 0xc8d0
callq 0xc090
movl $0x0, (%rax)
movq 0x548(%rsp), %rdi
callq 0xcc10
testb $0x1, %al
jne 0x47eed
jmp 0x48174
callq 0xc8c0
cmpl $0x0, %eax
jne 0x4816a
leaq 0x37f(%rsp), %rdi
movq %rdi, 0x40(%rsp)
callq 0xcd00
movq 0x40(%rsp), %rdx
leaq 0x85b00(%rip), %rsi     # 0xcda19
leaq 0x380(%rsp), %rdi
callq 0x29fd0
jmp 0x47f28
leaq 0x358(%rsp), %rdi
movl $0x5ce, %esi            # imm = 0x5CE
callq 0x2ded0
jmp 0x47f3c
leaq 0x3a0(%rsp), %rdi
leaq 0x380(%rsp), %rsi
leaq 0x358(%rsp), %rdx
callq 0x2dde0
jmp 0x47f5b
leaq 0x83c3f(%rip), %rdx     # 0xcbba1
leaq 0x3c0(%rsp), %rdi
leaq 0x3a0(%rsp), %rsi
callq 0x2a2f0
jmp 0x47f79
leaq 0x317(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xcd00
movq 0x38(%rsp), %rdx
leaq 0x860c8(%rip), %rsi     # 0xce05f
leaq 0x318(%rsp), %rdi
callq 0x29fd0
jmp 0x47fa6
leaq 0x85a69(%rip), %rdx     # 0xcda16
leaq 0x338(%rsp), %rdi
leaq 0x318(%rsp), %rsi
callq 0x2a2f0
jmp 0x47fc4
leaq 0x3e0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
leaq 0x338(%rsp), %rdx
callq 0x2dde0
jmp 0x47fe3
leaq 0x860c4(%rip), %rdx     # 0xce0ae
leaq 0x400(%rsp), %rdi
leaq 0x3e0(%rsp), %rsi
callq 0x2a2f0
jmp 0x48001
leaq 0x400(%rsp), %rdi
callq 0x3e9b0
jmp 0x48010
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48158
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4814b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4813e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48131
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48117
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4810a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x480fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x480f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
leaq 0x400(%rsp), %rdi
callq 0xce98
leaq 0x3e0(%rsp), %rdi
callq 0xce98
leaq 0x338(%rsp), %rdi
callq 0xce98
leaq 0x318(%rsp), %rdi
callq 0xce98
leaq 0x317(%rsp), %rdi
callq 0xc7a0
leaq 0x3c0(%rsp), %rdi
callq 0xce98
leaq 0x3a0(%rsp), %rdi
callq 0xce98
leaq 0x358(%rsp), %rdi
callq 0xce98
leaq 0x380(%rsp), %rdi
callq 0xce98
leaq 0x37f(%rsp), %rdi
callq 0xc7a0
jmp 0x4898e
movl $0x1, %edi
callq 0xc8d0
leaq 0x24f(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0xcd00
movq 0x30(%rsp), %rdx
leaq 0x85f30(%rip), %rsi     # 0xce0c2
leaq 0x250(%rsp), %rdi
callq 0x29fd0
jmp 0x481a1
movb 0x547(%rsp), %cl
leaq 0x85f20(%rip), %rax     # 0xce0cf
leaq 0x85f25(%rip), %rdx     # 0xce0db
testb $0x1, %cl
cmovneq %rax, %rdx
leaq 0x270(%rsp), %rdi
leaq 0x250(%rsp), %rsi
callq 0x2a2f0
jmp 0x481d4
leaq 0x85f0b(%rip), %rdx     # 0xce0e6
leaq 0x290(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x2a2f0
jmp 0x481f2
movq 0x58(%rsp), %rsi
leaq 0x228(%rsp), %rdi
movl $0x22, %edx
callq 0x424f0
jmp 0x4820b
leaq 0x2b0(%rsp), %rdi
leaq 0x290(%rsp), %rsi
leaq 0x228(%rsp), %rdx
callq 0x2dde0
jmp 0x4822a
leaq 0x87b0f(%rip), %rdx     # 0xcfd40
leaq 0x2d0(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x2a2f0
jmp 0x48248
movq 0x548(%rsp), %rsi
leaq 0x208(%rsp), %rdi
movl $0x22, %edx
callq 0x424f0
jmp 0x48264
leaq 0x2f0(%rsp), %rdi
leaq 0x2d0(%rsp), %rsi
leaq 0x208(%rsp), %rdx
callq 0x2dde0
jmp 0x48283
leaq 0x208(%rsp), %rdi
callq 0xce98
leaq 0x2d0(%rsp), %rdi
callq 0xce98
leaq 0x2b0(%rsp), %rdi
callq 0xce98
leaq 0x228(%rsp), %rdi
callq 0xce98
leaq 0x290(%rsp), %rdi
callq 0xce98
leaq 0x270(%rsp), %rdi
callq 0xce98
leaq 0x250(%rsp), %rdi
callq 0xce98
leaq 0x24f(%rsp), %rdi
callq 0xc7a0
testb $0x1, 0x547(%rsp)
je 0x48471
movq 0x58(%rsp), %rsi
leaq 0x1e8(%rsp), %rdi
callq 0x2ec10
jmp 0x4830d
movq 0x58(%rsp), %rdi
leaq 0x1e8(%rsp), %rsi
callq 0xc8f0
leaq 0x1e8(%rsp), %rdi
callq 0xce98
jmp 0x488e3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48446
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48439
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4842c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4841f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48412
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48405
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x483f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
leaq 0x208(%rsp), %rdi
callq 0xce98
leaq 0x2d0(%rsp), %rdi
callq 0xce98
leaq 0x2b0(%rsp), %rdi
callq 0xce98
leaq 0x228(%rsp), %rdi
callq 0xce98
leaq 0x290(%rsp), %rdi
callq 0xce98
leaq 0x270(%rsp), %rdi
callq 0xce98
leaq 0x250(%rsp), %rdi
callq 0xce98
leaq 0x24f(%rsp), %rdi
callq 0xc7a0
jmp 0x4898e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48981
movq 0x58(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xce50
movq %rax, 0x28(%rsp)
jmp 0x48486
movq 0x28(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x48619
movb $0x1, 0x167(%rsp)
movl $0x10, %edi
callq 0xc3b0
movq %rax, 0x20(%rsp)
leaq 0x85c3f(%rip), %rdx     # 0xce0f4
leaq 0x188(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x2d9a0
jmp 0x484cc
movq 0x58(%rsp), %rsi
leaq 0x168(%rsp), %rdi
movl $0x22, %edx
callq 0x424f0
jmp 0x484e5
leaq 0x1a8(%rsp), %rdi
leaq 0x188(%rsp), %rsi
leaq 0x168(%rsp), %rdx
callq 0x2dde0
jmp 0x48504
leaq 0x85bf3(%rip), %rdx     # 0xce0fe
leaq 0x1c8(%rsp), %rdi
leaq 0x1a8(%rsp), %rsi
callq 0x2a2f0
jmp 0x48522
movq 0x20(%rsp), %rdi
leaq 0x1c8(%rsp), %rsi
callq 0xcbb0
jmp 0x48536
movq 0x20(%rsp), %rdi
movb $0x0, 0x167(%rsp)
movq 0xbdaa6(%rip), %rsi     # 0x105ff0
movq 0xbda1f(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x4899b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x485fe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x485f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x485e4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x485d7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
leaq 0x1c8(%rsp), %rdi
callq 0xce98
leaq 0x1a8(%rsp), %rdi
callq 0xce98
leaq 0x168(%rsp), %rdi
callq 0xce98
leaq 0x188(%rsp), %rdi
callq 0xce98
testb $0x1, 0x167(%rsp)
jne 0x4860a
jmp 0x48614
movq 0x20(%rsp), %rdi
callq 0xc580
jmp 0x48981
movq 0x548(%rsp), %rsi
leaq 0x148(%rsp), %rdi
callq 0x46b00
jmp 0x48630
leaq 0xe8(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x2e270
jmp 0x48647
leaq 0x85db0(%rip), %rdx     # 0xce3fe
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
callq 0x2a2f0
jmp 0x48665
movq 0x58(%rsp), %rdx
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0x2e220
jmp 0x48681
leaq 0x108(%rsp), %rdi
callq 0xce98
leaq 0xe8(%rsp), %rdi
callq 0xce98
leaq 0x128(%rsp), %rdi
xorl %esi, %esi
callq 0x43f40
movl %eax, 0x1c(%rsp)
jmp 0x486b0
movl 0x1c(%rsp), %eax
cmpl $0x0, %eax
jne 0x488a8
movb $0x1, 0x67(%rsp)
movl $0x10, %edi
callq 0xc3b0
movq %rax, 0x10(%rsp)
leaq 0x85a1c(%rip), %rdx     # 0xce0f4
leaq 0x88(%rsp), %rdi
leaq 0x2f0(%rsp), %rsi
callq 0x2d9a0
jmp 0x486ef
leaq 0x68(%rsp), %rdi
leaq 0x128(%rsp), %rsi
movl $0x22, %edx
callq 0x424f0
jmp 0x48708
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x2dde0
jmp 0x48724
leaq 0x859e0(%rip), %rdx     # 0xce10b
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0x2a2f0
jmp 0x48742
movq 0x10(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
callq 0xcbb0
jmp 0x48756
movq 0x10(%rsp), %rdi
movb $0x0, 0x67(%rsp)
movq 0xbd889(%rip), %rsi     # 0x105ff0
movq 0xbd802(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x4899b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x488d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x487c8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
leaq 0x108(%rsp), %rdi
callq 0xce98
leaq 0xe8(%rsp), %rdi
callq 0xce98
jmp 0x488d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x488c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48893
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x48886
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4887c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
jmp 0x4886f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
leaq 0xc8(%rsp), %rdi
callq 0xce98
leaq 0xa8(%rsp), %rdi
callq 0xce98
leaq 0x68(%rsp), %rdi
callq 0xce98
leaq 0x88(%rsp), %rdi
callq 0xce98
testb $0x1, 0x67(%rsp)
jne 0x4889c
jmp 0x488a6
movq 0x10(%rsp), %rdi
callq 0xc580
jmp 0x488c4
leaq 0x128(%rsp), %rdi
callq 0xce98
leaq 0x148(%rsp), %rdi
callq 0x2ebe0
jmp 0x488e3
leaq 0x128(%rsp), %rdi
callq 0xce98
leaq 0x148(%rsp), %rdi
callq 0x2ebe0
jmp 0x48981
movq 0x58(%rsp), %rdi
callq 0xc300
movq %rax, 0x8(%rsp)
movq 0x548(%rsp), %rdi
callq 0xc300
movq 0x8(%rsp), %rdi
movq %rax, %rsi
callq 0xc0a0
cmpl $0x0, %eax
je 0x4896c
movl $0x10, %edi
callq 0xc3b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, (%rsp)
leaq 0x2f0(%rsp), %rsi
callq 0xcbb0
jmp 0x48934
movq (%rsp), %rdi
movq 0xbd6b1(%rip), %rsi     # 0x105ff0
movq 0xbd62a(%rip), %rdx     # 0x105f70
callq 0xcc80
jmp 0x4899b
movq (%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x490(%rsp)
movl %eax, 0x48c(%rsp)
callq 0xc580
jmp 0x48981
leaq 0x2f0(%rsp), %rdi
callq 0xce98
addq $0x558, %rsp            # imm = 0x558
retq
leaq 0x2f0(%rsp), %rdi
callq 0xce98
movq 0x490(%rsp), %rdi
callq 0xccf0
nopl (%rax,%rax)