#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 */
double DBL_MAX;
double FLT_MAX;
int INT_MAX;
int LDBL_MAX;
int LLONG_MAX;
int /*<<< orphan*/ printf(char *, int, double);
int main() {
  printf("Rzutowanie FLT_MAX do (int)FLT_MAX: '%e' do '%i'\n", FLT_MAX,
         (int)FLT_MAX);
  printf("Rzutowanie DBM_MAX do (int)DBL_MAX: '%e' do '%i'\n", DBL_MAX,
         (int)DBL_MAX);
  printf("Rzutowanie LDBL_MAX do (double)LDBL_MAX: '%Le' do '%e'\n", LDBL_MAX,
         (double)LDBL_MAX);
  printf("Rzutowanie INT_MAX do (float)FLT_MAX: '%i' do '%e'\n", INT_MAX,
         (float)INT_MAX);
  printf("Rzutowanie LLONG_MAX do (double)LLONG_MAX: '%lli' do '%18.1lf'\n",
         LLONG_MAX, (double)LLONG_MAX);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ebd(%rip),%rax
cvttsd2si (%rax),%esi
mov    0x2eb2(%rip),%rax
cvttsd2si (%rax),%eax
cvtsi2sd %eax,%xmm0
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7f(%rip),%rax
cvttsd2si (%rax),%esi
mov    0x2e74(%rip),%rax
cvttsd2si (%rax),%eax
cvtsi2sd %eax,%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
mov    0x2e58(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xee9(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e61(%rip),%rax
mov    (%rax),%esi
mov    0x2e58(%rip),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e35(%rip),%rax
mov    (%rax),%esi
mov    0x2e2c(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xf11(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
movsd  (%rax),%xmm0
cvttsd2si %xmm0,%esi
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e85(%rip),%rax
movsd  (%rax),%xmm0
cvttsd2si %xmm0,%esi
cvttpd2dq %xmm0,%xmm0
cvtdq2pd %xmm0,%xmm0
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
lea    0xef6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf0e(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e46(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
lea    0xf26(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [50 x i8] c"Rzutowanie FLT_MAX do (int)FLT_MAX: '%e' do '%i'\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.1 = [50 x i8] c"Rzutowanie DBM_MAX do (int)DBL_MAX: '%e' do '%i'\0A\00"
@DBL_MAX = global double 0.000000e+00
@.str.2 = [56 x i8] c"Rzutowanie LDBL_MAX do (double)LDBL_MAX: '%Le' do '%e'\0A\00"
@LDBL_MAX = global i32 0
@.str.3 = [52 x i8] c"Rzutowanie INT_MAX do (float)FLT_MAX: '%i' do '%e'\0A\00"
@INT_MAX = global i32 0
@.str.4 = [64 x i8] c"Rzutowanie LLONG_MAX do (double)LLONG_MAX: '%lli' do '%18.1lf'\0A\00"
@LLONG_MAX = global i32 0
define i32 @main() {
%1 = load double, double* @FLT_MAX
%2 = fptosi double %1 to i32
%3 = load double, double* @FLT_MAX
%4 = fptosi double %3 to i32
%5 = sitofp i32 %4 to double
%6 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %2, double %5)
%7 = load double, double* @DBL_MAX
%8 = fptosi double %7 to i32
%9 = load double, double* @DBL_MAX
%10 = fptosi double %9 to i32
%11 = sitofp i32 %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %8, double %11)
%13 = load i32, i32* @LDBL_MAX
%14 = load i32, i32* @LDBL_MAX
%15 = sitofp i32 %14 to double
%16 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i32 %13, double %15)
%17 = load i32, i32* @INT_MAX
%18 = load i32, i32* @INT_MAX
%19 = sitofp i32 %18 to float
%20 = fpext float %19 to double
%21 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %17, double %20)
%22 = load i32, i32* @LLONG_MAX
%23 = load i32, i32* @LLONG_MAX
%24 = sitofp i32 %23 to double
%25 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), i32 %22, double %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [50 x i8] c"Rzutowanie FLT_MAX do (int)FLT_MAX: '%e' do '%i'\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.1 = [50 x i8] c"Rzutowanie DBM_MAX do (int)DBL_MAX: '%e' do '%i'\0A\00"
@DBL_MAX = global double 0.000000e+00
@.str.2 = [56 x i8] c"Rzutowanie LDBL_MAX do (double)LDBL_MAX: '%Le' do '%e'\0A\00"
@LDBL_MAX = global i32 0
@.str.3 = [52 x i8] c"Rzutowanie INT_MAX do (float)FLT_MAX: '%i' do '%e'\0A\00"
@INT_MAX = global i32 0
@.str.4 = [64 x i8] c"Rzutowanie LLONG_MAX do (double)LLONG_MAX: '%lli' do '%18.1lf'\0A\00"
@LLONG_MAX = global i32 0
define i32 @main() {
%1 = load double, double* @FLT_MAX
%2 = fptosi double %1 to i32
%3 = sitofp i32 %2 to double
%4 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i32 %2, double %3)
%5 = load double, double* @DBL_MAX
%6 = fptosi double %5 to i32
%7 = sitofp i32 %6 to double
%8 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0), i32 %6, double %7)
%9 = load i32, i32* @LDBL_MAX
%10 = sitofp i32 %9 to double
%11 = tail call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0), i32 %9, double %10)
%12 = load i32, i32* @INT_MAX
%13 = sitofp i32 %12 to float
%14 = fpext float %13 to double
%15 = tail call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0), i32 %12, double %14)
%16 = load i32, i32* @LLONG_MAX
%17 = sitofp i32 %16 to double
%18 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.4, i64 0, i64 0), i32 %16, double %17)
ret i32 0
}