// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/cgame/cgame.c
// Function: init_game
static void init_game(void)
{
  int i;

  money_collected  = 0;
  steps_taken      = 0;
  enemy_idle_count = 0;

  srandom(time(NULL));

  player.symbol = '@';
  player.attributes = 0;
  find_empty_spot(&player.y, &player.x);
  draw_object(&player);

  enemy.symbol = 'M';
  enemy.attributes = A_BOLD | COLOR_PAIR(PAIR_YELLOW);
  find_empty_spot(&enemy.y, &enemy.x);
  draw_object(&enemy);

  for (i = 0; i < AMOUNT_OF_MONEY; i++) {
    money[i].symbol = '$';
    money[i].attributes = A_BOLD;
    money[i].taken = 0;
    find_empty_spot(&money[i].y, &money[i].x);
    draw_object(&money[i]);
  }

  for (i = 0; i < AMOUNT_OF_MINES; i++) {
    mines[i].symbol = '*';
    mines[i].attributes = COLOR_PAIR(PAIR_CYAN);
    find_empty_spot(&mines[i].y, &mines[i].x);
    draw_object(&mines[i]);
  }

  for (i = 0; i < AMOUNT_OF_CRATES; i++) {
    crates[i].symbol = '#';
    crates[i].attributes = COLOR_PAIR(PAIR_YELLOW);
    find_empty_spot(&crates[i].y, &crates[i].x);
    draw_object(&crates[i]);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, 0x2c1e(%rip)      # 0x4280
movl $0x0, 0x2a78(%rip)      # 0x40e4
movl $0x0, 0x2c22(%rip)      # 0x4298
xorl %eax, %eax
movl %eax, %edi
callq 0x10f0
movl %eax, %edi
callq 0x1060
movb $0x40, 0x2a4b(%rip)     # 0x40d8
movl $0x0, 0x2a45(%rip)      # 0x40dc
leaq 0x2a32(%rip), %rdi      # 0x40d0
movq %rdi, %rsi
addq $0x4, %rsi
callq 0x1dd0
leaq 0x2a1f(%rip), %rdi      # 0x40d0
callq 0x1eb0
movb $0x4d, 0x2bcf(%rip)     # 0x428c
movl $0x200100, 0x2bc9(%rip) # imm = 0x200100
leaq 0x2bb6(%rip), %rdi      # 0x4284
movq %rdi, %rsi
addq $0x4, %rsi
callq 0x1dd0
leaq 0x2ba3(%rip), %rdi      # 0x4284
callq 0x1eb0
movl $0x0, -0x4(%rbp)
cmpl $0x14, -0x4(%rbp)
jge 0x1791
movslq -0x4(%rbp), %rcx
leaq 0x29ee(%rip), %rax      # 0x40f0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x24, 0x8(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x29d8(%rip), %rax      # 0x40f0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x200000, 0xc(%rax)    # imm = 0x200000
movslq -0x4(%rbp), %rcx
leaq 0x29bf(%rip), %rax      # 0x40f0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x0, 0x10(%rax)
movslq -0x4(%rbp), %rax
leaq 0x29a6(%rip), %rdi      # 0x40f0
imulq $0x14, %rax, %rax
addq %rax, %rdi
movslq -0x4(%rbp), %rax
leaq 0x2994(%rip), %rsi      # 0x40f0
imulq $0x14, %rax, %rax
addq %rax, %rsi
addq $0x4, %rsi
callq 0x1dd0
movslq -0x4(%rbp), %rax
leaq 0x2979(%rip), %rdi      # 0x40f0
imulq $0x14, %rax, %rax
addq %rax, %rdi
callq 0x1eb0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x16ed
movl $0x0, -0x4(%rbp)
cmpl $0xa, -0x4(%rbp)
jge 0x1823
movslq -0x4(%rbp), %rcx
leaq 0x2af3(%rip), %rax      # 0x42a0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x2a, 0x8(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x2add(%rip), %rax      # 0x42a0
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x200, 0xc(%rax)       # imm = 0x200
movslq -0x4(%rbp), %rax
leaq 0x2ac4(%rip), %rdi      # 0x42a0
imulq $0x14, %rax, %rax
addq %rax, %rdi
movslq -0x4(%rbp), %rax
leaq 0x2ab2(%rip), %rsi      # 0x42a0
imulq $0x14, %rax, %rax
addq %rax, %rsi
addq $0x4, %rsi
callq 0x1dd0
movslq -0x4(%rbp), %rax
leaq 0x2a97(%rip), %rdi      # 0x42a0
imulq $0x14, %rax, %rax
addq %rax, %rdi
callq 0x1eb0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x1798
movl $0x0, -0x4(%rbp)
cmpl $0x5, -0x4(%rbp)
jge 0x18b5
movslq -0x4(%rbp), %rcx
leaq 0x2b31(%rip), %rax      # 0x4370
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movb $0x23, 0x8(%rax)
movslq -0x4(%rbp), %rcx
leaq 0x2b1b(%rip), %rax      # 0x4370
imulq $0x14, %rcx, %rcx
addq %rcx, %rax
movl $0x100, 0xc(%rax)       # imm = 0x100
movslq -0x4(%rbp), %rax
leaq 0x2b02(%rip), %rdi      # 0x4370
imulq $0x14, %rax, %rax
addq %rax, %rdi
movslq -0x4(%rbp), %rax
leaq 0x2af0(%rip), %rsi      # 0x4370
imulq $0x14, %rax, %rax
addq %rax, %rsi
addq $0x4, %rsi
callq 0x1dd0
movslq -0x4(%rbp), %rax
leaq 0x2ad5(%rip), %rdi      # 0x4370
imulq $0x14, %rax, %rax
addq %rax, %rdi
callq 0x1eb0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x182a
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)