#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 /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ display(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int i = 1;
  time_t newTime, oldTime = time(NULL);
  double timeDiff = 0;
  while (i) {
    newTime = time(NULL);
    timeDiff = difftime(newTime, oldTime);
    if (timeDiff >= 1) {
      display(newTime);
    }
    oldTime = newTime;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     11aa <main+0x7a>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <difftime@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe73(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     119f <main+0x6f>
mov    -0xc(%rbp),%edi
call   1030 <display@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    115a <main+0x2a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
nopl   0x0(%rax)
mov    %ebx,%ebp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%ebx
mov    %eax,%edi
mov    %ebp,%esi
call   1040 <difftime@plt>
ucomisd 0xea4(%rip),%xmm0
jb     1140 <main+0x10>
mov    %ebx,%edi
call   1030 <display@plt>
jmp    1140 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 0, i32* %1
store i32 1, i32* %2
%6 = call i32 @time(i32* null)
store i32 %6, i32* %4
store double 0.000000e+00, double* %5
br label %7
7: ; preds = %20, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = call i32 @time(i32* null)
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = call double @difftime(i32 %12, i32 %13)
store double %14, double* %5
%15 = load double, double* %5
%16 = fcmp oge double %15, 1.000000e+00
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i32, i32* %3
%19 = call i32 @display(i32 %18)
br label %20
20: ; preds = %17, %10
%21 = load i32, i32* %3
store i32 %21, i32* %4
br label %7
22: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
br label %2
2: ; preds = %9, %0
%3 = phi i32 [ %1, %0 ], [ %4, %9 ]
%4 = tail call i32 @time(i32* null)
%5 = tail call double @difftime(i32 %4, i32 %3)
%6 = fcmp ult double %5, 1.000000e+00
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @display(i32 %4)
br label %9
9: ; preds = %7, %2
br label %2
}