#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 *, double *);
int /*<<< orphan*/ sqrt(double);
int main() {
  double a, b, c;
  printf("Podaj wartość początkową: \n");
  scanf("%lf", &a);
  printf("Podaj wartość koncową: \n");
  scanf("%lf", &b);
  printf("Podaj wartość kroku dla argumentu: \n");
  scanf("%lf", &c);
  for (; a <= b; a += c) {
    printf("%.4lf %.4lf\n", a, sqrt(a));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     11ea <main+0xba>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  -0x28(%rbp),%xmm0
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1199 <main+0x69>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec6(%rip),%rdi
call   1030 <puts@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     11e9 <main+0xa9>
lea    0xe57(%rip),%rbx
nopl   (%rax)
movsd  %xmm0,0x10(%rsp)
call   1060 <sqrt@plt>
mov    %rbx,%rdi
movsd  0x10(%rsp),%xmm0
mov    %eax,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x18(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    11b0 <main+0x70>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

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

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