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

/* Variables and functions */
int leftray(int, int);
int /*<<< orphan*/ printf(char *, ...);
int rightray(int, int);
int main() {
  int occmask;
  int pos;
  uint64_t result;
  for (occmask = 0; occmask < 256; occmask++) {
    printf("\t{ ");
    for (pos = 0; pos < 8; pos++) {
      printf("U64(");
      result = (leftray(occmask, pos) | rightray(occmask, pos));
      printf("0x%.16lx)", result);
      if (pos < 7)
        printf(",");
      printf(" ");
    }
    printf("}");
    if (occmask < 255)
      printf(",");
    printf(" /* 0x%.2x */\n", occmask);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    1230 <main+0x100>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jge    11e8 <main+0xb8>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <leftray@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <rightray@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xe5c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x7,-0xc(%rbp)
jge    11cc <main+0x9c>
lea    0xe4e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1168 <main+0x38>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0xff,-0x8(%rbp)
jge    1211 <main+0xe1>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%r14
lea    0xeab(%rip),%r15
lea    0xea9(%rip),%r13
lea    0xeac(%rip),%r12
xor    %ebp,%ebp
jmp    118b <main+0x4b>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
je     13da <main+0x29a>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
xor    %esi,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
xor    %esi,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x1,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x1,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x2,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x2,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x3,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x3,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x4,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x4,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x5,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x5,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x6,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x6,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
mov    $0x7,%esi
call   1060 <leftray@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    $0x7,%esi
call   1050 <rightray@plt>
or     %eax,%ebx
mov    %r13,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    $0x7d,%edi
call   1030 <putchar@plt>
cmp    $0xfe,%ebp
ja     1170 <main+0x30>
mov    $0x2c,%edi
call   1030 <putchar@plt>
jmp    1170 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"\09{ \00"
@.str.1 = [5 x i8] c"U64(\00"
@.str.2 = [10 x i8] c"0x%.16lx)\00"
@.str.6 = [15 x i8] c" /* 0x%.2x */\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %63
%2 = phi i32 [ 0, %0 ], [ %65, %63 ]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @leftray(i32 %2, i32 0)
%6 = tail call i32 @rightray(i32 %2, i32 0)
%7 = or i32 %6, %5
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @putchar(i32 44)
%10 = tail call i32 @putchar(i32 32)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%12 = tail call i32 @leftray(i32 %2, i32 1)
%13 = tail call i32 @rightray(i32 %2, i32 1)
%14 = or i32 %13, %12
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = tail call i32 @putchar(i32 44)
%17 = tail call i32 @putchar(i32 32)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @leftray(i32 %2, i32 2)
%20 = tail call i32 @rightray(i32 %2, i32 2)
%21 = or i32 %20, %19
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = tail call i32 @putchar(i32 44)
%24 = tail call i32 @putchar(i32 32)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%26 = tail call i32 @leftray(i32 %2, i32 3)
%27 = tail call i32 @rightray(i32 %2, i32 3)
%28 = or i32 %27, %26
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = tail call i32 @putchar(i32 44)
%31 = tail call i32 @putchar(i32 32)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%33 = tail call i32 @leftray(i32 %2, i32 4)
%34 = tail call i32 @rightray(i32 %2, i32 4)
%35 = or i32 %34, %33
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %35)
%37 = tail call i32 @putchar(i32 44)
%38 = tail call i32 @putchar(i32 32)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%40 = tail call i32 @leftray(i32 %2, i32 5)
%41 = tail call i32 @rightray(i32 %2, i32 5)
%42 = or i32 %41, %40
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %42)
%44 = tail call i32 @putchar(i32 44)
%45 = tail call i32 @putchar(i32 32)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%47 = tail call i32 @leftray(i32 %2, i32 6)
%48 = tail call i32 @rightray(i32 %2, i32 6)
%49 = or i32 %48, %47
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = tail call i32 @putchar(i32 44)
%52 = tail call i32 @putchar(i32 32)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%54 = tail call i32 @leftray(i32 %2, i32 7)
%55 = tail call i32 @rightray(i32 %2, i32 7)
%56 = or i32 %55, %54
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %56)
%58 = tail call i32 @putchar(i32 32)
%59 = tail call i32 @putchar(i32 125)
%60 = icmp ult i32 %2, 255
br i1 %60, label %61, label %63
61: ; preds = %1
%62 = tail call i32 @putchar(i32 44)
br label %63
63: ; preds = %61, %1
%64 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %2)
%65 = add nuw nsw i32 %2, 1
%66 = icmp eq i32 %65, 256
br i1 %66, label %67, label %1
67: ; preds = %63
ret i32 0
}