#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 *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
double sqrt(float);
int main() {
  float l1, l2, krok;
  printf(
      "Podaj wartość początkową, wartość końcową oraz krok dla argumentu: \n");
  scanf("%f %f %f", &l1, &l2, &krok);
  while (l1 <= l2) {
    printf("%.4f %.4f\n", l1, sqrt(l1));
    l1 = l1 + krok;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jb     11ba <main+0x8a>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1165 <main+0x35>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jb     11d2 <main+0x92>
lea    0xe85(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
call   1060 <sqrt@plt>
movaps %xmm0,%xmm1
mov    %rbx,%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
addss  0x14(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
movss  0x10(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jae    1190 <main+0x50>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [77 x i8] c"Podaj warto\C5\9B\C4\87 pocz\C4\85tkow\C4\85, warto\C5\9B\C4\87 ko\C5\84cow\C4\85 oraz krok dla argumentu: \0A\00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [11 x i8] c"%.4f %.4f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4)
br label %7
7: ; preds = %11, %0
%8 = load float, float* %2
%9 = load float, float* %3
%10 = fcmp ole float %8, %9
br i1 %10, label %11, label %20
11: ; preds = %7
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = load float, float* %2
%15 = call double @sqrt(float %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %13, double %15)
%17 = load float, float* %2
%18 = load float, float* %4
%19 = fadd float %17, %18
store float %19, float* %2
br label %7
20: ; preds = %7
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [11 x i8] c"%.4f %.4f\0A\00"
@str = [76 x i8] c"Podaj warto\C5\9B\C4\87 pocz\C4\85tkow\C4\85, warto\C5\9B\C4\87 ko\C5\84cow\C4\85 oraz krok dla argumentu: \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([76 x i8], [76 x i8]* @str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fcmp ugt float %9, %10
br i1 %11, label %22, label %12
12: ; preds = %0, %12
%13 = phi float [ %19, %12 ], [ %9, %0 ]
%14 = fpext float %13 to double
%15 = call double @sqrt(float %13)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), double %14, double %15)
%17 = load float, float* %1
%18 = load float, float* %3
%19 = fadd float %17, %18
store float %19, float* %1
%20 = load float, float* %2
%21 = fcmp ugt float %19, %20
br i1 %21, label %22, label %12
22: ; preds = %12, %0
ret i32 0
}