// File: /workspace/github_cpp_makefile_star2_O1/ncbi[P]amr/common.cpp
// Function: Common_sp::Application::initEnvironment()
void Application::initEnvironment () 
{
  ASSERT (! programArgs. empty ());
  
  // execDir, programName
	execDir = getProgramDirName ();
	if (execDir. empty ())
		execDir = which (programArgs. front ());
  if (! isDirName (execDir))
    throw logic_error ("Cannot identify the directory of the executable");
  {
    string s (programArgs. front ());
    programName = rfindSplit (s, fileSlash);
    execDir = getDirName (path2canonical (execDir + programName));
  }

  string execDir_ (execDir);
  trimSuffix (execDir_, "/");				
  for (Key& key : keyArgs)
    if (! key. flag)
      replaceStr (key. defaultValue, "$BASE", execDir_);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rdi, %rbx
callq 0xa070
movl $0x0, (%rax)
movq 0x56460(%rip), %rax     # 0xb0a80
cmpq 0x56461(%rip), %rax     # 0xb0a88
je 0x5a936
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x65e12
leaq 0xb0(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xa6e0
movq (%r15), %rdi
leaq 0x18(%rsp), %r12
cmpq %r12, %rdi
je 0x5a669
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
cmpq $0x0, 0xb8(%rbx)
jne 0x5a6a7
movq 0x56406(%rip), %rsi     # 0xb0a80
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x405c9
movq %r14, %rdi
movq %r15, %rsi
callq 0xa6e0
movq (%r15), %rdi
cmpq %r12, %rdi
je 0x5a6a7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
leaq 0x8(%rsp), %rsi
movq %r12, (%rsi)
movw $0x2f, 0x10(%rsi)
movq $0x1, 0x8(%rsi)
movq %r14, %rdi
callq 0x37303
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5a6de
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
testb %bpl, %bpl
je 0x5a9c8
movq 0x56392(%rip), %rax     # 0xb0a80
leaq 0x8(%rsp), %r15
movq %r12, (%r15)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
movq %r15, %rdi
callq 0x2c652
leaq 0x28(%rsp), %rdi
movq %r15, %rsi
movl $0x2f, %edx
callq 0x3956d
leaq 0x56377(%rip), %rdi     # 0xb0a98
leaq 0x28(%rsp), %r15
movq %r15, %rsi
callq 0xa6e0
movq (%r15), %rdi
leaq 0x38(%rsp), %rbp
cmpq %rbp, %rdi
je 0x5a748
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
leaq 0x56349(%rip), %rdx     # 0xb0a98
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
callq 0x2eeb8
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x2dfd2
leaq 0x48(%rsp), %rdi
movl $0x2f, %esi
movq $-0x1, %rdx
callq 0xab00
cmpq $-0x1, %rax
je 0x5a7a0
incq %rax
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
xorl %edx, %edx
movq %rax, %rcx
callq 0xa5d0
jmp 0x5a7be
leaq 0x28(%rsp), %rdi
movq %rbp, (%rdi)
movq 0x56329(%rip), %rsi     # 0xb0ad8
movq 0x5632a(%rip), %rdx     # 0xb0ae0
addq %rsi, %rdx
callq 0x2c652
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xa6e0
movq (%r15), %rdi
cmpq %rbp, %rdi
je 0x5a7e3
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5a7fe
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5a819
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5a830
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
leaq 0x8(%rsp), %rdi
movq %r12, (%rdi)
movq 0xb0(%rbx), %rsi
movq 0xb8(%rbx), %rdx
addq %rsi, %rdx
callq 0x2c652
leaq 0x28(%rsp), %rdi
movq %rbp, (%rdi)
leaq 0x32a89(%rip), %rsi     # 0x8d2e6
leaq 0x32a83(%rip), %rdx     # 0x8d2e7
callq 0x2fdd8
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x3740f
movq 0x28(%rsp), %rdi
movq %rbp, %r13
cmpq %rbp, %rdi
je 0x5a892
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0xe8(%rbx), %rbp
addq $0xe8, %rbx
cmpq %rbx, %rbp
je 0x5a908
leaq 0x33f00(%rip), %r15     # 0x8e7ac
leaq 0x28(%rsp), %r12
leaq 0x8(%rsp), %r14
cmpb $0x0, 0x80(%rbp)
jne 0x5a8ff
movq %r13, 0x28(%rsp)
movq %r12, %rdi
leaq 0x33ed9(%rip), %rsi     # 0x8e7a7
movq %r15, %rdx
callq 0x2fdd8
leaq 0xd0(%rbp), %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x37703
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x5a8ff
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq (%rbp), %rbp
cmpq %rbx, %rbp
jne 0x5a8b6
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5a924
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xa6b0
testl %eax, %eax
jne 0x5a9fa
leaq 0xd8(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x31fe0(%rip), %rsi     # 0x8c936
leaq 0x31fec(%rip), %rdx     # 0x8c949
leaq 0xc8(%rsp), %rdi
callq 0x2fdd8
leaq 0xe8(%rsp), %rdi
movl $0xf28, %esi            # imm = 0xF28
callq 0x2d60a
leaq 0x68(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0x2d562
leaq 0x30248(%rip), %rsi     # 0x8abe5
leaq 0x68(%rsp), %rdi
callq 0xaac0
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x5aa04
movups (%rcx), %xmm0
movups %xmm0, (%r15)
jmp 0x5aa11
movl $0x10, %edi
callq 0xa2c0
movq %rax, %r14
leaq 0x33d9b(%rip), %rsi     # 0x8e777
movq %rax, %rdi
callq 0xa7f0
movq 0x555d5(%rip), %rsi     # 0xaffc0
movq 0x55596(%rip), %rdx     # 0xaff88
movq %r14, %rdi
callq 0xa9b0
movl $0x1, %edi
callq 0xa6c0
movq %rdx, 0x48(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x58(%rsp)
movq 0x8(%rax), %rdx
movq %rdx, 0x50(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0xb8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x33ceb(%rip), %rsi     # 0x8e728
leaq 0x33d1a(%rip), %rdx     # 0x8e75e
leaq 0xa8(%rsp), %rdi
callq 0x2fdd8
leaq 0x31edb(%rip), %rsi     # 0x8c933
leaq 0xa8(%rsp), %rdi
callq 0xaac0
leaq 0x98(%rsp), %r13
movq %r13, -0x10(%r13)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x5aa8a
movups (%rcx), %xmm0
movups %xmm0, (%r13)
jmp 0x5aa9d
movq %rdx, 0x88(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x98(%rsp)
movq 0x8(%rax), %rsi
leaq 0x88(%rsp), %rdx
movq %rsi, 0x8(%rdx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x2d562
leaq 0x33c8d(%rip), %rsi     # 0x8e75f
leaq 0x28(%rsp), %rdi
callq 0xaac0
leaq 0x18(%rsp), %rbp
movq %rbp, -0x10(%rbp)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
jne 0x5aafd
movups (%rcx), %xmm0
movups %xmm0, (%rbp)
jmp 0x5ab0a
movq %rdx, 0x8(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x18(%rsp)
movq 0x8(%rax), %rdx
leaq 0x8(%rsp), %rdi
movq %rdx, 0x8(%rdi)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
callq 0x3523b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %rbp, %rdi
je 0x5ab4a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5ab4a
movq %rax, %rbx
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ab6a
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5ab6a
movq %rax, %rbx
movq 0x88(%rsp), %rdi
cmpq %r13, %rdi
je 0x5ab8c
movq 0x98(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5ab8c
movq %rax, %rbx
movq 0xa8(%rsp), %rdi
cmpq %r12, %rdi
je 0x5abae
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5abae
movq %rax, %rbx
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x5abca
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5abca
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5abea
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5abea
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ac10
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5ac10
movq %rax, %rbx
movq 0xc8(%rsp), %rdi
cmpq %r14, %rdi
je 0x5ace5
movq 0xd8(%rsp), %rsi
jmp 0x5acdd
movq %rax, %rbx
jmp 0x5ace5
movq %rax, %rbx
movq %r14, %rdi
callq 0xa440
jmp 0x5ace5
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %rbp, %rdi
jne 0x5acbc
jmp 0x5acc9
jmp 0x5acaa
movq %rax, %rbx
leaq 0x58(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ac7a
movq 0x58(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5ac7a
movq %rax, %rbx
leaq 0x78(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ac9e
movq 0x78(%rsp), %rsi
incq %rsi
callq 0xa5a0
jmp 0x5ac9e
jmp 0x5ac9b
jmp 0x5ac9b
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
jne 0x5acd8
jmp 0x5ace5
movq %rax, %rbx
jmp 0x5acc9
movq %rax, %rbx
movq 0x28(%rsp), %rdi
cmpq %r13, %rdi
je 0x5acc9
movq 0x38(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x5ace5
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xa5a0
movq %rbx, %rdi
callq 0xaa10
nop