#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 int8_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ init_int(int *, char const **);
int /*<<< orphan*/ stderr;
int __attribute__((__unused__)) init_int8_t(int8_t *i8, const char *argv[]) {
  int i32;
  init_int(&i32, argv);
  if (i32 > 0x7F)
    do {
      fprintf(stderr, "FATAL[%s:%d]: ",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/0mark/linux-sunxi/refs/heads/"
              "2.6.34.15-mali19/drivers/amlogic/wifi/nano_c047_12/userspace/"
              "libnrx/autotest/testprogram.in.c",
              95);
      fprintf(stderr, "Overflow: Number larger than 0x7F (%s)\n", *argv);
      return -1;
    } while (0);
  if (i32 < -0x80)
    do {
      fprintf(stderr, "FATAL[%s:%d]: ",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/0mark/linux-sunxi/refs/heads/"
              "2.6.34.15-mali19/drivers/amlogic/wifi/nano_c047_12/userspace/"
              "libnrx/autotest/testprogram.in.c",
              97);
      fprintf(stderr, "Overflow: Number smaller than -0x80 (%s)\n", *argv);
      return -1;
    } while (0);
  *i8 = i32;
  return 1;
}


x86 assembly (clang, -O0):
<init_int8_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdi
call   1030 <init_int@plt>
cmpl   $0x7f,-0x1c(%rbp)
jle    1199 <init_int8_t+0x79>
jmp    114c <init_int8_t+0x2c>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
lea    0xeac(%rip),%rdx
mov    $0x5f,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xf5e(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1205 <init_int8_t+0xe5>
cmpl   $0xffffff80,-0x1c(%rbp)
jge    11f5 <init_int8_t+0xd5>
jmp    11a8 <init_int8_t+0x88>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
lea    0xe48(%rip),%rsi
lea    0xe50(%rip),%rdx
mov    $0x61,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2e0e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
lea    0xf2a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1205 <init_int8_t+0xe5>
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_int8_t>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x4(%rsp),%rdi
call   1030 <init_int@plt>
mov    0x4(%rsp),%eax
cmp    $0x80,%eax
jl     1172 <init_int8_t+0x52>
mov    0x2e9a(%rip),%r14
mov    (%r14),%edi
lea    0xeb0(%rip),%rsi
lea    0xeb8(%rip),%rdx
mov    $0x5f,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xf74(%rip),%rsi
jmp    11aa <init_int8_t+0x8a>
cmp    $0xffffff7f,%eax
jg     11b8 <init_int8_t+0x98>
mov    0x2e60(%rip),%r14
mov    (%r14),%edi
lea    0xe76(%rip),%rsi
lea    0xe7e(%rip),%rdx
mov    $0x61,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xf62(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xffffffff,%eax
jmp    11c0 <init_int8_t+0xa0>
mov    %eax,(%r14)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"FATAL[%s:%d]: \00"
@.str.1 = [213 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0mark/linux-sunxi/refs/heads/2.6.34.15-mali19/drivers/amlogic/wifi/nano_c047_12/userspace/libnrx/autotest/testprogram.in.c\00"
@.str.2 = [40 x i8] c"Overflow: Number larger than 0x7F (%s)\0A\00"
@.str.3 = [42 x i8] c"Overflow: Number smaller than -0x80 (%s)\0A\00"
define i32 @init_int8_t(i32* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8**
%6 = alloca i32
store i32* %0, i32** %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = call i32 @init_int(i32* %6, i8** %7)
%9 = load i32, i32* %6
%10 = icmp sgt i32 %9, 127
br i1 %10, label %11, label %20
11: ; preds = %2
br label %12
12: ; preds = %11
%13 = load i32, i32* @stderr
%14 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0), i32 95)
%15 = load i32, i32* @stderr
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %17)
store i32 -1, i32* %3
br label %35
19: ; No predecessors!
br label %20
20: ; preds = %19, %2
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, -128
br i1 %22, label %23, label %32
23: ; preds = %20
br label %24
24: ; preds = %23
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0), i32 97)
%27 = load i32, i32* @stderr
%28 = load i8**, i8*** %5
%29 = load i8*, i8** %28
%30 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %27, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %29)
store i32 -1, i32* %3
br label %35
31: ; No predecessors!
br label %32
32: ; preds = %31, %20
%33 = load i32, i32* %6
%34 = load i32*, i32** %4
store i32 %33, i32* %34
store i32 1, i32* %3
br label %35
35: ; preds = %32, %24, %12
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"FATAL[%s:%d]: \00"
@.str.1 = [213 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/0mark/linux-sunxi/refs/heads/2.6.34.15-mali19/drivers/amlogic/wifi/nano_c047_12/userspace/libnrx/autotest/testprogram.in.c\00"
@.str.2 = [40 x i8] c"Overflow: Number larger than 0x7F (%s)\0A\00"
@.str.3 = [42 x i8] c"Overflow: Number smaller than -0x80 (%s)\0A\00"
define i32 @init_int8_t(i32* nocapture writeonly %0, i8** %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @init_int(i32* %3, i8** %1)
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 127
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0), i32 95)
%11 = load i32, i32* @stderr
%12 = load i8*, i8** %1
%13 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* %12)
br label %23
14: ; preds = %2
%15 = icmp slt i32 %6, -128
br i1 %15, label %16, label %22
16: ; preds = %14
%17 = load i32, i32* @stderr
%18 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([213 x i8], [213 x i8]* @.str.1, i64 0, i64 0), i32 97)
%19 = load i32, i32* @stderr
%20 = load i8*, i8** %1
%21 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %20)
br label %23
22: ; preds = %14
store i32 %6, i32* %0
br label %23
23: ; preds = %22, %16, %8
%24 = phi i32 [ -1, %8 ], [ -1, %16 ], [ 1, %22 ]
ret i32 %24
}