#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 */
void LCDRasterSubPanelConfigSet(uint32_t ui32Base, uint32_t ui32Flags,
                                uint32_t ui32BottomLines,
                                uint32_t ui32DefaultPixel) {
  ;

  ;
  ;
  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
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
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)
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCDRasterSubPanelConfigSet>:
add    $0xffffffff,%edx
movslq %edi,%r8
mov    $0x80000000,%r9d
and    0x38(%r8),%r9d
movzwl %cx,%eax
mov    %edx,%edi
shl    $0x10,%edi
and    $0x3ff0000,%edi
or     %esi,%eax
or     %edi,%eax
or     %r9d,%eax
mov    %eax,0x38(%r8)
shr    $0x10,%ecx
movzbl %cl,%eax
shr    $0x8,%edx
and    $0x100,%edx
or     %eax,%edx
mov    %edx,0x3c(%r8)
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* %7
%10 = add nsw i32 %9, -1
store i32 %10, i32* %7
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 56
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = and i32 %15, -2147483648
%17 = load i32, i32* %6
%18 = or i32 %16, %17
%19 = load i32, i32* %8
%20 = and i32 %19, 65535
%21 = shl i32 %20, 0
%22 = or i32 %18, %21
%23 = load i32, i32* %7
%24 = shl i32 %23, 16
%25 = and i32 %24, 67043328
%26 = or i32 %22, %25
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 56
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
store volatile i32 %26, i32* %30
%31 = load i32, i32* %8
%32 = ashr i32 %31, 16
%33 = and i32 %32, 255
%34 = load i32, i32* %7
%35 = ashr i32 %34, 16
%36 = and i32 %35, 1
%37 = shl i32 %36, 8
%38 = or i32 %33, %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 60
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
store volatile i32 %38, i32* %42
ret void
}

LLVM IR (-O2):
define void @LCDRasterSubPanelConfigSet(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = add nsw i32 %2, -1
%6 = add nsw i32 %0, 56
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = and i32 %9, -2147483648
%11 = and i32 %3, 65535
%12 = shl i32 %5, 16
%13 = and i32 %12, 67043328
%14 = or i32 %11, %1
%15 = or i32 %14, %13
%16 = or i32 %15, %10
store volatile i32 %16, i32* %8
%17 = lshr i32 %3, 16
%18 = and i32 %17, 255
%19 = lshr i32 %5, 8
%20 = and i32 %19, 256
%21 = or i32 %18, %20
%22 = add nsw i32 %0, 60
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
store volatile i32 %21, i32* %24
ret void
}