#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*/ od_filter_dering_direction_offsets(int *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  printf("int direction_offsets_table[16][3] = {\n");
  int offset[3];
  int bstride;
  bstride = 38;
  for (int dir = 0; dir < 16; dir++) {
    od_filter_dering_direction_offsets(offset, dir, bstride);
    printf("  {");
    for (int i = 0; i < 3; i++) {
      printf("%4i", offset[i]);
      if (i < 2) {
        printf(",");
      }
    }
    printf(" }");
    if (dir < 15) {
      printf(",\n");
    }
  }
  printf("\n};\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x26,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x10,-0x24(%rbp)
jge    1204 <main+0xe4>
lea    -0x1c(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1040 <od_filter_dering_direction_offsets@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
cmpl   $0x3,-0x28(%rbp)
jge    11cb <main+0xab>
movslq -0x28(%rbp),%rax
mov    -0x1c(%rbp,%rax,4),%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x2,-0x28(%rbp)
jge    11b8 <main+0x98>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bd <main+0x9d>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1180 <main+0x60>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xf,-0x24(%rbp)
jge    11f1 <main+0xd1>
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f6 <main+0xd6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1152 <main+0x32>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeb6(%rip),%rdi
call   1040 <puts@plt>
lea    0xc(%rsp),%r14
lea    0xe9a(%rip),%r15
lea    0xe97(%rip),%rbx
lea    0xe94(%rip),%r12
lea    0xebb(%rip),%r13
xor    %ebp,%ebp
jmp    1188 <main+0x48>
nop
add    $0x1,%ebp
cmp    $0x10,%ebp
je     11f8 <main+0xb8>
mov    %r14,%rdi
mov    %ebp,%esi
mov    $0x26,%edx
call   1060 <od_filter_dering_direction_offsets@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0xe,%ebp
ja     1180 <main+0x40>
mov    %r13,%rdi
call   1040 <puts@plt>
jmp    1180 <main+0x40>
lea    0xe33(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [4 x i8] c" {\00"
@.str.2 = [4 x i8] c"%4i\00"
@.str.4 = [3 x i8] c" }\00"
@str = [39 x i8] c"int direction_offsets_table[16][3] = {\00"
@str.7 = [4 x i8] c"\0A};\00"
@str.8 = [2 x i8] c",\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [3 x i32]
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%5 = bitcast [3 x i32]* %3 to i8*
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 0
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 1
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0, i64 2
br label %11
9: ; preds = %27
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.7, i64 0, i64 0))
ret i32 0
11: ; preds = %27, %2
%12 = phi i32 [ 0, %2 ], [ %28, %27 ]
%13 = call i32 @od_filter_dering_direction_offsets(i32* %6, i32 %12, i32 38)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %6
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = call i32 @putchar(i32 44)
%18 = load i32, i32* %7
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = call i32 @putchar(i32 44)
%21 = load i32, i32* %8
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%24 = icmp ult i32 %12, 15
br i1 %24, label %25, label %27
25: ; preds = %11
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.8, i64 0, i64 0))
br label %27
27: ; preds = %11, %25
%28 = add nuw nsw i32 %12, 1
%29 = icmp eq i32 %28, 16
br i1 %29, label %9, label %11
}