#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*/ abort();
scalar_t__ cbrt(int /*<<< orphan*/);
scalar_t__ convert_it(double);
int /*<<< orphan*/ sqrt(double);
int main(int argc, char *argv[]) {
  double values[6] = {3.0, 1.95, 2.227, 729.0, 64.0, .0008797};
  unsigned i;
  for (i = 0; i < 6; i++)
    if (convert_it(values[i]) != cbrt(sqrt(values[i])))
      abort();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1040 <memset@plt>
movsd  0xeaa(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xe95(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe80(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe6b(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe56(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe41(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x6,-0x44(%rbp)
jae    1226 <main+0xd6>
mov    -0x44(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1050 <convert_it@plt>
mov    %rax,-0x50(%rbp)
mov    -0x44(%rbp),%eax
movsd  -0x40(%rbp,%rax,8),%xmm0
call   1070 <sqrt@plt>
mov    %eax,%edi
call   1060 <cbrt@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
cmp    %rcx,%rax
je     1213 <main+0xc3>
mov    $0x0,%al
call   1030 <abort@plt>
jmp    1218 <main+0xc8>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11cb <main+0x7b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xeb7(%rip),%xmm0
call   1040 <convert_it@plt>
mov    %rax,%rbx
movsd  0xea7(%rip),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1050 <cbrt@plt>
cmp    %rax,%rbx
jne    1243 <main+0x103>
movsd  0xe92(%rip),%xmm0
call   1040 <convert_it@plt>
mov    %rax,%rbx
movsd  0xe82(%rip),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1050 <cbrt@plt>
cmp    %rax,%rbx
jne    1243 <main+0x103>
movsd  0xe6d(%rip),%xmm0
call   1040 <convert_it@plt>
mov    %rax,%rbx
movsd  0xe5d(%rip),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1050 <cbrt@plt>
cmp    %rax,%rbx
jne    1243 <main+0x103>
movsd  0xe4c(%rip),%xmm0
call   1040 <convert_it@plt>
mov    %rax,%rbx
movsd  0xe3c(%rip),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1050 <cbrt@plt>
cmp    %rax,%rbx
jne    1243 <main+0x103>
movsd  0xe2b(%rip),%xmm0
call   1040 <convert_it@plt>
mov    %rax,%rbx
movsd  0xe1b(%rip),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1050 <cbrt@plt>
cmp    %rax,%rbx
jne    1243 <main+0x103>
movsd  0xe0a(%rip),%xmm0
call   1040 <convert_it@plt>
mov    %rax,%rbx
movsd  0xdfa(%rip),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
call   1050 <cbrt@plt>
cmp    %rax,%rbx
jne    1243 <main+0x103>
xor    %eax,%eax
pop    %rbx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [6 x double]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [6 x double]* %6 to i8*
%9 = bitcast i8* %8 to [6 x double]*
%10 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 0
store double 3.000000e+00, double* %10
%11 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 1
store double 1.950000e+00, double* %11
%12 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 2
store double 2.227000e+00, double* %12
%13 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 3
store double 7.290000e+02, double* %13
%14 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 4
store double 6.400000e+01, double* %14
%15 = getelementptr inbounds [6 x double], [6 x double]* %9, i32 0, i32 5
store double 8.797000e-04, double* %15
store i32 0, i32* %7
br label %16
16: ; preds = %35, %2
%17 = load i32, i32* %7
%18 = icmp ult i32 %17, 6
br i1 %18, label %19, label %38
19: ; preds = %16
%20 = load i32, i32* %7
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %21
%23 = load double, double* %22
%24 = call i64 @convert_it(double %23)
%25 = load i32, i32* %7
%26 = zext i32 %25 to i64
%27 = getelementptr inbounds [6 x double], [6 x double]* %6, i64 0, i64 %26
%28 = load double, double* %27
%29 = call i32 @sqrt(double %28)
%30 = call i64 @cbrt(i32 %29)
%31 = icmp ne i64 %24, %30
br i1 %31, label %32, label %34
32: ; preds = %19
%33 = call i32 (...) @abort()
unreachable
34: ; preds = %19
br label %35
35: ; preds = %34
%36 = load i32, i32* %7
%37 = add i32 %36, 1
store i32 %37, i32* %7
br label %16
38: ; preds = %16
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 @convert_it(double 3.000000e+00)
%4 = tail call i32 @sqrt(double 3.000000e+00)
%5 = tail call i64 @cbrt(i32 %4)
%6 = icmp eq i64 %3, %5
br i1 %6, label %7, label %33
7: ; preds = %2
%8 = tail call i64 @convert_it(double 1.950000e+00)
%9 = tail call i32 @sqrt(double 1.950000e+00)
%10 = tail call i64 @cbrt(i32 %9)
%11 = icmp eq i64 %8, %10
br i1 %11, label %12, label %33
12: ; preds = %7
%13 = tail call i64 @convert_it(double 2.227000e+00)
%14 = tail call i32 @sqrt(double 2.227000e+00)
%15 = tail call i64 @cbrt(i32 %14)
%16 = icmp eq i64 %13, %15
br i1 %16, label %17, label %33
17: ; preds = %12
%18 = tail call i64 @convert_it(double 7.290000e+02)
%19 = tail call i32 @sqrt(double 7.290000e+02)
%20 = tail call i64 @cbrt(i32 %19)
%21 = icmp eq i64 %18, %20
br i1 %21, label %22, label %33
22: ; preds = %17
%23 = tail call i64 @convert_it(double 6.400000e+01)
%24 = tail call i32 @sqrt(double 6.400000e+01)
%25 = tail call i64 @cbrt(i32 %24)
%26 = icmp eq i64 %23, %25
br i1 %26, label %27, label %33
27: ; preds = %22
%28 = tail call i64 @convert_it(double 8.797000e-04)
%29 = tail call i32 @sqrt(double 8.797000e-04)
%30 = tail call i64 @cbrt(i32 %29)
%31 = icmp eq i64 %28, %30
br i1 %31, label %32, label %33
32: ; preds = %27
ret i32 0
33: ; preds = %27, %22, %17, %12, %7, %2
%34 = tail call i32 (...) @abort()
unreachable
}