#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;
struct tm {
  scalar_t__ tm_year;
  int /*<<< orphan*/ tm_mon;
  int /*<<< orphan*/ tm_mday;
  int /*<<< orphan*/ tm_sec;
  int /*<<< orphan*/ tm_min;
  int /*<<< orphan*/ tm_hour;
};

/* Variables and functions */
int /*<<< orphan*/ LONG_MAX;
struct tm *gmtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ mktime(struct tm *);
time_t read_fake_timer_utc(time_t curTime) {
  struct tm tsWake;
  struct tm *ts;
  time_t wakeupTime = LONG_MAX;
  ts = gmtime(&curTime);
  tsWake.tm_hour = ts->tm_hour;
  tsWake.tm_min = ts->tm_min;
  tsWake.tm_sec = ts->tm_sec;
  tsWake.tm_mday = ts->tm_mday;
  tsWake.tm_mon = ts->tm_mon;
  tsWake.tm_year = ts->tm_year + 1;
  wakeupTime = mktime(&tsWake);
  return wakeupTime;
}


x86 assembly (clang, -O0):
<read_fake_timer_utc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
lea    -0x4(%rbp),%rdi
call   1040 <gmtime@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x30(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x30(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x30(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x30(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
lea    -0x28(%rbp),%rdi
call   1030 <mktime@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_fake_timer_utc>:
sub    $0x28,%rsp
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <gmtime@plt>
mov    0x18(%rax),%ecx
mov    %ecx,0x20(%rsp)
movups 0x8(%rax),%xmm0
movups %xmm0,0x10(%rsp)
mov    (%rax),%rax
add    $0x1,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <mktime@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.tm = type { i64, i32, i32, i32, i32, i32 }
@LONG_MAX = global i32 0
define i32 @read_fake_timer_utc(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
%4 = alloca %struct.tm*
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* @LONG_MAX
store i32 %6, i32* %5
%7 = call %struct.tm* @gmtime(i32* %2)
store %struct.tm* %7, %struct.tm** %4
%8 = load %struct.tm*, %struct.tm** %4
%9 = getelementptr inbounds %struct.tm, %struct.tm* %8, i32 0, i32 5
%10 = load i32, i32* %9
%11 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 5
store i32 %10, i32* %11
%12 = load %struct.tm*, %struct.tm** %4
%13 = getelementptr inbounds %struct.tm, %struct.tm* %12, i32 0, i32 4
%14 = load i32, i32* %13
%15 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 4
store i32 %14, i32* %15
%16 = load %struct.tm*, %struct.tm** %4
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 3
%18 = load i32, i32* %17
%19 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 3
store i32 %18, i32* %19
%20 = load %struct.tm*, %struct.tm** %4
%21 = getelementptr inbounds %struct.tm, %struct.tm* %20, i32 0, i32 2
%22 = load i32, i32* %21
%23 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 2
store i32 %22, i32* %23
%24 = load %struct.tm*, %struct.tm** %4
%25 = getelementptr inbounds %struct.tm, %struct.tm* %24, i32 0, i32 1
%26 = load i32, i32* %25
%27 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 1
store i32 %26, i32* %27
%28 = load %struct.tm*, %struct.tm** %4
%29 = getelementptr inbounds %struct.tm, %struct.tm* %28, i32 0, i32 0
%30 = load i64, i64* %29
%31 = add nsw i64 %30, 1
%32 = getelementptr inbounds %struct.tm, %struct.tm* %3, i32 0, i32 0
store i64 %31, i64* %32
%33 = call i32 @mktime(%struct.tm* %3)
store i32 %33, i32* %5
%34 = load i32, i32* %5
ret i32 %34
}

LLVM IR (-O2):
%struct.tm = type { i64, i32, i32, i32, i32, i32 }
@LONG_MAX = global i32 0
define i32 @read_fake_timer_utc(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.tm
store i32 %0, i32* %2
%4 = bitcast %struct.tm* %3 to i8*
%5 = call %struct.tm* @gmtime(i32* %2)
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 5
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 5
store i32 %7, i32* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 1
%10 = bitcast i32* %9 to <4 x i32>*
%11 = load <4 x i32>, <4 x i32>* %10
%12 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %11, <4 x i32>* %13
%14 = getelementptr inbounds %struct.tm, %struct.tm* %5, i64 0, i32 0
%15 = load i64, i64* %14
%16 = add nsw i64 %15, 1
%17 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
store i64 %16, i64* %17
%18 = call i32 @mktime(%struct.tm* %3)
ret i32 %18
}