#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 */
size_t sas_rle_measure_insert_run(unsigned char last_byte, size_t insert_run) {
  if (last_byte == '@' || last_byte == ' ' || last_byte == '\0') {
    if (insert_run > 17) {
      return 2;
    }
    return 1;
  }
  if (insert_run > 18) {
    return 3;
  }
  return 2;
}


x86 assembly (clang, -O0):
<sas_rle_measure_insert_run>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x9(%rbp)
mov    %rsi,-0x18(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0x40,%eax
je     1135 <sas_rle_measure_insert_run+0x35>
movzbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     1135 <sas_rle_measure_insert_run+0x35>
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
jne    115a <sas_rle_measure_insert_run+0x5a>
cmpq   $0x11,-0x18(%rbp)
jbe    114d <sas_rle_measure_insert_run+0x4d>
movq   $0x2,-0x8(%rbp)
jmp    117a <sas_rle_measure_insert_run+0x7a>
movq   $0x1,-0x8(%rbp)
jmp    117a <sas_rle_measure_insert_run+0x7a>
cmpq   $0x12,-0x18(%rbp)
jbe    1172 <sas_rle_measure_insert_run+0x72>
movq   $0x3,-0x8(%rbp)
jmp    117a <sas_rle_measure_insert_run+0x7a>
movq   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sas_rle_measure_insert_run>:
test   %edi,%edi
je     1110 <sas_rle_measure_insert_run+0x10>
cmp    $0x40,%dil
je     1110 <sas_rle_measure_insert_run+0x10>
cmp    $0x20,%dil
jne    111e <sas_rle_measure_insert_run+0x1e>
cmp    $0x12,%rsi
mov    $0x1,%eax
sbb    $0xffffffffffffffff,%rax
ret
xor    %eax,%eax
cmp    $0x13,%rsi
setae  %al
or     $0x2,%rax
ret

LLVM IR (-O0):
define i64 @sas_rle_measure_insert_run(i8 zeroext %0, i64 %1) {
%3 = alloca i64
%4 = alloca i8
%5 = alloca i64
store i8 %0, i8* %4
store i64 %1, i64* %5
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = icmp eq i32 %7, 64
br i1 %8, label %17, label %9
9: ; preds = %2
%10 = load i8, i8* %4
%11 = zext i8 %10 to i32
%12 = icmp eq i32 %11, 32
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %22
17: ; preds = %13, %9, %2
%18 = load i64, i64* %5
%19 = icmp ugt i64 %18, 17
br i1 %19, label %20, label %21
20: ; preds = %17
store i64 2, i64* %3
br label %27
21: ; preds = %17
store i64 1, i64* %3
br label %27
22: ; preds = %13
%23 = load i64, i64* %5
%24 = icmp ugt i64 %23, 18
br i1 %24, label %25, label %26
25: ; preds = %22
store i64 3, i64* %3
br label %27
26: ; preds = %22
store i64 2, i64* %3
br label %27
27: ; preds = %26, %25, %21, %20
%28 = load i64, i64* %3
ret i64 %28
}

LLVM IR (-O2):
define i64 @sas_rle_measure_insert_run(i8 zeroext %0, i64 %1) {
switch i8 %0, label %6 [
i8 64, label %3
i8 32, label %3
i8 0, label %3
]
3: ; preds = %2, %2, %2
%4 = icmp ugt i64 %1, 17
%5 = select i1 %4, i64 2, i64 1
br label %9
6: ; preds = %2
%7 = icmp ugt i64 %1, 18
%8 = select i1 %7, i64 3, i64 2
br label %9
9: ; preds = %6, %3
%10 = phi i64 [ %5, %3 ], [ %8, %6 ]
ret i64 %10
}