// File: 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:
subq $0x2f8, %rsp            # imm = 0x2F8
movq %rdi, 0x2f0(%rsp)
movq 0x2f0(%rsp), %rax
movq %rax, 0x58(%rsp)
callq 0xc090
movl $0x0, (%rax)
leaq 0x9dc92(%rip), %rdi     # 0x106c40
callq 0x2f920
testb $0x1, %al
jne 0x68fbc
jmp 0x69243
callq 0xc8c0
cmpl $0x0, %eax
jne 0x69239
leaq 0x24f(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0xcd00
movq 0x50(%rsp), %rdx
leaq 0x64a31(%rip), %rsi     # 0xcda19
leaq 0x250(%rsp), %rdi
callq 0x29fd0
jmp 0x68ff7
leaq 0x218(%rsp), %rdi
movl $0xf28, %esi            # imm = 0xF28
callq 0x2ded0
jmp 0x6900b
leaq 0x270(%rsp), %rdi
leaq 0x250(%rsp), %rsi
leaq 0x218(%rsp), %rdx
callq 0x2dde0
jmp 0x6902a
leaq 0x62b70(%rip), %rdx     # 0xcbba1
leaq 0x290(%rsp), %rdi
leaq 0x270(%rsp), %rsi
callq 0x2a2f0
jmp 0x69048
leaq 0x1d7(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xcd00
movq 0x48(%rsp), %rdx
leaq 0x667e0(%rip), %rsi     # 0xcf846
leaq 0x1d8(%rsp), %rdi
callq 0x29fd0
jmp 0x69075
leaq 0x6499a(%rip), %rdx     # 0xcda16
leaq 0x1f8(%rsp), %rdi
leaq 0x1d8(%rsp), %rsi
callq 0x2a2f0
jmp 0x69093
leaq 0x2b0(%rsp), %rdi
leaq 0x290(%rsp), %rsi
leaq 0x1f8(%rsp), %rdx
callq 0x2dde0
jmp 0x690b2
leaq 0x667c4(%rip), %rdx     # 0xcf87d
leaq 0x2d0(%rsp), %rdi
leaq 0x2b0(%rsp), %rsi
callq 0x2a2f0
jmp 0x690d0
leaq 0x2d0(%rsp), %rdi
callq 0x3e9b0
jmp 0x690df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x69227
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x6921a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x6920d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x69200
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x691e6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x691d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x691cc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x691bf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x2d0(%rsp), %rdi
callq 0xce98
leaq 0x2b0(%rsp), %rdi
callq 0xce98
leaq 0x1f8(%rsp), %rdi
callq 0xce98
leaq 0x1d8(%rsp), %rdi
callq 0xce98
leaq 0x1d7(%rsp), %rdi
callq 0xc7a0
leaq 0x290(%rsp), %rdi
callq 0xce98
leaq 0x270(%rsp), %rdi
callq 0xce98
leaq 0x218(%rsp), %rdi
callq 0xce98
leaq 0x250(%rsp), %rdi
callq 0xce98
leaq 0x24f(%rsp), %rdi
callq 0xc7a0
jmp 0x696cf
movl $0x1, %edi
callq 0xc8d0
movq 0x58(%rsp), %rsi
leaq 0x1b0(%rsp), %rdi
callq 0x770f0
movq 0x58(%rsp), %rdi
addq $0xb0, %rdi
leaq 0x1b0(%rsp), %rsi
callq 0xc8f0
leaq 0x1b0(%rsp), %rdi
callq 0xce98
movq 0x58(%rsp), %rdi
addq $0xb0, %rdi
callq 0xcc10
testb $0x1, %al
jne 0x69292
jmp 0x692d4
leaq 0x9d9a7(%rip), %rdi     # 0x106c40
callq 0x77130
movq %rax, %rsi
leaq 0x190(%rsp), %rdi
callq 0x4b150
movq 0x58(%rsp), %rdi
addq $0xb0, %rdi
leaq 0x190(%rsp), %rsi
callq 0xc8f0
leaq 0x190(%rsp), %rdi
callq 0xce98
movq 0x58(%rsp), %rdi
addq $0xb0, %rdi
callq 0x31310
testb $0x1, %al
jne 0x69347
movl $0x10, %edi
callq 0xc3b0
movq %rax, %rdi
movq %rdi, %rax
movq %rax, 0x40(%rsp)
leaq 0x66590(%rip), %rsi     # 0xcf895
callq 0xca70
jmp 0x6930c
movq 0x40(%rsp), %rdi
movq 0x9ccb0(%rip), %rsi     # 0x105fc8
movq 0x9cc61(%rip), %rdx     # 0x105f80
callq 0xcc80
movq 0x40(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
callq 0xc580
jmp 0x696cf
leaq 0x9d8f2(%rip), %rdi     # 0x106c40
callq 0x77130
movq %rax, %rsi
leaq 0x170(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0xc320
movq 0x38(%rsp), %rsi
leaq 0x150(%rsp), %rdi
movl $0x2f, %edx
callq 0x43040
jmp 0x69381
leaq 0x9d8d0(%rip), %rdi     # 0x106c58
movq %rdi, 0x30(%rsp)
leaq 0x150(%rsp), %rsi
movq %rsi, 0x28(%rsp)
callq 0xc8f0
movq 0x28(%rsp), %rdi
callq 0xce98
movq 0x58(%rsp), %rsi
movq 0x30(%rsp), %rdx
addq $0xb0, %rsi
leaq 0xf0(%rsp), %rdi
callq 0x30680
jmp 0x693c9
leaq 0x110(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x2ec10
jmp 0x693e0
leaq 0x130(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x77160
jmp 0x693f7
movq 0x58(%rsp), %rdi
addq $0xb0, %rdi
movq %rdi, 0x18(%rsp)
leaq 0x130(%rsp), %rsi
movq %rsi, 0x10(%rsp)
callq 0xc8f0
movq 0x10(%rsp), %rdi
callq 0xce98
leaq 0x110(%rsp), %rdi
callq 0xce98
leaq 0xf0(%rsp), %rdi
callq 0xce98
leaq 0x170(%rsp), %rdi
callq 0xce98
movq 0x18(%rsp), %rsi
leaq 0xd0(%rsp), %rdi
callq 0xc320
leaq 0xaf(%rsp), %rdi
movq %rdi, 0x20(%rsp)
callq 0xcd00
movq 0x20(%rsp), %rdx
leaq 0x64f83(%rip), %rsi     # 0xce3fe
leaq 0xb0(%rsp), %rdi
callq 0x29fd0
jmp 0x6948a
leaq 0xd0(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x405d0
jmp 0x694a1
leaq 0xb0(%rsp), %rdi
callq 0xce98
leaq 0xaf(%rsp), %rdi
callq 0xc7a0
movq 0x58(%rsp), %rax
addq $0xe8, %rax
movq %rax, 0xa0(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x771e0
movq %rax, 0x98(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x77210
movq %rax, 0x90(%rsp)
leaq 0x98(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x77240
testb $0x1, %al
jne 0x69516
jmp 0x696ad
leaq 0x98(%rsp), %rdi
callq 0x77260
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rax
testb $0x1, 0x70(%rax)
jne 0x69699
movq 0x88(%rsp), %rax
addq $0xc0, %rax
movq %rax, (%rsp)
leaq 0x67(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0xcd00
movq 0x8(%rsp), %rdx
leaq 0x6635b(%rip), %rsi     # 0xcf8c5
leaq 0x68(%rsp), %rdi
callq 0x29fd0
jmp 0x69576
movq (%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x409d0
jmp 0x6958e
leaq 0x68(%rsp), %rdi
callq 0xce98
leaq 0x67(%rsp), %rdi
callq 0xc7a0
jmp 0x69699
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x69601
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x695f4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x110(%rsp), %rdi
callq 0xce98
leaq 0xf0(%rsp), %rdi
callq 0xce98
leaq 0x170(%rsp), %rdi
callq 0xce98
jmp 0x696cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x6964a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0xce98
leaq 0xaf(%rsp), %rdi
callq 0xc7a0
jmp 0x696c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
jmp 0x6968d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x240(%rsp)
movl %eax, 0x23c(%rsp)
leaq 0x68(%rsp), %rdi
callq 0xce98
leaq 0x67(%rsp), %rdi
callq 0xc7a0
jmp 0x696c2
jmp 0x6969b
leaq 0x98(%rsp), %rdi
callq 0x77280
jmp 0x694f8
leaq 0xd0(%rsp), %rdi
callq 0xce98
addq $0x2f8, %rsp            # imm = 0x2F8
retq
leaq 0xd0(%rsp), %rdi
callq 0xce98
movq 0x240(%rsp), %rdi
callq 0xccf0
nopl (%rax)