#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 */
void EMACTimestampSysTimeSet(uint32_t ui32Base, uint32_t ui32Seconds,
                             uint32_t ui32SubSeconds) {
  ;
  (*((volatile uint32_t *)(ui32Base + 0x00000710))) = ui32Seconds;
  (*((volatile uint32_t *)(ui32Base + 0x00000714))) = ui32SubSeconds;
  while ((*((volatile uint32_t *)(ui32Base + 0x00000700))) & 0x00000004) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000700))) |= 0x00000004;
}


x86 assembly (clang, -O0):
<EMACTimestampSysTimeSet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x710,%eax
cltq
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x714,%eax
cltq
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    (%rax),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1148 <EMACTimestampSysTimeSet+0x48>
jmp    112b <EMACTimestampSysTimeSet+0x2b>
mov    -0x4(%rbp),%eax
add    $0x700,%eax
cltq
mov    (%rax),%ecx
or     $0x4,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampSysTimeSet>:
movslq %edi,%rax
mov    %esi,0x710(%rax)
mov    %edx,0x714(%rax)
nop
testl  $0x4,0x700(%rax)
jne    1110 <EMACTimestampSysTimeSet+0x10>
orl    $0x4,0x700(%rax)
ret

LLVM IR (-O0):
define void @EMACTimestampSysTimeSet(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* %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 1808
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
store volatile i32 %7, i32* %11
%12 = load i32, i32* %6
%13 = load i32, i32* %4
%14 = add nsw i32 %13, 1812
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %12, i32* %16
br label %17
17: ; preds = %25, %3
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1792
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i32*
%22 = load volatile i32, i32* %21
%23 = and i32 %22, 4
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %17
br label %17
26: ; preds = %17
%27 = load i32, i32* %4
%28 = add nsw i32 %27, 1792
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i32*
%31 = load volatile i32, i32* %30
%32 = or i32 %31, 4
store volatile i32 %32, i32* %30
ret void
}

LLVM IR (-O2):
define void @EMACTimestampSysTimeSet(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %0, 1808
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i32*
store volatile i32 %1, i32* %6
%7 = add nsw i32 %0, 1812
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
store volatile i32 %2, i32* %9
%10 = add nsw i32 %0, 1792
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i32*
br label %13
13: ; preds = %13, %3
%14 = load volatile i32, i32* %12
%15 = and i32 %14, 4
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %13
17: ; preds = %13
%18 = load volatile i32, i32* %12
%19 = or i32 %18, 4
store volatile i32 %19, i32* %12
ret void
}