#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 atoi(char *);
char *date_get_environment(char *);
int date_utc_offset(void) {
  char *utc_offset;
  static int utc_offset_integer = -99;
  if (utc_offset_integer != -99)
    return utc_offset_integer;
  utc_offset = date_get_environment("UTC_OFFSET");
  if (utc_offset)
    utc_offset_integer = atoi(utc_offset);
  else
    utc_offset_integer = -5;
  return utc_offset_integer;
}


x86 assembly (clang, -O0):
<date_utc_offset>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
cmpl   $0xffffff9d,0x2f01(%rip)
je     1143 <date_utc_offset+0x23>
mov    0x2ef5(%rip),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <date_utc_offset+0x65>
lea    0xeb6(%rip),%rdi
call   1030 <date_get_environment@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1172 <date_utc_offset+0x52>
mov    -0x10(%rbp),%rdi
call   1040 <atoi@plt>
mov    %eax,0x2ec3(%rip)
jmp    117c <date_utc_offset+0x5c>
movl   $0xfffffffb,0x2eb4(%rip)
ff ff ff
mov    0x2eae(%rip),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_utc_offset>:
push   %rax
mov    0x2f09(%rip),%eax
cmp    $0xffffff9d,%eax
jne    1152 <date_utc_offset+0x32>
lea    0xecd(%rip),%rdi
call   1030 <date_get_environment@plt>
test   %rax,%rax
je     1147 <date_utc_offset+0x27>
mov    %rax,%rdi
call   1040 <atoi@plt>
jmp    114c <date_utc_offset+0x2c>
mov    $0xfffffffb,%eax
mov    %eax,0x2ede(%rip)
pop    %rcx
ret

LLVM IR (-O0):
@date_utc_offset.utc_offset_integer = internal global i32 -99
@.str = [11 x i8] c"UTC_OFFSET\00"
define i32 @date_utc_offset() {
%1 = alloca i32
%2 = alloca i8*
%3 = load i32, i32* @date_utc_offset.utc_offset_integer
%4 = icmp ne i32 %3, -99
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @date_utc_offset.utc_offset_integer
store i32 %6, i32* %1
br label %17
7: ; preds = %0
%8 = call i8* @date_get_environment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %2
%9 = load i8*, i8** %2
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i8*, i8** %2
%13 = call i32 @atoi(i8* %12)
store i32 %13, i32* @date_utc_offset.utc_offset_integer
br label %15
14: ; preds = %7
store i32 -5, i32* @date_utc_offset.utc_offset_integer
br label %15
15: ; preds = %14, %11
%16 = load i32, i32* @date_utc_offset.utc_offset_integer
store i32 %16, i32* %1
br label %17
17: ; preds = %15, %5
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
@date_utc_offset.utc_offset_integer = internal unnamed_addr global i32 -99
@.str = [11 x i8] c"UTC_OFFSET\00"
define i32 @date_utc_offset() {
%1 = load i32, i32* @date_utc_offset.utc_offset_integer
%2 = icmp eq i32 %1, -99
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i8* @date_get_environment(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
%7 = tail call i32 @atoi(i8* %4)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ %7, %6 ], [ -5, %3 ]
store i32 %9, i32* @date_utc_offset.utc_offset_integer
br label %10
10: ; preds = %0, %8
%11 = phi i32 [ %9, %8 ], [ %1, %0 ]
ret i32 %11
}