#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*/ TimerCompare1Set(unsigned long, unsigned long);
int /*<<< orphan*/ TimerCompare2Set(unsigned long, unsigned long);
int /*<<< orphan*/ TimerCompare3Set(unsigned long, unsigned long);
int /*<<< orphan*/ TimerCompare4Set(unsigned long, unsigned long);
void xTimerMatchSet(unsigned long ulBase, unsigned long ulChannel,
                    unsigned long ulValue) {
  if (ulChannel == 1) {
    TimerCompare1Set(ulBase, ulValue);
  } else if (ulChannel == 2) {
    TimerCompare2Set(ulBase, ulValue);
  } else if (ulChannel == 3) {
    TimerCompare3Set(ulBase, ulValue);
  } else {
    TimerCompare4Set(ulBase, ulValue);
  }
}


x86 assembly (clang, -O0):
<xTimerMatchSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1171 <xTimerMatchSet+0x31>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <TimerCompare1Set@plt>
jmp    11c2 <xTimerMatchSet+0x82>
cmpq   $0x2,-0x10(%rbp)
jne    118e <xTimerMatchSet+0x4e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <TimerCompare2Set@plt>
jmp    11bd <xTimerMatchSet+0x7d>
cmpq   $0x3,-0x10(%rbp)
jne    11ab <xTimerMatchSet+0x6b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1060 <TimerCompare3Set@plt>
jmp    11b8 <xTimerMatchSet+0x78>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <TimerCompare4Set@plt>
jmp    11bd <xTimerMatchSet+0x7d>
jmp    11c2 <xTimerMatchSet+0x82>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xTimerMatchSet>:
cmp    $0x3,%rsi
je     115a <xTimerMatchSet+0x1a>
cmp    $0x2,%rsi
je     1162 <xTimerMatchSet+0x22>
cmp    $0x1,%rsi
jne    116a <xTimerMatchSet+0x2a>
mov    %rdx,%rsi
jmp    1050 <TimerCompare1Set@plt>
mov    %rdx,%rsi
jmp    1060 <TimerCompare3Set@plt>
mov    %rdx,%rsi
jmp    1040 <TimerCompare2Set@plt>
mov    %rdx,%rsi
jmp    1030 <TimerCompare4Set@plt>

LLVM IR (-O0):
define void @xTimerMatchSet(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i64, i64* %4
%11 = load i64, i64* %6
%12 = call i32 @TimerCompare1Set(i64 %10, i64 %11)
br label %33
13: ; preds = %3
%14 = load i64, i64* %5
%15 = icmp eq i64 %14, 2
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* %4
%18 = load i64, i64* %6
%19 = call i32 @TimerCompare2Set(i64 %17, i64 %18)
br label %32
20: ; preds = %13
%21 = load i64, i64* %5
%22 = icmp eq i64 %21, 3
br i1 %22, label %23, label %27
23: ; preds = %20
%24 = load i64, i64* %4
%25 = load i64, i64* %6
%26 = call i32 @TimerCompare3Set(i64 %24, i64 %25)
br label %31
27: ; preds = %20
%28 = load i64, i64* %4
%29 = load i64, i64* %6
%30 = call i32 @TimerCompare4Set(i64 %28, i64 %29)
br label %31
31: ; preds = %27, %23
br label %32
32: ; preds = %31, %16
br label %33
33: ; preds = %32, %9
ret void
}

LLVM IR (-O2):
define void @xTimerMatchSet(i64 %0, i64 %1, i64 %2) {
switch i64 %1, label %10 [
i64 1, label %4
i64 2, label %6
i64 3, label %8
]
4: ; preds = %3
%5 = tail call i32 @TimerCompare1Set(i64 %0, i64 %2)
br label %12
6: ; preds = %3
%7 = tail call i32 @TimerCompare2Set(i64 %0, i64 %2)
br label %12
8: ; preds = %3
%9 = tail call i32 @TimerCompare3Set(i64 %0, i64 %2)
br label %12
10: ; preds = %3
%11 = tail call i32 @TimerCompare4Set(i64 %0, i64 %2)
br label %12
12: ; preds = %6, %10, %8, %4
ret void
}