#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*/ printf(char *, double const, double const, int, char *);
double setDoubleInbound(const double max, const double min, const double val,
                        const int option, const int isShowErr) {
  double tmp = val;
  if ((max < val) && ((option & 0x1) == 0)) {
    tmp = max;
    if (isShowErr == 1) {
      printf("Error in setDoubleInbound Val is greater than MAX : %f > %f , "
             "ln:%d, file:%s\n",
             val, max, 475,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/"
             "master/mProject/library_jui/dataStruct/src/basicVarArea.c");
    } else {
    }
  } else if ((min > val) && ((option & 0x2) == 0)) {
    tmp = min;
    if (isShowErr == 1) {
      printf("Error in setDoubleInbound Val is leaster than Min : %f < %f , "
             "ln:%d, file:%s\n",
             val, max, 487,
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/"
             "master/mProject/library_jui/dataStruct/src/basicVarArea.c");
    } else {
    }
  } else {
  }
  return tmp;
}


x86 assembly (clang, -O0):
<setDoubleInbound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    119f <setDoubleInbound+0x8f>
mov    -0x1c(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    119f <setDoubleInbound+0x8f>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    1195 <setDoubleInbound+0x85>
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
lea    0xe81(%rip),%rdi
mov    $0x1db,%esi
lea    0xec3(%rip),%rdx
call   1030 <printf@plt>
jmp    119a <setDoubleInbound+0x8a>
jmp    119a <setDoubleInbound+0x8a>
jmp    120d <setDoubleInbound+0xfd>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1203 <setDoubleInbound+0xf3>
mov    -0x1c(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
jne    1203 <setDoubleInbound+0xf3>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
cmpl   $0x1,-0x20(%rbp)
jne    11f9 <setDoubleInbound+0xe9>
movsd  -0x18(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm1
lea    0xf24(%rip),%rdi
mov    $0x1e7,%esi
lea    0xe5f(%rip),%rdx
call   1030 <printf@plt>
jmp    11fe <setDoubleInbound+0xee>
jmp    11fe <setDoubleInbound+0xee>
jmp    1208 <setDoubleInbound+0xf8>
jmp    1208 <setDoubleInbound+0xf8>
jmp    120d <setDoubleInbound+0xfd>
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setDoubleInbound>:
push   %rax
movapd %xmm1,%xmm3
movapd %xmm0,%xmm1
ucomisd %xmm0,%xmm2
jbe    114e <setDoubleInbound+0x3e>
mov    %edi,%eax
and    $0x1,%eax
jne    114e <setDoubleInbound+0x3e>
cmp    $0x1,%esi
jne    1190 <setDoubleInbound+0x80>
lea    0xece(%rip),%rdi
lea    0xf15(%rip),%rdx
movapd %xmm2,%xmm0
movsd  %xmm1,(%rsp)
movsd  (%rsp),%xmm1
mov    $0x1db,%esi
jmp    117a <setDoubleInbound+0x6a>
ucomisd %xmm2,%xmm3
jbe    1186 <setDoubleInbound+0x76>
and    $0x2,%edi
jne    1186 <setDoubleInbound+0x76>
cmp    $0x1,%esi
jne    118c <setDoubleInbound+0x7c>
lea    0xfa2(%rip),%rdi
lea    0xee2(%rip),%rdx
movapd %xmm2,%xmm0
mov    $0x1e7,%esi
movsd  %xmm3,(%rsp)
call   1030 <printf@plt>
movsd  (%rsp),%xmm1
jmp    1190 <setDoubleInbound+0x80>
movapd %xmm2,%xmm1
jmp    1190 <setDoubleInbound+0x80>
movapd %xmm3,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [78 x i8] c"Error in setDoubleInbound Val is greater than MAX : %f > %f , ln:%d, file:%s\0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/mProject/library_jui/dataStruct/src/basicVarArea.c\00"
@.str.2 = [78 x i8] c"Error in setDoubleInbound Val is leaster than Min : %f < %f , ln:%d, file:%s\0A\00"
define double @setDoubleInbound(double %0, double %1, double %2, i32 %3, i32 %4) {
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
store double %0, double* %6
store double %1, double* %7
store double %2, double* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load double, double* %8
store double %12, double* %11
%13 = load double, double* %6
%14 = load double, double* %8
%15 = fcmp olt double %13, %14
br i1 %15, label %16, label %30
16: ; preds = %5
%17 = load i32, i32* %9
%18 = and i32 %17, 1
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load double, double* %6
store double %21, double* %11
%22 = load i32, i32* %10
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %28
24: ; preds = %20
%25 = load double, double* %8
%26 = load double, double* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), double %25, double %26, i32 475, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %29
28: ; preds = %20
br label %29
29: ; preds = %28, %24
br label %50
30: ; preds = %16, %5
%31 = load double, double* %7
%32 = load double, double* %8
%33 = fcmp ogt double %31, %32
br i1 %33, label %34, label %48
34: ; preds = %30
%35 = load i32, i32* %9
%36 = and i32 %35, 2
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %48
38: ; preds = %34
%39 = load double, double* %7
store double %39, double* %11
%40 = load i32, i32* %10
%41 = icmp eq i32 %40, 1
br i1 %41, label %42, label %46
42: ; preds = %38
%43 = load double, double* %8
%44 = load double, double* %6
%45 = call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), double %43, double %44, i32 487, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %47
46: ; preds = %38
br label %47
47: ; preds = %46, %42
br label %49
48: ; preds = %34, %30
br label %49
49: ; preds = %48, %47
br label %50
50: ; preds = %49, %29
%51 = load double, double* %11
ret double %51
}

LLVM IR (-O2):
@.str = [78 x i8] c"Error in setDoubleInbound Val is greater than MAX : %f > %f , ln:%d, file:%s\0A\00"
@.str.1 = [185 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Chalearm/MachineLearning-/refs/heads/master/mProject/library_jui/dataStruct/src/basicVarArea.c\00"
@.str.2 = [78 x i8] c"Error in setDoubleInbound Val is leaster than Min : %f < %f , ln:%d, file:%s\0A\00"
define double @setDoubleInbound(double %0, double %1, double %2, i32 %3, i32 %4) {
%6 = fcmp olt double %0, %2
%7 = and i32 %3, 1
%8 = icmp eq i32 %7, 0
%9 = and i1 %6, %8
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = icmp eq i32 %4, 1
br i1 %11, label %12, label %23
12: ; preds = %10
%13 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0), double %2, double %0, i32 475, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %23
14: ; preds = %5
%15 = fcmp ogt double %1, %2
%16 = and i32 %3, 2
%17 = icmp eq i32 %16, 0
%18 = and i1 %15, %17
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = icmp eq i32 %4, 1
br i1 %20, label %21, label %23
21: ; preds = %19
%22 = tail call i32 @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str.2, i64 0, i64 0), double %2, double %0, i32 487, i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %19, %21, %14, %12, %10
%24 = phi double [ %0, %12 ], [ %0, %10 ], [ %1, %21 ], [ %1, %19 ], [ %2, %14 ]
ret double %24
}