#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*/ assert(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
void dump_array(int v[], int size) {
  const int blocksize = 32;
  int i, blockno;
  assert((size % blocksize) == 0);
  for (blockno = 0; blockno < size / blocksize; blockno++) {
    printf("[pos]  ");
    for (i = 0; i < blocksize; i++) {
      printf("%4d ", i + blocksize * blockno);
    }
    putchar('\n');
    printf("[elem] ");
    for (i = 0; i < blocksize; i++) {
      printf("%4d ", v[i + blocksize * blockno]);
    }
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<dump_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x20,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
cmp    %ecx,%eax
jge    123e <dump_array+0x10e>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    11cc <dump_array+0x9c>
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%eax
shl    $0x5,%eax
add    %eax,%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119b <dump_array+0x6b>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1226 <dump_array+0xf6>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%edx
shl    $0x5,%edx
add    %edx,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11eb <dump_array+0xbb>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <dump_array+0x38>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
xor    %edi,%edi
test   $0x1f,%r14b
sete   %dil
call   1050 <assert@plt>
cmp    $0x20,%r14d
jl     1372 <dump_array+0x242>
shr    $0x5,%r14d
lea    0xea3(%rip),%r12
lea    0xea1(%rip),%r13
xor    %r15d,%r15d
nop
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15d,%ebp
shl    $0x5,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x2(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x3(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x5(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x6(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x7(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x9(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xa(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xb(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x10(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x11(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x12(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x13(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x15(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x16(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x17(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x19(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1a(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1b(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1d(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1e(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
or     $0x1f,%ebp
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rbp,4),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    $0x20,%rbp
jne    1340 <dump_array+0x210>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
sub    $0xffffffffffffff80,%rbx
cmp    %r14,%r15
jne    1170 <dump_array+0x40>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"[pos] \00"
@.str.1 = [5 x i8] c"%4d \00"
@.str.2 = [8 x i8] c"[elem] \00"
define void @dump_array(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 32, i32* %5
%8 = load i32, i32* %4
%9 = srem i32 %8, 32
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
store i32 0, i32* %7
br label %13
13: ; preds = %53, %2
%14 = load i32, i32* %7
%15 = load i32, i32* %4
%16 = sdiv i32 %15, 32
%17 = icmp slt i32 %14, %16
br i1 %17, label %18, label %56
18: ; preds = %13
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %6
br label %20
20: ; preds = %29, %18
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 32
br i1 %22, label %23, label %32
23: ; preds = %20
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = mul nsw i32 32, %25
%27 = add nsw i32 %24, %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %23
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
br label %20
32: ; preds = %20
%33 = call i32 @putchar(i8 signext 10)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %35
35: ; preds = %48, %32
%36 = load i32, i32* %6
%37 = icmp slt i32 %36, 32
br i1 %37, label %38, label %51
38: ; preds = %35
%39 = load i32*, i32** %3
%40 = load i32, i32* %6
%41 = load i32, i32* %7
%42 = mul nsw i32 32, %41
%43 = add nsw i32 %40, %42
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32, i32* %39, i64 %44
%46 = load i32, i32* %45
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %38
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %35
51: ; preds = %35
%52 = call i32 @putchar(i8 signext 10)
br label %53
53: ; preds = %51
%54 = load i32, i32* %7
%55 = add nsw i32 %54, 1
store i32 %55, i32* %7
br label %13
56: ; preds = %13
%57 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"[pos] \00"
@.str.1 = [5 x i8] c"%4d \00"
@.str.2 = [8 x i8] c"[elem] \00"
define void @dump_array(i32* nocapture %0, i32 %1) {
%3 = and i32 %1, 31
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp sgt i32 %1, 31
br i1 %7, label %8, label %124
8: ; preds = %2
%9 = lshr i32 %1, 5
%10 = zext i32 %9 to i64
br label %11
11: ; preds = %8, %120
%12 = phi i64 [ 0, %8 ], [ %122, %120 ]
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = shl nsw i64 %12, 5
%15 = trunc i64 %14 to i32
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = trunc i64 %14 to i32
%18 = or i32 %17, 1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = trunc i64 %14 to i32
%21 = or i32 %20, 2
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %21)
%23 = trunc i64 %14 to i32
%24 = or i32 %23, 3
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = trunc i64 %14 to i32
%27 = or i32 %26, 4
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %27)
%29 = trunc i64 %14 to i32
%30 = or i32 %29, 5
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %30)
%32 = trunc i64 %14 to i32
%33 = or i32 %32, 6
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %33)
%35 = trunc i64 %14 to i32
%36 = or i32 %35, 7
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = trunc i64 %14 to i32
%39 = or i32 %38, 8
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %39)
%41 = trunc i64 %14 to i32
%42 = or i32 %41, 9
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = trunc i64 %14 to i32
%45 = or i32 %44, 10
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = trunc i64 %14 to i32
%48 = or i32 %47, 11
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = trunc i64 %14 to i32
%51 = or i32 %50, 12
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %51)
%53 = trunc i64 %14 to i32
%54 = or i32 %53, 13
%55 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %54)
%56 = trunc i64 %14 to i32
%57 = or i32 %56, 14
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %57)
%59 = trunc i64 %14 to i32
%60 = or i32 %59, 15
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %60)
%62 = trunc i64 %14 to i32
%63 = or i32 %62, 16
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %63)
%65 = trunc i64 %14 to i32
%66 = or i32 %65, 17
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %66)
%68 = trunc i64 %14 to i32
%69 = or i32 %68, 18
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%71 = trunc i64 %14 to i32
%72 = or i32 %71, 19
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %72)
%74 = trunc i64 %14 to i32
%75 = or i32 %74, 20
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %75)
%77 = trunc i64 %14 to i32
%78 = or i32 %77, 21
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %78)
%80 = trunc i64 %14 to i32
%81 = or i32 %80, 22
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %81)
%83 = trunc i64 %14 to i32
%84 = or i32 %83, 23
%85 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %84)
%86 = trunc i64 %14 to i32
%87 = or i32 %86, 24
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %87)
%89 = trunc i64 %14 to i32
%90 = or i32 %89, 25
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %90)
%92 = trunc i64 %14 to i32
%93 = or i32 %92, 26
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %93)
%95 = trunc i64 %14 to i32
%96 = or i32 %95, 27
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %96)
%98 = trunc i64 %14 to i32
%99 = or i32 %98, 28
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %99)
%101 = trunc i64 %14 to i32
%102 = or i32 %101, 29
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %102)
%104 = trunc i64 %14 to i32
%105 = or i32 %104, 30
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %105)
%107 = trunc i64 %14 to i32
%108 = or i32 %107, 31
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %108)
%110 = tail call i32 @putchar(i8 signext 10)
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %112
112: ; preds = %11, %112
%113 = phi i64 [ 0, %11 ], [ %118, %112 ]
%114 = add nuw nsw i64 %113, %14
%115 = getelementptr inbounds i32, i32* %0, i64 %114
%116 = load i32, i32* %115
%117 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %116)
%118 = add nuw nsw i64 %113, 1
%119 = icmp eq i64 %118, 32
br i1 %119, label %120, label %112
120: ; preds = %112
%121 = tail call i32 @putchar(i8 signext 10)
%122 = add nuw nsw i64 %12, 1
%123 = icmp eq i64 %122, %10
br i1 %123, label %124, label %11
124: ; preds = %120, %2
%125 = tail call i32 @putchar(i8 signext 10)
ret void
}