#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*/ IO_put_byte(char);
void AB_output_binary(unsigned long int value) {
  int mask = 128;
  if (value > 0xff)
    AB_output_binary(value >> 8);
  value &= 0xff;
  while (mask) {
    IO_put_byte((value & mask) ? '1' : '0');
    mask >>= 1;
  }
}


x86 assembly (clang, -O0):
<AB_output_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x80,-0xc(%rbp)
cmpq   $0xff,-0x8(%rbp)
jbe    114e <AB_output_binary+0x2e>
mov    -0x8(%rbp),%rdi
shr    $0x8,%rdi
call   1040 <AB_output_binary@plt>
mov    -0x8(%rbp),%rax
and    $0xff,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1198 <AB_output_binary+0x78>
mov    -0x8(%rbp),%rdx
movslq -0xc(%rbp),%rax
and    %rax,%rdx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <IO_put_byte@plt>
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115c <AB_output_binary+0x3c>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AB_output_binary>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
cmp    $0x100,%rdi
jb     113b <AB_output_binary+0x1b>
mov    %rbx,%rdi
shr    $0x8,%rdi
call   1040 <AB_output_binary@plt>
mov    %ebx,%eax
and    $0x80,%eax
cmp    $0x1,%rax
mov    $0x31,%ebp
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <IO_put_byte@plt>
mov    %ebx,%eax
and    $0x40,%eax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <IO_put_byte@plt>
mov    %ebx,%eax
and    $0x20,%eax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <IO_put_byte@plt>
mov    %ebx,%eax
and    $0x10,%eax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <IO_put_byte@plt>
mov    %ebx,%eax
and    $0x8,%eax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <IO_put_byte@plt>
mov    %ebx,%eax
and    $0x4,%eax
cmp    $0x1,%rax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <IO_put_byte@plt>
mov    %ebx,%eax
and    $0x2,%eax
cmp    $0x1,%rax
sbb    $0x0,%ebp
mov    %ebp,%edi
call   1030 <IO_put_byte@plt>
and    $0x1,%ebx
or     $0x30,%ebx
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <IO_put_byte@plt>

LLVM IR (-O0):
define void @AB_output_binary(i64 %0) {
%2 = alloca i64
%3 = alloca i32
store i64 %0, i64* %2
store i32 128, i32* %3
%4 = load i64, i64* %2
%5 = icmp ugt i64 %4, 255
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i64, i64* %2
%8 = lshr i64 %7, 8
br label %9
9: ; preds = %6, %1
%10 = load i64, i64* %2
%11 = and i64 %10, 255
store i64 %11, i64* %2
br label %12
12: ; preds = %15, %9
%13 = load i32, i32* %3
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %12
%16 = load i64, i64* %2
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = and i64 %16, %18
%20 = icmp ne i64 %19, 0
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 49, i32 48
%23 = trunc i32 %22 to i8
%24 = call i32 @IO_put_byte(i8 signext %23)
%25 = load i32, i32* %3
%26 = ashr i32 %25, 1
store i32 %26, i32* %3
br label %12
27: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @AB_output_binary(i64 %0) {
%2 = icmp ugt i64 %0, 255
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = lshr i64 %0, 8
tail call void @AB_output_binary(i64 %4)
br label %5
5: ; preds = %3, %1
%6 = and i64 %0, 128
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i8 48, i8 49
%9 = tail call i32 @IO_put_byte(i8 signext %8)
%10 = and i64 %0, 64
%11 = icmp eq i64 %10, 0
%12 = select i1 %11, i8 48, i8 49
%13 = tail call i32 @IO_put_byte(i8 signext %12)
%14 = and i64 %0, 32
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8 48, i8 49
%17 = tail call i32 @IO_put_byte(i8 signext %16)
%18 = and i64 %0, 16
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i8 48, i8 49
%21 = tail call i32 @IO_put_byte(i8 signext %20)
%22 = and i64 %0, 8
%23 = icmp eq i64 %22, 0
%24 = select i1 %23, i8 48, i8 49
%25 = tail call i32 @IO_put_byte(i8 signext %24)
%26 = and i64 %0, 4
%27 = icmp eq i64 %26, 0
%28 = select i1 %27, i8 48, i8 49
%29 = tail call i32 @IO_put_byte(i8 signext %28)
%30 = and i64 %0, 2
%31 = icmp eq i64 %30, 0
%32 = select i1 %31, i8 48, i8 49
%33 = tail call i32 @IO_put_byte(i8 signext %32)
%34 = and i64 %0, 1
%35 = icmp eq i64 %34, 0
%36 = select i1 %35, i8 48, i8 49
%37 = tail call i32 @IO_put_byte(i8 signext %36)
ret void
}