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

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void Test_checkInRange() {
  uint32_t num0, num1, num2, num3, num4;
  num0 = 0;
  num1 = 1;
  num2 = 2;
  num3 = 3;
  num4 = 4;
  if (((num2 <= num3) && (num2 > num1)) && !((num4 <= num3) && (num4 > num1)) &&
      !((num0 <= num3) && (num0 > num1))) {
    printf("checkInRangeA is working properly\n");
  } else {
    printf("ERROR checkInRangeA\n");
  }
  if (((num0 <= num1) || (num0 > num3)) && ((num4 <= num1) || (num4 > num3)) &&
      !((num2 <= num1) || (num2 > num3))) {
    printf("checkInRangeB is working properly\n");
  } else {
    printf("ERROR checkInRangeB\n");
  }
}


x86 assembly (clang, -O0):
<Test_checkInRange>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1194 <Test_checkInRange+0x84>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1194 <Test_checkInRange+0x84>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     116b <Test_checkInRange+0x5b>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1194 <Test_checkInRange+0x84>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1183 <Test_checkInRange+0x73>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1194 <Test_checkInRange+0x84>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    11a0 <Test_checkInRange+0x90>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11b8 <Test_checkInRange+0xa8>
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11f9 <Test_checkInRange+0xe9>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11d0 <Test_checkInRange+0xc0>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11f9 <Test_checkInRange+0xe9>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11f9 <Test_checkInRange+0xe9>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11f9 <Test_checkInRange+0xe9>
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
jmp    1205 <Test_checkInRange+0xf5>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Test_checkInRange>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"checkInRangeA is working properly\0A\00"
@.str.1 = [21 x i8] c"ERROR checkInRangeA\0A\00"
@.str.2 = [35 x i8] c"checkInRangeB is working properly\0A\00"
@.str.3 = [21 x i8] c"ERROR checkInRangeB\0A\00"
define void @Test_checkInRange() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store i32 3, i32* %4
store i32 4, i32* %5
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = icmp sle i32 %6, %7
br i1 %8, label %9, label %31
9: ; preds = %0
%10 = load i32, i32* %3
%11 = load i32, i32* %2
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %31
13: ; preds = %9
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load i32, i32* %5
%19 = load i32, i32* %2
%20 = icmp sgt i32 %18, %19
br i1 %20, label %31, label %21
21: ; preds = %17, %13
%22 = load i32, i32* %1
%23 = load i32, i32* %4
%24 = icmp sle i32 %22, %23
br i1 %24, label %25, label %29
25: ; preds = %21
%26 = load i32, i32* %1
%27 = load i32, i32* %2
%28 = icmp sgt i32 %26, %27
br i1 %28, label %31, label %29
29: ; preds = %25, %21
%30 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %33
31: ; preds = %25, %17, %9, %0
%32 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %33
33: ; preds = %31, %29
%34 = load i32, i32* %1
%35 = load i32, i32* %2
%36 = icmp sle i32 %34, %35
br i1 %36, label %41, label %37
37: ; preds = %33
%38 = load i32, i32* %1
%39 = load i32, i32* %4
%40 = icmp sgt i32 %38, %39
br i1 %40, label %41, label %59
41: ; preds = %37, %33
%42 = load i32, i32* %5
%43 = load i32, i32* %2
%44 = icmp sle i32 %42, %43
br i1 %44, label %49, label %45
45: ; preds = %41
%46 = load i32, i32* %5
%47 = load i32, i32* %4
%48 = icmp sgt i32 %46, %47
br i1 %48, label %49, label %59
49: ; preds = %45, %41
%50 = load i32, i32* %3
%51 = load i32, i32* %2
%52 = icmp sle i32 %50, %51
br i1 %52, label %59, label %53
53: ; preds = %49
%54 = load i32, i32* %3
%55 = load i32, i32* %4
%56 = icmp sgt i32 %54, %55
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
br label %61
59: ; preds = %53, %49, %45, %37
%60 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
br label %61
61: ; preds = %59, %57
ret void
}

LLVM IR (-O2):
@str = [34 x i8] c"checkInRangeA is working properly\00"
@str.4 = [34 x i8] c"checkInRangeB is working properly\00"
define void @Test_checkInRange() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
ret void
}