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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int mktime(struct tm *);
int main(int argc, char **argv) {
  struct tm ts;
  ts.tm_sec = 0;
  ts.tm_min = 0;
  ts.tm_hour = 0;
  ts.tm_mday = 1;
  ts.tm_mon = 0;
  ts.tm_year = 0;
  ts.tm_isdst = -1;
  {
    time_t t = mktime(&ts);
    if (t == -1)
      exit(1);
    else
      exit(0);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x1,-0x40(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0xffffffff,-0x3c(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <mktime@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0xffffffff,-0x44(%rbp)
jne    118c <main+0x6c>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
xorps  %xmm0,%xmm0
movups %xmm0,0x20(%rsp)
movq   $0x0,0x30(%rsp)
movabs $0xffffffff00000001,%rax
ff ff ff
mov    %rax,0x8(%rsp)
movups %xmm0,0x10(%rsp)
lea    0x8(%rsp),%rdi
call   1030 <mktime@plt>
cmp    $0xffffffff,%eax
jne    1162 <main+0x42>
mov    $0x1,%edi
call   1040 <exit@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i64, i64, i64, i64, i64 }
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.tm
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 6
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 5
store i64 0, i64* %9
%10 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 4
store i64 0, i64* %10
%11 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 0
store i32 1, i32* %11
%12 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 3
store i64 0, i64* %12
%13 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 2
store i64 0, i64* %13
%14 = getelementptr inbounds %struct.tm, %struct.tm* %6, i32 0, i32 1
store i32 -1, i32* %14
%15 = call i32 @mktime(%struct.tm* %6)
store i32 %15, i32* %7
%16 = load i32, i32* %7
%17 = icmp eq i32 %16, -1
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
%21 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i64, i64, i64, i64, i64 }
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.tm
%4 = bitcast %struct.tm* %3 to i8*
%5 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 4
%6 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 0
%7 = bitcast i64* %5 to i8*
store i32 1, i32* %6
%8 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 2
%9 = getelementptr inbounds %struct.tm, %struct.tm* %3, i64 0, i32 1
%10 = bitcast i64* %8 to i8*
store i32 -1, i32* %9
%11 = call i32 @mktime(%struct.tm* %3)
%12 = icmp eq i32 %11, -1
br i1 %12, label %13, label %15
13: ; preds = %2
%14 = tail call i32 @exit(i32 1)
unreachable
15: ; preds = %2
%16 = tail call i32 @exit(i32 0)
unreachable
}