#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 uint32_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void output_table(uint32_t (*table)[256], int rows, int len, char *trans) {
  int i, j;
  for (j = 0; j < rows; j++) {
    printf("{");
    for (i = 0; i < len - 1; i++) {
      if (i % 4 == 0)
        printf("\n");
      printf("%s(0x%8.8xL), ", trans, table[j][i]);
    }
    printf("%s(0x%8.8xL)},\n", trans, table[j][len - 1]);
  }
}


x86 assembly (clang, -O0):
<output_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f2 <output_table+0xe2>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11b7 <output_table+0xa7>
mov    -0x1c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1181 <output_table+0x71>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0xa,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    114e <output_table+0x3e>
mov    -0x18(%rbp),%rsi
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
shl    $0xa,%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <output_table+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,0x10(%rsp)
mov    %rdi,0x8(%rsp)
test   %esi,%esi
jle    11ec <output_table+0xcc>
mov    %rcx,%rbx
mov    0x10(%rsp),%rax
lea    -0x1(%rax),%ebp
movslq %ebp,%rax
mov    %rax,0x20(%rsp)
mov    %esi,%eax
mov    %rax,0x18(%rsp)
lea    0xe9f(%rip),%r12
mov    0x8(%rsp),%r15
xor    %r13d,%r13d
jmp    11a7 <output_table+0x87>
nopl   0x0(%rax,%rax,1)
mov    %r13,%rax
shl    $0xa,%rax
add    0x8(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xe84(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r13
add    $0x400,%r15
cmp    0x18(%rsp),%r13
je     11ec <output_table+0xcc>
mov    $0x7b,%edi
call   1030 <putchar@plt>
cmpl   $0x2,0x10(%rsp)
jl     1170 <output_table+0x50>
xor    %r14d,%r14d
jmp    11da <output_table+0xba>
nopl   (%rax)
mov    (%r15,%r14,4),%edx
mov    %r12,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
je     1170 <output_table+0x50>
test   $0x3,%r14b
jne    11c0 <output_table+0xa0>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11c0 <output_table+0xa0>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"{\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [15 x i8] c"%s(0x%8.8xL), \00"
@.str.3 = [16 x i8] c"%s(0x%8.8xL)},\0A\00"
define void @output_table([256 x i32]* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca [256 x i32]*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store [256 x i32]* %0, [256 x i32]** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
store i32 0, i32* %10
br label %11
11: ; preds = %54, %4
%12 = load i32, i32* %10
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %57
15: ; preds = %11
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %17
17: ; preds = %39, %15
%18 = load i32, i32* %9
%19 = load i32, i32* %7
%20 = sub nsw i32 %19, 1
%21 = icmp slt i32 %18, %20
br i1 %21, label %22, label %42
22: ; preds = %17
%23 = load i32, i32* %9
%24 = srem i32 %23, 4
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %28
26: ; preds = %22
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i8*, i8** %8
%30 = load [256 x i32]*, [256 x i32]** %5
%31 = load i32, i32* %10
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [256 x i32], [256 x i32]* %30, i64 %32
%34 = load i32, i32* %9
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [256 x i32], [256 x i32]* %33, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %29, i32 %37)
br label %39
39: ; preds = %28
%40 = load i32, i32* %9
%41 = add nsw i32 %40, 1
store i32 %41, i32* %9
br label %17
42: ; preds = %17
%43 = load i8*, i8** %8
%44 = load [256 x i32]*, [256 x i32]** %5
%45 = load i32, i32* %10
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [256 x i32], [256 x i32]* %44, i64 %46
%48 = load i32, i32* %7
%49 = sub nsw i32 %48, 1
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [256 x i32], [256 x i32]* %47, i64 0, i64 %50
%52 = load i32, i32* %51
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %43, i32 %52)
br label %54
54: ; preds = %42
%55 = load i32, i32* %10
%56 = add nsw i32 %55, 1
store i32 %56, i32* %10
br label %11
57: ; preds = %11
ret void
}

LLVM IR (-O2):
@.str.2 = [15 x i8] c"%s(0x%8.8xL), \00"
@.str.3 = [16 x i8] c"%s(0x%8.8xL)},\0A\00"
define void @output_table([256 x i32]* nocapture %0, i32 %1, i32 %2, i8* %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %33
6: ; preds = %4
%7 = add i32 %2, -1
%8 = icmp sgt i32 %2, 1
%9 = sext i32 %7 to i64
%10 = zext i32 %1 to i64
%11 = zext i32 %7 to i64
br label %12
12: ; preds = %6, %27
%13 = phi i64 [ 0, %6 ], [ %31, %27 ]
%14 = tail call i32 @putchar(i32 123)
br i1 %8, label %15, label %27
15: ; preds = %12, %21
%16 = phi i64 [ %25, %21 ], [ 0, %12 ]
%17 = and i64 %16, 3
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = tail call i32 @putchar(i32 10)
br label %21
21: ; preds = %19, %15
%22 = getelementptr inbounds [256 x i32], [256 x i32]* %0, i64 %13, i64 %16
%23 = load i32, i32* %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %3, i32 %23)
%25 = add nuw nsw i64 %16, 1
%26 = icmp eq i64 %25, %11
br i1 %26, label %27, label %15
27: ; preds = %21, %12
%28 = getelementptr inbounds [256 x i32], [256 x i32]* %0, i64 %13, i64 %9
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i8* %3, i32 %29)
%31 = add nuw nsw i64 %13, 1
%32 = icmp eq i64 %31, %10
br i1 %32, label %33, label %12
33: ; preds = %27, %4
ret void
}