#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 LONG_MAX;
int /*<<< orphan*/ printf(char *, ...);
int main() {
  printf("FLT_MAX -> (int)FLT_MAX:\n%e -> %i\n\n", FLT_MAX, (int)FLT_MAX);
  printf("INT_MAX -> (float)INT_MAX:\n%i -> %e\n\n", INT_MAX, (float)INT_MAX);
  printf("DBL_MAX -> (int)DBL_MAX:\n%e -> %i\n", DBL_MAX, (int)DBL_MAX);
  printf("Wartosc double max wychodzi poza maksymalna wartosc int. Wypisywana "
         "jest wartosc maksymalna int.\n\n");
  printf("INT_MAX -> (double)INT_MAX:\n%i -> %e\n\n", INT_MAX, (double)INT_MAX);
  printf("LDBL_MAX -> (double)LDBL_MAX:\n%Le -> %e\n\n", LDBL_MAX,
         (double)LDBL_MAX);
  printf("(double)LDBL_MAX podzielone przez 2:\n %e \n\n",
         (double)LDBL_MAX / 2);
  printf("(double)LDBL_MAX podzielone przez 4:\n %e \n\n",
         (double)LDBL_MAX / 4);
  printf("LONG_MAX -> (float)LONG_MAX:\n%li -> %e\n\n", LONG_MAX,
         (float)LONG_MAX);
  printf("INT_MAX -> (float)INT_MAX:\n%i -> %e\n\n", INT_MAX, (float)INT_MAX);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2eba(%rip),%rax
cvttsd2si (%rax),%esi
lea    0xedf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e5b(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2e50(%rip),%rax
cvttsd2si (%rax),%esi
lea    0xedf(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2e51(%rip),%rax
mov    (%rax),%esi
mov    0x2e48(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xf35(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e17(%rip),%rax
mov    (%rax),%esi
mov    0x2e0e(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xf3a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2df5(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xe21(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xf3f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2dd0(%rip),%rax
cvtsi2sdl (%rax),%xmm0
movsd  0xdf4(%rip),%xmm1
divsd  %xmm1,%xmm0
lea    0xf46(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%esi
mov    0x2d9a(%rip),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf4c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d9d(%rip),%rax
mov    (%rax),%esi
mov    0x2d94(%rip),%rax
cvtsi2ssl (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    0x2eb4(%rip),%rax
movsd  (%rax),%xmm0
cvttsd2si %xmm0,%esi
lea    0xed5(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2e9f(%rip),%r15
mov    (%r15),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xed6(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2e51(%rip),%rax
movsd  (%rax),%xmm0
cvttsd2si %xmm0,%esi
lea    0xedc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xfc3(%rip),%rdi
call   1030 <puts@plt>
mov    (%r15),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
lea    0xedb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2e20(%rip),%rbx
mov    (%rbx),%esi
xorps  %xmm0,%xmm0
cvtsi2sd %esi,%xmm0
lea    0xee4(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx),%xmm0
mulsd  0xe2a(%rip),%xmm0
lea    0xef1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx),%xmm0
mulsd  0xe15(%rip),%xmm0
lea    0xf00(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x2dc0(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xf0a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    (%r15),%esi
xorps  %xmm0,%xmm0
cvtsi2ss %esi,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [36 x i8] c"FLT_MAX -> (int)FLT_MAX:\0A%e -> %i\0A\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.1 = [38 x i8] c"INT_MAX -> (float)INT_MAX:\0A%i -> %e\0A\0A\00"
@INT_MAX = global i32 0
@.str.2 = [35 x i8] c"DBL_MAX -> (int)DBL_MAX:\0A%e -> %i\0A\00"
@DBL_MAX = global double 0.000000e+00
@.str.3 = [99 x i8] c"Wartosc double max wychodzi poza maksymalna wartosc int. Wypisywana jest wartosc maksymalna int.\0A\0A\00"
@.str.4 = [39 x i8] c"INT_MAX -> (double)INT_MAX:\0A%i -> %e\0A\0A\00"
@.str.5 = [42 x i8] c"LDBL_MAX -> (double)LDBL_MAX:\0A%Le -> %e\0A\0A\00"
@LDBL_MAX = global i32 0
@.str.6 = [44 x i8] c"(double)LDBL_MAX podzielone przez 2:\0A %e \0A\0A\00"
@.str.7 = [44 x i8] c"(double)LDBL_MAX podzielone przez 4:\0A %e \0A\0A\00"
@.str.8 = [41 x i8] c"LONG_MAX -> (float)LONG_MAX:\0A%li -> %e\0A\0A\00"
@LONG_MAX = global i32 0
define i32 @main() {
%1 = load double, double* @FLT_MAX
%2 = load double, double* @FLT_MAX
%3 = fptosi double %2 to i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %1, i32 %3)
%5 = load i32, i32* @INT_MAX
%6 = load i32, i32* @INT_MAX
%7 = sitofp i32 %6 to float
%8 = fpext float %7 to double
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %5, double %8)
%10 = load double, double* @DBL_MAX
%11 = load double, double* @DBL_MAX
%12 = fptosi double %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %10, i32 %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32, i32* @INT_MAX
%16 = load i32, i32* @INT_MAX
%17 = sitofp i32 %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), i32 %15, double %17)
%19 = load i32, i32* @LDBL_MAX
%20 = load i32, i32* @LDBL_MAX
%21 = sitofp i32 %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %19, double %21)
%23 = load i32, i32* @LDBL_MAX
%24 = sitofp i32 %23 to double
%25 = fdiv double %24, 2.000000e+00
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %25)
%27 = load i32, i32* @LDBL_MAX
%28 = sitofp i32 %27 to double
%29 = fdiv double %28, 4.000000e+00
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %29)
%31 = load i32, i32* @LONG_MAX
%32 = load i32, i32* @LONG_MAX
%33 = sitofp i32 %32 to float
%34 = fpext float %33 to double
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %31, double %34)
%36 = load i32, i32* @INT_MAX
%37 = load i32, i32* @INT_MAX
%38 = sitofp i32 %37 to float
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %36, double %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"FLT_MAX -> (int)FLT_MAX:\0A%e -> %i\0A\0A\00"
@FLT_MAX = global double 0.000000e+00
@.str.1 = [38 x i8] c"INT_MAX -> (float)INT_MAX:\0A%i -> %e\0A\0A\00"
@INT_MAX = global i32 0
@.str.2 = [35 x i8] c"DBL_MAX -> (int)DBL_MAX:\0A%e -> %i\0A\00"
@DBL_MAX = global double 0.000000e+00
@.str.4 = [39 x i8] c"INT_MAX -> (double)INT_MAX:\0A%i -> %e\0A\0A\00"
@.str.5 = [42 x i8] c"LDBL_MAX -> (double)LDBL_MAX:\0A%Le -> %e\0A\0A\00"
@LDBL_MAX = global i32 0
@.str.6 = [44 x i8] c"(double)LDBL_MAX podzielone przez 2:\0A %e \0A\0A\00"
@.str.7 = [44 x i8] c"(double)LDBL_MAX podzielone przez 4:\0A %e \0A\0A\00"
@.str.8 = [41 x i8] c"LONG_MAX -> (float)LONG_MAX:\0A%li -> %e\0A\0A\00"
@LONG_MAX = global i32 0
@str = [98 x i8] c"Wartosc double max wychodzi poza maksymalna wartosc int. Wypisywana jest wartosc maksymalna int.\0A\00"
define i32 @main() {
%1 = load double, double* @FLT_MAX
%2 = fptosi double %1 to i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), double %1, i32 %2)
%4 = load i32, i32* @INT_MAX
%5 = sitofp i32 %4 to float
%6 = fpext float %5 to double
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %4, double %6)
%8 = load double, double* @DBL_MAX
%9 = fptosi double %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), double %8, i32 %9)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str, i64 0, i64 0))
%12 = load i32, i32* @INT_MAX
%13 = sitofp i32 %12 to double
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.4, i64 0, i64 0), i32 %12, double %13)
%15 = load i32, i32* @LDBL_MAX
%16 = sitofp i32 %15 to double
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.5, i64 0, i64 0), i32 %15, double %16)
%18 = load i32, i32* @LDBL_MAX
%19 = sitofp i32 %18 to double
%20 = fmul double %19, 5.000000e-01
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.6, i64 0, i64 0), double %20)
%22 = load i32, i32* @LDBL_MAX
%23 = sitofp i32 %22 to double
%24 = fmul double %23, 2.500000e-01
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), double %24)
%26 = load i32, i32* @LONG_MAX
%27 = sitofp i32 %26 to float
%28 = fpext float %27 to double
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0), i32 %26, double %28)
%30 = load i32, i32* @INT_MAX
%31 = sitofp i32 %30 to float
%32 = fpext float %31 to double
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %30, double %32)
ret i32 0
}