#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 main() {
  printf("#ifndef _BITIO_H_"
         "\n"
         "#define _BITIO_H_"
         "\n");
  for (unsigned n = 0; n <= 0xF; ++n)
    printf("const unsigned char %c%c%c%c = 0x%X;\n", n & 0x8 ? 'I' : 'O',
           n & 0x4 ? 'I' : 'O', n & 0x2 ? 'I' : 'O', n & 0x1 ? 'I' : 'O', n);
  for (unsigned n = 0; n <= 0xFF; ++n)
    printf("const unsigned char %c%c%c%c%c%c%c%c = 0x%02X;\n",
           n & 0x80 ? 'I' : 'O', n & 0x40 ? 'I' : 'O', n & 0x20 ? 'I' : 'O',
           n & 0x10 ? 'I' : 'O', n & 0x08 ? 'I' : 'O', n & 0x04 ? 'I' : 'O',
           n & 0x02 ? 'I' : 'O', n & 0x01 ? 'I' : 'O', n);
  printf("#endif"
         "\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
movl   $0x0,-0xc(%rbp)
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0xf,-0x10(%rbp)
ja     11b9 <main+0xa9>
mov    -0x10(%rbp),%ecx
and    $0x8,%ecx
mov    $0x4f,%esi
mov    $0x49,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
mov    -0x10(%rbp),%ecx
and    $0x4,%ecx
mov    $0x4f,%edx
mov    $0x49,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
mov    -0x10(%rbp),%edi
and    $0x2,%edi
mov    $0x4f,%ecx
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%ecx
mov    -0x10(%rbp),%edi
and    $0x1,%edi
mov    $0x4f,%r8d
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%r8d
mov    -0x10(%rbp),%r9d
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1135 <main+0x25>
movl   $0x0,-0x14(%rbp)
cmpl   $0xff,-0x14(%rbp)
ja     12b8 <main+0x1a8>
mov    -0x14(%rbp),%ecx
and    $0x80,%ecx
mov    $0x4f,%esi
mov    $0x49,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
mov    -0x14(%rbp),%ecx
and    $0x40,%ecx
mov    $0x4f,%edx
mov    $0x49,%eax
cmp    $0x0,%ecx
cmovne %eax,%edx
mov    -0x14(%rbp),%edi
and    $0x20,%edi
mov    $0x4f,%ecx
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%ecx
mov    -0x14(%rbp),%edi
and    $0x10,%edi
mov    $0x4f,%r8d
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%r8d
mov    -0x14(%rbp),%edi
and    $0x8,%edi
mov    $0x4f,%r9d
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%r9d
mov    -0x14(%rbp),%edi
and    $0x4,%edi
mov    $0x4f,%ebx
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%ebx
mov    -0x14(%rbp),%edi
and    $0x2,%edi
mov    $0x4f,%r11d
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%r11d
mov    -0x14(%rbp),%edi
and    $0x1,%edi
mov    $0x4f,%r10d
mov    $0x49,%eax
cmp    $0x0,%edi
cmovne %eax,%r10d
mov    -0x14(%rbp),%eax
lea    0xdb9(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c0 <main+0xb0>
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xf4b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x4f,%ebx
lea    0xee4(%rip),%r14
xor    %ebp,%ebp
xchg   %ax,%ax
test   $0x8,%bpl
mov    $0x49,%esi
cmove  %ebx,%esi
test   $0x4,%bpl
mov    $0x49,%edx
cmove  %ebx,%edx
test   $0x2,%bpl
mov    $0x49,%ecx
cmove  %ebx,%ecx
test   $0x1,%bpl
mov    $0x49,%r8d
cmove  %ebx,%r8d
mov    %r14,%rdi
mov    %ebp,%r9d
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    $0x10,%ebp
jne    1140 <main+0x20>
lea    0xeb8(%rip),%r14
xor    %ebp,%ebp
jmp    11c3 <main+0xa3>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
push   %rbp
push   %r10
push   %rbx
push   %r11
call   1040 <printf@plt>
add    $0x20,%rsp
add    $0x1,%ebp
cmp    $0x100,%ebp
je     1279 <main+0x159>
movd   %ebp,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa %xmm0,%xmm1
pand   0xe28(%rip),%xmm1
pand   0xe30(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%eax
mov    $0x4f,%r10d
mov    $0x4f,%esi
test   $0x80,%al
jne    120c <main+0xec>
mov    $0x49,%esi
mov    $0x4f,%edx
test   $0x40,%al
jne    121a <main+0xfa>
mov    $0x49,%edx
mov    $0x4f,%ecx
test   $0x20,%al
jne    1228 <main+0x108>
mov    $0x49,%ecx
mov    $0x4f,%r8d
test   $0x10,%al
jne    1238 <main+0x118>
mov    $0x49,%r8d
mov    $0x4f,%r9d
test   $0x8,%al
jne    1248 <main+0x128>
mov    $0x49,%r9d
mov    $0x4f,%r11d
test   $0x4,%al
jne    1258 <main+0x138>
mov    $0x49,%r11d
mov    $0x4f,%ebx
test   $0x2,%al
jne    1266 <main+0x146>
mov    $0x49,%ebx
test   $0x1,%al
jne    11a0 <main+0x80>
mov    $0x49,%r10d
jmp    11a0 <main+0x80>
lea    0xe1a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"#ifndef _BITIO_H_\0A#define _BITIO_H_\0A\00"
@.str.1 = [38 x i8] c"const unsigned char %c%c%c%c = 0x%X;\0A\00"
@.str.2 = [48 x i8] c"const unsigned char %c%c%c%c%c%c%c%c = 0x%02X;\0A\00"
@.str.3 = [8 x i8] c"#endif\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %5
5: ; preds = %31, %0
%6 = load i32, i32* %2
%7 = icmp ule i32 %6, 15
br i1 %7, label %8, label %34
8: ; preds = %5
%9 = load i32, i32* %2
%10 = and i32 %9, 8
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i64
%13 = select i1 %11, i32 73, i32 79
%14 = load i32, i32* %2
%15 = and i32 %14, 4
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i32 73, i32 79
%19 = load i32, i32* %2
%20 = and i32 %19, 2
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 73, i32 79
%24 = load i32, i32* %2
%25 = and i32 %24, 1
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 73, i32 79
%29 = load i32, i32* %2
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %13, i32 %18, i32 %23, i32 %28, i32 %29)
br label %31
31: ; preds = %8
%32 = load i32, i32* %2
%33 = add i32 %32, 1
store i32 %33, i32* %2
br label %5
34: ; preds = %5
store i32 0, i32* %3
br label %35
35: ; preds = %81, %34
%36 = load i32, i32* %3
%37 = icmp ule i32 %36, 255
br i1 %37, label %38, label %84
38: ; preds = %35
%39 = load i32, i32* %3
%40 = and i32 %39, 128
%41 = icmp ne i32 %40, 0
%42 = zext i1 %41 to i64
%43 = select i1 %41, i32 73, i32 79
%44 = load i32, i32* %3
%45 = and i32 %44, 64
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i32 73, i32 79
%49 = load i32, i32* %3
%50 = and i32 %49, 32
%51 = icmp ne i32 %50, 0
%52 = zext i1 %51 to i64
%53 = select i1 %51, i32 73, i32 79
%54 = load i32, i32* %3
%55 = and i32 %54, 16
%56 = icmp ne i32 %55, 0
%57 = zext i1 %56 to i64
%58 = select i1 %56, i32 73, i32 79
%59 = load i32, i32* %3
%60 = and i32 %59, 8
%61 = icmp ne i32 %60, 0
%62 = zext i1 %61 to i64
%63 = select i1 %61, i32 73, i32 79
%64 = load i32, i32* %3
%65 = and i32 %64, 4
%66 = icmp ne i32 %65, 0
%67 = zext i1 %66 to i64
%68 = select i1 %66, i32 73, i32 79
%69 = load i32, i32* %3
%70 = and i32 %69, 2
%71 = icmp ne i32 %70, 0
%72 = zext i1 %71 to i64
%73 = select i1 %71, i32 73, i32 79
%74 = load i32, i32* %3
%75 = and i32 %74, 1
%76 = icmp ne i32 %75, 0
%77 = zext i1 %76 to i64
%78 = select i1 %76, i32 73, i32 79
%79 = load i32, i32* %3
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %43, i32 %48, i32 %53, i32 %58, i32 %63, i32 %68, i32 %73, i32 %78, i32 %79)
br label %81
81: ; preds = %38
%82 = load i32, i32* %3
%83 = add i32 %82, 1
store i32 %83, i32* %3
br label %35
84: ; preds = %35
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [38 x i8] c"const unsigned char %c%c%c%c = 0x%X;\0A\00"
@.str.2 = [48 x i8] c"const unsigned char %c%c%c%c%c%c%c%c = 0x%02X;\0A\00"
@str = [36 x i8] c"#ifndef _BITIO_H_\0A#define _BITIO_H_\00"
@str.4 = [7 x i8] c"#endif\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 0, %0 ], [ %17, %2 ]
%4 = and i32 %3, 8
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 79, i32 73
%7 = and i32 %3, 4
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 79, i32 73
%10 = and i32 %3, 2
%11 = icmp eq i32 %10, 0
%12 = select i1 %11, i32 79, i32 73
%13 = and i32 %3, 1
%14 = icmp eq i32 %13, 0
%15 = select i1 %14, i32 79, i32 73
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %15, i32 %3)
%17 = add nuw nsw i32 %3, 1
%18 = icmp eq i32 %17, 16
br i1 %18, label %21, label %2
19: ; preds = %21
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.4, i64 0, i64 0))
ret i32 0
21: ; preds = %2, %21
%22 = phi i32 [ %44, %21 ], [ 0, %2 ]
%23 = insertelement <8 x i32> poison, i32 %22, i64 0
%24 = shufflevector <8 x i32> %23, <8 x i32> poison, <8 x i32> zeroinitializer
%25 = and <8 x i32> %24, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128>
%26 = icmp eq <8 x i32> %25, zeroinitializer
%27 = extractelement <8 x i1> %26, i64 7
%28 = select i1 %27, i32 79, i32 73
%29 = extractelement <8 x i1> %26, i64 6
%30 = select i1 %29, i32 79, i32 73
%31 = extractelement <8 x i1> %26, i64 5
%32 = select i1 %31, i32 79, i32 73
%33 = extractelement <8 x i1> %26, i64 4
%34 = select i1 %33, i32 79, i32 73
%35 = extractelement <8 x i1> %26, i64 3
%36 = select i1 %35, i32 79, i32 73
%37 = extractelement <8 x i1> %26, i64 2
%38 = select i1 %37, i32 79, i32 73
%39 = extractelement <8 x i1> %26, i64 1
%40 = select i1 %39, i32 79, i32 73
%41 = extractelement <8 x i1> %26, i64 0
%42 = select i1 %41, i32 79, i32 73
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i64 0, i64 0), i32 %28, i32 %30, i32 %32, i32 %34, i32 %36, i32 %38, i32 %40, i32 %42, i32 %22)
%44 = add nuw nsw i32 %22, 1
%45 = icmp eq i32 %44, 256
br i1 %45, label %19, label %21
}