#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_mday;
  int tm_mon;
  int tm_year;
  scalar_t__ tm_isdst;
  scalar_t__ tm_yday;
  scalar_t__ tm_wday;
  scalar_t__ tm_hour;
  scalar_t__ tm_min;
  scalar_t__ tm_sec;
};

/* Variables and functions */
int /*<<< orphan*/ mktime(struct tm *);
time_t GetDay(int D, int M, int Y) {
  struct tm TM;
  TM.tm_sec = 0;
  TM.tm_min = 0;
  TM.tm_hour = 0;
  TM.tm_mday = D;
  TM.tm_mon = M;
  TM.tm_wday = 0;
  TM.tm_yday = 0;
  TM.tm_year = Y - 1900;
  TM.tm_isdst = 0;
  return mktime(&TM);
}


x86 assembly (clang, -O0):
<GetDay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x76c,%eax
mov    %eax,-0x48(%rbp)
movq   $0x0,-0x40(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <mktime@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetDay>:
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x30(%rsp)
movq   $0x0,0x40(%rsp)
mov    %edi,0x8(%rsp)
mov    %esi,0xc(%rsp)
add    $0xfffff894,%edx
movups %xmm0,0x20(%rsp)
mov    %edx,0x10(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <mktime@plt>
add    $0x48,%rsp
ret

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

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