// File: /workspace/github_cpp_makefile_star2_O3/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), %r14
movq %r14, %rdi
movl $0x8, %edx
callq 0x6590
movq (%r14), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x100(%rsp,%rax)
jne 0x1ecbb
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 0x2b7bb(%rip), %rsi     # 0x4a096
leaq 0xc0(%rsp), %rdi
movl $0x10, %edx
callq 0xb2a8
leaq 0x2b7b0(%rip), %rsi     # 0x4a0a4
leaq 0xa0(%rsp), %rdi
movl $0x10, %edx
callq 0xb2a8
movq %rbx, 0x78(%rsp)
leaq 0x29a75(%rip), %rsi     # 0x48387
leaq 0x80(%rsp), %rdi
movl $0x10, %edx
callq 0xb2a8
xorl %ebx, %ebx
leaq 0x50(%rsp), %r12
xorl %ebp, %ebp
movq 0xe0(%rsp), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x6350
movsbl %al, %edx
movq %r14, %rdi
leaq 0x28(%rsp), %rsi
callq 0x6650
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x1ebf7
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
cmpb $0xd, -0x1(%rdi,%rsi)
jne 0x1e98d
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 0x16c4f
testb %al, %al
je 0x1eaa9
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
je 0x1e9df
movq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x5, %rdx
cmpq $-0x3, %rdx
ja 0x1e9df
addq $0x18, %rax
jmp 0x1e9e6
addq %rcx, %rax
addq $-0x48, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1ea0e
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x18bdc
movq 0x8(%rsp), %r15
jmp 0x1ea26
leaq 0x18(%rsp), %r15
movq %r15, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
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 0x1eca3
movq %rax, %rbp
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x1ecaf
movl (%r13), %eax
cmpl $0x22, %eax
je 0x1ecaf
testl %eax, %eax
jne 0x1ea85
movl %r14d, (%r13)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1eaa1
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %r14
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movq %r12, %rdx
leaq 0xa0(%rsp), %rcx
xorl %r8d, %r8d
callq 0x16c4f
testb %al, %al
je 0x1ebcf
movq 0x50(%rsp), %rax
movq 0x58(%rsp), %rcx
subq %rax, %rcx
je 0x1eb05
movq %rcx, %rdx
sarq $0x3, %rdx
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rsi, %rdx
addq $-0x5, %rdx
cmpq $-0x3, %rdx
ja 0x1eb05
addq $0x18, %rax
jmp 0x1eb0c
addq %rcx, %rax
addq $-0x48, %rax
cmpb $0x1, 0x10(%rax)
jne 0x1eb34
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
callq 0x18bdc
movq 0x8(%rsp), %r15
jmp 0x1eb4c
leaq 0x18(%rsp), %r15
movq %r15, 0x8(%rsp)
movq $0x0, 0x10(%rsp)
movb $0x0, 0x18(%rsp)
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 0x1ec8b
movq %rax, %rbx
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x1ec97
movl (%r13), %eax
cmpl $0x22, %eax
je 0x1ec97
testl %eax, %eax
jne 0x1ebab
movl %r14d, (%r13)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1ebc7
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %r14
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rsi
addq %rdi, %rsi
movq %r12, %rdx
leaq 0x80(%rsp), %rcx
xorl %r8d, %r8d
callq 0x16c4f
testb %al, %al
je 0x1e92d
movq 0x78(%rsp), %rdi
movl %ebx, %esi
movl %ebp, %edx
callq 0x1ccf2
leaq 0xe0(%rsp), %rdi
callq 0x60c0
leaq 0x80(%rsp), %rdi
callq 0xb464
leaq 0xa0(%rsp), %rdi
callq 0xb464
leaq 0xc0(%rsp), %rdi
callq 0xb464
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
leaq 0x38(%rsp), %rbx
je 0x1ec55
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x28(%rsp), %rdi
cmpq %rbx, %rdi
je 0x1ec6c
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 0x298d3(%rip), %rdi     # 0x48565
callq 0x6220
leaq 0x298c7(%rip), %rdi     # 0x48565
callq 0x6520
leaq 0x298bb(%rip), %rdi     # 0x48565
callq 0x6220
leaq 0x298af(%rip), %rdi     # 0x48565
callq 0x6520
movq 0x432e6(%rip), %rdi     # 0x61fa8
leaq 0x2b3a5(%rip), %rsi     # 0x4a06e
movl $0x27, %edx
callq 0x63f0
movq 0xa0(%rbx), %rsi
movq 0xa8(%rbx), %rdx
movq 0x432c0(%rip), %rdi     # 0x61fa8
callq 0x63f0
movq %rax, %rbx
leaq 0x295e1(%rip), %rsi     # 0x482d8
movl $0xf, %edx
movq %rax, %rdi
callq 0x63f0
leaq 0x29858(%rip), %rsi     # 0x48563
movq %rbx, %rdi
callq 0x6360
movl $0x1, %edi
callq 0x6440
movq %rax, %rbx
jmp 0x1edc5
movq %rax, %rbx
jmp 0x1ed78
movq %rax, %rbx
jmp 0x1ed85
movq %rax, %rbx
jmp 0x1ed92
jmp 0x1ed68
jmp 0x1ed68
jmp 0x1ed68
jmp 0x1ed3c
movq %rax, %rbx
cmpl $0x0, (%r13)
jne 0x1ed4a
movl %r14d, (%r13)
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x1ed6b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x6380
jmp 0x1ed6b
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0xb464
leaq 0xa0(%rsp), %rdi
callq 0xb464
leaq 0xc0(%rsp), %rdi
callq 0xb464
movq 0x50(%rsp), %rdi
testq %rdi, %rdi
je 0x1eda9
movq 0x60(%rsp), %rsi
subq %rdi, %rsi
callq 0x6380
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1edc5
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x6380
leaq 0xe0(%rsp), %rdi
callq 0x60f0
movq %rbx, %rdi
callq 0x6620