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

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double);
int main(int argc, char const *argv[]) {
  FILE *fp = fopen("input.txt", "w");
  double num = 0.05;
  while (num <= 300) {
    fprintf(fp, "%.2lf\n", num);
    num += 0.05;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xed3(%rip),%rdi
lea    0xed6(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x18(%rbp)
movsd  0xeab(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xea6(%rip),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1199 <main+0x79>
mov    -0x18(%rbp),%rdi
movsd  -0x20(%rbp),%xmm0
lea    0xe9f(%rip),%rsi
call   1030 <fprintf@plt>
movsd  0xe76(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    115a <main+0x3a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xee5(%rip),%rdi
lea    0xee8(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
movsd  0xebe(%rip),%xmm0
lea    0xed3(%rip),%r14
nopl   0x0(%rax)
movsd  %xmm0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
movsd  (%rsp),%xmm0
call   1030 <fprintf@plt>
movsd  (%rsp),%xmm0
addsd  0xe8e(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0xe89(%rip),%xmm0
ucomisd (%rsp),%xmm0
movsd  (%rsp),%xmm0
jae    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %8, i32** %6
store double 5.000000e-02, double* %7
br label %9
9: ; preds = %12, %2
%10 = load double, double* %7
%11 = fcmp ole double %10, 3.000000e+02
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32*, i32** %6
%14 = load double, double* %7
%15 = call i32 @fprintf(i32* %13, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = load double, double* %7
%17 = fadd double %16, 5.000000e-02
store double %17, double* %7
br label %9
18: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"input.txt\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [7 x i8] c"%.2lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %4
4: ; preds = %2, %4
%5 = phi double [ 5.000000e-02, %2 ], [ %7, %4 ]
%6 = tail call i32 @fprintf(i32* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), double %5)
%7 = fadd double %5, 5.000000e-02
%8 = fcmp ugt double %7, 3.000000e+02
br i1 %8, label %9, label %4
9: ; preds = %4
ret i32 0
}