#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 call_checker(char **, char **, char **, char **);
int check_built(char **);
char **check_path(char **);
int checker(char **, char **);
int /*<<< orphan*/ my_exec(char **, char *, char **);
int separator_pipe(char **s1, char **s2, char **env, int point) {
  char **path;
  int a;
  a = 0;
  (void)point;
  if ((s1 == NULL || s2 == NULL))
    return (-1);
  path = check_path(env);
  if ((check_built(s1)) == 1) {
    my_exec(env, s2[0], s2);
    return (0);
  }
  if ((check_built(s2)) == 1) {
    if ((a = checker(s2, env)) == -2)
      return (-2);
    else if (a == 1)
      return (1);
  }
  if ((call_checker(s1, path, env, s2)) == -1)
    return (-1);
  return (0);
}


x86 assembly (clang, -O0):
<separator_pipe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
movl   $0x0,-0x34(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1184 <separator_pipe+0x34>
cmpq   $0x0,-0x18(%rbp)
jne    1190 <separator_pipe+0x40>
movl   $0xffffffff,-0x4(%rbp)
jmp    1257 <separator_pipe+0x107>
mov    -0x20(%rbp),%rdi
call   1060 <check_path@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <check_built@plt>
cmp    $0x1,%eax
jne    11cf <separator_pipe+0x7f>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
call   1040 <my_exec@plt>
movl   $0x0,-0x4(%rbp)
jmp    1257 <separator_pipe+0x107>
mov    -0x18(%rbp),%rdi
call   1030 <check_built@plt>
cmp    $0x1,%eax
jne    1226 <separator_pipe+0xd6>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <checker@plt>
mov    %eax,-0x34(%rbp)
cmp    $0xfffffffe,%eax
jne    1206 <separator_pipe+0xb6>
movl   $0xfffffffe,-0x4(%rbp)
jmp    1257 <separator_pipe+0x107>
cmpl   $0x1,-0x34(%rbp)
jne    121c <separator_pipe+0xcc>
movl   $0x1,-0x4(%rbp)
jmp    1257 <separator_pipe+0x107>
jmp    1221 <separator_pipe+0xd1>
jmp    1226 <separator_pipe+0xd6>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1070 <call_checker@plt>
cmp    $0xffffffff,%eax
jne    1250 <separator_pipe+0x100>
movl   $0xffffffff,-0x4(%rbp)
jmp    1257 <separator_pipe+0x107>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separator_pipe>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    $0xffffffff,%eax
test   %rdi,%rdi
je     11e0 <separator_pipe+0x90>
mov    %rsi,%r15
test   %rsi,%rsi
je     11e0 <separator_pipe+0x90>
mov    %rdx,%r14
mov    %rdi,%rbx
mov    %rdx,%rdi
call   1060 <check_path@plt>
mov    %rax,%r12
mov    %rbx,%rdi
call   1030 <check_built@plt>
cmp    $0x1,%eax
jne    119a <separator_pipe+0x4a>
mov    (%r15),%rsi
mov    %r14,%rdi
mov    %r15,%rdx
call   1040 <my_exec@plt>
xor    %eax,%eax
jmp    11e0 <separator_pipe+0x90>
mov    %r15,%rdi
call   1030 <check_built@plt>
cmp    $0x1,%eax
jne    11c3 <separator_pipe+0x73>
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <checker@plt>
cmp    $0xfffffffe,%eax
je     11e0 <separator_pipe+0x90>
cmp    $0x1,%eax
jne    11c3 <separator_pipe+0x73>
mov    $0x1,%eax
jmp    11e0 <separator_pipe+0x90>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1070 <call_checker@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
sete   %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @separator_pipe(i8** %0, i8** %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
%10 = alloca i8**
%11 = alloca i32
store i8** %0, i8*** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
store i32 0, i32* %11
%12 = load i32, i32* %9
%13 = load i8**, i8*** %6
%14 = icmp eq i8** %13, null
br i1 %14, label %18, label %15
15: ; preds = %4
%16 = load i8**, i8*** %7
%17 = icmp eq i8** %16, null
br i1 %17, label %18, label %19
18: ; preds = %15, %4
store i32 -1, i32* %5
br label %57
19: ; preds = %15
%20 = load i8**, i8*** %8
%21 = call i8** @check_path(i8** %20)
store i8** %21, i8*** %10
%22 = load i8**, i8*** %6
%23 = call i32 @check_built(i8** %22)
%24 = icmp eq i32 %23, 1
br i1 %24, label %25, label %32
25: ; preds = %19
%26 = load i8**, i8*** %8
%27 = load i8**, i8*** %7
%28 = getelementptr inbounds i8*, i8** %27, i64 0
%29 = load i8*, i8** %28
%30 = load i8**, i8*** %7
%31 = call i32 @my_exec(i8** %26, i8* %29, i8** %30)
store i32 0, i32* %5
br label %57
32: ; preds = %19
%33 = load i8**, i8*** %7
%34 = call i32 @check_built(i8** %33)
%35 = icmp eq i32 %34, 1
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = load i8**, i8*** %7
%38 = load i8**, i8*** %8
%39 = call i32 @checker(i8** %37, i8** %38)
store i32 %39, i32* %11
%40 = icmp eq i32 %39, -2
br i1 %40, label %41, label %42
41: ; preds = %36
store i32 -2, i32* %5
br label %57
42: ; preds = %36
%43 = load i32, i32* %11
%44 = icmp eq i32 %43, 1
br i1 %44, label %45, label %46
45: ; preds = %42
store i32 1, i32* %5
br label %57
46: ; preds = %42
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47, %32
%49 = load i8**, i8*** %6
%50 = load i8**, i8*** %10
%51 = load i8**, i8*** %8
%52 = load i8**, i8*** %7
%53 = call i32 @call_checker(i8** %49, i8** %50, i8** %51, i8** %52)
%54 = icmp eq i32 %53, -1
br i1 %54, label %55, label %56
55: ; preds = %48
store i32 -1, i32* %5
br label %57
56: ; preds = %48
store i32 0, i32* %5
br label %57
57: ; preds = %56, %55, %45, %41, %25, %18
%58 = load i32, i32* %5
ret i32 %58
}

LLVM IR (-O2):
define i32 @separator_pipe(i8** %0, i8** %1, i8** %2, i32 %3) {
%5 = icmp eq i8** %0, null
%6 = icmp eq i8** %1, null
%7 = or i1 %5, %6
br i1 %7, label %25, label %8
8: ; preds = %4
%9 = tail call i8** @check_path(i8** %2)
%10 = tail call i32 @check_built(i8** %0)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i8*, i8** %1
%14 = tail call i32 @my_exec(i8** %2, i8* %13, i8** %1)
br label %25
15: ; preds = %8
%16 = tail call i32 @check_built(i8** %1)
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %15
%19 = tail call i32 @checker(i8** %1, i8** %2)
switch i32 %19, label %21 [
i32 -2, label %25
i32 1, label %20
]
20: ; preds = %18
br label %25
21: ; preds = %18, %15
%22 = tail call i32 @call_checker(i8** %0, i8** %9, i8** %2, i8** %1)
%23 = icmp eq i32 %22, -1
%24 = sext i1 %23 to i32
br label %25
25: ; preds = %21, %18, %4, %20, %12
%26 = phi i32 [ 0, %12 ], [ 1, %20 ], [ -1, %4 ], [ %19, %18 ], [ %24, %21 ]
ret i32 %26
}