#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 */
long long SCHAR_MAX;
long long SCHAR_MIN;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
long long strtoll(char const *, char **, int);
int stoI1(const char *X, char *ptr_Y) {
  int status = 0;
  char *endptr;
  long long Y;
  if ((X == NULL) || (*X == '\0')) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 88,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  Y = strtoll(X, &endptr, 10);
  if ((*endptr != '\0') && (*endptr != '\n')) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 90,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  if ((Y < SCHAR_MIN) || (Y > SCHAR_MAX)) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 91,
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/"
                "master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c");
      };
      status = -1;
      goto BYE;
    };
  }
  *ptr_Y = Y;
BYE:
  return status;
}


x86 assembly (clang, -O0):
<stoI1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <stoI1+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117f <stoI1+0x5f>
mov    0x2e77(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    $0x58,%edx
lea    0xea8(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1243 <stoI1+0x123>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11e2 <stoI1+0xc2>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11e2 <stoI1+0xc2>
mov    0x2e14(%rip),%rax
mov    (%rax),%edi
lea    0xe3b(%rip),%rsi
mov    $0x5a,%edx
lea    0xe45(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1243 <stoI1+0x123>
mov    -0x28(%rbp),%rax
mov    0x2df3(%rip),%rcx
cmp    (%rcx),%rax
jl     120a <stoI1+0xea>
mov    -0x28(%rbp),%rax
mov    0x2dd7(%rip),%rcx
cmp    (%rcx),%rax
jle    1237 <stoI1+0x117>
mov    0x2dbf(%rip),%rax
mov    (%rax),%edi
lea    0xde6(%rip),%rsi
mov    $0x5b,%edx
lea    0xdf0(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    1243 <stoI1+0x123>
mov    -0x28(%rbp),%rax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    %cl,(%rax)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoI1>:
push   %rbx
sub    $0x10,%rsp
test   %rdi,%rdi
je     116f <stoI1+0x4f>
cmpb   $0x0,(%rdi)
je     116f <stoI1+0x4f>
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
mov    $0xa,%edx
call   1030 <strtoll@plt>
mov    0x8(%rsp),%rcx
mov    (%rcx),%cl
test   %cl,%cl
je     1151 <stoI1+0x31>
cmp    $0xa,%cl
jne    119b <stoI1+0x7b>
mov    0x2e88(%rip),%rcx
cmp    (%rcx),%rax
jl     11b9 <stoI1+0x99>
mov    0x2e74(%rip),%rcx
cmp    (%rcx),%rax
jg     11b9 <stoI1+0x99>
mov    %al,(%rbx)
xor    %eax,%eax
jmp    1195 <stoI1+0x75>
mov    0x2e5a(%rip),%rax
mov    (%rax),%edi
lea    0xe81(%rip),%rsi
lea    0xe90(%rip),%rcx
mov    $0x58,%edx
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x2e2e(%rip),%rax
mov    (%rax),%edi
lea    0xe55(%rip),%rsi
lea    0xe64(%rip),%rcx
mov    $0x5a,%edx
jmp    118b <stoI1+0x6b>
mov    0x2e10(%rip),%rax
mov    (%rax),%edi
lea    0xe37(%rip),%rsi
lea    0xe46(%rip),%rcx
mov    $0x5b,%edx
jmp    118b <stoI1+0x6b>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c\00"
@SCHAR_MIN = global i64 0
@SCHAR_MAX = global i64 0
define i32 @stoI1(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 0, i32* %5
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %10, %2
%16 = load i32, i32* @stderr
%17 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 88, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %48
18: ; preds = %10
%19 = load i8*, i8** %3
%20 = call i64 @strtoll(i8* %19, i8** %6, i32 10)
store i64 %20, i64* %7
%21 = load i8*, i8** %6
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %18
%26 = load i8*, i8** %6
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 10
br i1 %29, label %30, label %33
30: ; preds = %25
%31 = load i32, i32* @stderr
%32 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %48
33: ; preds = %25, %18
%34 = load i64, i64* %7
%35 = load i64, i64* @SCHAR_MIN
%36 = icmp slt i64 %34, %35
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i64, i64* %7
%39 = load i64, i64* @SCHAR_MAX
%40 = icmp sgt i64 %38, %39
br i1 %40, label %41, label %44
41: ; preds = %37, %33
%42 = load i32, i32* @stderr
%43 = call i32 @fprintf(i32 %42, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 91, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %48
44: ; preds = %37
%45 = load i64, i64* %7
%46 = trunc i64 %45 to i8
%47 = load i8*, i8** %4
store i8 %46, i8* %47
br label %48
48: ; preds = %44, %41, %30, %15
%49 = load i32, i32* %5
ret i32 %49
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/DEPRECATED_Q2/BAK.4.23.2015.PARSER/auxil.c\00"
@SCHAR_MIN = global i64 0
@SCHAR_MAX = global i64 0
define i32 @stoI1(i8* %0, i8* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6, %2
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 88, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %30
12: ; preds = %6
%13 = call i64 @strtoll(i8* %0, i8** %3, i32 10)
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
switch i8 %15, label %16 [
i8 0, label %19
i8 10, label %19
]
16: ; preds = %12
%17 = load i32, i32* @stderr
%18 = tail call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 90, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %30
19: ; preds = %12, %12
%20 = load i64, i64* @SCHAR_MIN
%21 = icmp slt i64 %13, %20
%22 = load i64, i64* @SCHAR_MAX
%23 = icmp sgt i64 %13, %22
%24 = select i1 %21, i1 true, i1 %23
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 91, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %30
28: ; preds = %19
%29 = trunc i64 %13 to i8
store i8 %29, i8* %1
br label %30
30: ; preds = %28, %25, %16, %9
%31 = phi i32 [ -1, %9 ], [ -1, %16 ], [ -1, %25 ], [ 0, %28 ]
ret i32 %31
}