#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*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int pipe(int *);
int /*<<< orphan*/ stderr;
int creation_pipes(int **pipes) {
  int indice;
  for (indice = 0; indice < 9; indice++) {
    if (pipe(pipes[indice]) == -1) {
      fprintf(stderr, "Erreur lors de l'ouverture de pipes[%d] \n", indice);
      exit(EXIT_FAILURE);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<creation_pipes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x9,-0xc(%rbp)
jge    11a0 <creation_pipes+0x70>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
jne    118d <creation_pipes+0x5d>
mov    0x2e72(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe86(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
jmp    1192 <creation_pipes+0x62>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1143 <creation_pipes+0x13>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<creation_pipes>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11b5 <creation_pipes+0x85>
mov    0x8(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11b9 <creation_pipes+0x89>
mov    0x10(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11c0 <creation_pipes+0x90>
mov    0x18(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11c7 <creation_pipes+0x97>
mov    0x20(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11ce <creation_pipes+0x9e>
mov    0x28(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11d5 <creation_pipes+0xa5>
mov    0x30(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11dc <creation_pipes+0xac>
mov    0x38(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11e3 <creation_pipes+0xb3>
mov    0x40(%rbx),%rdi
call   1030 <pipe@plt>
cmp    $0xffffffff,%eax
je     11ea <creation_pipes+0xba>
xor    %eax,%eax
pop    %rbx
ret
xor    %edx,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x1,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x2,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x3,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x4,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x5,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x6,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x7,%edx
jmp    11ef <creation_pipes+0xbf>
mov    $0x8,%edx
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe01(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Erreur lors de l'ouverture de pipes[%d] \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @creation_pipes(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
store i32 0, i32* %3
br label %4
4: ; preds = %22, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 9
br i1 %6, label %7, label %25
7: ; preds = %4
%8 = load i32**, i32*** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32*, i32** %8, i64 %10
%12 = load i32*, i32** %11
%13 = call i32 @pipe(i32* %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %21
15: ; preds = %7
%16 = load i32, i32* @stderr
%17 = load i32, i32* %3
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; preds = %7
br label %22
22: ; preds = %21
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %4
25: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Erreur lors de l'ouverture de pipes[%d] \0A\00"
@EXIT_FAILURE = global i32 0
define i32 @creation_pipes(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = tail call i32 @pipe(i32* %2)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %11
5: ; preds = %46, %41, %36, %31, %26, %21, %16, %11, %1
%6 = phi i32 [ 0, %1 ], [ 1, %11 ], [ 2, %16 ], [ 3, %21 ], [ 4, %26 ], [ 5, %31 ], [ 6, %36 ], [ 7, %41 ], [ 8, %46 ]
%7 = load i32, i32* @stderr
%8 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %6)
%9 = load i32, i32* @EXIT_FAILURE
%10 = tail call i32 @exit(i32 %9)
unreachable
11: ; preds = %1
%12 = getelementptr inbounds i32*, i32** %0, i64 1
%13 = load i32*, i32** %12
%14 = tail call i32 @pipe(i32* %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %5, label %16
16: ; preds = %11
%17 = getelementptr inbounds i32*, i32** %0, i64 2
%18 = load i32*, i32** %17
%19 = tail call i32 @pipe(i32* %18)
%20 = icmp eq i32 %19, -1
br i1 %20, label %5, label %21
21: ; preds = %16
%22 = getelementptr inbounds i32*, i32** %0, i64 3
%23 = load i32*, i32** %22
%24 = tail call i32 @pipe(i32* %23)
%25 = icmp eq i32 %24, -1
br i1 %25, label %5, label %26
26: ; preds = %21
%27 = getelementptr inbounds i32*, i32** %0, i64 4
%28 = load i32*, i32** %27
%29 = tail call i32 @pipe(i32* %28)
%30 = icmp eq i32 %29, -1
br i1 %30, label %5, label %31
31: ; preds = %26
%32 = getelementptr inbounds i32*, i32** %0, i64 5
%33 = load i32*, i32** %32
%34 = tail call i32 @pipe(i32* %33)
%35 = icmp eq i32 %34, -1
br i1 %35, label %5, label %36
36: ; preds = %31
%37 = getelementptr inbounds i32*, i32** %0, i64 6
%38 = load i32*, i32** %37
%39 = tail call i32 @pipe(i32* %38)
%40 = icmp eq i32 %39, -1
br i1 %40, label %5, label %41
41: ; preds = %36
%42 = getelementptr inbounds i32*, i32** %0, i64 7
%43 = load i32*, i32** %42
%44 = tail call i32 @pipe(i32* %43)
%45 = icmp eq i32 %44, -1
br i1 %45, label %5, label %46
46: ; preds = %41
%47 = getelementptr inbounds i32*, i32** %0, i64 8
%48 = load i32*, i32** %47
%49 = tail call i32 @pipe(i32* %48)
%50 = icmp eq i32 %49, -1
br i1 %50, label %5, label %51
51: ; preds = %46
ret i32 0
}