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

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
int _PWMGenValid(int);
void PWMDeadBandEnable(uint32_t ui32Base, uint32_t ui32Gen, uint16_t ui16Rise,
                       uint16_t ui16Fall) {
  ASSERT((ui32Base == 0x40028000) || (ui32Base == 0x40029000));
  ASSERT(_PWMGenValid(ui32Gen));
  ASSERT(ui16Rise < 4096);
  ASSERT(ui16Fall < 4096);
  ui32Gen = ((ui32Base) + (ui32Gen));
  (*((volatile uint32_t *)(ui32Gen + 0x0000002C))) = ui16Rise;
  (*((volatile uint32_t *)(ui32Gen + 0x00000030))) = ui16Fall;
  (*((volatile uint32_t *)(ui32Gen + 0x00000028))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<PWMDeadBandEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    $0x1,%al
cmpl   $0x40028000,-0x4(%rbp)
mov    %al,-0x11(%rbp)
je     1153 <PWMDeadBandEnable+0x33>
cmpl   $0x40029000,-0x4(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x8(%rbp),%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
cmpl   $0x1000,-0xc(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
cmpl   $0x1000,-0x10(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x2c,%eax
cltq
mov    %ecx,(%rax)
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x30,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
add    $0x28,%eax
cltq
mov    (%rax),%ecx
or     $0x1,%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PWMDeadBandEnable>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%ebx
mov    %edi,%eax
and    $0xffffefff,%eax
xor    %edi,%edi
cmp    $0x40028000,%eax
sete   %dil
call   1040 <ASSERT@plt>
mov    %ebp,%edi
call   1030 <_PWMGenValid@plt>
mov    %eax,%edi
call   1040 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x1000,%r15d
setl   %dil
call   1040 <ASSERT@plt>
xor    %edi,%edi
cmp    $0x1000,%r14d
setl   %dil
call   1040 <ASSERT@plt>
movslq %ebp,%rax
movslq %ebx,%rcx
mov    %r15d,0x2c(%rax,%rcx,1)
mov    %r14d,0x30(%rax,%rcx,1)
orl    $0x1,0x28(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @PWMDeadBandEnable(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, 1073905664
br i1 %10, label %14, label %11
11: ; preds = %4
%12 = load i32, i32* %5
%13 = icmp eq i32 %12, 1073909760
br label %14
14: ; preds = %11, %4
%15 = phi i1 [ true, %4 ], [ %13, %11 ]
%16 = zext i1 %15 to i32
%17 = call i32 @ASSERT(i32 %16)
%18 = load i32, i32* %6
%19 = call i32 @_PWMGenValid(i32 %18)
%20 = call i32 @ASSERT(i32 %19)
%21 = load i32, i32* %7
%22 = icmp slt i32 %21, 4096
%23 = zext i1 %22 to i32
%24 = call i32 @ASSERT(i32 %23)
%25 = load i32, i32* %8
%26 = icmp slt i32 %25, 4096
%27 = zext i1 %26 to i32
%28 = call i32 @ASSERT(i32 %27)
%29 = load i32, i32* %5
%30 = load i32, i32* %6
%31 = add nsw i32 %29, %30
store i32 %31, i32* %6
%32 = load i32, i32* %7
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 44
%35 = sext i32 %34 to i64
%36 = inttoptr i64 %35 to i32*
store volatile i32 %32, i32* %36
%37 = load i32, i32* %8
%38 = load i32, i32* %6
%39 = add nsw i32 %38, 48
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i32*
store volatile i32 %37, i32* %41
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 40
%44 = sext i32 %43 to i64
%45 = inttoptr i64 %44 to i32*
%46 = load volatile i32, i32* %45
%47 = or i32 %46, 1
store volatile i32 %47, i32* %45
ret void
}

LLVM IR (-O2):
define void @PWMDeadBandEnable(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %0, -4097
%6 = icmp eq i32 %5, 1073905664
%7 = zext i1 %6 to i32
%8 = tail call i32 @ASSERT(i32 %7)
%9 = tail call i32 @_PWMGenValid(i32 %1)
%10 = tail call i32 @ASSERT(i32 %9)
%11 = icmp slt i32 %2, 4096
%12 = zext i1 %11 to i32
%13 = tail call i32 @ASSERT(i32 %12)
%14 = icmp slt i32 %3, 4096
%15 = zext i1 %14 to i32
%16 = tail call i32 @ASSERT(i32 %15)
%17 = add nsw i32 %1, %0
%18 = add nsw i32 %17, 44
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i32*
store volatile i32 %2, i32* %20
%21 = add nsw i32 %17, 48
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %3, i32* %23
%24 = add nsw i32 %17, 40
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
%27 = load volatile i32, i32* %26
%28 = or i32 %27, 1
store volatile i32 %28, i32* %26
ret void
}