#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*/ format_size(char *, float);
int /*<<< orphan*/ printf(char *, float, char *);
int main(int argc, char *argv[]) {
  char buf[1024];
  float size = 100;
  int i = 0;
  for (i = 0; i < 50; i++) {
    format_size(buf, size);
    printf("%f format_size %s\n", size, buf);
    size += 1024 * 50;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x420,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x414(%rbp)
ff
movl   $0x0,-0x418(%rbp)
movl   $0x0,-0x418(%rbp)
cmpl   $0x32,-0x418(%rbp)
jge    11c5 <main+0xa5>
lea    -0x410(%rbp),%rdi
movss  -0x414(%rbp),%xmm0
ff
call   1030 <format_size@plt>
movss  -0x414(%rbp),%xmm0
ff
lea    -0x410(%rbp),%rsi
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
movss  0xe63(%rip),%xmm0
addss  -0x414(%rbp),%xmm0
ff
movss  %xmm0,-0x414(%rbp)
ff
mov    -0x418(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x418(%rbp)
jmp    115d <main+0x3d>
xor    %eax,%eax
add    $0x420,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x410,%rsp
movss  0xecd(%rip),%xmm0
mov    $0x32,%ebp
lea    0x10(%rsp),%rbx
lea    0xec4(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
movss  0xc(%rsp),%xmm0
call   1030 <format_size@plt>
mov    %r14,%rdi
movss  0xc(%rsp),%xmm0
mov    %rbx,%rsi
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
addss  0xe81(%rip),%xmm0
add    $0xffffffff,%ebp
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%f format_size %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [1024 x i8]
%7 = alloca float
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store float 1.000000e+02, float* %7
store i32 0, i32* %8
store i32 0, i32* %8
br label %9
9: ; preds = %21, %2
%10 = load i32, i32* %8
%11 = icmp slt i32 %10, 50
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%14 = load float, float* %7
%15 = call i32 @format_size(i8* %13, float %14)
%16 = load float, float* %7
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%18 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %16, i8* %17)
%19 = load float, float* %7
%20 = fadd float %19, 5.120000e+04
store float %20, float* %7
br label %21
21: ; preds = %12
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %9
24: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%f format_size %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [1024 x i8]
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %11, %5 ]
%7 = phi float [ 1.000000e+02, %2 ], [ %10, %5 ]
%8 = call i32 @format_size(i8* %4, float %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), float %7, i8* %4)
%10 = fadd float %7, 5.120000e+04
%11 = add nuw nsw i32 %6, 1
%12 = icmp eq i32 %11, 50
br i1 %12, label %13, label %5
13: ; preds = %5
ret i32 0
}