#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*/ close(int);
int pipes_pere_end_close(int **pipes) {
  int indice;
  close(pipes[0][0]);
  for (indice = 1; indice < 5; indice++) {
    close(pipes[indice][1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<pipes_pere_end_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%edi
call   1030 <close@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    115d <pipes_pere_end_close+0x4d>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <pipes_pere_end_close+0x21>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pipes_pere_end_close>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rax
mov    (%rax),%edi
call   1030 <close@plt>
mov    0x8(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
mov    0x10(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
mov    0x18(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
mov    0x20(%rbx),%rax
mov    0x4(%rax),%edi
call   1030 <close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @pipes_pere_end_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 0
%8 = load i32, i32* %7
%9 = call i32 @close(i32 %8)
store i32 1, i32* %3
br label %10
10: ; preds = %22, %1
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 5
br i1 %12, label %13, label %25
13: ; preds = %10
%14 = load i32**, i32*** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32*, i32** %14, i64 %16
%18 = load i32*, i32** %17
%19 = getelementptr inbounds i32, i32* %18, i64 1
%20 = load i32, i32* %19
%21 = call i32 @close(i32 %20)
br label %22
22: ; preds = %13
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
br label %10
25: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
define i32 @pipes_pere_end_close(i32** nocapture %0) {
%2 = load i32*, i32** %0
%3 = load i32, i32* %2
%4 = tail call i32 @close(i32 %3)
%5 = getelementptr inbounds i32*, i32** %0, i64 1
%6 = load i32*, i32** %5
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = tail call i32 @close(i32 %8)
%10 = getelementptr inbounds i32*, i32** %0, i64 2
%11 = load i32*, i32** %10
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = tail call i32 @close(i32 %13)
%15 = getelementptr inbounds i32*, i32** %0, i64 3
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = tail call i32 @close(i32 %18)
%20 = getelementptr inbounds i32*, i32** %0, i64 4
%21 = load i32*, i32** %20
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = tail call i32 @close(i32 %23)
ret i32 0
}