#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*/ fusion(int, int, int, int *, double *, double *);
void triRec(int deb, int fin, int *ind, double *val, double *val2) {
  if (deb < fin) {
    int milieu = (deb + fin) / 2;
    if (deb < milieu) {
      triRec(deb, milieu, ind, val, val2);
    }
    if (milieu + 1 < fin) {
      triRec(milieu + 1, fin, ind, val, val2);
    }
    fusion(deb, milieu, fin, ind, val, val2);
  }
}


x86 assembly (clang, -O0):
<triRec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11bd <triRec+0x9d>
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    117a <triRec+0x5a>
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <triRec@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
cmp    -0x8(%rbp),%eax
jge    11a3 <triRec+0x83>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1030 <triRec@plt>
mov    -0x4(%rbp),%edi
mov    -0x24(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
call   1040 <fusion@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<triRec>:
cmp    %esi,%edi
jge    119c <triRec+0x7c>
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %esi,%r13d
mov    %edi,%ebx
lea    (%rbx,%r13,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
cmp    %edi,%ebp
jle    1160 <triRec+0x40>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <triRec@plt>
lea    0x1(%rbp),%edi
cmp    %r13d,%edi
jge    1179 <triRec+0x59>
mov    %r13d,%esi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14,%r8
call   1030 <triRec@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %r12,%rcx
mov    %r15,%r8
mov    %r14,%r9
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <fusion@plt>
ret

LLVM IR (-O0):
define void @triRec(i32 %0, i32 %1, i32* %2, double* %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
%9 = alloca double*
%10 = alloca double*
%11 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store double* %3, double** %9
store double* %4, double** %10
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %49
15: ; preds = %5
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = sdiv i32 %18, 2
store i32 %19, i32* %11
%20 = load i32, i32* %6
%21 = load i32, i32* %11
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %29
23: ; preds = %15
%24 = load i32, i32* %6
%25 = load i32, i32* %11
%26 = load i32*, i32** %8
%27 = load double*, double** %9
%28 = load double*, double** %10
br label %29
29: ; preds = %23, %15
%30 = load i32, i32* %11
%31 = add nsw i32 %30, 1
%32 = load i32, i32* %7
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %41
34: ; preds = %29
%35 = load i32, i32* %11
%36 = add nsw i32 %35, 1
%37 = load i32, i32* %7
%38 = load i32*, i32** %8
%39 = load double*, double** %9
%40 = load double*, double** %10
br label %41
41: ; preds = %34, %29
%42 = load i32, i32* %6
%43 = load i32, i32* %11
%44 = load i32, i32* %7
%45 = load i32*, i32** %8
%46 = load double*, double** %9
%47 = load double*, double** %10
%48 = call i32 @fusion(i32 %42, i32 %43, i32 %44, i32* %45, double* %46, double* %47)
br label %49
49: ; preds = %41, %5
ret void
}

LLVM IR (-O2):
define void @triRec(i32 %0, i32 %1, i32* %2, double* %3, double* %4) {
%6 = icmp slt i32 %0, %1
br i1 %6, label %7, label %18
7: ; preds = %5
%8 = add nsw i32 %1, %0
%9 = sdiv i32 %8, 2
%10 = icmp sgt i32 %9, %0
br i1 %10, label %11, label %12
11: ; preds = %7
tail call void @triRec(i32 %0, i32 %9, i32* %2, double* %3, double* %4)
br label %12
12: ; preds = %11, %7
%13 = add nsw i32 %9, 1
%14 = icmp slt i32 %13, %1
br i1 %14, label %15, label %16
15: ; preds = %12
tail call void @triRec(i32 %13, i32 %1, i32* %2, double* %3, double* %4)
br label %16
16: ; preds = %15, %12
%17 = tail call i32 @fusion(i32 %0, i32 %9, i32 %1, i32* %2, double* %3, double* %4)
br label %18
18: ; preds = %16, %5
ret void
}