#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*/ printf(char *, long double, long double);
int main() {
  short shr = 32767;
  short shr2 = shr + 10;
  printf("Short: %i + 10 = %i\n", shr, shr2);
  int in = 2000000000;
  int in2 = in + 1000000000;
  printf("Int: %i + 1000000000 = %i\n", in, in2);
  long lg = 9000000000000000000;
  long lg2 = lg + 1000000000000000000;
  printf("Long: %li + 1000000000000000000 = %li\n", lg, lg2);
  long long llg = 9000000000000000000;
  long long llg2 = llg + 1000000000000000000;
  printf("Long long: %lli + 1000000000000000000 = %lli\n", llg, llg2);
  float fl = 0.000001;
  float fl2 = fl / 2.0;
  printf("Float: %f / 2 = %f\n", fl, fl2);
  double dl = 0.000003;
  double dl2 = dl / 4.0;
  printf("Double: %f / 4 = %f\n", dl, dl2);
  long double ldl = 0.00000000000000005;
  long double ldl2 = dl / 4.0;
  printf("Long double: %Lf / 4 = %Lf\n", ldl, ldl2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x7fff,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
add    $0xa,%eax
mov    %ax,-0x8(%rbp)
mov    -0x6(%rbp),%ax
mov    %ax,-0x9a(%rbp)
filds  -0x9a(%rbp)
mov    -0x8(%rbp),%ax
mov    %ax,-0x9c(%rbp)
filds  -0x9c(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
movl   $0x77359400,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x3b9aca00,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x94(%rbp)
fildl  -0x94(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x98(%rbp)
fildl  -0x98(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe85(%rip),%rdi
call   1030 <printf@plt>
movabs $0x7ce66c50e2840000,%rax
6c e6 7c
mov    %rax,-0xb8(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movabs $0xde0b6b3a7640000,%rcx
b6 e0 0d
mov    %rcx,-0xc0(%rbp)
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
fildll -0x88(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x90(%rbp)
fildll -0x90(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe39(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc0(%rbp),%rcx
mov    -0xb8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x78(%rbp)
fildll -0x78(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x80(%rbp)
fildll -0x80(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe19(%rip),%rdi
call   1030 <printf@plt>
movl   $0x358637bd,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xd8d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x38(%rbp)
flds   -0x34(%rbp)
flds   -0x38(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe08(%rip),%rdi
call   1030 <printf@plt>
movabs $0x3ec92a737110e454,%rax
2a c9 3e
mov    %rax,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xd53(%rip),%xmm1
movsd  %xmm1,-0xb0(%rbp)
ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
fldl   -0x40(%rbp)
fldl   -0x48(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
movsd  -0xb0(%rbp),%xmm1
ff
fldl   0xd22(%rip)
fstpt  -0x60(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
fldl   -0xa8(%rbp)
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xda6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
flds   0xee6(%rip)
fstpt  0x10(%rsp)
flds   0xee0(%rip)
fstpt  (%rsp)
lea    0xf12(%rip),%rdi
call   1030 <printf@plt>
flds   0xecf(%rip)
fstpt  0x10(%rsp)
flds   0xec9(%rip)
fstpt  (%rsp)
lea    0xf08(%rip),%rdi
call   1030 <printf@plt>
fldl   0xec0(%rip)
fld    %st(0)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fldl   0xeb8(%rip)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
lea    0xef8(%rip),%rdi
call   1030 <printf@plt>
fldt   0x20(%rsp)
fstpt  0x10(%rsp)
fldt   0x2c(%rsp)
fstpt  (%rsp)
lea    0xf04(%rip),%rdi
call   1030 <printf@plt>
flds   0xe72(%rip)
fstpt  0x10(%rsp)
flds   0xe6c(%rip)
fstpt  (%rsp)
lea    0xf13(%rip),%rdi
call   1030 <printf@plt>
fldl   0xe6b(%rip)
fld    %st(0)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fldl   0xe63(%rip)
fstpt  (%rsp)
lea    0xf02(%rip),%rdi
call   1030 <printf@plt>
fldt   0x20(%rsp)
fstpt  0x10(%rsp)
fldl   0xe4e(%rip)
fstpt  (%rsp)
lea    0xefa(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Short: %i + 10 = %i\0A\00"
@.str.1 = [27 x i8] c"Int: %i + 1000000000 = %i\0A\00"
@.str.2 = [39 x i8] c"Long: %li + 1000000000000000000 = %li\0A\00"
@.str.3 = [46 x i8] c"Long long: %lli + 1000000000000000000 = %lli\0A\00"
@.str.4 = [20 x i8] c"Float: %f / 2 = %f\0A\00"
@.str.5 = [21 x i8] c"Double: %f / 4 = %f\0A\00"
@.str.6 = [28 x i8] c"Long double: %Lf / 4 = %Lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca i32
%5 = alloca i32
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca float
%11 = alloca float
%12 = alloca double
%13 = alloca double
%14 = alloca x86_fp80
%15 = alloca x86_fp80
store i32 0, i32* %1
store i16 32767, i16* %2
%16 = load i16, i16* %2
%17 = sext i16 %16 to i32
%18 = add nsw i32 %17, 10
%19 = trunc i32 %18 to i16
store i16 %19, i16* %3
%20 = load i16, i16* %2
%21 = sitofp i16 %20 to x86_fp80
%22 = load i16, i16* %3
%23 = sitofp i16 %22 to x86_fp80
%24 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), x86_fp80 %21, x86_fp80 %23)
store i32 2000000000, i32* %4
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1000000000
store i32 %26, i32* %5
%27 = load i32, i32* %4
%28 = sitofp i32 %27 to x86_fp80
%29 = load i32, i32* %5
%30 = sitofp i32 %29 to x86_fp80
%31 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %28, x86_fp80 %30)
store i64 9000000000000000000, i64* %6
%32 = load i64, i64* %6
%33 = add nsw i64 %32, 1000000000000000000
store i64 %33, i64* %7
%34 = load i64, i64* %6
%35 = sitofp i64 %34 to x86_fp80
%36 = load i64, i64* %7
%37 = sitofp i64 %36 to x86_fp80
%38 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %35, x86_fp80 %37)
store i64 9000000000000000000, i64* %8
%39 = load i64, i64* %8
%40 = add nsw i64 %39, 1000000000000000000
store i64 %40, i64* %9
%41 = load i64, i64* %8
%42 = sitofp i64 %41 to x86_fp80
%43 = load i64, i64* %9
%44 = sitofp i64 %43 to x86_fp80
%45 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %42, x86_fp80 %44)
store float 0x3EB0C6F7A0000000, float* %10
%46 = load float, float* %10
%47 = fpext float %46 to double
%48 = fdiv double %47, 2.000000e+00
%49 = fptrunc double %48 to float
store float %49, float* %11
%50 = load float, float* %10
%51 = fpext float %50 to x86_fp80
%52 = load float, float* %11
%53 = fpext float %52 to x86_fp80
%54 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), x86_fp80 %51, x86_fp80 %53)
store double 3.000000e-06, double* %12
%55 = load double, double* %12
%56 = fdiv double %55, 4.000000e+00
store double %56, double* %13
%57 = load double, double* %12
%58 = fpext double %57 to x86_fp80
%59 = load double, double* %13
%60 = fpext double %59 to x86_fp80
%61 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), x86_fp80 %58, x86_fp80 %60)
store x86_fp80 0xK3FC8E69594BEC44DE000, x86_fp80* %14
%62 = load double, double* %12
%63 = fdiv double %62, 4.000000e+00
%64 = fpext double %63 to x86_fp80
store x86_fp80 %64, x86_fp80* %15
%65 = load x86_fp80, x86_fp80* %14
%66 = load x86_fp80, x86_fp80* %15
%67 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), x86_fp80 %65, x86_fp80 %66)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Short: %i + 10 = %i\0A\00"
@.str.1 = [27 x i8] c"Int: %i + 1000000000 = %i\0A\00"
@.str.2 = [39 x i8] c"Long: %li + 1000000000000000000 = %li\0A\00"
@.str.3 = [46 x i8] c"Long long: %lli + 1000000000000000000 = %lli\0A\00"
@.str.4 = [20 x i8] c"Float: %f / 2 = %f\0A\00"
@.str.5 = [21 x i8] c"Double: %f / 4 = %f\0A\00"
@.str.6 = [28 x i8] c"Long double: %Lf / 4 = %Lf\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), x86_fp80 0xK400DFFFE000000000000, x86_fp80 0xKC00DFFEE000000000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0), x86_fp80 0xK401DEE6B280000000000, x86_fp80 0xKC01D9A5F440000000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), x86_fp80 0xK403DF9CCD8A1C5080000, x86_fp80 0xKC03DEA71B9F6EC300000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0), x86_fp80 0xK403DF9CCD8A1C5080000, x86_fp80 0xKC03DEA71B9F6EC300000)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), x86_fp80 0xK3FEB8637BD0000000000, x86_fp80 0xK3FEA8637BD0000000000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), x86_fp80 0xK3FECC9539B888722A000, x86_fp80 0xK3FEAC9539B888722A000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), x86_fp80 0xK3FC8E69594BEC44DE000, x86_fp80 0xK3FEAC9539B888722A000)
ret i32 0
}