#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;
  int member_3;
  int member_4;
};
typedef TYPE_1__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
scalar_t__ searchForBytes(TYPE_1__ const *, int, TYPE_1__ *, int, int);
int isProbablyFE(const uint8_t *image, uint32_t size) {
  uint8_t signature[4][5] = {{0x20, 0x00, 0xD0, 0xC6, 0xC5},
                             {0x20, 0xC3, 0xF8, 0xA5, 0x82},
                             {0xD0, 0xFB, 0x20, 0x73, 0xFE},
                             {0x20, 0x00, 0xF0, 0x84, 0xD6}};
  uint32_t i;
  for (i = 0; i < 4; ++i)
    if (searchForBytes(image, size, signature[i], 5, 1))
      return 1;
  return 0;
}


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

x86 assembly (clang, -O2):
<isProbablyFE>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x198,%rsp
mov    %esi,%r14d
mov    %rdi,%r15
lea    0xec6(%rip),%rsi
mov    %rsp,%rbx
mov    $0x190,%edx
mov    %rbx,%rdi
call   1040 <memcpy@plt>
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    $0x5,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    11e1 <isProbablyFE+0xc1>
lea    0x64(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x5,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    11e1 <isProbablyFE+0xc1>
lea    0xc8(%rsp),%rdx
mov    $0x1,%ebp
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x5,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
test   %rax,%rax
jne    11e1 <isProbablyFE+0xc1>
lea    0x12c(%rsp),%rdx
mov    %r15,%rdi
mov    %r14d,%esi
mov    $0x5,%ecx
mov    $0x1,%r8d
call   1030 <searchForBytes@plt>
xor    %ebp,%ebp
test   %rax,%rax
setne  %bpl
mov    %ebp,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32, i32, i32, i32 }
@__const.isProbablyFE.signature = [4 x [5 x %struct.TYPE_5__]] [[5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 32, i32 0, i32 208, i32 198, i32 197 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 32, i32 195, i32 248, i32 165, i32 130 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 208, i32 251, i32 32, i32 115, i32 254 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 32, i32 0, i32 240, i32 132, i32 214 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer]]
define i32 @isProbablyFE(%struct.TYPE_5__* %0, i32 %1) {
%3 = alloca i32
%4 = alloca %struct.TYPE_5__*
%5 = alloca i32
%6 = alloca [4 x [5 x %struct.TYPE_5__]]
%7 = alloca i32
store %struct.TYPE_5__* %0, %struct.TYPE_5__** %4
store i32 %1, i32* %5
%8 = bitcast [4 x [5 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, 4
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 [4 x [5 x %struct.TYPE_5__]], [4 x [5 x %struct.TYPE_5__]]* %6, i64 0, i64 %16
%18 = getelementptr inbounds [5 x %struct.TYPE_5__], [5 x %struct.TYPE_5__]* %17, i64 0, i64 0
%19 = call i64 @searchForBytes(%struct.TYPE_5__* %13, i32 %14, %struct.TYPE_5__* %18, i32 5, 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, i32, i32 }
@__const.isProbablyFE.signature = [4 x [5 x %struct.TYPE_5__]] [[5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 32, i32 0, i32 208, i32 198, i32 197 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 32, i32 195, i32 248, i32 165, i32 130 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 208, i32 251, i32 32, i32 115, i32 254 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer], [5 x %struct.TYPE_5__] [%struct.TYPE_5__ { i32 32, i32 0, i32 240, i32 132, i32 214 }, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer, %struct.TYPE_5__ zeroinitializer]]
define i32 @isProbablyFE(%struct.TYPE_5__* %0, i32 %1) {
%3 = alloca [4 x [5 x %struct.TYPE_5__]]
%4 = bitcast [4 x [5 x %struct.TYPE_5__]]* %3 to i8*
%5 = getelementptr inbounds [4 x [5 x %struct.TYPE_5__]], [4 x [5 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 5, i32 1)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %21
8: ; preds = %2
%9 = getelementptr inbounds [4 x [5 x %struct.TYPE_5__]], [4 x [5 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 5, i32 1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = getelementptr inbounds [4 x [5 x %struct.TYPE_5__]], [4 x [5 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 5, i32 1)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = getelementptr inbounds [4 x [5 x %struct.TYPE_5__]], [4 x [5 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 5, i32 1)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %16, %12, %8, %2
%22 = phi i32 [ 1, %2 ], [ 1, %8 ], [ 1, %12 ], [ %20, %16 ]
ret i32 %22
}