#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*/ fail(int, char *, unsigned int, char *, char const *, int);
int /*<<< orphan*/ fgs_check_handle(int, char const *, unsigned int);
void fgs_check_parms(signed int handle, signed int dom, signed int op,
                     const char *func, unsigned line) {
  if (dom < 1 || dom > 3)
    fail(1,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/michel2323/omp_amg/refs/heads/master/gs.c",
         line, "%s: datatype %d not in valid range 1-3", func, dom);
  if (op < 1 || op > 4)
    fail(1,
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/michel2323/omp_amg/refs/heads/master/gs.c",
         line, "%s: op %d not in valid range 1-4", func, op);
  fgs_check_handle(handle, func, line);
}


x86 assembly (clang, -O0):
<fgs_check_parms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
cmpl   $0x1,-0x8(%rbp)
jl     114d <fgs_check_parms+0x2d>
cmpl   $0x3,-0x8(%rbp)
jle    1170 <fgs_check_parms+0x50>
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0x8(%rbp),%r9d
mov    $0x1,%edi
lea    0xe9c(%rip),%rsi
lea    0xf19(%rip),%rcx
call   1030 <fail@plt>
cmpl   $0x1,-0xc(%rbp)
jl     1184 <fgs_check_parms+0x64>
cmpl   $0x4,-0xc(%rbp)
jle    11a7 <fgs_check_parms+0x87>
mov    -0x1c(%rbp),%edx
mov    -0x18(%rbp),%r8
mov    -0xc(%rbp),%r9d
mov    $0x1,%edi
lea    0xe65(%rip),%rsi
lea    0xf09(%rip),%rcx
call   1030 <fail@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <fgs_check_handle@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fgs_check_parms>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %r8d,%ebp
mov    %rcx,%rbx
mov    %edx,%r15d
mov    %esi,%r9d
mov    %edi,%r14d
lea    -0x4(%r9),%eax
cmp    $0xfffffffc,%eax
ja     115c <fgs_check_parms+0x3c>
lea    0xeba(%rip),%rsi
lea    0xf37(%rip),%rcx
mov    $0x1,%edi
mov    %ebp,%edx
mov    %rbx,%r8
call   1030 <fail@plt>
lea    -0x5(%r15),%eax
cmp    $0xfffffffb,%eax
ja     1185 <fgs_check_parms+0x65>
lea    0xe94(%rip),%rsi
lea    0xf38(%rip),%rcx
mov    $0x1,%edi
mov    %ebp,%edx
mov    %rbx,%r8
mov    %r15d,%r9d
call   1030 <fail@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fgs_check_handle@plt>

LLVM IR (-O0):
@.str = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/michel2323/omp_amg/refs/heads/master/gs.c\00"
@.str.1 = [39 x i8] c"%s: datatype %d not in valid range 1-3\00"
@.str.2 = [33 x i8] c"%s: op %d not in valid range 1-4\00"
define void @fgs_check_parms(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%11 = load i32, i32* %7
%12 = icmp slt i32 %11, 1
br i1 %12, label %16, label %13
13: ; preds = %5
%14 = load i32, i32* %7
%15 = icmp sgt i32 %14, 3
br i1 %15, label %16, label %21
16: ; preds = %13, %5
%17 = load i32, i32* %10
%18 = load i8*, i8** %9
%19 = load i32, i32* %7
%20 = call i32 @fail(i32 1, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %19)
br label %21
21: ; preds = %16, %13
%22 = load i32, i32* %8
%23 = icmp slt i32 %22, 1
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = load i32, i32* %8
%26 = icmp sgt i32 %25, 4
br i1 %26, label %27, label %32
27: ; preds = %24, %21
%28 = load i32, i32* %10
%29 = load i8*, i8** %9
%30 = load i32, i32* %8
%31 = call i32 @fail(i32 1, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 %28, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %29, i32 %30)
br label %32
32: ; preds = %27, %24
%33 = load i32, i32* %6
%34 = load i8*, i8** %9
%35 = load i32, i32* %10
%36 = call i32 @fgs_check_handle(i32 %33, i8* %34, i32 %35)
ret void
}

LLVM IR (-O2):
@.str = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/michel2323/omp_amg/refs/heads/master/gs.c\00"
@.str.1 = [39 x i8] c"%s: datatype %d not in valid range 1-3\00"
@.str.2 = [33 x i8] c"%s: op %d not in valid range 1-4\00"
define void @fgs_check_parms(i32 %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = add i32 %1, -4
%7 = icmp ult i32 %6, -3
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @fail(i32 1, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i8* %3, i32 %1)
br label %10
10: ; preds = %5, %8
%11 = add i32 %2, -5
%12 = icmp ult i32 %11, -4
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @fail(i32 1, i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i8* %3, i32 %2)
br label %15
15: ; preds = %10, %13
%16 = tail call i32 @fgs_check_handle(i32 %0, i8* %3, i32 %4)
ret void
}