#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*/ ft_putstr(char *);
int /*<<< orphan*/ print_bonus(char *, int, int);
int /*<<< orphan*/ print_results(int, int, int);
void print_decisions(int **decisions) {
  int i;
  if (decisions == NULL)
    ft_putstr("aucune");
  else {
    i = 0;
    while (decisions[0][i] != -1) {
      if (i != 0)
        ft_putstr(" || ");
      print_results(decisions[0][i], decisions[1][1], decisions[1][0]);
      ++i;
    }
    if (decisions[1][0] == decisions[1][1])
      print_bonus("square", decisions[1][1], decisions[1][0]);
    print_bonus("rectangle", decisions[1][1], decisions[1][0]);
  }
  ft_putstr("\n");
}


x86 assembly (clang, -O0):
<print_decisions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1158 <print_decisions+0x28>
lea    0xeb2(%rip),%rdi
call   1050 <ft_putstr@plt>
jmp    121d <print_decisions+0xed>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
cmpl   $0xffffffff,(%rax,%rcx,4)
je     11c0 <print_decisions+0x90>
cmpl   $0x0,-0xc(%rbp)
je     118a <print_decisions+0x5a>
lea    0xe82(%rip),%rdi
call   1050 <ft_putstr@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%edx
call   1030 <print_results@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115f <print_decisions+0x2f>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
cmp    0x4(%rcx),%eax
jne    11fc <print_decisions+0xcc>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%edx
lea    0xe15(%rip),%rdi
call   1040 <print_bonus@plt>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%esi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%edx
lea    0xdfb(%rip),%rdi
call   1040 <print_bonus@plt>
lea    0xdf9(%rip),%rdi
call   1050 <ft_putstr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_decisions>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     11cd <print_decisions+0x9d>
mov    %rdi,%r15
mov    (%rdi),%rax
mov    (%rax),%edi
cmp    $0xffffffff,%edi
je     119b <print_decisions+0x6b>
mov    0x8(%r15),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
call   1030 <print_results@plt>
mov    (%r15),%rax
cmpl   $0xffffffff,0x4(%rax)
je     119b <print_decisions+0x6b>
xor    %ebx,%ebx
lea    0xe9c(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1050 <ft_putstr@plt>
mov    (%r15),%rax
mov    0x8(%r15),%rcx
mov    0x4(%rax,%rbx,1),%edi
mov    (%rcx),%edx
mov    0x4(%rcx),%esi
call   1030 <print_results@plt>
mov    (%r15),%rax
cmpl   $0xffffffff,0x8(%rax,%rbx,1)
lea    0x4(%rbx),%rbx
jne    1170 <print_decisions+0x40>
mov    0x8(%r15),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
cmp    %esi,%edx
jne    11bf <print_decisions+0x8f>
lea    0xe5d(%rip),%rdi
mov    %edx,%esi
call   1040 <print_bonus@plt>
mov    0x8(%r15),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
lea    0xe4d(%rip),%rdi
call   1040 <print_bonus@plt>
jmp    11d9 <print_decisions+0xa9>
lea    0xe2c(%rip),%rdi
call   1050 <ft_putstr@plt>
lea    0xe3d(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <ft_putstr@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"aucune\00"
@.str.1 = [5 x i8] c" || \00"
@.str.2 = [7 x i8] c"square\00"
@.str.3 = [10 x i8] c"rectangle\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @print_decisions(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = icmp eq i32** %4, null
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %80
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %23, %8
%10 = load i32**, i32*** %2
%11 = getelementptr inbounds i32*, i32** %10, i64 0
%12 = load i32*, i32** %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = icmp ne i32 %16, -1
br i1 %17, label %18, label %44
18: ; preds = %9
%19 = load i32, i32* %3
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %18
%24 = load i32**, i32*** %2
%25 = getelementptr inbounds i32*, i32** %24, i64 0
%26 = load i32*, i32** %25
%27 = load i32, i32* %3
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i32, i32* %26, i64 %28
%30 = load i32, i32* %29
%31 = load i32**, i32*** %2
%32 = getelementptr inbounds i32*, i32** %31, i64 1
%33 = load i32*, i32** %32
%34 = getelementptr inbounds i32, i32* %33, i64 1
%35 = load i32, i32* %34
%36 = load i32**, i32*** %2
%37 = getelementptr inbounds i32*, i32** %36, i64 1
%38 = load i32*, i32** %37
%39 = getelementptr inbounds i32, i32* %38, i64 0
%40 = load i32, i32* %39
%41 = call i32 @print_results(i32 %30, i32 %35, i32 %40)
%42 = load i32, i32* %3
%43 = add nsw i32 %42, 1
store i32 %43, i32* %3
br label %9
44: ; preds = %9
%45 = load i32**, i32*** %2
%46 = getelementptr inbounds i32*, i32** %45, i64 1
%47 = load i32*, i32** %46
%48 = getelementptr inbounds i32, i32* %47, i64 0
%49 = load i32, i32* %48
%50 = load i32**, i32*** %2
%51 = getelementptr inbounds i32*, i32** %50, i64 1
%52 = load i32*, i32** %51
%53 = getelementptr inbounds i32, i32* %52, i64 1
%54 = load i32, i32* %53
%55 = icmp eq i32 %49, %54
br i1 %55, label %56, label %68
56: ; preds = %44
%57 = load i32**, i32*** %2
%58 = getelementptr inbounds i32*, i32** %57, i64 1
%59 = load i32*, i32** %58
%60 = getelementptr inbounds i32, i32* %59, i64 1
%61 = load i32, i32* %60
%62 = load i32**, i32*** %2
%63 = getelementptr inbounds i32*, i32** %62, i64 1
%64 = load i32*, i32** %63
%65 = getelementptr inbounds i32, i32* %64, i64 0
%66 = load i32, i32* %65
%67 = call i32 @print_bonus(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %61, i32 %66)
br label %68
68: ; preds = %56, %44
%69 = load i32**, i32*** %2
%70 = getelementptr inbounds i32*, i32** %69, i64 1
%71 = load i32*, i32** %70
%72 = getelementptr inbounds i32, i32* %71, i64 1
%73 = load i32, i32* %72
%74 = load i32**, i32*** %2
%75 = getelementptr inbounds i32*, i32** %74, i64 1
%76 = load i32*, i32** %75
%77 = getelementptr inbounds i32, i32* %76, i64 0
%78 = load i32, i32* %77
%79 = call i32 @print_bonus(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %73, i32 %78)
br label %80
80: ; preds = %68, %6
%81 = call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"aucune\00"
@.str.1 = [5 x i8] c" || \00"
@.str.2 = [7 x i8] c"square\00"
@.str.3 = [10 x i8] c"rectangle\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @print_decisions(i32** %0) {
%2 = icmp eq i32** %0, null
br i1 %2, label %18, label %3
3: ; preds = %1
%4 = load i32*, i32** %0
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, -1
br i1 %6, label %36, label %7
7: ; preds = %3
%8 = getelementptr inbounds i32*, i32** %0, i64 1
%9 = load i32*, i32** %8
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = load i32, i32* %9
%13 = tail call i32 @print_results(i32 %5, i32 %11, i32 %12)
%14 = load i32*, i32** %0
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = icmp eq i32 %16, -1
br i1 %17, label %36, label %20
18: ; preds = %1
%19 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
br label %53
20: ; preds = %7, %20
%21 = phi i64 [ %31, %20 ], [ 1, %7 ]
%22 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32*, i32** %0
%24 = getelementptr inbounds i32, i32* %23, i64 %21
%25 = load i32, i32* %24
%26 = load i32*, i32** %8
%27 = getelementptr inbounds i32, i32* %26, i64 1
%28 = load i32, i32* %27
%29 = load i32, i32* %26
%30 = tail call i32 @print_results(i32 %25, i32 %28, i32 %29)
%31 = add nuw i64 %21, 1
%32 = load i32*, i32** %0
%33 = getelementptr inbounds i32, i32* %32, i64 %31
%34 = load i32, i32* %33
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %20
36: ; preds = %20, %7, %3
%37 = getelementptr inbounds i32*, i32** %0, i64 1
%38 = load i32*, i32** %37
%39 = load i32, i32* %38
%40 = getelementptr inbounds i32, i32* %38, i64 1
%41 = load i32, i32* %40
%42 = icmp eq i32 %39, %41
br i1 %42, label %43, label %49
43: ; preds = %36
%44 = tail call i32 @print_bonus(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 %39, i32 %39)
%45 = load i32*, i32** %37
%46 = getelementptr inbounds i32, i32* %45, i64 1
%47 = load i32, i32* %46
%48 = load i32, i32* %45
br label %49
49: ; preds = %43, %36
%50 = phi i32 [ %48, %43 ], [ %39, %36 ]
%51 = phi i32 [ %47, %43 ], [ %41, %36 ]
%52 = tail call i32 @print_bonus(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %51, i32 %50)
br label %53
53: ; preds = %49, %18
%54 = tail call i32 @ft_putstr(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
ret void
}