#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 EMACTimestampTargetSet(uint32_t ui32Base, uint32_t ui32Seconds,
                            uint32_t ui32SubSeconds) {
  ASSERT(ui32Base == 0x400EC000);
  while ((*((volatile uint32_t *)(ui32Base + 0x00000720))) & 0x80000000) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x0000071C))) = ui32Seconds;
  (*((volatile uint32_t *)(ui32Base + 0x00000720))) = ui32SubSeconds;
}


x86 assembly (clang, -O0):
<EMACTimestampTargetSet>:
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    $0x720,%eax
cltq
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1154 <EMACTimestampTargetSet+0x44>
jmp    1135 <EMACTimestampTargetSet+0x25>
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x71c,%eax
cltq
mov    %ecx,(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
add    $0x720,%eax
cltq
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EMACTimestampTargetSet>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x400ec000,%ebx
sete   %dil
call   1030 <ASSERT@plt>
movslq %ebx,%rax
nop
cmpl   $0x0,0x720(%rax)
js     1130 <EMACTimestampTargetSet+0x20>
mov    %ebp,0x71c(%rax)
mov    %r14d,0x720(%rax)
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define void @EMACTimestampTargetSet(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, 1824
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
br label %10
10: ; preds = %10, %3
%11 = load volatile i32, i32* %9
%12 = icmp sgt i32 %11, -1
br i1 %12, label %13, label %10
13: ; preds = %10
%14 = add nsw i32 %0, 1820
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 %1, i32* %16
store volatile i32 %2, i32* %9
ret void
}