// File: /workspace/github_cpp_makefile_star2_O1/Kei18[P]pibt/./src/graph/simplegrid.cpp
// Function: SimpleGrid::setBasicParams()
void SimpleGrid::setBasicParams() {
  // read file
  std::ifstream file(filename);
  if (!file) {
    std::cout << "error@SimpleGrid::setBasicParams, file "
              << filename
              << " does not exist" << "\n";
    std::exit(1);
  }

  std::string line;
  std::smatch results;
  int w  = 0;
  int h = 0;

  std::regex r_height = std::regex(R"(height\s(\d+))");
  std::regex r_width = std::regex(R"(width\s(\d+))");
  std::regex r_map = std::regex(R"(map)");

  // read fundamental graph params
  while (getline(file, line)) {

    // for CRLF coding
    if (*(line.end()-1) == 0x0d) line.pop_back();

    if (std::regex_match(line, results, r_height)) {
      h = std::stoi(results[1].str());
    }
    if (std::regex_match(line, results, r_width)) {
      w = std::stoi(results[1].str());
    }
    if (std::regex_match(line, results, r_map)) {
      break;
    }
  }
  setSize(w, h);
  file.close();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2e8, %rsp            # imm = 0x2E8
movq %rdi, %rbx
leaq 0xa0(%rdi), %rsi
leaq 0xe0(%rsp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x6590
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x100(%rsp,%rax)
jne 0x1ed5e
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
xorps %xmm0, %xmm0
movaps %xmm0, 0x60(%rsp)
movaps %xmm0, 0x50(%rsp)
leaq 0x2b6dd(%rip), %rsi     # 0x4a058
leaq 0xc0(%rsp), %rdi
movl $0x10, %edx
callq 0xb26e
leaq 0x2b6d2(%rip), %rsi     # 0x4a066
leaq 0xa0(%rsp), %rdi
movl $0x10, %edx
callq 0xb26e
movq %rbx, 0x78(%rsp)
leaq 0x299d5(%rip), %rsi     # 0x48387
leaq 0x80(%rsp), %rdi
movl $0x10, %edx
callq 0xb26e
leaq 0x18(%rsp), %r14
xorl %ebx, %ebx
leaq 0x50(%rsp), %r12
xorl %ebp, %ebp
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x6350
movsbl %al, %edx
movq %r15, %rdi
leaq 0x28(%rsp), %rsi
callq 0x6650
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1ec9a
movq 0x28(%rsp), %rax
movq 0x30(%rsp), %rcx
cmpb $0xd, -0x1(%rax,%rcx)
jne 0x1ea28
leaq 0x28(%rsp), %rdi
callq 0x6450
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movq %r12, %rdx
leaq 0xc0(%rsp), %rcx
xorl %r8d, %r8d
callq 0x16bf5
testb %al, %al
je 0x1eb4d
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rax
cmpq %rax, %rcx
je 0x1ea84
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x5, %rdx
cmpq $-0x2, %rdx
setb %dl
jmp 0x1ea86
xorl %edx, %edx
addq $0x18, %rcx
addq $-0x48, %rax
testb %dl, %dl
cmovneq %rcx, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1eab2
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x18b72
jmp 0x1eac5
movq %r14, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x8(%rsp), %r15
callq 0x6050
movq %rax, %r13
movl (%rax), %r14d
movl $0x0, (%rax)
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x64e0
cmpq %r15, 0x48(%rsp)
je 0x1ed46
movq %rax, %rbp
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x1ed52
movl (%r13), %eax
cmpl $0x22, %eax
je 0x1ed52
testl %eax, %eax
jne 0x1eb29
movl %r14d, (%r13)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r14
cmpq %r14, %rdi
je 0x1eb45
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %r15
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movq %r12, %rdx
leaq 0xa0(%rsp), %rcx
xorl %r8d, %r8d
callq 0x16bf5
testb %al, %al
je 0x1ec72
movq 0x50(%rsp), %rcx
movq 0x58(%rsp), %rax
cmpq %rax, %rcx
je 0x1eba9
movq %rax, %rdx
subq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x5, %rdx
cmpq $-0x2, %rdx
setb %dl
jmp 0x1ebab
xorl %edx, %edx
addq $0x18, %rcx
addq $-0x48, %rax
testb %dl, %dl
cmovneq %rcx, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1ebd7
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %r14, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x18b72
jmp 0x1ebea
movq %r14, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
movq 0x8(%rsp), %r15
callq 0x6050
movq %rax, %r13
movl (%rax), %r14d
movl $0x0, (%rax)
movq %r15, %rdi
leaq 0x48(%rsp), %rsi
movl $0xa, %edx
callq 0x64e0
cmpq %r15, 0x48(%rsp)
je 0x1ed2e
movq %rax, %rbx
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x1ed3a
movl (%r13), %eax
cmpl $0x22, %eax
je 0x1ed3a
testl %eax, %eax
jne 0x1ec4e
movl %r14d, (%r13)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %r14
cmpq %r14, %rdi
je 0x1ec6a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %r15
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movq %r12, %rdx
leaq 0x80(%rsp), %rcx
xorl %r8d, %r8d
callq 0x16bf5
testb %al, %al
je 0x1e9d2
movq 0x78(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x1cd9e
leaq 0xe0(%rsp), %rdi
callq 0x60c0
leaq 0x80(%rsp), %rdi
callq 0xb42a
leaq 0xa0(%rsp), %rdi
callq 0xb42a
leaq 0xc0(%rsp), %rdi
callq 0xb42a
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
leaq 0x38(%rsp), %rbx
je 0x1ecf8
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1ed0f
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %rdi
callq 0x60f0
addq $0x2e8, %rsp            # imm = 0x2E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x29830(%rip), %rdi     # 0x48565
callq 0x6220
leaq 0x29824(%rip), %rdi     # 0x48565
callq 0x6520
leaq 0x29818(%rip), %rdi     # 0x48565
callq 0x6220
leaq 0x2980c(%rip), %rdi     # 0x48565
callq 0x6520
movq 0x43243(%rip), %rdi     # 0x61fa8
leaq 0x2b2c4(%rip), %rsi     # 0x4a030
movl $0x27, %edx
callq 0x63f0
movq 0xa0(%rbx), %rsi
movq 0xa8(%rbx), %rdx
movq 0x4321d(%rip), %rdi     # 0x61fa8
callq 0x63f0
movq %rax, %rbx
leaq 0x2953e(%rip), %rsi     # 0x482d8
movl $0xf, %edx
movq %rax, %rdi
callq 0x63f0
leaq 0x297b5(%rip), %rsi     # 0x48563
movq %rbx, %rdi
callq 0x6360
movl $0x1, %edi
callq 0x6440
movq %rax, %rbx
jmp 0x1ee68
movq %rax, %rbx
jmp 0x1ee1b
movq %rax, %rbx
jmp 0x1ee28
movq %rax, %rbx
jmp 0x1ee35
jmp 0x1ee0b
jmp 0x1ee0b
jmp 0x1ee0b
jmp 0x1eddf
movq %rax, %rbx
cmpl $0x0, (%r13)
jne 0x1eded
movl %r14d, (%r13)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1ee0e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6380
jmp 0x1ee0e
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xb42a
leaq 0xa0(%rsp), %rdi
callq 0xb42a
leaq 0xc0(%rsp), %rdi
callq 0xb42a
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1ee4c
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1ee68
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x6620
nop