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

/* Variables and functions */
int snprintf(char *, int, char *, ...);
const char *PS2_FormatMemoryUnit(unsigned int size_bytes, int abbreviated) {
  enum {
    KILOBYTE = 1024,
    MEGABYTE = 1024 * KILOBYTE,
    GIGABYTE = 1024 * MEGABYTE
  };
  const char *mem_unit_str;
  float adjusted_size;
  if (size_bytes < KILOBYTE) {
    mem_unit_str = abbreviated ? "B" : "Bytes";
    adjusted_size = (float)size_bytes;
  } else if (size_bytes < MEGABYTE) {
    mem_unit_str = abbreviated ? "KB" : "Kilobytes";
    adjusted_size = size_bytes / 1024.0f;
  } else if (size_bytes < GIGABYTE) {
    mem_unit_str = abbreviated ? "MB" : "Megabytes";
    adjusted_size = size_bytes / 1024.0f / 1024.0f;
  } else {
    mem_unit_str = abbreviated ? "GB" : "Gigabytes";
    adjusted_size = size_bytes / 1024.0f / 1024.0f / 1024.0f;
  }
  char *fmtbuf;
  int chars_written;
  char num_str_buf[100];
  enum { MEM_UNIT_STR_MAXLEN = sizeof(num_str_buf) + 28 };
  static int bufnum = 0;
  static char local_str_buf[8][MEM_UNIT_STR_MAXLEN];
  fmtbuf = local_str_buf[bufnum];
  bufnum = (bufnum + 1) & 7;
  chars_written = snprintf(num_str_buf, 100, "%.2f", adjusted_size);
  if (chars_written <= 0) {
    fmtbuf[0] = '?';
    fmtbuf[1] = '?';
    fmtbuf[2] = '?';
    fmtbuf[3] = '\0';
    return fmtbuf;
  }
  char *p = num_str_buf;
  for (; *p; ++p) {
    if (*p == '.') {
      while (*++p) {
      }
      while (*--p == '0') {
        *p = '\0';
      }
      if (*p == '.') {
        *p = '\0';
      }
      break;
    }
  }
  chars_written =
      snprintf(fmtbuf, MEM_UNIT_STR_MAXLEN, "%s %s", num_str_buf, mem_unit_str);
  if (chars_written <= 0) {
    fmtbuf[0] = '?';
    fmtbuf[1] = '?';
    fmtbuf[2] = '?';
    fmtbuf[3] = '\0';
    return fmtbuf;
  }
  return fmtbuf;
}


x86 assembly (clang, -O0):
<PS2_FormatMemoryUnit>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x400,-0xc(%rbp)
jae    115b <PS2_FormatMemoryUnit+0x4b>
mov    -0x10(%rbp),%eax
test   %eax,%eax
lea    0xeeb(%rip),%rcx
lea    0xec3(%rip),%rax
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1249 <PS2_FormatMemoryUnit+0x139>
cmpl   $0x100000,-0xc(%rbp)
jae    11a1 <PS2_FormatMemoryUnit+0x91>
mov    -0x10(%rbp),%eax
test   %eax,%eax
lea    0xe96(%rip),%rcx
lea    0xe92(%rip),%rax
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xe6d(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1244 <PS2_FormatMemoryUnit+0x134>
cmpl   $0x40000000,-0xc(%rbp)
jae    11f3 <PS2_FormatMemoryUnit+0xe3>
mov    -0x10(%rbp),%eax
test   %eax,%eax
lea    0xe5d(%rip),%rcx
lea    0xe59(%rip),%rax
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xe27(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xe1b(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    123f <PS2_FormatMemoryUnit+0x12f>
mov    -0x10(%rbp),%eax
test   %eax,%eax
lea    0xe25(%rip),%rcx
lea    0xe21(%rip),%rax
cmovne %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm0
movss  0xde2(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xdd6(%rip),%xmm1
divss  %xmm1,%xmm0
movss  0xdca(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1244 <PS2_FormatMemoryUnit+0x134>
jmp    1249 <PS2_FormatMemoryUnit+0x139>
movslq 0x2df0(%rip),%rcx
lea    0x2df9(%rip),%rax
shl    $0x7,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    0x2dd8(%rip),%eax
add    $0x1,%eax
and    $0x7,%eax
mov    %eax,0x2dcc(%rip)
lea    -0x90(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x64,%esi
lea    0xda1(%rip),%rdx
mov    $0x1,%al
call   1030 <snprintf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jg     12d0 <PS2_FormatMemoryUnit+0x1c0>
mov    -0x28(%rbp),%rax
movb   $0x3f,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x3f,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x3f,0x2(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1401 <PS2_FormatMemoryUnit+0x2f1>
lea    -0x90(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
cmpb   $0x0,(%rax)
je     139e <PS2_FormatMemoryUnit+0x28e>
mov    -0x98(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    1382 <PS2_FormatMemoryUnit+0x272>
jmp    1306 <PS2_FormatMemoryUnit+0x1f6>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x98(%rbp)
cmpb   $0x0,0x1(%rax)
je     132a <PS2_FormatMemoryUnit+0x21a>
jmp    1306 <PS2_FormatMemoryUnit+0x1f6>
jmp    132f <PS2_FormatMemoryUnit+0x21f>
mov    -0x98(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x98(%rbp)
movsbl -0x1(%rax),%eax
cmp    $0x30,%eax
jne    1360 <PS2_FormatMemoryUnit+0x250>
mov    -0x98(%rbp),%rax
movb   $0x0,(%rax)
jmp    132f <PS2_FormatMemoryUnit+0x21f>
mov    -0x98(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    137d <PS2_FormatMemoryUnit+0x26d>
mov    -0x98(%rbp),%rax
movb   $0x0,(%rax)
jmp    139e <PS2_FormatMemoryUnit+0x28e>
jmp    1387 <PS2_FormatMemoryUnit+0x277>
mov    -0x98(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x98(%rbp)
jmp    12de <PS2_FormatMemoryUnit+0x1ce>
mov    -0x28(%rbp),%rdi
lea    -0x90(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x80,%esi
lea    0xc7d(%rip),%rdx
mov    $0x0,%al
call   1030 <snprintf@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jg     13f9 <PS2_FormatMemoryUnit+0x2e9>
mov    -0x28(%rbp),%rax
movb   $0x3f,(%rax)
mov    -0x28(%rbp),%rax
movb   $0x3f,0x1(%rax)
mov    -0x28(%rbp),%rax
movb   $0x3f,0x2(%rax)
mov    -0x28(%rbp),%rax
movb   $0x0,0x3(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1401 <PS2_FormatMemoryUnit+0x2f1>
mov    -0x28(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PS2_FormatMemoryUnit>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
cmp    $0x3ff,%edi
ja     1143 <PS2_FormatMemoryUnit+0x33>
test   %esi,%esi
lea    0xed8(%rip),%rax
lea    0xef2(%rip),%r14
cmove  %rax,%r14
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
jmp    11cc <PS2_FormatMemoryUnit+0xbc>
cmp    $0xfffff,%edi
ja     1170 <PS2_FormatMemoryUnit+0x60>
test   %esi,%esi
lea    0xeb9(%rip),%rax
lea    0xeaf(%rip),%r14
mov    %edi,%ecx
cvtsi2ss %rcx,%xmm0
cmove  %rax,%r14
mulss  0xe92(%rip),%xmm0
jmp    11cc <PS2_FormatMemoryUnit+0xbc>
cmp    $0x3fffffff,%edi
ja     119d <PS2_FormatMemoryUnit+0x8d>
test   %esi,%esi
lea    0xe99(%rip),%rax
lea    0xe8f(%rip),%r14
cmove  %rax,%r14
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
movss  0xe65(%rip),%xmm1
jmp    11c4 <PS2_FormatMemoryUnit+0xb4>
test   %esi,%esi
lea    0xe81(%rip),%rax
lea    0xe77(%rip),%r14
cmove  %rax,%r14
mov    %edi,%eax
cvtsi2ss %rax,%xmm0
movss  0xe40(%rip),%xmm1
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mov    0x2e6e(%rip),%ebx
lea    0x1(%rbx),%eax
shl    $0x7,%rbx
lea    0x2e70(%rip),%r12
lea    (%r12,%rbx,1),%r15
and    $0x7,%eax
mov    %eax,0x2e53(%rip)
cvtss2sd %xmm0,%xmm0
lea    0xe39(%rip),%rdx
mov    %rsp,%rdi
mov    $0x64,%esi
mov    $0x1,%al
call   1030 <snprintf@plt>
test   %eax,%eax
jle    1277 <PS2_FormatMemoryUnit+0x167>
lea    -0x1(%rsp),%rax
movzbl 0x1(%rax),%ecx
test   %cl,%cl
je     1257 <PS2_FormatMemoryUnit+0x147>
cmp    $0x2e,%cl
je     1230 <PS2_FormatMemoryUnit+0x120>
add    $0x1,%rax
jmp    1210 <PS2_FormatMemoryUnit+0x100>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0x0,0x2(%rax)
lea    0x1(%rax),%rax
jne    1230 <PS2_FormatMemoryUnit+0x120>
jmp    1247 <PS2_FormatMemoryUnit+0x137>
nopl   0x0(%rax)
movb   $0x0,(%rax)
add    $0xffffffffffffffff,%rax
movzbl (%rax),%ecx
cmp    $0x30,%cl
je     1240 <PS2_FormatMemoryUnit+0x130>
cmp    $0x2e,%cl
jne    1257 <PS2_FormatMemoryUnit+0x147>
movb   $0x0,(%rax)
lea    0xdd8(%rip),%rdx
mov    %rsp,%rcx
mov    %r15,%rdi
mov    $0x80,%esi
mov    %r14,%r8
xor    %eax,%eax
call   1030 <snprintf@plt>
test   %eax,%eax
jg     1289 <PS2_FormatMemoryUnit+0x179>
movb   $0x3f,(%r15)
movw   $0x3f3f,0x1(%rbx,%r12,1)
3f
movb   $0x0,0x3(%rbx,%r12,1)
mov    %r15,%rax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"B\00"
@.str.1 = [6 x i8] c"Bytes\00"
@.str.2 = [3 x i8] c"KB\00"
@.str.3 = [10 x i8] c"Kilobytes\00"
@.str.4 = [3 x i8] c"MB\00"
@.str.5 = [10 x i8] c"Megabytes\00"
@.str.6 = [3 x i8] c"GB\00"
@.str.7 = [10 x i8] c"Gigabytes\00"
@PS2_FormatMemoryUnit.bufnum = internal global i32 0
@PS2_FormatMemoryUnit.local_str_buf = internal global [8 x [128 x i8]] zeroinitializer
@.str.8 = [5 x i8] c"%.2f\00"
@.str.9 = [6 x i8] c"%s %s\00"
define i8* @PS2_FormatMemoryUnit(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
%7 = alloca float
%8 = alloca i8*
%9 = alloca i32
%10 = alloca [100 x i8]
%11 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%12 = load i32, i32* %4
%13 = icmp ult i32 %12, 1024
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* %5
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i64
%18 = select i1 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0)
store i8* %18, i8** %6
%19 = load i32, i32* %4
%20 = uitofp i32 %19 to float
store float %20, float* %7
br label %56
21: ; preds = %2
%22 = load i32, i32* %4
%23 = icmp ult i32 %22, 1048576
br i1 %23, label %24, label %32
24: ; preds = %21
%25 = load i32, i32* %5
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0)
store i8* %28, i8** %6
%29 = load i32, i32* %4
%30 = uitofp i32 %29 to float
%31 = fdiv float %30, 1.024000e+03
store float %31, float* %7
br label %55
32: ; preds = %21
%33 = load i32, i32* %4
%34 = icmp ult i32 %33, 1073741824
br i1 %34, label %35, label %44
35: ; preds = %32
%36 = load i32, i32* %5
%37 = icmp ne i32 %36, 0
%38 = zext i1 %37 to i64
%39 = select i1 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0)
store i8* %39, i8** %6
%40 = load i32, i32* %4
%41 = uitofp i32 %40 to float
%42 = fdiv float %41, 1.024000e+03
%43 = fdiv float %42, 1.024000e+03
store float %43, float* %7
br label %54
44: ; preds = %32
%45 = load i32, i32* %5
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i64
%48 = select i1 %46, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0)
store i8* %48, i8** %6
%49 = load i32, i32* %4
%50 = uitofp i32 %49 to float
%51 = fdiv float %50, 1.024000e+03
%52 = fdiv float %51, 1.024000e+03
%53 = fdiv float %52, 1.024000e+03
store float %53, float* %7
br label %54
54: ; preds = %44, %35
br label %55
55: ; preds = %54, %24
br label %56
56: ; preds = %55, %14
%57 = load i32, i32* @PS2_FormatMemoryUnit.bufnum
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [8 x [128 x i8]], [8 x [128 x i8]]* @PS2_FormatMemoryUnit.local_str_buf, i64 0, i64 %58
%60 = getelementptr inbounds [128 x i8], [128 x i8]* %59, i64 0, i64 0
store i8* %60, i8** %8
%61 = load i32, i32* @PS2_FormatMemoryUnit.bufnum
%62 = add nsw i32 %61, 1
%63 = and i32 %62, 7
store i32 %63, i32* @PS2_FormatMemoryUnit.bufnum
%64 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%65 = load float, float* %7
%66 = fpext float %65 to double
%67 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %64, i32 100, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double %66)
store i32 %67, i32* %9
%68 = load i32, i32* %9
%69 = icmp sle i32 %68, 0
br i1 %69, label %70, label %80
70: ; preds = %56
%71 = load i8*, i8** %8
%72 = getelementptr inbounds i8, i8* %71, i64 0
store i8 63, i8* %72
%73 = load i8*, i8** %8
%74 = getelementptr inbounds i8, i8* %73, i64 1
store i8 63, i8* %74
%75 = load i8*, i8** %8
%76 = getelementptr inbounds i8, i8* %75, i64 2
store i8 63, i8* %76
%77 = load i8*, i8** %8
%78 = getelementptr inbounds i8, i8* %77, i64 3
store i8 0, i8* %78
%79 = load i8*, i8** %8
store i8* %79, i8** %3
br label %138
80: ; preds = %56
%81 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
store i8* %81, i8** %11
br label %82
82: ; preds = %116, %80
%83 = load i8*, i8** %11
%84 = load i8, i8* %83
%85 = icmp ne i8 %84, 0
br i1 %85, label %86, label %119
86: ; preds = %82
%87 = load i8*, i8** %11
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 46
br i1 %90, label %91, label %115
91: ; preds = %86
br label %92
92: ; preds = %97, %91
%93 = load i8*, i8** %11
%94 = getelementptr inbounds i8, i8* %93, i32 1
store i8* %94, i8** %11
%95 = load i8, i8* %94
%96 = icmp ne i8 %95, 0
br i1 %96, label %97, label %98
97: ; preds = %92
br label %92
98: ; preds = %92
br label %99
99: ; preds = %105, %98
%100 = load i8*, i8** %11
%101 = getelementptr inbounds i8, i8* %100, i32 -1
store i8* %101, i8** %11
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp eq i32 %103, 48
br i1 %104, label %105, label %107
105: ; preds = %99
%106 = load i8*, i8** %11
store i8 0, i8* %106
br label %99
107: ; preds = %99
%108 = load i8*, i8** %11
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 46
br i1 %111, label %112, label %114
112: ; preds = %107
%113 = load i8*, i8** %11
store i8 0, i8* %113
br label %114
114: ; preds = %112, %107
br label %119
115: ; preds = %86
br label %116
116: ; preds = %115
%117 = load i8*, i8** %11
%118 = getelementptr inbounds i8, i8* %117, i32 1
store i8* %118, i8** %11
br label %82
119: ; preds = %114, %82
%120 = load i8*, i8** %8
%121 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%122 = load i8*, i8** %6
%123 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %120, i32 128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %121, i8* %122)
store i32 %123, i32* %9
%124 = load i32, i32* %9
%125 = icmp sle i32 %124, 0
br i1 %125, label %126, label %136
126: ; preds = %119
%127 = load i8*, i8** %8
%128 = getelementptr inbounds i8, i8* %127, i64 0
store i8 63, i8* %128
%129 = load i8*, i8** %8
%130 = getelementptr inbounds i8, i8* %129, i64 1
store i8 63, i8* %130
%131 = load i8*, i8** %8
%132 = getelementptr inbounds i8, i8* %131, i64 2
store i8 63, i8* %132
%133 = load i8*, i8** %8
%134 = getelementptr inbounds i8, i8* %133, i64 3
store i8 0, i8* %134
%135 = load i8*, i8** %8
store i8* %135, i8** %3
br label %138
136: ; preds = %119
%137 = load i8*, i8** %8
store i8* %137, i8** %3
br label %138
138: ; preds = %136, %126, %70
%139 = load i8*, i8** %3
ret i8* %139
}

LLVM IR (-O2):
@.str = [2 x i8] c"B\00"
@.str.1 = [6 x i8] c"Bytes\00"
@.str.2 = [3 x i8] c"KB\00"
@.str.3 = [10 x i8] c"Kilobytes\00"
@.str.4 = [3 x i8] c"MB\00"
@.str.5 = [10 x i8] c"Megabytes\00"
@.str.6 = [3 x i8] c"GB\00"
@.str.7 = [10 x i8] c"Gigabytes\00"
@PS2_FormatMemoryUnit.bufnum = internal unnamed_addr global i32 0
@PS2_FormatMemoryUnit.local_str_buf = internal global [8 x [128 x i8]] zeroinitializer
@.str.8 = [5 x i8] c"%.2f\00"
@.str.9 = [6 x i8] c"%s %s\00"
define i8* @PS2_FormatMemoryUnit(i32 %0, i32 %1) {
%3 = alloca [100 x i8]
%4 = icmp ult i32 %0, 1024
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = icmp eq i32 %1, 0
%7 = select i1 %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%8 = uitofp i32 %0 to float
br label %30
9: ; preds = %2
%10 = icmp ult i32 %0, 1048576
br i1 %10, label %11, label %16
11: ; preds = %9
%12 = icmp eq i32 %1, 0
%13 = select i1 %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%14 = uitofp i32 %0 to float
%15 = fmul float %14, 0x3F50000000000000
br label %30
16: ; preds = %9
%17 = icmp ult i32 %0, 1073741824
%18 = icmp eq i32 %1, 0
br i1 %17, label %19, label %24
19: ; preds = %16
%20 = select i1 %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0)
%21 = uitofp i32 %0 to float
%22 = fmul float %21, 0x3F50000000000000
%23 = fmul float %22, 0x3F50000000000000
br label %30
24: ; preds = %16
%25 = select i1 %18, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0)
%26 = uitofp i32 %0 to float
%27 = fmul float %26, 0x3F50000000000000
%28 = fmul float %27, 0x3F50000000000000
%29 = fmul float %28, 0x3F50000000000000
br label %30
30: ; preds = %11, %24, %19, %5
%31 = phi i8* [ %7, %5 ], [ %13, %11 ], [ %20, %19 ], [ %25, %24 ]
%32 = phi float [ %8, %5 ], [ %15, %11 ], [ %23, %19 ], [ %29, %24 ]
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%34 = load i32, i32* @PS2_FormatMemoryUnit.bufnum
%35 = zext i32 %34 to i64
%36 = getelementptr inbounds [8 x [128 x i8]], [8 x [128 x i8]]* @PS2_FormatMemoryUnit.local_str_buf, i64 0, i64 %35, i64 0
%37 = add nsw i32 %34, 1
%38 = and i32 %37, 7
store i32 %38, i32* @PS2_FormatMemoryUnit.bufnum
%39 = fpext float %32 to double
%40 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %33, i32 100, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), double %39)
%41 = icmp slt i32 %40, 1
br i1 %41, label %61, label %42
42: ; preds = %30, %56
%43 = phi i8* [ %57, %56 ], [ %33, %30 ]
%44 = load i8, i8* %43
switch i8 %44, label %56 [
i8 0, label %58
i8 46, label %45
]
45: ; preds = %42, %45
%46 = phi i8* [ %47, %45 ], [ %43, %42 ]
%47 = getelementptr inbounds i8, i8* %46, i64 1
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 0
br i1 %49, label %50, label %45
50: ; preds = %45, %54
%51 = phi i8* [ %52, %54 ], [ %47, %45 ]
%52 = getelementptr inbounds i8, i8* %51, i64 -1
%53 = load i8, i8* %52
switch i8 %53, label %58 [
i8 48, label %54
i8 46, label %55
]
54: ; preds = %50
store i8 0, i8* %52
br label %50
55: ; preds = %50
store i8 0, i8* %52
br label %58
56: ; preds = %42
%57 = getelementptr inbounds i8, i8* %43, i64 1
br label %42
58: ; preds = %42, %50, %55
%59 = call i32 (i8*, i32, i8*, ...) @snprintf(i8* %36, i32 128, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), i8* %33, i8* %31)
%60 = icmp slt i32 %59, 1
br i1 %60, label %61, label %65
61: ; preds = %58, %30
store i8 63, i8* %36
%62 = getelementptr inbounds [8 x [128 x i8]], [8 x [128 x i8]]* @PS2_FormatMemoryUnit.local_str_buf, i64 0, i64 %35, i64 1
store i8 63, i8* %62
%63 = getelementptr inbounds [8 x [128 x i8]], [8 x [128 x i8]]* @PS2_FormatMemoryUnit.local_str_buf, i64 0, i64 %35, i64 2
store i8 63, i8* %63
%64 = getelementptr inbounds [8 x [128 x i8]], [8 x [128 x i8]]* @PS2_FormatMemoryUnit.local_str_buf, i64 0, i64 %35, i64 3
store i8 0, i8* %64
br label %65
65: ; preds = %61, %58
ret i8* %36
}