#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 */
struct timeval {
  int tv_sec;
  int tv_usec;
};
typedef int int64_t;

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/);
int64_t getNTPtime() {
  struct timeval tv;
  int64_t ntpTime = 0;
  int64_t t00_t70 = 0x83AA7E80;
  if (gettimeofday(&tv, 0) == 0) {
    ntpTime = (tv.tv_sec + t00_t70) * 1000000 + tv.tv_usec;
    do {
    } while (0);
    do {
    } while (0);
  } else {
    do {
    } while (0);
  }
  return ntpTime;
}


x86 assembly (clang, -O0):
<getNTPtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
movl   $0x83aa7e80,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
jne    1161 <getNTPtime+0x51>
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
imul   $0xf4240,%eax,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1152 <getNTPtime+0x42>
jmp    1157 <getNTPtime+0x47>
jmp    115c <getNTPtime+0x4c>
jmp    1170 <getNTPtime+0x60>
jmp    1166 <getNTPtime+0x56>
jmp    116b <getNTPtime+0x5b>
jmp    1170 <getNTPtime+0x60>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getNTPtime>:
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rdi
xor    %ebx,%ebx
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
jne    113d <getNTPtime+0x2d>
imul   $0xf4240,0x8(%rsp),%eax
mov    0xc(%rsp),%ecx
lea    (%rax,%rcx,1),%ebx
add    $0x48bca000,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getNTPtime() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %2
store i32 -2085978496, i32* %3
%4 = call i64 @gettimeofday(%struct.timeval* %1, i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %19
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%8 = load i32, i32* %7
%9 = load i32, i32* %3
%10 = add nsw i32 %8, %9
%11 = mul nsw i32 %10, 1000000
%12 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%13 = load i32, i32* %12
%14 = add nsw i32 %11, %13
store i32 %14, i32* %2
br label %15
15: ; preds = %6
br label %16
16: ; preds = %15
br label %17
17: ; preds = %16
br label %18
18: ; preds = %17
br label %22
19: ; preds = %0
br label %20
20: ; preds = %19
br label %21
21: ; preds = %20
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getNTPtime() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i32, i32* %6
%8 = mul i32 %7, 1000000
%9 = add i32 %8, 1220321280
%10 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%11 = load i32, i32* %10
%12 = add nsw i32 %9, %11
br label %13
13: ; preds = %0, %5
%14 = phi i32 [ %12, %5 ], [ 0, %0 ]
ret i32 %14
}