#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*/ putasc(int, long, long);
void putbitchar(unsigned char c, long x, long y) {
  unsigned char *pbit;
  unsigned char tbit, cbit = *pbit;
  unsigned long i, j;
  i = c * 8;
  i += 0xFFA6E;
  pbit = (char *)i;
  for (j = 0; j < 8; j++) {
    cbit = *(pbit + j);
    for (i = 0; i < 8; i++) {
      tbit = cbit & (1 << (7 - i));
      if (tbit != 0) {
        putasc(219, x + i, y + j);
      }
    }
  }
}


x86 assembly (clang, -O0):
<putbitchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x22(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x3,%eax
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0xffa6e,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
cmpq   $0x8,-0x38(%rbp)
jae    11f4 <putbitchar+0xe4>
mov    -0x20(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x22(%rbp)
movq   $0x0,-0x30(%rbp)
cmpq   $0x8,-0x30(%rbp)
jae    11de <putbitchar+0xce>
movzbl -0x22(%rbp),%eax
mov    $0x7,%ecx
sub    -0x30(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%eax
cmp    $0x0,%eax
je     11c8 <putbitchar+0xb8>
mov    -0x10(%rbp),%rsi
add    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
add    -0x38(%rbp),%rdx
mov    $0xdb,%edi
call   1030 <putasc@plt>
jmp    11cd <putbitchar+0xbd>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    117b <putbitchar+0x6b>
jmp    11e3 <putbitchar+0xd3>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    115a <putbitchar+0x4a>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbitchar>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %edi,%r15d
lea    0x1(%rsi),%rax
mov    %rax,0x30(%rsp)
lea    0x2(%rsi),%rax
mov    %rax,0x28(%rsp)
lea    0x3(%rsi),%rax
mov    %rax,0x20(%rsp)
lea    0x4(%rsi),%rax
mov    %rax,0x18(%rsp)
lea    0x5(%rsi),%rax
mov    %rax,0x10(%rsp)
lea    0x6(%rsi),%rax
mov    %rax,0x8(%rsp)
lea    0x7(%rsi),%rax
mov    %rax,(%rsp)
xor    %r12d,%r12d
jmp    117e <putbitchar+0x6e>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    $0x8,%r12
je     129c <putbitchar+0x18c>
movzbl 0xffa6e(%r12,%r15,8),%r13d
lea    (%rbx,%r12,1),%rbp
test   %r13b,%r13b
js     11d0 <putbitchar+0xc0>
test   $0x40,%r13b
jne    11e6 <putbitchar+0xd6>
test   $0x20,%r13b
jne    11fe <putbitchar+0xee>
test   $0x10,%r13b
jne    1216 <putbitchar+0x106>
test   $0x8,%r13b
jne    1232 <putbitchar+0x122>
test   $0x4,%r13b
jne    124e <putbitchar+0x13e>
test   $0x2,%r13b
jne    126a <putbitchar+0x15a>
test   $0x1,%r13b
je     1170 <putbitchar+0x60>
jmp    1286 <putbitchar+0x176>
nopl   0x0(%rax,%rax,1)
mov    $0xdb,%edi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x40,%r13b
je     1196 <putbitchar+0x86>
mov    $0xdb,%edi
mov    0x30(%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x20,%r13b
je     119c <putbitchar+0x8c>
mov    $0xdb,%edi
mov    0x28(%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x10,%r13b
je     11a2 <putbitchar+0x92>
mov    $0xdb,%edi
mov    0x20(%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x8,%r13b
je     11ac <putbitchar+0x9c>
mov    $0xdb,%edi
mov    0x18(%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x4,%r13b
je     11b6 <putbitchar+0xa6>
mov    $0xdb,%edi
mov    0x10(%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x2,%r13b
je     11c0 <putbitchar+0xb0>
mov    $0xdb,%edi
mov    0x8(%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
test   $0x1,%r13b
je     1170 <putbitchar+0x60>
mov    $0xdb,%edi
mov    (%rsp),%rsi
mov    %rbp,%rdx
call   1030 <putasc@plt>
jmp    1170 <putbitchar+0x60>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @putbitchar(i8 zeroext %0, i64 %1, i64 %2) {
%4 = alloca i8
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8
%9 = alloca i8
%10 = alloca i64
%11 = alloca i64
store i8 %0, i8* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%12 = load i8*, i8** %7
%13 = load i8, i8* %12
store i8 %13, i8* %9
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = mul nsw i32 %15, 8
%17 = sext i32 %16 to i64
store i64 %17, i64* %10
%18 = load i64, i64* %10
%19 = add i64 %18, 1047150
store i64 %19, i64* %10
%20 = load i64, i64* %10
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %7
store i64 0, i64* %11
br label %22
22: ; preds = %58, %3
%23 = load i64, i64* %11
%24 = icmp ult i64 %23, 8
br i1 %24, label %25, label %61
25: ; preds = %22
%26 = load i8*, i8** %7
%27 = load i64, i64* %11
%28 = getelementptr inbounds i8, i8* %26, i64 %27
%29 = load i8, i8* %28
store i8 %29, i8* %9
store i64 0, i64* %10
br label %30
30: ; preds = %54, %25
%31 = load i64, i64* %10
%32 = icmp ult i64 %31, 8
br i1 %32, label %33, label %57
33: ; preds = %30
%34 = load i8, i8* %9
%35 = zext i8 %34 to i32
%36 = load i64, i64* %10
%37 = sub i64 7, %36
%38 = trunc i64 %37 to i32
%39 = shl i32 1, %38
%40 = and i32 %35, %39
%41 = trunc i32 %40 to i8
store i8 %41, i8* %8
%42 = load i8, i8* %8
%43 = zext i8 %42 to i32
%44 = icmp ne i32 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %33
%46 = load i64, i64* %5
%47 = load i64, i64* %10
%48 = add i64 %46, %47
%49 = load i64, i64* %6
%50 = load i64, i64* %11
%51 = add i64 %49, %50
%52 = call i32 @putasc(i32 219, i64 %48, i64 %51)
br label %53
53: ; preds = %45, %33
br label %54
54: ; preds = %53
%55 = load i64, i64* %10
%56 = add i64 %55, 1
store i64 %56, i64* %10
br label %30
57: ; preds = %30
br label %58
58: ; preds = %57
%59 = load i64, i64* %11
%60 = add i64 %59, 1
store i64 %60, i64* %11
br label %22
61: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @putbitchar(i8 zeroext %0, i64 %1, i64 %2) {
%4 = zext i8 %0 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = add nuw nsw i64 %5, 1047150
%7 = inttoptr i64 %6 to i8*
%8 = add i64 %1, 1
%9 = add i64 %1, 2
%10 = add i64 %1, 3
%11 = add i64 %1, 4
%12 = add i64 %1, 5
%13 = add i64 %1, 6
%14 = add i64 %1, 7
br label %15
15: ; preds = %3, %58
%16 = phi i64 [ 0, %3 ], [ %59, %58 ]
%17 = getelementptr inbounds i8, i8* %7, i64 %16
%18 = load i8, i8* %17
%19 = add i64 %16, %2
%20 = icmp sgt i8 %18, -1
br i1 %20, label %23, label %21
21: ; preds = %15
%22 = tail call i32 @putasc(i32 219, i64 %1, i64 %19)
br label %23
23: ; preds = %15, %21
%24 = and i8 %18, 64
%25 = icmp eq i8 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %23
%27 = tail call i32 @putasc(i32 219, i64 %8, i64 %19)
br label %28
28: ; preds = %26, %23
%29 = and i8 %18, 32
%30 = icmp eq i8 %29, 0
br i1 %30, label %33, label %31
31: ; preds = %28
%32 = tail call i32 @putasc(i32 219, i64 %9, i64 %19)
br label %33
33: ; preds = %31, %28
%34 = and i8 %18, 16
%35 = icmp eq i8 %34, 0
br i1 %35, label %38, label %36
36: ; preds = %33
%37 = tail call i32 @putasc(i32 219, i64 %10, i64 %19)
br label %38
38: ; preds = %36, %33
%39 = and i8 %18, 8
%40 = icmp eq i8 %39, 0
br i1 %40, label %43, label %41
41: ; preds = %38
%42 = tail call i32 @putasc(i32 219, i64 %11, i64 %19)
br label %43
43: ; preds = %41, %38
%44 = and i8 %18, 4
%45 = icmp eq i8 %44, 0
br i1 %45, label %48, label %46
46: ; preds = %43
%47 = tail call i32 @putasc(i32 219, i64 %12, i64 %19)
br label %48
48: ; preds = %46, %43
%49 = and i8 %18, 2
%50 = icmp eq i8 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %48
%52 = tail call i32 @putasc(i32 219, i64 %13, i64 %19)
br label %53
53: ; preds = %51, %48
%54 = and i8 %18, 1
%55 = icmp eq i8 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %53
%57 = tail call i32 @putasc(i32 219, i64 %14, i64 %19)
br label %58
58: ; preds = %56, %53
%59 = add nuw nsw i64 %16, 1
%60 = icmp eq i64 %59, 8
br i1 %60, label %61, label %15
61: ; preds = %58
ret void
}