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


x86 assembly (clang, -O0):
<bad_limits>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    115a <bad_limits+0x4a>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jl     1176 <bad_limits+0x66>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jge    118f <bad_limits+0x7f>
mov    -0x18(%rbp),%rsi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x20(%rbp),%rax
jg     11ab <bad_limits+0x9b>
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jle    11c4 <bad_limits+0xb4>
mov    -0x20(%rbp),%rsi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bad_limits>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%r15
mov    %rdi,%rbx
xor    %eax,%eax
cmp    %rsi,%rdi
jle    1144 <bad_limits+0x34>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
cmp    %r12,%rbx
jl     114e <bad_limits+0x3e>
cmp    %r12,%r15
jge    1164 <bad_limits+0x54>
lea    0xec8(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
cmp    %r14,%rbx
jg     116e <bad_limits+0x5e>
cmp    %r14,%r15
jle    1184 <bad_limits+0x74>
lea    0xec8(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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