#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 close(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int pipes_pere_start_close(int **pipes) {
  int indice;
  if (close(pipes[0][1]) == -1) {
    fprintf(stderr, "Erreur lors de fermeture de pipes[0][1] \n");
  }
  for (indice = 1; indice < 5; indice++) {
    if (close(pipes[indice][0]) == -1) {
      fprintf(stderr, "Erreur lors de fermeture de pipes[%d][1] \n", indice);
    }
  }
  for (indice = 5; indice <= 8; indice++) {
    if (close(pipes[indice][1]) == -1) {
      fprintf(stderr, "Erreur lors de fermeture de pipes[%d][1] \n", indice);
    }
    if (close(pipes[indice][0]) == -1) {
      fprintf(stderr, "Erreur lors de fermeture de pipes[%d][0] \n", indice);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<pipes_pere_start_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    115b <pipes_pere_start_close+0x3b>
mov    0x2e95(%rip),%rax
mov    (%rax),%edi
lea    0xeac(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    11b5 <pipes_pere_start_close+0x95>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    11a2 <pipes_pere_start_close+0x82>
mov    0x2e51(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe8f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    11a7 <pipes_pere_start_close+0x87>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1162 <pipes_pere_start_close+0x42>
movl   $0x5,-0xc(%rbp)
cmpl   $0x8,-0xc(%rbp)
jg     1246 <pipes_pere_start_close+0x126>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    11fd <pipes_pere_start_close+0xdd>
mov    0x2df6(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe34(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1233 <pipes_pere_start_close+0x113>
mov    0x2dc0(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe29(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1238 <pipes_pere_start_close+0x118>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11bc <pipes_pere_start_close+0x9c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipes_pere_start_close>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    114b <pipes_pere_start_close+0x2b>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x8(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1177 <pipes_pere_start_close+0x57>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x10(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    11a3 <pipes_pere_start_close+0x83>
mov    0x2e52(%rip),%rax
mov    (%rax),%edi
lea    0xe93(%rip),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x18(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    11cf <pipes_pere_start_close+0xaf>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
lea    0xe67(%rip),%rsi
mov    $0x3,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x20(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    11fb <pipes_pere_start_close+0xdb>
mov    0x2dfa(%rip),%rax
mov    (%rax),%edi
lea    0xe3b(%rip),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x28(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1228 <pipes_pere_start_close+0x108>
mov    0x2dcd(%rip),%rax
mov    (%rax),%edi
lea    0xe0e(%rip),%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x28(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1254 <pipes_pere_start_close+0x134>
mov    0x2da1(%rip),%rax
mov    (%rax),%edi
lea    0xe0d(%rip),%rsi
mov    $0x5,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x30(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1281 <pipes_pere_start_close+0x161>
mov    0x2d74(%rip),%rax
mov    (%rax),%edi
lea    0xdb5(%rip),%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x30(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    12ad <pipes_pere_start_close+0x18d>
mov    0x2d48(%rip),%rax
mov    (%rax),%edi
lea    0xdb4(%rip),%rsi
mov    $0x6,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x38(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    12da <pipes_pere_start_close+0x1ba>
mov    0x2d1b(%rip),%rax
mov    (%rax),%edi
lea    0xd5c(%rip),%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x38(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1306 <pipes_pere_start_close+0x1e6>
mov    0x2cef(%rip),%rax
mov    (%rax),%edi
lea    0xd5b(%rip),%rsi
mov    $0x7,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x40(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1333 <pipes_pere_start_close+0x213>
mov    0x2cc2(%rip),%rax
mov    (%rax),%edi
lea    0xd03(%rip),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x40(%rbx),%rax
mov    (%rax),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    135f <pipes_pere_start_close+0x23f>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
lea    0xd02(%rip),%rsi
mov    $0x8,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [42 x i8] c"Erreur lors de fermeture de pipes[0][1] \0A\00"
@.str.1 = [43 x i8] c"Erreur lors de fermeture de pipes[%d][1] \0A\00"
@.str.2 = [43 x i8] c"Erreur lors de fermeture de pipes[%d][0] \0A\00"
define i32 @pipes_pere_start_close(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
store i32** %0, i32*** %2
%4 = load i32**, i32*** %2
%5 = getelementptr inbounds i32*, i32** %4, i64 0
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = call i32 @close(i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* @stderr
%13 = call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %1
store i32 1, i32* %3
br label %15
15: ; preds = %33, %14
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 5
br i1 %17, label %18, label %36
18: ; preds = %15
%19 = load i32**, i32*** %2
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32*, i32** %19, i64 %21
%23 = load i32*, i32** %22
%24 = getelementptr inbounds i32, i32* %23, i64 0
%25 = load i32, i32* %24
%26 = call i32 @close(i32 %25)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %32
28: ; preds = %18
%29 = load i32, i32* @stderr
%30 = load i32, i32* %3
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %32
32: ; preds = %28, %18
br label %33
33: ; preds = %32
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %15
36: ; preds = %15
store i32 5, i32* %3
br label %37
37: ; preds = %69, %36
%38 = load i32, i32* %3
%39 = icmp sle i32 %38, 8
br i1 %39, label %40, label %72
40: ; preds = %37
%41 = load i32**, i32*** %2
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds i32*, i32** %41, i64 %43
%45 = load i32*, i32** %44
%46 = getelementptr inbounds i32, i32* %45, i64 1
%47 = load i32, i32* %46
%48 = call i32 @close(i32 %47)
%49 = icmp eq i32 %48, -1
br i1 %49, label %50, label %54
50: ; preds = %40
%51 = load i32, i32* @stderr
%52 = load i32, i32* %3
%53 = call i32 (i32, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %52)
br label %54
54: ; preds = %50, %40
%55 = load i32**, i32*** %2
%56 = load i32, i32* %3
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i32*, i32** %55, i64 %57
%59 = load i32*, i32** %58
%60 = getelementptr inbounds i32, i32* %59, i64 0
%61 = load i32, i32* %60
%62 = call i32 @close(i32 %61)
%63 = icmp eq i32 %62, -1
br i1 %63, label %64, label %68
64: ; preds = %54
%65 = load i32, i32* @stderr
%66 = load i32, i32* %3
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %66)
br label %68
68: ; preds = %64, %54
br label %69
69: ; preds = %68
%70 = load i32, i32* %3
%71 = add nsw i32 %70, 1
store i32 %71, i32* %3
br label %37
72: ; preds = %37
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [42 x i8] c"Erreur lors de fermeture de pipes[0][1] \0A\00"
@.str.1 = [43 x i8] c"Erreur lors de fermeture de pipes[%d][1] \0A\00"
@.str.2 = [43 x i8] c"Erreur lors de fermeture de pipes[%d][0] \0A\00"
define i32 @pipes_pere_start_close(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = getelementptr inbounds i32, i32* %2, i64 1
%4 = load i32, i32* %3
%5 = tail call i32 @close(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %8, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %7, %1
%11 = getelementptr inbounds i32*, i32** %0, i64 1
%12 = load i32*, i32** %11
%13 = load i32, i32* %12
%14 = tail call i32 @close(i32 %13)
%15 = icmp eq i32 %14, -1
br i1 %15, label %16, label %19
16: ; preds = %10
%17 = load i32, i32* @stderr
%18 = tail call i32 (i32, i8*, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %19
19: ; preds = %10, %16
%20 = getelementptr inbounds i32*, i32** %0, i64 2
%21 = load i32*, i32** %20
%22 = load i32, i32* %21
%23 = tail call i32 @close(i32 %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %28
25: ; preds = %19
%26 = load i32, i32* @stderr
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 2)
br label %28
28: ; preds = %25, %19
%29 = getelementptr inbounds i32*, i32** %0, i64 3
%30 = load i32*, i32** %29
%31 = load i32, i32* %30
%32 = tail call i32 @close(i32 %31)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = load i32, i32* @stderr
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %35, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 3)
br label %37
37: ; preds = %34, %28
%38 = getelementptr inbounds i32*, i32** %0, i64 4
%39 = load i32*, i32** %38
%40 = load i32, i32* %39
%41 = tail call i32 @close(i32 %40)
%42 = icmp eq i32 %41, -1
br i1 %42, label %43, label %46
43: ; preds = %37
%44 = load i32, i32* @stderr
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 4)
br label %46
46: ; preds = %43, %37
%47 = getelementptr inbounds i32*, i32** %0, i64 5
%48 = load i32*, i32** %47
%49 = getelementptr inbounds i32, i32* %48, i64 1
%50 = load i32, i32* %49
%51 = tail call i32 @close(i32 %50)
%52 = icmp eq i32 %51, -1
br i1 %52, label %53, label %56
53: ; preds = %46
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 5)
br label %56
56: ; preds = %53, %46
%57 = load i32*, i32** %47
%58 = load i32, i32* %57
%59 = tail call i32 @close(i32 %58)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %56
%62 = load i32, i32* @stderr
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 5)
br label %64
64: ; preds = %56, %61
%65 = getelementptr inbounds i32*, i32** %0, i64 6
%66 = load i32*, i32** %65
%67 = getelementptr inbounds i32, i32* %66, i64 1
%68 = load i32, i32* %67
%69 = tail call i32 @close(i32 %68)
%70 = icmp eq i32 %69, -1
br i1 %70, label %71, label %74
71: ; preds = %64
%72 = load i32, i32* @stderr
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 6)
br label %74
74: ; preds = %71, %64
%75 = load i32*, i32** %65
%76 = load i32, i32* %75
%77 = tail call i32 @close(i32 %76)
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = load i32, i32* @stderr
%81 = tail call i32 (i32, i8*, ...) @fprintf(i32 %80, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 6)
br label %82
82: ; preds = %79, %74
%83 = getelementptr inbounds i32*, i32** %0, i64 7
%84 = load i32*, i32** %83
%85 = getelementptr inbounds i32, i32* %84, i64 1
%86 = load i32, i32* %85
%87 = tail call i32 @close(i32 %86)
%88 = icmp eq i32 %87, -1
br i1 %88, label %89, label %92
89: ; preds = %82
%90 = load i32, i32* @stderr
%91 = tail call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 7)
br label %92
92: ; preds = %89, %82
%93 = load i32*, i32** %83
%94 = load i32, i32* %93
%95 = tail call i32 @close(i32 %94)
%96 = icmp eq i32 %95, -1
br i1 %96, label %97, label %100
97: ; preds = %92
%98 = load i32, i32* @stderr
%99 = tail call i32 (i32, i8*, ...) @fprintf(i32 %98, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 7)
br label %100
100: ; preds = %97, %92
%101 = getelementptr inbounds i32*, i32** %0, i64 8
%102 = load i32*, i32** %101
%103 = getelementptr inbounds i32, i32* %102, i64 1
%104 = load i32, i32* %103
%105 = tail call i32 @close(i32 %104)
%106 = icmp eq i32 %105, -1
br i1 %106, label %107, label %110
107: ; preds = %100
%108 = load i32, i32* @stderr
%109 = tail call i32 (i32, i8*, ...) @fprintf(i32 %108, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 8)
br label %110
110: ; preds = %107, %100
%111 = load i32*, i32** %101
%112 = load i32, i32* %111
%113 = tail call i32 @close(i32 %112)
%114 = icmp eq i32 %113, -1
br i1 %114, label %115, label %118
115: ; preds = %110
%116 = load i32, i32* @stderr
%117 = tail call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 8)
br label %118
118: ; preds = %115, %110
ret i32 0
}