// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/cavescroll/cavescroll.c
// Function: objects_col_detect
static void objects_col_detect(void)
{
  object_t *curr_a, *curr_b;

  if (objects == NULL)
    return;

  for (curr_a = objects; curr_a != NULL; curr_a = curr_a->next) {
    if (curr_a->removed)
      continue;

    switch (curr_a->type) {
    case GRAPHICS_SHOT:
      if (mvinch(curr_a->y, curr_a->x) == GRAPHICS_CAVE) {
        curr_a->removed = 1;
      }
      for (curr_b = objects; curr_b != NULL; curr_b = curr_b->next) {
        if (curr_b->removed)
          continue;
        if (curr_a == curr_b)
          continue;
        if (curr_a->x == curr_b->x && curr_a->y == curr_b->y) {
          flash();
          if (curr_b->type == GRAPHICS_ENEMY)
            score += 5;
          curr_a->removed = 1;
          curr_b->removed = 1;
        }
      }
      break;

    case GRAPHICS_MONEY:
      if ((curr_a->x == player_x) && (curr_a->y == player_y)) {
        score++;
        curr_a->removed = 1;
      }
      break;

    case GRAPHICS_AMMO:
      if ((curr_a->x == player_x) && (curr_a->y == player_y)) {
        ammo++;
        curr_a->removed = 1;
      }
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpq $0x0, 0x3590(%rip)      # 0x5380
jne 0x1df7
jmp 0x1fbe
movq 0x3582(%rip), %rax      # 0x5380
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1fbe
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x1e1c
jmp 0x1fad
movq -0x8(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x14(%rbp)
subl $0x24, %eax
je 0x1f37
jmp 0x1e31
movl -0x14(%rbp), %eax
subl $0x2b, %eax
je 0x1f71
jmp 0x1e3f
movl -0x14(%rbp), %eax
subl $0x2d, %eax
jne 0x1fab
jmp 0x1e4d
movq 0x318c(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x4(%rax), %edx
callq 0x1130
cmpl $-0x1, %eax
jne 0x1e79
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x18(%rbp)
jmp 0x1e8b
movq 0x3160(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
callq 0x1110
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl $0x23, %eax
jne 0x1e9e
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
movq 0x34db(%rip), %rax      # 0x5380
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1f35
movq -0x10(%rbp), %rax
cmpl $0x0, 0xc(%rax)
je 0x1ec0
jmp 0x1f24
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x1ecc
jmp 0x1f24
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jne 0x1f22
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x1f22
callq 0x10c0
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
cmpl $0x40, %eax
jne 0x1f0c
movl 0x31f9(%rip), %eax      # 0x50fc
addl $0x5, %eax
movl %eax, 0x31f0(%rip)      # 0x50fc
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
movq -0x10(%rbp), %rax
movl $0x1, 0xc(%rax)
jmp 0x1f24
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x1ea9
jmp 0x1fab
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
cmpl 0x31b4(%rip), %eax      # 0x50f8
jne 0x1f6f
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
cmpl 0x319d(%rip), %eax      # 0x50f0
jne 0x1f6f
movl 0x31a1(%rip), %eax      # 0x50fc
addl $0x1, %eax
movl %eax, 0x3198(%rip)      # 0x50fc
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
jmp 0x1fab
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
cmpl 0x317a(%rip), %eax      # 0x50f8
jne 0x1fa9
movq -0x8(%rbp), %rax
movl 0x8(%rax), %eax
cmpl 0x3163(%rip), %eax      # 0x50f0
jne 0x1fa9
movl 0x315f(%rip), %eax      # 0x50f4
addl $0x1, %eax
movl %eax, 0x3156(%rip)      # 0x50f4
movq -0x8(%rbp), %rax
movl $0x1, 0xc(%rax)
jmp 0x1fab
jmp 0x1fad
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e02
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)