#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 UCHAR_MAX;
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
void print_table_bool(const char *type, const char *name, char table[],
                      int delta) {
  int n;
  printf("%s %s[%d] = {\n", type, name, UCHAR_MAX + 1);
  for (n = 1; n < UCHAR_MAX + 2; n++) {
    printf("%3d", table[n - 1] + delta);
    if (n < UCHAR_MAX + 1)
      putchar(',');
    if (n % 16 == 0)
      putchar('\n');
  }
  fputs("};\n\n", stdout);
}


x86 assembly (clang, -O0):
<print_table_bool>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    0x2e9a(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    0x2e76(%rip),%rcx
mov    (%rcx),%ecx
add    $0x2,%ecx
cmp    %ecx,%eax
jge    11fb <print_table_bool+0xcb>
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
add    -0x1c(%rbp),%esi
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
mov    0x2e3d(%rip),%rcx
mov    (%rcx),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    11ca <print_table_bool+0x9a>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    -0x20(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e8 <print_table_bool+0xb8>
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    11ed <print_table_bool+0xbd>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1170 <print_table_bool+0x40>
mov    0x2dd6(%rip),%rax
mov    (%rax),%esi
lea    0xe08(%rip),%rdi
call   1050 <fputs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_table_bool>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %ecx,%r15d
mov    %rdx,%r12
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2ea5(%rip),%rbp
mov    0x0(%rbp),%ecx
add    $0x1,%ecx
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x0(%rbp)
js     11bc <print_table_bool+0x8c>
lea    0xea3(%rip),%r14
xor    %ebx,%ebx
jmp    117e <print_table_bool+0x4e>
test   $0xf,%bl
je     11b0 <print_table_bool+0x80>
movslq 0x0(%rbp),%rax
cmp    %rax,%rbx
jg     11bc <print_table_bool+0x8c>
movsbl (%r12,%rbx,1),%esi
add    $0x1,%rbx
add    %r15d,%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movslq 0x0(%rbp),%rax
cmp    %rax,%rbx
jg     1170 <print_table_bool+0x40>
mov    $0x2c,%edi
call   1030 <putchar@plt>
jmp    1170 <print_table_bool+0x40>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
jmp    1175 <print_table_bool+0x45>
mov    0x2e15(%rip),%rax
mov    (%rax),%esi
lea    0xe47(%rip),%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <fputs@plt>

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

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