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

/* Variables and functions */
void *base_for_binary(unsigned char);
char *create_readable_string(char *str, uint64_t sequence_part) {
  char *ptr = (char *)&sequence_part;
  unsigned char *b = (unsigned char *)ptr;
  unsigned char byte;
  size_t size = sizeof(uint64_t);
  for (int i = size - 1; i >= 0; i--) {
    byte = b[i] >> 4;
    *str++ = base_for_binary(byte);
    byte = b[i] &= 0xf;
    *str++ = base_for_binary(byte);
  }
  *str++ = ' ';
  return str++;
}


x86 assembly (clang, -O0):
<create_readable_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
movq   $0x4,-0x30(%rbp)
mov    -0x30(%rbp),%rax
sub    $0x1,%rax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jl     11b9 <create_readable_string+0xa9>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%edi
call   1030 <base_for_binary@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x20(%rbp),%rcx
movslq -0x34(%rbp),%rdx
movzbl (%rcx,%rdx,1),%eax
and    $0xf,%eax
mov    %al,(%rcx,%rdx,1)
mov    %al,-0x21(%rbp)
movzbl -0x21(%rbp),%edi
call   1030 <base_for_binary@plt>
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    1142 <create_readable_string+0x32>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x20,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_readable_string>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r15d
mov    %rdi,%rbx
mov    %esi,%r14d
shr    $0x8,%r14d
mov    %esi,%r12d
shr    $0x10,%r12d
mov    %esi,%ebp
shr    $0x18,%ebp
mov    %esi,%edi
shr    $0x1c,%edi
call   1030 <base_for_binary@plt>
mov    %al,(%rbx)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x1(%rbx)
mov    %r12d,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x2(%rbx)
and    $0xf,%r12d
mov    %r12d,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x3(%rbx)
mov    %r14d,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x4(%rbx)
and    $0xf,%r14d
mov    %r14d,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x5(%rbx)
mov    %r15d,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x6(%rbx)
and    $0xf,%r15d
mov    %r15d,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x7(%rbx)
movb   $0x20,0x8(%rbx)
add    $0x9,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @create_readable_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i64
%9 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%10 = bitcast i32* %4 to i8*
store i8* %10, i8** %5
%11 = load i8*, i8** %5
store i8* %11, i8** %6
store i64 4, i64* %8
%12 = load i64, i64* %8
%13 = sub i64 %12, 1
%14 = trunc i64 %13 to i32
store i32 %14, i32* %9
br label %15
15: ; preds = %45, %2
%16 = load i32, i32* %9
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %48
18: ; preds = %15
%19 = load i8*, i8** %6
%20 = load i32, i32* %9
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 4
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = call i8* @base_for_binary(i8 zeroext %27)
%29 = ptrtoint i8* %28 to i8
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %3
store i8 %29, i8* %30
%32 = load i8*, i8** %6
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
%38 = and i32 %37, 15
%39 = trunc i32 %38 to i8
store i8 %39, i8* %35
store i8 %39, i8* %7
%40 = load i8, i8* %7
%41 = call i8* @base_for_binary(i8 zeroext %40)
%42 = ptrtoint i8* %41 to i8
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %3
store i8 %42, i8* %43
br label %45
45: ; preds = %18
%46 = load i32, i32* %9
%47 = add nsw i32 %46, -1
store i32 %47, i32* %9
br label %15
48: ; preds = %15
%49 = load i8*, i8** %3
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %3
store i8 32, i8* %49
%51 = load i8*, i8** %3
%52 = getelementptr inbounds i8, i8* %51, i32 1
store i8* %52, i8** %3
ret i8* %51
}

LLVM IR (-O2):
define i8* @create_readable_string(i8* writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = lshr i32 %1, 16
%7 = trunc i32 %6 to i8
%8 = lshr i32 %1, 24
%9 = trunc i32 %8 to i8
%10 = lshr i8 %9, 4
%11 = tail call i8* @base_for_binary(i8 zeroext %10)
%12 = ptrtoint i8* %11 to i64
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %13, i8* %0
%15 = and i8 %9, 15
%16 = tail call i8* @base_for_binary(i8 zeroext %15)
%17 = ptrtoint i8* %16 to i64
%18 = trunc i64 %17 to i8
%19 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %18, i8* %14
%20 = lshr i8 %7, 4
%21 = tail call i8* @base_for_binary(i8 zeroext %20)
%22 = ptrtoint i8* %21 to i64
%23 = trunc i64 %22 to i8
%24 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %23, i8* %19
%25 = and i8 %7, 15
%26 = tail call i8* @base_for_binary(i8 zeroext %25)
%27 = ptrtoint i8* %26 to i64
%28 = trunc i64 %27 to i8
%29 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %28, i8* %24
%30 = lshr i8 %5, 4
%31 = tail call i8* @base_for_binary(i8 zeroext %30)
%32 = ptrtoint i8* %31 to i64
%33 = trunc i64 %32 to i8
%34 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %33, i8* %29
%35 = and i8 %5, 15
%36 = tail call i8* @base_for_binary(i8 zeroext %35)
%37 = ptrtoint i8* %36 to i64
%38 = trunc i64 %37 to i8
%39 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %38, i8* %34
%40 = lshr i8 %3, 4
%41 = tail call i8* @base_for_binary(i8 zeroext %40)
%42 = ptrtoint i8* %41 to i64
%43 = trunc i64 %42 to i8
%44 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %43, i8* %39
%45 = and i8 %3, 15
%46 = tail call i8* @base_for_binary(i8 zeroext %45)
%47 = ptrtoint i8* %46 to i64
%48 = trunc i64 %47 to i8
%49 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %48, i8* %44
%50 = getelementptr inbounds i8, i8* %0, i64 9
store i8 32, i8* %49
ret i8* %50
}