#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*/ revstr(char *, size_t);
char *utob(char *buf, size_t len, unsigned long val, int bits, int lil_endian) {
  size_t i, shift, str_pos;
  if (len == 0) {
    return buf;
  }
  if (bits < 1) {
    bits = (sizeof(unsigned long) * 8);
  }
  str_pos = 0;
  for (i = bits; i > 0; i--) {
    if (str_pos >= (len - 1)) {
      break;
    }
    shift = (i - 1);
    buf[str_pos++] = ((val >> shift) & 1) ? '1' : '0';
  }
  buf[str_pos] = '\0';
  if (lil_endian) {
    revstr(buf, len);
  }
  return buf;
}


x86 assembly (clang, -O0):
<utob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8d,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1143 <utob+0x33>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1209 <utob+0xf9>
cmpl   $0x1,-0x24(%rbp)
jge    1154 <utob+0x44>
movl   $0x40,-0x24(%rbp)
movq   $0x0,-0x40(%rbp)
movslq -0x24(%rbp),%rax
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jbe    11de <utob+0xce>
mov    -0x40(%rbp),%rax
mov    -0x18(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
jb     1189 <utob+0x79>
jmp    11de <utob+0xce>
mov    -0x30(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x38(%rbp),%rcx
shr    %cl,%rdx
and    $0x1,%rdx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
mov    %al,%dl
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %rcx,%rsi
add    $0x1,%rsi
mov    %rsi,-0x40(%rbp)
mov    %dl,(%rax,%rcx,1)
mov    -0x30(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x30(%rbp)
jmp    1164 <utob+0x54>
mov    -0x10(%rbp),%rax
mov    -0x40(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
cmpl   $0x0,-0x28(%rbp)
je     1201 <utob+0xf1>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <revstr@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utob>:
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    %rdi,%r14
test   %rsi,%rsi
je     18dd <utob+0x7cd>
mov    %rsi,%r10
add    $0xffffffffffffffff,%r10
je     1163 <utob+0x53>
test   %ecx,%ecx
mov    $0x40,%edi
cmovg  %ecx,%edi
lea    -0x1(%rdi),%rax
lea    -0x2(%rsi),%rcx
cmp    %rax,%rcx
cmovae %rax,%rcx
add    $0x1,%rcx
test   %rax,%rax
mov    $0x1,%r9d
cmovne %rcx,%r9
cmp    $0x10,%r9
jae    116a <utob+0x5a>
xor    %ecx,%ecx
jmp    18a0 <utob+0x790>
xor    %ecx,%ecx
jmp    18cb <utob+0x7bb>
mov    %r9,%rcx
and    $0xfffffffffffffff0,%rcx
movq   %rdi,%xmm0
pshufd $0x44,%xmm0,%xmm9
movdqa 0xe7b(%rip),%xmm12
paddq  %xmm9,%xmm12
movdqa 0xe7e(%rip),%xmm5
paddq  %xmm9,%xmm5
movdqa 0xe81(%rip),%xmm7
paddq  %xmm9,%xmm7
movdqa 0xe84(%rip),%xmm3
paddq  %xmm9,%xmm3
movdqa 0xe87(%rip),%xmm6
paddq  %xmm9,%xmm6
movdqa 0xe8a(%rip),%xmm4
paddq  %xmm9,%xmm4
movdqa 0xe8c(%rip),%xmm11
paddq  %xmm9,%xmm11
paddq  0xe8e(%rip),%xmm9
movq   %rdx,%xmm0
pshufd $0x44,%xmm0,%xmm8
lea    -0x10(%rcx),%rax
mov    %rax,%r11
shr    $0x4,%r11
add    $0x1,%r11
test   %rax,%rax
je     18e8 <utob+0x7d8>
mov    %r11,%rbx
and    $0xfffffffffffffffe,%rbx
xor    %eax,%eax
movdqa 0xe69(%rip),%xmm10
pxor   %xmm14,%xmm14
nopl   0x0(%rax)
movdqa %xmm9,0x20(%rsp)
movdqa %xmm11,0x30(%rsp)
movdqa %xmm4,0x40(%rsp)
movdqa %xmm6,0x50(%rsp)
movdqa %xmm3,(%rsp)
movdqa %xmm7,0x60(%rsp)
movdqa %xmm5,0x10(%rsp)
movdqa 0x10(%rsp),%xmm13
pcmpeqd %xmm15,%xmm15
paddq  %xmm15,%xmm13
movdqa %xmm7,%xmm1
paddq  %xmm15,%xmm1
movdqa (%rsp),%xmm3
paddq  %xmm15,%xmm3
movdqa %xmm6,%xmm5
paddq  %xmm15,%xmm5
movdqa %xmm4,%xmm6
paddq  %xmm15,%xmm6
movdqa %xmm11,%xmm4
movdqa %xmm9,%xmm2
paddq  %xmm15,%xmm2
movdqa %xmm10,%xmm7
psllq  %xmm2,%xmm7
paddq  %xmm15,%xmm4
pshufd $0xee,%xmm2,%xmm0
movdqa %xmm10,%xmm2
psllq  %xmm0,%xmm2
movsd  %xmm7,%xmm2
movdqa %xmm10,%xmm0
psllq  %xmm4,%xmm0
pshufd $0xee,%xmm4,%xmm7
movdqa %xmm10,%xmm4
psllq  %xmm7,%xmm4
movdqa %xmm10,%xmm7
psllq  %xmm6,%xmm7
movsd  %xmm0,%xmm4
pshufd $0xee,%xmm6,%xmm0
movdqa %xmm12,%xmm11
movdqa %xmm10,%xmm12
psllq  %xmm0,%xmm12
movsd  %xmm7,%xmm12
movdqa %xmm10,%xmm0
psllq  %xmm5,%xmm0
pshufd $0xee,%xmm5,%xmm6
movdqa %xmm10,%xmm5
psllq  %xmm6,%xmm5
movdqa %xmm10,%xmm6
psllq  %xmm3,%xmm6
movsd  %xmm0,%xmm5
pshufd $0xee,%xmm3,%xmm0
movdqa %xmm10,%xmm9
psllq  %xmm0,%xmm9
movsd  %xmm6,%xmm9
movdqa %xmm10,%xmm0
psllq  %xmm1,%xmm0
pshufd $0xee,%xmm1,%xmm1
movdqa %xmm10,%xmm7
psllq  %xmm1,%xmm7
movdqa %xmm10,%xmm1
psllq  %xmm13,%xmm1
pshufd $0xee,%xmm13,%xmm3
movdqa %xmm10,%xmm13
psllq  %xmm3,%xmm13
movdqa %xmm11,%xmm3
paddq  %xmm15,%xmm3
movsd  %xmm0,%xmm7
movsd  %xmm1,%xmm13
movdqa %xmm10,%xmm1
psllq  %xmm3,%xmm1
pshufd $0xee,%xmm3,%xmm3
movdqa %xmm10,%xmm0
psllq  %xmm3,%xmm0
movsd  %xmm1,%xmm0
andpd  %xmm8,%xmm0
andpd  %xmm8,%xmm13
andpd  %xmm8,%xmm7
andpd  %xmm8,%xmm9
andpd  %xmm8,%xmm5
andpd  %xmm8,%xmm12
andpd  %xmm8,%xmm4
andpd  %xmm8,%xmm2
pcmpeqd %xmm14,%xmm2
pshufd $0xb1,%xmm2,%xmm1
pand   %xmm2,%xmm1
pcmpeqd %xmm14,%xmm4
pshufd $0xb1,%xmm4,%xmm2
pand   %xmm4,%xmm2
packssdw %xmm2,%xmm1
pcmpeqd %xmm14,%xmm12
pshufd $0xb1,%xmm12,%xmm2
pand   %xmm12,%xmm2
pcmpeqd %xmm14,%xmm5
pshufd $0xb1,%xmm5,%xmm3
pand   %xmm5,%xmm3
packssdw %xmm3,%xmm2
packssdw %xmm2,%xmm1
pcmpeqd %xmm14,%xmm9
pshufd $0xb1,%xmm9,%xmm2
pand   %xmm9,%xmm2
pcmpeqd %xmm14,%xmm7
pshufd $0xb1,%xmm7,%xmm3
pand   %xmm7,%xmm3
packssdw %xmm3,%xmm2
pcmpeqd %xmm14,%xmm13
pshufd $0xb1,%xmm13,%xmm3
pand   %xmm13,%xmm3
pcmpeqd %xmm14,%xmm0
pshufd $0xb1,%xmm0,%xmm4
pand   %xmm0,%xmm4
packssdw %xmm4,%xmm3
packssdw %xmm3,%xmm2
packsswb %xmm2,%xmm1
movdqa 0xc49(%rip),%xmm15
paddb  %xmm15,%xmm1
movdqu %xmm1,(%r14,%rax,1)
movdqa %xmm11,%xmm12
movdqa 0xc41(%rip),%xmm1
paddq  %xmm1,%xmm12
movdqa 0x10(%rsp),%xmm13
paddq  %xmm1,%xmm13
movdqa 0x60(%rsp),%xmm2
paddq  %xmm1,%xmm2
movdqa (%rsp),%xmm6
paddq  %xmm1,%xmm6
movdqa 0x50(%rsp),%xmm0
paddq  %xmm1,%xmm0
movdqa 0x40(%rsp),%xmm5
paddq  %xmm1,%xmm5
movdqa 0x30(%rsp),%xmm4
paddq  %xmm1,%xmm4
movdqa 0x20(%rsp),%xmm7
paddq  %xmm1,%xmm7
movdqa %xmm10,%xmm1
psllq  %xmm7,%xmm1
pshufd $0xee,%xmm7,%xmm7
movdqa %xmm10,%xmm9
psllq  %xmm7,%xmm9
movdqa %xmm10,%xmm7
psllq  %xmm4,%xmm7
movsd  %xmm1,%xmm9
pshufd $0xee,%xmm4,%xmm1
movdqa %xmm10,%xmm4
psllq  %xmm1,%xmm4
movsd  %xmm7,%xmm4
movdqa %xmm10,%xmm1
psllq  %xmm5,%xmm1
pshufd $0xee,%xmm5,%xmm7
movdqa %xmm10,%xmm5
psllq  %xmm7,%xmm5
movdqa %xmm10,%xmm7
psllq  %xmm0,%xmm7
movsd  %xmm1,%xmm5
pshufd $0xee,%xmm0,%xmm1
movdqa %xmm10,%xmm0
psllq  %xmm1,%xmm0
movsd  %xmm7,%xmm0
movdqa %xmm10,%xmm1
psllq  %xmm6,%xmm1
pshufd $0xee,%xmm6,%xmm6
movdqa %xmm10,%xmm7
psllq  %xmm6,%xmm7
movdqa %xmm10,%xmm3
psllq  %xmm2,%xmm3
movsd  %xmm1,%xmm7
pshufd $0xee,%xmm2,%xmm1
movdqa %xmm10,%xmm6
psllq  %xmm1,%xmm6
movsd  %xmm3,%xmm6
movdqa %xmm10,%xmm1
psllq  %xmm13,%xmm1
pshufd $0xee,%xmm13,%xmm2
movdqa %xmm10,%xmm13
psllq  %xmm2,%xmm13
movdqa %xmm10,%xmm2
psllq  %xmm12,%xmm2
movsd  %xmm1,%xmm13
pshufd $0xee,%xmm12,%xmm12
movdqa %xmm10,%xmm1
psllq  %xmm12,%xmm1
movdqa %xmm11,%xmm12
movdqa 0x30(%rsp),%xmm11
movsd  %xmm2,%xmm1
andpd  %xmm8,%xmm4
andpd  %xmm8,%xmm9
pcmpeqd %xmm14,%xmm9
pshufd $0xb1,%xmm9,%xmm2
pand   %xmm9,%xmm2
movdqa 0x20(%rsp),%xmm9
pcmpeqd %xmm14,%xmm4
pshufd $0xb1,%xmm4,%xmm3
pand   %xmm4,%xmm3
andpd  %xmm8,%xmm0
andpd  %xmm8,%xmm5
packssdw %xmm3,%xmm2
pcmpeqd %xmm14,%xmm5
pshufd $0xb1,%xmm5,%xmm3
pand   %xmm5,%xmm3
pcmpeqd %xmm14,%xmm0
pshufd $0xb1,%xmm0,%xmm4
pand   %xmm0,%xmm4
packssdw %xmm4,%xmm3
andpd  %xmm8,%xmm6
andpd  %xmm8,%xmm7
packssdw %xmm3,%xmm2
pcmpeqd %xmm14,%xmm7
pshufd $0xb1,%xmm7,%xmm0
pand   %xmm7,%xmm0
movdqa 0x60(%rsp),%xmm7
pcmpeqd %xmm14,%xmm6
pshufd $0xb1,%xmm6,%xmm3
pand   %xmm6,%xmm3
movdqa 0x50(%rsp),%xmm6
andpd  %xmm8,%xmm1
andpd  %xmm8,%xmm13
packssdw %xmm3,%xmm0
pcmpeqd %xmm14,%xmm13
pshufd $0xb1,%xmm13,%xmm3
pand   %xmm13,%xmm3
movdqa 0x10(%rsp),%xmm5
pcmpeqd %xmm14,%xmm1
pshufd $0xb1,%xmm1,%xmm4
pand   %xmm1,%xmm4
packssdw %xmm4,%xmm3
movdqa 0x40(%rsp),%xmm4
packssdw %xmm3,%xmm0
movdqa (%rsp),%xmm3
packsswb %xmm0,%xmm2
paddb  %xmm15,%xmm2
movdqu %xmm2,0x10(%r14,%rax,1)
add    $0x20,%rax
movdqa 0xa24(%rip),%xmm0
paddq  %xmm0,%xmm9
paddq  %xmm0,%xmm11
paddq  %xmm0,%xmm4
paddq  %xmm0,%xmm6
paddq  %xmm0,%xmm3
paddq  %xmm0,%xmm7
paddq  %xmm0,%xmm5
paddq  %xmm0,%xmm12
add    $0xfffffffffffffffe,%rbx
jne    1220 <utob+0x110>
test   $0x1,%r11b
je     1898 <utob+0x788>
pcmpeqd %xmm0,%xmm0
paddq  %xmm0,%xmm12
paddq  %xmm0,%xmm5
paddq  %xmm0,%xmm7
paddq  %xmm0,%xmm3
paddq  %xmm0,%xmm6
paddq  %xmm0,%xmm4
paddq  %xmm0,%xmm11
paddq  %xmm0,%xmm9
movdqa 0x98e(%rip),%xmm2
movdqa %xmm2,%xmm0
psllq  %xmm9,%xmm0
pshufd $0xee,%xmm9,%xmm1
movdqa %xmm2,%xmm9
psllq  %xmm1,%xmm9
movdqa %xmm2,%xmm1
psllq  %xmm11,%xmm1
movsd  %xmm0,%xmm9
movdqa %xmm3,%xmm0
pshufd $0xee,%xmm11,%xmm3
movdqa %xmm2,%xmm11
psllq  %xmm3,%xmm11
movsd  %xmm1,%xmm11
movdqa %xmm2,%xmm1
psllq  %xmm4,%xmm1
pshufd $0xee,%xmm4,%xmm3
movdqa %xmm2,%xmm4
psllq  %xmm3,%xmm4
movdqa %xmm2,%xmm3
psllq  %xmm6,%xmm3
movsd  %xmm1,%xmm4
pshufd $0xee,%xmm6,%xmm1
movdqa %xmm2,%xmm6
psllq  %xmm1,%xmm6
movsd  %xmm3,%xmm6
movdqa %xmm2,%xmm1
psllq  %xmm0,%xmm1
pshufd $0xee,%xmm0,%xmm3
movdqa %xmm2,%xmm13
psllq  %xmm3,%xmm13
movdqa %xmm2,%xmm3
psllq  %xmm7,%xmm3
movsd  %xmm1,%xmm13
pshufd $0xee,%xmm7,%xmm1
movdqa %xmm2,%xmm7
psllq  %xmm1,%xmm7
movsd  %xmm3,%xmm7
movdqa %xmm2,%xmm1
psllq  %xmm5,%xmm1
pshufd $0xee,%xmm5,%xmm10
movdqa %xmm2,%xmm3
psllq  %xmm10,%xmm3
movdqa %xmm2,%xmm0
psllq  %xmm12,%xmm0
movsd  %xmm1,%xmm3
pshufd $0xee,%xmm12,%xmm1
psllq  %xmm1,%xmm2
movsd  %xmm0,%xmm2
andpd  %xmm8,%xmm2
andpd  %xmm8,%xmm3
andpd  %xmm8,%xmm7
andpd  %xmm8,%xmm13
andpd  %xmm8,%xmm6
andpd  %xmm8,%xmm4
andpd  %xmm8,%xmm11
andpd  %xmm8,%xmm9
pxor   %xmm8,%xmm8
pcmpeqd %xmm8,%xmm9
pshufd $0xb1,%xmm9,%xmm1
pand   %xmm9,%xmm1
pcmpeqd %xmm8,%xmm11
pshufd $0xb1,%xmm11,%xmm0
pand   %xmm11,%xmm0
packssdw %xmm0,%xmm1
pcmpeqd %xmm8,%xmm4
pshufd $0xb1,%xmm4,%xmm0
pand   %xmm4,%xmm0
pcmpeqd %xmm8,%xmm6
pshufd $0xb1,%xmm6,%xmm4
pand   %xmm6,%xmm4
packssdw %xmm4,%xmm0
packssdw %xmm0,%xmm1
pcmpeqd %xmm8,%xmm13
pshufd $0xb1,%xmm13,%xmm0
pand   %xmm13,%xmm0
pcmpeqd %xmm8,%xmm7
pshufd $0xb1,%xmm7,%xmm4
pand   %xmm7,%xmm4
packssdw %xmm4,%xmm0
pcmpeqd %xmm8,%xmm3
pshufd $0xb1,%xmm3,%xmm4
pand   %xmm3,%xmm4
pcmpeqd %xmm8,%xmm2
pshufd $0xb1,%xmm2,%xmm3
pand   %xmm2,%xmm3
packssdw %xmm3,%xmm4
packssdw %xmm4,%xmm0
packsswb %xmm0,%xmm1
paddb  0x7fe(%rip),%xmm1
movdqu %xmm1,(%r14,%rax,1)
cmp    %rcx,%r9
je     18cb <utob+0x7bb>
sub    %rcx,%rdi
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
bt     %rdi,%rdx
mov    $0x31,%al
adc    $0xff,%al
mov    %al,(%r14,%rcx,1)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rdi
jae    18cb <utob+0x7bb>
cmp    %r10,%rcx
jb     18b0 <utob+0x7a0>
movb   $0x0,(%r14,%rcx,1)
test   %r8d,%r8d
je     18dd <utob+0x7cd>
mov    %r14,%rdi
call   1030 <revstr@plt>
mov    %r14,%rax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret
xor    %eax,%eax
test   $0x1,%r11b
jne    16c3 <utob+0x5b3>
jmp    1898 <utob+0x788>

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

LLVM IR (-O2):
define i8* @utob(i8* returned %0, i64 %1, i64 %2, i32 %3, i32 %4) {
%6 = icmp eq i64 %1, 0
br i1 %6, label %95, label %7
7: ; preds = %5
%8 = add i64 %1, -1
%9 = icmp eq i64 %8, 0
br i1 %9, label %89, label %10
10: ; preds = %7
%11 = icmp slt i32 %3, 1
%12 = select i1 %11, i32 64, i32 %3
%13 = zext i32 %12 to i64
%14 = add nsw i64 %13, -1
%15 = add i64 %1, -2
%16 = icmp eq i64 %14, 0
%17 = call i64 @llvm.umin.i64(i64 %15, i64 %14)
%18 = add i64 %17, 1
%19 = select i1 %16, i64 1, i64 %18
%20 = icmp ult i64 %19, 16
br i1 %20, label %73, label %21
21: ; preds = %10
%22 = and i64 %19, -16
%23 = sub i64 %13, %22
%24 = insertelement <16 x i64> poison, i64 %13, i64 0
%25 = shufflevector <16 x i64> %24, <16 x i64> poison, <16 x i32> zeroinitializer
%26 = add nsw <16 x i64> %25, <i64 0, i64 -1, i64 -2, i64 -3, i64 -4, i64 -5, i64 -6, i64 -7, i64 -8, i64 -9, i64 -10, i64 -11, i64 -12, i64 -13, i64 -14, i64 -15>
%27 = insertelement <16 x i64> poison, i64 %2, i64 0
%28 = shufflevector <16 x i64> %27, <16 x i64> poison, <16 x i32> zeroinitializer
%29 = add i64 %22, -16
%30 = lshr exact i64 %29, 4
%31 = add nuw nsw i64 %30, 1
%32 = and i64 %31, 1
%33 = icmp eq i64 %29, 0
br i1 %33, label %59, label %34
34: ; preds = %21
%35 = and i64 %31, 2305843009213693950
br label %36
36: ; preds = %36, %34
%37 = phi i64 [ 0, %34 ], [ %55, %36 ]
%38 = phi <16 x i64> [ %26, %34 ], [ %56, %36 ]
%39 = phi i64 [ 0, %34 ], [ %57, %36 ]
%40 = add nsw <16 x i64> %38, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
%41 = shl nuw <16 x i64> <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>, %40
%42 = and <16 x i64> %41, %28
%43 = icmp eq <16 x i64> %42, zeroinitializer
%44 = select <16 x i1> %43, <16 x i8> <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>, <16 x i8> <i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49>
%45 = getelementptr inbounds i8, i8* %0, i64 %37
%46 = bitcast i8* %45 to <16 x i8>*
store <16 x i8> %44, <16 x i8>* %46
%47 = or i64 %37, 16
%48 = add <16 x i64> %38, <i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17, i64 -17>
%49 = shl nuw <16 x i64> <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>, %48
%50 = and <16 x i64> %49, %28
%51 = icmp eq <16 x i64> %50, zeroinitializer
%52 = select <16 x i1> %51, <16 x i8> <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>, <16 x i8> <i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49>
%53 = getelementptr inbounds i8, i8* %0, i64 %47
%54 = bitcast i8* %53 to <16 x i8>*
store <16 x i8> %52, <16 x i8>* %54
%55 = add nuw i64 %37, 32
%56 = add <16 x i64> %38, <i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32, i64 -32>
%57 = add i64 %39, 2
%58 = icmp eq i64 %57, %35
br i1 %58, label %59, label %36
59: ; preds = %36, %21
%60 = phi i64 [ 0, %21 ], [ %55, %36 ]
%61 = phi <16 x i64> [ %26, %21 ], [ %56, %36 ]
%62 = icmp eq i64 %32, 0
br i1 %62, label %71, label %63
63: ; preds = %59
%64 = add nsw <16 x i64> %61, <i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1, i64 -1>
%65 = shl nuw <16 x i64> <i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1, i64 1>, %64
%66 = and <16 x i64> %65, %28
%67 = icmp eq <16 x i64> %66, zeroinitializer
%68 = select <16 x i1> %67, <16 x i8> <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>, <16 x i8> <i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49, i8 49>
%69 = getelementptr inbounds i8, i8* %0, i64 %60
%70 = bitcast i8* %69 to <16 x i8>*
store <16 x i8> %68, <16 x i8>* %70
br label %71
71: ; preds = %59, %63
%72 = icmp eq i64 %19, %22
br i1 %72, label %89, label %73
73: ; preds = %10, %71
%74 = phi i64 [ 0, %10 ], [ %22, %71 ]
%75 = phi i64 [ %13, %10 ], [ %23, %71 ]
br label %76
76: ; preds = %73, %76
%77 = phi i64 [ %84, %76 ], [ %74, %73 ]
%78 = phi i64 [ %79, %76 ], [ %75, %73 ]
%79 = add nsw i64 %78, -1
%80 = shl nuw i64 1, %79
%81 = and i64 %80, %2
%82 = icmp eq i64 %81, 0
%83 = select i1 %82, i8 48, i8 49
%84 = add nuw nsw i64 %77, 1
%85 = getelementptr inbounds i8, i8* %0, i64 %77
store i8 %83, i8* %85
%86 = icmp ne i64 %79, 0
%87 = icmp ult i64 %84, %8
%88 = select i1 %86, i1 %87, i1 false
br i1 %88, label %76, label %89
89: ; preds = %76, %71, %7
%90 = phi i64 [ 0, %7 ], [ %22, %71 ], [ %84, %76 ]
%91 = getelementptr inbounds i8, i8* %0, i64 %90
store i8 0, i8* %91
%92 = icmp eq i32 %4, 0
br i1 %92, label %95, label %93
93: ; preds = %89
%94 = tail call i32 @revstr(i8* %0, i64 %1)
br label %95
95: ; preds = %89, %93, %5
ret i8* %0
}