#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ offset_to_string(char *, int, int);
int /*<<< orphan*/ stderr;
size_t get_bytes_range(int offset_start, int offset_end) {
  if (offset_start < 0 || offset_start >= 256 || offset_end < offset_start ||
      offset_end >= 256) {
    char offset_str[30];
    offset_to_string(offset_str, offset_start, offset_end);
    fprintf(stderr,
            "Input error: "
            "Invalid offset %s"
            " - Operation Aborted!\n",
            offset_str);
    return 0;
  }
  return offset_end - offset_start + 1;
}


x86 assembly (clang, -O0):
<get_bytes_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jl     115e <get_bytes_range+0x3e>
cmpl   $0x100,-0xc(%rbp)
jge    115e <get_bytes_range+0x3e>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     115e <get_bytes_range+0x3e>
cmpl   $0x100,-0x10(%rbp)
jl     1193 <get_bytes_range+0x73>
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <offset_to_string@plt>
mov    0x2e6c(%rip),%rax
mov    (%rax),%edi
lea    -0x30(%rbp),%rdx
lea    0xe7f(%rip),%rsi
call   1040 <fprintf@plt>
movq   $0x0,-0x8(%rbp)
jmp    11a2 <get_bytes_range+0x82>
mov    -0x10(%rbp),%eax
sub    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bytes_range>:
mov    %esi,%edx
mov    %edi,%esi
cmp    $0xff,%edi
ja     1140 <get_bytes_range+0x20>
mov    %edx,%eax
sub    %esi,%eax
jl     1140 <get_bytes_range+0x20>
cmp    $0x100,%edx
jge    1140 <get_bytes_range+0x20>
add    $0x1,%eax
cltq
ret
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <offset_to_string@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    0xea0(%rip),%rsi
mov    %rbx,%rdx
call   1040 <fprintf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [53 x i8] c"Input error: Invalid offset %s - Operation Aborted!\0A\00"
define i64 @get_bytes_range(i32 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca [30 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 0
br i1 %8, label %19, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 256
br i1 %11, label %19, label %12
12: ; preds = %9
%13 = load i32, i32* %5
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = load i32, i32* %5
%18 = icmp sge i32 %17, 256
br i1 %18, label %19, label %27
19: ; preds = %16, %12, %9, %2
%20 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = call i32 @offset_to_string(i8* %20, i32 %21, i32 %22)
%24 = load i32, i32* @stderr
%25 = getelementptr inbounds [30 x i8], [30 x i8]* %6, i64 0, i64 0
%26 = call i32 @fprintf(i32 %24, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %25)
store i64 0, i64* %3
br label %33
27: ; preds = %16
%28 = load i32, i32* %5
%29 = load i32, i32* %4
%30 = sub nsw i32 %28, %29
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
store i64 %32, i64* %3
br label %33
33: ; preds = %27, %19
%34 = load i64, i64* %3
ret i64 %34
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [53 x i8] c"Input error: Invalid offset %s - Operation Aborted!\0A\00"
define i64 @get_bytes_range(i32 %0, i32 %1) {
%3 = alloca [30 x i8]
%4 = icmp ugt i32 %0, 255
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = icmp slt i32 %1, %0
%7 = icmp sgt i32 %1, 255
%8 = or i1 %6, %7
br i1 %8, label %9, label %14
9: ; preds = %5, %2
%10 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%11 = call i32 @offset_to_string(i8* %10, i32 %0, i32 %1)
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i8* %10)
br label %18
14: ; preds = %5
%15 = sub nsw i32 1, %0
%16 = add i32 %15, %1
%17 = sext i32 %16 to i64
br label %18
18: ; preds = %14, %9
%19 = phi i64 [ 0, %9 ], [ %17, %14 ]
ret i64 %19
}