#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*/ bytes_to_string(long long);
int /*<<< orphan*/ equal(char *, int /*<<< orphan*/);
void test_bytes_to_string(void) {
  equal("100b", bytes_to_string(100));
  equal("1kb", bytes_to_string(1024));
  equal("1mb", bytes_to_string(1024 * 1024));
  equal("5mb", bytes_to_string(1024 * 1024 * 5));
  equal("1gb", bytes_to_string(1024 * 1024 * 1024));
  equal("5gb", bytes_to_string((long long)1024 * 1024 * 1024 * 5));
}


x86 assembly (clang, -O0):
<test_bytes_to_string>:
push   %rbp
mov    %rsp,%rbp
mov    $0x64,%edi
call   1040 <bytes_to_string@plt>
mov    %eax,%esi
lea    0xec9(%rip),%rdi
call   1030 <equal@plt>
mov    $0x400,%edi
call   1040 <bytes_to_string@plt>
mov    %eax,%esi
lea    0xeb6(%rip),%rdi
call   1030 <equal@plt>
mov    $0x100000,%edi
call   1040 <bytes_to_string@plt>
mov    %eax,%esi
lea    0xea2(%rip),%rdi
call   1030 <equal@plt>
mov    $0x500000,%edi
call   1040 <bytes_to_string@plt>
mov    %eax,%esi
lea    0xe8e(%rip),%rdi
call   1030 <equal@plt>
mov    $0x40000000,%edi
call   1040 <bytes_to_string@plt>
mov    %eax,%esi
lea    0xe7a(%rip),%rdi
call   1030 <equal@plt>
movabs $0x140000000,%rdi
call   1040 <bytes_to_string@plt>
mov    %eax,%esi
lea    0xe61(%rip),%rdi
call   1030 <equal@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_bytes_to_string>:
push   %rax
mov    $0x64,%edi
call   1040 <bytes_to_string@plt>
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <equal@plt>
mov    $0x400,%edi
call   1040 <bytes_to_string@plt>
lea    0xebb(%rip),%rdi
mov    %eax,%esi
call   1030 <equal@plt>
mov    $0x100000,%edi
call   1040 <bytes_to_string@plt>
lea    0xea7(%rip),%rdi
mov    %eax,%esi
call   1030 <equal@plt>
mov    $0x500000,%edi
call   1040 <bytes_to_string@plt>
lea    0xe93(%rip),%rdi
mov    %eax,%esi
call   1030 <equal@plt>
mov    $0x40000000,%edi
call   1040 <bytes_to_string@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
call   1030 <equal@plt>
movabs $0x140000000,%rdi
call   1040 <bytes_to_string@plt>
lea    0xe66(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <equal@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"100b\00"
@.str.1 = [4 x i8] c"1kb\00"
@.str.2 = [4 x i8] c"1mb\00"
@.str.3 = [4 x i8] c"5mb\00"
@.str.4 = [4 x i8] c"1gb\00"
@.str.5 = [4 x i8] c"5gb\00"
define void @test_bytes_to_string() {
%1 = call i32 @bytes_to_string(i64 100)
%2 = call i32 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @bytes_to_string(i64 1024)
%4 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = call i32 @bytes_to_string(i64 1048576)
%6 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = call i32 @bytes_to_string(i64 5242880)
%8 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = call i32 @bytes_to_string(i64 1073741824)
%10 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = call i32 @bytes_to_string(i64 5368709120)
%12 = call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"100b\00"
@.str.1 = [4 x i8] c"1kb\00"
@.str.2 = [4 x i8] c"1mb\00"
@.str.3 = [4 x i8] c"5mb\00"
@.str.4 = [4 x i8] c"1gb\00"
@.str.5 = [4 x i8] c"5gb\00"
define void @test_bytes_to_string() {
%1 = tail call i32 @bytes_to_string(i64 100)
%2 = tail call i32 @equal(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @bytes_to_string(i64 1024)
%4 = tail call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %3)
%5 = tail call i32 @bytes_to_string(i64 1048576)
%6 = tail call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @bytes_to_string(i64 5242880)
%8 = tail call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = tail call i32 @bytes_to_string(i64 1073741824)
%10 = tail call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%11 = tail call i32 @bytes_to_string(i64 5368709120)
%12 = tail call i32 @equal(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %11)
ret void
}