#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 {
  int tm_year;
  int tm_isdst;
};

/* Variables and functions */
int /*<<< orphan*/ gmtime_r(int /*<<< orphan*/ *, struct tm *);
int /*<<< orphan*/ mktime(struct tm *);
void Time_to_UTC(struct tm *cdate, struct tm *odate) {
  time_t tdate;
  cdate->tm_year -= 1900;
  cdate->tm_isdst = -1;
  tdate = mktime(cdate);
  gmtime_r(&tdate, odate);
  odate->tm_year += 1900;
}


x86 assembly (clang, -O0):
<Time_to_UTC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
sub    $0x76c,%ecx
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movl   $0xffffffff,0x4(%rax)
mov    -0x8(%rbp),%rdi
call   1040 <mktime@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
call   1030 <gmtime_r@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x76c,%ecx
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Time_to_UTC>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
addl   $0xfffff894,(%rdi)
movl   $0xffffffff,0x4(%rdi)
call   1040 <mktime@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
call   1030 <gmtime_r@plt>
addl   $0x76c,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32 }
define void @Time_to_UTC(%struct.tm* %0, %struct.tm* %1) {
%3 = alloca %struct.tm*
%4 = alloca %struct.tm*
%5 = alloca i32
store %struct.tm* %0, %struct.tm** %3
store %struct.tm* %1, %struct.tm** %4
%6 = load %struct.tm*, %struct.tm** %3
%7 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
%8 = load i32, i32* %7
%9 = sub nsw i32 %8, 1900
store i32 %9, i32* %7
%10 = load %struct.tm*, %struct.tm** %3
%11 = getelementptr inbounds %struct.tm, %struct.tm* %10, i32 0, i32 1
store i32 -1, i32* %11
%12 = load %struct.tm*, %struct.tm** %3
%13 = call i32 @mktime(%struct.tm* %12)
store i32 %13, i32* %5
%14 = load %struct.tm*, %struct.tm** %4
%15 = call i32 @gmtime_r(i32* %5, %struct.tm* %14)
%16 = load %struct.tm*, %struct.tm** %4
%17 = getelementptr inbounds %struct.tm, %struct.tm* %16, i32 0, i32 0
%18 = load i32, i32* %17
%19 = add nsw i32 %18, 1900
store i32 %19, i32* %17
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32 }
define void @Time_to_UTC(%struct.tm* nocapture %0, %struct.tm* %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, -1900
store i32 %7, i32* %5
%8 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
store i32 -1, i32* %8
%9 = tail call i32 @mktime(%struct.tm* %0)
store i32 %9, i32* %3
%10 = call i32 @gmtime_r(i32* %3, %struct.tm* %1)
%11 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%12 = load i32, i32* %11
%13 = add nsw i32 %12, 1900
store i32 %13, i32* %11
ret void
}