#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 */
typedef int /*<<< orphan*/ errbuf;

/* Variables and functions */
int /*<<< orphan*/ errx(int, char *, char *);
long long strsuftollx(char const *, char const *, long long, long long, char *,
                      int);
long long strsuftoll(const char *desc, const char *val, long long min,
                     long long max) {
  long long result;
  char errbuf[100];
  result = strsuftollx(desc, val, min, max, errbuf, sizeof(errbuf));
  if (*errbuf != '\0')
    errx(1, "%s", errbuf);
  return (result);
}


x86 assembly (clang, -O0):
<strsuftoll>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x90(%rbp),%r8
mov    $0x64,%r9d
call   1040 <strsuftollx@plt>
mov    %rax,-0x28(%rbp)
movsbl -0x90(%rbp),%eax
cmp    $0x0,%eax
je     1189 <strsuftoll+0x69>
lea    -0x90(%rbp),%rdx
mov    $0x1,%edi
lea    0xe7c(%rip),%rsi
call   1030 <errx@plt>
mov    -0x28(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strsuftoll>:
push   %rbx
sub    $0x70,%rsp
mov    %rsp,%r8
mov    $0x64,%r9d
call   1040 <strsuftollx@plt>
mov    %rax,%rbx
cmpb   $0x0,(%rsp)
je     1150 <strsuftoll+0x30>
lea    0xebd(%rip),%rsi
mov    %rsp,%rdx
mov    $0x1,%edi
call   1030 <errx@plt>
mov    %rbx,%rax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i64 @strsuftoll(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca [100 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
store i64 %3, i64* %8
%11 = load i8*, i8** %5
%12 = load i8*, i8** %6
%13 = load i64, i64* %7
%14 = load i64, i64* %8
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%16 = call i64 @strsuftollx(i8* %11, i8* %12, i64 %13, i64 %14, i8* %15, i32 100)
store i64 %16, i64* %9
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %4
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%23 = call i32 @errx(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %21, %4
%25 = load i64, i64* %9
ret i64 %25
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i64 @strsuftoll(i8* %0, i8* %1, i64 %2, i64 %3) {
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = call i64 @strsuftollx(i8* %0, i8* %1, i64 %2, i64 %3, i8* %6, i32 100)
%8 = load i8, i8* %6
%9 = icmp eq i8 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %4
%11 = call i32 @errx(i32 1, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %12
12: ; preds = %10, %4
ret i64 %7
}