#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*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void output_blocks(int nBlock, int *nB, FILE *f) {
  int i;
  fprintf(f, "\nBlocks:\n");
  for (i = 0; i < nBlock; i++) {
    fprintf(f, "%2d ", nB[i]);
    if ((i + 1) % 25 == 0)
      fprintf(f, "\n");
  }
  fprintf(f, "\n");
  fflush(f);
}


x86 assembly (clang, -O0):
<output_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11b1 <output_blocks+0x91>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe9c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119e <output_blocks+0x7e>
mov    -0x18(%rbp),%rdi
lea    0xe71(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11a3 <output_blocks+0x83>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114c <output_blocks+0x2c>
mov    -0x18(%rbp),%rdi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fflush@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_blocks>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r13
mov    %rsi,(%rsp)
mov    %edi,%ebp
lea    0xea5(%rip),%rdi
mov    $0x9,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   1060 <fwrite@plt>
test   %ebp,%ebp
jle    11d4 <output_blocks+0x94>
mov    %ebp,%r12d
mov    $0x1,%ebp
xor    %r15d,%r15d
jmp    1188 <output_blocks+0x48>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    %r15,%r12
je     11d4 <output_blocks+0x94>
mov    %r15,%rbx
mov    %ebp,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x23,%rax
lea    (%rax,%rax,4),%eax
lea    (%rax,%rax,4),%r14d
add    $0xffffffff,%r14d
mov    (%rsp),%rax
mov    (%rax,%r15,4),%edx
mov    %r13,%rdi
lea    0xe55(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r15
cmp    %ebx,%r14d
jne    1180 <output_blocks+0x40>
mov    $0xa,%edi
mov    %r13,%rsi
call   1030 <fputc@plt>
jmp    1180 <output_blocks+0x40>
mov    $0xa,%edi
mov    %r13,%rsi
call   1030 <fputc@plt>
mov    %r13,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fflush@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"\0ABlocks:\0A\00"
@.str.1 = [5 x i8] c"%2d \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @output_blocks(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 = load i32*, i32** %6
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %7
br label %10
10: ; preds = %30, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %33
14: ; preds = %10
%15 = load i32*, i32** %6
%16 = load i32*, i32** %5
%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 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 1
%24 = srem i32 %23, 25
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %29
26: ; preds = %14
%27 = load i32*, i32** %6
%28 = call i32 (i32*, i8*, ...) @fprintf(i32* %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %29
29: ; preds = %26, %14
br label %30
30: ; preds = %29
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %10
33: ; preds = %10
%34 = load i32*, i32** %6
%35 = call i32 (i32*, i8*, ...) @fprintf(i32* %34, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32*, i32** %6
%37 = call i32 @fflush(i32* %36)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"\0ABlocks:\0A\00"
@.str.1 = [5 x i8] c"%2d \00"
define void @output_blocks(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64 9, i64 1, i32* %2)
%5 = icmp sgt i32 %0, 0
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = zext i32 %0 to i64
br label %8
8: ; preds = %6, %19
%9 = phi i64 [ 0, %6 ], [ %13, %19 ]
%10 = getelementptr inbounds i32, i32* %1, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = trunc i64 %13 to i32
%15 = urem i32 %14, 25
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = tail call i32 @fputc(i32 10, i32* %2)
br label %19
19: ; preds = %8, %17
%20 = icmp eq i64 %13, %7
br i1 %20, label %21, label %8
21: ; preds = %19, %3
%22 = tail call i32 @fputc(i32 10, i32* %2)
%23 = tail call i32 @fflush(i32* %2)
ret void
}