#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 check_access(char **, char **);
int pipe_fork(char **, char **, char **, char **);
int call_checker(char **s1, char **path, char **env, char **s2) {
  if ((check_access(s1, path)) == 1)
    return (-1);
  if ((check_access(s2, path)) == 1)
    return (-1);
  if ((pipe_fork(s1, s2, env, path)) == -1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<call_checker>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <check_access@plt>
cmp    $0x1,%eax
jne    115a <call_checker+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ad <call_checker+0x8d>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <check_access@plt>
cmp    $0x1,%eax
jne    117c <call_checker+0x5c>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ad <call_checker+0x8d>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <pipe_fork@plt>
cmp    $0xffffffff,%eax
jne    11a6 <call_checker+0x86>
movl   $0xffffffff,-0x4(%rbp)
jmp    11ad <call_checker+0x8d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_checker>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
call   1040 <check_access@plt>
mov    $0xffffffff,%ebp
cmp    $0x1,%eax
je     116f <call_checker+0x4f>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <check_access@plt>
cmp    $0x1,%eax
je     116f <call_checker+0x4f>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <pipe_fork@plt>
xor    %ebp,%ebp
cmp    $0xffffffff,%eax
sete   %bpl
neg    %ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @call_checker(i8** %0, i8** %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8**
store i8** %0, i8*** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
%10 = load i8**, i8*** %6
%11 = load i8**, i8*** %7
%12 = call i32 @check_access(i8** %10, i8** %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %15
14: ; preds = %4
store i32 -1, i32* %5
br label %30
15: ; preds = %4
%16 = load i8**, i8*** %9
%17 = load i8**, i8*** %7
%18 = call i32 @check_access(i8** %16, i8** %17)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 -1, i32* %5
br label %30
21: ; preds = %15
%22 = load i8**, i8*** %6
%23 = load i8**, i8*** %9
%24 = load i8**, i8*** %8
%25 = load i8**, i8*** %7
%26 = call i32 @pipe_fork(i8** %22, i8** %23, i8** %24, i8** %25)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %29
28: ; preds = %21
store i32 -1, i32* %5
br label %30
29: ; preds = %21
store i32 0, i32* %5
br label %30
30: ; preds = %29, %28, %20, %14
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
define i32 @call_checker(i8** %0, i8** %1, i8** %2, i8** %3) {
%5 = tail call i32 @check_access(i8** %0, i8** %1)
%6 = icmp eq i32 %5, 1
br i1 %6, label %14, label %7
7: ; preds = %4
%8 = tail call i32 @check_access(i8** %3, i8** %1)
%9 = icmp eq i32 %8, 1
br i1 %9, label %14, label %10
10: ; preds = %7
%11 = tail call i32 @pipe_fork(i8** %0, i8** %3, i8** %2, i8** %1)
%12 = icmp eq i32 %11, -1
%13 = sext i1 %12 to i32
br label %14
14: ; preds = %10, %7, %4
%15 = phi i32 [ -1, %4 ], [ -1, %7 ], [ %13, %10 ]
ret i32 %15
}