#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 *, int, int, int, int);
void print(int (*p)[50]) {
  int *ptmp;
  int i = 0;
  for (ptmp = *p; ptmp < (*p + 50); ptmp++, i++)
    printf("[%2d] %2d x %2d = %d \n", i, i, i, *ptmp);
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    $0xc8,%rcx
cmp    %rcx,%rax
jae    1179 <print+0x69>
mov    -0x14(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%r8d
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112b <print+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    %rdi,%r15
add    $0xc8,%r15
xor    %ebp,%ebp
lea    0xed3(%rip),%r14
nopl   (%rax)
mov    (%rbx),%r8d
mov    %r14,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    %ebp,%ecx
call   1030 <printf@plt>
add    $0x4,%rbx
add    $0x1,%ebp
cmp    %r15,%rbx
jb     1130 <print+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [23 x i8] c"[%2d] %2d x %2d = %d \0A\00"
define void @print([50 x i32]* %0) {
%2 = getelementptr inbounds [50 x i32], [50 x i32]* %0, i64 0, i64 0
%3 = getelementptr inbounds [50 x i32], [50 x i32]* %0, i64 0, i64 50
br label %4
4: ; preds = %1, %4
%5 = phi i32 [ 0, %1 ], [ %10, %4 ]
%6 = phi i32* [ %2, %1 ], [ %9, %4 ]
%7 = load i32, i32* %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %5, i32 %5, i32 %7)
%9 = getelementptr inbounds i32, i32* %6, i64 1
%10 = add nuw nsw i32 %5, 1
%11 = icmp ult i32* %9, %3
br i1 %11, label %4, label %12
12: ; preds = %4
ret void
}