#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 */
typedef int uint8_t;

/* Variables and functions */
int imports_obj_verify(const uint8_t *buffer, int file_size) {
  int i;
  const uint8_t e_ident[] = {
      0x7f,
      0x45,
      0x4c,
      0x46,
  };
  for (i = 0; i < 4; i++) {
    if (buffer[i] != e_ident[i]) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<imports_obj_verify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    0xeee(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeeb(%rip),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jge    116a <imports_obj_verify+0x6a>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x18(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
je     1157 <imports_obj_verify+0x57>
movl   $0xffffffff,-0x4(%rbp)
jmp    1171 <imports_obj_verify+0x71>
jmp    115c <imports_obj_verify+0x5c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1128 <imports_obj_verify+0x28>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<imports_obj_verify>:
mov    $0xffffffff,%eax
cmpl   $0x7f,(%rdi)
jne    1121 <imports_obj_verify+0x21>
cmpl   $0x45,0x4(%rdi)
jne    1121 <imports_obj_verify+0x21>
cmpl   $0x4c,0x8(%rdi)
jne    1121 <imports_obj_verify+0x21>
xor    %eax,%eax
cmpl   $0x46,0xc(%rdi)
setne  %al
neg    %eax
ret

LLVM IR (-O0):
@__const.imports_obj_verify.e_ident = [4 x i32] [i32 127, i32 69, i32 76, i32 70]
define i32 @imports_obj_verify(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x i32]
store i32* %0, i32** %4
store i32 %1, i32* %5
%8 = bitcast [4 x i32]* %7 to i8*
store i32 0, i32* %6
br label %9
9: ; preds = %25, %2
%10 = load i32, i32* %6
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = load i32, i32* %6
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp ne i32 %17, %21
br i1 %22, label %23, label %24
23: ; preds = %12
store i32 -1, i32* %3
br label %29
24: ; preds = %12
br label %25
25: ; preds = %24
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %9
28: ; preds = %9
store i32 0, i32* %3
br label %29
29: ; preds = %28, %23
%30 = load i32, i32* %3
ret i32 %30
}

LLVM IR (-O2):
define i32 @imports_obj_verify(i32* nocapture %0, i32 %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 127
br i1 %4, label %5, label %18
5: ; preds = %2
%6 = getelementptr inbounds i32, i32* %0, i64 1
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 69
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 76
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = getelementptr inbounds i32, i32* %0, i64 3
%15 = load i32, i32* %14
%16 = icmp ne i32 %15, 70
%17 = sext i1 %16 to i32
br label %18
18: ; preds = %13, %9, %5, %2
%19 = phi i32 [ -1, %2 ], [ -1, %5 ], [ -1, %9 ], [ %17, %13 ]
ret i32 %19
}