#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*/ TimerETRConfigure(unsigned long, unsigned long,
                                     unsigned long, unsigned long);
void TimerETRClockMode1Configure(unsigned long ulBase,
                                 unsigned long ulExtTRGPrescaler,
                                 unsigned long ulExtTRGPloarity,
                                 unsigned long ulExtTRGFilter) {
  unsigned long ulTempsmcr = 0;

  ;

  ;

  ;
  ;
  TimerETRConfigure(ulBase, ulExtTRGPrescaler, ulExtTRGPloarity,
                    ulExtTRGFilter);
  ulTempsmcr = (*((volatile unsigned long *)(ulBase + 0x00000008)));
  ulTempsmcr &= ~0x00000007;
  ulTempsmcr |= 0x00000007;
  ulTempsmcr &= ~0x00000070;
  ulTempsmcr |= 0x00000070;
  (*((volatile unsigned long *)(ulBase + 0x00000008))) = ulTempsmcr;
}


x86 assembly (clang, -O0):
<TimerETRClockMode1Configure>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <TimerETRConfigure@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
and    $0xfffffffffffffff8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
or     $0x7,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
and    $0xffffffffffffff8f,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
or     $0x70,%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,0x8(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerETRClockMode1Configure>:
push   %rbx
mov    %rdi,%rbx
call   1030 <TimerETRConfigure@plt>
orq    $0x77,0x8(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @TimerETRClockMode1Configure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i64 %3, i64* %8
store i64 0, i64* %9
%10 = load i64, i64* %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i64, i64* %8
%14 = call i32 @TimerETRConfigure(i64 %10, i64 %11, i64 %12, i64 %13)
%15 = load i64, i64* %5
%16 = add i64 %15, 8
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
store i64 %18, i64* %9
%19 = load i64, i64* %9
%20 = and i64 %19, -8
store i64 %20, i64* %9
%21 = load i64, i64* %9
%22 = or i64 %21, 7
store i64 %22, i64* %9
%23 = load i64, i64* %9
%24 = and i64 %23, -113
store i64 %24, i64* %9
%25 = load i64, i64* %9
%26 = or i64 %25, 112
store i64 %26, i64* %9
%27 = load i64, i64* %9
%28 = load i64, i64* %5
%29 = add i64 %28, 8
%30 = inttoptr i64 %29 to i64*
store volatile i64 %27, i64* %30
ret void
}

LLVM IR (-O2):
define void @TimerETRClockMode1Configure(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = tail call i32 @TimerETRConfigure(i64 %0, i64 %1, i64 %2, i64 %3)
%6 = add i64 %0, 8
%7 = inttoptr i64 %6 to i64*
%8 = load volatile i64, i64* %7
%9 = or i64 %8, 119
store volatile i64 %9, i64* %7
ret void
}