#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, double);
scalar_t__ scanf(char *, double *, int *);
double sqrt(double);
int main() {
  double result, n;
  int m;
  while (EOF != scanf("%lf%d", &n, &m)) {
    result = n;
    while (--m) {
      n = sqrt(n);
      result += n;
    }
    printf("%.2lf\n", result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
lea    0xeac(%rip),%rdi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1040 <scanf@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
cmp    %rcx,%rax
je     11c6 <main+0x96>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
cmp    $0x0,%eax
je     11b0 <main+0x80>
movsd  -0x18(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    117b <main+0x4b>
movsd  -0x10(%rbp),%xmm0
lea    0xe4a(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x2ea3(%rip),%r13
mov    0x0(%r13),%rbx
lea    0xeb8(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
cmp    %rax,%rbx
jne    1175 <main+0x45>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe92(%rip),%r14
lea    0xe85(%rip),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%rbx
jmp    11b7 <main+0x87>
nop
movapd %xmm0,%xmm1
mov    %r14,%rdi
movapd %xmm1,%xmm0
call   1030 <printf@plt>
mov    0x0(%r13),%rbp
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    %rax,%rbp
je     1164 <main+0x34>
movsd  0x8(%rsp),%xmm0
addl   $0xffffffff,0x4(%rsp)
je     1190 <main+0x60>
movapd %xmm0,%xmm1
jmp    11f2 <main+0xc2>
nopw   0x0(%rax,%rax,1)
movsd  %xmm1,0x10(%rsp)
call   1050 <sqrt@plt>
movsd  0x10(%rsp),%xmm1
movsd  %xmm0,0x8(%rsp)
addsd  %xmm0,%xmm1
addl   $0xffffffff,0x4(%rsp)
je     1194 <main+0x64>
ucomisd 0xe06(%rip),%xmm0
jb     11d0 <main+0xa0>
sqrtsd %xmm0,%xmm0
jmp    11e1 <main+0xb1>

LLVM IR (-O0):
@EOF = global i64 0
@.str = [6 x i8] c"%lf%d\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca i32
store i32 0, i32* %1
br label %5
5: ; preds = %21, %0
%6 = load i64, i64* @EOF
%7 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double* %3, i32* %4)
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %24
9: ; preds = %5
%10 = load double, double* %3
store double %10, double* %2
br label %11
11: ; preds = %15, %9
%12 = load i32, i32* %4
%13 = add nsw i32 %12, -1
store i32 %13, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load double, double* %3
%17 = call double @sqrt(double %16)
store double %17, double* %3
%18 = load double, double* %3
%19 = load double, double* %2
%20 = fadd double %19, %18
store double %20, double* %2
br label %11
21: ; preds = %11
%22 = load double, double* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %22)
br label %5
24: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i64 0
@.str = [6 x i8] c"%lf%d\00"
@.str.1 = [7 x i8] c"%.2lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i32
%3 = bitcast double* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = load i64, i64* @EOF
%6 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double* %1, i32* %2)
%7 = icmp eq i64 %5, %6
br i1 %7, label %27, label %8
8: ; preds = %0, %21
%9 = load double, double* %1
%10 = load i32, i32* %2
%11 = add nsw i32 %10, -1
store i32 %11, i32* %2
%12 = icmp eq i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %8, %13
%14 = phi double [ %16, %13 ], [ %9, %8 ]
%15 = phi double [ %17, %13 ], [ %9, %8 ]
%16 = call double @sqrt(double %14)
store double %16, double* %1
%17 = fadd double %15, %16
%18 = load i32, i32* %2
%19 = add nsw i32 %18, -1
store i32 %19, i32* %2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %13
21: ; preds = %13, %8
%22 = phi double [ %9, %8 ], [ %17, %13 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), double %22)
%24 = load i64, i64* @EOF
%25 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double* %1, i32* %2)
%26 = icmp eq i64 %24, %25
br i1 %26, label %27, label %8
27: ; preds = %21, %0
ret i32 0
}