#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 my_exec(char **, char *, char **);
int /*<<< orphan*/ my_putstr(char *);
int separator_or(char **s1, char **s2, char **env, int point) {
  if (s2 == NULL) {
    my_exec(env, s1[0], s1);
    return (0);
  }
  if (point == 1)
    return (0);
  else {
    if ((my_exec(env, s1[0], s1) == 0))
      return (1);
    else {
      my_putstr("42sh : Command not found\n");
      if ((my_exec(env, s2[0], s2)) == 1) {
        my_putstr("42sh : Command not found\n");
        return (1);
      }
    }
  }
  return (5);
}


x86 assembly (clang, -O0):
<separator_or>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1162 <separator_or+0x42>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <my_exec@plt>
movl   $0x0,-0x4(%rbp)
jmp    11f3 <separator_or+0xd3>
cmpl   $0x1,-0x24(%rbp)
jne    1178 <separator_or+0x58>
movl   $0x0,-0x4(%rbp)
jmp    11f3 <separator_or+0xd3>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <my_exec@plt>
cmp    $0x0,%eax
jne    11a1 <separator_or+0x81>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <separator_or+0xd3>
lea    0xe58(%rip),%rdi
call   1040 <my_putstr@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <my_exec@plt>
cmp    $0x1,%eax
jne    11e2 <separator_or+0xc2>
lea    0xe2f(%rip),%rdi
call   1040 <my_putstr@plt>
movl   $0x1,-0x4(%rbp)
jmp    11f3 <separator_or+0xd3>
jmp    11e7 <separator_or+0xc7>
jmp    11ec <separator_or+0xcc>
movl   $0x5,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separator_or>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rdx
test   %rsi,%rsi
je     1188 <separator_or+0x68>
xor    %eax,%eax
cmp    $0x1,%ecx
je     1195 <separator_or+0x75>
mov    %rsi,%rbx
mov    (%rdx),%rsi
mov    %r14,%rdi
call   1030 <my_exec@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
je     1195 <separator_or+0x75>
lea    0xeaa(%rip),%rdi
call   1040 <my_putstr@plt>
mov    (%rbx),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <my_exec@plt>
mov    %eax,%ecx
mov    $0x5,%eax
cmp    $0x1,%ecx
jne    1195 <separator_or+0x75>
lea    0xe84(%rip),%rdi
call   1040 <my_putstr@plt>
mov    $0x1,%eax
jmp    1195 <separator_or+0x75>
mov    (%rdx),%rsi
mov    %r14,%rdi
call   1030 <my_exec@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [26 x i8] c"42sh : Command not found\0A\00"
define i32 @separator_or(i8** %0, i8** %1, i8** %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
store i8** %0, i8*** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
%10 = load i8**, i8*** %7
%11 = icmp eq i8** %10, null
br i1 %11, label %12, label %19
12: ; preds = %4
%13 = load i8**, i8*** %8
%14 = load i8**, i8*** %6
%15 = getelementptr inbounds i8*, i8** %14, i64 0
%16 = load i8*, i8** %15
%17 = load i8**, i8*** %6
%18 = call i32 @my_exec(i8** %13, i8* %16, i8** %17)
store i32 0, i32* %5
br label %46
19: ; preds = %4
%20 = load i32, i32* %9
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %23
22: ; preds = %19
store i32 0, i32* %5
br label %46
23: ; preds = %19
%24 = load i8**, i8*** %8
%25 = load i8**, i8*** %6
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = load i8**, i8*** %6
%29 = call i32 @my_exec(i8** %24, i8* %27, i8** %28)
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %32
31: ; preds = %23
store i32 1, i32* %5
br label %46
32: ; preds = %23
%33 = call i32 @my_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%34 = load i8**, i8*** %8
%35 = load i8**, i8*** %7
%36 = getelementptr inbounds i8*, i8** %35, i64 0
%37 = load i8*, i8** %36
%38 = load i8**, i8*** %7
%39 = call i32 @my_exec(i8** %34, i8* %37, i8** %38)
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %43
41: ; preds = %32
%42 = call i32 @my_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %5
br label %46
43: ; preds = %32
br label %44
44: ; preds = %43
br label %45
45: ; preds = %44
store i32 5, i32* %5
br label %46
46: ; preds = %45, %41, %31, %22, %12
%47 = load i32, i32* %5
ret i32 %47
}

LLVM IR (-O2):
@.str = [26 x i8] c"42sh : Command not found\0A\00"
define i32 @separator_or(i8** %0, i8** %1, i8** %2, i32 %3) {
%5 = icmp eq i8** %1, null
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = load i8*, i8** %0
%8 = tail call i32 @my_exec(i8** %2, i8* %7, i8** %0)
br label %22
9: ; preds = %4
%10 = icmp eq i32 %3, 1
br i1 %10, label %22, label %11
11: ; preds = %9
%12 = load i8*, i8** %0
%13 = tail call i32 @my_exec(i8** %2, i8* %12, i8** %0)
%14 = icmp eq i32 %13, 0
br i1 %14, label %22, label %15
15: ; preds = %11
%16 = tail call i32 @my_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%17 = load i8*, i8** %1
%18 = tail call i32 @my_exec(i8** %2, i8* %17, i8** %1)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %22
20: ; preds = %15
%21 = tail call i32 @my_putstr(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %15, %11, %9, %20, %6
%23 = phi i32 [ 0, %6 ], [ 1, %20 ], [ 0, %9 ], [ 1, %11 ], [ 5, %15 ]
ret i32 %23
}