#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*/ TimerIC1PrescalerSet(unsigned long, unsigned long);
int /*<<< orphan*/ TimerIC2PrescalerSet(unsigned long, unsigned long);
int /*<<< orphan*/ TimerIC3PrescalerSet(unsigned long, unsigned long);
int /*<<< orphan*/ TimerIC4PrescalerSet(unsigned long, unsigned long);
int /*<<< orphan*/ TimerTI1Configure(unsigned long, unsigned long,
                                     unsigned long, unsigned long);
int /*<<< orphan*/ TimerTI2Configure(unsigned long, unsigned long,
                                     unsigned long, unsigned long);
int /*<<< orphan*/ TimerTI3Configure(unsigned long, unsigned long,
                                     unsigned long, unsigned long);
int /*<<< orphan*/ TimerTI4Configure(unsigned long, unsigned long,
                                     unsigned long, unsigned long);
void TimerICConfigure(unsigned long ulBase, unsigned long ulChannel,
                      unsigned long ulICPolarity, unsigned long ulICSelection,
                      unsigned long ulPrescaler, unsigned long ulICFilter) {

  ;
  if ((ulBase == 0x40012C00) || (ulBase == 0x40000000) ||
      (ulBase == 0x40000400) || (ulBase == 0x40000800) ||
      (ulBase == 0x40000C00) || (ulBase == 0x40013400)) {

    ;
  } else {

    ;
  }
  if (ulChannel == 1) {
    TimerTI1Configure(ulBase, ulICPolarity, ulICSelection, ulICFilter);
    TimerIC1PrescalerSet(ulBase, ulPrescaler);
  } else if (ulChannel == 2) {
    TimerTI2Configure(ulBase, ulICPolarity, ulICSelection, ulICFilter);
    TimerIC2PrescalerSet(ulBase, ulPrescaler);
  } else if (ulChannel == 3) {
    TimerTI3Configure(ulBase, ulICPolarity, ulICSelection, ulICFilter);
    TimerIC3PrescalerSet(ulBase, ulPrescaler);
  } else {
    TimerTI4Configure(ulBase, ulICPolarity, ulICSelection, ulICFilter);
    TimerIC4PrescalerSet(ulBase, ulPrescaler);
  }
}


x86 assembly (clang, -O0):
<TimerICConfigure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x40012c00,-0x8(%rbp)
40
je     11f4 <TimerICConfigure+0x74>
cmpq   $0x40000000,-0x8(%rbp)
40
je     11f4 <TimerICConfigure+0x74>
cmpq   $0x40000400,-0x8(%rbp)
40
je     11f4 <TimerICConfigure+0x74>
cmpq   $0x40000800,-0x8(%rbp)
40
je     11f4 <TimerICConfigure+0x74>
cmpq   $0x40000c00,-0x8(%rbp)
40
je     11f4 <TimerICConfigure+0x74>
cmpq   $0x40013400,-0x8(%rbp)
40
jne    11f9 <TimerICConfigure+0x79>
jmp    11fe <TimerICConfigure+0x7e>
jmp    11fe <TimerICConfigure+0x7e>
cmpq   $0x1,-0x10(%rbp)
jne    1230 <TimerICConfigure+0xb0>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1040 <TimerTI1Configure@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <TimerIC1PrescalerSet@plt>
jmp    12c0 <TimerICConfigure+0x140>
cmpq   $0x2,-0x10(%rbp)
jne    1262 <TimerICConfigure+0xe2>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1080 <TimerTI2Configure@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <TimerIC2PrescalerSet@plt>
jmp    12bb <TimerICConfigure+0x13b>
cmpq   $0x3,-0x10(%rbp)
jne    1294 <TimerICConfigure+0x114>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1070 <TimerTI3Configure@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <TimerIC3PrescalerSet@plt>
jmp    12b6 <TimerICConfigure+0x136>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x30(%rbp),%rcx
call   1050 <TimerTI4Configure@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1060 <TimerIC4PrescalerSet@plt>
jmp    12bb <TimerICConfigure+0x13b>
jmp    12c0 <TimerICConfigure+0x140>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerICConfigure>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rdi,%rbx
cmp    $0x3,%rsi
je     11bc <TimerICConfigure+0x3c>
cmp    $0x2,%rsi
je     11dc <TimerICConfigure+0x5c>
cmp    $0x1,%rsi
jne    11fc <TimerICConfigure+0x7c>
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r9,%rcx
call   1040 <TimerTI1Configure@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1090 <TimerIC1PrescalerSet@plt>
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r9,%rcx
call   1070 <TimerTI3Configure@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <TimerIC3PrescalerSet@plt>
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r9,%rcx
call   1080 <TimerTI2Configure@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    10a0 <TimerIC2PrescalerSet@plt>
mov    %rdx,%rsi
mov    %rcx,%rdx
mov    %r9,%rcx
call   1050 <TimerTI4Configure@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <TimerIC4PrescalerSet@plt>

LLVM IR (-O0):
define void @TimerICConfigure(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
store i64 %0, i64* %7
store i64 %1, i64* %8
store i64 %2, i64* %9
store i64 %3, i64* %10
store i64 %4, i64* %11
store i64 %5, i64* %12
%13 = load i64, i64* %7
%14 = icmp eq i64 %13, 1073818624
br i1 %14, label %30, label %15
15: ; preds = %6
%16 = load i64, i64* %7
%17 = icmp eq i64 %16, 1073741824
br i1 %17, label %30, label %18
18: ; preds = %15
%19 = load i64, i64* %7
%20 = icmp eq i64 %19, 1073742848
br i1 %20, label %30, label %21
21: ; preds = %18
%22 = load i64, i64* %7
%23 = icmp eq i64 %22, 1073743872
br i1 %23, label %30, label %24
24: ; preds = %21
%25 = load i64, i64* %7
%26 = icmp eq i64 %25, 1073744896
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i64, i64* %7
%29 = icmp eq i64 %28, 1073820672
br i1 %29, label %30, label %31
30: ; preds = %27, %24, %21, %18, %15, %6
br label %32
31: ; preds = %27
br label %32
32: ; preds = %31, %30
%33 = load i64, i64* %8
%34 = icmp eq i64 %33, 1
br i1 %34, label %35, label %44
35: ; preds = %32
%36 = load i64, i64* %7
%37 = load i64, i64* %9
%38 = load i64, i64* %10
%39 = load i64, i64* %12
%40 = call i32 @TimerTI1Configure(i64 %36, i64 %37, i64 %38, i64 %39)
%41 = load i64, i64* %7
%42 = load i64, i64* %11
%43 = call i32 @TimerIC1PrescalerSet(i64 %41, i64 %42)
br label %79
44: ; preds = %32
%45 = load i64, i64* %8
%46 = icmp eq i64 %45, 2
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = load i64, i64* %7
%49 = load i64, i64* %9
%50 = load i64, i64* %10
%51 = load i64, i64* %12
%52 = call i32 @TimerTI2Configure(i64 %48, i64 %49, i64 %50, i64 %51)
%53 = load i64, i64* %7
%54 = load i64, i64* %11
%55 = call i32 @TimerIC2PrescalerSet(i64 %53, i64 %54)
br label %78
56: ; preds = %44
%57 = load i64, i64* %8
%58 = icmp eq i64 %57, 3
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i64, i64* %7
%61 = load i64, i64* %9
%62 = load i64, i64* %10
%63 = load i64, i64* %12
%64 = call i32 @TimerTI3Configure(i64 %60, i64 %61, i64 %62, i64 %63)
%65 = load i64, i64* %7
%66 = load i64, i64* %11
%67 = call i32 @TimerIC3PrescalerSet(i64 %65, i64 %66)
br label %77
68: ; preds = %56
%69 = load i64, i64* %7
%70 = load i64, i64* %9
%71 = load i64, i64* %10
%72 = load i64, i64* %12
%73 = call i32 @TimerTI4Configure(i64 %69, i64 %70, i64 %71, i64 %72)
%74 = load i64, i64* %7
%75 = load i64, i64* %11
%76 = call i32 @TimerIC4PrescalerSet(i64 %74, i64 %75)
br label %77
77: ; preds = %68, %59
br label %78
78: ; preds = %77, %47
br label %79
79: ; preds = %78, %35
ret void
}

LLVM IR (-O2):
define void @TimerICConfigure(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5) {
switch i64 %1, label %16 [
i64 1, label %7
i64 2, label %10
i64 3, label %13
]
7: ; preds = %6
%8 = tail call i32 @TimerTI1Configure(i64 %0, i64 %2, i64 %3, i64 %5)
%9 = tail call i32 @TimerIC1PrescalerSet(i64 %0, i64 %4)
br label %19
10: ; preds = %6
%11 = tail call i32 @TimerTI2Configure(i64 %0, i64 %2, i64 %3, i64 %5)
%12 = tail call i32 @TimerIC2PrescalerSet(i64 %0, i64 %4)
br label %19
13: ; preds = %6
%14 = tail call i32 @TimerTI3Configure(i64 %0, i64 %2, i64 %3, i64 %5)
%15 = tail call i32 @TimerIC3PrescalerSet(i64 %0, i64 %4)
br label %19
16: ; preds = %6
%17 = tail call i32 @TimerTI4Configure(i64 %0, i64 %2, i64 %3, i64 %5)
%18 = tail call i32 @TimerIC4PrescalerSet(i64 %0, i64 %4)
br label %19
19: ; preds = %10, %16, %13, %7
ret void
}