#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*/ DBL_MAX;
double backtrack(double **, int, int, int /*<<< orphan*/, int *,
                 int /*<<< orphan*/, int /*<<< orphan*/, int *);
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
double find_correspondent_object(double **d, int n_gt, int n_c, int *sol) {
  int i;
  int *used;
  double min;
  used = (int *)malloc(n_c * sizeof(int));
  for (i = 0; i < n_c; i++)
    used[i] = 0;
  min = backtrack(d, n_gt, n_c, 0, used, 0, DBL_MAX, sol);
  free(used);
  return min;
}


x86 assembly (clang, -O0):
<find_correspondent_object>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1189 <find_correspondent_object+0x59>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1160 <find_correspondent_object+0x30>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x28(%rbp),%r8
mov    0x2e42(%rip),%rax
mov    (%rax),%r10d
mov    -0x18(%rbp),%rax
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r10d,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <backtrack@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x30(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_correspondent_object>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rcx,%r14
mov    %edx,%ebx
mov    %esi,%r12d
mov    %rdi,%rbp
lea    0x0(,%rbx,4),%edi
call   1060 <malloc@plt>
mov    %rax,%r15
test   %ebx,%ebx
jle    117a <find_correspondent_object+0x3a>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %r15,%rdi
xor    %esi,%esi
call   1040 <memset@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%eax
mov    %rbp,%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %ecx,%ecx
mov    %r15,%r8
xor    %r9d,%r9d
push   %r14
push   %rax
call   1050 <backtrack@plt>
add    $0x10,%rsp
movsd  %xmm0,0x8(%rsp)
mov    %r15,%rdi
call   1030 <free@plt>
movsd  0x8(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@DBL_MAX = global i32 0
define double @find_correspondent_object(double** %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32*
%11 = alloca double
store double** %0, double*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%12 = load i32, i32* %7
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call i64 @malloc(i32 %15)
%17 = inttoptr i64 %16 to i32*
store i32* %17, i32** %10
store i32 0, i32* %9
br label %18
18: ; preds = %27, %4
%19 = load i32, i32* %9
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %30
22: ; preds = %18
%23 = load i32*, i32** %10
%24 = load i32, i32* %9
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 0, i32* %26
br label %27
27: ; preds = %22
%28 = load i32, i32* %9
%29 = add nsw i32 %28, 1
store i32 %29, i32* %9
br label %18
30: ; preds = %18
%31 = load double**, double*** %5
%32 = load i32, i32* %6
%33 = load i32, i32* %7
%34 = load i32*, i32** %10
%35 = load i32, i32* @DBL_MAX
%36 = load i32*, i32** %8
%37 = call double @backtrack(double** %31, i32 %32, i32 %33, i32 0, i32* %34, i32 0, i32 %35, i32* %36)
store double %37, double* %11
%38 = load i32*, i32** %10
%39 = call i32 @free(i32* %38)
%40 = load double, double* %11
ret double %40
}

LLVM IR (-O2):
@DBL_MAX = global i32 0
define double @find_correspondent_object(double** %0, i32 %1, i32 %2, i32* %3) {
%5 = shl i32 %2, 2
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i32*
%8 = icmp sgt i32 %2, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = inttoptr i64 %6 to i8*
%11 = zext i32 %2 to i64
%12 = shl nuw nsw i64 %11, 2
br label %13
13: ; preds = %9, %4
%14 = load i32, i32* @DBL_MAX
%15 = tail call double @backtrack(double** %0, i32 %1, i32 %2, i32 0, i32* %7, i32 0, i32 %14, i32* %3)
%16 = tail call i32 @free(i32* %7)
ret double %15
}