#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void LCDRasterSubPanelConfigSet(uint32_t ui32Base, uint32_t ui32Flags,
                                uint32_t ui32BottomLines,
                                uint32_t ui32DefaultPixel) {
  ASSERT(ui32Base == 0x44050000);
  ASSERT((ui32Flags == 0x20000000) || (ui32Flags == 0x00000000));
  ASSERT(ui32BottomLines && (ui32BottomLines <= 2048));
  ui32BottomLines--;
  (*((volatile uint32_t *)(ui32Base + 0x00000038))) =
      ((*((volatile uint32_t *)(ui32Base + 0x00000038))) & 0x80000000) |
      ui32Flags | ((ui32DefaultPixel & 0xFFFF) << 0) |
      ((ui32BottomLines << 16) & 0x03FF0000);
  (*((volatile uint32_t *)(ui32Base + 0x0000003C))) =
      ((ui32DefaultPixel >> 16) & 0x000000FF) |
      (((ui32BottomLines >> 16) & 1) << 8);
}


x86 assembly (clang, -O0):
<LCDRasterSubPanelConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x44050000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x20000000,-0x8(%rbp)
mov    %al,-0x11(%rbp)
je     1154 <LCDRasterSubPanelConfigSet+0x44>
cmpl   $0x0,-0x8(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x12(%rbp)
je     117d <LCDRasterSubPanelConfigSet+0x6d>
cmpl   $0x800,-0xc(%rbp)
setle  %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%ecx
and    $0x80000000,%ecx
or     -0x8(%rbp),%ecx
mov    -0x10(%rbp),%eax
and    $0xffff,%eax
shl    $0x0,%eax
or     %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
and    $0x3ff0000,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0x1,%eax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
cltq
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterSubPanelConfigSet>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%ebx
mov    %edx,%r12d
mov    %esi,%r14d
mov    %edi,%r15d
xor    %edi,%edi
cmp    $0x44050000,%r15d
sete   %dil
call   1030 <ASSERT@plt>
xor    %edi,%edi
test   $0xdfffffff,%r14d
sete   %dil
call   1030 <ASSERT@plt>
mov    %r12d,%ebp
add    $0xffffffff,%ebp
setb   %al
cmp    $0x801,%r12d
setl   %cl
and    %al,%cl
movzbl %cl,%edi
call   1030 <ASSERT@plt>
movslq %r15d,%rax
mov    $0x80000000,%ecx
and    0x38(%rax),%ecx
movzwl %bx,%edx
mov    %ebp,%esi
shl    $0x10,%esi
and    $0x3ff0000,%esi
or     %r14d,%edx
or     %esi,%edx
or     %ecx,%edx
mov    %edx,0x38(%rax)
shr    $0x10,%ebx
movzbl %bl,%ecx
shr    $0x8,%ebp
and    $0x100,%ebp
or     %ecx,%ebp
mov    %ebp,0x3c(%rax)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @LCDRasterSubPanelConfigSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = icmp eq i32 %9, 1141178368
%11 = zext i1 %10 to i32
%12 = call i32 @ASSERT(i32 %11)
%13 = load i32, i32* %6
%14 = icmp eq i32 %13, 536870912
br i1 %14, label %18, label %15
15: ; preds = %4
%16 = load i32, i32* %6
%17 = icmp eq i32 %16, 0
br label %18
18: ; preds = %15, %4
%19 = phi i1 [ true, %4 ], [ %17, %15 ]
%20 = zext i1 %19 to i32
%21 = call i32 @ASSERT(i32 %20)
%22 = load i32, i32* %7
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %18
%25 = load i32, i32* %7
%26 = icmp sle i32 %25, 2048
br label %27
27: ; preds = %24, %18
%28 = phi i1 [ false, %18 ], [ %26, %24 ]
%29 = zext i1 %28 to i32
%30 = call i32 @ASSERT(i32 %29)
%31 = load i32, i32* %7
%32 = add nsw i32 %31, -1
store i32 %32, i32* %7
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 56
%35 = sext i32 %34 to i64
%36 = inttoptr i64 %35 to i32*
%37 = load volatile i32, i32* %36
%38 = and i32 %37, -2147483648
%39 = load i32, i32* %6
%40 = or i32 %38, %39
%41 = load i32, i32* %8
%42 = and i32 %41, 65535
%43 = shl i32 %42, 0
%44 = or i32 %40, %43
%45 = load i32, i32* %7
%46 = shl i32 %45, 16
%47 = and i32 %46, 67043328
%48 = or i32 %44, %47
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 56
%51 = sext i32 %50 to i64
%52 = inttoptr i64 %51 to i32*
store volatile i32 %48, i32* %52
%53 = load i32, i32* %8
%54 = ashr i32 %53, 16
%55 = and i32 %54, 255
%56 = load i32, i32* %7
%57 = ashr i32 %56, 16
%58 = and i32 %57, 1
%59 = shl i32 %58, 8
%60 = or i32 %55, %59
%61 = load i32, i32* %5
%62 = add nsw i32 %61, 60
%63 = sext i32 %62 to i64
%64 = inttoptr i64 %63 to i32*
store volatile i32 %60, i32* %64
ret void
}

LLVM IR (-O2):
define void @LCDRasterSubPanelConfigSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %0, 1141178368
%6 = zext i1 %5 to i32
%7 = tail call i32 @ASSERT(i32 %6)
%8 = and i32 %1, -536870913
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
%11 = tail call i32 @ASSERT(i32 %10)
%12 = icmp ne i32 %2, 0
%13 = icmp slt i32 %2, 2049
%14 = and i1 %12, %13
%15 = zext i1 %14 to i32
%16 = tail call i32 @ASSERT(i32 %15)
%17 = add nsw i32 %2, -1
%18 = add nsw i32 %0, 56
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
%21 = load volatile i32, i32* %20
%22 = and i32 %21, -2147483648
%23 = and i32 %3, 65535
%24 = shl i32 %17, 16
%25 = and i32 %24, 67043328
%26 = or i32 %23, %1
%27 = or i32 %26, %25
%28 = or i32 %27, %22
store volatile i32 %28, i32* %20
%29 = lshr i32 %3, 16
%30 = and i32 %29, 255
%31 = lshr i32 %17, 8
%32 = and i32 %31, 256
%33 = or i32 %30, %32
%34 = add nsw i32 %0, 60
%35 = sext i32 %34 to i64
%36 = inttoptr i64 %35 to i32*
store volatile i32 %33, i32* %36
ret void
}