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

/* Variables and functions */
int CK_Cross_freadInt16LE(int **, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
bool processObjects(FILE *fp) {
  uint16_t objFields[38];
  int i, j;
  for (j = 0; j < 100; ++j) {
    if (CK_Cross_freadInt16LE(&objFields, 38, fp) != 38)
      return false;
    printf("Obj %02X:", j);
    for (i = 0; i < 38; ++i)
      printf(" %04X", objFields[i]);
    printf("\n");
  }
  return true;
}


x86 assembly (clang, -O0):
<processObjects>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0xb8(%rbp)
cmpl   $0x64,-0xb8(%rbp)
jge    11ed <processObjects+0xcd>
lea    -0xb0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x26,%esi
call   1040 <CK_Cross_freadInt16LE@plt>
cmp    $0x26,%eax
je     1170 <processObjects+0x50>
movl   $0x0,-0x4(%rbp)
jmp    11f4 <processObjects+0xd4>
mov    -0xb8(%rbp),%esi
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xb4(%rbp)
cmpl   $0x26,-0xb4(%rbp)
jge    11cb <processObjects+0xab>
movslq -0xb4(%rbp),%rax
mov    -0xb0(%rbp,%rax,4),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xb4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb4(%rbp)
jmp    118e <processObjects+0x6e>
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xb8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xb8(%rbp)
jmp    1139 <processObjects+0x19>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<processObjects>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %rdi,%r13
mov    %rsp,%r15
lea    0xeb2(%rip),%r12
lea    0xeb5(%rip),%rbx
xor    %ebp,%ebp
nopw   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    $0x26,%esi
mov    %r13,%rdx
call   1050 <CK_Cross_freadInt16LE@plt>
cmp    $0x26,%eax
jne    11c1 <processObjects+0x91>
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rsp,%r14,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    $0x26,%r14
jne    1190 <processObjects+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    $0x64,%ebp
jne    1160 <processObjects+0x30>
mov    $0x1,%eax
jmp    11c3 <processObjects+0x93>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Obj %02X:\00"
@.str.1 = [6 x i8] c" %04X\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @processObjects(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [38 x i32]
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 0, i32* %6
br label %7
7: ; preds = %33, %1
%8 = load i32, i32* %6
%9 = icmp slt i32 %8, 100
br i1 %9, label %10, label %36
10: ; preds = %7
%11 = bitcast [38 x i32]* %4 to i32**
%12 = load i32*, i32** %3
%13 = call i32 @CK_Cross_freadInt16LE(i32** %11, i32 38, i32* %12)
%14 = icmp ne i32 %13, 38
br i1 %14, label %15, label %16
15: ; preds = %10
store i32 0, i32* %2
br label %37
16: ; preds = %10
%17 = load i32, i32* %6
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %17)
store i32 0, i32* %5
br label %19
19: ; preds = %28, %16
%20 = load i32, i32* %5
%21 = icmp slt i32 %20, 38
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = load i32, i32* %5
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [38 x i32], [38 x i32]* %4, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %22
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %19
31: ; preds = %19
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %7
36: ; preds = %7
store i32 1, i32* %2
br label %37
37: ; preds = %36, %15
%38 = load i32, i32* %2
ret i32 %38
}

LLVM IR (-O2):
@.str = [10 x i8] c"Obj %02X:\00"
@.str.1 = [6 x i8] c" %04X\00"
define i32 @processObjects(i32* %0) {
%2 = alloca [38 x i32]
%3 = bitcast [38 x i32]* %2 to i8*
%4 = bitcast [38 x i32]* %2 to i32**
br label %5
5: ; preds = %1, %18
%6 = phi i32 [ 0, %1 ], [ %20, %18 ]
%7 = call i32 @CK_Cross_freadInt16LE(i32** %4, i32 38, i32* %0)
%8 = icmp eq i32 %7, 38
br i1 %8, label %9, label %22
9: ; preds = %5
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %16, %11 ]
%13 = getelementptr inbounds [38 x i32], [38 x i32]* %2, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, 38
br i1 %17, label %18, label %11
18: ; preds = %11
%19 = call i32 @putchar(i32 10)
%20 = add nuw nsw i32 %6, 1
%21 = icmp eq i32 %20, 100
br i1 %21, label %22, label %5
22: ; preds = %18, %5
%23 = phi i32 [ 0, %5 ], [ 1, %18 ]
ret i32 %23
}