#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 scalar_t__ volatile uint32_t;

/* Variables and functions */
void EMACTimestampSysTimeGet(uint32_t ui32Base, uint32_t *pui32Seconds,
                             uint32_t *pui32SubSeconds) {
  ;
  ;
  ;
  do {
    *pui32Seconds = (*((volatile uint32_t *)(ui32Base + 0x00000708)));
    *pui32SubSeconds = (*((volatile uint32_t *)(ui32Base + 0x0000070C)));
  } while (*pui32SubSeconds >
           (*((volatile uint32_t *)(ui32Base + 0x0000070C))));
}


x86 assembly (clang, -O0):
<EMACTimestampSysTimeGet>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    0x708(%rax),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x70c(%rax),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x70c(%rcx),%rcx
cmp    %rcx,%rax
jg     1110 <EMACTimestampSysTimeGet+0x10>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampSysTimeGet>:
mov    %rdi,-0x8(%rsp)
cs nopw 0x0(%rax,%rax,1)
nop
mov    -0x8(%rsp),%rax
mov    0x708(%rax),%rax
mov    %rax,(%rsi)
mov    -0x8(%rsp),%rax
mov    0x70c(%rax),%rax
mov    %rax,(%rdx)
mov    (%rdx),%rax
mov    -0x8(%rsp),%rcx
cmp    0x70c(%rcx),%rax
jg     1110 <EMACTimestampSysTimeGet+0x10>
ret

LLVM IR (-O0):
define void @EMACTimestampSysTimeGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64*
store volatile i64 %0, i64* %4
store i64* %1, i64** %5
store i64* %2, i64** %6
br label %7
7: ; preds = %18, %3
%8 = load volatile i64, i64* %4
%9 = add nsw i64 %8, 1800
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = load i64*, i64** %5
store volatile i64 %11, i64* %12
%13 = load volatile i64, i64* %4
%14 = add nsw i64 %13, 1804
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = load i64*, i64** %6
store volatile i64 %16, i64* %17
br label %18
18: ; preds = %7
%19 = load i64*, i64** %6
%20 = load volatile i64, i64* %19
%21 = load volatile i64, i64* %4
%22 = add nsw i64 %21, 1804
%23 = inttoptr i64 %22 to i64*
%24 = load volatile i64, i64* %23
%25 = icmp sgt i64 %20, %24
br i1 %25, label %7, label %26
26: ; preds = %18
ret void
}

LLVM IR (-O2):
define void @EMACTimestampSysTimeGet(i64 %0, i64* %1, i64* %2) {
%4 = alloca i64
store volatile i64 %0, i64* %4
br label %5
5: ; preds = %5, %3
%6 = load volatile i64, i64* %4
%7 = add nsw i64 %6, 1800
%8 = inttoptr i64 %7 to i64*
%9 = load volatile i64, i64* %8
store volatile i64 %9, i64* %1
%10 = load volatile i64, i64* %4
%11 = add nsw i64 %10, 1804
%12 = inttoptr i64 %11 to i64*
%13 = load volatile i64, i64* %12
store volatile i64 %13, i64* %2
%14 = load volatile i64, i64* %2
%15 = load volatile i64, i64* %4
%16 = add nsw i64 %15, 1804
%17 = inttoptr i64 %16 to i64*
%18 = load volatile i64, i64* %17
%19 = icmp sgt i64 %14, %18
br i1 %19, label %5, label %20
20: ; preds = %5
ret void
}