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

/* Variables and functions */
char *basename(char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int getchar();
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char **argv) {
  int odd, i, j, c1, c2;
  uint8_t lut[65536], to, te;
  if (!strcmp(basename(argv[0]), "oddbits"))
    odd = 1;
  else if (!strcmp(basename(argv[0]), "evenbits"))
    odd = 0;
  else if (!strcmp(basename(argv[0]), "xorbits"))
    odd = 2;
  else {
    fprintf(stderr, "%s: Should be named oddbits or evenbits or xorbits.\n",
            basename(argv[0]));
    return 1;
  }
  if (odd == 0 || odd == 1) {
    for (i = 0; i < 65536; i++)
      for (lut[i] = 0, j = 0; j < 8; j++)
        if ((i >> (j * 2 + odd)) & 1)
          lut[i] |= 1 << j;
  } else {
    for (i = 0; i < 65536; i++) {
      to = 0;
      te = 0;
      for (j = 0; j < 8; j++) {
        if ((i >> (j * 2 + 1)) & 1)
          to |= 1 << j;
        if ((i >> (j * 2)) & 1)
          te |= 1 << j;
      }
      lut[i] = to ^ te;
    }
  }
  while ((c1 = getchar()) >= 0 && (c2 = getchar()) >= 0)
    putchar(lut[c1 | (c2 << 8)]);
  if (c1 >= 0)
    putchar(lut[c1]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40040,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <basename@plt>
mov    %rax,%rdi
lea    0xe81(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1199 <main+0x49>
movl   $0x1,-0x14(%rbp)
jmp    123f <main+0xef>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <basename@plt>
mov    %rax,%rdi
lea    0xe59(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11c9 <main+0x79>
movl   $0x0,-0x14(%rbp)
jmp    123a <main+0xea>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <basename@plt>
mov    %rax,%rdi
lea    0xe32(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11f9 <main+0xa9>
movl   $0x2,-0x14(%rbp)
jmp    1235 <main+0xe5>
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4003c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1070 <basename@plt>
mov    -0x4003c(%rbp),%edi
mov    %rax,%rdx
lea    0xdf5(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1447 <main+0x2f7>
jmp    123a <main+0xea>
jmp    123f <main+0xef>
cmpl   $0x0,-0x14(%rbp)
je     1253 <main+0x103>
cmpl   $0x1,-0x14(%rbp)
jne    12ea <main+0x19a>
movl   $0x0,-0x18(%rbp)
cmpl   $0x10000,-0x18(%rbp)
jge    12e5 <main+0x195>
movslq -0x18(%rbp),%rax
movl   $0x0,-0x40030(%rbp,%rax,4)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    12d2 <main+0x182>
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    -0x14(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     12bf <main+0x16f>
mov    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
movslq -0x18(%rbp),%rax
or     -0x40030(%rbp,%rax,4),%ecx
mov    %ecx,-0x40030(%rbp,%rax,4)
jmp    12c4 <main+0x174>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    127d <main+0x12d>
jmp    12d7 <main+0x187>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    125a <main+0x10a>
jmp    13bd <main+0x26d>
movl   $0x0,-0x18(%rbp)
cmpl   $0x10000,-0x18(%rbp)
jge    13b8 <main+0x268>
movl   $0x0,-0x40034(%rbp)
movl   $0x0,-0x40038(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1393 <main+0x243>
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1353 <main+0x203>
mov    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x40034(%rbp),%eax
mov    %eax,-0x40034(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
shl    $0x1,%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1380 <main+0x230>
mov    -0x1c(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x40038(%rbp),%eax
mov    %eax,-0x40038(%rbp)
jmp    1385 <main+0x235>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1319 <main+0x1c9>
mov    -0x40034(%rbp),%ecx
xor    -0x40038(%rbp),%ecx
movslq -0x18(%rbp),%rax
mov    %ecx,-0x40030(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12f1 <main+0x1a1>
jmp    13bd <main+0x26d>
jmp    13c2 <main+0x272>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x20(%rbp)
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x4003d(%rbp)
jl     13f5 <main+0x2a5>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
setge  %al
mov    %al,-0x4003d(%rbp)
mov    -0x4003d(%rbp),%al
test   $0x1,%al
jne    1408 <main+0x2b8>
jmp    1426 <main+0x2d6>
mov    -0x20(%rbp),%eax
mov    -0x24(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
cltq
mov    -0x40030(%rbp,%rax,4),%edi
call   1030 <putchar@plt>
jmp    13c2 <main+0x272>
cmpl   $0x0,-0x20(%rbp)
jl     1440 <main+0x2f0>
movslq -0x20(%rbp),%rax
mov    -0x40030(%rbp,%rax,4),%edi
call   1030 <putchar@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40040,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40000,%rsp
mov    %rsi,%rbx
mov    (%rsi),%rdi
call   1070 <basename@plt>
lea    0xf23(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
mov    $0x1,%r14d
mov    $0x1,%edx
test   %eax,%eax
je     11ec <main+0x9c>
mov    (%rbx),%rdi
call   1070 <basename@plt>
lea    0xf05(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11ea <main+0x9a>
mov    (%rbx),%rdi
call   1070 <basename@plt>
lea    0xef3(%rip),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     1433 <main+0x2e3>
mov    0x2e1b(%rip),%rax
mov    (%rax),%ebp
mov    (%rbx),%rdi
call   1070 <basename@plt>
lea    0xed3(%rip),%rsi
mov    %ebp,%edi
mov    %rax,%rdx
call   1060 <fprintf@plt>
mov    $0x1,%ebp
jmp    1425 <main+0x2d5>
xor    %edx,%edx
mov    $0x4000,%r8d
mov    %edx,%ecx
shl    %cl,%r8d
lea    0xc(%rdx),%ecx
mov    $0x1,%esi
shl    %cl,%esi
mov    $0x400,%edi
mov    %edx,%ecx
shl    %cl,%edi
lea    0x8(%rdx),%ecx
mov    $0x1,%ebx
shl    %cl,%ebx
mov    $0x40,%ebp
mov    %edx,%ecx
shl    %cl,%ebp
lea    0x4(%rdx),%ecx
shl    %cl,%r14d
mov    $0x4,%eax
mov    %edx,%ecx
shl    %cl,%eax
movd   %edx,%xmm2
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm14
movd   %r14d,%xmm0
pshufd $0x0,%xmm0,%xmm9
movd   %ebp,%xmm0
pshufd $0x0,%xmm0,%xmm12
movd   %ebx,%xmm0
pshufd $0x0,%xmm0,%xmm10
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm11
movd   %esi,%xmm0
pshufd $0x0,%xmm0,%xmm5
movd   %r8d,%xmm0
pshufd $0x0,%xmm0,%xmm6
movdqa 0xd81(%rip),%xmm13
xor    %eax,%eax
pxor   %xmm0,%xmm0
xorps  %xmm1,%xmm1
movss  %xmm2,%xmm1
movdqa 0xd9c(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movdqa %xmm13,%xmm7
psrld  %xmm1,%xmm7
pand   0xd5f(%rip),%xmm7
movdqa %xmm14,%xmm8
pand   %xmm13,%xmm8
pcmpeqd %xmm0,%xmm8
movdqa %xmm7,%xmm15
por    0xd52(%rip),%xmm15
pand   %xmm8,%xmm7
pandn  %xmm15,%xmm8
por    %xmm7,%xmm8
movdqa %xmm9,%xmm7
pand   %xmm13,%xmm7
pcmpeqd %xmm0,%xmm7
movdqa %xmm8,%xmm3
por    %xmm2,%xmm3
pand   %xmm7,%xmm8
pandn  %xmm3,%xmm7
por    %xmm8,%xmm7
movdqa %xmm12,%xmm3
pand   %xmm13,%xmm3
pcmpeqd %xmm0,%xmm3
movdqa %xmm7,%xmm4
por    0xd24(%rip),%xmm4
pand   %xmm3,%xmm7
pandn  %xmm4,%xmm3
por    %xmm7,%xmm3
movdqa %xmm10,%xmm4
pand   %xmm13,%xmm4
pcmpeqd %xmm0,%xmm4
movdqa %xmm3,%xmm7
por    0xd0e(%rip),%xmm7
pand   %xmm4,%xmm3
pandn  %xmm7,%xmm4
por    %xmm3,%xmm4
movdqa %xmm11,%xmm3
pand   %xmm13,%xmm3
pcmpeqd %xmm0,%xmm3
movdqa %xmm4,%xmm7
por    0xcf8(%rip),%xmm7
pand   %xmm3,%xmm4
pandn  %xmm7,%xmm3
por    %xmm4,%xmm3
movdqa %xmm5,%xmm4
pand   %xmm13,%xmm4
pcmpeqd %xmm0,%xmm4
movdqa %xmm3,%xmm7
por    0xce3(%rip),%xmm7
pand   %xmm4,%xmm3
pandn  %xmm7,%xmm4
por    %xmm3,%xmm4
movdqa %xmm6,%xmm3
pand   %xmm13,%xmm3
pcmpeqd %xmm0,%xmm3
movdqa %xmm4,%xmm7
por    0xcce(%rip),%xmm7
pand   %xmm3,%xmm4
pandn  %xmm7,%xmm3
por    %xmm4,%xmm3
movdqa %xmm3,(%rsp,%rax,4)
add    $0x4,%rax
paddd  %xmm2,%xmm13
cmp    $0x10000,%rax
jne    12a0 <main+0x150>
xor    %ebp,%ebp
xor    %eax,%eax
call   1050 <getchar@plt>
test   %eax,%eax
js     1425 <main+0x2d5>
mov    %eax,%ebx
xor    %ebp,%ebp
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
test   %eax,%eax
js     1419 <main+0x2c9>
shl    $0x8,%eax
or     %ebx,%eax
cltq
mov    (%rsp,%rax,4),%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    13f0 <main+0x2a0>
jmp    1425 <main+0x2d5>
mov    %ebx,%eax
mov    (%rsp,%rax,4),%edi
call   1030 <putchar@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x40000,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
movdqa 0xbc5(%rip),%xmm3
xor    %eax,%eax
movdqa 0xbca(%rip),%xmm8
movdqa 0xbd1(%rip),%xmm9
movdqa 0xbd8(%rip),%xmm15
movdqa 0xbdf(%rip),%xmm10
movdqa 0xbe6(%rip),%xmm11
movdqa 0xbed(%rip),%xmm12
movdqa 0xbf4(%rip),%xmm13
movdqa 0xbfb(%rip),%xmm14
cs nopw 0x0(%rax,%rax,1)
nop
movdqa %xmm3,%xmm2
psrld  $0x1,%xmm2
movdqa %xmm2,%xmm0
pand   %xmm8,%xmm0
movdqa %xmm3,%xmm5
pand   %xmm8,%xmm5
movdqa %xmm3,%xmm4
psrld  $0x2,%xmm4
movdqa %xmm4,%xmm7
pand   %xmm9,%xmm7
por    %xmm0,%xmm7
pand   %xmm9,%xmm2
por    %xmm5,%xmm2
movdqa %xmm3,%xmm0
psrld  $0x3,%xmm0
movdqa %xmm0,%xmm1
pand   %xmm15,%xmm1
pand   %xmm15,%xmm4
movdqa %xmm3,%xmm6
psrld  $0x4,%xmm6
movdqa %xmm6,%xmm5
pand   %xmm10,%xmm5
por    %xmm1,%xmm5
por    %xmm7,%xmm5
pand   %xmm10,%xmm0
por    %xmm4,%xmm0
por    %xmm2,%xmm0
movdqa %xmm3,%xmm1
psrld  $0x5,%xmm1
movdqa %xmm1,%xmm4
pand   %xmm11,%xmm4
pand   %xmm11,%xmm6
movdqa %xmm3,%xmm2
psrld  $0x6,%xmm2
movdqa %xmm2,%xmm7
pand   %xmm12,%xmm7
por    %xmm4,%xmm7
pand   %xmm12,%xmm1
por    %xmm6,%xmm1
movdqa %xmm3,%xmm4
psrld  $0x7,%xmm4
movdqa %xmm4,%xmm6
pand   %xmm13,%xmm6
por    %xmm7,%xmm6
por    %xmm5,%xmm6
pand   %xmm13,%xmm2
por    %xmm1,%xmm2
por    %xmm0,%xmm2
movdqa %xmm3,%xmm0
psrld  $0x8,%xmm0
pand   %xmm14,%xmm0
por    %xmm6,%xmm0
pand   %xmm14,%xmm4
por    %xmm2,%xmm4
pxor   %xmm0,%xmm4
movdqa %xmm4,(%rsp,%rax,4)
add    $0x4,%rax
paddd  %xmm15,%xmm3
cmp    $0x10000,%rax
jne    1490 <main+0x340>
jmp    13d8 <main+0x288>

LLVM IR (-O0):
@.str = [8 x i8] c"oddbits\00"
@.str.1 = [9 x i8] c"evenbits\00"
@.str.2 = [8 x i8] c"xorbits\00"
@stderr = global i32 0
@.str.3 = [53 x i8] c"%s: Should be named oddbits or evenbits or xorbits.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [65536 x i32]
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = call i8* @basename(i8* %16)
%18 = call i32 @strcmp(i8* %17, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %2
store i32 1, i32* %6
br label %46
21: ; preds = %2
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i8* @basename(i8* %24)
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %21
store i32 0, i32* %6
br label %45
29: ; preds = %21
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 0
%32 = load i8*, i8** %31
%33 = call i8* @basename(i8* %32)
%34 = call i32 @strcmp(i8* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %29
store i32 2, i32* %6
br label %44
37: ; preds = %29
%38 = load i32, i32* @stderr
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 0
%41 = load i8*, i8** %40
%42 = call i8* @basename(i8* %41)
%43 = call i32 @fprintf(i32 %38, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %42)
store i32 1, i32* %3
br label %165
44: ; preds = %36
br label %45
45: ; preds = %44, %28
br label %46
46: ; preds = %45, %20
%47 = load i32, i32* %6
%48 = icmp eq i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %46
%50 = load i32, i32* %6
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %89
52: ; preds = %49, %46
store i32 0, i32* %7
br label %53
53: ; preds = %85, %52
%54 = load i32, i32* %7
%55 = icmp slt i32 %54, 65536
br i1 %55, label %56, label %88
56: ; preds = %53
%57 = load i32, i32* %7
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [65536 x i32], [65536 x i32]* %11, i64 0, i64 %58
store i32 0, i32* %59
store i32 0, i32* %8
br label %60
60: ; preds = %81, %56
%61 = load i32, i32* %8
%62 = icmp slt i32 %61, 8
br i1 %62, label %63, label %84
63: ; preds = %60
%64 = load i32, i32* %7
%65 = load i32, i32* %8
%66 = mul nsw i32 %65, 2
%67 = load i32, i32* %6
%68 = add nsw i32 %66, %67
%69 = ashr i32 %64, %68
%70 = and i32 %69, 1
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %80
72: ; preds = %63
%73 = load i32, i32* %8
%74 = shl i32 1, %73
%75 = load i32, i32* %7
%76 = sext i32 %75 to i64
%77 = getelementptr inbounds [65536 x i32], [65536 x i32]* %11, i64 0, i64 %76
%78 = load i32, i32* %77
%79 = or i32 %78, %74
store i32 %79, i32* %77
br label %80
80: ; preds = %72, %63
br label %81
81: ; preds = %80
%82 = load i32, i32* %8
%83 = add nsw i32 %82, 1
store i32 %83, i32* %8
br label %60
84: ; preds = %60
br label %85
85: ; preds = %84
%86 = load i32, i32* %7
%87 = add nsw i32 %86, 1
store i32 %87, i32* %7
br label %53
88: ; preds = %53
br label %137
89: ; preds = %49
store i32 0, i32* %7
br label %90
90: ; preds = %133, %89
%91 = load i32, i32* %7
%92 = icmp slt i32 %91, 65536
br i1 %92, label %93, label %136
93: ; preds = %90
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %8
br label %94
94: ; preds = %123, %93
%95 = load i32, i32* %8
%96 = icmp slt i32 %95, 8
br i1 %96, label %97, label %126
97: ; preds = %94
%98 = load i32, i32* %7
%99 = load i32, i32* %8
%100 = mul nsw i32 %99, 2
%101 = add nsw i32 %100, 1
%102 = ashr i32 %98, %101
%103 = and i32 %102, 1
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %110
105: ; preds = %97
%106 = load i32, i32* %8
%107 = shl i32 1, %106
%108 = load i32, i32* %12
%109 = or i32 %108, %107
store i32 %109, i32* %12
br label %110
110: ; preds = %105, %97
%111 = load i32, i32* %7
%112 = load i32, i32* %8
%113 = mul nsw i32 %112, 2
%114 = ashr i32 %111, %113
%115 = and i32 %114, 1
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %122
117: ; preds = %110
%118 = load i32, i32* %8
%119 = shl i32 1, %118
%120 = load i32, i32* %13
%121 = or i32 %120, %119
store i32 %121, i32* %13
br label %122
122: ; preds = %117, %110
br label %123
123: ; preds = %122
%124 = load i32, i32* %8
%125 = add nsw i32 %124, 1
store i32 %125, i32* %8
br label %94
126: ; preds = %94
%127 = load i32, i32* %12
%128 = load i32, i32* %13
%129 = xor i32 %127, %128
%130 = load i32, i32* %7
%131 = sext i32 %130 to i64
%132 = getelementptr inbounds [65536 x i32], [65536 x i32]* %11, i64 0, i64 %131
store i32 %129, i32* %132
br label %133
133: ; preds = %126
%134 = load i32, i32* %7
%135 = add nsw i32 %134, 1
store i32 %135, i32* %7
br label %90
136: ; preds = %90
br label %137
137: ; preds = %136, %88
br label %138
138: ; preds = %146, %137
%139 = call i32 (...) @getchar()
store i32 %139, i32* %9
%140 = icmp sge i32 %139, 0
br i1 %140, label %141, label %144
141: ; preds = %138
%142 = call i32 (...) @getchar()
store i32 %142, i32* %10
%143 = icmp sge i32 %142, 0
br label %144
144: ; preds = %141, %138
%145 = phi i1 [ false, %138 ], [ %143, %141 ]
br i1 %145, label %146, label %155
146: ; preds = %144
%147 = load i32, i32* %9
%148 = load i32, i32* %10
%149 = shl i32 %148, 8
%150 = or i32 %147, %149
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [65536 x i32], [65536 x i32]* %11, i64 0, i64 %151
%153 = load i32, i32* %152
%154 = call i32 @putchar(i32 %153)
br label %138
155: ; preds = %144
%156 = load i32, i32* %9
%157 = icmp sge i32 %156, 0
br i1 %157, label %158, label %164
158: ; preds = %155
%159 = load i32, i32* %9
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [65536 x i32], [65536 x i32]* %11, i64 0, i64 %160
%162 = load i32, i32* %161
%163 = call i32 @putchar(i32 %162)
br label %164
164: ; preds = %158, %155
store i32 0, i32* %3
br label %165
165: ; preds = %164, %37
%166 = load i32, i32* %3
ret i32 %166
}

LLVM IR (-O2):
@.str = [8 x i8] c"oddbits\00"
@.str.1 = [9 x i8] c"evenbits\00"
@.str.2 = [8 x i8] c"xorbits\00"
@stderr = global i32 0
@.str.3 = [53 x i8] c"%s: Should be named oddbits or evenbits or xorbits.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [65536 x i32]
%4 = bitcast [65536 x i32]* %3 to i8*
%5 = load i8*, i8** %1
%6 = tail call i8* @basename(i8* %5)
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %6, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %78, label %9
9: ; preds = %2
%10 = load i8*, i8** %1
%11 = tail call i8* @basename(i8* %10)
%12 = tail call i32 @strcmp(i8* dereferenceable(1) %11, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp eq i32 %12, 0
br i1 %13, label %78, label %14
14: ; preds = %9
%15 = load i8*, i8** %1
%16 = tail call i8* @basename(i8* %15)
%17 = tail call i32 @strcmp(i8* dereferenceable(1) %16, i8* dereferenceable(8) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp eq i32 %17, 0
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = load i32, i32* @stderr
%21 = load i8*, i8** %1
%22 = tail call i8* @basename(i8* %21)
%23 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0), i8* %22)
br label %165
24: ; preds = %14, %24
%25 = phi i64 [ %75, %24 ], [ 0, %14 ]
%26 = phi <4 x i32> [ %76, %24 ], [ <i32 0, i32 1, i32 2, i32 3>, %14 ]
%27 = lshr <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
%28 = and <4 x i32> %27, <i32 1, i32 1, i32 1, i32 1>
%29 = and <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
%30 = lshr <4 x i32> %26, <i32 2, i32 2, i32 2, i32 2>
%31 = and <4 x i32> %30, <i32 2, i32 2, i32 2, i32 2>
%32 = or <4 x i32> %31, %28
%33 = lshr <4 x i32> %26, <i32 1, i32 1, i32 1, i32 1>
%34 = and <4 x i32> %33, <i32 2, i32 2, i32 2, i32 2>
%35 = or <4 x i32> %34, %29
%36 = lshr <4 x i32> %26, <i32 3, i32 3, i32 3, i32 3>
%37 = and <4 x i32> %36, <i32 4, i32 4, i32 4, i32 4>
%38 = or <4 x i32> %37, %32
%39 = lshr <4 x i32> %26, <i32 2, i32 2, i32 2, i32 2>
%40 = and <4 x i32> %39, <i32 4, i32 4, i32 4, i32 4>
%41 = or <4 x i32> %40, %35
%42 = lshr <4 x i32> %26, <i32 4, i32 4, i32 4, i32 4>
%43 = and <4 x i32> %42, <i32 8, i32 8, i32 8, i32 8>
%44 = or <4 x i32> %43, %38
%45 = lshr <4 x i32> %26, <i32 3, i32 3, i32 3, i32 3>
%46 = and <4 x i32> %45, <i32 8, i32 8, i32 8, i32 8>
%47 = or <4 x i32> %46, %41
%48 = lshr <4 x i32> %26, <i32 5, i32 5, i32 5, i32 5>
%49 = and <4 x i32> %48, <i32 16, i32 16, i32 16, i32 16>
%50 = or <4 x i32> %49, %44
%51 = lshr <4 x i32> %26, <i32 4, i32 4, i32 4, i32 4>
%52 = and <4 x i32> %51, <i32 16, i32 16, i32 16, i32 16>
%53 = or <4 x i32> %52, %47
%54 = lshr <4 x i32> %26, <i32 6, i32 6, i32 6, i32 6>
%55 = and <4 x i32> %54, <i32 32, i32 32, i32 32, i32 32>
%56 = or <4 x i32> %55, %50
%57 = lshr <4 x i32> %26, <i32 5, i32 5, i32 5, i32 5>
%58 = and <4 x i32> %57, <i32 32, i32 32, i32 32, i32 32>
%59 = or <4 x i32> %58, %53
%60 = lshr <4 x i32> %26, <i32 7, i32 7, i32 7, i32 7>
%61 = and <4 x i32> %60, <i32 64, i32 64, i32 64, i32 64>
%62 = or <4 x i32> %61, %56
%63 = lshr <4 x i32> %26, <i32 6, i32 6, i32 6, i32 6>
%64 = and <4 x i32> %63, <i32 64, i32 64, i32 64, i32 64>
%65 = or <4 x i32> %64, %59
%66 = lshr <4 x i32> %26, <i32 8, i32 8, i32 8, i32 8>
%67 = and <4 x i32> %66, <i32 128, i32 128, i32 128, i32 128>
%68 = or <4 x i32> %67, %62
%69 = lshr <4 x i32> %26, <i32 7, i32 7, i32 7, i32 7>
%70 = and <4 x i32> %69, <i32 128, i32 128, i32 128, i32 128>
%71 = or <4 x i32> %70, %65
%72 = xor <4 x i32> %71, %68
%73 = getelementptr inbounds [65536 x i32], [65536 x i32]* %3, i64 0, i64 %25
%74 = bitcast i32* %73 to <4 x i32>*
store <4 x i32> %72, <4 x i32>* %74
%75 = add nuw i64 %25, 4
%76 = add <4 x i32> %26, <i32 4, i32 4, i32 4, i32 4>
%77 = icmp eq i64 %75, 65536
br i1 %77, label %144, label %24
78: ; preds = %9, %2
%79 = phi i32 [ 0, %9 ], [ 1, %2 ]
%80 = shl i32 16384, %79
%81 = or i32 %79, 12
%82 = shl nuw i32 1, %81
%83 = shl i32 1024, %79
%84 = or i32 %79, 8
%85 = shl nuw i32 1, %84
%86 = shl i32 64, %79
%87 = or i32 %79, 4
%88 = shl nuw i32 1, %87
%89 = shl i32 4, %79
%90 = insertelement <4 x i32> poison, i32 %79, i64 0
%91 = shufflevector <4 x i32> %90, <4 x i32> poison, <4 x i32> zeroinitializer
%92 = insertelement <4 x i32> poison, i32 %89, i64 0
%93 = shufflevector <4 x i32> %92, <4 x i32> poison, <4 x i32> zeroinitializer
%94 = insertelement <4 x i32> poison, i32 %88, i64 0
%95 = shufflevector <4 x i32> %94, <4 x i32> poison, <4 x i32> zeroinitializer
%96 = insertelement <4 x i32> poison, i32 %86, i64 0
%97 = shufflevector <4 x i32> %96, <4 x i32> poison, <4 x i32> zeroinitializer
%98 = insertelement <4 x i32> poison, i32 %85, i64 0
%99 = shufflevector <4 x i32> %98, <4 x i32> poison, <4 x i32> zeroinitializer
%100 = insertelement <4 x i32> poison, i32 %83, i64 0
%101 = shufflevector <4 x i32> %100, <4 x i32> poison, <4 x i32> zeroinitializer
%102 = insertelement <4 x i32> poison, i32 %82, i64 0
%103 = shufflevector <4 x i32> %102, <4 x i32> poison, <4 x i32> zeroinitializer
%104 = insertelement <4 x i32> poison, i32 %80, i64 0
%105 = shufflevector <4 x i32> %104, <4 x i32> poison, <4 x i32> zeroinitializer
br label %106
106: ; preds = %106, %78
%107 = phi i64 [ 0, %78 ], [ %141, %106 ]
%108 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %78 ], [ %142, %106 ]
%109 = getelementptr inbounds [65536 x i32], [65536 x i32]* %3, i64 0, i64 %107
%110 = lshr <4 x i32> %108, %91
%111 = and <4 x i32> %110, <i32 1, i32 1, i32 1, i32 1>
%112 = and <4 x i32> %93, %108
%113 = icmp eq <4 x i32> %112, zeroinitializer
%114 = or <4 x i32> %111, <i32 2, i32 2, i32 2, i32 2>
%115 = select <4 x i1> %113, <4 x i32> %111, <4 x i32> %114
%116 = and <4 x i32> %95, %108
%117 = icmp eq <4 x i32> %116, zeroinitializer
%118 = or <4 x i32> %115, <i32 4, i32 4, i32 4, i32 4>
%119 = select <4 x i1> %117, <4 x i32> %115, <4 x i32> %118
%120 = and <4 x i32> %97, %108
%121 = icmp eq <4 x i32> %120, zeroinitializer
%122 = or <4 x i32> %119, <i32 8, i32 8, i32 8, i32 8>
%123 = select <4 x i1> %121, <4 x i32> %119, <4 x i32> %122
%124 = and <4 x i32> %99, %108
%125 = icmp eq <4 x i32> %124, zeroinitializer
%126 = or <4 x i32> %123, <i32 16, i32 16, i32 16, i32 16>
%127 = select <4 x i1> %125, <4 x i32> %123, <4 x i32> %126
%128 = and <4 x i32> %101, %108
%129 = icmp eq <4 x i32> %128, zeroinitializer
%130 = or <4 x i32> %127, <i32 32, i32 32, i32 32, i32 32>
%131 = select <4 x i1> %129, <4 x i32> %127, <4 x i32> %130
%132 = and <4 x i32> %103, %108
%133 = icmp eq <4 x i32> %132, zeroinitializer
%134 = or <4 x i32> %131, <i32 64, i32 64, i32 64, i32 64>
%135 = select <4 x i1> %133, <4 x i32> %131, <4 x i32> %134
%136 = and <4 x i32> %105, %108
%137 = icmp eq <4 x i32> %136, zeroinitializer
%138 = or <4 x i32> %135, <i32 128, i32 128, i32 128, i32 128>
%139 = select <4 x i1> %137, <4 x i32> %135, <4 x i32> %138
%140 = bitcast i32* %109 to <4 x i32>*
store <4 x i32> %139, <4 x i32>* %140
%141 = add nuw i64 %107, 4
%142 = add <4 x i32> %108, <i32 4, i32 4, i32 4, i32 4>
%143 = icmp eq i64 %141, 65536
br i1 %143, label %144, label %106
144: ; preds = %24, %106
%145 = tail call i32 (...) @getchar()
%146 = icmp sgt i32 %145, -1
br i1 %146, label %147, label %165
147: ; preds = %144, %151
%148 = phi i32 [ %158, %151 ], [ %145, %144 ]
%149 = tail call i32 (...) @getchar()
%150 = icmp sgt i32 %149, -1
br i1 %150, label %151, label %160
151: ; preds = %147
%152 = shl i32 %149, 8
%153 = or i32 %152, %148
%154 = sext i32 %153 to i64
%155 = getelementptr inbounds [65536 x i32], [65536 x i32]* %3, i64 0, i64 %154
%156 = load i32, i32* %155
%157 = tail call i32 @putchar(i32 %156)
%158 = tail call i32 (...) @getchar()
%159 = icmp sgt i32 %158, -1
br i1 %159, label %147, label %165
160: ; preds = %147
%161 = zext i32 %148 to i64
%162 = getelementptr inbounds [65536 x i32], [65536 x i32]* %3, i64 0, i64 %161
%163 = load i32, i32* %162
%164 = tail call i32 @putchar(i32 %163)
br label %165
165: ; preds = %151, %144, %160, %19
%166 = phi i32 [ 1, %19 ], [ 0, %160 ], [ 0, %144 ], [ 0, %151 ]
ret i32 %166
}