#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;
typedef int ui32Base;

/* Variables and functions */
void PWMGenConfigure(uint32_t ui32Base, uint32_t ui32Gen, uint32_t ui32Config) {
  ;
  ;
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x00000000))) =
      (((*((volatile uint32_t *)(ui32Gen + 0x00000000))) &
        ~(0x00000002 | 0x00000004 | 0x00040000 | 0x00020000 | 0x00010000 |
          0x0000C000 | 0x00003000 | 0x00000C00 | 0x00000300 | 0x000000C0 |
          0x00000008 | 0x00000010 | 0x00000020)) |
       ui32Config);
  if (ui32Config & 0x00000002) {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) =
        (0x00000030 | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) =
        (0x00000300 | 0x00000800);
  } else {
    (*((volatile uint32_t *)(ui32Gen + 0x00000020))) =
        (0x0000000C | 0x00000080);
    (*((volatile uint32_t *)(ui32Gen + 0x00000024))) =
        (0x0000000C | 0x00000800);
  }
}


x86 assembly (clang, -O0):
<PWMGenConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    (%rax),%ecx
and    $0xfff80001,%ecx
or     -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1163 <PWMGenConfigure+0x63>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
cltq
movl   $0xb0,(%rax)
mov    -0x8(%rbp),%eax
add    $0x24,%eax
cltq
movl   $0xb00,(%rax)
jmp    117f <PWMGenConfigure+0x7f>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
cltq
movl   $0x8c,(%rax)
mov    -0x8(%rbp),%eax
add    $0x24,%eax
cltq
movl   $0x80c,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenConfigure>:
movslq %esi,%rax
movslq %edi,%rcx
mov    $0xfff80001,%esi
and    (%rax,%rcx,1),%esi
or     %edx,%esi
mov    %esi,(%rax,%rcx,1)
test   $0x2,%dl
mov    $0x8c,%edx
mov    $0xb0,%esi
cmove  %edx,%esi
mov    $0x80c,%edx
mov    $0xb00,%edi
cmove  %edx,%edi
mov    %esi,0x20(%rax,%rcx,1)
mov    %edi,0x24(%rax,%rcx,1)
ret

LLVM IR (-O0):
define void @PWMGenConfigure(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = add nsw i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = add nsw i32 %10, 0
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i32*
%14 = load volatile i32, i32* %13
%15 = and i32 %14, -524287
%16 = load i32, i32* %6
%17 = or i32 %15, %16
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 0
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
store volatile i32 %17, i32* %21
%22 = load i32, i32* %6
%23 = and i32 %22, 2
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %34
25: ; preds = %3
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 32
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i32*
store volatile i32 176, i32* %29
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 36
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
store volatile i32 2816, i32* %33
br label %43
34: ; preds = %3
%35 = load i32, i32* %5
%36 = add nsw i32 %35, 32
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
store volatile i32 140, i32* %38
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 36
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i32*
store volatile i32 2060, i32* %42
br label %43
43: ; preds = %34, %25
ret void
}

LLVM IR (-O2):
define void @PWMGenConfigure(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
%7 = load volatile i32, i32* %6
%8 = and i32 %7, -524287
%9 = or i32 %8, %2
store volatile i32 %9, i32* %6
%10 = and i32 %2, 2
%11 = icmp eq i32 %10, 0
%12 = add nsw i32 %4, 32
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = select i1 %11, i32 140, i32 176
%16 = select i1 %11, i32 2060, i32 2816
store volatile i32 %15, i32* %14
%17 = add nsw i32 %4, 36
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %16, i32* %19
ret void
}