#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 */
int isID(char const *, char, char, char, char);
int isForm(const void *data, char c1, char c2, char c3, char c4) {
  if (data && isID(data, 'F', 'O', 'R', 'M'))
    return isID((const char *)data + 8, c1, c2, c3, c4);
  else
    return 0;
}


x86 assembly (clang, -O0):
<isForm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %r8b,%al
mov    %rdi,-0x10(%rbp)
mov    %sil,-0x11(%rbp)
mov    %dl,-0x12(%rbp)
mov    %cl,-0x13(%rbp)
mov    %al,-0x14(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     118a <isForm+0x7a>
mov    -0x10(%rbp),%rdi
mov    $0x46,%esi
mov    $0x4f,%edx
mov    $0x52,%ecx
mov    $0x4d,%r8d
call   1030 <isID@plt>
cmp    $0x0,%eax
je     118a <isForm+0x7a>
mov    -0x10(%rbp),%rdi
add    $0x8,%rdi
mov    -0x11(%rbp),%dl
mov    -0x12(%rbp),%cl
mov    -0x13(%rbp),%al
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x14(%rbp),%r8d
call   1030 <isID@plt>
mov    %eax,-0x4(%rbp)
jmp    1191 <isForm+0x81>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isForm>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %rdi,%rdi
je     116d <isForm+0x5d>
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    $0x46,%esi
mov    $0x4f,%edx
mov    $0x52,%ecx
mov    $0x4d,%r8d
call   1030 <isID@plt>
test   %eax,%eax
je     116d <isForm+0x5d>
add    $0x8,%rbx
movsbl %bpl,%esi
movsbl %r12b,%edx
movsbl %r15b,%ecx
movsbl %r14b,%r8d
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <isID@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @isForm(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
store i8* %0, i8** %7
store i8 %1, i8* %8
store i8 %2, i8* %9
store i8 %3, i8* %10
store i8 %4, i8* %11
%12 = load i8*, i8** %7
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %26
14: ; preds = %5
%15 = load i8*, i8** %7
%16 = call i32 @isID(i8* %15, i8 signext 70, i8 signext 79, i8 signext 82, i8 signext 77)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load i8*, i8** %7
%20 = getelementptr inbounds i8, i8* %19, i64 8
%21 = load i8, i8* %8
%22 = load i8, i8* %9
%23 = load i8, i8* %10
%24 = load i8, i8* %11
%25 = call i32 @isID(i8* %20, i8 signext %21, i8 signext %22, i8 signext %23, i8 signext %24)
store i32 %25, i32* %6
br label %27
26: ; preds = %14, %5
store i32 0, i32* %6
br label %27
27: ; preds = %26, %18
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @isForm(i8* %0, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4) {
%6 = icmp eq i8* %0, null
br i1 %6, label %13, label %7
7: ; preds = %5
%8 = tail call i32 @isID(i8* %0, i8 signext 70, i8 signext 79, i8 signext 82, i8 signext 77)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %7
%11 = getelementptr inbounds i8, i8* %0, i64 8
%12 = tail call i32 @isID(i8* %11, i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4)
br label %13
13: ; preds = %5, %7, %10
%14 = phi i32 [ %12, %10 ], [ 0, %7 ], [ 0, %5 ]
ret i32 %14
}