#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*/ fread(unsigned char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int emptyBlocksWithData(int fatSize, int dataRegionStart, unsigned short *fat,
                        FILE *file) {
  int i, flag = 0;
  unsigned char *dataEntry;
  for (i = 3; i < fatSize; i++) {
    fseek(file, dataRegionStart + (i * 32), SEEK_SET);
    fread(dataEntry, 32, 1, file);
    if (dataEntry[0] == 229 && fat[i] != 0 && flag == 0) {
      printf("REMOVIDOS %d", i);
      flag = 1;
    } else if (dataEntry[0] == 229 && fat[i] != 0 && flag > 0) {
      printf(", %d", i);
    }
  }
  printf("\n");
  return 1;
}


x86 assembly (clang, -O0):
<emptyBlocksWithData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x3,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    123c <emptyBlocksWithData+0x10c>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%eax
shl    $0x5,%eax
add    %eax,%esi
mov    0x2e6a(%rip),%rax
mov    (%rax),%edx
call   1050 <fseek@plt>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x20,%esi
mov    $0x1,%edx
call   1030 <fread@plt>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xe5,%eax
jne    11e2 <emptyBlocksWithData+0xb2>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
je     11e2 <emptyBlocksWithData+0xb2>
cmpl   $0x0,-0x20(%rbp)
jne    11e2 <emptyBlocksWithData+0xb2>
mov    -0x1c(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x20(%rbp)
jmp    1229 <emptyBlocksWithData+0xf9>
mov    -0x28(%rbp),%rax
movzbl (%rax),%eax
cmp    $0xe5,%eax
jne    1224 <emptyBlocksWithData+0xf4>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzwl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
je     1224 <emptyBlocksWithData+0xf4>
cmpl   $0x0,-0x20(%rbp)
jle    1224 <emptyBlocksWithData+0xf4>
mov    -0x1c(%rbp),%esi
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1229 <emptyBlocksWithData+0xf9>
jmp    122e <emptyBlocksWithData+0xfe>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1154 <emptyBlocksWithData+0x24>
lea    0xdcf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyBlocksWithData>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
cmp    $0x4,%edi
jl     1177 <emptyBlocksWithData+0x47>
mov    %rcx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
add    $0x60,%ebp
add    $0xfffffffd,%ebx
mov    0x2e90(%rip),%r15
mov    (%r15),%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1050 <fseek@plt>
mov    $0x20,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1040 <fread@plt>
add    $0x20,%ebp
add    $0xffffffff,%ebx
jne    1150 <emptyBlocksWithData+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [13 x i8] c"REMOVIDOS %d\00"
@.str.1 = [5 x i8] c", %d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @emptyBlocksWithData(i32 %0, i32 %1, i16* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i16*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i16* %2, i16** %7
store i32* %3, i32** %8
store i32 0, i32* %10
store i32 3, i32* %9
br label %12
12: ; preds = %68, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %5
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %71
16: ; preds = %12
%17 = load i32*, i32** %8
%18 = load i32, i32* %6
%19 = load i32, i32* %9
%20 = mul nsw i32 %19, 32
%21 = add nsw i32 %18, %20
%22 = load i32, i32* @SEEK_SET
%23 = call i32 @fseek(i32* %17, i32 %21, i32 %22)
%24 = load i8*, i8** %11
%25 = load i32*, i32** %8
%26 = call i32 @fread(i8* %24, i32 32, i32 1, i32* %25)
%27 = load i8*, i8** %11
%28 = getelementptr inbounds i8, i8* %27, i64 0
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = icmp eq i32 %30, 229
br i1 %31, label %32, label %46
32: ; preds = %16
%33 = load i16*, i16** %7
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i16, i16* %33, i64 %35
%37 = load i16, i16* %36
%38 = zext i16 %37 to i32
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %46
40: ; preds = %32
%41 = load i32, i32* %10
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %46
43: ; preds = %40
%44 = load i32, i32* %9
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %44)
store i32 1, i32* %10
br label %67
46: ; preds = %40, %32, %16
%47 = load i8*, i8** %11
%48 = getelementptr inbounds i8, i8* %47, i64 0
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = icmp eq i32 %50, 229
br i1 %51, label %52, label %66
52: ; preds = %46
%53 = load i16*, i16** %7
%54 = load i32, i32* %9
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i16, i16* %53, i64 %55
%57 = load i16, i16* %56
%58 = zext i16 %57 to i32
%59 = icmp ne i32 %58, 0
br i1 %59, label %60, label %66
60: ; preds = %52
%61 = load i32, i32* %10
%62 = icmp sgt i32 %61, 0
br i1 %62, label %63, label %66
63: ; preds = %60
%64 = load i32, i32* %9
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %64)
br label %66
66: ; preds = %63, %60, %52, %46
br label %67
67: ; preds = %66, %43
br label %68
68: ; preds = %67
%69 = load i32, i32* %9
%70 = add nsw i32 %69, 1
store i32 %70, i32* %9
br label %12
71: ; preds = %12
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
define i32 @emptyBlocksWithData(i32 %0, i32 %1, i16* nocapture readnone %2, i32* nocapture %3) {
%5 = icmp sgt i32 %0, 3
br i1 %5, label %6, label %15
6: ; preds = %4, %6
%7 = phi i32 [ %13, %6 ], [ 3, %4 ]
%8 = shl nsw i32 %7, 5
%9 = add nsw i32 %8, %1
%10 = load i32, i32* @SEEK_SET
%11 = tail call i32 @fseek(i32* %3, i32 %9, i32 %10)
%12 = tail call i32 @fread(i8* undef, i32 32, i32 1, i32* %3)
%13 = add nuw nsw i32 %7, 1
%14 = icmp eq i32 %13, %0
br i1 %14, label %15, label %6
15: ; preds = %6, %4
%16 = tail call i32 @putchar(i32 10)
ret i32 1
}