// File: arisKoutsou[P]oopproj/./src/game_utils.cpp
// Function: initGrid()
void initGrid(void) {
  vector<string> tokens;
  skipCommentsAndWhitespace(map);
  tokenize(tokens);
  int rows = atoi(tokens[0].c_str());
  int columns = atoi(tokens[1].c_str());
  skipCommentsAndWhitespace(map);
  tokens.clear();
  tokenize(tokens);
  while (map.eof() == false) {
    getline(map, buffer);
    tokenize(tokens);
  }
  bool* tileInfo = new bool[rows*columns*2];
  size_t j = 0U;
  for (size_t i = 0U; i < tokens.size();) {
    tileInfo[j++] = (tokens[i] == "true") ? true : false;
    tileInfo[j++] = (tokens[i+1] == "true") ? true : false;
    i += (tokens[i+2] == "false") ? 3 : 4;
  }
  gameGrid = new Grid(rows, columns, tileInfo);
  ssize_t row = 0U;
  ssize_t col = 0U;
  for (size_t i = 2U; i < tokens.size(); ++col) {
    if (col == columns) { ++row, col = 0U; }
    if (tokens[i] == "false") { i += 3U; continue; }
    int cap = atoi(tokens[i+1].c_str());
    Market* market = new Market(cap);
    fillMarket(market);
    gameGrid->addMarket(row, col, market);
    i += 4U;
  }
  delete[] tileInfo;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
leaq -0x18(%rbp), %rdi
callq 0x6370
leaq 0x333dd(%rip), %rdi     # 0x403d8
callq 0xd410
jmp 0xd002
leaq -0x18(%rbp), %rdi
callq 0xd470
jmp 0xd00d
xorl %eax, %eax
movl %eax, %esi
leaq -0x18(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x132f0
movq %rax, %rdi
callq 0x5110
movq %rax, %rdi
callq 0x54c0
movq -0x78(%rbp), %rdi
movl %eax, -0x28(%rbp)
movl $0x1, %esi
callq 0x132f0
movq %rax, %rdi
callq 0x5110
movq %rax, %rdi
callq 0x54c0
movl %eax, -0x2c(%rbp)
leaq 0x3337f(%rip), %rdi     # 0x403d8
callq 0xd410
jmp 0xd060
leaq -0x18(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x13310
movq -0x80(%rbp), %rdi
callq 0xd470
jmp 0xd078
jmp 0xd07a
leaq 0x33357(%rip), %rdi     # 0x403d8
movq 0x33350(%rip), %rax     # 0x403d8
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x5580
movb %al, -0x81(%rbp)
jmp 0xd09c
movb -0x81(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xd0df
leaq 0x33325(%rip), %rdi     # 0x403d8
leaq 0x33256(%rip), %rsi     # 0x40310
callq 0x5070
jmp 0xd0c1
leaq -0x18(%rbp), %rdi
callq 0xd470
jmp 0xd0cc
jmp 0xd07a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0xd3ef
movl -0x28(%rbp), %eax
movl -0x2c(%rbp), %ecx
imull %ecx, %eax
addl %eax, %eax
movslq %eax, %rdi
callq 0x5030
movq %rax, -0x90(%rbp)
jmp 0xd0fb
movq -0x90(%rbp), %rax
movq %rax, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x6390
movq %rax, %rcx
movq -0x98(%rbp), %rax
cmpq %rcx, %rax
jae 0xd211
movq -0x48(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x132f0
movq %rax, %rdi
leaq 0x215ec(%rip), %rsi     # 0x2e740
callq 0x8e10
movb %al, -0x99(%rbp)
jmp 0xd161
movb -0x99(%rbp), %dl
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rsi
incq %rsi
movq %rsi, -0x40(%rbp)
andb $0x1, %dl
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rsi
incq %rsi
leaq -0x18(%rbp), %rdi
callq 0x132f0
movq %rax, %rdi
leaq 0x215a7(%rip), %rsi     # 0x2e740
callq 0x8e10
movb %al, -0x9a(%rbp)
jmp 0xd1a6
movb -0x9a(%rbp), %dl
movq -0x38(%rbp), %rax
movq -0x40(%rbp), %rcx
movq %rcx, %rsi
incq %rsi
movq %rsi, -0x40(%rbp)
andb $0x1, %dl
movb %dl, (%rax,%rcx)
movq -0x48(%rbp), %rsi
addq $0x2, %rsi
leaq -0x18(%rbp), %rdi
callq 0x132f0
movq %rax, %rdi
leaq 0x21566(%rip), %rsi     # 0x2e745
callq 0x8e10
movb %al, -0x9b(%rbp)
jmp 0xd1ec
movb -0x9b(%rbp), %dl
movl $0x4, %eax
movl $0x3, %ecx
testb $0x1, %dl
cmovnel %ecx, %eax
cltq
addq -0x48(%rbp), %rax
movq %rax, -0x48(%rbp)
jmp 0xd116
movl $0x20, %edi
callq 0x5300
movq %rax, -0xa8(%rbp)
jmp 0xd224
movq -0xa8(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x2c(%rbp), %edx
movq -0x38(%rbp), %rcx
callq 0x9050
jmp 0xd23c
movq -0xa8(%rbp), %rax
movq %rax, 0x33396(%rip)     # 0x405e0
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x2, -0x60(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0xb0(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x6390
movq %rax, %rcx
movq -0xb0(%rbp), %rax
cmpq %rcx, %rax
jae 0xd3c0
movq -0x58(%rbp), %rax
movslq -0x2c(%rbp), %rcx
cmpq %rcx, %rax
jne 0xd2ce
movq -0x50(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
jmp 0xd2ce
movq -0xa8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x20, %esi
callq 0x5310
jmp 0xd3ef
movq -0x60(%rbp), %rsi
leaq -0x18(%rbp), %rdi
callq 0x132f0
movq %rax, %rdi
leaq 0x21460(%rip), %rsi     # 0x2e745
callq 0x8e10
movb %al, -0xb1(%rbp)
jmp 0xd2f2
movb -0xb1(%rbp), %al
testb $0x1, %al
jne 0xd2fe
jmp 0xd30f
movq -0x60(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x60(%rbp)
jmp 0xd390
movq -0x60(%rbp), %rsi
incq %rsi
leaq -0x18(%rbp), %rdi
callq 0x132f0
movq %rax, %rdi
callq 0x5110
movq %rax, %rdi
callq 0x54c0
movl %eax, -0x64(%rbp)
movl $0x58, %edi
callq 0x5300
movq %rax, -0xc0(%rbp)
jmp 0xd345
movq -0xc0(%rbp), %rdi
movl -0x64(%rbp), %esi
callq 0x1daa0
jmp 0xd356
movq -0xc0(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
callq 0xd540
jmp 0xd36c
movq 0x3326d(%rip), %rdi     # 0x405e0
movl -0x50(%rbp), %esi
movl -0x58(%rbp), %edx
movq -0x70(%rbp), %rcx
callq 0x9250
jmp 0xd384
movq -0x60(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x60(%rbp)
movq -0x58(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x58(%rbp)
jmp 0xd262
movq -0xc0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
movl $0x58, %esi
callq 0x5310
jmp 0xd3ef
movq -0x38(%rbp), %rax
movq %rax, -0xc8(%rbp)
cmpq $0x0, %rax
je 0xd3dd
movq -0xc8(%rbp), %rdi
callq 0x5430
leaq -0x18(%rbp), %rdi
callq 0x7f40
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x18(%rbp), %rdi
callq 0x7f40
movq -0x20(%rbp), %rdi
callq 0x5550
nopw %cs:(%rax,%rax)