#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*/ eclose(int);
void close_pipes(int sub_pipe[3][2]) {
  for (int i = 0; i < 3; i++)
    for (int j = 0; j < 2; j++)
      eclose(sub_pipe[i][j]);
}


x86 assembly (clang, -O0):
<close_pipes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x3,-0xc(%rbp)
jge    117a <close_pipes+0x6a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x2,-0x10(%rbp)
jge    1167 <close_pipes+0x57>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1030 <eclose@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <close_pipes+0x24>
jmp    116c <close_pipes+0x5c>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <close_pipes+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<close_pipes>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%edi
call   1030 <eclose@plt>
mov    0x4(%rbx),%edi
call   1030 <eclose@plt>
mov    0x8(%rbx),%edi
call   1030 <eclose@plt>
mov    0xc(%rbx),%edi
call   1030 <eclose@plt>
mov    0x10(%rbx),%edi
call   1030 <eclose@plt>
mov    0x14(%rbx),%edi
pop    %rbx
jmp    1030 <eclose@plt>

LLVM IR (-O0):
define void @close_pipes([2 x i32]* %0) {
%2 = alloca [2 x i32]*
%3 = alloca i32
%4 = alloca i32
store [2 x i32]* %0, [2 x i32]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %26, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %29
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %22, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 2
br i1 %11, label %12, label %25
12: ; preds = %9
%13 = load [2 x i32]*, [2 x i32]** %2
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [2 x i32], [2 x i32]* %13, i64 %15
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = call i32 @eclose(i32 %20)
br label %22
22: ; preds = %12
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 1
store i32 %24, i32* %4
br label %9
25: ; preds = %9
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %5
29: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @close_pipes([2 x i32]* nocapture %0) {
%2 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = tail call i32 @eclose(i32 %3)
%5 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @eclose(i32 %6)
%8 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 0
%9 = load i32, i32* %8
%10 = tail call i32 @eclose(i32 %9)
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 1, i64 1
%12 = load i32, i32* %11
%13 = tail call i32 @eclose(i32 %12)
%14 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 2, i64 0
%15 = load i32, i32* %14
%16 = tail call i32 @eclose(i32 %15)
%17 = getelementptr inbounds [2 x i32], [2 x i32]* %0, i64 2, i64 1
%18 = load i32, i32* %17
%19 = tail call i32 @eclose(i32 %18)
ret void
}