#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 */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ ASSERT(int);
void EMACTimestampConfigSet(uint32_t ui32Base, uint32_t ui32Config,
                            uint32_t ui32SubSecondInc) {
  ASSERT(ui32Base == 0x400EC000);
  (*((volatile uint32_t *)(ui32Base + 0x00000FC8))) |= 0x00040000;
  (*((volatile uint32_t *)(ui32Base + 0x00000704))) =
      ((ui32SubSecondInc << 0) & 0x000000FF);
  (*((volatile uint32_t *)(ui32Base + 0x00000700))) = ui32Config;
}


x86 assembly (clang, -O0):
<EMACTimestampConfigSet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x400ec000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <ASSERT@plt>
mov    -0x4(%rbp),%eax
add    $0xfc8,%eax
cltq
mov    (%rax),%ecx
or     $0x40000,%ecx
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x0,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%eax
add    $0x704,%eax
cltq
mov    %ecx,(%rax)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampConfigSet>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x400ec000,%ebp
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebp,%rax
orl    $0x40000,0xfc8(%rax)
movzbl %bl,%ecx
mov    %ecx,0x704(%rax)
mov    %r14d,0x700(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @EMACTimestampConfigSet(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1074708480
%9 = zext i1 %8 to i32
%10 = call i32 @ASSERT(i32 %9)
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 4040
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = or i32 %15, 262144
store volatile i32 %16, i32* %14
%17 = load i32, i32* %6
%18 = shl i32 %17, 0
%19 = and i32 %18, 255
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1796
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i32*
store volatile i32 %19, i32* %23
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1792
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store volatile i32 %24, i32* %28
ret void
}

LLVM IR (-O2):
define void @EMACTimestampConfigSet(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 1074708480
%5 = zext i1 %4 to i32
%6 = tail call i32 @ASSERT(i32 %5)
%7 = add nsw i32 %0, 4040
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = or i32 %10, 262144
store volatile i32 %11, i32* %9
%12 = and i32 %2, 255
%13 = add nsw i32 %0, 1796
%14 = sext i32 %13 to i64
%15 = inttoptr i64 %14 to i32*
store volatile i32 %12, i32* %15
%16 = add nsw i32 %0, 1792
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
store volatile i32 %1, i32* %18
ret void
}