#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 CHAR_BIT;
double DBL_MAX;
double DBL_MIN;
double FLT_MAX;
double FLT_MIN;
int INT_MAX;
int INT_MIN;
int LONG_MAX;
int LONG_MIN;
int SCHAR_MAX;
int SCHAR_MIN;
int SHRT_MAX;
int SHRT_MIN;
int UCHAR_MAX;
int UINT_MAX;
int ULONG_MAX;
int USHRT_MAX;
int /*<<< orphan*/ calc(int, char *);
int /*<<< orphan*/ printf(char *, double, ...);
main() {
  unsigned short us = 1;
  unsigned int ui = 1;
  unsigned long ul = 1;
  float f = 1;
  double d;
  long double ld = 1;
  int n;
  printf("char max:%d,min:%d\n", SCHAR_MAX, SCHAR_MIN);
  printf("uchar max:%d\n", UCHAR_MAX);
  printf("shrt max:%d,min:%d\n", SHRT_MAX, SHRT_MIN);
  printf("ushrt max:%d\n", USHRT_MAX);
  printf("int max:%d,min:%d\n", INT_MAX, INT_MIN);
  printf("uint max:%u\n", UINT_MAX);
  printf("long max:%d,min:%d\n", LONG_MAX, LONG_MIN);
  printf("ulong max:%u\n", ULONG_MAX);
  calc(CHAR_BIT, "char");
  for (n = 0; us; ++n)
    us = us * 2;
  calc(n, "short");
  for (n = 0; ui; ++n)
    ui = ui * 2;
  calc(n, "int");
  for (n = 0; ul; ++n)
    ul = ul * 2;
  calc(n, "long");
  printf("float:%e\n%e\n", FLT_MAX, FLT_MIN);
  printf("double:%e\n%e\n", DBL_MAX, DBL_MIN);
  printf("long double:%e\n%e\n", DBL_MAX, DBL_MIN);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x1,-0x6(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x1,-0x18(%rbp)
movl   $0x3f800000,-0x1c(%rbp)
fld1
fstpt  -0x40(%rbp)
mov    0x2e41(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mov    0x2e3e(%rip),%rax
mov    (%rax),%esi
lea    0xe95(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e77(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xe90(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2de6(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mov    0x2de3(%rip),%rax
mov    (%rax),%esi
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e24(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xe77(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e03(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mov    0x2de0(%rip),%rax
mov    (%rax),%esi
lea    0xe63(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2dd9(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xe5d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d80(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mov    0x2dad(%rip),%rax
mov    (%rax),%esi
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d2e(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
lea    0xe3a(%rip),%rsi
call   1040 <calc@plt>
movl   $0x0,-0x44(%rbp)
cmpw   $0x0,-0x6(%rbp)
je     127c <main+0x15c>
movzwl -0x6(%rbp),%eax
shl    $0x1,%eax
mov    %ax,-0x6(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1258 <main+0x138>
mov    -0x44(%rbp),%edi
lea    0xe05(%rip),%rsi
call   1040 <calc@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     12b3 <main+0x193>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1292 <main+0x172>
mov    -0x44(%rbp),%edi
lea    0xdd4(%rip),%rsi
call   1040 <calc@plt>
movl   $0x0,-0x44(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     12ee <main+0x1ce>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12c9 <main+0x1a9>
mov    -0x44(%rbp),%edi
lea    0xd9d(%rip),%rsi
call   1040 <calc@plt>
mov    0x2cac(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2cd1(%rip),%rax
movsd  (%rax),%xmm1
lea    0xd80(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2c48(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2c35(%rip),%rax
movsd  (%rax),%xmm1
lea    0xd6e(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2c24(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2c11(%rip),%rax
movsd  (%rax),%xmm1
lea    0xd45(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2e6d(%rip),%rax
cvtsi2sdl (%rax),%xmm0
mov    0x2e6a(%rip),%rax
mov    (%rax),%esi
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2ea3(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
lea    0xeb9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e0f(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
mov    0x2e09(%rip),%rax
mov    (%rax),%esi
lea    0xea2(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e4a(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e26(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
mov    0x2e00(%rip),%rax
mov    (%rax),%esi
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2df9(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
lea    0xe7a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d9d(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
mov    0x2dc7(%rip),%rax
mov    (%rax),%esi
lea    0xe62(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d48(%rip),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rax),%xmm0
lea    0xe5a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d64(%rip),%rax
mov    (%rax),%edi
lea    0xe51(%rip),%rsi
call   1040 <calc@plt>
lea    0xe4a(%rip),%rsi
mov    $0x10,%edi
call   1040 <calc@plt>
lea    0xe3f(%rip),%rsi
mov    $0x20,%edi
call   1040 <calc@plt>
lea    0xe32(%rip),%rsi
mov    $0x40,%edi
call   1040 <calc@plt>
mov    0x2d3c(%rip),%rax
movsd  (%rax),%xmm0
mov    0x2d61(%rip),%rax
movsd  (%rax),%xmm1
lea    0xe10(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2cd8(%rip),%r14
movsd  (%r14),%xmm0
mov    0x2cc4(%rip),%rbx
movsd  (%rbx),%xmm1
lea    0xdfd(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  (%r14),%xmm0
movsd  (%rbx),%xmm1
lea    0xde1(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [20 x i8] c"char max:%d,min:%d\0A\00"
@SCHAR_MAX = global i32 0
@SCHAR_MIN = global i32 0
@.str.1 = [14 x i8] c"uchar max:%d\0A\00"
@UCHAR_MAX = global i32 0
@.str.2 = [20 x i8] c"shrt max:%d,min:%d\0A\00"
@SHRT_MAX = global i32 0
@SHRT_MIN = global i32 0
@.str.3 = [14 x i8] c"ushrt max:%d\0A\00"
@USHRT_MAX = global i32 0
@.str.4 = [19 x i8] c"int max:%d,min:%d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@.str.5 = [13 x i8] c"uint max:%u\0A\00"
@UINT_MAX = global i32 0
@.str.6 = [20 x i8] c"long max:%d,min:%d\0A\00"
@LONG_MAX = global i32 0
@LONG_MIN = global i32 0
@.str.7 = [14 x i8] c"ulong max:%u\0A\00"
@ULONG_MAX = global i32 0
@CHAR_BIT = global i32 0
@.str.8 = [5 x i8] c"char\00"
@.str.9 = [6 x i8] c"short\00"
@.str.10 = [4 x i8] c"int\00"
@.str.11 = [5 x i8] c"long\00"
@.str.12 = [13 x i8] c"float:%e\0A%e\0A\00"
@FLT_MAX = global double 0.000000e+00
@FLT_MIN = global double 0.000000e+00
@.str.13 = [14 x i8] c"double:%e\0A%e\0A\00"
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
@.str.14 = [19 x i8] c"long double:%e\0A%e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i32
%4 = alloca i64
%5 = alloca float
%6 = alloca double
%7 = alloca x86_fp80
%8 = alloca i32
store i32 0, i32* %1
store i16 1, i16* %2
store i32 1, i32* %3
store i64 1, i64* %4
store float 1.000000e+00, float* %5
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %7
%9 = load i32, i32* @SCHAR_MAX
%10 = sitofp i32 %9 to double
%11 = load i32, i32* @SCHAR_MIN
%12 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %10, i32 %11)
%13 = load i32, i32* @UCHAR_MAX
%14 = sitofp i32 %13 to double
%15 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %14)
%16 = load i32, i32* @SHRT_MAX
%17 = sitofp i32 %16 to double
%18 = load i32, i32* @SHRT_MIN
%19 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %17, i32 %18)
%20 = load i32, i32* @USHRT_MAX
%21 = sitofp i32 %20 to double
%22 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %21)
%23 = load i32, i32* @INT_MAX
%24 = sitofp i32 %23 to double
%25 = load i32, i32* @INT_MIN
%26 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), double %24, i32 %25)
%27 = load i32, i32* @UINT_MAX
%28 = sitofp i32 %27 to double
%29 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), double %28)
%30 = load i32, i32* @LONG_MAX
%31 = sitofp i32 %30 to double
%32 = load i32, i32* @LONG_MIN
%33 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), double %31, i32 %32)
%34 = load i32, i32* @ULONG_MAX
%35 = sitofp i32 %34 to double
%36 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %35)
%37 = load i32, i32* @CHAR_BIT
%38 = call i32 @calc(i32 %37, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %8
br label %39
39: ; preds = %47, %0
%40 = load i16, i16* %2
%41 = icmp ne i16 %40, 0
br i1 %41, label %42, label %50
42: ; preds = %39
%43 = load i16, i16* %2
%44 = zext i16 %43 to i32
%45 = mul nsw i32 %44, 2
%46 = trunc i32 %45 to i16
store i16 %46, i16* %2
br label %47
47: ; preds = %42
%48 = load i32, i32* %8
%49 = add nsw i32 %48, 1
store i32 %49, i32* %8
br label %39
50: ; preds = %39
%51 = load i32, i32* %8
%52 = call i32 @calc(i32 %51, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
store i32 0, i32* %8
br label %53
53: ; preds = %59, %50
%54 = load i32, i32* %3
%55 = icmp ne i32 %54, 0
br i1 %55, label %56, label %62
56: ; preds = %53
%57 = load i32, i32* %3
%58 = mul i32 %57, 2
store i32 %58, i32* %3
br label %59
59: ; preds = %56
%60 = load i32, i32* %8
%61 = add nsw i32 %60, 1
store i32 %61, i32* %8
br label %53
62: ; preds = %53
%63 = load i32, i32* %8
%64 = call i32 @calc(i32 %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %8
br label %65
65: ; preds = %71, %62
%66 = load i64, i64* %4
%67 = icmp ne i64 %66, 0
br i1 %67, label %68, label %74
68: ; preds = %65
%69 = load i64, i64* %4
%70 = mul i64 %69, 2
store i64 %70, i64* %4
br label %71
71: ; preds = %68
%72 = load i32, i32* %8
%73 = add nsw i32 %72, 1
store i32 %73, i32* %8
br label %65
74: ; preds = %65
%75 = load i32, i32* %8
%76 = call i32 @calc(i32 %75, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%77 = load double, double* @FLT_MAX
%78 = load double, double* @FLT_MIN
%79 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), double %77, double %78)
%80 = load double, double* @DBL_MAX
%81 = load double, double* @DBL_MIN
%82 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), double %80, double %81)
%83 = load double, double* @DBL_MAX
%84 = load double, double* @DBL_MIN
%85 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), double %83, double %84)
%86 = load i32, i32* %1
ret i32 %86
}

LLVM IR (-O2):
@.str = [20 x i8] c"char max:%d,min:%d\0A\00"
@SCHAR_MAX = global i32 0
@SCHAR_MIN = global i32 0
@.str.1 = [14 x i8] c"uchar max:%d\0A\00"
@UCHAR_MAX = global i32 0
@.str.2 = [20 x i8] c"shrt max:%d,min:%d\0A\00"
@SHRT_MAX = global i32 0
@SHRT_MIN = global i32 0
@.str.3 = [14 x i8] c"ushrt max:%d\0A\00"
@USHRT_MAX = global i32 0
@.str.4 = [19 x i8] c"int max:%d,min:%d\0A\00"
@INT_MAX = global i32 0
@INT_MIN = global i32 0
@.str.5 = [13 x i8] c"uint max:%u\0A\00"
@UINT_MAX = global i32 0
@.str.6 = [20 x i8] c"long max:%d,min:%d\0A\00"
@LONG_MAX = global i32 0
@LONG_MIN = global i32 0
@.str.7 = [14 x i8] c"ulong max:%u\0A\00"
@ULONG_MAX = global i32 0
@CHAR_BIT = global i32 0
@.str.8 = [5 x i8] c"char\00"
@.str.9 = [6 x i8] c"short\00"
@.str.10 = [4 x i8] c"int\00"
@.str.11 = [5 x i8] c"long\00"
@.str.12 = [13 x i8] c"float:%e\0A%e\0A\00"
@FLT_MAX = global double 0.000000e+00
@FLT_MIN = global double 0.000000e+00
@.str.13 = [14 x i8] c"double:%e\0A%e\0A\00"
@DBL_MAX = global double 0.000000e+00
@DBL_MIN = global double 0.000000e+00
@.str.14 = [19 x i8] c"long double:%e\0A%e\0A\00"
define i32 @main() {
%1 = load i32, i32* @SCHAR_MAX
%2 = sitofp i32 %1 to double
%3 = load i32, i32* @SCHAR_MIN
%4 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %2, i32 %3)
%5 = load i32, i32* @UCHAR_MAX
%6 = sitofp i32 %5 to double
%7 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %6)
%8 = load i32, i32* @SHRT_MAX
%9 = sitofp i32 %8 to double
%10 = load i32, i32* @SHRT_MIN
%11 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %9, i32 %10)
%12 = load i32, i32* @USHRT_MAX
%13 = sitofp i32 %12 to double
%14 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = load i32, i32* @INT_MAX
%16 = sitofp i32 %15 to double
%17 = load i32, i32* @INT_MIN
%18 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), double %16, i32 %17)
%19 = load i32, i32* @UINT_MAX
%20 = sitofp i32 %19 to double
%21 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), double %20)
%22 = load i32, i32* @LONG_MAX
%23 = sitofp i32 %22 to double
%24 = load i32, i32* @LONG_MIN
%25 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), double %23, i32 %24)
%26 = load i32, i32* @ULONG_MAX
%27 = sitofp i32 %26 to double
%28 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), double %27)
%29 = load i32, i32* @CHAR_BIT
%30 = tail call i32 @calc(i32 %29, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%31 = tail call i32 @calc(i32 16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0))
%32 = tail call i32 @calc(i32 32, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%33 = tail call i32 @calc(i32 64, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%34 = load double, double* @FLT_MAX
%35 = load double, double* @FLT_MIN
%36 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.12, i64 0, i64 0), double %34, double %35)
%37 = load double, double* @DBL_MAX
%38 = load double, double* @DBL_MIN
%39 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.13, i64 0, i64 0), double %37, double %38)
%40 = load double, double* @DBL_MAX
%41 = load double, double* @DBL_MIN
%42 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), double %40, double %41)
ret i32 0
}