#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 uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void *base_for_binary(unsigned char);
void create_readable_string_for_last_part(char *str, uint64_t sequence_part) {
  char *ptr = (char *)&sequence_part;
  unsigned char *b = (unsigned char *)ptr;
  size_t size = sizeof(uint32_t);
  uint64_t threeLast = ((*ptr) & 0xFFFUL);
  *ptr >>= 12;
  unsigned char byte;
  for (int i = size; i > 0; i--) {
    byte = b[i] >> 4;
    *str++ = base_for_binary(byte);
    byte = b[i] &= 0xf;
    *str++ = base_for_binary(byte);
  }
  *str++ = ' ';
  byte = threeLast >> 0b1000;
  *str++ = byte == 1 ? '1' : '0';
  byte = (threeLast >> 0b0100) & 0xF;
  *str++ = byte == 1 ? '1' : '0';
  byte = threeLast & 0xF;
  *str++ = byte == 1 ? '1' : '0';
  *str++ = 0;
}


x86 assembly (clang, -O0):
<create_readable_string_for_last_part>:
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,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsbq (%rax),%rax
and    $0xfff,%rax
mov    %eax,-0x2c(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
sar    $0xc,%ecx
mov    %cl,(%rax)
mov    -0x28(%rbp),%rax
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jle    11d2 <create_readable_string_for_last_part+0xc2>
mov    -0x20(%rbp),%rax
movslq -0x34(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%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,-0x2d(%rbp)
movzbl -0x2d(%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    115b <create_readable_string_for_last_part+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x20,(%rax)
mov    -0x2c(%rbp),%eax
sar    $0x8,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x2c(%rbp),%eax
sar    $0x4,%eax
and    $0xf,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x2c(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x2d(%rbp)
movzbl -0x2d(%rbp),%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movb   $0x0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_readable_string_for_last_part>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%r15d
shr    $0x8,%r15d
mov    %esi,%r12d
shr    $0x10,%r12d
mov    %esi,%ebp
shr    $0x18,%ebp
xor    %edi,%edi
call   1030 <base_for_binary@plt>
mov    %al,(%rbx)
xor    %edi,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x1(%rbx)
mov    %r14d,%edi
shr    $0x1c,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x2(%rbx)
and    $0xf,%ebp
mov    %ebp,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x3(%rbx)
mov    %r12d,%eax
shr    $0x4,%al
movzbl %al,%edi
call   1030 <base_for_binary@plt>
mov    %al,0x4(%rbx)
and    $0xf,%r12d
mov    %r12d,%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)
movsbl %r14b,%eax
movb   $0x20,0x8(%rbx)
mov    %eax,%ecx
and    $0xf00,%ecx
cmp    $0x100,%ecx
sete   %cl
or     $0x30,%cl
mov    %cl,0x9(%rbx)
mov    %eax,%ecx
and    $0xf0,%cl
cmp    $0x10,%cl
sete   %cl
or     $0x30,%cl
mov    %cl,0xa(%rbx)
and    $0xf,%al
cmp    $0x1,%al
sete   %al
or     $0x30,%al
mov    %al,0xb(%rbx)
movb   $0x0,0xc(%rbx)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @create_readable_string_for_last_part(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i32
%9 = alloca i8
%10 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%11 = bitcast i32* %4 to i8*
store i8* %11, i8** %5
%12 = load i8*, i8** %5
store i8* %12, i8** %6
store i64 4, i64* %7
%13 = load i8*, i8** %5
%14 = load i8, i8* %13
%15 = sext i8 %14 to i64
%16 = and i64 %15, 4095
%17 = trunc i64 %16 to i32
store i32 %17, i32* %8
%18 = load i8*, i8** %5
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = ashr i32 %20, 12
%22 = trunc i32 %21 to i8
store i8 %22, i8* %18
%23 = load i64, i64* %7
%24 = trunc i64 %23 to i32
store i32 %24, i32* %10
br label %25
25: ; preds = %55, %2
%26 = load i32, i32* %10
%27 = icmp sgt i32 %26, 0
br i1 %27, label %28, label %58
28: ; preds = %25
%29 = load i8*, i8** %6
%30 = load i32, i32* %10
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = ashr i32 %34, 4
%36 = trunc i32 %35 to i8
store i8 %36, i8* %9
%37 = load i8, i8* %9
%38 = call i8* @base_for_binary(i8 zeroext %37)
%39 = ptrtoint i8* %38 to i8
%40 = load i8*, i8** %3
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %3
store i8 %39, i8* %40
%42 = load i8*, i8** %6
%43 = load i32, i32* %10
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i8, i8* %42, i64 %44
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %47, 15
%49 = trunc i32 %48 to i8
store i8 %49, i8* %45
store i8 %49, i8* %9
%50 = load i8, i8* %9
%51 = call i8* @base_for_binary(i8 zeroext %50)
%52 = ptrtoint i8* %51 to i8
%53 = load i8*, i8** %3
%54 = getelementptr inbounds i8, i8* %53, i32 1
store i8* %54, i8** %3
store i8 %52, i8* %53
br label %55
55: ; preds = %28
%56 = load i32, i32* %10
%57 = add nsw i32 %56, -1
store i32 %57, i32* %10
br label %25
58: ; preds = %25
%59 = load i8*, i8** %3
%60 = getelementptr inbounds i8, i8* %59, i32 1
store i8* %60, i8** %3
store i8 32, i8* %59
%61 = load i32, i32* %8
%62 = ashr i32 %61, 8
%63 = trunc i32 %62 to i8
store i8 %63, i8* %9
%64 = load i8, i8* %9
%65 = zext i8 %64 to i32
%66 = icmp eq i32 %65, 1
%67 = zext i1 %66 to i64
%68 = select i1 %66, i32 49, i32 48
%69 = trunc i32 %68 to i8
%70 = load i8*, i8** %3
%71 = getelementptr inbounds i8, i8* %70, i32 1
store i8* %71, i8** %3
store i8 %69, i8* %70
%72 = load i32, i32* %8
%73 = ashr i32 %72, 4
%74 = and i32 %73, 15
%75 = trunc i32 %74 to i8
store i8 %75, i8* %9
%76 = load i8, i8* %9
%77 = zext i8 %76 to i32
%78 = icmp eq i32 %77, 1
%79 = zext i1 %78 to i64
%80 = select i1 %78, i32 49, i32 48
%81 = trunc i32 %80 to i8
%82 = load i8*, i8** %3
%83 = getelementptr inbounds i8, i8* %82, i32 1
store i8* %83, i8** %3
store i8 %81, i8* %82
%84 = load i32, i32* %8
%85 = and i32 %84, 15
%86 = trunc i32 %85 to i8
store i8 %86, i8* %9
%87 = load i8, i8* %9
%88 = zext i8 %87 to i32
%89 = icmp eq i32 %88, 1
%90 = zext i1 %89 to i64
%91 = select i1 %89, i32 49, i32 48
%92 = trunc i32 %91 to i8
%93 = load i8*, i8** %3
%94 = getelementptr inbounds i8, i8* %93, i32 1
store i8* %94, i8** %3
store i8 %92, i8* %93
%95 = load i8*, i8** %3
%96 = getelementptr inbounds i8, i8* %95, i32 1
store i8* %96, i8** %3
store i8 0, i8* %95
ret void
}

LLVM IR (-O2):
define void @create_readable_string_for_last_part(i8* nocapture 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 = tail call i8* @base_for_binary(i8 zeroext poison)
%11 = ptrtoint i8* %10 to i64
%12 = trunc i64 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %12, i8* %0
%14 = tail call i8* @base_for_binary(i8 zeroext poison)
%15 = ptrtoint i8* %14 to i64
%16 = trunc i64 %15 to i8
%17 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %16, i8* %13
%18 = lshr i8 %9, 4
%19 = tail call i8* @base_for_binary(i8 zeroext %18)
%20 = ptrtoint i8* %19 to i64
%21 = trunc i64 %20 to i8
%22 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %21, i8* %17
%23 = and i8 %9, 15
%24 = tail call i8* @base_for_binary(i8 zeroext %23)
%25 = ptrtoint i8* %24 to i64
%26 = trunc i64 %25 to i8
%27 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %26, i8* %22
%28 = lshr i8 %7, 4
%29 = tail call i8* @base_for_binary(i8 zeroext %28)
%30 = ptrtoint i8* %29 to i64
%31 = trunc i64 %30 to i8
%32 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %31, i8* %27
%33 = and i8 %7, 15
%34 = tail call i8* @base_for_binary(i8 zeroext %33)
%35 = ptrtoint i8* %34 to i64
%36 = trunc i64 %35 to i8
%37 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %36, i8* %32
%38 = lshr i8 %5, 4
%39 = tail call i8* @base_for_binary(i8 zeroext %38)
%40 = ptrtoint i8* %39 to i64
%41 = trunc i64 %40 to i8
%42 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %41, i8* %37
%43 = and i8 %5, 15
%44 = tail call i8* @base_for_binary(i8 zeroext %43)
%45 = ptrtoint i8* %44 to i64
%46 = trunc i64 %45 to i8
%47 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %46, i8* %42
%48 = shl i32 %1, 24
%49 = ashr exact i32 %48, 24
%50 = getelementptr inbounds i8, i8* %0, i64 9
store i8 32, i8* %47
%51 = and i32 %49, 3840
%52 = icmp eq i32 %51, 256
%53 = select i1 %52, i8 49, i8 48
%54 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %53, i8* %50
%55 = and i8 %3, -16
%56 = icmp eq i8 %55, 16
%57 = select i1 %56, i8 49, i8 48
%58 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %57, i8* %54
%59 = and i8 %3, 15
%60 = icmp eq i8 %59, 1
%61 = select i1 %60, i8 49, i8 48
%62 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %61, i8* %58
store i8 0, i8* %62
ret void
}