// File: /workspace/github_cpp_makefile_star2_O2/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 0xb060
andl $0x0, (%rax)
movq 0x4df3b(%rip), %rax     # 0x84aa0
cmpq 0x4df3c(%rip), %rax     # 0x84aa8
je 0x36d36
leaq 0x8(%rsp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x3d53e
leaq 0xb0(%rbx), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0xb6f0
movq %r15, %rdi
callq 0xbb68
cmpq $0x0, 0xb8(%rbx)
jne 0x36bcd
movq 0x4def3(%rip), %rsi     # 0x84aa0
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x2857d
movq %r14, %rdi
movq %r15, %rsi
callq 0xb6f0
movq %r15, %rdi
callq 0xbb68
movq %r14, %rdi
callq 0x1e230
testb %al, %al
je 0x36e0a
movq 0x4debc(%rip), %rsi     # 0x84aa0
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0xb7b0
leaq 0x28(%rsp), %rdi
pushq $0x2f
popq %rdx
movq %r15, %rsi
callq 0x24925
leaq 0x4deb0(%rip), %r15     # 0x84ab8
leaq 0x28(%rsp), %r12
movq %r15, %rdi
movq %r12, %rsi
callq 0xb6f0
movq %r12, %rdi
callq 0xbb68
leaq 0x68(%rsp), %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x1dbc3
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x1cfeb
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
callq 0x3d553
leaq 0x28(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0xb6f0
movq %r15, %rdi
callq 0xbb68
leaq 0x48(%rsp), %rdi
callq 0xbb68
leaq 0x68(%rsp), %rdi
callq 0xbb68
leaq 0x8(%rsp), %rdi
callq 0xbb68
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xb7b0
leaq 0x25643(%rip), %rsi     # 0x5c2db
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x1b7b6
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x23521
leaq 0x28(%rsp), %r14
movq %r14, %rdi
callq 0xbb68
addq $0xe8, %rbx
leaq 0x26acb(%rip), %r15     # 0x5d79c
leaq 0x48(%rsp), %r12
leaq 0x8(%rsp), %r13
movq %rbx, %rbp
movq (%rbp), %rbp
cmpq %rbx, %rbp
je 0x36d1a
cmpb $0x0, 0x80(%rbp)
jne 0x36cde
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1b7b6
leaq 0xd0(%rbp), %rdi
movq %r14, %rsi
movq %r13, %rdx
callq 0x236ec
movq %r14, %rdi
callq 0xbb68
jmp 0x36cde
leaq 0x8(%rsp), %rdi
callq 0xbb68
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xb6c0
testl %eax, %eax
jne 0x36e3a
leaq 0x24bf7(%rip), %rsi     # 0x5b941
leaq 0xe8(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0x1b7b6
leaq 0xc8(%rsp), %rdi
movl $0xf28, %esi            # imm = 0xF28
callq 0x1caa3
leaq 0x68(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0xc8(%rsp), %rdx
callq 0x1ca3c
leaq 0x22e54(%rip), %rdx     # 0x59be3
leaq 0x48(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x1b92d
leaq 0x26978(%rip), %rsi     # 0x5d71d
leaq 0x88(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x1b7b6
leaq 0x24b80(%rip), %rdx     # 0x5b93e
leaq 0xa8(%rsp), %rdi
leaq 0x88(%rsp), %rsi
callq 0x1b92d
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x1ca3c
leaq 0x26963(%rip), %rdx     # 0x5d754
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x1b92d
leaq 0x8(%rsp), %rdi
callq 0x224fc
pushq $0x10
popq %rdi
callq 0xb300
movq %rax, %r14
leaq 0x26950(%rip), %rsi     # 0x5d76c
movq %rax, %rdi
callq 0xb800
movq 0x4d195(%rip), %rsi     # 0x83fc0
movq 0x4d146(%rip), %rdx     # 0x83f78
movq %r14, %rdi
callq 0xb9d0
pushq $0x1
popq %rdi
callq 0xb6d0
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0xbb68
jmp 0x36e54
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbb68
jmp 0x36e63
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0xbb68
jmp 0x36e75
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0xbb68
jmp 0x36e87
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xbb68
jmp 0x36e96
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xbb68
jmp 0x36ea5
movq %rax, %rbx
leaq 0xc8(%rsp), %rdi
callq 0xbb68
jmp 0x36eb7
movq %rax, %rbx
leaq 0xe8(%rsp), %rdi
jmp 0x36f0b
movq %rax, %rbx
jmp 0x36f10
movq %rax, %rbx
movq %r14, %rdi
callq 0xb470
jmp 0x36f10
jmp 0x36ef9
jmp 0x36ef4
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0xbb68
jmp 0x36ee9
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
jmp 0x36f01
jmp 0x36ef4
jmp 0x36ef4
movq %rax, %rbx
jmp 0x36f06
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xbb68
leaq 0x8(%rsp), %rdi
callq 0xbb68
movq %rbx, %rdi
callq 0xba30