#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*/ exit(int /*<<< orphan*/);
double log(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *, ...);
int sqrt(double);
int main(void) {
  double a, b, y, step;
  printf("Введите интервал: ");
  scanf("%lf %lf", &a, &b);
  printf("Введите шаг: ");
  scanf("%lf", &step);
  printf("-------------------------------------------------\n");
  printf("|           X           |           Y           |\n");
  printf("|-----------------------|-----------------------|\n");
  for (double x = a; x <= b; x += step) {
    if (x <= 0) {
      printf("| %-22f| Функция не существует |\n", x);
    } else {
      y = log(x);
      int pw = 3;
      for (int n = 1; n <= 20; n++) {
        pw *= 3;
        y += sqrt(x) / pw;
      }
      printf("| %-22f| %-22f|\n", x, y);
    }
  }
  printf("-------------------------------------------------");
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeae(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8e(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     129a <main+0x14a>
xorps  %xmm0,%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     1211 <main+0xc1>
movsd  -0x30(%rbp),%xmm0
lea    0xed6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1281 <main+0x131>
movsd  -0x30(%rbp),%xmm0
call   1050 <log@plt>
movsd  %xmm0,-0x20(%rbp)
movl   $0x3,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
cmpl   $0x14,-0x38(%rbp)
jg     1269 <main+0x119>
imul   $0x3,-0x34(%rbp),%eax
mov    %eax,-0x34(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1060 <sqrt@plt>
cltd
idivl  -0x34(%rbp)
cvtsi2sd %eax,%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    122e <main+0xde>
movsd  -0x30(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe96(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    1286 <main+0x136>
movsd  -0x28(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    11d7 <main+0x87>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x30,%rsp
lea    0xe95(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    0x28(%rsp),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xf22(%rip),%rdi
call   1030 <puts@plt>
movsd  0x28(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    11fe <main+0x9e>
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %edi,%edi
call   1080 <exit@plt>
lea    0xe7a(%rip),%r14
lea    0xe3e(%rip),%r15
jmp    1232 <main+0xd2>
xchg   %ax,%ax
mov    %r15,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x8(%rsp),%xmm0
addsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     11e9 <main+0x89>
xorpd  %xmm1,%xmm1
ucomisd %xmm0,%xmm1
movsd  %xmm0,0x8(%rsp)
jae    1210 <main+0xb0>
call   1060 <log@plt>
movapd %xmm0,%xmm1
mov    $0x3,%ebx
mov    $0x14,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,0x10(%rsp)
lea    (%rbx,%rbx,2),%r12d
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
cltd
idiv   %r12d
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
lea    (%rbx,%rbx,8),%ebx
movsd  0x8(%rsp),%xmm0
call   1070 <sqrt@plt>
cltd
idiv   %ebx
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x10(%rsp),%xmm1
add    $0xfffffffe,%ebp
jne    1260 <main+0x100>
mov    %r14,%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x2,%al
call   1040 <printf@plt>
jmp    121a <main+0xba>

LLVM IR (-O0):
@.str = [34 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\B8\D0\BD\D1\82\D0\B5\D1\80\D0\B2\D0\B0\D0\BB: \00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [24 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\88\D0\B0\D0\B3: \00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.4 = [51 x i8] c"-------------------------------------------------\0A\00"
@.str.5 = [51 x i8] c"| X | Y |\0A\00"
@.str.6 = [51 x i8] c"|-----------------------|-----------------------|\0A\00"
@.str.7 = [53 x i8] c"| %-22f| \D0\A4\D1\83\D0\BD\D0\BA\D1\86\D0\B8\D1\8F \D0\BD\D0\B5 \D1\81\D1\83\D1\89\D0\B5\D1\81\D1\82\D0\B2\D1\83\D0\B5\D1\82 |\0A\00"
@.str.8 = [17 x i8] c"| %-22f| %-22f|\0A\00"
@.str.9 = [50 x i8] c"-------------------------------------------------\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %5)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.6, i64 0, i64 0))
%16 = load double, double* %2
store double %16, double* %6
br label %17
17: ; preds = %51, %0
%18 = load double, double* %6
%19 = load double, double* %3
%20 = fcmp ole double %18, %19
br i1 %20, label %21, label %55
21: ; preds = %17
%22 = load double, double* %6
%23 = fcmp ole double %22, 0.000000e+00
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load double, double* %6
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0), double %25)
br label %50
27: ; preds = %21
%28 = load double, double* %6
%29 = call double @log(double %28)
store double %29, double* %4
store i32 3, i32* %7
store i32 1, i32* %8
br label %30
30: ; preds = %43, %27
%31 = load i32, i32* %8
%32 = icmp sle i32 %31, 20
br i1 %32, label %33, label %46
33: ; preds = %30
%34 = load i32, i32* %7
%35 = mul nsw i32 %34, 3
store i32 %35, i32* %7
%36 = load double, double* %6
%37 = call i32 @sqrt(double %36)
%38 = load i32, i32* %7
%39 = sdiv i32 %37, %38
%40 = sitofp i32 %39 to double
%41 = load double, double* %4
%42 = fadd double %41, %40
store double %42, double* %4
br label %43
43: ; preds = %33
%44 = load i32, i32* %8
%45 = add nsw i32 %44, 1
store i32 %45, i32* %8
br label %30
46: ; preds = %30
%47 = load double, double* %6
%48 = load double, double* %4
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), double %47, double %48)
br label %50
50: ; preds = %46, %24
br label %51
51: ; preds = %50
%52 = load double, double* %5
%53 = load double, double* %6
%54 = fadd double %53, %52
store double %54, double* %6
br label %17
55: ; preds = %17
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.9, i64 0, i64 0))
%57 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D0\B8\D0\BD\D1\82\D0\B5\D1\80\D0\B2\D0\B0\D0\BB: \00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [24 x i8] c"\D0\92\D0\B2\D0\B5\D0\B4\D0\B8\D1\82\D0\B5 \D1\88\D0\B0\D0\B3: \00"
@.str.3 = [4 x i8] c"%lf\00"
@.str.7 = [53 x i8] c"| %-22f| \D0\A4\D1\83\D0\BD\D0\BA\D1\86\D0\B8\D1\8F \D0\BD\D0\B5 \D1\81\D1\83\D1\89\D0\B5\D1\81\D1\82\D0\B2\D1\83\D0\B5\D1\82 |\0A\00"
@.str.8 = [17 x i8] c"| %-22f| %-22f|\0A\00"
@str = [50 x i8] c"-------------------------------------------------\00"
@str.10 = [50 x i8] c"| X | Y |\00"
@str.11 = [50 x i8] c"|-----------------------|-----------------------|\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, double*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), double* %3)
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.10, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.11, i64 0, i64 0))
%14 = load double, double* %1
%15 = load double, double* %2
%16 = fcmp ugt double %14, %15
br i1 %16, label %17, label %20
17: ; preds = %45, %0
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %0, %45
%21 = phi double [ %47, %45 ], [ %14, %0 ]
%22 = fcmp ugt double %21, 0.000000e+00
br i1 %22, label %25, label %23
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.7, i64 0, i64 0), double %21)
br label %45
25: ; preds = %20
%26 = call double @log(double %21)
br label %29
27: ; preds = %29
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.8, i64 0, i64 0), double %21, double %42)
br label %45
29: ; preds = %29, %25
%30 = phi i32 [ 1, %25 ], [ %43, %29 ]
%31 = phi i32 [ 3, %25 ], [ %38, %29 ]
%32 = phi double [ %26, %25 ], [ %42, %29 ]
%33 = mul nsw i32 %31, 3
%34 = call i32 @sqrt(double %21)
%35 = sdiv i32 %34, %33
%36 = sitofp i32 %35 to double
%37 = fadd double %32, %36
%38 = mul i32 %31, 9
%39 = call i32 @sqrt(double %21)
%40 = sdiv i32 %39, %38
%41 = sitofp i32 %40 to double
%42 = fadd double %37, %41
%43 = add nuw nsw i32 %30, 2
%44 = icmp eq i32 %43, 21
br i1 %44, label %27, label %29
45: ; preds = %23, %27
%46 = load double, double* %3
%47 = fadd double %21, %46
%48 = load double, double* %2
%49 = fcmp ugt double %47, %48
br i1 %49, label %17, label %20
}