#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*/ writeFloat(float, char *, int);
void testforloop() {
  float f;
  for (f = -1.f; f < 1.f; f += 0.2f) {
    writeFloat(f, "f", 10);
  }
}


x86 assembly (clang, -O0):
<testforloop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  0xee0(%rip),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  0xed7(%rip),%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    1164 <testforloop+0x54>
movss  -0x4(%rbp),%xmm0
lea    0xec9(%rip),%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xeb3(%rip),%xmm0
addss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1125 <testforloop+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testforloop>:
push   %rbx
lea    0xf14(%rip),%rbx
movss  0xee0(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xecf(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xebe(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xead(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe9c(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe8b(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe7a(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe69(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe58(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe47(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <writeFloat@plt>
movss  0xe36(%rip),%xmm0
mov    %rbx,%rdi
mov    $0xa,%esi
pop    %rbx
jmp    1030 <writeFloat@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"f\00"
define void @testforloop() {
%1 = alloca float
store float -1.000000e+00, float* %1
br label %2
2: ; preds = %8, %0
%3 = load float, float* %1
%4 = fcmp olt float %3, 1.000000e+00
br i1 %4, label %5, label %11
5: ; preds = %2
%6 = load float, float* %1
%7 = call i32 @writeFloat(float %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
br label %8
8: ; preds = %5
%9 = load float, float* %1
%10 = fadd float %9, 0x3FC99999A0000000
store float %10, float* %1
br label %2
11: ; preds = %2
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"f\00"
define void @testforloop() {
%1 = tail call i32 @writeFloat(float -1.000000e+00, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = tail call i32 @writeFloat(float 0xBFE99999A0000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = tail call i32 @writeFloat(float 0xBFE3333340000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%4 = tail call i32 @writeFloat(float 0xBFD99999C0000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%5 = tail call i32 @writeFloat(float 0xBFC99999E0000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%6 = tail call i32 @writeFloat(float 0xBE60000000000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%7 = tail call i32 @writeFloat(float 0x3FC9999960000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%8 = tail call i32 @writeFloat(float 0x3FD9999980000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%9 = tail call i32 @writeFloat(float 0x3FE3333320000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%10 = tail call i32 @writeFloat(float 0x3FE9999980000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
%11 = tail call i32 @writeFloat(float 0x3FEFFFFFE0000000, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i32 10)
ret void
}