#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 /*<<< orphan*/ printf(char *, ...);
char **tzname;
int /*<<< orphan*/ tzset();
int main(void) {
  printf("without tzset()\n");
  printf("tzname: [%s][%s]\n", tzname[0], tzname[1]);
  tzset();
  printf("with tzset()\n");
  printf("tzname: [%s][%s]\n", tzname[0], tzname[1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rdx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <tzset@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    0x2e51(%rip),%rax
mov    (%rax),%rax
mov    0x8(%rax),%rdx
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed7(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e99(%rip),%r14
mov    (%r14),%rax
mov    (%rax),%rsi
mov    0x8(%rax),%rdx
lea    0xea8(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <tzset@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%rax
mov    (%rax),%rsi
mov    0x8(%rax),%rdx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"without tzset()\0A\00"
@.str.1 = [18 x i8] c"tzname: [%s][%s]\0A\00"
@tzname = global i8** null
@.str.2 = [14 x i8] c"with tzset()\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%3 = load i8**, i8*** @tzname
%4 = getelementptr inbounds i8*, i8** %3, i64 0
%5 = load i8*, i8** %4
%6 = load i8**, i8*** @tzname
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5, i8* %8)
%10 = call i32 (...) @tzset()
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%12 = load i8**, i8*** @tzname
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = load i8**, i8*** @tzname
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %17)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [18 x i8] c"tzname: [%s][%s]\0A\00"
@tzname = global i8** null
@str = [16 x i8] c"without tzset()\00"
@str.3 = [13 x i8] c"with tzset()\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = load i8**, i8*** @tzname
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8*, i8** %2, i64 1
%5 = load i8*, i8** %4
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %5)
%7 = tail call i32 (...) @tzset()
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.3, i64 0, i64 0))
%9 = load i8**, i8*** @tzname
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %9, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %10, i8* %12)
ret i32 0
}