#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*/ bcddemo(unsigned char *, unsigned char *);
int /*<<< orphan*/ pr(unsigned char *);
int /*<<< orphan*/ printf(char *, long double, ...);
int main(void) {
  float a = 0.1;
  float b = 0.2;
  unsigned char bcda[10] = {
      9 << 4 | 9,
      0,
  };
  unsigned char bcdb[10] = {
      1,
      1,
      0,
  };
  long double aa = 0.1, bb = 0.2;
  printf("sizeof long double: %lu\n", sizeof aa);
  printf("%g + %g = %g\n", a, b, a + b);
  printf("%Lg + %Lg = %Lg\n", aa, bb, aa + bb);
  pr(bcda);
  pr(bcdb);
  bcddemo(bcda, bcdb);
  pr(bcda);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3dcccccd,-0x8(%rbp)
movl   $0x3e4ccccd,-0xc(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x10(%rbp)
mov    0xeb2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xeb9(%rip),%ax
mov    %ax,-0x20(%rbp)
mov    0xea6(%rip),%rax
mov    %rax,-0x28(%rbp)
fldl   0xe7e(%rip)
fstpt  -0x40(%rbp)
fldl   0xe7d(%rip)
fstpt  -0x50(%rbp)
mov    %rsp,%rax
flds   0xe79(%rip)
fstpt  (%rax)
lea    0xe88(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm1
movss  %xmm1,-0x54(%rbp)
flds   -0x54(%rbp)
movss  -0xc(%rbp),%xmm2
cvtss2sd %xmm2,%xmm0
addss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mov    %rsp,%rax
fstpt  (%rax)
lea    0xe70(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
fldt   -0x40(%rbp)
fld    %st(0)
fldt   -0x50(%rbp)
fld    %st(0)
fxch   %st(3)
faddp  %st,%st(1)
mov    %rsp,%rax
fstpt  0x20(%rax)
fxch   %st(1)
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe55(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    -0x18(%rbp),%rdi
call   1040 <pr@plt>
lea    -0x28(%rbp),%rdi
call   1040 <pr@plt>
lea    -0x18(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <bcddemo@plt>
lea    -0x18(%rbp),%rdi
call   1040 <pr@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
movzwl 0xf0a(%rip),%eax
mov    %ax,0x50(%rsp)
mov    0xef6(%rip),%rax
mov    %rax,0x48(%rsp)
movzwl 0xefc(%rip),%eax
mov    %ax,0x40(%rsp)
mov    0xee8(%rip),%rax
mov    %rax,0x38(%rsp)
flds   0xe93(%rip)
fstpt  (%rsp)
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
flds   0xe80(%rip)
fstpt  (%rsp)
lea    0xedf(%rip),%rdi
movsd  0xe72(%rip),%xmm0
movsd  0xe72(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
fldt   0xe85(%rip)
fstpt  0x20(%rsp)
fldl   0xe63(%rip)
fstpt  0x10(%rsp)
fldl   0xe61(%rip)
fstpt  (%rsp)
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x48(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <pr@plt>
lea    0x38(%rsp),%r14
mov    %r14,%rdi
call   1040 <pr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <bcddemo@plt>
mov    %rbx,%rdi
call   1040 <pr@plt>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.bcda = <{ i8, [9 x i8] }> <{ i8 -103, [9 x i8] zeroinitializer }>
@__const.main.bcdb = <{ i8, i8, [8 x i8] }> <{ i8 1, i8 1, [8 x i8] zeroinitializer }>
@.str = [25 x i8] c"sizeof long double: %lu\0A\00"
@.str.1 = [14 x i8] c"%g + %g = %g\0A\00"
@.str.2 = [17 x i8] c"%Lg + %Lg = %Lg\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = alloca x86_fp80
%7 = alloca x86_fp80
store i32 0, i32* %1
store float 0x3FB99999A0000000, float* %2
store float 0x3FC99999A0000000, float* %3
%8 = bitcast [10 x i8]* %4 to i8*
%9 = bitcast [10 x i8]* %5 to i8*
store x86_fp80 0xK3FFBCCCCCCCCCCCCD000, x86_fp80* %6
store x86_fp80 0xK3FFCCCCCCCCCCCCCD000, x86_fp80* %7
%10 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40038000000000000000)
%11 = load float, float* %2
%12 = fpext float %11 to x86_fp80
%13 = load float, float* %3
%14 = fpext float %13 to double
%15 = load float, float* %2
%16 = load float, float* %3
%17 = fadd float %15, %16
%18 = fpext float %17 to double
%19 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %12, double %14, double %18)
%20 = load x86_fp80, x86_fp80* %6
%21 = load x86_fp80, x86_fp80* %7
%22 = load x86_fp80, x86_fp80* %6
%23 = load x86_fp80, x86_fp80* %7
%24 = fadd x86_fp80 %22, %23
%25 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %20, x86_fp80 %21, x86_fp80 %24)
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%27 = call i32 @pr(i8* %26)
%28 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%29 = call i32 @pr(i8* %28)
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%32 = call i32 @bcddemo(i8* %30, i8* %31)
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%34 = call i32 @pr(i8* %33)
ret i32 0
}

LLVM IR (-O2):
@__const.main.bcda = <{ i8, [9 x i8] }> <{ i8 -103, [9 x i8] zeroinitializer }>
@__const.main.bcdb = <{ i8, i8, [8 x i8] }> <{ i8 1, i8 1, [8 x i8] zeroinitializer }>
@.str = [25 x i8] c"sizeof long double: %lu\0A\00"
@.str.1 = [14 x i8] c"%g + %g = %g\0A\00"
@.str.2 = [17 x i8] c"%Lg + %Lg = %Lg\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK40038000000000000000)
%6 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), x86_fp80 0xK3FFBCCCCCD0000000000, double 0x3FC99999A0000000, double 0x3FD3333340000000)
%7 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), x86_fp80 0xK3FFBCCCCCCCCCCCCD000, x86_fp80 0xK3FFCCCCCCCCCCCCCD000, x86_fp80 0xK3FFD9999999999999C00)
%8 = call i32 @pr(i8* %3)
%9 = call i32 @pr(i8* %4)
%10 = call i32 @bcddemo(i8* %3, i8* %4)
%11 = call i32 @pr(i8* %3)
ret i32 0
}