#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ set_xy(int, int);
void explode(int exp_x, int exp_y) {
  int i, j, xfin, yfin;
  int *rp;
  rp = (int *)0xF880;
  for (i = 0; i < 32; i++) {
    xfin = exp_x + (*rp++ >> 8);
    yfin = exp_y + (*rp++ >> 8);
    set_xy(xfin, yfin);
    for (j = 0; j < 16384; j++) {
    }
  }
}


x86 assembly (clang, -O0):
<explode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0xf880,%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    11b5 <explode+0xa5>
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    (%rcx),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    %rcx,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    (%rcx),%ecx
sar    $0x8,%ecx
add    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <set_xy@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4000,-0x10(%rbp)
jge    11a2 <explode+0x92>
jmp    1194 <explode+0x84>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1182 <explode+0x72>
jmp    11a7 <explode+0x97>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <explode+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<explode>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    0xf880(,%rbx,8),%edi
mov    0xf884(,%rbx,8),%esi
sar    $0x8,%edi
add    %ebp,%edi
sar    $0x8,%esi
add    %r14d,%esi
call   1030 <set_xy@plt>
add    $0x1,%rbx
cmp    $0x20,%ebx
jne    1120 <explode+0x10>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @explode(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32*
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32* inttoptr (i64 63616 to i32*), i32** %9
store i32 0, i32* %5
br label %10
10: ; preds = %37, %2
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 32
br i1 %12, label %13, label %40
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32*, i32** %9
%16 = getelementptr inbounds i32, i32* %15, i32 1
store i32* %16, i32** %9
%17 = load i32, i32* %15
%18 = ashr i32 %17, 8
%19 = add nsw i32 %14, %18
store i32 %19, i32* %7
%20 = load i32, i32* %4
%21 = load i32*, i32** %9
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %9
%23 = load i32, i32* %21
%24 = ashr i32 %23, 8
%25 = add nsw i32 %20, %24
store i32 %25, i32* %8
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = call i32 @set_xy(i32 %26, i32 %27)
store i32 0, i32* %6
br label %29
29: ; preds = %33, %13
%30 = load i32, i32* %6
%31 = icmp slt i32 %30, 16384
br i1 %31, label %32, label %36
32: ; preds = %29
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %29
36: ; preds = %29
br label %37
37: ; preds = %36
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %10
40: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @explode(i32 %0, i32 %1) {
br label %3
3: ; preds = %2, %3
%4 = phi i32* [ inttoptr (i64 63616 to i32*), %2 ], [ %14, %3 ]
%5 = phi i32 [ 0, %2 ], [ %15, %3 ]
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %4
%8 = ashr i32 %7, 8
%9 = add nsw i32 %8, %0
%10 = load i32, i32* %6
%11 = ashr i32 %10, 8
%12 = add nsw i32 %11, %1
%13 = tail call i32 @set_xy(i32 %9, i32 %12)
%14 = getelementptr inbounds i32, i32* %4, i64 2
%15 = add nuw nsw i32 %5, 1
%16 = icmp eq i32 %15, 32
br i1 %16, label %17, label %3
17: ; preds = %3
ret void
}