#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 unsigned long *)(ui32Gen + 0x00000000))) =
      (((*((volatile unsigned long *)(ui32Gen + 0x00000000))) &
        ~(0x00000002 | 0x00000004 | 0x00040000 | 0x00020000 | 0x00010000 |
          0x0000C000 | 0x00003000 | 0x00000C00 | 0x00000300 | 0x000000C0 |
          0x00000008 | 0x00000010 | 0x00000020)) |
       ui32Config);
  if (ui32Config & 0x00000002) {
    (*((volatile unsigned long *)(ui32Gen + 0x00000020))) =
        (0x00000030 | 0x00000080);
    (*((volatile unsigned long *)(ui32Gen + 0x00000024))) =
        (0x00000300 | 0x00000800);
  } else {
    (*((volatile unsigned long *)(ui32Gen + 0x00000020))) =
        (0x0000000C | 0x00000080);
    (*((volatile unsigned long *)(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),%rcx
and    $0xfffffffffff80001,%rcx
movslq -0xc(%rbp),%rax
or     %rax,%rcx
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     116c <PWMGenConfigure+0x6c>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
cltq
movq   $0xb0,(%rax)
mov    -0x8(%rbp),%eax
add    $0x24,%eax
cltq
movq   $0xb00,(%rax)
jmp    118a <PWMGenConfigure+0x8a>
mov    -0x8(%rbp),%eax
add    $0x20,%eax
cltq
movq   $0x8c,(%rax)
mov    -0x8(%rbp),%eax
add    $0x24,%eax
cltq
movq   $0x80c,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMGenConfigure>:
movslq %esi,%rax
movslq %edi,%rcx
mov    $0xfffffffffff80001,%rsi
and    (%rax,%rcx,1),%rsi
movslq %edx,%rdx
or     %rdx,%rsi
mov    %rsi,(%rax,%rcx,1)
test   $0x2,%dl
mov    $0x8c,%edx
mov    $0xb0,%esi
cmove  %rdx,%rsi
mov    $0x80c,%edx
mov    $0xb00,%edi
cmove  %rdx,%rdi
mov    %rsi,0x20(%rax,%rcx,1)
mov    %rdi,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 i64*
%14 = load volatile i64, i64* %13
%15 = and i64 %14, -524287
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = or i64 %15, %17
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 0
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i64*
store volatile i64 %18, i64* %22
%23 = load i32, i32* %6
%24 = and i32 %23, 2
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %35
26: ; preds = %3
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 32
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i64*
store volatile i64 176, i64* %30
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 36
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i64*
store volatile i64 2816, i64* %34
br label %44
35: ; preds = %3
%36 = load i32, i32* %5
%37 = add nsw i32 %36, 32
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to i64*
store volatile i64 140, i64* %39
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 36
%42 = sext i32 %41 to i64
%43 = inttoptr i64 %42 to i64*
store volatile i64 2060, i64* %43
br label %44
44: ; preds = %35, %26
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 i64*
%7 = load volatile i64, i64* %6
%8 = and i64 %7, -524287
%9 = sext i32 %2 to i64
%10 = or i64 %8, %9
store volatile i64 %10, i64* %6
%11 = and i32 %2, 2
%12 = icmp eq i32 %11, 0
%13 = add nsw i32 %4, 32
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i64*
%16 = select i1 %12, i64 140, i64 176
%17 = select i1 %12, i64 2060, i64 2816
store volatile i64 %16, i64* %15
%18 = add nsw i32 %4, 36
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i64*
store volatile i64 %17, i64* %20
ret void
}