// File: /workspace/github_c_makefile_star2_O1/kobolt[P]curses-collection/cgame/cgame.c
// Function: main.cold.1
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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
andl $0x0, 0x30fe(%rip)      # 0x4280
andl $0x0, 0x2f5b(%rip)      # 0x40e4
andl $0x0, 0x3108(%rip)      # 0x4298
xorl %edi, %edi
callq 0x10f0
movl %eax, %edi
callq 0x1060
movb $0x40, 0x2f33(%rip)     # 0x40d8
leaq 0x2f24(%rip), %rbx      # 0x40d0
andl $0x0, 0x2f29(%rip)      # 0x40dc
leaq 0x2f1a(%rip), %rsi      # 0x40d4
movq %rbx, %rdi
callq 0x18df
movq %rbx, %rdi
callq 0x19a5
movb $0x4d, 0x30bb(%rip)     # 0x428c
leaq 0x30ac(%rip), %rbx      # 0x4284
movl $0x200100, 0x30ae(%rip) # imm = 0x200100
leaq 0x309f(%rip), %rsi      # 0x4288
movq %rbx, %rdi
callq 0x18df
movq %rbx, %rdi
callq 0x19a5
pushq $0x14
popq %r14
leaq 0x2eec(%rip), %rbx      # 0x40f0
movb $0x24, 0x8(%rbx)
movq $0x200000, 0xc(%rbx)    # imm = 0x200000
leaq 0x4(%rbx), %rsi
movq %rbx, %rdi
callq 0x18df
movq %rbx, %rdi
callq 0x19a5
addq $0x14, %rbx
decq %r14
jne 0x1204
pushq $0xa
popq %r14
leaq 0x3068(%rip), %rbx      # 0x42a0
movb $0x2a, 0x8(%rbx)
movl $0x200, 0xc(%rbx)       # imm = 0x200
leaq 0x4(%rbx), %rsi
movq %rbx, %rdi
callq 0x18df
movq %rbx, %rdi
callq 0x19a5
addq $0x14, %rbx
decq %r14
jne 0x1238
pushq $0x5
popq %r14
leaq 0x3105(%rip), %rbx      # 0x4370
movb $0x23, 0x8(%rbx)
movl $0x100, 0xc(%rbx)       # imm = 0x100
leaq 0x4(%rbx), %rsi
movq %rbx, %rdi
callq 0x18df
movq %rbx, %rdi
callq 0x19a5
addq $0x14, %rbx
decq %r14
jne 0x126b
leaq 0x2e36(%rip), %rbx      # 0x40d0
leaq 0x2fe3(%rip), %r14      # 0x4284
leaq 0xe3b(%rip), %rbp       # 0x20e3
leaq 0xd85(%rip), %r13       # 0x2034
leaq 0x2e3a(%rip), %r12      # 0x40f0
callq 0x16c8
movq 0x2d16(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x1080
leal -0x102(%rax), %ecx
cmpl $0x3, %ecx
jbe 0x12f6
cmpl $0x1b, %eax
je 0x130a
cmpl $0x51, %eax
je 0x130a
cmpl $0x71, %eax
je 0x130a
xorl %esi, %esi
cmpl $0x19a, %eax            # imm = 0x19A
jne 0x1320
leaq 0xd6d(%rip), %r15       # 0x2061
jmp 0x1323
leaq 0xd27(%rip), %rdx       # 0x2024
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
pushq $0x4
jmp 0x131f
xorl %esi, %esi
leaq 0xd71(%rip), %r15       # 0x2084
jmp 0x1323
pushq $0x1
jmp 0x131f
pushq $0x2
jmp 0x131f
pushq $0x3
popq %rsi
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x17a8
cmpl $0x4, %eax
ja 0x1395
movl %eax, %eax
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
incl 0x2da2(%rip)            # 0x40e4
jmp 0x1395
movl 0x2d86(%rip), %eax      # 0x40d0
movl 0x2f30(%rip), %ecx      # 0x4280
movl 0x2d7e(%rip), %edx      # 0x40d4
xorl %esi, %esi
cmpl (%rsi,%r12), %eax
jne 0x1376
cmpl 0x4(%rsi,%r12), %edx
jne 0x1376
incl %ecx
movl %ecx, 0x2f13(%rip)      # 0x4280
movl $0x1, 0x10(%rsi,%r12)
addq $0x14, %rsi
cmpq $0x190, %rsi            # imm = 0x190
jne 0x1358
jmp 0x1395
leaq 0xd04(%rip), %r15       # 0x2090
jmp 0x1395
leaq 0xd16(%rip), %r15       # 0x20ab
callq 0x16c8
movl 0x2ee4(%rip), %eax      # 0x4284
movl 0x2d2a(%rip), %ecx      # 0x40d0
movl %eax, %edx
subl %ecx, %edx
movl 0x2ed8(%rip), %edi      # 0x4288
subl 0x2d1e(%rip), %edi      # 0x40d4
jns 0x13e1
movl %edx, %esi
negl %esi
cmpl %esi, %edi
setg %r8b
cmpl %edx, %edi
setl %r9b
testb %r9b, %r8b
jne 0x13e1
cmpl %edx, %edi
setg %r8b
cmpl %esi, %edi
setl %r9b
pushq $0x2
popq %rsi
testb %r9b, %r8b
je 0x1420
testl %edi, %edi
jle 0x140e
cmpl %edx, %edi
setg %r8b
movl %edx, %esi
negl %esi
cmpl %esi, %edi
setl %r9b
testb %r9b, %r8b
jne 0x140e
cmpl %esi, %edi
setg %r8b
cmpl %edx, %edi
setl %dil
pushq $0x1
popq %rsi
testb %dil, %r8b
je 0x1420
pushq $0x3
popq %rsi
testl %edx, %edx
jg 0x1420
xorl %esi, %esi
cmpl %ecx, %eax
setne %sil
shll $0x2, %esi
movq %r14, %rdi
callq 0x17a8
cmpl $0x1, %eax
jne 0x1470
movl 0x2e65(%rip), %eax      # 0x4298
leal 0x1(%rax), %ecx
movl %ecx, 0x2e5c(%rip)      # 0x4298
cmpl $0x2, %eax
jle 0x1470
callq 0x1100
cqto
pushq $0x4
popq %rcx
idivq %rcx
leal 0x1(%rdx), %esi
cmpq $0x4, %rdx
movl $0x0, %eax
cmovael %eax, %esi
movq %r14, %rdi
callq 0x17a8
testl %eax, %eax
jne 0x1470
andl $0x0, 0x2e28(%rip)      # 0x4298
movl 0x2c5a(%rip), %eax      # 0x40d0
cmpl 0x2e08(%rip), %eax      # 0x4284
jne 0x148c
movl 0x2c50(%rip), %eax      # 0x40d4
cmpl 0x2dfe(%rip), %eax      # 0x4288
je 0x14a2
cmpl $0x14, 0x2ded(%rip)     # 0x4280
cmoveq %rbp, %r15
testq %r15, %r15
je 0x12b6
jmp 0x14a9
leaq 0xc1c(%rip), %r15       # 0x20c5
callq 0x16c8
callq 0x1150
movq 0x2b3e(%rip), %rbx      # 0x3ff8
movq (%rbx), %rdi
leaq 0xc3f(%rip), %rsi       # 0x2103
movq %r15, %rdx
xorl %eax, %eax
callq 0x10e0
movq (%rbx), %rdi
movl 0x2da9(%rip), %edx      # 0x4280
leaq 0xc29(%rip), %rsi       # 0x2107
pushq $0x14
popq %rcx
xorl %eax, %eax
callq 0x10e0
movq (%rbx), %rdi
movl 0x2bf3(%rip), %edx      # 0x40e4
cmpl $0x1, %edx
leaq 0xb65(%rip), %rax       # 0x2060
leaq 0xc37(%rip), %rcx       # 0x2139
cmoveq %rax, %rcx
leaq 0xc15(%rip), %rsi       # 0x2122
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10e0