#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 stat {
  int dummy;
};

/* Variables and functions */
long long *dynamic_configuration_get_last_change();
int /*<<< orphan*/ dynamic_configuration_get_path();
long long millisecond(struct stat *);
long long millisecond_clock();
scalar_t__ stat(int /*<<< orphan*/, struct stat *);
int dynamic_configuration_changed() {
  long long *last_change = dynamic_configuration_get_last_change();
  long long new_change;
  struct stat stats;
  if (*last_change == 0)
    *last_change = millisecond_clock();
  if (stat(dynamic_configuration_get_path(), &stats) != 0)
    return 0;
  new_change = millisecond(&stats);
  if (new_change <= *last_change)
    return 0;
  *last_change = new_change;
  return 1;
}


x86 assembly (clang, -O0):
<dynamic_configuration_changed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x0,%al
call   1050 <dynamic_configuration_get_last_change@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1182 <dynamic_configuration_changed+0x32>
mov    $0x0,%al
call   1070 <millisecond_clock@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1030 <dynamic_configuration_get_path@plt>
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
call   1060 <stat@plt>
cmp    $0x0,%rax
je     11aa <dynamic_configuration_changed+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    11e6 <dynamic_configuration_changed+0x96>
lea    -0x20(%rbp),%rdi
call   1040 <millisecond@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%rax
jg     11d4 <dynamic_configuration_changed+0x84>
movl   $0x0,-0x4(%rbp)
jmp    11e6 <dynamic_configuration_changed+0x96>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamic_configuration_changed>:
push   %rbp
push   %rbx
push   %rax
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <dynamic_configuration_get_last_change@plt>
mov    %rax,%rbx
cmpq   $0x0,(%rax)
jne    116f <dynamic_configuration_changed+0x1f>
xor    %eax,%eax
call   1070 <millisecond_clock@plt>
mov    %rax,(%rbx)
xor    %eax,%eax
call   1030 <dynamic_configuration_get_path@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1060 <stat@plt>
test   %rax,%rax
jne    119a <dynamic_configuration_changed+0x4a>
mov    %rsp,%rdi
call   1040 <millisecond@plt>
cmp    (%rbx),%rax
jle    119a <dynamic_configuration_changed+0x4a>
mov    %rax,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @dynamic_configuration_changed() {
%1 = alloca i32
%2 = alloca i64*
%3 = alloca i64
%4 = alloca %struct.stat
%5 = call i64* (...) @dynamic_configuration_get_last_change()
store i64* %5, i64** %2
%6 = load i64*, i64** %2
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = call i64 (...) @millisecond_clock()
%11 = load i64*, i64** %2
store i64 %10, i64* %11
br label %12
12: ; preds = %9, %0
%13 = call i32 (...) @dynamic_configuration_get_path()
%14 = call i64 @stat(i32 %13, %struct.stat* %4)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 0, i32* %1
br label %27
17: ; preds = %12
%18 = call i64 @millisecond(%struct.stat* %4)
store i64 %18, i64* %3
%19 = load i64, i64* %3
%20 = load i64*, i64** %2
%21 = load i64, i64* %20
%22 = icmp sle i64 %19, %21
br i1 %22, label %23, label %24
23: ; preds = %17
store i32 0, i32* %1
br label %27
24: ; preds = %17
%25 = load i64, i64* %3
%26 = load i64*, i64** %2
store i64 %25, i64* %26
store i32 1, i32* %1
br label %27
27: ; preds = %24, %23, %16
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @dynamic_configuration_changed() {
%1 = alloca %struct.stat
%2 = tail call i64* (...) @dynamic_configuration_get_last_change()
%3 = bitcast %struct.stat* %1 to i8*
%4 = load i64, i64* %2
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i64 (...) @millisecond_clock()
store i64 %7, i64* %2
br label %8
8: ; preds = %6, %0
%9 = tail call i32 (...) @dynamic_configuration_get_path()
%10 = call i64 @stat(i32 %9, %struct.stat* %1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = call i64 @millisecond(%struct.stat* %1)
%14 = load i64, i64* %2
%15 = icmp sgt i64 %13, %14
br i1 %15, label %16, label %17
16: ; preds = %12
store i64 %13, i64* %2
br label %17
17: ; preds = %12, %8, %16
%18 = phi i32 [ 1, %16 ], [ 0, %8 ], [ 0, %12 ]
ret i32 %18
}