#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 *, unsigned int const);
int /*<<< orphan*/ puts(char *);
void printArray(const unsigned int a[]) {
  size_t j;
  for (j = 0; j < 100; ++j) {
    if (j % 20 == 0) {
      puts("");
    }
    printf("%2u", a[j]);
  }
  return;
}


x86 assembly (clang, -O0):
<printArray>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0x64,-0x10(%rbp)
jae    118b <printArray+0x6b>
mov    -0x10(%rbp),%rax
mov    $0x14,%ecx
xor    %edx,%edx
div    %rcx
cmp    $0x0,%rdx
jne    1163 <printArray+0x43>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe8b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1134 <printArray+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printArray>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r15
mov    $0xfffffffffffffe70,%r12
xor    %ebp,%ebp
lea    0xec5(%rip),%r14
xor    %ebx,%ebx
jmp    115d <printArray+0x3d>
nop
mov    0x190(%r15,%r12,1),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0xff,%bl
add    $0x1,%bpl
add    $0x4,%r12
je     1180 <printArray+0x60>
movzbl %bpl,%eax
imul   $0xcd,%eax,%eax
shr    $0xa,%eax
and    $0xfffffffc,%eax
lea    (%rax,%rax,4),%eax
add    %bl,%al
jne    1140 <printArray+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1140 <printArray+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [4 x i8] c"%2u\00"
define void @printArray(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
store i64 0, i64* %3
br label %4
4: ; preds = %19, %1
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, 100
br i1 %6, label %7, label %22
7: ; preds = %4
%8 = load i64, i64* %3
%9 = urem i64 %8, 20
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
%14 = load i32*, i32** %2
%15 = load i64, i64* %3
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
br label %19
19: ; preds = %13
%20 = load i64, i64* %3
%21 = add i64 %20, 1
store i64 %21, i64* %3
br label %4
22: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%2u\00"
define void @printArray(i32* nocapture %0) {
br label %2
2: ; preds = %1, %9
%3 = phi i64 [ 0, %1 ], [ %13, %9 ]
%4 = trunc i64 %3 to i8
%5 = urem i8 %4, 20
%6 = icmp eq i8 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @putchar(i32 10)
br label %9
9: ; preds = %7, %2
%10 = getelementptr inbounds i32, i32* %0, i64 %3
%11 = load i32, i32* %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %3, 1
%14 = icmp eq i64 %13, 100
br i1 %14, label %15, label %2
15: ; preds = %9
ret void
}