#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*/ tz;
struct rlimit {
  long rlim_cur;
};

/* Variables and functions */
int /*<<< orphan*/ RLIMIT_AS;
long RLIM_INFINITY;
scalar_t__ getrlimit(int /*<<< orphan*/, struct rlimit *);
char *malloc(size_t);
int /*<<< orphan*/ memset(char *, char, size_t);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
scalar_t__ setenv(char *, char *, int);
scalar_t__ setrlimit(int /*<<< orphan*/, struct rlimit *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
scalar_t__ strcmp(int /*<<< orphan*/, char *);
int /*<<< orphan*/ test_tz_file(long long);
int /*<<< orphan*/ *tzname;
int /*<<< orphan*/ tzset();
int do_test(void) {
  {
    struct rlimit limit;
    if (getrlimit(RLIMIT_AS, &limit) != 0) {
      printf("getrlimit (RLIMIT_AS) failed: %m\n");
      return 1;
    }
    long target = 512 * 1024 * 1024;
    if (limit.rlim_cur == RLIM_INFINITY || limit.rlim_cur > target) {
      limit.rlim_cur = 512 * 1024 * 1024;
      if (setrlimit(RLIMIT_AS, &limit) != 0) {
        printf("setrlimit (RLIMIT_AS) failed: %m\n");
        return 1;
      }
    }
  }
  int errors = 0;
  for (int i = 1; i <= 4; ++i) {
    char tz[16];
    snprintf(tz, sizeof(tz), "XT%d", i);
    if (setenv("TZ", tz, 1) < 0) {
      printf("setenv failed: %m\n");
      return 1;
    }
    tzset();
    if (strcmp(tzname[0], tz) == 0) {
      printf("Unexpected success for %s\n", tz);
      ++errors;
    }
  }
  test_tz_file(64 * 1024 * 1024);
  test_tz_file(4LL * 1024 * 1024 * 1024 - 6);
  {
    size_t length = 64 * 1024 * 1024;
    char *value = malloc(length + 1);
    if (value == NULL) {
      puts("malloc failed: %m");
      return 1;
    }
    value[length] = '\0';
    memset(value, ' ', length);
    value[0] = 'U';
    value[1] = 'T';
    value[2] = 'C';
    if (setenv("TZ", value, 1) < 0) {
      printf("setenv failed: %m\n");
      return 1;
    }
    tzset();
    memset(value, '0', length);
    value[0] = '<';
    value[length - 1] = '>';
    if (setenv("TZ", value, 1) < 0) {
      printf("setenv failed: %m\n");
      return 1;
    }
    tzset();
  }
  return errors > 0;
}


x86 assembly (clang, -O0):
<do_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   10d0 <getrlimit@plt>
cmp    $0x0,%rax
je     11ee <do_test+0x3e>
lea    0xe25(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1455 <do_test+0x2a5>
movq   $0x20000000,-0x18(%rbp)
20
mov    -0x10(%rbp),%rax
mov    0x2dd7(%rip),%rcx
cmp    (%rcx),%rax
je     1218 <do_test+0x68>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    125b <do_test+0xab>
movq   $0x20000000,-0x10(%rbp)
20
mov    0x2db9(%rip),%rax
mov    (%rax),%edi
lea    -0x10(%rbp),%rsi
call   10c0 <setrlimit@plt>
cmp    $0x0,%rax
je     1256 <do_test+0xa6>
lea    0xddf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1455 <do_test+0x2a5>
jmp    125b <do_test+0xab>
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
cmpl   $0x4,-0x20(%rbp)
jg     1318 <do_test+0x168>
lea    -0x30(%rbp),%rdi
mov    -0x20(%rbp),%ecx
mov    $0x10,%esi
lea    0xdbe(%rip),%rdx
call   1060 <snprintf@plt>
lea    -0x30(%rbp),%rsi
lea    0xdb3(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
cmp    $0x0,%rax
jge    12c4 <do_test+0x114>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1455 <do_test+0x2a5>
mov    $0x0,%al
call   1090 <tzset@plt>
mov    0x2cfe(%rip),%rax
mov    (%rax),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rsi
call   1080 <strcmp@plt>
cmp    $0x0,%rax
jne    1305 <do_test+0x155>
lea    -0x30(%rbp),%rsi
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    130a <do_test+0x15a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1269 <do_test+0xb9>
mov    $0x4000000,%edi
call   10b0 <test_tz_file@plt>
mov    $0xfffffffa,%edi
call   10b0 <test_tz_file@plt>
movq   $0x4000000,-0x38(%rbp)
04
mov    -0x38(%rbp),%rdi
add    $0x1,%rdi
call   10a0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1368 <do_test+0x1b8>
lea    0xd23(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1455 <do_test+0x2a5>
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x20,%esi
call   1070 <memset@plt>
mov    -0x40(%rbp),%rax
movb   $0x55,(%rax)
mov    -0x40(%rbp),%rax
movb   $0x54,0x1(%rax)
mov    -0x40(%rbp),%rax
movb   $0x43,0x2(%rax)
mov    -0x40(%rbp),%rsi
lea    0xca1(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
cmp    $0x0,%rax
jge    13d6 <do_test+0x226>
lea    0xc89(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1455 <do_test+0x2a5>
mov    $0x0,%al
call   1090 <tzset@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x30,%esi
call   1070 <memset@plt>
mov    -0x40(%rbp),%rax
movb   $0x3c,(%rax)
mov    -0x40(%rbp),%rax
mov    -0x38(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x3e,(%rax,%rcx,1)
mov    -0x40(%rbp),%rsi
lea    0xc38(%rip),%rdi
mov    $0x1,%edx
call   1040 <setenv@plt>
cmp    $0x0,%rax
jge    143f <do_test+0x28f>
lea    0xc20(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1455 <do_test+0x2a5>
mov    $0x0,%al
call   1090 <tzset@plt>
cmpl   $0x0,-0x1c(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_test>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    0x2e1f(%rip),%rbx
mov    (%rbx),%edi
mov    %rsp,%rsi
call   10d0 <getrlimit@plt>
test   %rax,%rax
je     11e8 <do_test+0x38>
lea    0xe29(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebp
jmp    149c <do_test+0x2ec>
mov    (%rsp),%rax
cmp    $0x20000000,%rax
jg     1200 <do_test+0x50>
mov    0x2ddd(%rip),%rcx
cmp    (%rcx),%rax
jne    1220 <do_test+0x70>
movq   $0x20000000,(%rsp)
20
mov    (%rbx),%edi
mov    %rsp,%rsi
call   10c0 <setrlimit@plt>
test   %rax,%rax
je     1220 <do_test+0x70>
lea    0xe04(%rip),%rdi
jmp    11d7 <do_test+0x27>
lea    0xe1d(%rip),%rdx
mov    %rsp,%rbx
mov    $0x1,%ebp
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x1,%ecx
call   1060 <snprintf@plt>
lea    0xe01(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
test   %rax,%rax
js     148e <do_test+0x2de>
xor    %r15d,%r15d
xor    %eax,%eax
call   1090 <tzset@plt>
mov    0x2d61(%rip),%r14
mov    (%r14),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1298 <do_test+0xe8>
lea    0xdd7(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%r15d
lea    0xda5(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x2,%ecx
call   1060 <snprintf@plt>
lea    0xd8e(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
test   %rax,%rax
js     148e <do_test+0x2de>
xor    %eax,%eax
call   1090 <tzset@plt>
mov    (%r14),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    12ff <do_test+0x14f>
lea    0xd6e(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15d
lea    0xd3e(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x3,%ecx
call   1060 <snprintf@plt>
lea    0xd27(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
test   %rax,%rax
js     148e <do_test+0x2de>
xor    %eax,%eax
call   1090 <tzset@plt>
mov    (%r14),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    1366 <do_test+0x1b6>
lea    0xd07(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15d
lea    0xcd7(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x10,%esi
mov    $0x4,%ecx
call   1060 <snprintf@plt>
lea    0xcc0(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
test   %rax,%rax
js     148e <do_test+0x2de>
xor    %eax,%eax
call   1090 <tzset@plt>
mov    (%r14),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1080 <strcmp@plt>
test   %rax,%rax
jne    13cd <do_test+0x21d>
lea    0xca0(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15d
mov    $0x4000000,%edi
call   10b0 <test_tz_file@plt>
mov    $0xfffffffa,%edi
call   10b0 <test_tz_file@plt>
mov    $0x4000001,%edi
call   10a0 <malloc@plt>
test   %rax,%rax
je     14a9 <do_test+0x2f9>
mov    %rax,%r14
movb   $0x0,0x4000000(%rax)
mov    $0x4000000,%edx
mov    %rax,%rdi
mov    $0x20,%esi
call   1070 <memset@plt>
movw   $0x5455,(%r14)
movb   $0x43,0x2(%r14)
lea    0xc27(%rip),%rdi
mov    $0x1,%ebp
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
test   %rax,%rax
js     148e <do_test+0x2de>
xor    %eax,%eax
call   1090 <tzset@plt>
mov    $0x4000000,%edx
mov    %r14,%rdi
mov    $0x30,%esi
call   1070 <memset@plt>
movb   $0x3c,(%r14)
movb   $0x3e,0x3ffffff(%r14)
3e
lea    0xbe4(%rip),%rdi
mov    $0x1,%ebp
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <setenv@plt>
test   %rax,%rax
js     148e <do_test+0x2de>
xor    %eax,%eax
call   1090 <tzset@plt>
xor    %ebp,%ebp
test   %r15d,%r15d
setne  %bpl
jmp    149c <do_test+0x2ec>
lea    0xbb7(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xbca(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%ebp
jmp    149c <do_test+0x2ec>

LLVM IR (-O0):
%struct.rlimit = type { i64 }
@RLIMIT_AS = global i32 0
@.str = [34 x i8] c"getrlimit (RLIMIT_AS) failed: %m\0A\00"
@RLIM_INFINITY = global i64 0
@.str.1 = [34 x i8] c"setrlimit (RLIMIT_AS) failed: %m\0A\00"
@.str.2 = [5 x i8] c"XT%d\00"
@.str.3 = [3 x i8] c"TZ\00"
@.str.4 = [19 x i8] c"setenv failed: %m\0A\00"
@tzname = global i32* null
@.str.5 = [27 x i8] c"Unexpected success for %s\0A\00"
@.str.6 = [18 x i8] c"malloc failed: %m\00"
define i32 @do_test() {
%1 = alloca i32
%2 = alloca %struct.rlimit
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca [16 x i8]
%7 = alloca i64
%8 = alloca i8*
%9 = load i32, i32* @RLIMIT_AS
%10 = call i64 @getrlimit(i32 %9, %struct.rlimit* %2)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %1
br label %111
14: ; preds = %0
store i64 536870912, i64* %3
%15 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%16 = load i64, i64* %15
%17 = load i64, i64* @RLIM_INFINITY
%18 = icmp eq i64 %16, %17
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
%21 = load i64, i64* %20
%22 = load i64, i64* %3
%23 = icmp sgt i64 %21, %22
br i1 %23, label %24, label %32
24: ; preds = %19, %14
%25 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %2, i32 0, i32 0
store i64 536870912, i64* %25
%26 = load i32, i32* @RLIMIT_AS
%27 = call i64 @setrlimit(i32 %26, %struct.rlimit* %2)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %111
31: ; preds = %24
br label %32
32: ; preds = %31, %19
store i32 0, i32* %4
store i32 1, i32* %5
br label %33
33: ; preds = %59, %32
%34 = load i32, i32* %5
%35 = icmp sle i32 %34, 4
br i1 %35, label %36, label %62
36: ; preds = %33
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%38 = load i32, i32* %5
%39 = call i32 @snprintf(i8* %37, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%41 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %40, i32 1)
%42 = icmp slt i64 %41, 0
br i1 %42, label %43, label %45
43: ; preds = %36
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %111
45: ; preds = %36
%46 = call i32 (...) @tzset()
%47 = load i32*, i32** @tzname
%48 = getelementptr inbounds i32, i32* %47, i64 0
%49 = load i32, i32* %48
%50 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%51 = call i64 @strcmp(i32 %49, i8* %50)
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %58
53: ; preds = %45
%54 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %54)
%56 = load i32, i32* %4
%57 = add nsw i32 %56, 1
store i32 %57, i32* %4
br label %58
58: ; preds = %53, %45
br label %59
59: ; preds = %58
%60 = load i32, i32* %5
%61 = add nsw i32 %60, 1
store i32 %61, i32* %5
br label %33
62: ; preds = %33
%63 = call i32 @test_tz_file(i64 67108864)
%64 = call i32 @test_tz_file(i64 4294967290)
store i64 67108864, i64* %7
%65 = load i64, i64* %7
%66 = add i64 %65, 1
%67 = call i8* @malloc(i64 %66)
store i8* %67, i8** %8
%68 = load i8*, i8** %8
%69 = icmp eq i8* %68, null
br i1 %69, label %70, label %72
70: ; preds = %62
%71 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %111
72: ; preds = %62
%73 = load i8*, i8** %8
%74 = load i64, i64* %7
%75 = getelementptr inbounds i8, i8* %73, i64 %74
store i8 0, i8* %75
%76 = load i8*, i8** %8
%77 = load i64, i64* %7
%78 = call i32 @memset(i8* %76, i8 signext 32, i64 %77)
%79 = load i8*, i8** %8
%80 = getelementptr inbounds i8, i8* %79, i64 0
store i8 85, i8* %80
%81 = load i8*, i8** %8
%82 = getelementptr inbounds i8, i8* %81, i64 1
store i8 84, i8* %82
%83 = load i8*, i8** %8
%84 = getelementptr inbounds i8, i8* %83, i64 2
store i8 67, i8* %84
%85 = load i8*, i8** %8
%86 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %85, i32 1)
%87 = icmp slt i64 %86, 0
br i1 %87, label %88, label %90
88: ; preds = %72
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %111
90: ; preds = %72
%91 = call i32 (...) @tzset()
%92 = load i8*, i8** %8
%93 = load i64, i64* %7
%94 = call i32 @memset(i8* %92, i8 signext 48, i64 %93)
%95 = load i8*, i8** %8
%96 = getelementptr inbounds i8, i8* %95, i64 0
store i8 60, i8* %96
%97 = load i8*, i8** %8
%98 = load i64, i64* %7
%99 = sub i64 %98, 1
%100 = getelementptr inbounds i8, i8* %97, i64 %99
store i8 62, i8* %100
%101 = load i8*, i8** %8
%102 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %101, i32 1)
%103 = icmp slt i64 %102, 0
br i1 %103, label %104, label %106
104: ; preds = %90
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 1, i32* %1
br label %111
106: ; preds = %90
%107 = call i32 (...) @tzset()
%108 = load i32, i32* %4
%109 = icmp sgt i32 %108, 0
%110 = zext i1 %109 to i32
store i32 %110, i32* %1
br label %111
111: ; preds = %106, %104, %88, %70, %43, %29, %12
%112 = load i32, i32* %1
ret i32 %112
}

LLVM IR (-O2):
%struct.rlimit = type { i64 }
@RLIMIT_AS = global i32 0
@.str = [34 x i8] c"getrlimit (RLIMIT_AS) failed: %m\0A\00"
@RLIM_INFINITY = global i64 0
@.str.1 = [34 x i8] c"setrlimit (RLIMIT_AS) failed: %m\0A\00"
@.str.2 = [5 x i8] c"XT%d\00"
@.str.3 = [3 x i8] c"TZ\00"
@.str.4 = [19 x i8] c"setenv failed: %m\0A\00"
@tzname = global i32* null
@.str.5 = [27 x i8] c"Unexpected success for %s\0A\00"
@.str.6 = [18 x i8] c"malloc failed: %m\00"
define i32 @do_test() {
%1 = alloca %struct.rlimit
%2 = alloca [16 x i8]
%3 = bitcast %struct.rlimit* %1 to i8*
%4 = load i32, i32* @RLIMIT_AS
%5 = call i64 @getrlimit(i32 %4, %struct.rlimit* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %18
7: ; preds = %0
%8 = getelementptr inbounds %struct.rlimit, %struct.rlimit* %1, i64 0, i32 0
%9 = load i64, i64* %8
%10 = load i64, i64* @RLIM_INFINITY
%11 = icmp eq i64 %9, %10
%12 = icmp sgt i64 %9, 536870912
%13 = or i1 %12, %11
br i1 %13, label %14, label %21
14: ; preds = %7
store i64 536870912, i64* %8
%15 = load i32, i32* @RLIMIT_AS
%16 = call i64 @setrlimit(i32 %15, %struct.rlimit* %1)
%17 = icmp eq i64 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %14, %0
%19 = phi i8* [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), %0 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0), %14 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %19)
br label %107
21: ; preds = %7, %14
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%23 = call i32 @snprintf(i8* %22, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 1)
%24 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %22, i32 1)
%25 = icmp slt i64 %24, 0
br i1 %25, label %34, label %26
26: ; preds = %21
%27 = call i32 (...) @tzset()
%28 = load i32*, i32** @tzname
%29 = load i32, i32* %28
%30 = call i64 @strcmp(i32 %29, i8* %22)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %36
32: ; preds = %26
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %22)
br label %36
34: ; preds = %64, %50, %36, %21
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %107
36: ; preds = %26, %32
%37 = phi i32 [ 0, %26 ], [ 1, %32 ]
%38 = call i32 @snprintf(i8* %22, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 2)
%39 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %22, i32 1)
%40 = icmp slt i64 %39, 0
br i1 %40, label %34, label %41
41: ; preds = %36
%42 = call i32 (...) @tzset()
%43 = load i32*, i32** @tzname
%44 = load i32, i32* %43
%45 = call i64 @strcmp(i32 %44, i8* %22)
%46 = icmp eq i64 %45, 0
br i1 %46, label %47, label %50
47: ; preds = %41
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%49 = add nuw nsw i32 %37, 1
br label %50
50: ; preds = %47, %41
%51 = phi i32 [ %37, %41 ], [ %49, %47 ]
%52 = call i32 @snprintf(i8* %22, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 3)
%53 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %22, i32 1)
%54 = icmp slt i64 %53, 0
br i1 %54, label %34, label %55
55: ; preds = %50
%56 = call i32 (...) @tzset()
%57 = load i32*, i32** @tzname
%58 = load i32, i32* %57
%59 = call i64 @strcmp(i32 %58, i8* %22)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %64
61: ; preds = %55
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%63 = add nuw nsw i32 %51, 1
br label %64
64: ; preds = %61, %55
%65 = phi i32 [ %51, %55 ], [ %63, %61 ]
%66 = call i32 @snprintf(i8* %22, i32 16, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 4)
%67 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %22, i32 1)
%68 = icmp slt i64 %67, 0
br i1 %68, label %34, label %69
69: ; preds = %64
%70 = call i32 (...) @tzset()
%71 = load i32*, i32** @tzname
%72 = load i32, i32* %71
%73 = call i64 @strcmp(i32 %72, i8* %22)
%74 = icmp eq i64 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %69
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), i8* %22)
%77 = add nuw nsw i32 %65, 1
br label %78
78: ; preds = %75, %69
%79 = phi i32 [ %65, %69 ], [ %77, %75 ]
%80 = call i32 @test_tz_file(i64 67108864)
%81 = call i32 @test_tz_file(i64 4294967290)
%82 = call dereferenceable_or_null(67108865) i8* @malloc(i64 67108865)
%83 = icmp eq i8* %82, null
br i1 %83, label %84, label %86
84: ; preds = %78
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
br label %107
86: ; preds = %78
%87 = getelementptr inbounds i8, i8* %82, i64 67108864
store i8 0, i8* %87
%88 = call i32 @memset(i8* %82, i8 signext 32, i64 67108864)
store i8 85, i8* %82
%89 = getelementptr inbounds i8, i8* %82, i64 1
store i8 84, i8* %89
%90 = getelementptr inbounds i8, i8* %82, i64 2
store i8 67, i8* %90
%91 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %82, i32 1)
%92 = icmp slt i64 %91, 0
br i1 %92, label %93, label %95
93: ; preds = %86
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %107
95: ; preds = %86
%96 = call i32 (...) @tzset()
%97 = call i32 @memset(i8* %82, i8 signext 48, i64 67108864)
store i8 60, i8* %82
%98 = getelementptr inbounds i8, i8* %82, i64 67108863
store i8 62, i8* %98
%99 = call i64 @setenv(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %82, i32 1)
%100 = icmp slt i64 %99, 0
br i1 %100, label %101, label %103
101: ; preds = %95
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
br label %107
103: ; preds = %95
%104 = call i32 (...) @tzset()
%105 = icmp ne i32 %79, 0
%106 = zext i1 %105 to i32
br label %107
107: ; preds = %34, %18, %103, %101, %93, %84
%108 = phi i32 [ %106, %103 ], [ 1, %101 ], [ 1, %93 ], [ 1, %84 ], [ 1, %18 ], [ 1, %34 ]
ret i32 %108
}