#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
void print_table(FILE *fout, unsigned int *xs, size_t n) {
  size_t i, j;
  for (j = 0; j < 255; ++j) {
    fprintf(fout, "%u", xs[j]);
    for (i = 1; i < n; ++i) {
      fprintf(fout, "\t%u", xs[i * 255 + j]);
    }
    fputc('\n', fout);
  }
}


x86 assembly (clang, -O0):
<print_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0xff,-0x28(%rbp)
jae    11ce <print_table+0xae>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xea1(%rip),%rsi
call   1040 <fprintf@plt>
movq   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    11af <print_table+0x8f>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
imul   $0xff,-0x20(%rbp),%rcx
add    -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe67(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    116d <print_table+0x4d>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1030 <fputc@plt>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    113c <print_table+0x1c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
mov    %rdx,0x10(%rsp)
lea    -0x1(%rdx),%rax
mov    %rax,(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x3fc(%rsi),%r14
xor    %r12d,%r12d
lea    0xeac(%rip),%r13
jmp    117e <print_table+0x5e>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0x1,%r12
add    $0x4,%r14
cmp    $0xff,%r12
je     11cd <print_table+0xad>
mov    0x8(%rsp),%rax
mov    (%rax,%r12,4),%edx
mov    %rbx,%rdi
lea    0xe70(%rip),%rsi
call   1040 <fprintf@plt>
cmpq   $0x2,0x10(%rsp)
jb     1160 <print_table+0x40>
mov    %r14,%rbp
mov    (%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
mov    %r13,%rsi
call   1040 <fprintf@plt>
add    $0x3fc,%rbp
add    $0xffffffffffffffff,%r15
jne    11b0 <print_table+0x90>
jmp    1160 <print_table+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"\09%u\00"
define void @print_table(i32* %0, i32* %1, i64 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
store i32* %0, i32** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
store i64 0, i64* %8
br label %9
9: ; preds = %39, %3
%10 = load i64, i64* %8
%11 = icmp ult i64 %10, 255
br i1 %11, label %12, label %42
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = load i32*, i32** %5
%15 = load i64, i64* %8
%16 = getelementptr inbounds i32, i32* %14, i64 %15
%17 = load i32, i32* %16
%18 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %17)
store i64 1, i64* %7
br label %19
19: ; preds = %33, %12
%20 = load i64, i64* %7
%21 = load i64, i64* %6
%22 = icmp ult i64 %20, %21
br i1 %22, label %23, label %36
23: ; preds = %19
%24 = load i32*, i32** %4
%25 = load i32*, i32** %5
%26 = load i64, i64* %7
%27 = mul i64 %26, 255
%28 = load i64, i64* %8
%29 = add i64 %27, %28
%30 = getelementptr inbounds i32, i32* %25, i64 %29
%31 = load i32, i32* %30
%32 = call i32 @fprintf(i32* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %23
%34 = load i64, i64* %7
%35 = add i64 %34, 1
store i64 %35, i64* %7
br label %19
36: ; preds = %19
%37 = load i32*, i32** %4
%38 = call i32 @fputc(i8 signext 10, i32* %37)
br label %39
39: ; preds = %36
%40 = load i64, i64* %8
%41 = add i64 %40, 1
store i64 %41, i64* %8
br label %9
42: ; preds = %9
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
@.str.1 = [4 x i8] c"\09%u\00"
define void @print_table(i32* nocapture %0, i32* nocapture %1, i64 %2) {
%4 = icmp ugt i64 %2, 1
br label %5
5: ; preds = %3, %19
%6 = phi i64 [ 0, %3 ], [ %21, %19 ]
%7 = getelementptr inbounds i32, i32* %1, i64 %6
%8 = load i32, i32* %7
%9 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
br i1 %4, label %10, label %19
10: ; preds = %5, %10
%11 = phi i64 [ %17, %10 ], [ 1, %5 ]
%12 = mul i64 %11, 255
%13 = add i64 %12, %6
%14 = getelementptr inbounds i32, i32* %1, i64 %13
%15 = load i32, i32* %14
%16 = tail call i32 @fprintf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
%17 = add nuw i64 %11, 1
%18 = icmp eq i64 %17, %2
br i1 %18, label %19, label %10
19: ; preds = %10, %5
%20 = tail call i32 @fputc(i8 signext 10, i32* %0)
%21 = add nuw nsw i64 %6, 1
%22 = icmp eq i64 %21, 255
br i1 %22, label %23, label %5
23: ; preds = %19
ret void
}