#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 *, ...);
int q0(unsigned int);
int q1(unsigned int);
int main(void) {
  unsigned i;
  printf("static const uint8_t q0[256] = {");
  for (i = 0; i < 256; i++) {
    if ((i % 8) == 0)
      printf("\n  ");
    printf("0x%02X,", q0(i));
  }
  printf("\n};\n\n");
  printf("static const uint8_t q1[256] = {");
  for (i = 0; i < 256; i++) {
    if ((i % 8) == 0)
      printf("\n  ");
    printf("0x%02X,", q1(i));
  }
  printf("\n};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jae    11a4 <main+0x74>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    117e <main+0x4e>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1050 <q0@plt>
mov    %eax,%esi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1154 <main+0x24>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jae    1217 <main+0xe7>
mov    -0x8(%rbp),%eax
and    $0x7,%eax
cmp    $0x0,%eax
jne    11f1 <main+0xc1>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%edi
call   1040 <q1@plt>
mov    %eax,%esi
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c7 <main+0x97>
lea    0xe36(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%r14
lea    0xec5(%rip),%rbx
xor    %ebp,%ebp
jmp    118e <main+0x4e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebp,%edi
call   1060 <q0@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
je     11a0 <main+0x60>
test   $0x7,%bpl
jne    1170 <main+0x30>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1170 <main+0x30>
lea    0xea7(%rip),%rdi
call   1030 <puts@plt>
lea    0xe7a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe60(%rip),%r14
lea    0xe5d(%rip),%rbx
xor    %ebp,%ebp
jmp    11ee <main+0xae>
nopl   0x0(%rax)
mov    %ebp,%edi
call   1050 <q1@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x100,%ebp
je     1200 <main+0xc0>
test   $0x7,%bpl
jne    11d0 <main+0x90>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d0 <main+0x90>
lea    0xe4c(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"static const uint8_t q0[256] = {\00"
@.str.1 = [4 x i8] c"\0A \00"
@.str.2 = [8 x i8] c"0x%02X,\00"
@.str.3 = [6 x i8] c"\0A};\0A\0A\00"
@.str.4 = [33 x i8] c"static const uint8_t q1[256] = {\00"
@.str.5 = [5 x i8] c"\0A};\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %2
%6 = icmp ult i32 %5, 256
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = load i32, i32* %2
%9 = urem i32 %8, 8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %7
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %11, %7
%14 = load i32, i32* %2
%15 = call i32 @q0(i32 %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %2
%19 = add i32 %18, 1
store i32 %19, i32* %2
br label %4
20: ; preds = %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %23
23: ; preds = %36, %20
%24 = load i32, i32* %2
%25 = icmp ult i32 %24, 256
br i1 %25, label %26, label %39
26: ; preds = %23
%27 = load i32, i32* %2
%28 = urem i32 %27, 8
%29 = icmp eq i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %26
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %26
%33 = load i32, i32* %2
%34 = call i32 @q1(i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %32
%37 = load i32, i32* %2
%38 = add i32 %37, 1
store i32 %38, i32* %2
br label %23
39: ; preds = %23
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"static const uint8_t q0[256] = {\00"
@.str.1 = [4 x i8] c"\0A \00"
@.str.2 = [8 x i8] c"0x%02X,\00"
@.str.4 = [33 x i8] c"static const uint8_t q1[256] = {\00"
@str = [5 x i8] c"\0A};\0A\00"
@str.6 = [4 x i8] c"\0A};\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %8
%3 = phi i32 [ 0, %0 ], [ %11, %8 ]
%4 = and i32 %3, 7
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
%9 = tail call i32 @q0(i32 %3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i32 %3, 1
%12 = icmp eq i32 %11, 256
br i1 %12, label %13, label %2
13: ; preds = %8
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
br label %16
16: ; preds = %13, %22
%17 = phi i32 [ 0, %13 ], [ %25, %22 ]
%18 = and i32 %17, 7
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %16
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %16
%23 = tail call i32 @q1(i32 %17)
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%25 = add nuw nsw i32 %17, 1
%26 = icmp eq i32 %25, 256
br i1 %26, label %27, label %16
27: ; preds = %22
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.6, i64 0, i64 0))
ret i32 0
}