#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 *, int, ...);
bool bad_limits(int begin, int end, int low, int high) {
  bool not_good = false;
  if (begin > end) {
    printf("%d isn't smaller than %d.\n", begin, end);
    not_good = true;
  }
  if (begin < low || end < low) {
    printf("Values must be %d or greater.\n", low);
    not_good = true;
  }
  if (begin > high || end > high) {
    printf("Values must be %d or less.\n", high);
    not_good = true;
  }
  return not_good;
}


x86 assembly (clang, -O0):
<bad_limits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1152 <bad_limits+0x42>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     116a <bad_limits+0x5a>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1182 <bad_limits+0x72>
mov    -0xc(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     119a <bad_limits+0x8a>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11b2 <bad_limits+0xa2>
mov    -0x10(%rbp),%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_limits>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
cmp    %esi,%edi
jle    113e <bad_limits+0x2e>
lea    0xed2(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
cmp    %r15d,%ebx
jl     1148 <bad_limits+0x38>
cmp    %r15d,%ebp
jge    115e <bad_limits+0x4e>
lea    0xecc(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
cmp    %r14d,%ebx
jg     1168 <bad_limits+0x58>
cmp    %r14d,%ebp
jle    117e <bad_limits+0x6e>
lea    0xecb(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [27 x i8] c"%d isn't smaller than %d.\0A\00"
@.str.1 = [31 x i8] c"Values must be %d or greater.\0A\00"
@.str.2 = [28 x i8] c"Values must be %d or less.\0A\00"
define i32 @bad_limits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = icmp sgt i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15)
store i32 1, i32* %9
br label %17
17: ; preds = %13, %4
%18 = load i32, i32* %5
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i32, i32* %6
%23 = load i32, i32* %7
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21, %17
%26 = load i32, i32* %7
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %26)
store i32 1, i32* %9
br label %28
28: ; preds = %25, %21
%29 = load i32, i32* %5
%30 = load i32, i32* %8
%31 = icmp sgt i32 %29, %30
br i1 %31, label %36, label %32
32: ; preds = %28
%33 = load i32, i32* %6
%34 = load i32, i32* %8
%35 = icmp sgt i32 %33, %34
br i1 %35, label %36, label %39
36: ; preds = %32, %28
%37 = load i32, i32* %8
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %37)
store i32 1, i32* %9
br label %39
39: ; preds = %36, %32
%40 = load i32, i32* %9
ret i32 %40
}

LLVM IR (-O2):
@.str = [27 x i8] c"%d isn't smaller than %d.\0A\00"
@.str.1 = [31 x i8] c"Values must be %d or greater.\0A\00"
@.str.2 = [28 x i8] c"Values must be %d or less.\0A\00"
define i32 @bad_limits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp sgt i32 %0, %1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1)
br label %8
8: ; preds = %6, %4
%9 = phi i32 [ 1, %6 ], [ 0, %4 ]
%10 = icmp slt i32 %0, %2
%11 = icmp slt i32 %1, %2
%12 = or i1 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i32 %2)
br label %15
15: ; preds = %8, %13
%16 = phi i32 [ 1, %13 ], [ %9, %8 ]
%17 = icmp sgt i32 %0, %3
%18 = icmp sgt i32 %1, %3
%19 = or i1 %17, %18
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), i32 %3)
br label %22
22: ; preds = %15, %20
%23 = phi i32 [ 1, %20 ], [ %16, %15 ]
ret i32 %23
}