#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 */
long INT_MAX;
long INT_MIN;
scalar_t__ isLongCL(char *, int);
long strtol(char *, char **, int /*<<< orphan*/);
int isIntCL(char *input, int isVerbose) {
  if (isLongCL(input, isVerbose)) {
    char *end;
    long number = strtol(input, &end, 0);
    return INT_MIN <= number && number <= INT_MAX;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<isIntCL>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1040 <isLongCL@plt>
cmp    $0x0,%rax
je     1195 <isIntCL+0x75>
mov    -0x10(%rbp),%rdi
lea    -0x20(%rbp),%rsi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    %rax,-0x28(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%rcx
xor    %eax,%eax
cmp    -0x28(%rbp),%rcx
mov    %al,-0x29(%rbp)
jg     1185 <isIntCL+0x65>
mov    -0x28(%rbp),%rax
mov    0x2e6c(%rip),%rcx
cmp    (%rcx),%rax
setle  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    119c <isIntCL+0x7c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isIntCL>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <isLongCL@plt>
test   %rax,%rax
je     1162 <isIntCL+0x42>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %edx,%edx
call   1030 <strtol@plt>
mov    0x2e98(%rip),%rcx
cmp    %rax,(%rcx)
setle  %cl
mov    0x2e93(%rip),%rdx
cmp    (%rdx),%rax
setle  %al
and    %cl,%al
movzbl %al,%eax
jmp    1164 <isIntCL+0x44>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
@INT_MAX = global i64 0
define i32 @isIntCL(i8* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = call i64 @isLongCL(i8* %8, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %25
12: ; preds = %2
%13 = load i8*, i8** %4
%14 = call i64 @strtol(i8* %13, i8** %6, i32 0)
store i64 %14, i64* %7
%15 = load i64, i64* @INT_MIN
%16 = load i64, i64* %7
%17 = icmp sle i64 %15, %16
br i1 %17, label %18, label %22
18: ; preds = %12
%19 = load i64, i64* %7
%20 = load i64, i64* @INT_MAX
%21 = icmp sle i64 %19, %20
br label %22
22: ; preds = %18, %12
%23 = phi i1 [ false, %12 ], [ %21, %18 ]
%24 = zext i1 %23 to i32
store i32 %24, i32* %3
br label %26
25: ; preds = %2
store i32 0, i32* %3
br label %26
26: ; preds = %25, %22
%27 = load i32, i32* %3
ret i32 %27
}

LLVM IR (-O2):
@INT_MIN = global i64 0
@INT_MAX = global i64 0
define i32 @isIntCL(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = tail call i64 @isLongCL(i8* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %15, label %6
6: ; preds = %2
%7 = bitcast i8** %3 to i8*
%8 = call i64 @strtol(i8* %0, i8** %3, i32 0)
%9 = load i64, i64* @INT_MIN
%10 = icmp sle i64 %9, %8
%11 = load i64, i64* @INT_MAX
%12 = icmp sle i64 %8, %11
%13 = select i1 %10, i1 %12, i1 false
%14 = zext i1 %13 to i32
br label %15
15: ; preds = %2, %6
%16 = phi i32 [ %14, %6 ], [ 0, %2 ]
ret i32 %16
}