#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, int);
void Extra_PrintBinary_(FILE *pFile, unsigned Sign[], int nBits) {
  int Remainder, nWords;
  int w, i;
  Remainder = (nBits % (sizeof(unsigned) * 8));
  nWords = (nBits / (sizeof(unsigned) * 8)) + (Remainder > 0);
  for (w = nWords - 1; w >= 0; w--)
    for (i = ((w == nWords - 1 && Remainder) ? Remainder - 1 : 31); i >= 0; i--)
      fprintf(pFile, "%c", '0' + (int)((Sign[w] & (1 << i)) > 0));
}


x86 assembly (clang, -O0):
<Extra_PrintBinary_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movslq -0x14(%rbp),%rax
and    $0x1f,%rax
mov    %eax,-0x18(%rbp)
movslq -0x14(%rbp),%rax
shr    $0x5,%rax
cmpl   $0x0,-0x18(%rbp)
setg   %cl
and    $0x1,%cl
movzbl %cl,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jl     11fd <Extra_PrintBinary_+0xed>
mov    -0x20(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    1188 <Extra_PrintBinary_+0x78>
cmpl   $0x0,-0x18(%rbp)
je     1188 <Extra_PrintBinary_+0x78>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1195 <Extra_PrintBinary_+0x85>
mov    $0x1f,%eax
mov    %eax,-0x28(%rbp)
jmp    1195 <Extra_PrintBinary_+0x85>
mov    -0x28(%rbp),%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     11ea <Extra_PrintBinary_+0xda>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x24(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
seta   %al
and    $0x1,%al
movzbl %al,%edx
add    $0x30,%edx
lea    0xe29(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    119b <Extra_PrintBinary_+0x8b>
jmp    11ef <Extra_PrintBinary_+0xdf>
mov    -0x20(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x20(%rbp)
jmp    1155 <Extra_PrintBinary_+0x45>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Extra_PrintBinary_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movslq %edx,%rdx
mov    %rdx,%rcx
shr    $0x5,%rcx
xor    %eax,%eax
and    $0x1f,%edx
mov    %rdx,0x10(%rsp)
setne  %al
add    %rcx,%rax
test   %eax,%eax
jle    11ad <Extra_PrintBinary_+0x9d>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x10(%rsp),%rcx
add    $0xffffffff,%ecx
mov    %ecx,0xc(%rsp)
movslq %eax,%r12
lea    -0x1(%r12),%eax
movslq %eax,%r15
jmp    1169 <Extra_PrintBinary_+0x59>
nopl   0x0(%rax,%rax,1)
cmp    $0x1,%r12
mov    %r13,%r12
jle    11ad <Extra_PrintBinary_+0x9d>
lea    -0x1(%r12),%r13
cmp    %r15,%r13
mov    $0x1f,%ebp
cmove  0xc(%rsp),%ebp
cmpl   $0x0,0x10(%rsp)
mov    $0x1f,%eax
cmove  %eax,%ebp
test   %ebp,%ebp
js     1160 <Extra_PrintBinary_+0x50>
nopl   0x0(%rax)
mov    (%r14,%r13,4),%edi
mov    %ebp,%ecx
shr    %cl,%edi
and    $0x1,%edi
or     $0x30,%edi
mov    %rbx,%rsi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jb     1190 <Extra_PrintBinary_+0x80>
jmp    1160 <Extra_PrintBinary_+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @Extra_PrintBinary_(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = urem i64 %12, 32
%14 = trunc i64 %13 to i32
store i32 %14, i32* %7
%15 = load i32, i32* %6
%16 = sext i32 %15 to i64
%17 = udiv i64 %16, 32
%18 = load i32, i32* %7
%19 = icmp sgt i32 %18, 0
%20 = zext i1 %19 to i32
%21 = sext i32 %20 to i64
%22 = add i64 %17, %21
%23 = trunc i64 %22 to i32
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = sub nsw i32 %24, 1
store i32 %25, i32* %9
br label %26
26: ; preds = %64, %3
%27 = load i32, i32* %9
%28 = icmp sge i32 %27, 0
br i1 %28, label %29, label %67
29: ; preds = %26
%30 = load i32, i32* %9
%31 = load i32, i32* %8
%32 = sub nsw i32 %31, 1
%33 = icmp eq i32 %30, %32
br i1 %33, label %34, label %40
34: ; preds = %29
%35 = load i32, i32* %7
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %34
%38 = load i32, i32* %7
%39 = sub nsw i32 %38, 1
br label %41
40: ; preds = %34, %29
br label %41
41: ; preds = %40, %37
%42 = phi i32 [ %39, %37 ], [ 31, %40 ]
store i32 %42, i32* %10
br label %43
43: ; preds = %60, %41
%44 = load i32, i32* %10
%45 = icmp sge i32 %44, 0
br i1 %45, label %46, label %63
46: ; preds = %43
%47 = load i32*, i32** %4
%48 = load i32*, i32** %5
%49 = load i32, i32* %9
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i32, i32* %48, i64 %50
%52 = load i32, i32* %51
%53 = load i32, i32* %10
%54 = shl i32 1, %53
%55 = and i32 %52, %54
%56 = icmp ugt i32 %55, 0
%57 = zext i1 %56 to i32
%58 = add nsw i32 48, %57
%59 = call i32 @fprintf(i32* %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %46
%61 = load i32, i32* %10
%62 = add nsw i32 %61, -1
store i32 %62, i32* %10
br label %43
63: ; preds = %43
br label %64
64: ; preds = %63
%65 = load i32, i32* %9
%66 = add nsw i32 %65, -1
store i32 %66, i32* %9
br label %26
67: ; preds = %26
ret void
}

LLVM IR (-O2):
define void @Extra_PrintBinary_(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = and i32 %2, 31
%6 = lshr i64 %4, 5
%7 = icmp ne i32 %5, 0
%8 = zext i1 %7 to i64
%9 = add nuw nsw i64 %6, %8
%10 = trunc i64 %9 to i32
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %39
12: ; preds = %3
%13 = add nsw i32 %5, -1
%14 = shl i64 %9, 32
%15 = ashr exact i64 %14, 32
%16 = shl i64 %9, 32
%17 = add i64 %16, -4294967296
%18 = ashr exact i64 %17, 32
br label %19
19: ; preds = %12, %37
%20 = phi i64 [ %15, %12 ], [ %21, %37 ]
%21 = add nsw i64 %20, -1
%22 = icmp eq i64 %21, %18
%23 = and i1 %7, %22
%24 = select i1 %23, i32 %13, i32 31
%25 = icmp sgt i32 %24, -1
br i1 %25, label %26, label %37
26: ; preds = %19
%27 = getelementptr inbounds i32, i32* %1, i64 %21
br label %28
28: ; preds = %26, %28
%29 = phi i32 [ %24, %26 ], [ %35, %28 ]
%30 = load i32, i32* %27
%31 = lshr i32 %30, %29
%32 = and i32 %31, 1
%33 = or i32 %32, 48
%34 = tail call i32 @fputc(i32 %33, i32* %0)
%35 = add nsw i32 %29, -1
%36 = icmp eq i32 %29, 0
br i1 %36, label %37, label %28
37: ; preds = %28, %19
%38 = icmp sgt i64 %20, 1
br i1 %38, label %19, label %39
39: ; preds = %37, %3
ret void
}