#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*/ printf(char *, float, float, float);
int main() {
  float g = 100;
  float s;
  float f = 100;
  float x;
  float scale = 0.3;
  int i = 0;
  for (i = 0; i < 200; i++, f += 1) {
    x = f * scale;
    s = f - g - x;
    printf("fangjia %f, shoufu %f, shang dai= %f\n", f, x, s);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xed0(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xebf(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xc8,-0x1c(%rbp)
jge    11bf <main+0xaf>
movss  -0x10(%rbp),%xmm0
mulss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0x14(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movss  0xe58(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1154 <main+0x44>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movss  0xee5(%rip),%xmm2
mov    $0xc8,%ebp
lea    0xee9(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movss  %xmm2,0x4(%rsp)
movaps %xmm2,%xmm1
mulss  0xec3(%rip),%xmm1
addss  0xebf(%rip),%xmm2
subss  %xmm1,%xmm2
mov    %rbx,%rdi
movss  0x4(%rsp),%xmm0
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm2
addss  0xea3(%rip),%xmm2
add    $0xffffffff,%ebp
jne    1130 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"fangjia %f, shoufu %f, shang dai= %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
store i32 0, i32* %1
store float 1.000000e+02, float* %2
store float 1.000000e+02, float* %4
store float 0x3FD3333340000000, float* %6
store i32 0, i32* %7
store i32 0, i32* %7
br label %8
8: ; preds = %24, %0
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 200
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load float, float* %4
%13 = load float, float* %6
%14 = fmul float %12, %13
store float %14, float* %5
%15 = load float, float* %4
%16 = load float, float* %2
%17 = fsub float %15, %16
%18 = load float, float* %5
%19 = fsub float %17, %18
store float %19, float* %3
%20 = load float, float* %4
%21 = load float, float* %5
%22 = load float, float* %3
%23 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), float %20, float %21, float %22)
br label %24
24: ; preds = %11
%25 = load i32, i32* %7
%26 = add nsw i32 %25, 1
store i32 %26, i32* %7
%27 = load float, float* %4
%28 = fadd float %27, 1.000000e+00
store float %28, float* %4
br label %8
29: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"fangjia %f, shoufu %f, shang dai= %f\0A\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %8, %1 ]
%3 = phi float [ 1.000000e+02, %0 ], [ %9, %1 ]
%4 = fmul float %3, 0x3FD3333340000000
%5 = fadd float %3, -1.000000e+02
%6 = fsub float %5, %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), float %3, float %4, float %6)
%8 = add nuw nsw i32 %2, 1
%9 = fadd float %3, 1.000000e+00
%10 = icmp eq i32 %8, 200
br i1 %10, label %11, label %1
11: ; preds = %1
ret i32 0
}