#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*/ delay();
int /*<<< orphan*/ write_to_address(int, int);
void disable_gppud() {
  unsigned int register_a;
  write_to_address(0x3F200094, 0);
  for (register_a = 0; register_a < 150; register_a++) {
    delay();
  }
  write_to_address(0x3F200098, (1 << 4) | (1 << 14) | (1 << 15) | (1 << 22) |
                                   (1 << 24) | (1 << 25) | (1 << 27));
  write_to_address(0x3F20009C, (1 << 15));
  for (register_a = 0; register_a < 150; register_a++) {
    delay();
  }
  write_to_address(0x3F200098, 0);
}


x86 assembly (clang, -O0):
<disable_gppud>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3f200094,%edi
xor    %esi,%esi
call   1040 <write_to_address@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x96,-0x4(%rbp)
jae    115d <disable_gppud+0x3d>
mov    $0x0,%al
call   1030 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    113b <disable_gppud+0x1b>
mov    $0x3f200098,%edi
mov    $0xb40c010,%esi
call   1040 <write_to_address@plt>
mov    $0x3f20009c,%edi
mov    $0x8000,%esi
call   1040 <write_to_address@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x96,-0x4(%rbp)
jae    11a4 <disable_gppud+0x84>
mov    $0x0,%al
call   1030 <delay@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1182 <disable_gppud+0x62>
mov    $0x3f200098,%edi
xor    %esi,%esi
call   1040 <write_to_address@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<disable_gppud>:
push   %rbx
mov    $0x3f200094,%edi
xor    %esi,%esi
call   1040 <write_to_address@plt>
mov    $0x96,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1030 <delay@plt>
add    $0xffffffff,%ebx
jne    1140 <disable_gppud+0x20>
mov    $0x3f200098,%edi
mov    $0xb40c010,%esi
call   1040 <write_to_address@plt>
mov    $0x3f20009c,%edi
mov    $0x8000,%esi
call   1040 <write_to_address@plt>
mov    $0x96,%ebx
nop
xor    %eax,%eax
call   1030 <delay@plt>
add    $0xffffffff,%ebx
jne    1170 <disable_gppud+0x50>
mov    $0x3f200098,%edi
xor    %esi,%esi
pop    %rbx
jmp    1040 <write_to_address@plt>

LLVM IR (-O0):
define void @disable_gppud() {
%1 = alloca i32
%2 = call i32 @write_to_address(i32 1059061908, i32 0)
store i32 0, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp ult i32 %4, 150
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @delay()
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add i32 %9, 1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 @write_to_address(i32 1059061912, i32 188792848)
%13 = call i32 @write_to_address(i32 1059061916, i32 32768)
store i32 0, i32* %1
br label %14
14: ; preds = %19, %11
%15 = load i32, i32* %1
%16 = icmp ult i32 %15, 150
br i1 %16, label %17, label %22
17: ; preds = %14
%18 = call i32 (...) @delay()
br label %19
19: ; preds = %17
%20 = load i32, i32* %1
%21 = add i32 %20, 1
store i32 %21, i32* %1
br label %14
22: ; preds = %14
%23 = call i32 @write_to_address(i32 1059061912, i32 0)
ret void
}

LLVM IR (-O2):
define void @disable_gppud() {
%1 = tail call i32 @write_to_address(i32 1059061908, i32 0)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %5, %2 ]
%4 = tail call i32 (...) @delay()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 150
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i32 @write_to_address(i32 1059061912, i32 188792848)
%9 = tail call i32 @write_to_address(i32 1059061916, i32 32768)
br label %10
10: ; preds = %7, %10
%11 = phi i32 [ 0, %7 ], [ %13, %10 ]
%12 = tail call i32 (...) @delay()
%13 = add nuw nsw i32 %11, 1
%14 = icmp eq i32 %13, 150
br i1 %14, label %15, label %10
15: ; preds = %10
%16 = tail call i32 @write_to_address(i32 1059061912, i32 0)
ret void
}