#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 */
double fabs(double);
int /*<<< orphan*/ printf(char *, double, double);
int main(void) {
  double d = 7.0, dd = 7.5, ddd = -7.5;
  printf("\tabs(%.1f) = %.1f\n", d, fabs(d));
  printf("\tabs(%.1f) = %.1f\n", dd, fabs(dd));
  printf("\tabs(%.1f) = %.1f\n", ddd, fabs(ddd));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xef9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xee4(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecf(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movaps 0xea9(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movaps 0xe88(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xea5(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
movaps 0xe67(%rip),%xmm2
pand   %xmm2,%xmm1
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xf00(%rip),%rbx
movsd  0xee0(%rip),%xmm0
mov    %rbx,%rdi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movsd  0xed5(%rip),%xmm0
mov    %rbx,%rdi
movaps %xmm0,%xmm1
call   1030 <printf@plt>
movsd  0xeca(%rip),%xmm0
mov    %rbx,%rdi
movsd  0xeb7(%rip),%xmm1
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"\09abs(%.1f) = %.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 7.000000e+00, double* %2
store double 7.500000e+00, double* %3
store double -7.500000e+00, double* %4
%5 = load double, double* %2
%6 = load double, double* %2
%7 = call double @llvm.fabs.f64(double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %5, double %7)
%9 = load double, double* %3
%10 = load double, double* %3
%11 = call double @llvm.fabs.f64(double %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %9, double %11)
%13 = load double, double* %4
%14 = load double, double* %4
%15 = call double @llvm.fabs.f64(double %14)
%16 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double %13, double %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"\09abs(%.1f) = %.1f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 7.000000e+00, double 7.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double 7.500000e+00, double 7.500000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), double -7.500000e+00, double 7.500000e+00)
ret i32 0
}