#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 fma(double, double, double);
int /*<<< orphan*/ printf(char *, double);
int main(int argc, char **argv) {
  double a = 1.e-160;
  double b = 1.e-160;
  float af = 1.e-20;
  float bf = -1.e-20;
  double a1 = 1.e-320;
  double a2 = -1.;
  double a3 = -1.1e-320;
  printf("c: %e\n", a * b);
  printf("cf: %e\n", af * bf);
  printf("cfma: %e\n", fma(a1, a2, a3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x28(%rbp)
movsd  0xe9e(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe89(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xe74(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
mulss  -0x28(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm2
call   1040 <fma@plt>
lea    0xe5b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf00(%rip),%rdi
movsd  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xef3(%rip),%rdi
movsd  0xed4(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
movsd  0xec8(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"c: %e\0A\00"
@.str.1 = [8 x i8] c"cf: %e\0A\00"
@.str.2 = [10 x i8] c"cfma: %e\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
%8 = alloca float
%9 = alloca float
%10 = alloca double
%11 = alloca double
%12 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0x1EB67E9C127B6E74, double* %6
store double 0x1EB67E9C127B6E74, double* %7
store float 0x3BC79CA100000000, float* %8
store float 0xBBC79CA100000000, float* %9
store double 9.999880e-321, double* %10
store double -1.000000e+00, double* %11
store double -1.099790e-320, double* %12
%13 = load double, double* %6
%14 = load double, double* %7
%15 = fmul double %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double %15)
%17 = load float, float* %8
%18 = load float, float* %9
%19 = fmul float %17, %18
%20 = fpext float %19 to double
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %20)
%22 = load double, double* %10
%23 = load double, double* %11
%24 = load double, double* %12
%25 = call double @llvm.fma.f64(double %22, double %23, double %24)
%26 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"c: %e\0A\00"
@.str.1 = [8 x i8] c"cf: %e\0A\00"
@.str.2 = [10 x i8] c"cfma: %e\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), double 9.999880e-321)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double 0xB7A16C2000000000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double -2.099780e-320)
ret i32 0
}