#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*/ write_kernel_memory(int, int, int /*<<< orphan*/, int);
void setup_fpga() {
  int i;
  for (i = 0; i < 16; i++) {
    write_kernel_memory(0x20e0114 + i * 4, 0x0, 0, 4);
    write_kernel_memory(0x20e0428 + i * 4, 0xb0b1, 0, 4);
  }
  write_kernel_memory(0x20e046c - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e040c - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0410 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0414 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0418 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e041c - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0468 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0408 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0404 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e0400 - 0x314, 0x0, 0, 4);
  write_kernel_memory(0x20e046c, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e040c, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0410, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0414, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0418, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e041c, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0468, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0408, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0404, 0xb0b1, 0, 4);
  write_kernel_memory(0x20e0400, 0xb0b1, 0, 4);
  write_kernel_memory(0x020c4080, 0xcf3, 0, 4);
  write_kernel_memory(0x21b8000, 0x31910BBF, 0, 4);
  write_kernel_memory(0x21b8004, 0x1000, 0, 4);
  write_kernel_memory(0x21b8008, 0x09014000, 0, 4);
  write_kernel_memory(0x21b800c, 0x00000000, 0, 4);
  write_kernel_memory(0x21b8010, 0x09080800, 0, 4);
  write_kernel_memory(0x21b8090, 0x701, 0, 4);
  write_kernel_memory(0x21b8094, 0x10, 0, 4);
}


x86 assembly (clang, -O0):
<setup_fpga>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    116e <setup_fpga+0x5e>
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
add    $0x20e0114,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    -0x4(%rbp),%edi
shl    $0x2,%edi
add    $0x20e0428,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <setup_fpga+0xf>
mov    $0x20e0158,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e00f8,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e00fc,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e0100,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e0104,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e0108,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e0154,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e00f4,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e00f0,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e00ec,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x20e046c,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e040c,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0410,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0414,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0418,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e041c,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0468,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0408,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0404,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0400,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20c4080,%edi
mov    $0xcf3,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8000,%edi
mov    $0x31910bbf,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8004,%edi
mov    $0x1000,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8008,%edi
mov    $0x9014000,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b800c,%edi
xor    %edx,%edx
mov    $0x4,%ecx
mov    %edx,%esi
call   1030 <write_kernel_memory@plt>
mov    $0x21b8010,%edi
mov    $0x9080800,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8090,%edi
mov    $0x701,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8094,%edi
mov    $0x10,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setup_fpga>:
push   %rbx
mov    $0x20e0114,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %ebx,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
lea    0x314(%rbx),%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
add    $0x4,%ebx
cmp    $0x20e0154,%ebx
jne    1120 <setup_fpga+0x10>
mov    $0x20e0158,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e00f8,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e00fc,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0100,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0104,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0108,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0154,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e00f4,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e00f0,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e00ec,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e046c,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e040c,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0410,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0414,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0418,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e041c,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0468,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0408,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0404,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20e0400,%edi
mov    $0xb0b1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x20c4080,%edi
mov    $0xcf3,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8000,%edi
mov    $0x31910bbf,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8004,%edi
mov    $0x1000,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8008,%edi
mov    $0x9014000,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b800c,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8010,%edi
mov    $0x9080800,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8090,%edi
mov    $0x701,%esi
xor    %edx,%edx
mov    $0x4,%ecx
call   1030 <write_kernel_memory@plt>
mov    $0x21b8094,%edi
mov    $0x10,%esi
xor    %edx,%edx
mov    $0x4,%ecx
pop    %rbx
jmp    1030 <write_kernel_memory@plt>

LLVM IR (-O0):
define void @setup_fpga() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %14, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %17
5: ; preds = %2
%6 = load i32, i32* %1
%7 = mul nsw i32 %6, 4
%8 = add nsw i32 34472212, %7
%9 = call i32 @write_kernel_memory(i32 %8, i32 0, i32 0, i32 4)
%10 = load i32, i32* %1
%11 = mul nsw i32 %10, 4
%12 = add nsw i32 34473000, %11
%13 = call i32 @write_kernel_memory(i32 %12, i32 45233, i32 0, i32 4)
br label %14
14: ; preds = %5
%15 = load i32, i32* %1
%16 = add nsw i32 %15, 1
store i32 %16, i32* %1
br label %2
17: ; preds = %2
%18 = call i32 @write_kernel_memory(i32 34472280, i32 0, i32 0, i32 4)
%19 = call i32 @write_kernel_memory(i32 34472184, i32 0, i32 0, i32 4)
%20 = call i32 @write_kernel_memory(i32 34472188, i32 0, i32 0, i32 4)
%21 = call i32 @write_kernel_memory(i32 34472192, i32 0, i32 0, i32 4)
%22 = call i32 @write_kernel_memory(i32 34472196, i32 0, i32 0, i32 4)
%23 = call i32 @write_kernel_memory(i32 34472200, i32 0, i32 0, i32 4)
%24 = call i32 @write_kernel_memory(i32 34472276, i32 0, i32 0, i32 4)
%25 = call i32 @write_kernel_memory(i32 34472180, i32 0, i32 0, i32 4)
%26 = call i32 @write_kernel_memory(i32 34472176, i32 0, i32 0, i32 4)
%27 = call i32 @write_kernel_memory(i32 34472172, i32 0, i32 0, i32 4)
%28 = call i32 @write_kernel_memory(i32 34473068, i32 45233, i32 0, i32 4)
%29 = call i32 @write_kernel_memory(i32 34472972, i32 45233, i32 0, i32 4)
%30 = call i32 @write_kernel_memory(i32 34472976, i32 45233, i32 0, i32 4)
%31 = call i32 @write_kernel_memory(i32 34472980, i32 45233, i32 0, i32 4)
%32 = call i32 @write_kernel_memory(i32 34472984, i32 45233, i32 0, i32 4)
%33 = call i32 @write_kernel_memory(i32 34472988, i32 45233, i32 0, i32 4)
%34 = call i32 @write_kernel_memory(i32 34473064, i32 45233, i32 0, i32 4)
%35 = call i32 @write_kernel_memory(i32 34472968, i32 45233, i32 0, i32 4)
%36 = call i32 @write_kernel_memory(i32 34472964, i32 45233, i32 0, i32 4)
%37 = call i32 @write_kernel_memory(i32 34472960, i32 45233, i32 0, i32 4)
%38 = call i32 @write_kernel_memory(i32 34357376, i32 3315, i32 0, i32 4)
%39 = call i32 @write_kernel_memory(i32 35356672, i32 831589311, i32 0, i32 4)
%40 = call i32 @write_kernel_memory(i32 35356676, i32 4096, i32 0, i32 4)
%41 = call i32 @write_kernel_memory(i32 35356680, i32 151076864, i32 0, i32 4)
%42 = call i32 @write_kernel_memory(i32 35356684, i32 0, i32 0, i32 4)
%43 = call i32 @write_kernel_memory(i32 35356688, i32 151521280, i32 0, i32 4)
%44 = call i32 @write_kernel_memory(i32 35356816, i32 1793, i32 0, i32 4)
%45 = call i32 @write_kernel_memory(i32 35356820, i32 16, i32 0, i32 4)
ret void
}

LLVM IR (-O2):
define void @setup_fpga() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = shl nuw nsw i32 %2, 2
%4 = add nuw nsw i32 %3, 34472212
%5 = tail call i32 @write_kernel_memory(i32 %4, i32 0, i32 0, i32 4)
%6 = add nuw nsw i32 %3, 34473000
%7 = tail call i32 @write_kernel_memory(i32 %6, i32 45233, i32 0, i32 4)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 16
br i1 %9, label %10, label %1
10: ; preds = %1
%11 = tail call i32 @write_kernel_memory(i32 34472280, i32 0, i32 0, i32 4)
%12 = tail call i32 @write_kernel_memory(i32 34472184, i32 0, i32 0, i32 4)
%13 = tail call i32 @write_kernel_memory(i32 34472188, i32 0, i32 0, i32 4)
%14 = tail call i32 @write_kernel_memory(i32 34472192, i32 0, i32 0, i32 4)
%15 = tail call i32 @write_kernel_memory(i32 34472196, i32 0, i32 0, i32 4)
%16 = tail call i32 @write_kernel_memory(i32 34472200, i32 0, i32 0, i32 4)
%17 = tail call i32 @write_kernel_memory(i32 34472276, i32 0, i32 0, i32 4)
%18 = tail call i32 @write_kernel_memory(i32 34472180, i32 0, i32 0, i32 4)
%19 = tail call i32 @write_kernel_memory(i32 34472176, i32 0, i32 0, i32 4)
%20 = tail call i32 @write_kernel_memory(i32 34472172, i32 0, i32 0, i32 4)
%21 = tail call i32 @write_kernel_memory(i32 34473068, i32 45233, i32 0, i32 4)
%22 = tail call i32 @write_kernel_memory(i32 34472972, i32 45233, i32 0, i32 4)
%23 = tail call i32 @write_kernel_memory(i32 34472976, i32 45233, i32 0, i32 4)
%24 = tail call i32 @write_kernel_memory(i32 34472980, i32 45233, i32 0, i32 4)
%25 = tail call i32 @write_kernel_memory(i32 34472984, i32 45233, i32 0, i32 4)
%26 = tail call i32 @write_kernel_memory(i32 34472988, i32 45233, i32 0, i32 4)
%27 = tail call i32 @write_kernel_memory(i32 34473064, i32 45233, i32 0, i32 4)
%28 = tail call i32 @write_kernel_memory(i32 34472968, i32 45233, i32 0, i32 4)
%29 = tail call i32 @write_kernel_memory(i32 34472964, i32 45233, i32 0, i32 4)
%30 = tail call i32 @write_kernel_memory(i32 34472960, i32 45233, i32 0, i32 4)
%31 = tail call i32 @write_kernel_memory(i32 34357376, i32 3315, i32 0, i32 4)
%32 = tail call i32 @write_kernel_memory(i32 35356672, i32 831589311, i32 0, i32 4)
%33 = tail call i32 @write_kernel_memory(i32 35356676, i32 4096, i32 0, i32 4)
%34 = tail call i32 @write_kernel_memory(i32 35356680, i32 151076864, i32 0, i32 4)
%35 = tail call i32 @write_kernel_memory(i32 35356684, i32 0, i32 0, i32 4)
%36 = tail call i32 @write_kernel_memory(i32 35356688, i32 151521280, i32 0, i32 4)
%37 = tail call i32 @write_kernel_memory(i32 35356816, i32 1793, i32 0, i32 4)
%38 = tail call i32 @write_kernel_memory(i32 35356820, i32 16, i32 0, i32 4)
ret void
}