#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 /*<<< orphan*/ printf(char *, ...);
void fat_dumpClusterChain(unsigned int *buf, int maxBuf, int clusterSkip) {
  int i;
  printf("cluster chain:");
  for (i = 0 + clusterSkip; i < maxBuf; i++) {
    printf(" %i,", buf[i]);
  }
  printf(" end  (skip=%d, maxBuf=%d arrayLimit=%d) \n", clusterSkip, maxBuf,
         512);
}


x86 assembly (clang, -O0):
<fat_dumpClusterChain>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x0,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    116c <fat_dumpClusterChain+0x5c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <fat_dumpClusterChain+0x29>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe9b(%rip),%rdi
mov    $0x200,%ecx
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fat_dumpClusterChain>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cmp    %r14d,%r15d
jge    1167 <fat_dumpClusterChain+0x57>
movslq %r15d,%rax
lea    (%rbx,%rax,4),%r13
mov    %r14d,%ebx
sub    %r15d,%ebx
lea    0xec4(%rip),%r12
xor    %ebp,%ebp
nopl   (%rax)
mov    0x0(%r13,%rbp,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%rbp
cmp    %ebp,%ebx
jne    1150 <fat_dumpClusterChain+0x40>
lea    0xea6(%rip),%rdi
mov    %r15d,%esi
mov    %r14d,%edx
mov    $0x200,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"cluster chain:\00"
@.str.1 = [5 x i8] c" %i,\00"
@.str.2 = [43 x i8] c" end (skip=%d, maxBuf=%d arrayLimit=%d) \0A\00"
define void @fat_dumpClusterChain(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %6
%10 = add nsw i32 0, %9
store i32 %10, i32* %7
br label %11
11: ; preds = %22, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %5
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %11
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = load i32, i32* %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %7
%24 = add nsw i32 %23, 1
store i32 %24, i32* %7
br label %11
25: ; preds = %11
%26 = load i32, i32* %6
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %26, i32 %27, i32 512)
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"cluster chain:\00"
@.str.1 = [5 x i8] c" %i,\00"
@.str.2 = [43 x i8] c" end (skip=%d, maxBuf=%d arrayLimit=%d) \0A\00"
define void @fat_dumpClusterChain(i32* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = icmp slt i32 %2, %1
br i1 %5, label %6, label %16
6: ; preds = %3
%7 = sext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ %7, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nsw i64 %9, 1
%14 = trunc i64 %13 to i32
%15 = icmp eq i32 %14, %1
br i1 %15, label %16, label %8
16: ; preds = %8, %3
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %2, i32 %1, i32 512)
ret void
}