#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 */
scalar_t__ ERANGE;
long INT_MAX;
long INT_MIN;
long LONG_MAX;
long LONG_MIN;
scalar_t__ errno;
int /*<<< orphan*/ fprint_err(char *, ...);
int /*<<< orphan*/ print_err(char *);
int /*<<< orphan*/ strerror(scalar_t__);
long strtol(char *, char **, int);
extern int int_value(char *prefix, char *cmd, char *arg, int positive, int base,
                     int *value) {
  char *ptr;
  long val;
  errno = 0;
  val = strtol(arg, &ptr, base);
  if (errno) {
    print_err("### ");
    if (prefix != NULL)
      fprint_err("%s: ", prefix);
    if (errno == ERANGE && val == 0)
      fprint_err("String cannot be converted to (long) integer in %s %s\n", cmd,
                 arg);
    else if (errno == ERANGE && (val == LONG_MAX || val == LONG_MIN))
      fprint_err("Number is too big (overflows) in %s %s\n", cmd, arg);
    else
      fprint_err("Cannot read number in %s %s (%s)\n", cmd, arg,
                 strerror(errno));
    return 1;
  }
  if (ptr[0] != '\0') {
    print_err("### ");
    if (prefix != NULL)
      fprint_err("%s: ", prefix);
    if (ptr - arg == 0)
      fprint_err("Argument to %s should be a number, in %s %s\n", cmd, cmd,
                 arg);
    else
      fprint_err("Unexpected characters ('%s') after the %.*s in %s %s\n", ptr,
                 (int)(ptr - arg), arg, cmd, arg);
    return 1;
  }
  if (val > INT_MAX || val < INT_MIN) {
    print_err("### ");
    if (prefix != NULL)
      fprint_err("%s: ", prefix);
    fprint_err("Value %ld (in %s %s) is too large (to fit into 'int')\n", val,
               cmd, arg);
    return 1;
  }
  if (positive && val < 0) {
    print_err("### ");
    if (prefix != NULL)
      fprint_err("%s: ", prefix);
    fprint_err("Value %ld (in %s %s) is less than zero\n", val, cmd, arg);
    return 1;
  }
  *value = val;
  return 0;
}


x86 assembly (clang, -O0):
<int_value>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2e52(%rip),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%edx
lea    -0x38(%rbp),%rsi
call   1050 <strtol@plt>
mov    %rax,-0x40(%rbp)
mov    0x2e30(%rip),%rax
cmpq   $0x0,(%rax)
je     12a0 <int_value+0x160>
lea    0xe67(%rip),%rdi
call   1040 <print_err@plt>
cmpq   $0x0,-0x10(%rbp)
je     11bb <int_value+0x7b>
mov    -0x10(%rbp),%rsi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%rax
mov    0x2e04(%rip),%rcx
cmp    (%rcx),%rax
jne    11fb <int_value+0xbb>
cmpq   $0x0,-0x40(%rbp)
jne    11fb <int_value+0xbb>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
jmp    1294 <int_value+0x154>
mov    0x2db6(%rip),%rax
mov    (%rax),%rax
mov    0x2dc4(%rip),%rcx
cmp    (%rcx),%rax
jne    1258 <int_value+0x118>
mov    -0x40(%rbp),%rax
mov    0x2da0(%rip),%rcx
cmp    (%rcx),%rax
je     123d <int_value+0xfd>
mov    -0x40(%rbp),%rax
mov    0x2dac(%rip),%rcx
cmp    (%rcx),%rax
jne    1258 <int_value+0x118>
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
jmp    128f <int_value+0x14f>
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d49(%rip),%rax
mov    (%rax),%rdi
call   1060 <strerror@plt>
mov    -0x50(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    %eax,%ecx
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
jmp    1294 <int_value+0x154>
movl   $0x1,-0x4(%rbp)
jmp    1432 <int_value+0x2f2>
mov    -0x38(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1344 <int_value+0x204>
lea    0xd49(%rip),%rdi
call   1040 <print_err@plt>
cmpq   $0x0,-0x10(%rbp)
je     12d9 <int_value+0x199>
mov    -0x10(%rbp),%rsi
lea    0xd33(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
mov    -0x38(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
cmp    $0x0,%rax
jne    130d <int_value+0x1cd>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
jmp    1338 <int_value+0x1f8>
mov    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,%edx
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
movl   $0x1,-0x4(%rbp)
jmp    1432 <int_value+0x2f2>
mov    -0x40(%rbp),%rax
mov    0x2c99(%rip),%rcx
cmp    (%rcx),%rax
jg     136c <int_value+0x22c>
mov    -0x40(%rbp),%rax
mov    0x2c75(%rip),%rcx
cmp    (%rcx),%rax
jge    13bb <int_value+0x27b>
lea    0xc8d(%rip),%rdi
call   1040 <print_err@plt>
cmpq   $0x0,-0x10(%rbp)
je     1395 <int_value+0x255>
mov    -0x10(%rbp),%rsi
lea    0xc77(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
mov    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xd46(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
movl   $0x1,-0x4(%rbp)
jmp    1432 <int_value+0x2f2>
cmpl   $0x0,-0x24(%rbp)
je     141f <int_value+0x2df>
cmpq   $0x0,-0x40(%rbp)
jge    141f <int_value+0x2df>
lea    0xc29(%rip),%rdi
call   1040 <print_err@plt>
cmpq   $0x0,-0x10(%rbp)
je     13f9 <int_value+0x2b9>
mov    -0x10(%rbp),%rsi
lea    0xc13(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
mov    -0x40(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1030 <fprint_err@plt>
movl   $0x1,-0x4(%rbp)
jmp    1432 <int_value+0x2f2>
mov    -0x40(%rbp),%rax
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_value>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r13
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,0x8(%rsp)
mov    %rdi,%rbx
mov    0x2e52(%rip),%rbp
movq   $0x0,0x0(%rbp)
lea    0x10(%rsp),%rsi
mov    %rdx,%rdi
mov    %r8d,%edx
call   1050 <strtol@plt>
mov    %rax,%r12
cmpq   $0x0,0x0(%rbp)
je     11ce <int_value+0x8e>
lea    0xe71(%rip),%rdi
call   1040 <print_err@plt>
test   %rbx,%rbx
je     11aa <int_value+0x6a>
lea    0xe65(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprint_err@plt>
mov    0x0(%rbp),%rdi
mov    0x2e1b(%rip),%rax
mov    (%rax),%rax
cmp    %rax,%rdi
jne    122c <int_value+0xec>
test   %r12,%r12
jne    122c <int_value+0xec>
lea    0xe41(%rip),%rdi
jmp    12e0 <int_value+0x1a0>
mov    0x10(%rsp),%rbp
cmpb   $0x0,0x0(%rbp)
je     1273 <int_value+0x133>
lea    0xe1c(%rip),%rdi
call   1040 <print_err@plt>
test   %rbx,%rbx
je     11ff <int_value+0xbf>
lea    0xe10(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprint_err@plt>
mov    %rbp,%rdx
sub    %r15,%rdx
je     12c8 <int_value+0x188>
lea    0xea6(%rip),%rdi
mov    %rbp,%rsi
mov    %r15,%rcx
mov    0x8(%rsp),%r8
mov    %r15,%r9
xor    %eax,%eax
call   1030 <fprint_err@plt>
jmp    132c <int_value+0x1ec>
cmp    %rax,%rdi
jne    1251 <int_value+0x111>
mov    0x2d88(%rip),%rax
cmp    (%rax),%r12
je     12d9 <int_value+0x199>
mov    0x2d98(%rip),%rax
cmp    (%rax),%r12
je     12d9 <int_value+0x199>
call   1060 <strerror@plt>
lea    0xe0c(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    %r15,%rdx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <fprint_err@plt>
jmp    132c <int_value+0x1ec>
mov    0x2d6e(%rip),%rax
cmp    (%rax),%r12
jg     12f1 <int_value+0x1b1>
mov    0x2d52(%rip),%rax
cmp    (%rax),%r12
jl     12f1 <int_value+0x1b1>
test   %r14d,%r14d
je     1340 <int_value+0x200>
test   %r12,%r12
jns    1340 <int_value+0x200>
lea    0xd5c(%rip),%rdi
call   1040 <print_err@plt>
test   %rbx,%rbx
je     12bf <int_value+0x17f>
lea    0xd50(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprint_err@plt>
lea    0xe5f(%rip),%rdi
jmp    131a <int_value+0x1da>
lea    0xdbc(%rip),%rdi
mov    0x8(%rsp),%rdx
mov    %rdx,%rsi
jmp    1322 <int_value+0x1e2>
lea    0xd61(%rip),%rdi
mov    0x8(%rsp),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <fprint_err@plt>
jmp    132c <int_value+0x1ec>
lea    0xd08(%rip),%rdi
call   1040 <print_err@plt>
test   %rbx,%rbx
je     1313 <int_value+0x1d3>
lea    0xcfc(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprint_err@plt>
lea    0xdd4(%rip),%rdi
mov    %r12,%rsi
mov    0x8(%rsp),%rdx
mov    %r15,%rcx
xor    %eax,%eax
call   1030 <fprint_err@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r12d,0x0(%r13)
xor    %eax,%eax
jmp    1331 <int_value+0x1f1>

LLVM IR (-O0):
@errno = global i64 0
@.str = [5 x i8] c"### \00"
@.str.1 = [5 x i8] c"%s: \00"
@ERANGE = global i64 0
@.str.2 = [55 x i8] c"String cannot be converted to (long) integer in %s %s\0A\00"
@LONG_MAX = global i64 0
@LONG_MIN = global i64 0
@.str.3 = [40 x i8] c"Number is too big (overflows) in %s %s\0A\00"
@.str.4 = [34 x i8] c"Cannot read number in %s %s (%s)\0A\00"
@.str.5 = [45 x i8] c"Argument to %s should be a number, in %s %s\0A\00"
@.str.6 = [54 x i8] c"Unexpected characters ('%s') after the %.*s in %s %s\0A\00"
@INT_MAX = global i64 0
@INT_MIN = global i64 0
@.str.7 = [55 x i8] c"Value %ld (in %s %s) is too large (to fit into 'int')\0A\00"
@.str.8 = [40 x i8] c"Value %ld (in %s %s) is less than zero\0A\00"
define i32 @int_value(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i8*
%15 = alloca i64
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32* %5, i32** %13
store i64 0, i64* @errno
%16 = load i8*, i8** %10
%17 = load i32, i32* %12
%18 = call i64 @strtol(i8* %16, i8** %14, i32 %17)
store i64 %18, i64* %15
%19 = load i64, i64* @errno
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %63
21: ; preds = %6
%22 = call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%23 = load i8*, i8** %8
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load i8*, i8** %8
%27 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %25, %21
%29 = load i64, i64* @errno
%30 = load i64, i64* @ERANGE
%31 = icmp eq i64 %29, %30
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = load i64, i64* %15
%34 = icmp eq i64 %33, 0
br i1 %34, label %35, label %39
35: ; preds = %32
%36 = load i8*, i8** %9
%37 = load i8*, i8** %10
%38 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %36, i8* %37)
br label %62
39: ; preds = %32, %28
%40 = load i64, i64* @errno
%41 = load i64, i64* @ERANGE
%42 = icmp eq i64 %40, %41
br i1 %42, label %43, label %55
43: ; preds = %39
%44 = load i64, i64* %15
%45 = load i64, i64* @LONG_MAX
%46 = icmp eq i64 %44, %45
br i1 %46, label %51, label %47
47: ; preds = %43
%48 = load i64, i64* %15
%49 = load i64, i64* @LONG_MIN
%50 = icmp eq i64 %48, %49
br i1 %50, label %51, label %55
51: ; preds = %47, %43
%52 = load i8*, i8** %9
%53 = load i8*, i8** %10
%54 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %52, i8* %53)
br label %61
55: ; preds = %47, %39
%56 = load i8*, i8** %9
%57 = load i8*, i8** %10
%58 = load i64, i64* @errno
%59 = call i32 @strerror(i64 %58)
%60 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %56, i8* %57, i32 %59)
br label %61
61: ; preds = %55, %51
br label %62
62: ; preds = %61, %35
store i32 1, i32* %7
br label %143
63: ; preds = %6
%64 = load i8*, i8** %14
%65 = getelementptr inbounds i8, i8* %64, i64 0
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = icmp ne i32 %67, 0
br i1 %68, label %69, label %101
69: ; preds = %63
%70 = call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%71 = load i8*, i8** %8
%72 = icmp ne i8* %71, null
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = load i8*, i8** %8
%75 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %74)
br label %76
76: ; preds = %73, %69
%77 = load i8*, i8** %14
%78 = load i8*, i8** %10
%79 = ptrtoint i8* %77 to i64
%80 = ptrtoint i8* %78 to i64
%81 = sub i64 %79, %80
%82 = icmp eq i64 %81, 0
br i1 %82, label %83, label %88
83: ; preds = %76
%84 = load i8*, i8** %9
%85 = load i8*, i8** %9
%86 = load i8*, i8** %10
%87 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i8* %84, i8* %85, i8* %86)
br label %100
88: ; preds = %76
%89 = load i8*, i8** %14
%90 = load i8*, i8** %14
%91 = load i8*, i8** %10
%92 = ptrtoint i8* %90 to i64
%93 = ptrtoint i8* %91 to i64
%94 = sub i64 %92, %93
%95 = trunc i64 %94 to i32
%96 = load i8*, i8** %10
%97 = load i8*, i8** %9
%98 = load i8*, i8** %10
%99 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* %89, i32 %95, i8* %96, i8* %97, i8* %98)
br label %100
100: ; preds = %88, %83
store i32 1, i32* %7
br label %143
101: ; preds = %63
%102 = load i64, i64* %15
%103 = load i64, i64* @INT_MAX
%104 = icmp sgt i64 %102, %103
br i1 %104, label %109, label %105
105: ; preds = %101
%106 = load i64, i64* %15
%107 = load i64, i64* @INT_MIN
%108 = icmp slt i64 %106, %107
br i1 %108, label %109, label %121
109: ; preds = %105, %101
%110 = call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%111 = load i8*, i8** %8
%112 = icmp ne i8* %111, null
br i1 %112, label %113, label %116
113: ; preds = %109
%114 = load i8*, i8** %8
%115 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %114)
br label %116
116: ; preds = %113, %109
%117 = load i64, i64* %15
%118 = load i8*, i8** %9
%119 = load i8*, i8** %10
%120 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i64 %117, i8* %118, i8* %119)
store i32 1, i32* %7
br label %143
121: ; preds = %105
%122 = load i32, i32* %11
%123 = icmp ne i32 %122, 0
br i1 %123, label %124, label %139
124: ; preds = %121
%125 = load i64, i64* %15
%126 = icmp slt i64 %125, 0
br i1 %126, label %127, label %139
127: ; preds = %124
%128 = call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%129 = load i8*, i8** %8
%130 = icmp ne i8* %129, null
br i1 %130, label %131, label %134
131: ; preds = %127
%132 = load i8*, i8** %8
%133 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %132)
br label %134
134: ; preds = %131, %127
%135 = load i64, i64* %15
%136 = load i8*, i8** %9
%137 = load i8*, i8** %10
%138 = call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i64 %135, i8* %136, i8* %137)
store i32 1, i32* %7
br label %143
139: ; preds = %124, %121
%140 = load i64, i64* %15
%141 = trunc i64 %140 to i32
%142 = load i32*, i32** %13
store i32 %141, i32* %142
store i32 0, i32* %7
br label %143
143: ; preds = %139, %134, %116, %100, %62
%144 = load i32, i32* %7
ret i32 %144
}

LLVM IR (-O2):
@errno = global i64 0
@.str = [5 x i8] c"### \00"
@.str.1 = [5 x i8] c"%s: \00"
@ERANGE = global i64 0
@.str.2 = [55 x i8] c"String cannot be converted to (long) integer in %s %s\0A\00"
@LONG_MAX = global i64 0
@LONG_MIN = global i64 0
@.str.3 = [40 x i8] c"Number is too big (overflows) in %s %s\0A\00"
@.str.4 = [34 x i8] c"Cannot read number in %s %s (%s)\0A\00"
@.str.5 = [45 x i8] c"Argument to %s should be a number, in %s %s\0A\00"
@.str.6 = [54 x i8] c"Unexpected characters ('%s') after the %.*s in %s %s\0A\00"
@INT_MAX = global i64 0
@INT_MIN = global i64 0
@.str.7 = [55 x i8] c"Value %ld (in %s %s) is too large (to fit into 'int')\0A\00"
@.str.8 = [40 x i8] c"Value %ld (in %s %s) is less than zero\0A\00"
define i32 @int_value(i8* %0, i8* %1, i8* %2, i32 %3, i32 %4, i32* nocapture writeonly %5) {
%7 = alloca i8*
%8 = bitcast i8** %7 to i8*
store i64 0, i64* @errno
%9 = call i64 @strtol(i8* %2, i8** %7, i32 %4)
%10 = load i64, i64* @errno
%11 = icmp eq i64 %10, 0
br i1 %11, label %37, label %12
12: ; preds = %6
%13 = tail call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i8* %0, null
br i1 %14, label %17, label %15
15: ; preds = %12
%16 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %17
17: ; preds = %15, %12
%18 = load i64, i64* @errno
%19 = load i64, i64* @ERANGE
%20 = icmp eq i64 %18, %19
%21 = icmp eq i64 %9, 0
%22 = select i1 %20, i1 %21, i1 false
br i1 %22, label %23, label %25
23: ; preds = %17
%24 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %2)
br label %82
25: ; preds = %17
br i1 %20, label %26, label %34
26: ; preds = %25
%27 = load i64, i64* @LONG_MAX
%28 = icmp eq i64 %9, %27
%29 = load i64, i64* @LONG_MIN
%30 = icmp eq i64 %9, %29
%31 = select i1 %28, i1 true, i1 %30
br i1 %31, label %32, label %34
32: ; preds = %26
%33 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0), i8* %1, i8* %2)
br label %82
34: ; preds = %26, %25
%35 = tail call i32 @strerror(i64 %18)
%36 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0), i8* %1, i8* %2, i32 %35)
br label %82
37: ; preds = %6
%38 = load i8*, i8** %7
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 0
br i1 %40, label %56, label %41
41: ; preds = %37
%42 = tail call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%43 = icmp eq i8* %0, null
br i1 %43, label %46, label %44
44: ; preds = %41
%45 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %46
46: ; preds = %44, %41
%47 = ptrtoint i8* %38 to i64
%48 = ptrtoint i8* %2 to i64
%49 = sub i64 %47, %48
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %46
%52 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.5, i64 0, i64 0), i8* %1, i8* %1, i8* %2)
br label %82
53: ; preds = %46
%54 = trunc i64 %49 to i32
%55 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* %38, i32 %54, i8* %2, i8* %1, i8* %2)
br label %82
56: ; preds = %37
%57 = load i64, i64* @INT_MAX
%58 = icmp sgt i64 %9, %57
%59 = load i64, i64* @INT_MIN
%60 = icmp slt i64 %9, %59
%61 = select i1 %58, i1 true, i1 %60
br i1 %61, label %62, label %69
62: ; preds = %56
%63 = tail call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%64 = icmp eq i8* %0, null
br i1 %64, label %67, label %65
65: ; preds = %62
%66 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %67
67: ; preds = %65, %62
%68 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.7, i64 0, i64 0), i64 %9, i8* %1, i8* %2)
br label %82
69: ; preds = %56
%70 = icmp ne i32 %3, 0
%71 = icmp slt i64 %9, 0
%72 = select i1 %70, i1 %71, i1 false
br i1 %72, label %73, label %80
73: ; preds = %69
%74 = tail call i32 @print_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%75 = icmp eq i8* %0, null
br i1 %75, label %78, label %76
76: ; preds = %73
%77 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %78
78: ; preds = %76, %73
%79 = tail call i32 (i8*, ...) @fprint_err(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0), i64 %9, i8* %1, i8* %2)
br label %82
80: ; preds = %69
%81 = trunc i64 %9 to i32
store i32 %81, i32* %5
br label %82
82: ; preds = %51, %53, %23, %34, %32, %80, %78, %67
%83 = phi i32 [ 1, %67 ], [ 1, %78 ], [ 0, %80 ], [ 1, %32 ], [ 1, %34 ], [ 1, %23 ], [ 1, %53 ], [ 1, %51 ]
ret i32 %83
}