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

/* Variables and functions */
int CHAR_BIT;
void tb_dump_unsigned_char(char *dest_, unsigned char n_) {
  unsigned i;
  for (i = sizeof(n_) * CHAR_BIT; 0u < i; i--) {
    *dest_ = '0' + ((n_ >> (i - 1)) & 1);
    ;
    ++dest_;
  }
}


x86 assembly (clang, -O0):
<tb_dump_unsigned_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    0x2ecb(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jae    115e <tb_dump_unsigned_char+0x5e>
movzbl -0x9(%rbp),%eax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
sar    %cl,%eax
and    $0x1,%eax
add    $0x30,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    111f <tb_dump_unsigned_char+0x1f>
pop    %rbp
ret

x86 assembly (clang, -O2):
<tb_dump_unsigned_char>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
test   %ecx,%ecx
je     1655 <tb_dump_unsigned_char+0x555>
movzbl %sil,%eax
lea    -0x1(%rcx),%r9d
cmp    $0xf,%r9d
jb     162e <tb_dump_unsigned_char+0x52e>
add    $0x1,%r9
mov    %r9,%r8
and    $0xfffffffffffffff0,%r8
movd   %ecx,%xmm0
pshufd $0x0,%xmm0,%xmm14
movdqa 0xebf(%rip),%xmm15
paddd  %xmm14,%xmm15
movdqa 0xec1(%rip),%xmm9
paddd  %xmm14,%xmm9
movdqa 0xec3(%rip),%xmm13
paddd  %xmm14,%xmm13
paddd  0xec5(%rip),%xmm14
movd   %eax,%xmm0
pshufd $0x0,%xmm0,%xmm10
lea    -0x10(%r8),%rdx
mov    %rdx,%r10
shr    $0x4,%r10
add    $0x1,%r10
test   %rdx,%rdx
je     1656 <tb_dump_unsigned_char+0x556>
mov    %r10,%rdx
and    $0xfffffffffffffffe,%rdx
xor    %esi,%esi
movdqa 0xec1(%rip),%xmm11
movdqa 0xec8(%rip),%xmm12
nopl   0x0(%rax,%rax,1)
movdqa %xmm13,%xmm1
pcmpeqd %xmm3,%xmm3
paddd  %xmm3,%xmm1
movdqa %xmm14,%xmm2
paddd  %xmm3,%xmm2
movdqa %xmm15,%xmm5
movdqa %xmm9,%xmm4
paddd  %xmm3,%xmm4
pshuflw $0xfe,%xmm4,%xmm0
movdqa %xmm10,%xmm6
psrld  %xmm0,%xmm6
paddd  %xmm3,%xmm5
pshuflw $0x54,%xmm4,%xmm8
movdqa %xmm10,%xmm0
psrld  %xmm8,%xmm0
pshufd $0xee,%xmm4,%xmm4
pshuflw $0xfe,%xmm4,%xmm7
movdqa %xmm10,%xmm3
psrld  %xmm7,%xmm3
punpcklqdq %xmm6,%xmm0
pshuflw $0x54,%xmm4,%xmm4
movdqa %xmm10,%xmm6
psrld  %xmm4,%xmm6
punpckhqdq %xmm3,%xmm6
pshuflw $0xfe,%xmm5,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
shufps $0xcc,%xmm6,%xmm0
pshuflw $0x54,%xmm5,%xmm3
movdqa %xmm10,%xmm6
psrld  %xmm3,%xmm6
pshufd $0xee,%xmm5,%xmm3
pshuflw $0xfe,%xmm3,%xmm5
movdqa %xmm10,%xmm7
psrld  %xmm5,%xmm7
punpcklqdq %xmm4,%xmm6
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
punpckhqdq %xmm7,%xmm4
pshuflw $0xfe,%xmm2,%xmm3
movdqa %xmm10,%xmm7
psrld  %xmm3,%xmm7
shufps $0xcc,%xmm4,%xmm6
pshuflw $0x54,%xmm2,%xmm3
movdqa %xmm10,%xmm5
psrld  %xmm3,%xmm5
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
packuswb %xmm6,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm10,%xmm3
psrld  %xmm2,%xmm3
punpcklqdq %xmm7,%xmm5
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm10,%xmm6
psrld  %xmm2,%xmm6
punpckhqdq %xmm4,%xmm3
pshuflw $0x54,%xmm1,%xmm2
movdqa %xmm10,%xmm4
psrld  %xmm2,%xmm4
pshufd $0xee,%xmm1,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm10,%xmm7
psrld  %xmm2,%xmm7
shufps $0xcc,%xmm3,%xmm5
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm10,%xmm2
psrld  %xmm1,%xmm2
punpcklqdq %xmm6,%xmm4
punpckhqdq %xmm7,%xmm2
shufps $0xcc,%xmm2,%xmm4
packuswb %xmm4,%xmm5
packuswb %xmm0,%xmm5
movdqa 0xd2e(%rip),%xmm7
pand   %xmm7,%xmm5
movdqa 0xd31(%rip),%xmm8
por    %xmm8,%xmm5
movdqu %xmm5,(%rdi,%rsi,1)
movdqa %xmm15,%xmm1
movdqa %xmm9,%xmm2
paddd  %xmm11,%xmm2
pshuflw $0xfe,%xmm2,%xmm0
movdqa %xmm10,%xmm3
psrld  %xmm0,%xmm3
paddd  %xmm11,%xmm1
pshuflw $0x54,%xmm2,%xmm4
movdqa %xmm10,%xmm0
psrld  %xmm4,%xmm0
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm4
movdqa %xmm10,%xmm5
psrld  %xmm4,%xmm5
punpcklqdq %xmm3,%xmm0
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm10,%xmm3
psrld  %xmm2,%xmm3
punpckhqdq %xmm5,%xmm3
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm10,%xmm4
psrld  %xmm2,%xmm4
shufps $0xcc,%xmm3,%xmm0
pshuflw $0x54,%xmm1,%xmm2
movdqa %xmm10,%xmm3
psrld  %xmm2,%xmm3
pshufd $0xee,%xmm1,%xmm1
pshuflw $0xfe,%xmm1,%xmm2
movdqa %xmm10,%xmm5
psrld  %xmm2,%xmm5
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm10,%xmm6
psrld  %xmm1,%xmm6
movdqa %xmm13,%xmm2
paddd  %xmm11,%xmm2
punpcklqdq %xmm4,%xmm3
movdqa %xmm14,%xmm4
paddd  %xmm11,%xmm4
punpckhqdq %xmm5,%xmm6
shufps $0xcc,%xmm6,%xmm3
packuswb %xmm3,%xmm0
pshuflw $0xfe,%xmm4,%xmm1
movdqa %xmm10,%xmm3
psrld  %xmm1,%xmm3
pshuflw $0x54,%xmm4,%xmm5
movdqa %xmm10,%xmm1
psrld  %xmm5,%xmm1
punpcklqdq %xmm3,%xmm1
pshufd $0xee,%xmm4,%xmm3
pshuflw $0xfe,%xmm3,%xmm4
movdqa %xmm10,%xmm5
psrld  %xmm4,%xmm5
pshuflw $0x54,%xmm3,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
punpckhqdq %xmm5,%xmm4
shufps $0xcc,%xmm4,%xmm1
pshuflw $0xfe,%xmm2,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
pshuflw $0x54,%xmm2,%xmm3
movdqa %xmm10,%xmm5
psrld  %xmm3,%xmm5
punpcklqdq %xmm4,%xmm5
pshufd $0xee,%xmm2,%xmm2
pshuflw $0xfe,%xmm2,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm10,%xmm3
psrld  %xmm2,%xmm3
punpckhqdq %xmm4,%xmm3
shufps $0xcc,%xmm3,%xmm5
packuswb %xmm5,%xmm1
packuswb %xmm0,%xmm1
pand   %xmm7,%xmm1
por    %xmm8,%xmm1
movdqu %xmm1,0x10(%rdi,%rsi,1)
add    $0x20,%rsi
paddd  %xmm12,%xmm14
paddd  %xmm12,%xmm13
paddd  %xmm12,%xmm9
paddd  %xmm12,%xmm15
add    $0xfffffffffffffffe,%rdx
jne    11b0 <tb_dump_unsigned_char+0xb0>
test   $0x1,%r10b
je     1623 <tb_dump_unsigned_char+0x523>
pcmpeqd %xmm1,%xmm1
paddd  %xmm1,%xmm13
paddd  %xmm1,%xmm9
pshuflw $0xfe,%xmm9,%xmm0
movdqa %xmm10,%xmm2
psrld  %xmm0,%xmm2
paddd  %xmm1,%xmm14
pshuflw $0x54,%xmm9,%xmm3
movdqa %xmm10,%xmm0
psrld  %xmm3,%xmm0
pshufd $0xee,%xmm9,%xmm3
pshuflw $0xfe,%xmm3,%xmm4
movdqa %xmm10,%xmm5
psrld  %xmm4,%xmm5
paddd  %xmm1,%xmm15
pshuflw $0x54,%xmm3,%xmm1
movdqa %xmm10,%xmm3
psrld  %xmm1,%xmm3
punpcklqdq %xmm2,%xmm0
pshuflw $0xfe,%xmm15,%xmm1
movdqa %xmm10,%xmm2
psrld  %xmm1,%xmm2
punpckhqdq %xmm5,%xmm3
pshuflw $0x54,%xmm15,%xmm1
movdqa %xmm10,%xmm4
psrld  %xmm1,%xmm4
pshufd $0xee,%xmm15,%xmm1
pshuflw $0xfe,%xmm1,%xmm5
movdqa %xmm10,%xmm6
psrld  %xmm5,%xmm6
shufps $0xcc,%xmm3,%xmm0
pshuflw $0x54,%xmm1,%xmm1
movdqa %xmm10,%xmm3
psrld  %xmm1,%xmm3
punpcklqdq %xmm2,%xmm4
punpckhqdq %xmm6,%xmm3
shufps $0xcc,%xmm3,%xmm4
packuswb %xmm4,%xmm0
pshuflw $0xfe,%xmm14,%xmm1
movdqa %xmm10,%xmm2
psrld  %xmm1,%xmm2
pshuflw $0x54,%xmm14,%xmm3
movdqa %xmm10,%xmm1
psrld  %xmm3,%xmm1
punpcklqdq %xmm2,%xmm1
pshufd $0xee,%xmm14,%xmm2
pshuflw $0xfe,%xmm2,%xmm3
movdqa %xmm10,%xmm4
psrld  %xmm3,%xmm4
pshuflw $0x54,%xmm2,%xmm2
movdqa %xmm10,%xmm3
psrld  %xmm2,%xmm3
punpckhqdq %xmm4,%xmm3
shufps $0xcc,%xmm3,%xmm1
pshuflw $0xfe,%xmm13,%xmm2
movdqa %xmm10,%xmm3
psrld  %xmm2,%xmm3
pshuflw $0x54,%xmm13,%xmm2
movdqa %xmm10,%xmm4
psrld  %xmm2,%xmm4
punpcklqdq %xmm3,%xmm4
pshufd $0xee,%xmm13,%xmm2
pshuflw $0xfe,%xmm2,%xmm3
movdqa %xmm10,%xmm5
psrld  %xmm3,%xmm5
pshuflw $0x54,%xmm2,%xmm2
psrld  %xmm2,%xmm10
punpckhqdq %xmm5,%xmm10
shufps $0xcc,%xmm10,%xmm4
packuswb %xmm4,%xmm1
packuswb %xmm0,%xmm1
pand   0xa2a(%rip),%xmm1
por    0xa32(%rip),%xmm1
movdqu %xmm1,(%rdi,%rsi,1)
cmp    %r8,%r9
je     1655 <tb_dump_unsigned_char+0x555>
sub    %r8d,%ecx
add    %r8,%rdi
add    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %eax,%edx
shr    %cl,%edx
and    $0x1,%dl
or     $0x30,%dl
mov    %dl,(%rdi)
add    $0x1,%rdi
add    $0xffffffff,%ecx
jb     1640 <tb_dump_unsigned_char+0x540>
ret
xor    %esi,%esi
test   $0x1,%r10b
jne    14bc <tb_dump_unsigned_char+0x3bc>
jmp    1623 <tb_dump_unsigned_char+0x523>

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define void @tb_dump_unsigned_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i32
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i32, i32* @CHAR_BIT
%7 = sext i32 %6 to i64
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
store i32 %9, i32* %5
br label %10
10: ; preds = %25, %2
%11 = load i32, i32* %5
%12 = icmp ult i32 0, %11
br i1 %12, label %13, label %28
13: ; preds = %10
%14 = load i8, i8* %4
%15 = zext i8 %14 to i32
%16 = load i32, i32* %5
%17 = sub i32 %16, 1
%18 = ashr i32 %15, %17
%19 = and i32 %18, 1
%20 = add nsw i32 48, %19
%21 = trunc i32 %20 to i8
%22 = load i8*, i8** %3
store i8 %21, i8* %22
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i32 1
store i8* %24, i8** %3
br label %25
25: ; preds = %13
%26 = load i32, i32* %5
%27 = add i32 %26, -1
store i32 %27, i32* %5
br label %10
28: ; preds = %10
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define void @tb_dump_unsigned_char(i8* nocapture writeonly %0, i8 zeroext %1) {
%3 = load i32, i32* @CHAR_BIT
%4 = icmp eq i32 %3, 0
br i1 %4, label %78, label %5
5: ; preds = %2
%6 = zext i8 %1 to i32
%7 = add i32 %3, -1
%8 = zext i32 %7 to i64
%9 = add nuw nsw i64 %8, 1
%10 = icmp ult i32 %7, 15
br i1 %10, label %65, label %11
11: ; preds = %5
%12 = and i64 %9, 8589934576
%13 = trunc i64 %12 to i32
%14 = sub i32 %3, %13
%15 = getelementptr i8, i8* %0, i64 %12
%16 = insertelement <16 x i32> poison, i32 %3, i64 0
%17 = shufflevector <16 x i32> %16, <16 x i32> poison, <16 x i32> zeroinitializer
%18 = add <16 x i32> %17, <i32 0, i32 -1, i32 -2, i32 -3, i32 -4, i32 -5, i32 -6, i32 -7, i32 -8, i32 -9, i32 -10, i32 -11, i32 -12, i32 -13, i32 -14, i32 -15>
%19 = insertelement <16 x i32> poison, i32 %6, i64 0
%20 = shufflevector <16 x i32> %19, <16 x i32> poison, <16 x i32> zeroinitializer
%21 = add nsw i64 %12, -16
%22 = lshr exact i64 %21, 4
%23 = add nuw nsw i64 %22, 1
%24 = and i64 %23, 1
%25 = icmp eq i64 %21, 0
br i1 %25, label %51, label %26
26: ; preds = %11
%27 = and i64 %23, 2305843009213693950
br label %28
28: ; preds = %28, %26
%29 = phi i64 [ 0, %26 ], [ %47, %28 ]
%30 = phi <16 x i32> [ %18, %26 ], [ %48, %28 ]
%31 = phi i64 [ 0, %26 ], [ %49, %28 ]
%32 = getelementptr i8, i8* %0, i64 %29
%33 = add <16 x i32> %30, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
%34 = lshr <16 x i32> %20, %33
%35 = trunc <16 x i32> %34 to <16 x i8>
%36 = and <16 x i8> %35, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%37 = or <16 x i8> %36, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%38 = bitcast i8* %32 to <16 x i8>*
store <16 x i8> %37, <16 x i8>* %38
%39 = or i64 %29, 16
%40 = getelementptr i8, i8* %0, i64 %39
%41 = add <16 x i32> %30, <i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17, i32 -17>
%42 = lshr <16 x i32> %20, %41
%43 = trunc <16 x i32> %42 to <16 x i8>
%44 = and <16 x i8> %43, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%45 = or <16 x i8> %44, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%46 = bitcast i8* %40 to <16 x i8>*
store <16 x i8> %45, <16 x i8>* %46
%47 = add nuw i64 %29, 32
%48 = add <16 x i32> %30, <i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32, i32 -32>
%49 = add i64 %31, 2
%50 = icmp eq i64 %49, %27
br i1 %50, label %51, label %28
51: ; preds = %28, %11
%52 = phi i64 [ 0, %11 ], [ %47, %28 ]
%53 = phi <16 x i32> [ %18, %11 ], [ %48, %28 ]
%54 = icmp eq i64 %24, 0
br i1 %54, label %63, label %55
55: ; preds = %51
%56 = getelementptr i8, i8* %0, i64 %52
%57 = add <16 x i32> %53, <i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1, i32 -1>
%58 = lshr <16 x i32> %20, %57
%59 = trunc <16 x i32> %58 to <16 x i8>
%60 = and <16 x i8> %59, <i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1, i8 1>
%61 = or <16 x i8> %60, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%62 = bitcast i8* %56 to <16 x i8>*
store <16 x i8> %61, <16 x i8>* %62
br label %63
63: ; preds = %51, %55
%64 = icmp eq i64 %9, %12
br i1 %64, label %78, label %65
65: ; preds = %5, %63
%66 = phi i32 [ %3, %5 ], [ %14, %63 ]
%67 = phi i8* [ %0, %5 ], [ %15, %63 ]
br label %68
68: ; preds = %65, %68
%69 = phi i32 [ %71, %68 ], [ %66, %65 ]
%70 = phi i8* [ %76, %68 ], [ %67, %65 ]
%71 = add i32 %69, -1
%72 = lshr i32 %6, %71
%73 = trunc i32 %72 to i8
%74 = and i8 %73, 1
%75 = or i8 %74, 48
store i8 %75, i8* %70
%76 = getelementptr inbounds i8, i8* %70, i64 1
%77 = icmp eq i32 %71, 0
br i1 %77, label %78, label %68
78: ; preds = %68, %63, %2
ret void
}