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

/* Variables and functions */
int /*<<< orphan*/ exit(int);
scalar_t__ mktime(struct tm *);
int /*<<< orphan*/ setenv(char *, char *, int);
void spring_forward_gap(void) {
  struct tm tm;
  setenv("TZ", "PST8PDT,M4.1.0,M10.5.0", 1);
  tm.tm_year = 98;
  tm.tm_mon = 3;
  tm.tm_mday = 5;
  tm.tm_hour = 2;
  tm.tm_min = 0;
  tm.tm_sec = 0;
  tm.tm_isdst = -1;
  if (mktime(&tm) == (time_t)-1)
    exit(1);
}


x86 assembly (clang, -O0):
<spring_forward_gap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xec1(%rip),%rdi
lea    0xebd(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
movl   $0x62,-0x28(%rbp)
movl   $0x3,-0x24(%rbp)
movl   $0x5,-0x20(%rbp)
movl   $0x2,-0x1c(%rbp)
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
lea    -0x28(%rbp),%rdi
call   1040 <mktime@plt>
cmp    $0xffffffffffffffff,%rax
jne    11a0 <spring_forward_gap+0x70>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<spring_forward_gap>:
sub    $0x28,%rsp
lea    0xed5(%rip),%rdi
lea    0xed1(%rip),%rsi
mov    $0x1,%edx
call   1030 <setenv@plt>
movaps 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x18(%rsp)
movl   $0xffffffff,0x10(%rsp)
ff
mov    %rsp,%rdi
call   1040 <mktime@plt>
cmp    $0xffffffffffffffff,%rax
je     117a <spring_forward_gap+0x4a>
add    $0x28,%rsp
ret
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, i32, i32, i64, i64 }
@.str = [3 x i8] c"TZ\00"
@.str.1 = [23 x i8] c"PST8PDT,M4.1.0,M10.5.0\00"
define void @spring_forward_gap() {
%1 = alloca %struct.tm
%2 = call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 1)
%3 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 0
store i32 98, i32* %3
%4 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 1
store i32 3, i32* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 2
store i32 5, i32* %5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 3
store i32 2, i32* %6
%7 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 6
store i64 0, i64* %7
%8 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 5
store i64 0, i64* %8
%9 = getelementptr inbounds %struct.tm, %struct.tm* %1, i32 0, i32 4
store i32 -1, i32* %9
%10 = call i64 @mktime(%struct.tm* %1)
%11 = icmp eq i64 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %0
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, i32, i32, i64, i64 }
@.str = [3 x i8] c"TZ\00"
@.str.1 = [23 x i8] c"PST8PDT,M4.1.0,M10.5.0\00"
define void @spring_forward_gap() {
%1 = alloca %struct.tm
%2 = bitcast %struct.tm* %1 to i8*
%3 = tail call i32 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 1)
%4 = bitcast %struct.tm* %1 to <4 x i32>*
store <4 x i32> <i32 98, i32 3, i32 5, i32 2>, <4 x i32>* %4
%5 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 5
%6 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 4
%7 = bitcast i64* %5 to i8*
store i32 -1, i32* %6
%8 = call i64 @mktime(%struct.tm* %1)
%9 = icmp eq i64 %8, -1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = tail call i32 @exit(i32 1)
unreachable
12: ; preds = %0
ret void
}