#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 INT_MAX;
int LLONG_MAX;
int LONG_MAX;
int SHRT_MAX;
int /*<<< orphan*/ printf(char *, long double, ...);
int main() {
  short test_short = SHRT_MAX + 1;
  printf("short: Niepoprawny wynik dzialania %d + 1 = %d\n", SHRT_MAX,
         test_short);
  int test_int = INT_MAX + 1;
  printf("int: Niepoprawny wynik dzialania %d + 1 = %d\n", INT_MAX, test_int);
  long test_lint = LONG_MAX + 1;
  printf("long int: Niepoprawny wynik dzialania %li + 1 = %li\n", LONG_MAX,
         test_lint);
  long long test_llint = LLONG_MAX + 1;
  printf("long long int: Niepoprawny wynik dzialania %lli + 1 = %lli\n",
         LLONG_MAX, test_llint);
  float test_float = 1.0 + 0.00000001;
  printf("float: Niepoprawny wynik dzialania 1.0 + 0.00000001 = %1.8f\n",
         test_float);
  double test_double = 1.0 + 0.0000000000000001;
  printf("double: Niepoprawny wynik dzialania 1.0 + 0.0000000000000001 = "
         "%1.16lf\n",
         test_double);
  long double test_ldouble = 1.0 + 0.0000000000000000001;
  printf("long double: Niepoprawny wynik dzialania 1.0 + 0.0000000000000000001 "
         "= %1.19Lf\n",
         test_ldouble);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ea2(%rip),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %cx,-0x6(%rbp)
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
fildl  -0x50(%rbp)
movswl -0x6(%rbp),%esi
mov    %rsp,%rax
fstpt  (%rax)
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x51(%rbp)
call   1030 <printf@plt>
mov    -0x51(%rbp),%al
mov    0x2e8d(%rip),%rcx
mov    (%rcx),%edx
add    $0x1,%edx
mov    %edx,-0xc(%rbp)
mov    (%rcx),%ecx
mov    %ecx,-0x4c(%rbp)
fildl  -0x4c(%rbp)
mov    -0xc(%rbp),%esi
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x51(%rbp),%al
mov    0x2e47(%rip),%rcx
mov    (%rcx),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    %rdx,-0x18(%rbp)
mov    (%rcx),%ecx
mov    %ecx,-0x48(%rbp)
fildl  -0x48(%rbp)
mov    -0x18(%rbp),%rsi
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x51(%rbp),%al
mov    0x2e24(%rip),%rcx
mov    (%rcx),%edx
add    $0x1,%edx
movslq %edx,%rdx
mov    %rdx,-0x20(%rbp)
mov    (%rcx),%ecx
mov    %ecx,-0x44(%rbp)
fildl  -0x44(%rbp)
mov    -0x20(%rbp),%rsi
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x51(%rbp),%al
movl   $0x3f800000,-0x24(%rbp)
flds   -0x24(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x51(%rbp),%al
movabs $0x3ff0000000000000,%rcx
mov    %rcx,-0x30(%rbp)
fldl   -0x30(%rbp)
mov    %rsp,%rcx
fstpt  (%rcx)
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
fld1
fstpt  -0x40(%rbp)
fldt   -0x40(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
lea    0xf18(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
fildl  0x1c(%rsp)
add    $0x1,%eax
movswl %ax,%esi
fstpt  (%rsp)
lea    0xecb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2ea5(%rip),%rax
mov    (%rax),%esi
mov    %esi,0x20(%rsp)
add    $0x1,%esi
fildl  0x20(%rsp)
fstpt  (%rsp)
lea    0xed6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e68(%rip),%rax
movslq (%rax),%rsi
mov    %esi,0x24(%rsp)
add    $0x1,%rsi
fildl  0x24(%rsp)
fstpt  (%rsp)
lea    0xedd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
movslq (%rax),%rsi
mov    %esi,0x28(%rsp)
add    $0x1,%rsi
fildl  0x28(%rsp)
fstpt  (%rsp)
lea    0xeeb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fld1
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
lea    0xf0e(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x2c(%rsp)
fstpt  (%rsp)
lea    0xf36(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
fldt   0x2c(%rsp)
fstpt  (%rsp)
lea    0xf69(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@SHRT_MAX = global i32 0
@.str = [48 x i8] c"short: Niepoprawny wynik dzialania %d + 1 = %d\0A\00"
@INT_MAX = global i32 0
@.str.1 = [46 x i8] c"int: Niepoprawny wynik dzialania %d + 1 = %d\0A\00"
@LONG_MAX = global i32 0
@.str.2 = [53 x i8] c"long int: Niepoprawny wynik dzialania %li + 1 = %li\0A\00"
@LLONG_MAX = global i32 0
@.str.3 = [60 x i8] c"long long int: Niepoprawny wynik dzialania %lli + 1 = %lli\0A\00"
@.str.4 = [61 x i8] c"float: Niepoprawny wynik dzialania 1.0 + 0.00000001 = %1.8f\0A\00"
@.str.5 = [72 x i8] c"double: Niepoprawny wynik dzialania 1.0 + 0.0000000000000001 = %1.16lf\0A\00"
@.str.6 = [80 x i8] c"long double: Niepoprawny wynik dzialania 1.0 + 0.0000000000000000001 = %1.19Lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca float
%7 = alloca double
%8 = alloca x86_fp80
store i32 0, i32* %1
%9 = load i32, i32* @SHRT_MAX
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i16
store i16 %11, i16* %2
%12 = load i32, i32* @SHRT_MAX
%13 = sitofp i32 %12 to x86_fp80
%14 = load i16, i16* %2
%15 = sext i16 %14 to i32
%16 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), x86_fp80 %13, i32 %15)
%17 = load i32, i32* @INT_MAX
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = load i32, i32* @INT_MAX
%20 = sitofp i32 %19 to x86_fp80
%21 = load i32, i32* %3
%22 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %20, i32 %21)
%23 = load i32, i32* @LONG_MAX
%24 = add nsw i32 %23, 1
%25 = sext i32 %24 to i64
store i64 %25, i64* %4
%26 = load i32, i32* @LONG_MAX
%27 = sitofp i32 %26 to x86_fp80
%28 = load i64, i64* %4
%29 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %27, i64 %28)
%30 = load i32, i32* @LLONG_MAX
%31 = add nsw i32 %30, 1
%32 = sext i32 %31 to i64
store i64 %32, i64* %5
%33 = load i32, i32* @LLONG_MAX
%34 = sitofp i32 %33 to x86_fp80
%35 = load i64, i64* %5
%36 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %34, i64 %35)
store float 1.000000e+00, float* %6
%37 = load float, float* %6
%38 = fpext float %37 to x86_fp80
%39 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0), x86_fp80 %38)
store double 1.000000e+00, double* %7
%40 = load double, double* %7
%41 = fpext double %40 to x86_fp80
%42 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.5, i64 0, i64 0), x86_fp80 %41)
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %8
%43 = load x86_fp80, x86_fp80* %8
%44 = call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), x86_fp80 %43)
ret i32 0
}

LLVM IR (-O2):
@SHRT_MAX = global i32 0
@.str = [48 x i8] c"short: Niepoprawny wynik dzialania %d + 1 = %d\0A\00"
@INT_MAX = global i32 0
@.str.1 = [46 x i8] c"int: Niepoprawny wynik dzialania %d + 1 = %d\0A\00"
@LONG_MAX = global i32 0
@.str.2 = [53 x i8] c"long int: Niepoprawny wynik dzialania %li + 1 = %li\0A\00"
@LLONG_MAX = global i32 0
@.str.3 = [60 x i8] c"long long int: Niepoprawny wynik dzialania %lli + 1 = %lli\0A\00"
@.str.4 = [61 x i8] c"float: Niepoprawny wynik dzialania 1.0 + 0.00000001 = %1.8f\0A\00"
@.str.5 = [72 x i8] c"double: Niepoprawny wynik dzialania 1.0 + 0.0000000000000001 = %1.16lf\0A\00"
@.str.6 = [80 x i8] c"long double: Niepoprawny wynik dzialania 1.0 + 0.0000000000000000001 = %1.19Lf\0A\00"
define i32 @main() {
%1 = load i32, i32* @SHRT_MAX
%2 = sitofp i32 %1 to x86_fp80
%3 = shl i32 %1, 16
%4 = add i32 %3, 65536
%5 = ashr exact i32 %4, 16
%6 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), x86_fp80 %2, i32 %5)
%7 = load i32, i32* @INT_MAX
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %7 to x86_fp80
%10 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), x86_fp80 %9, i32 %8)
%11 = load i32, i32* @LONG_MAX
%12 = add nsw i32 %11, 1
%13 = sext i32 %12 to i64
%14 = sitofp i32 %11 to x86_fp80
%15 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), x86_fp80 %14, i64 %13)
%16 = load i32, i32* @LLONG_MAX
%17 = add nsw i32 %16, 1
%18 = sext i32 %17 to i64
%19 = sitofp i32 %16 to x86_fp80
%20 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), x86_fp80 %19, i64 %18)
%21 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.4, i64 0, i64 0), x86_fp80 0xK3FFF8000000000000000)
%22 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.5, i64 0, i64 0), x86_fp80 0xK3FFF8000000000000000)
%23 = tail call i32 (i8*, x86_fp80, ...) @printf(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @.str.6, i64 0, i64 0), x86_fp80 0xK3FFF8000000000000000)
ret i32 0
}