#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*/ is_my_file(char const *);
long number_from_filename(char const *);
bool include_this_file(const char *filename, long start_at, long end_at,
                       long *number) {
  if (!is_my_file(filename))
    return false;
  *number = number_from_filename(filename);
  return start_at <= *number && *number <= end_at;
}


x86 assembly (clang, -O0):
<include_this_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <is_my_file@plt>
cmp    $0x0,%eax
jne    1156 <include_this_file+0x36>
movl   $0x0,-0x4(%rbp)
jmp    119b <include_this_file+0x7b>
mov    -0x10(%rbp),%rdi
call   1040 <number_from_filename@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x28(%rbp),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
mov    %al,-0x29(%rbp)
jg     1190 <include_this_file+0x70>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
setle  %al
mov    %al,-0x29(%rbp)
mov    -0x29(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<include_this_file>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%r12
mov    %rdi,%rbx
call   1030 <is_my_file@plt>
test   %eax,%eax
je     115b <include_this_file+0x3b>
mov    %rbx,%rdi
call   1040 <number_from_filename@plt>
mov    %rax,(%r15)
cmp    %r12,%rax
setge  %cl
cmp    %r14,%rax
setle  %al
and    %cl,%al
movzbl %al,%eax
jmp    115d <include_this_file+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @include_this_file(i8* %0, i64 %1, i64 %2, i64* nocapture writeonly %3) {
%5 = tail call i32 @is_my_file(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %13, label %7
7: ; preds = %4
%8 = tail call i64 @number_from_filename(i8* %0)
store i64 %8, i64* %3
%9 = icmp sge i64 %8, %1
%10 = icmp sle i64 %8, %2
%11 = and i1 %9, %10
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %4, %7
%14 = phi i32 [ %12, %7 ], [ 0, %4 ]
ret i32 %14
}