#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 */
float ceil(double);
double fabs(int);
int floor(double);
int /*<<< orphan*/ printf(char *, float);
int main() {
  float x;
  x = fabs(7.5);
  printf("fabs(7.5) = %.3f\n", x);
  x = floor(7.5);
  printf("floor(7.5) = %.3f\n", x);
  x = fabs(0.0);
  printf("fabs(0.0) = %.3f\n", x);
  x = ceil(0.0);
  printf("ceil(0.0) = %.3f\n", x);
  x = fabs(-6.4);
  printf("fabs(-6.4) = %.3f\n", x);
  x = ceil(-6.4);
  printf("ceil(-6.4) = %.3f\n", x);
  x = ceil(-fabs(-8 + floor(-5.5)));
  printf("ceil( -fabs( -8 + floor( -5.5 ) ) ) = %.3f\n", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x7,%edi
call   1050 <fabs@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe95(%rip),%xmm0
call   1060 <floor@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <fabs@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffa,%edi
call   1050 <fabs@plt>
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe03(%rip),%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe59(%rip),%rdi
call   1040 <printf@plt>
movsd  0xdd8(%rip),%xmm0
call   1060 <floor@plt>
mov    %eax,%edi
add    $0xfffffff8,%edi
call   1050 <fabs@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <ceil@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe20(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x7,%edi
call   1050 <fabs@plt>
cvtsd2ss %xmm0,%xmm0
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe9d(%rip),%xmm0
call   1060 <floor@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <fabs@plt>
cvtsd2ss %xmm0,%xmm0
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
call   1030 <ceil@plt>
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
mov    $0xfffffffa,%edi
call   1050 <fabs@plt>
cvtsd2ss %xmm0,%xmm0
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe40(%rip),%xmm0
call   1030 <ceil@plt>
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
movsd  0xe2f(%rip),%xmm0
call   1060 <floor@plt>
lea    -0x8(%rax),%edi
call   1050 <fabs@plt>
xorps  0xe2b(%rip),%xmm0
call   1030 <ceil@plt>
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"fabs(7.5) = %.3f\0A\00"
@.str.1 = [19 x i8] c"floor(7.5) = %.3f\0A\00"
@.str.2 = [18 x i8] c"fabs(0.0) = %.3f\0A\00"
@.str.3 = [18 x i8] c"ceil(0.0) = %.3f\0A\00"
@.str.4 = [19 x i8] c"fabs(-6.4) = %.3f\0A\00"
@.str.5 = [19 x i8] c"ceil(-6.4) = %.3f\0A\00"
@.str.6 = [44 x i8] c"ceil( -fabs( -8 + floor( -5.5 ) ) ) = %.3f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
%3 = call double @fabs(i32 7)
%4 = fptrunc double %3 to float
store float %4, float* %2
%5 = load float, float* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %5)
%7 = call i32 @floor(double 7.500000e+00)
%8 = sitofp i32 %7 to float
store float %8, float* %2
%9 = load float, float* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float %9)
%11 = call double @fabs(i32 0)
%12 = fptrunc double %11 to float
store float %12, float* %2
%13 = load float, float* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), float %13)
%15 = call float @ceil(double 0.000000e+00)
store float %15, float* %2
%16 = load float, float* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %16)
%18 = call double @fabs(i32 -6)
%19 = fptrunc double %18 to float
store float %19, float* %2
%20 = load float, float* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), float %20)
%22 = call float @ceil(double -6.400000e+00)
store float %22, float* %2
%23 = load float, float* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), float %23)
%25 = call i32 @floor(double -5.500000e+00)
%26 = add nsw i32 -8, %25
%27 = call double @fabs(i32 %26)
%28 = fneg double %27
%29 = call float @ceil(double %28)
store float %29, float* %2
%30 = load float, float* %2
%31 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), float %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"fabs(7.5) = %.3f\0A\00"
@.str.1 = [19 x i8] c"floor(7.5) = %.3f\0A\00"
@.str.2 = [18 x i8] c"fabs(0.0) = %.3f\0A\00"
@.str.3 = [18 x i8] c"ceil(0.0) = %.3f\0A\00"
@.str.4 = [19 x i8] c"fabs(-6.4) = %.3f\0A\00"
@.str.5 = [19 x i8] c"ceil(-6.4) = %.3f\0A\00"
@.str.6 = [44 x i8] c"ceil( -fabs( -8 + floor( -5.5 ) ) ) = %.3f\0A\00"
define i32 @main() {
%1 = tail call double @fabs(i32 7)
%2 = fptrunc double %1 to float
%3 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), float %2)
%4 = tail call i32 @floor(double 7.500000e+00)
%5 = sitofp i32 %4 to float
%6 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), float %5)
%7 = tail call double @fabs(i32 0)
%8 = fptrunc double %7 to float
%9 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), float %8)
%10 = tail call float @ceil(double 0.000000e+00)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), float %10)
%12 = tail call double @fabs(i32 -6)
%13 = fptrunc double %12 to float
%14 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), float %13)
%15 = tail call float @ceil(double -6.400000e+00)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), float %15)
%17 = tail call i32 @floor(double -5.500000e+00)
%18 = add nsw i32 %17, -8
%19 = tail call double @fabs(i32 %18)
%20 = fneg double %19
%21 = tail call float @ceil(double %20)
%22 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), float %21)
ret i32 0
}