#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*/ putbit0();
int /*<<< orphan*/ putbit1();
void output2(int x, int y) {
  int mask;
  putbit0();
  mask = (1 << 12);
  while (mask >>= 1) {
    if (x & mask)
      putbit1();
    else
      putbit0();
  }
  mask = (1 << 4);
  while (mask >>= 1) {
    if (y & mask)
      putbit1();
    else
      putbit0();
  }
}


x86 assembly (clang, -O0):
<output2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <putbit0@plt>
movl   $0x1000,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     1175 <output2+0x55>
mov    -0x4(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     1169 <output2+0x49>
mov    $0x0,%al
call   1030 <putbit1@plt>
jmp    1170 <output2+0x50>
mov    $0x0,%al
call   1040 <putbit0@plt>
jmp    113c <output2+0x1c>
movl   $0x10,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
je     11b5 <output2+0x95>
mov    -0x8(%rbp),%eax
and    -0xc(%rbp),%eax
cmp    $0x0,%eax
je     11a9 <output2+0x89>
mov    $0x0,%al
call   1030 <putbit1@plt>
jmp    11b0 <output2+0x90>
mov    $0x0,%al
call   1040 <putbit0@plt>
jmp    117c <output2+0x5c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output2>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <putbit0@plt>
xor    %eax,%eax
test   $0x800,%ebp
jne    113f <output2+0x1f>
call   1040 <putbit0@plt>
jmp    1144 <output2+0x24>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x400,%ebp
jne    1155 <output2+0x35>
call   1040 <putbit0@plt>
jmp    115a <output2+0x3a>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x200,%ebp
jne    116b <output2+0x4b>
call   1040 <putbit0@plt>
jmp    1170 <output2+0x50>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x100,%ebp
jne    1181 <output2+0x61>
call   1040 <putbit0@plt>
jmp    1186 <output2+0x66>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x80,%bpl
jne    1195 <output2+0x75>
call   1040 <putbit0@plt>
jmp    119a <output2+0x7a>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x40,%bpl
jne    11a9 <output2+0x89>
call   1040 <putbit0@plt>
jmp    11ae <output2+0x8e>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x20,%bpl
jne    11bd <output2+0x9d>
call   1040 <putbit0@plt>
jmp    11c2 <output2+0xa2>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x10,%bpl
jne    11d1 <output2+0xb1>
call   1040 <putbit0@plt>
jmp    11d6 <output2+0xb6>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x8,%bpl
jne    11e5 <output2+0xc5>
call   1040 <putbit0@plt>
jmp    11ea <output2+0xca>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x4,%bpl
jne    11f9 <output2+0xd9>
call   1040 <putbit0@plt>
jmp    11fe <output2+0xde>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x2,%bpl
jne    120d <output2+0xed>
call   1040 <putbit0@plt>
jmp    1212 <output2+0xf2>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x1,%bpl
jne    1221 <output2+0x101>
call   1040 <putbit0@plt>
jmp    1226 <output2+0x106>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x8,%bl
jne    1234 <output2+0x114>
call   1040 <putbit0@plt>
jmp    1239 <output2+0x119>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x4,%bl
jne    1247 <output2+0x127>
call   1040 <putbit0@plt>
jmp    124c <output2+0x12c>
call   1030 <putbit1@plt>
xor    %eax,%eax
test   $0x2,%bl
jne    125a <output2+0x13a>
call   1040 <putbit0@plt>
jmp    125f <output2+0x13f>
call   1030 <putbit1@plt>
xor    %eax,%eax
add    $0x8,%rsp
test   $0x1,%bl
jne    1271 <output2+0x151>
pop    %rbx
pop    %rbp
jmp    1040 <putbit0@plt>
pop    %rbx
pop    %rbp
jmp    1030 <putbit1@plt>

LLVM IR (-O0):
define void @output2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = call i32 (...) @putbit0()
store i32 4096, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = ashr i32 %8, 1
store i32 %9, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i32, i32* %3
%13 = load i32, i32* %5
%14 = and i32 %12, %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 (...) @putbit1()
br label %20
18: ; preds = %11
%19 = call i32 (...) @putbit0()
br label %20
20: ; preds = %18, %16
br label %7
21: ; preds = %7
store i32 16, i32* %5
br label %22
22: ; preds = %35, %21
%23 = load i32, i32* %5
%24 = ashr i32 %23, 1
store i32 %24, i32* %5
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %36
26: ; preds = %22
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = and i32 %27, %28
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %26
%32 = call i32 (...) @putbit1()
br label %35
33: ; preds = %26
%34 = call i32 (...) @putbit0()
br label %35
35: ; preds = %33, %31
br label %22
36: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @output2(i32 %0, i32 %1) {
%3 = tail call i32 (...) @putbit0()
%4 = and i32 %0, 2048
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @putbit1()
br label %10
8: ; preds = %2
%9 = tail call i32 (...) @putbit0()
br label %10
10: ; preds = %8, %6
%11 = and i32 %0, 1024
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @putbit1()
br label %17
15: ; preds = %10
%16 = tail call i32 (...) @putbit0()
br label %17
17: ; preds = %15, %13
%18 = and i32 %0, 512
%19 = icmp eq i32 %18, 0
br i1 %19, label %22, label %20
20: ; preds = %17
%21 = tail call i32 (...) @putbit1()
br label %24
22: ; preds = %17
%23 = tail call i32 (...) @putbit0()
br label %24
24: ; preds = %22, %20
%25 = and i32 %0, 256
%26 = icmp eq i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %24
%28 = tail call i32 (...) @putbit1()
br label %31
29: ; preds = %24
%30 = tail call i32 (...) @putbit0()
br label %31
31: ; preds = %29, %27
%32 = and i32 %0, 128
%33 = icmp eq i32 %32, 0
br i1 %33, label %36, label %34
34: ; preds = %31
%35 = tail call i32 (...) @putbit1()
br label %38
36: ; preds = %31
%37 = tail call i32 (...) @putbit0()
br label %38
38: ; preds = %36, %34
%39 = and i32 %0, 64
%40 = icmp eq i32 %39, 0
br i1 %40, label %43, label %41
41: ; preds = %38
%42 = tail call i32 (...) @putbit1()
br label %45
43: ; preds = %38
%44 = tail call i32 (...) @putbit0()
br label %45
45: ; preds = %43, %41
%46 = and i32 %0, 32
%47 = icmp eq i32 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = tail call i32 (...) @putbit1()
br label %52
50: ; preds = %45
%51 = tail call i32 (...) @putbit0()
br label %52
52: ; preds = %50, %48
%53 = and i32 %0, 16
%54 = icmp eq i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %52
%56 = tail call i32 (...) @putbit1()
br label %59
57: ; preds = %52
%58 = tail call i32 (...) @putbit0()
br label %59
59: ; preds = %57, %55
%60 = and i32 %0, 8
%61 = icmp eq i32 %60, 0
br i1 %61, label %64, label %62
62: ; preds = %59
%63 = tail call i32 (...) @putbit1()
br label %66
64: ; preds = %59
%65 = tail call i32 (...) @putbit0()
br label %66
66: ; preds = %64, %62
%67 = and i32 %0, 4
%68 = icmp eq i32 %67, 0
br i1 %68, label %71, label %69
69: ; preds = %66
%70 = tail call i32 (...) @putbit1()
br label %73
71: ; preds = %66
%72 = tail call i32 (...) @putbit0()
br label %73
73: ; preds = %71, %69
%74 = and i32 %0, 2
%75 = icmp eq i32 %74, 0
br i1 %75, label %78, label %76
76: ; preds = %73
%77 = tail call i32 (...) @putbit1()
br label %80
78: ; preds = %73
%79 = tail call i32 (...) @putbit0()
br label %80
80: ; preds = %78, %76
%81 = and i32 %0, 1
%82 = icmp eq i32 %81, 0
br i1 %82, label %85, label %83
83: ; preds = %80
%84 = tail call i32 (...) @putbit1()
br label %87
85: ; preds = %80
%86 = tail call i32 (...) @putbit0()
br label %87
87: ; preds = %85, %83
%88 = and i32 %1, 8
%89 = icmp eq i32 %88, 0
br i1 %89, label %92, label %90
90: ; preds = %87
%91 = tail call i32 (...) @putbit1()
br label %94
92: ; preds = %87
%93 = tail call i32 (...) @putbit0()
br label %94
94: ; preds = %92, %90
%95 = and i32 %1, 4
%96 = icmp eq i32 %95, 0
br i1 %96, label %99, label %97
97: ; preds = %94
%98 = tail call i32 (...) @putbit1()
br label %101
99: ; preds = %94
%100 = tail call i32 (...) @putbit0()
br label %101
101: ; preds = %99, %97
%102 = and i32 %1, 2
%103 = icmp eq i32 %102, 0
br i1 %103, label %106, label %104
104: ; preds = %101
%105 = tail call i32 (...) @putbit1()
br label %108
106: ; preds = %101
%107 = tail call i32 (...) @putbit0()
br label %108
108: ; preds = %106, %104
%109 = and i32 %1, 1
%110 = icmp eq i32 %109, 0
br i1 %110, label %113, label %111
111: ; preds = %108
%112 = tail call i32 (...) @putbit1()
br label %115
113: ; preds = %108
%114 = tail call i32 (...) @putbit0()
br label %115
115: ; preds = %113, %111
ret void
}