#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 display_table(const char *name, unsigned long table[][0x100]) {
  unsigned i, j, k;
  printf("uint32_t %s[4][0x100] =\n{\n  ", name);
  for (k = 0; k < 4; k++) {
    printf("{ ");
    for (i = 0; i < 0x100; i += 4) {
      printf("\n    ");
      for (j = 0; j < 4; j++)
        printf("0x%08lx"
               ",",
               table[k][i + j]);
    }
    printf("\n  },");
  }
  printf("\n};\n\n");
}


x86 assembly (clang, -O0):
<display_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jae    11e9 <display_table+0xd9>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x100,-0x14(%rbp)
jae    11cd <display_table+0xbd>
lea    0xeb4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x4,-0x18(%rbp)
jae    11ba <display_table+0xaa>
mov    -0x10(%rbp),%rax
mov    -0x1c(%rbp),%ecx
shl    $0xb,%rcx
add    %rcx,%rax
mov    -0x14(%rbp),%ecx
add    -0x18(%rbp),%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,8),%rsi
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117a <display_table+0x6a>
jmp    11bf <display_table+0xaf>
mov    -0x14(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    1158 <display_table+0x48>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1139 <display_table+0x29>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_table>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%rsi
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffffffffffc,%rbx
lea    0xec8(%rip),%r14
lea    0xec7(%rip),%r15
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x20(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x28(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x30(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x38(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0xfc,%rbx
jb     1160 <display_table+0x40>
lea    0xe75(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe55(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffffffffffc,%rbx
lea    0xe43(%rip),%r14
lea    0xe42(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x820(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x828(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x830(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x838(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0xfc,%rbx
jb     11f0 <display_table+0xd0>
lea    0xdd9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xdb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffffffffffc,%rbx
lea    0xda7(%rip),%r14
lea    0xda6(%rip),%r15
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1020(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1028(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1030(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1038(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0xfc,%rbx
jb     1280 <display_table+0x160>
lea    0xd49(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd29(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffffffffffffc,%rbx
lea    0xd17(%rip),%r14
lea    0xd16(%rip),%r15
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1820(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1828(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1830(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x1838(%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0xfc,%rbx
jb     1310 <display_table+0x1f0>
lea    0xcb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xcb1(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"uint32_t %s[4][0x100] =\0A{\0A \00"
@.str.1 = [3 x i8] c"{ \00"
@.str.2 = [6 x i8] c"\0A \00"
@.str.3 = [9 x i8] c"0x%08lx,\00"
@.str.4 = [6 x i8] c"\0A },\00"
@.str.5 = [6 x i8] c"\0A};\0A\0A\00"
define void @display_table(i8* %0, [256 x i64]* %1) {
%3 = alloca i8*
%4 = alloca [256 x i64]*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store [256 x i64]* %1, [256 x i64]** %4
%8 = load i8*, i8** %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %8)
store i32 0, i32* %7
br label %10
10: ; preds = %44, %2
%11 = load i32, i32* %7
%12 = icmp ult i32 %11, 4
br i1 %12, label %13, label %47
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %15
15: ; preds = %39, %13
%16 = load i32, i32* %5
%17 = icmp ult i32 %16, 256
br i1 %17, label %18, label %42
18: ; preds = %15
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %6
br label %20
20: ; preds = %35, %18
%21 = load i32, i32* %6
%22 = icmp ult i32 %21, 4
br i1 %22, label %23, label %38
23: ; preds = %20
%24 = load [256 x i64]*, [256 x i64]** %4
%25 = load i32, i32* %7
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [256 x i64], [256 x i64]* %24, i64 %26
%28 = load i32, i32* %5
%29 = load i32, i32* %6
%30 = add i32 %28, %29
%31 = zext i32 %30 to i64
%32 = getelementptr inbounds [256 x i64], [256 x i64]* %27, i64 0, i64 %31
%33 = load i64, i64* %32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %33)
br label %35
35: ; preds = %23
%36 = load i32, i32* %6
%37 = add i32 %36, 1
store i32 %37, i32* %6
br label %20
38: ; preds = %20
br label %39
39: ; preds = %38
%40 = load i32, i32* %5
%41 = add i32 %40, 4
store i32 %41, i32* %5
br label %15
42: ; preds = %15
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %7
%46 = add i32 %45, 1
store i32 %46, i32* %7
br label %10
47: ; preds = %10
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"uint32_t %s[4][0x100] =\0A{\0A \00"
@.str.1 = [3 x i8] c"{ \00"
@.str.2 = [6 x i8] c"\0A \00"
@.str.3 = [9 x i8] c"0x%08lx,\00"
@.str.4 = [6 x i8] c"\0A },\00"
@str = [5 x i8] c"\0A};\0A\00"
define void @display_table(i8* %0, [256 x i64]* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %23, %5 ]
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%8 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 0, i64 %6
%9 = load i64, i64* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %9)
%11 = or i64 %6, 1
%12 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 0, i64 %11
%13 = load i64, i64* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %13)
%15 = or i64 %6, 2
%16 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 0, i64 %15
%17 = load i64, i64* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %17)
%19 = or i64 %6, 3
%20 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 0, i64 %19
%21 = load i64, i64* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %21)
%23 = add nuw nsw i64 %6, 4
%24 = icmp ult i64 %6, 252
br i1 %24, label %5, label %25
25: ; preds = %5
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %28
28: ; preds = %28, %25
%29 = phi i64 [ 0, %25 ], [ %46, %28 ]
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%31 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 1, i64 %29
%32 = load i64, i64* %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %32)
%34 = or i64 %29, 1
%35 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 1, i64 %34
%36 = load i64, i64* %35
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %36)
%38 = or i64 %29, 2
%39 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 1, i64 %38
%40 = load i64, i64* %39
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %40)
%42 = or i64 %29, 3
%43 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 1, i64 %42
%44 = load i64, i64* %43
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %44)
%46 = add nuw nsw i64 %29, 4
%47 = icmp ult i64 %29, 252
br i1 %47, label %28, label %48
48: ; preds = %28
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %51
51: ; preds = %51, %48
%52 = phi i64 [ 0, %48 ], [ %69, %51 ]
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%54 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 2, i64 %52
%55 = load i64, i64* %54
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %55)
%57 = or i64 %52, 1
%58 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 2, i64 %57
%59 = load i64, i64* %58
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %59)
%61 = or i64 %52, 2
%62 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 2, i64 %61
%63 = load i64, i64* %62
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %63)
%65 = or i64 %52, 3
%66 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 2, i64 %65
%67 = load i64, i64* %66
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %67)
%69 = add nuw nsw i64 %52, 4
%70 = icmp ult i64 %52, 252
br i1 %70, label %51, label %71
71: ; preds = %51
%72 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %74
74: ; preds = %74, %71
%75 = phi i64 [ 0, %71 ], [ %92, %74 ]
%76 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%77 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 3, i64 %75
%78 = load i64, i64* %77
%79 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %78)
%80 = or i64 %75, 1
%81 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 3, i64 %80
%82 = load i64, i64* %81
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %82)
%84 = or i64 %75, 2
%85 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 3, i64 %84
%86 = load i64, i64* %85
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %86)
%88 = or i64 %75, 3
%89 = getelementptr inbounds [256 x i64], [256 x i64]* %1, i64 3, i64 %88
%90 = load i64, i64* %89
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i64 %90)
%92 = add nuw nsw i64 %75, 4
%93 = icmp ult i64 %75, 252
br i1 %93, label %74, label %94
94: ; preds = %74
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%96 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret void
}