#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 s = 32767;
  short se = s + 10;
  printf("Short: %i + 10 = %i\n", s, se);
  int i = 2147483647;
  int ie = i + 10;
  printf("Int: %i + 10 = %i\n", i, ie);
  long l = 9223372036854775807;
  long le = l + 10;
  printf("Long: %li + 10 = %li\n", l, le);
  long ll = 9223372036854775807;
  long lle = ll + 10;
  printf("Long long: %li + 10 = %li\n", ll, lle);
  float fl = 0.000001;
  float fle = fl / 2.0;
  printf("Float: %f / 2 = %f\n", fl, fle);
  double d = 0.000001;
  double de = d / 2.0;
  printf("Double: %f / 2 = %f\n", d, de);
  long double ld = 0.000001;
  long double lde = ld / 2.0;
  printf("Long double: %Lf / 2 = %Lf\n", ld, lde);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movw   $0x7fff,-0x2(%rbp)
movzwl -0x2(%rbp),%eax
add    $0xa,%eax
mov    %ax,-0x4(%rbp)
mov    -0x2(%rbp),%ax
mov    %ax,-0x9a(%rbp)
filds  -0x9a(%rbp)
mov    -0x4(%rbp),%ax
mov    %ax,-0x9c(%rbp)
filds  -0x9c(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x7fffffff,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x94(%rbp)
fildl  -0x94(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x98(%rbp)
fildl  -0x98(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movabs $0x7fffffffffffffff,%rax
ff ff 7f
mov    %rax,-0xb0(%rbp)
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0xa,%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    0xe46(%rip),%rdi
call   1030 <printf@plt>
mov    -0xb0(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0xa,%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    0xe1b(%rip),%rdi
call   1030 <printf@plt>
movl   $0x358637bd,-0x34(%rbp)
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xdac(%rip),%xmm1
movsd  %xmm1,-0xa8(%rbp)
ff
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    0xdef(%rip),%rdi
call   1030 <printf@plt>
movsd  -0xa8(%rbp),%xmm1
ff
movabs $0x3eb0c6f7a0b5ed8d,%rax
c6 b0 3e
mov    %rax,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
fldl   -0x40(%rbp)
fldl   -0x48(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xdc5(%rip),%rdi
call   1030 <printf@plt>
fldl   0xd41(%rip)
fstpt  -0x60(%rbp)
fldt   -0x60(%rbp)
flds   0xd3d(%rip)
fdivrp %st,%st(1)
fstpt  -0x70(%rbp)
fldt   -0x60(%rbp)
fldt   -0x70(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
lea    0xda9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
flds   0xee6(%rip)
fstpt  0x10(%rsp)
flds   0xee0(%rip)
fstpt  (%rsp)
lea    0xf22(%rip),%rdi
call   1030 <printf@plt>
fldl   0xed7(%rip)
fstpt  0x10(%rsp)
fldl   0xed5(%rip)
fstpt  (%rsp)
lea    0xf18(%rip),%rdi
call   1030 <printf@plt>
fldt   0xed8(%rip)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  0x10(%rsp)
fldt   0xed8(%rip)
fld    %st(0)
fstpt  0x20(%rsp)
fstpt  (%rsp)
lea    0xf00(%rip),%rdi
call   1030 <printf@plt>
fldt   0x2c(%rsp)
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
lea    0xefb(%rip),%rdi
call   1030 <printf@plt>
flds   0xe6a(%rip)
fstpt  0x10(%rsp)
flds   0xe64(%rip)
fstpt  (%rsp)
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
fldl   0xe63(%rip)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  0x10(%rsp)
fldl   0xe5b(%rip)
fld    %st(0)
fstpt  0x20(%rsp)
fstpt  (%rsp)
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
fldt   0x2c(%rsp)
fstpt  0x10(%rsp)
fldt   0x20(%rsp)
fstpt  (%rsp)
lea    0xeda(%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 = [19 x i8] c"Int: %i + 10 = %i\0A\00"
@.str.2 = [22 x i8] c"Long: %li + 10 = %li\0A\00"
@.str.3 = [27 x i8] c"Long long: %li + 10 = %li\0A\00"
@.str.4 = [20 x i8] c"Float: %f / 2 = %f\0A\00"
@.str.5 = [21 x i8] c"Double: %f / 2 = %f\0A\00"
@.str.6 = [28 x i8] c"Long double: %Lf / 2 = %Lf\0A\00"
define i32 @main() {
%1 = alloca i16
%2 = alloca i16
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca float
%10 = alloca float
%11 = alloca double
%12 = alloca double
%13 = alloca x86_fp80
%14 = alloca x86_fp80
store i16 32767, i16* %1
%15 = load i16, i16* %1
%16 = sext i16 %15 to i32
%17 = add nsw i32 %16, 10
%18 = trunc i32 %17 to i16
store i16 %18, i16* %2
%19 = load i16, i16* %1
%20 = sitofp i16 %19 to x86_fp80
%21 = load i16, i16* %2
%22 = sitofp i16 %21 to x86_fp80
%23 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), x86_fp80 %20, x86_fp80 %22)
store i32 2147483647, i32* %3
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 10
store i32 %25, i32* %4
%26 = load i32, i32* %3
%27 = sitofp i32 %26 to x86_fp80
%28 = load i32, i32* %4
%29 = sitofp i32 %28 to x86_fp80
%30 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %27, x86_fp80 %29)
store i64 9223372036854775807, i64* %5
%31 = load i64, i64* %5
%32 = add nsw i64 %31, 10
store i64 %32, i64* %6
%33 = load i64, i64* %5
%34 = sitofp i64 %33 to x86_fp80
%35 = load i64, i64* %6
%36 = sitofp i64 %35 to x86_fp80
%37 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %34, x86_fp80 %36)
store i64 9223372036854775807, i64* %7
%38 = load i64, i64* %7
%39 = add nsw i64 %38, 10
store i64 %39, i64* %8
%40 = load i64, i64* %7
%41 = sitofp i64 %40 to x86_fp80
%42 = load i64, i64* %8
%43 = sitofp i64 %42 to x86_fp80
%44 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %41, x86_fp80 %43)
store float 0x3EB0C6F7A0000000, float* %9
%45 = load float, float* %9
%46 = fpext float %45 to double
%47 = fdiv double %46, 2.000000e+00
%48 = fptrunc double %47 to float
store float %48, float* %10
%49 = load float, float* %9
%50 = fpext float %49 to x86_fp80
%51 = load float, float* %10
%52 = fpext float %51 to x86_fp80
%53 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), x86_fp80 %50, x86_fp80 %52)
store double 0x3EB0C6F7A0B5ED8D, double* %11
%54 = load double, double* %11
%55 = fdiv double %54, 2.000000e+00
store double %55, double* %12
%56 = load double, double* %11
%57 = fpext double %56 to x86_fp80
%58 = load double, double* %12
%59 = fpext double %58 to x86_fp80
%60 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), x86_fp80 %57, x86_fp80 %59)
store x86_fp80 0xK3FEB8637BD05AF6C6800, x86_fp80* %13
%61 = load x86_fp80, x86_fp80* %13
%62 = fdiv x86_fp80 %61, 0xK40008000000000000000
store x86_fp80 %62, x86_fp80* %14
%63 = load x86_fp80, x86_fp80* %13
%64 = load x86_fp80, x86_fp80* %14
%65 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), x86_fp80 %63, x86_fp80 %64)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Short: %i + 10 = %i\0A\00"
@.str.1 = [19 x i8] c"Int: %i + 10 = %i\0A\00"
@.str.2 = [22 x i8] c"Long: %li + 10 = %li\0A\00"
@.str.3 = [27 x i8] c"Long long: %li + 10 = %li\0A\00"
@.str.4 = [20 x i8] c"Float: %f / 2 = %f\0A\00"
@.str.5 = [21 x i8] c"Double: %f / 2 = %f\0A\00"
@.str.6 = [28 x i8] c"Long double: %Lf / 2 = %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 ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), x86_fp80 0xK401DFFFFFFFE00000000, x86_fp80 0xKC01DFFFFFFEE00000000)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), x86_fp80 0xK403DFFFFFFFFFFFFFFFE, x86_fp80 0xKC03DFFFFFFFFFFFFFFEE)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), x86_fp80 0xK403DFFFFFFFFFFFFFFFE, x86_fp80 0xKC03DFFFFFFFFFFFFFFEE)
%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 0xK3FEB8637BD05AF6C6800, x86_fp80 0xK3FEA8637BD05AF6C6800)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), x86_fp80 0xK3FEB8637BD05AF6C6800, x86_fp80 0xK3FEA8637BD05AF6C6800)
ret i32 0
}