#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 DBL_MANT_DIG;
int DBL_MAX_EXP;
int DBL_MIN_EXP;
int FLT_MANT_DIG;
int FLT_MAX_EXP;
int FLT_MIN_EXP;
double number(int, int /*<<< orphan*/, int);
double pow(int, int);
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  int k = 2;
  int l = 3;
  printf("%d to the power of %d-1 is: %f\n", k, l, pow(k, l - 1));
  printf("The radix of the base (p) in float is %d\n", FLT_MANT_DIG);
  printf("The radix of the base (p) in double float is %d\n", DBL_MANT_DIG);
  printf(
      "The minimun exponent number for a representable number in float is %d\n",
      FLT_MIN_EXP);
  printf("The minimun exponent number for a representable number in double is "
         "%d\n",
         DBL_MIN_EXP);
  printf(
      "The maximum exponent number for a representable number in float is %d\n",
      FLT_MAX_EXP);
  printf("The maximum exponent number for a representable number in double is "
         "%d\n",
         DBL_MAX_EXP);
  printf("The biggest number in single precision is %f\n",
         number(FLT_MANT_DIG, 0, FLT_MAX_EXP));
  printf("The biggest number in double precision is %f\n",
         number(DBL_MANT_DIG, 0, DBL_MAX_EXP));
  printf("The smallest number in single precision is %f\n",
         number(FLT_MANT_DIG, 0, FLT_MIN_EXP));
  printf("The smallest number in single precision is %0.25f\n",
         number(DBL_MANT_DIG, 0, DBL_MIN_EXP));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1050 <pow@plt>
mov    -0x1c(%rbp),%esi
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
lea    0xe83(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2e2d(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xe8a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e34(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e0b(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xeb3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e12(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xee1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2de1(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xf10(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2dd8(%rip),%rax
cvtsi2sdl (%rax),%xmm0
lea    0xf3e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
mov    0x2da6(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf5f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
mov    0x2d8f(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf66(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d49(%rip),%rax
mov    (%rax),%edi
mov    0x2d50(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf6d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2d42(%rip),%rax
mov    (%rax),%edi
mov    0x2d49(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf75(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x2,%edi
mov    $0x2,%esi
call   1050 <pow@plt>
movaps %xmm0,%xmm1
lea    0xeb4(%rip),%rdi
movsd  0xea4(%rip),%xmm0
mov    $0x3,%esi
mov    $0x2,%al
call   1030 <printf@plt>
mov    0x2e49(%rip),%r13
xorps  %xmm0,%xmm0
cvtsi2sdl 0x0(%r13),%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e4b(%rip),%r14
xorps  %xmm0,%xmm0
cvtsi2sdl (%r14),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e1e(%rip),%r12
xorps  %xmm0,%xmm0
cvtsi2sdl (%r12),%xmm0
lea    0xec9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2e20(%rip),%r15
xorps  %xmm0,%xmm0
cvtsi2sdl (%r15),%xmm0
lea    0xef3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2deb(%rip),%rbx
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx),%xmm0
lea    0xf1f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x2ddf(%rip),%rbp
xorps  %xmm0,%xmm0
cvtsi2sdl 0x0(%rbp),%xmm0
lea    0xf49(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x0(%r13),%edi
mov    (%rbx),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf76(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    (%r14),%edi
mov    0x0(%rbp),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf89(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    0x0(%r13),%edi
mov    (%r12),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xf9a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    (%r14),%edi
mov    (%r15),%edx
xor    %esi,%esi
call   1040 <number@plt>
lea    0xfae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [32 x i8] c"%d to the power of %d-1 is: %f\0A\00"
@.str.1 = [42 x i8] c"The radix of the base (p) in float is %d\0A\00"
@FLT_MANT_DIG = global i32 0
@.str.2 = [49 x i8] c"The radix of the base (p) in double float is %d\0A\00"
@DBL_MANT_DIG = global i32 0
@.str.3 = [71 x i8] c"The minimun exponent number for a representable number in float is %d\0A\00"
@FLT_MIN_EXP = global i32 0
@.str.4 = [72 x i8] c"The minimun exponent number for a representable number in double is %d\0A\00"
@DBL_MIN_EXP = global i32 0
@.str.5 = [71 x i8] c"The maximum exponent number for a representable number in float is %d\0A\00"
@FLT_MAX_EXP = global i32 0
@.str.6 = [72 x i8] c"The maximum exponent number for a representable number in double is %d\0A\00"
@DBL_MAX_EXP = global i32 0
@.str.7 = [46 x i8] c"The biggest number in single precision is %f\0A\00"
@.str.8 = [46 x i8] c"The biggest number in double precision is %f\0A\00"
@.str.9 = [47 x i8] c"The smallest number in single precision is %f\0A\00"
@.str.10 = [51 x i8] c"The smallest number in single precision is %0.25f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to double
%6 = load i32, i32* %3
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 1
%10 = call double @pow(i32 %7, i32 %9)
%11 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double %5, i32 %6, double %10)
%12 = load i32, i32* @FLT_MANT_DIG
%13 = sitofp i32 %12 to double
%14 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = load i32, i32* @DBL_MANT_DIG
%16 = sitofp i32 %15 to double
%17 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = load i32, i32* @FLT_MIN_EXP
%19 = sitofp i32 %18 to double
%20 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), double %19)
%21 = load i32, i32* @DBL_MIN_EXP
%22 = sitofp i32 %21 to double
%23 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0), double %22)
%24 = load i32, i32* @FLT_MAX_EXP
%25 = sitofp i32 %24 to double
%26 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.5, i64 0, i64 0), double %25)
%27 = load i32, i32* @DBL_MAX_EXP
%28 = sitofp i32 %27 to double
%29 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0), double %28)
%30 = load i32, i32* @FLT_MANT_DIG
%31 = load i32, i32* @FLT_MAX_EXP
%32 = call double @number(i32 %30, i32 0, i32 %31)
%33 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), double %32)
%34 = load i32, i32* @DBL_MANT_DIG
%35 = load i32, i32* @DBL_MAX_EXP
%36 = call double @number(i32 %34, i32 0, i32 %35)
%37 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), double %36)
%38 = load i32, i32* @FLT_MANT_DIG
%39 = load i32, i32* @FLT_MIN_EXP
%40 = call double @number(i32 %38, i32 0, i32 %39)
%41 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0), double %40)
%42 = load i32, i32* @DBL_MANT_DIG
%43 = load i32, i32* @DBL_MIN_EXP
%44 = call double @number(i32 %42, i32 0, i32 %43)
%45 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0), double %44)
ret i32 0
}

LLVM IR (-O2):
@.str = [32 x i8] c"%d to the power of %d-1 is: %f\0A\00"
@.str.1 = [42 x i8] c"The radix of the base (p) in float is %d\0A\00"
@FLT_MANT_DIG = global i32 0
@.str.2 = [49 x i8] c"The radix of the base (p) in double float is %d\0A\00"
@DBL_MANT_DIG = global i32 0
@.str.3 = [71 x i8] c"The minimun exponent number for a representable number in float is %d\0A\00"
@FLT_MIN_EXP = global i32 0
@.str.4 = [72 x i8] c"The minimun exponent number for a representable number in double is %d\0A\00"
@DBL_MIN_EXP = global i32 0
@.str.5 = [71 x i8] c"The maximum exponent number for a representable number in float is %d\0A\00"
@FLT_MAX_EXP = global i32 0
@.str.6 = [72 x i8] c"The maximum exponent number for a representable number in double is %d\0A\00"
@DBL_MAX_EXP = global i32 0
@.str.7 = [46 x i8] c"The biggest number in single precision is %f\0A\00"
@.str.8 = [46 x i8] c"The biggest number in double precision is %f\0A\00"
@.str.9 = [47 x i8] c"The smallest number in single precision is %f\0A\00"
@.str.10 = [51 x i8] c"The smallest number in single precision is %0.25f\0A\00"
define i32 @main() {
%1 = tail call double @pow(i32 2, i32 2)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), double 2.000000e+00, i32 3, double %1)
%3 = load i32, i32* @FLT_MANT_DIG
%4 = sitofp i32 %3 to double
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = load i32, i32* @DBL_MANT_DIG
%7 = sitofp i32 %6 to double
%8 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = load i32, i32* @FLT_MIN_EXP
%10 = sitofp i32 %9 to double
%11 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.3, i64 0, i64 0), double %10)
%12 = load i32, i32* @DBL_MIN_EXP
%13 = sitofp i32 %12 to double
%14 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.4, i64 0, i64 0), double %13)
%15 = load i32, i32* @FLT_MAX_EXP
%16 = sitofp i32 %15 to double
%17 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.5, i64 0, i64 0), double %16)
%18 = load i32, i32* @DBL_MAX_EXP
%19 = sitofp i32 %18 to double
%20 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0), double %19)
%21 = load i32, i32* @FLT_MANT_DIG
%22 = load i32, i32* @FLT_MAX_EXP
%23 = tail call double @number(i32 %21, i32 0, i32 %22)
%24 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.7, i64 0, i64 0), double %23)
%25 = load i32, i32* @DBL_MANT_DIG
%26 = load i32, i32* @DBL_MAX_EXP
%27 = tail call double @number(i32 %25, i32 0, i32 %26)
%28 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.8, i64 0, i64 0), double %27)
%29 = load i32, i32* @FLT_MANT_DIG
%30 = load i32, i32* @FLT_MIN_EXP
%31 = tail call double @number(i32 %29, i32 0, i32 %30)
%32 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.9, i64 0, i64 0), double %31)
%33 = load i32, i32* @DBL_MANT_DIG
%34 = load i32, i32* @DBL_MIN_EXP
%35 = tail call double @number(i32 %33, i32 0, i32 %34)
%36 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0), double %35)
ret i32 0
}