#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*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
long long strtoll(char const *, char **, int /*<<< orphan*/);
int stoI8(const char *X, long long *ptr_Y) {
  int status = 0;
  char *endptr;
  if ((X == NULL) || (*X == '\0')) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 153,
                "/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 = strtoll(X, &endptr, 0);
  if ((*endptr != '\0') && (*endptr != '\n')) {
    {
      {
        fprintf(stderr, "Line %3d of File %s \n", 156,
                "/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;
    };
  }
BYE:
  return status;
}


x86 assembly (clang, -O0):
<stoI8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1152 <stoI8+0x32>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    117f <stoI8+0x5f>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
mov    $0x99,%edx
lea    0xea8(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    11ea <stoI8+0xca>
mov    -0x8(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11e5 <stoI8+0xc5>
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     11e5 <stoI8+0xc5>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
lea    0xe38(%rip),%rsi
mov    $0x9c,%edx
lea    0xe42(%rip),%rcx
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x14(%rbp)
jmp    11ea <stoI8+0xca>
jmp    11ea <stoI8+0xca>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoI8>:
push   %r14
push   %rbx
push   %rax
mov    $0x99,%edx
test   %rdi,%rdi
je     1158 <stoI8+0x38>
cmpb   $0x0,(%rdi)
je     1158 <stoI8+0x38>
mov    %rsi,%r14
mov    %rsp,%rsi
xor    %ebx,%ebx
xor    %edx,%edx
call   1030 <strtoll@plt>
mov    %rax,(%r14)
mov    (%rsp),%rax
mov    (%rax),%al
test   %al,%al
je     1179 <stoI8+0x59>
mov    $0x9c,%edx
cmp    $0xa,%al
je     1179 <stoI8+0x59>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
lea    0xea7(%rip),%rcx
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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"
define i32 @stoI8(i8* %0, i64* %1) {
%3 = alloca i8*
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i8*
store i8* %0, i8** %3
store i64* %1, i64** %4
store i32 0, i32* %5
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %14, label %9
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %9, %2
%15 = load i32, i32* @stderr
%16 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 153, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %34
17: ; preds = %9
%18 = load i8*, i8** %3
%19 = call i64 @strtoll(i8* %18, i8** %6, i32 0)
%20 = load i64*, i64** %4
store i64 %19, i64* %20
%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 = %17
%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 156, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %5
br label %34
33: ; preds = %25, %17
br label %34
34: ; preds = %33, %30, %14
%35 = load i32, i32* %5
ret i32 %35
}

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"
define i32 @stoI8(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
%5 = icmp eq i8* %0, null
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = call i64 @strtoll(i8* %0, i8** %3, i32 0)
store i64 %10, i64* %1
%11 = load i8*, i8** %3
%12 = load i8, i8* %11
switch i8 %12, label %13 [
i8 0, label %17
i8 10, label %17
]
13: ; preds = %9, %2, %6
%14 = phi i32 [ 153, %6 ], [ 153, %2 ], [ 156, %9 ]
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %14, i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %13, %9, %9
%18 = phi i32 [ 0, %9 ], [ 0, %9 ], [ -1, %13 ]
ret i32 %18
}