#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 */
typedef struct TYPE_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int member_0;
  int member_1;
  int member_2;
};
typedef TYPE_1__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ searchForBytes(TYPE_1__ const *, int, TYPE_1__ *, int, int);
int isProbablyE0(const uint8_t *image, uint32_t size) {
  uint8_t signature[8][3] = {{0x8D, 0xE0, 0x1F}, {0x8D, 0xE0, 0x5F},
                             {0x8D, 0xE9, 0xFF}, {0x0C, 0xE0, 0x1F},
                             {0xAD, 0xE0, 0x1F}, {0xAD, 0xE9, 0xFF},
                             {0xAD, 0xED, 0xFF}, {0xAD, 0xF3, 0xBF}};
  uint32_t i;
  for (i = 0; i < 8; ++i)
    if (searchForBytes(image, size, signature[i], 3, 1))
      return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isProbablyE0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x150,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
lea    -0x140(%rbp),%rdi
lea    0xec0(%rip),%rsi
mov    $0x120,%edx
call   1040 <memcpy@plt>
movl   $0x0,-0x144(%rbp)
cmpl   $0x8,-0x144(%rbp)
jge    11bc <isProbablyE0+0x9c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
movslq -0x144(%rbp),%rax
lea    -0x140(%rbp),%rdx
imul   $0x24,%rax,%rax
add    %rax,%rdx
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
cmp    $0x0,%rax
je     11a3 <isProbablyE0+0x83>
movl   $0x1,-0x4(%rbp)
jmp    11c3 <isProbablyE0+0xa3>
jmp    11a8 <isProbablyE0+0x88>
mov    -0x144(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x144(%rbp)
jmp    1154 <isProbablyE0+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x150,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isProbablyE0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x128,%rsp
mov    %esi,%r14d
mov    %rdi,%r15
lea    0xec6(%rip),%rsi
mov    %rsp,%rbx
mov    $0x120,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0x24(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0x48(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0x6c(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0x90(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0xb4(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0xd8(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    128b <isProbablyE0+0x16b>
lea    0xfc(%rsp),%rdx
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x3,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x128,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32, i32 }
@__const.isProbablyE0.signature = [8 x [3 x %struct.TYPE_5__]] [[3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 141, i32 224, i32 31 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 141, i32 224, i32 95 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 141, i32 233, i32 255 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 12, i32 224, i32 31 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 224, i32 31 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 233, i32 255 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 237, i32 255 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 243, i32 191 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer]]
define i32 @isProbablyE0(%struct.TYPE_5__* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca i32
%6 = alloca [8 x [3 x %struct.TYPE_5__]]
%7 = alloca i32
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i32 %1, i32* %5
%8 = bitcast [8 x [3 x %struct.TYPE_5__]]* %6 to i8*
store i32 0, i32* %7
br label %9
9: ; preds = %23, %2
%10 = load i32, i32* %7
%11 = icmp slt i32 %10, 8
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load %struct.TYPE_5__*, %struct.TYPE_5__** %4
%14 = load i32, i32* %5
%15 = load i32, i32* %7
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %6, i64 0, i64 %16
%18 = getelementptr inbounds [3 x %struct.TYPE_5__], [3 x %struct.TYPE_5__]* %17, i64 0, i64 0
%19 = call i64 @searchForBytes(%struct.TYPE_5__* %13, i32 %14, %struct.TYPE_5__* %18, i32 3, i32 1)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %12
store i32 1, i32* %3
br label %27
22: ; preds = %12
br label %23
23: ; preds = %22
%24 = load i32, i32* %7
%25 = add nsw i32 %24, 1
store i32 %25, i32* %7
br label %9
26: ; preds = %9
store i32 0, i32* %3
br label %27
27: ; preds = %26, %21
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32, i32 }
@__const.isProbablyE0.signature = [8 x [3 x %struct.TYPE_5__]] [[3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 141, i32 224, i32 31 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 141, i32 224, i32 95 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 141, i32 233, i32 255 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 12, i32 224, i32 31 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 224, i32 31 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 233, i32 255 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 237, i32 255 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [3 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 173, i32 243, i32 191 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer]]
define i32 @isProbablyE0(%struct.TYPE_5__* %0, i32 %1) {
%3 = alloca [8 x [3 x %struct.TYPE_5__]]
%4 = bitcast [8 x [3 x %struct.TYPE_5__]]* %3 to i8*
%5 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 0, i64 0
%6 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %5, i32 3, i32 1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %37
8: ; preds = %2
%9 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 1, i64 0
%10 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %9, i32 3, i32 1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %37
12: ; preds = %8
%13 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 2, i64 0
%14 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %13, i32 3, i32 1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %37
16: ; preds = %12
%17 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 3, i64 0
%18 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %17, i32 3, i32 1)
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %37
20: ; preds = %16
%21 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 4, i64 0
%22 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %21, i32 3, i32 1)
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %37
24: ; preds = %20
%25 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 5, i64 0
%26 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %25, i32 3, i32 1)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %37
28: ; preds = %24
%29 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 6, i64 0
%30 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %29, i32 3, i32 1)
%31 = icmp eq i64 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %28
%33 = getelementptr inbounds [8 x [3 x %struct.TYPE_5__]], [8 x [3 x %struct.TYPE_5__]]* %3, i64 0, i64 7, i64 0
%34 = call i64 @searchForBytes(%struct.TYPE_5__* %0, i32 %1, %struct.TYPE_5__* %33, i32 3, i32 1)
%35 = icmp ne i64 %34, 0
%36 = zext i1 %35 to i32
br label %37
37: ; preds = %32, %28, %24, %20, %16, %12, %8, %2
%38 = phi i32 [ 1, %2 ], [ 1, %8 ], [ 1, %12 ], [ 1, %16 ], [ 1, %20 ], [ 1, %24 ], [ 1, %28 ], [ %36, %32 ]
ret i32 %38
}