#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 /*<<< orphan*/ form_flat_clusters_from_monotonic_criterion(double const *,
                                                               double *, int *,
                                                               double, int);
int /*<<< orphan*/ free(double *);
int /*<<< orphan*/ get_max_Rfield_for_each_cluster(double const *,
                                                   double const *, double *,
                                                   int, int);
scalar_t__ malloc(int);
void form_flat_clusters_from_in(const double *Z, const double *R, int *T,
                                double cutoff, int n) {
  double *max_inconsists = (double *)malloc(sizeof(double) * n);
  get_max_Rfield_for_each_cluster(Z, R, max_inconsists, n, 3);
  form_flat_clusters_from_monotonic_criterion(Z, max_inconsists, T, cutoff, n);
  free(max_inconsists);
}


x86 assembly (clang, -O0):
<form_flat_clusters_from_in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
mov    -0x24(%rbp),%ecx
mov    $0x3,%r8d
call   1040 <get_max_Rfield_for_each_cluster@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
movsd  -0x20(%rbp),%xmm0
mov    -0x24(%rbp),%ecx
call   1060 <form_flat_clusters_from_monotonic_criterion@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<form_flat_clusters_from_in>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %ecx,%r13d
movsd  %xmm0,0x8(%rsp)
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%r12
lea    0x0(,%r13,8),%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rax,%rdx
mov    %r13d,%ecx
mov    $0x3,%r8d
call   1040 <get_max_Rfield_for_each_cluster@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
movsd  0x8(%rsp),%xmm0
mov    %r13d,%ecx
call   1060 <form_flat_clusters_from_monotonic_criterion@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @form_flat_clusters_from_in(double* %0, double* %1, i32* %2, double %3, i32 %4) {
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32*
%9 = alloca double
%10 = alloca i32
%11 = alloca double*
store double* %0, double** %6
store double* %1, double** %7
store i32* %2, i32** %8
store double %3, double* %9
store i32 %4, i32* %10
%12 = load i32, i32* %10
%13 = sext i32 %12 to i64
%14 = mul i64 8, %13
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to double*
store double* %17, double** %11
%18 = load double*, double** %6
%19 = load double*, double** %7
%20 = load double*, double** %11
%21 = load i32, i32* %10
%22 = call i32 @get_max_Rfield_for_each_cluster(double* %18, double* %19, double* %20, i32 %21, i32 3)
%23 = load double*, double** %6
%24 = load double*, double** %11
%25 = load i32*, i32** %8
%26 = load double, double* %9
%27 = load i32, i32* %10
%28 = call i32 @form_flat_clusters_from_monotonic_criterion(double* %23, double* %24, i32* %25, double %26, i32 %27)
%29 = load double*, double** %11
%30 = call i32 @free(double* %29)
ret void
}

LLVM IR (-O2):
define void @form_flat_clusters_from_in(double* %0, double* %1, i32* %2, double %3, i32 %4) {
%6 = shl i32 %4, 3
%7 = tail call i64 @malloc(i32 %6)
%8 = inttoptr i64 %7 to double*
%9 = tail call i32 @get_max_Rfield_for_each_cluster(double* %0, double* %1, double* %8, i32 %4, i32 3)
%10 = tail call i32 @form_flat_clusters_from_monotonic_criterion(double* %0, double* %8, i32* %2, double %3, i32 %4)
%11 = tail call i32 @free(double* %8)
ret void
}