#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 pinta_vector(int *p, int tope) {
  register int i;
  printf("\n\n");
  for (i = 0; i < tope; i++, p++)
    printf("%5d%c", *p, (((i + 1) % 10) == 0 || i == tope - 1) ? '\n' : ' ');
  printf("\n\n\n");
}


x86 assembly (clang, -O0):
<pinta_vector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b4 <pinta_vector+0xa4>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x11(%rbp)
je     1176 <pinta_vector+0x66>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x11(%rbp),%cl
mov    $0x20,%edx
mov    $0xa,%eax
test   $0x1,%cl
cmovne %eax,%edx
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <pinta_vector+0x24>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pinta_vector>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r13d
mov    %rdi,%r14
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
test   %r13d,%r13d
jle    11aa <pinta_vector+0x8a>
neg    %r13d
mov    $0x1,%ebp
mov    $0xcccccccd,%r12d
lea    0xea9(%rip),%r15
xor    %ebx,%ebx
jmp    117c <pinta_vector+0x5c>
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
add    $0x1,%ebp
mov    %r13d,%eax
add    %ebx,%eax
je     11aa <pinta_vector+0x8a>
lea    (%rbx,%r13,1),%eax
mov    %ebp,%ecx
imul   %r12,%rcx
shr    $0x23,%rcx
lea    (%rcx,%rcx,4),%ecx
add    %ecx,%ecx
add    $0xffffffff,%ecx
cmp    $0xffffffff,%eax
mov    $0xa,%edx
mov    $0x20,%eax
cmove  %edx,%eax
cmp    %ebx,%ecx
je     1160 <pinta_vector+0x40>
mov    %eax,%edx
jmp    1160 <pinta_vector+0x40>
lea    0xe55(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [6 x i8] c"%5d%c\00"
@.str.2 = [4 x i8] c"\0A\0A\0A\00"
define void @pinta_vector(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %28, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %33
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %12
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
%16 = srem i32 %15, 10
%17 = icmp eq i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %11
%19 = load i32, i32* %5
%20 = load i32, i32* %4
%21 = sub nsw i32 %20, 1
%22 = icmp eq i32 %19, %21
br label %23
23: ; preds = %18, %11
%24 = phi i1 [ true, %11 ], [ %22, %18 ]
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 10, i32 32
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %26)
br label %28
28: ; preds = %23
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = load i32*, i32** %3
%32 = getelementptr inbounds i32, i32* %31, i32 1
store i32* %32, i32** %3
br label %7
33: ; preds = %7
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%5d%c\00"
@str = [2 x i8] c"\0A\00"
@str.3 = [3 x i8] c"\0A\0A\00"
define void @pinta_vector(i32* nocapture %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = add nsw i32 %1, -1
br label %7
7: ; preds = %5, %7
%8 = phi i32 [ 0, %5 ], [ %11, %7 ]
%9 = phi i32* [ %0, %5 ], [ %18, %7 ]
%10 = load i32, i32* %9
%11 = add nuw nsw i32 %8, 1
%12 = urem i32 %11, 10
%13 = icmp eq i32 %12, 0
%14 = icmp eq i32 %8, %6
%15 = select i1 %13, i1 true, i1 %14
%16 = select i1 %15, i32 10, i32 32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %16)
%18 = getelementptr inbounds i32, i32* %9, i64 1
%19 = icmp eq i32 %11, %1
br i1 %19, label %20, label %7
20: ; preds = %7, %2
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.3, i64 0, i64 0))
ret void
}