#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;
scalar_t__ errno;
unsigned long strtoul(char *, void *, int);
int /*<<< orphan*/ suerr(char *, char *);
unsigned long eatov(char *s) {
  unsigned long n = strtoul(s, ((void *)0), 10);
  if (errno == ERANGE)
    suerr("%s: eatov: overflow",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/"
          "iwave/sucore/src/atopkge.c");
  return n;
}


x86 assembly (clang, -O0):
<eatov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %rax,-0x10(%rbp)
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%rax
jne    116f <eatov+0x4f>
lea    0xe9d(%rip),%rdi
lea    0xeaa(%rip),%rsi
call   1030 <suerr@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eatov>:
push   %rbx
xor    %esi,%esi
mov    $0xa,%edx
call   1040 <strtoul@plt>
mov    %rax,%rbx
mov    0x2ea1(%rip),%rax
mov    (%rax),%rax
mov    0x2ea7(%rip),%rcx
cmp    (%rcx),%rax
jne    1159 <eatov+0x39>
lea    0xeb3(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1030 <suerr@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@errno = global i64 0
@ERANGE = global i64 0
@.str = [20 x i8] c"%s: eatov: overflow\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/atopkge.c\00"
define i64 @eatov(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtoul(i8* %4, i8* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* @errno
%7 = load i64, i64* @ERANGE
%8 = icmp eq i64 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @suerr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %9, %1
%12 = load i64, i64* %3
ret i64 %12
}

LLVM IR (-O2):
@errno = global i64 0
@ERANGE = global i64 0
@.str = [20 x i8] c"%s: eatov: overflow\00"
@.str.1 = [159 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/TobbeTripitaka/src/refs/heads/master/trip/iwave/sucore/src/atopkge.c\00"
define i64 @eatov(i8* nocapture %0) {
%2 = tail call i64 @strtoul(i8* nocapture %0, i8* null, i32 10)
%3 = load i64, i64* @errno
%4 = load i64, i64* @ERANGE
%5 = icmp eq i64 %3, %4
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = tail call i32 @suerr(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([159 x i8], [159 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %1
ret i64 %2
}