#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*/ TimerInputTriggerSelect(unsigned long, unsigned long);
int /*<<< orphan*/ TimerTI1Configure(unsigned long, unsigned long, int,
                                     unsigned long);
int /*<<< orphan*/ TimerTI2Configure(unsigned long, unsigned long, int,
                                     unsigned long);
void TimerTIxExternalClockConfigure(unsigned long ulBase,
                                    unsigned long ulExtClkSource,
                                    unsigned long ulICPolarity,
                                    unsigned long ulICFilter) {

  ;

  ;

  ;
  ;
  if (ulExtClkSource == 0x00000060) {
    TimerTI2Configure(ulBase, ulICPolarity, 0x00000001, ulICFilter);
  } else {
    TimerTI1Configure(ulBase, ulICPolarity, 0x00000001, ulICFilter);
  }
  TimerInputTriggerSelect(ulBase, ulExtClkSource);
  (*((volatile unsigned long *)(ulBase + 0x00000008))) |= 0x00000007;
}


x86 assembly (clang, -O0):
<TimerTIxExternalClockConfigure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x60,-0x10(%rbp)
jne    116e <TimerTIxExternalClockConfigure+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1050 <TimerTI2Configure@plt>
jmp    1184 <TimerTIxExternalClockConfigure+0x54>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rcx
mov    $0x1,%edx
call   1030 <TimerTI1Configure@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <TimerInputTriggerSelect@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rcx
or     $0x7,%rcx
mov    %rcx,0x8(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerTIxExternalClockConfigure>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    $0x60,%rsi
jne    114f <TimerTIxExternalClockConfigure+0x1f>
mov    %rdx,%rsi
mov    $0x1,%edx
call   1050 <TimerTI2Configure@plt>
jmp    115c <TimerTIxExternalClockConfigure+0x2c>
mov    %rdx,%rsi
mov    $0x1,%edx
call   1030 <TimerTI1Configure@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <TimerInputTriggerSelect@plt>
orq    $0x7,0x8(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @TimerTIxExternalClockConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 96
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i64, i64* %5
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = call i32 @TimerTI2Configure(i64 %12, i64 %13, i32 1, i64 %14)
br label %21
16: ; preds = %4
%17 = load i64, i64* %5
%18 = load i64, i64* %7
%19 = load i64, i64* %8
%20 = call i32 @TimerTI1Configure(i64 %17, i64 %18, i32 1, i64 %19)
br label %21
21: ; preds = %16, %11
%22 = load i64, i64* %5
%23 = load i64, i64* %6
%24 = call i32 @TimerInputTriggerSelect(i64 %22, i64 %23)
%25 = load i64, i64* %5
%26 = add i64 %25, 8
%27 = inttoptr i64 %26 to i64*
%28 = load volatile i64, i64* %27
%29 = or i64 %28, 7
store volatile i64 %29, i64* %27
ret void
}

LLVM IR (-O2):
define void @TimerTIxExternalClockConfigure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %1, 96
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @TimerTI2Configure(i64 %0, i64 %2, i32 1, i64 %3)
br label %10
8: ; preds = %4
%9 = tail call i32 @TimerTI1Configure(i64 %0, i64 %2, i32 1, i64 %3)
br label %10
10: ; preds = %8, %6
%11 = tail call i32 @TimerInputTriggerSelect(i64 %0, i64 %1)
%12 = add i64 %0, 8
%13 = inttoptr i64 %12 to i64*
%14 = load volatile i64, i64* %13
%15 = or i64 %14, 7
store volatile i64 %15, i64* %13
ret void
}