#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 PWMClockSet(uint32_t ui32Base, uint32_t ui32Config) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT((ui32Config == 0x00000100) || (ui32Config == 0x00000101) ||
         (ui32Config == 0x00000102) || (ui32Config == 0x00000103) ||
         (ui32Config == 0x00000104) || (ui32Config == 0x00000105));
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000FC8))) &
        ~(0x00000100 | 0x00000007)) |
       ui32Config);
}


x86 assembly (clang, -O0):
<PWMClockSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x40028000,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     113d <PWMClockSet+0x2d>
cmpl   $0x40029000,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    $0x1,%al
cmpl   $0x100,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     11b1 <PWMClockSet+0xa1>
mov    $0x1,%al
cmpl   $0x101,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     11b1 <PWMClockSet+0xa1>
mov    $0x1,%al
cmpl   $0x102,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     11b1 <PWMClockSet+0xa1>
mov    $0x1,%al
cmpl   $0x103,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     11b1 <PWMClockSet+0xa1>
mov    $0x1,%al
cmpl   $0x104,-0x8(%rbp)
mov    %al,-0xa(%rbp)
je     11b1 <PWMClockSet+0xa1>
cmpl   $0x105,-0x8(%rbp)
sete   %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    (%rax),%ecx
and    $0xfffffef8,%ecx
or     -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMClockSet>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40028000,%eax
sete   %dil
call   1030 <ASSERT@plt>
lea    -0x100(%rbx),%eax
xor    %edi,%edi
cmp    $0x6,%eax
setb   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
mov    $0xfffffef8,%ecx
and    0xfc8(%rax),%ecx
or     %ebx,%ecx
mov    %ecx,0xfc8(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @PWMClockSet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1073905664
br i1 %6, label %10, label %7
7: ; preds = %2
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1073909760
br label %10
10: ; preds = %7, %2
%11 = phi i1 [ true, %2 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @ASSERT(i32 %12)
%14 = load i32, i32* %4
%15 = icmp eq i32 %14, 256
br i1 %15, label %31, label %16
16: ; preds = %10
%17 = load i32, i32* %4
%18 = icmp eq i32 %17, 257
br i1 %18, label %31, label %19
19: ; preds = %16
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 258
br i1 %21, label %31, label %22
22: ; preds = %19
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 259
br i1 %24, label %31, label %25
25: ; preds = %22
%26 = load i32, i32* %4
%27 = icmp eq i32 %26, 260
br i1 %27, label %31, label %28
28: ; preds = %25
%29 = load i32, i32* %4
%30 = icmp eq i32 %29, 261
br label %31
31: ; preds = %28, %25, %22, %19, %16, %10
%32 = phi i1 [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %10 ], [ %30, %28 ]
%33 = zext i1 %32 to i32
%34 = call i32 @ASSERT(i32 %33)
%35 = load i32, i32* %3
%36 = add nsw i32 %35, 4040
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
%39 = load volatile i32, i32* %38
%40 = and i32 %39, -264
%41 = load i32, i32* %4
%42 = or i32 %40, %41
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 4040
%45 = sext i32 %44 to i64
%46 = inttoptr i64 %45 to i32*
store volatile i32 %42, i32* %46
ret void
}

LLVM IR (-O2):
define void @PWMClockSet(i32 %0, i32 %1) {
%3 = and i32 %0, -4097
%4 = icmp eq i32 %3, 1073905664
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = add i32 %1, -256
%8 = icmp ult i32 %7, 6
%9 = zext i1 %8 to i32
%10 = tail call i32 @ASSERT(i32 %9)
%11 = add nsw i32 %0, 4040
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -264
%16 = or i32 %15, %1
store volatile i32 %16, i32* %13
ret void
}