#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 show(int p[4][10]) {
  register int i, j;
  printf("%10s  %10s  %10s  %10s\n", "N", "N^2", "N^3", "N^4");
  for (j = 1; j < 11; j++) {
    for (i = 1; i < 5; i++)
      printf("%10d ", p[i - 1][j - 1]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
lea    0xeee(%rip),%rsi
lea    0xee9(%rip),%rdx
lea    0xee6(%rip),%rcx
lea    0xee3(%rip),%r8
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
cmpl   $0xb,-0x10(%rbp)
jge    11c0 <show+0xb0>
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11a4 <show+0x94>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115e <show+0x4e>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114d <show+0x3d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
lea    0xed1(%rip),%rdi
lea    0xee2(%rip),%rsi
lea    0xedd(%rip),%rdx
lea    0xeda(%rip),%rcx
lea    0xed7(%rip),%r8
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffffffffff6,%rbx
lea    0xec6(%rip),%r14
mov    0x28(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x50(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x78(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xa0(%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
inc    %rbx
jne    1160 <show+0x40>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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