#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*/ assert(int);
int check_int(char *, int *);
int check_rint(char *text, int *number, int minVal, int maxVal) {
  int ret;
  assert(maxVal >= minVal);
  if ((ret = check_int(text, number))) {
    return ret;
  }
  if ((*number < minVal) || (*number > maxVal)) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_rint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <check_int@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
je     116d <check_rint+0x4d>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    119e <check_rint+0x7e>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jl     118b <check_rint+0x6b>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x20(%rbp),%eax
jle    1197 <check_rint+0x77>
movl   $0x1,-0x4(%rbp)
jmp    119e <check_rint+0x7e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_rint>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
xor    %edi,%edi
cmp    %edx,%ecx
setge  %dil
call   1040 <assert@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <check_int@plt>
test   %eax,%eax
jne    1162 <check_rint+0x42>
mov    (%rbx),%eax
cmp    %r15d,%eax
setl   %cl
cmp    %r14d,%eax
setg   %al
or     %cl,%al
movzbl %al,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @check_rint(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%11 = load i32, i32* %9
%12 = load i32, i32* %8
%13 = icmp sge i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i8*, i8** %6
%17 = load i32*, i32** %7
%18 = call i32 @check_int(i8* %16, i32* %17)
store i32 %18, i32* %10
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %4
%21 = load i32, i32* %10
store i32 %21, i32* %5
br label %34
22: ; preds = %4
%23 = load i32*, i32** %7
%24 = load i32, i32* %23
%25 = load i32, i32* %8
%26 = icmp slt i32 %24, %25
br i1 %26, label %32, label %27
27: ; preds = %22
%28 = load i32*, i32** %7
%29 = load i32, i32* %28
%30 = load i32, i32* %9
%31 = icmp sgt i32 %29, %30
br i1 %31, label %32, label %33
32: ; preds = %27, %22
store i32 1, i32* %5
br label %34
33: ; preds = %27
store i32 0, i32* %5
br label %34
34: ; preds = %33, %32, %20
%35 = load i32, i32* %5
ret i32 %35
}

LLVM IR (-O2):
define i32 @check_rint(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = icmp sge i32 %3, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = tail call i32 @check_int(i8* %0, i32* %1)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %4
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, %2
%13 = icmp sgt i32 %11, %3
%14 = or i1 %12, %13
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %10, %4
%17 = phi i32 [ %8, %4 ], [ %15, %10 ]
ret i32 %17
}