#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*/ iAfterCh(char *, int *, char);
int /*<<< orphan*/ printf(char *, char, ...);
int iParseEqual(char *s, int *n, int lo, int hi) {
  if (!iAfterCh(s, n, '=')) {
    printf("Error: expects '-%c=' followed by an integer\n", s[1]);
    return 0;
  } else if (*n < lo || *n > hi) {
    printf("-%c= must be in range %d to %d\n", s[1], lo, hi);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<iParseEqual>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x3d,%edx
call   1040 <iAfterCh@plt>
cmp    $0x0,%eax
jne    1173 <iParseEqual+0x53>
mov    -0x10(%rbp),%rax
lea    0xea4(%rip),%rdi
movsbl 0x1(%rax),%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c7 <iParseEqual+0xa7>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x1c(%rbp),%eax
jl     1191 <iParseEqual+0x71>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
cmp    -0x20(%rbp),%eax
jle    11bb <iParseEqual+0x9b>
mov    -0x10(%rbp),%rax
mov    0x1(%rax),%al
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe89(%rip),%rdi
movsbl %al,%esi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11c7 <iParseEqual+0xa7>
jmp    11c0 <iParseEqual+0xa0>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iParseEqual>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    $0x3d,%edx
call   1040 <iAfterCh@plt>
test   %eax,%eax
je     116e <iParseEqual+0x4e>
mov    (%rbx),%eax
cmp    %r15d,%eax
jl     1152 <iParseEqual+0x32>
mov    $0x1,%ebx
cmp    %r14d,%eax
jle    1182 <iParseEqual+0x62>
movsbl 0x1(%rbp),%esi
lea    0xed1(%rip),%rdi
xor    %ebx,%ebx
mov    %r15d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1182 <iParseEqual+0x62>
movsbl 0x1(%rbp),%esi
lea    0xe87(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Error: expects '-%c=' followed by an integer\0A\00"
@.str.1 = [32 x i8] c"-%c= must be in range %d to %d\0A\00"
define i32 @iParseEqual(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32*
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %6
store i32* %1, i32** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
%10 = load i8*, i8** %6
%11 = load i32*, i32** %7
%12 = call i32 @iAfterCh(i8* %10, i32* %11, i8 signext 61)
%13 = icmp ne i32 %12, 0
br i1 %13, label %19, label %14
14: ; preds = %4
%15 = load i8*, i8** %6
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
%18 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 signext %17)
store i32 0, i32* %5
br label %38
19: ; preds = %4
%20 = load i32*, i32** %7
%21 = load i32, i32* %20
%22 = load i32, i32* %8
%23 = icmp slt i32 %21, %22
br i1 %23, label %29, label %24
24: ; preds = %19
%25 = load i32*, i32** %7
%26 = load i32, i32* %25
%27 = load i32, i32* %9
%28 = icmp sgt i32 %26, %27
br i1 %28, label %29, label %36
29: ; preds = %24, %19
%30 = load i8*, i8** %6
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 signext %32, i32 %33, i32 %34)
store i32 0, i32* %5
br label %38
36: ; preds = %24
br label %37
37: ; preds = %36
store i32 1, i32* %5
br label %38
38: ; preds = %37, %29, %14
%39 = load i32, i32* %5
ret i32 %39
}

LLVM IR (-O2):
@.str = [46 x i8] c"Error: expects '-%c=' followed by an integer\0A\00"
@.str.1 = [32 x i8] c"-%c= must be in range %d to %d\0A\00"
define i32 @iParseEqual(i8* %0, i32* %1, i32 %2, i32 %3) {
%5 = tail call i32 @iAfterCh(i8* %0, i32* %1, i8 signext 61)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8 signext %9)
br label %20
11: ; preds = %4
%12 = load i32, i32* %1
%13 = icmp slt i32 %12, %2
%14 = icmp sgt i32 %12, %3
%15 = or i1 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %11
%17 = getelementptr inbounds i8, i8* %0, i64 1
%18 = load i8, i8* %17
%19 = tail call i32 (i8*, i8, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8 signext %18, i32 %2, i32 %3)
br label %20
20: ; preds = %11, %16, %7
%21 = phi i32 [ 0, %16 ], [ 0, %7 ], [ 1, %11 ]
ret i32 %21
}