#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 test(long double);
int main(void) {
  double a = -3.3;
  long double b = 22.5f;
  if (b) {
    return test(a) + test(b) + test(1.0L) + test(3.14L);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movabs $0xc00a666666666666,%rax
66 0a c0
mov    %rax,-0x10(%rbp)
flds   0xecd(%rip)
fstpt  -0x20(%rbp)
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1152 <main+0x42>
jp     1152 <main+0x42>
jmp    11ae <main+0x9e>
fldl   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,-0x2c(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    %rsp,%rax
fld1
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    %rsp,%rax
fldt   0xe78(%rip)
fstpt  (%rax)
call   1030 <test@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    11b5 <main+0xa5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
fldl   0xee2(%rip)
fstpt  (%rsp)
call   1030 <test@plt>
mov    %eax,%r14d
flds   0xed9(%rip)
fstpt  (%rsp)
call   1030 <test@plt>
mov    %eax,%ebp
fld1
fstpt  (%rsp)
call   1030 <test@plt>
mov    %eax,%ebx
fldt   0xec5(%rip)
fstpt  (%rsp)
call   1030 <test@plt>
add    %r14d,%ebp
add    %ebx,%ebp
add    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca x86_fp80
store i32 0, i32* %1
store double -3.300000e+00, double* %2
store x86_fp80 0xK4003B400000000000000, x86_fp80* %3
%4 = load x86_fp80, x86_fp80* %3
%5 = fcmp une x86_fp80 %4, 0xK00000000000000000000
br i1 %5, label %6, label %17
6: ; preds = %0
%7 = load double, double* %2
%8 = fpext double %7 to x86_fp80
%9 = call i32 @test(x86_fp80 %8)
%10 = load x86_fp80, x86_fp80* %3
%11 = call i32 @test(x86_fp80 %10)
%12 = add nsw i32 %9, %11
%13 = call i32 @test(x86_fp80 0xK3FFF8000000000000000)
%14 = add nsw i32 %12, %13
%15 = call i32 @test(x86_fp80 0xK4000C8F5C28F5C28F5C3)
%16 = add nsw i32 %14, %15
store i32 %16, i32* %1
br label %18
17: ; preds = %0
store i32 0, i32* %1
br label %18
18: ; preds = %17, %6
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(x86_fp80 0xKC000D333333333333000)
%2 = tail call i32 @test(x86_fp80 0xK4003B400000000000000)
%3 = tail call i32 @test(x86_fp80 0xK3FFF8000000000000000)
%4 = tail call i32 @test(x86_fp80 0xK4000C8F5C28F5C28F5C3)
%5 = add nsw i32 %2, %1
%6 = add nsw i32 %5, %3
%7 = add nsw i32 %6, %4
ret i32 %7
}