#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 estimate_mi(double *, int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, int, int);
double mixnyn(double *rangevec, int n, int c, int dimx, int k) {
  if ((c > dimx) && (dimx > 0)) {
    return estimate_mi(rangevec, n, c, dimx, c - dimx, k, -1);
  } else {
    printf("Error: dimx(%d) should be less than the number of columns(%d)!\n",
           dimx, c);
    return -1;
  }
}


x86 assembly (clang, -O0):
<mixnyn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    117e <mixnyn+0x5e>
cmpl   $0x0,-0x1c(%rbp)
jle    117e <mixnyn+0x5e>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
sub    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
movl   $0xffffffff,(%rsp)
call   1040 <estimate_mi@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    119d <mixnyn+0x7d>
mov    -0x1c(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
movsd  0xe68(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixnyn>:
push   %rax
mov    %r8d,%r9d
mov    %edx,%r8d
sub    %ecx,%r8d
jle    113e <mixnyn+0x1e>
test   %ecx,%ecx
jle    113e <mixnyn+0x1e>
movl   $0xffffffff,(%rsp)
call   1040 <estimate_mi@plt>
pop    %rax
ret
lea    0xec3(%rip),%rdi
mov    %ecx,%esi
call   1030 <printf@plt>
movsd  0xeac(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [64 x i8] c"Error: dimx(%d) should be less than the number of columns(%d)!\0A\00"
define double @mixnyn(double* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
%12 = load i32, i32* %9
%13 = load i32, i32* %10
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %28
15: ; preds = %5
%16 = load i32, i32* %10
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load double*, double** %7
%20 = load i32, i32* %8
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = load i32, i32* %9
%24 = load i32, i32* %10
%25 = sub nsw i32 %23, %24
%26 = load i32, i32* %11
%27 = call double @estimate_mi(double* %19, i32 %20, i32 %21, i32 %22, i32 %25, i32 %26, i32 -1)
store double %27, double* %6
br label %32
28: ; preds = %15, %5
%29 = load i32, i32* %10
%30 = load i32, i32* %9
%31 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %29, i32 %30)
store double -1.000000e+00, double* %6
br label %32
32: ; preds = %28, %18
%33 = load double, double* %6
ret double %33
}

LLVM IR (-O2):
@.str = [64 x i8] c"Error: dimx(%d) should be less than the number of columns(%d)!\0A\00"
define double @mixnyn(double* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %2, %3
%7 = icmp sgt i32 %3, 0
%8 = and i1 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = sub nsw i32 %2, %3
%11 = tail call double @estimate_mi(double* %0, i32 %1, i32 %2, i32 %3, i32 %10, i32 %4, i32 -1)
br label %14
12: ; preds = %5
%13 = tail call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %2)
br label %14
14: ; preds = %12, %9
%15 = phi double [ %11, %9 ], [ -1.000000e+00, %12 ]
ret double %15
}