#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 */

/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
int I2CMasterBaseValid(unsigned long);
void I2CMasterControl(unsigned long ulBase, unsigned long ulCmd) {
  DEBUG_ASSERT(I2CMasterBaseValid(ulBase));
  DEBUG_ASSERT(
      (ulCmd == 0x00000007) || (ulCmd == 0x00000007) || (ulCmd == 0x00000003) ||
      (ulCmd == 0x00000001) || (ulCmd == 0x00000005) || (ulCmd == 0x00000004) ||
      (ulCmd == 0x0000000b) || (ulCmd == 0x00000009) || (ulCmd == 0x00000005) ||
      (ulCmd == 0x00000004) || (ulCmd == 0x00000027) || (ulCmd == 0x00000011));
  (*((volatile unsigned long *)(ulBase + 0x00000004))) = ulCmd;
}


x86 assembly (clang, -O0):
<I2CMasterControl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    $0x1,%al
cmpq   $0x7,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x7,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x3,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x1,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x5,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x4,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0xb,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x9,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x5,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x4,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
mov    $0x1,%al
cmpq   $0x27,-0x10(%rbp)
mov    %al,-0x11(%rbp)
je     11fb <I2CMasterControl+0xdb>
cmpq   $0x11,-0x10(%rbp)
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1040 <DEBUG_ASSERT@plt>
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterControl>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
call   1030 <I2CMasterBaseValid@plt>
mov    %eax,%edi
call   1040 <DEBUG_ASSERT@plt>
cmp    $0x27,%rbx
ja     1162 <I2CMasterControl+0x42>
mov    $0x1,%edi
movabs $0x8000000aba,%rax
bt     %rbx,%rax
jae    1162 <I2CMasterControl+0x42>
call   1040 <DEBUG_ASSERT@plt>
mov    %rbx,0x4(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
xor    %edi,%edi
cmp    $0x11,%rbx
sete   %dil
jmp    1151 <I2CMasterControl+0x31>

LLVM IR (-O0):
define void @I2CMasterControl(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = call i32 @I2CMasterBaseValid(i64 %5)
%7 = call i32 @DEBUG_ASSERT(i32 %6)
%8 = load i64, i64* %4
%9 = icmp eq i64 %8, 7
br i1 %9, label %43, label %10
10: ; preds = %2
%11 = load i64, i64* %4
%12 = icmp eq i64 %11, 7
br i1 %12, label %43, label %13
13: ; preds = %10
%14 = load i64, i64* %4
%15 = icmp eq i64 %14, 3
br i1 %15, label %43, label %16
16: ; preds = %13
%17 = load i64, i64* %4
%18 = icmp eq i64 %17, 1
br i1 %18, label %43, label %19
19: ; preds = %16
%20 = load i64, i64* %4
%21 = icmp eq i64 %20, 5
br i1 %21, label %43, label %22
22: ; preds = %19
%23 = load i64, i64* %4
%24 = icmp eq i64 %23, 4
br i1 %24, label %43, label %25
25: ; preds = %22
%26 = load i64, i64* %4
%27 = icmp eq i64 %26, 11
br i1 %27, label %43, label %28
28: ; preds = %25
%29 = load i64, i64* %4
%30 = icmp eq i64 %29, 9
br i1 %30, label %43, label %31
31: ; preds = %28
%32 = load i64, i64* %4
%33 = icmp eq i64 %32, 5
br i1 %33, label %43, label %34
34: ; preds = %31
%35 = load i64, i64* %4
%36 = icmp eq i64 %35, 4
br i1 %36, label %43, label %37
37: ; preds = %34
%38 = load i64, i64* %4
%39 = icmp eq i64 %38, 39
br i1 %39, label %43, label %40
40: ; preds = %37
%41 = load i64, i64* %4
%42 = icmp eq i64 %41, 17
br label %43
43: ; preds = %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10, %2
%44 = phi i1 [ true, %37 ], [ true, %34 ], [ true, %31 ], [ true, %28 ], [ true, %25 ], [ true, %22 ], [ true, %19 ], [ true, %16 ], [ true, %13 ], [ true, %10 ], [ true, %2 ], [ %42, %40 ]
%45 = zext i1 %44 to i32
%46 = call i32 @DEBUG_ASSERT(i32 %45)
%47 = load i64, i64* %4
%48 = load i64, i64* %3
%49 = add i64 %48, 4
%50 = inttoptr i64 %49 to i64*
store volatile i64 %47, i64* %50
ret void
}

LLVM IR (-O2):
define void @I2CMasterControl(i64 %0, i64 %1) {
%3 = tail call i32 @I2CMasterBaseValid(i64 %0)
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
switch i64 %1, label %5 [
i64 39, label %8
i64 11, label %8
i64 9, label %8
i64 7, label %8
i64 5, label %8
i64 4, label %8
i64 3, label %8
i64 1, label %8
]
5: ; preds = %2
%6 = icmp eq i64 %1, 17
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %2, %2, %2, %2, %2, %2, %2, %2, %5
%9 = phi i32 [ 1, %2 ], [ %7, %5 ], [ 1, %2 ], [ 1, %2 ], [ 1, %2 ], [ 1, %2 ], [ 1, %2 ], [ 1, %2 ], [ 1, %2 ]
%10 = tail call i32 @DEBUG_ASSERT(i32 %9)
%11 = add i64 %0, 4
%12 = inttoptr i64 %11 to i64*
store volatile i64 %1, i64* %12
ret void
}