#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ bzero(char *, int);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void GCMGetMakerCode(FILE *ifile, char *buf) {
  if (!ifile || !buf) {
    return;
  }
  fseek(ifile, 0x0000 + 0x0004, SEEK_SET);
  bzero(buf, 0x0002 + 1);
  if (fread(buf, 1, 0x0002, ifile) != 0x0002) {
    free(buf);
    return;
  }
}


x86 assembly (clang, -O0):
<GCMGetMakerCode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1166 <GCMGetMakerCode+0x26>
cmpq   $0x0,-0x10(%rbp)
jne    116b <GCMGetMakerCode+0x2b>
jmp    11b9 <GCMGetMakerCode+0x79>
mov    -0x8(%rbp),%rdi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   1050 <fseek@plt>
mov    -0x10(%rbp),%rdi
mov    $0x3,%esi
call   1060 <bzero@plt>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%esi
mov    $0x2,%edx
call   1040 <fread@plt>
cmp    $0x2,%eax
je     11b9 <GCMGetMakerCode+0x79>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GCMGetMakerCode>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     118e <GCMGetMakerCode+0x4e>
mov    %rsi,%r14
test   %rsi,%rsi
je     118e <GCMGetMakerCode+0x4e>
mov    %rdi,%rbx
mov    0x2e85(%rip),%rax
mov    (%rax),%edx
mov    $0x4,%esi
call   1050 <fseek@plt>
mov    %r14,%rdi
mov    $0x3,%esi
call   1060 <bzero@plt>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
mov    %rbx,%rcx
call   1040 <fread@plt>
cmp    $0x2,%eax
jne    1196 <GCMGetMakerCode+0x56>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
define void @GCMGetMakerCode(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = icmp ne i32* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = icmp ne i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %7, %2
br label %24
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* @SEEK_SET
%14 = call i32 @fseek(i32* %12, i32 4, i32 %13)
%15 = load i8*, i8** %4
%16 = call i32 @bzero(i8* %15, i32 3)
%17 = load i8*, i8** %4
%18 = load i32*, i32** %3
%19 = call i32 @fread(i8* %17, i32 1, i32 2, i32* %18)
%20 = icmp ne i32 %19, 2
br i1 %20, label %21, label %24
21: ; preds = %11
%22 = load i8*, i8** %4
%23 = call i32 @free(i8* %22)
br label %24
24: ; preds = %10, %21, %11
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define void @GCMGetMakerCode(i32* %0, i8* %1) {
%3 = icmp ne i32* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %14
6: ; preds = %2
%7 = load i32, i32* @SEEK_SET
%8 = tail call i32 @fseek(i32* %0, i32 4, i32 %7)
%9 = tail call i32 @bzero(i8* %1, i32 3)
%10 = tail call i32 @fread(i8* %1, i32 1, i32 2, i32* %0)
%11 = icmp eq i32 %10, 2
br i1 %11, label %14, label %12
12: ; preds = %6
%13 = tail call i32 @free(i8* %1)
br label %14
14: ; preds = %2, %12, %6
ret void
}