#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 Read32(void *, int);
int /*<<< orphan*/ Write32(void *, int, int);
void omap_dispc_init(void) {
  void *DISPC = ((void *)0x48050400);
  Write32(DISPC, 0x010, (2 << 12) | (2 << 3) | (1 << 2) | (1 << 0));
  Write32(DISPC, 0x044, (2 << 1));
  Write32(DISPC, 0x04c, 0x7c70da);
  Write32(DISPC, 0x050, 0x000000);
  Write32(DISPC, 0x54, 0x000000);
  Write32(DISPC, 0x58, 0x000000);
  Write32(DISPC, 0x06C,
          (1 << 14) | (1 << 13) | (1 << 12) | (2 << 8) | (8 << 0));
  Write32(DISPC, 0x070, (1 << 16) | (2 << 0));
  Write32(DISPC, 0x0A0, 0);
  Write32(DISPC, 0x130, 296 | (409 << 16));
  Write32(DISPC, 0x134, 0 | (298 << 16));
  Write32(DISPC, 0x138, ((-208) & 0xffff) | (-100 << 16));
  Write32(DISPC, 0x13C, 298 | (0 << 16));
  Write32(DISPC, 0x140, 517);
  Write32(DISPC, (0x130 + 0x90), 296 | (409 << 16));
  Write32(DISPC, (0x134 + 0x90), 0 | (298 << 16));
  Write32(DISPC, (0x138 + 0x90), ((-208) & 0xffff) | (-100 << 16));
  Write32(DISPC, (0x13C + 0x90), 298 | (0 << 16));
  Write32(DISPC, (0x140 + 0x90), 517);
  Write32(DISPC, 0x040,
          (1 << 16) | (1 << 15) | (3 << 8) | (1 << 7) | (1 << 5) | (1 << 3) |
              (1 << 0));
  while ((Read32(DISPC, 0x040) & (1 << 5)))
    ;
}


x86 assembly (clang, -O0):
<omap_dispc_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x48050400,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
mov    $0x2015,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x44,%esi
mov    $0x4,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4c,%esi
mov    $0x7c70da,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x50,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x54,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x58,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6c,%esi
mov    $0x7208,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x70,%esi
mov    $0x10002,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0xa0,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x130,%esi
mov    $0x1990128,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x134,%esi
mov    $0x12a0000,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x138,%esi
mov    $0xff9cff30,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x13c,%esi
mov    $0x12a,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x140,%esi
mov    $0x205,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1c0,%esi
mov    $0x1990128,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1c4,%esi
mov    $0x12a0000,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1c8,%esi
mov    $0xff9cff30,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1cc,%esi
mov    $0x12a,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1d0,%esi
mov    $0x205,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
mov    $0x183a9,%edx
call   1030 <Write32@plt>
mov    -0x8(%rbp),%rdi
mov    $0x40,%esi
call   1040 <Read32@plt>
and    $0x20,%eax
cmp    $0x0,%eax
je     12c0 <omap_dispc_init+0x1a0>
jmp    12a1 <omap_dispc_init+0x181>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<omap_dispc_init>:
push   %rax
mov    $0x48050400,%edi
mov    $0x10,%esi
mov    $0x2015,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x44,%esi
mov    $0x4,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x4c,%esi
mov    $0x7c70da,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x50,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x54,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x58,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x6c,%esi
mov    $0x7208,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x70,%esi
mov    $0x10002,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0xa0,%esi
xor    %edx,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x130,%esi
mov    $0x1990128,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x134,%esi
mov    $0x12a0000,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x138,%esi
mov    $0xff9cff30,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x13c,%esi
mov    $0x12a,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x140,%esi
mov    $0x205,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x1c0,%esi
mov    $0x1990128,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x1c4,%esi
mov    $0x12a0000,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x1c8,%esi
mov    $0xff9cff30,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x1cc,%esi
mov    $0x12a,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x1d0,%esi
mov    $0x205,%edx
call   1030 <Write32@plt>
mov    $0x48050400,%edi
mov    $0x40,%esi
mov    $0x183a9,%edx
call   1030 <Write32@plt>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x48050400,%edi
mov    $0x40,%esi
call   1040 <Read32@plt>
test   $0x20,%al
jne    12b0 <omap_dispc_init+0x190>
pop    %rax
ret

LLVM IR (-O0):
define void @omap_dispc_init() {
%1 = alloca i8*
store i8* inttoptr (i64 1208288256 to i8*), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @Write32(i8* %2, i32 16, i32 8213)
%4 = load i8*, i8** %1
%5 = call i32 @Write32(i8* %4, i32 68, i32 4)
%6 = load i8*, i8** %1
%7 = call i32 @Write32(i8* %6, i32 76, i32 8155354)
%8 = load i8*, i8** %1
%9 = call i32 @Write32(i8* %8, i32 80, i32 0)
%10 = load i8*, i8** %1
%11 = call i32 @Write32(i8* %10, i32 84, i32 0)
%12 = load i8*, i8** %1
%13 = call i32 @Write32(i8* %12, i32 88, i32 0)
%14 = load i8*, i8** %1
%15 = call i32 @Write32(i8* %14, i32 108, i32 29192)
%16 = load i8*, i8** %1
%17 = call i32 @Write32(i8* %16, i32 112, i32 65538)
%18 = load i8*, i8** %1
%19 = call i32 @Write32(i8* %18, i32 160, i32 0)
%20 = load i8*, i8** %1
%21 = call i32 @Write32(i8* %20, i32 304, i32 26804520)
%22 = load i8*, i8** %1
%23 = call i32 @Write32(i8* %22, i32 308, i32 19529728)
%24 = load i8*, i8** %1
%25 = call i32 @Write32(i8* %24, i32 312, i32 -6488272)
%26 = load i8*, i8** %1
%27 = call i32 @Write32(i8* %26, i32 316, i32 298)
%28 = load i8*, i8** %1
%29 = call i32 @Write32(i8* %28, i32 320, i32 517)
%30 = load i8*, i8** %1
%31 = call i32 @Write32(i8* %30, i32 448, i32 26804520)
%32 = load i8*, i8** %1
%33 = call i32 @Write32(i8* %32, i32 452, i32 19529728)
%34 = load i8*, i8** %1
%35 = call i32 @Write32(i8* %34, i32 456, i32 -6488272)
%36 = load i8*, i8** %1
%37 = call i32 @Write32(i8* %36, i32 460, i32 298)
%38 = load i8*, i8** %1
%39 = call i32 @Write32(i8* %38, i32 464, i32 517)
%40 = load i8*, i8** %1
%41 = call i32 @Write32(i8* %40, i32 64, i32 99241)
br label %42
42: ; preds = %47, %0
%43 = load i8*, i8** %1
%44 = call i32 @Read32(i8* %43, i32 64)
%45 = and i32 %44, 32
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %42
br label %42
48: ; preds = %42
ret void
}

LLVM IR (-O2):
define void @omap_dispc_init() {
%1 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 16, i32 8213)
%2 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 68, i32 4)
%3 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 76, i32 8155354)
%4 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 80, i32 0)
%5 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 84, i32 0)
%6 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 88, i32 0)
%7 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 108, i32 29192)
%8 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 112, i32 65538)
%9 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 160, i32 0)
%10 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 304, i32 26804520)
%11 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 308, i32 19529728)
%12 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 312, i32 -6488272)
%13 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 316, i32 298)
%14 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 320, i32 517)
%15 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 448, i32 26804520)
%16 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 452, i32 19529728)
%17 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 456, i32 -6488272)
%18 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 460, i32 298)
%19 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 464, i32 517)
%20 = tail call i32 @Write32(i8* inttoptr (i64 1208288256 to i8*), i32 64, i32 99241)
br label %21
21: ; preds = %21, %0
%22 = tail call i32 @Read32(i8* inttoptr (i64 1208288256 to i8*), i32 64)
%23 = and i32 %22, 32
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %21
25: ; preds = %21
ret void
}