#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 */

/* Variables and functions */
int daylight;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ timezone;
char **tzname;
int /*<<< orphan*/ tzset();
int _tzset(char const *progname) {
  printf("%s: Testing tzset()\n", progname);
  tzset();
  printf("STD: %s, DST %s\n", tzname[0], tzname[1]);
  printf("daylight: %d, timezone %ld\n", daylight, timezone);
  return 0;
}


x86 assembly (clang, -O0):
<_tzset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <tzset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    0x2e7f(%rip),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rdx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e53(%rip),%rax
mov    (%rax),%esi
mov    0x2e62(%rip),%rax
mov    (%rax),%edx
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_tzset>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <tzset@plt>
mov    0x2e98(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    0x8(%rax),%rdx
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%esi
mov    0x2e78(%rip),%rax
mov    (%rax),%edx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s: Testing tzset()\0A\00"
@.str.1 = [17 x i8] c"STD: %s, DST %s\0A\00"
@tzname = global i8** null
@.str.2 = [28 x i8] c"daylight: %d, timezone %ld\0A\00"
@daylight = global i32 0
@timezone = global i32 0
define i32 @_tzset(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @tzset()
%6 = load i8**, i8*** @tzname
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = load i8**, i8*** @tzname
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %8, i8* %11)
%13 = load i32, i32* @daylight
%14 = load i32, i32* @timezone
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %13, i32 %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s: Testing tzset()\0A\00"
@.str.1 = [17 x i8] c"STD: %s, DST %s\0A\00"
@tzname = global i8** null
@.str.2 = [28 x i8] c"daylight: %d, timezone %ld\0A\00"
@daylight = global i32 0
@timezone = global i32 0
define i32 @_tzset(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 (...) @tzset()
%4 = load i8**, i8*** @tzname
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8*, i8** %4, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %7)
%9 = load i32, i32* @daylight
%10 = load i32, i32* @timezone
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
}