#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 */
char **boucle(char **, char **);
int creat_file(char **);
char **exec_redir(char **, char **);
int /*<<< orphan*/ exec_rm(char **);
int /*<<< orphan*/ free(char **);
char **malloc(int);
int d_arrow_left(char **s1, char **s2, char **env, int point) {
  char **tab3;
  char **tabl;
  (void)point;
  if ((tab3 = malloc(sizeof(char *) * 4096)) == NULL)
    return (0);
  if (s2 == NULL)
    return (0);
  tab3 = boucle(tab3, s2);
  if (tab3 == NULL)
    return (0);
  if (s1[0] == NULL)
    return (0);
  if (creat_file(tab3) == 1)
    return (0);
  tabl = exec_redir(env, s1);
  exec_rm(env);
  free(tab3);
  free(tabl);
  return (0);
}


x86 assembly (clang, -O0):
<d_arrow_left>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    $0x8000,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    119b <d_arrow_left+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    1245 <d_arrow_left+0xe5>
cmpq   $0x0,-0x18(%rbp)
jne    11b2 <d_arrow_left+0x52>
movl   $0x0,-0x4(%rbp)
jmp    1245 <d_arrow_left+0xe5>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <boucle@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
jne    11da <d_arrow_left+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    1245 <d_arrow_left+0xe5>
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11f4 <d_arrow_left+0x94>
movl   $0x0,-0x4(%rbp)
jmp    1245 <d_arrow_left+0xe5>
mov    -0x30(%rbp),%rdi
call   1050 <creat_file@plt>
cmp    $0x1,%eax
jne    1212 <d_arrow_left+0xb2>
movl   $0x0,-0x4(%rbp)
jmp    1245 <d_arrow_left+0xe5>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <exec_redir@plt>
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <exec_rm@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_arrow_left>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    $0x8000,%edi
call   1060 <malloc@plt>
test   %rbx,%rbx
je     11ce <d_arrow_left+0x6e>
test   %rax,%rax
je     11ce <d_arrow_left+0x6e>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <boucle@plt>
test   %rax,%rax
je     11ce <d_arrow_left+0x6e>
cmpq   $0x0,(%r15)
je     11ce <d_arrow_left+0x6e>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <creat_file@plt>
cmp    $0x1,%eax
je     11ce <d_arrow_left+0x6e>
mov    %r14,%rdi
mov    %r15,%rsi
call   1080 <exec_redir@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1070 <exec_rm@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @d_arrow_left(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 i8**
store i8** %0, i8*** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i32 %3, i32* %9
%12 = load i32, i32* %9
%13 = call i8** @malloc(i32 32768)
store i8** %13, i8*** %10
%14 = icmp eq i8** %13, null
br i1 %14, label %15, label %16
15: ; preds = %4
store i32 0, i32* %5
br label %48
16: ; preds = %4
%17 = load i8**, i8*** %7
%18 = icmp eq i8** %17, null
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 0, i32* %5
br label %48
20: ; preds = %16
%21 = load i8**, i8*** %10
%22 = load i8**, i8*** %7
%23 = call i8** @boucle(i8** %21, i8** %22)
store i8** %23, i8*** %10
%24 = load i8**, i8*** %10
%25 = icmp eq i8** %24, null
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 0, i32* %5
br label %48
27: ; preds = %20
%28 = load i8**, i8*** %6
%29 = getelementptr inbounds i8*, i8** %28, i64 0
%30 = load i8*, i8** %29
%31 = icmp eq i8* %30, null
br i1 %31, label %32, label %33
32: ; preds = %27
store i32 0, i32* %5
br label %48
33: ; preds = %27
%34 = load i8**, i8*** %10
%35 = call i32 @creat_file(i8** %34)
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %38
37: ; preds = %33
store i32 0, i32* %5
br label %48
38: ; preds = %33
%39 = load i8**, i8*** %8
%40 = load i8**, i8*** %6
%41 = call i8** @exec_redir(i8** %39, i8** %40)
store i8** %41, i8*** %11
%42 = load i8**, i8*** %8
%43 = call i32 @exec_rm(i8** %42)
%44 = load i8**, i8*** %10
%45 = call i32 @free(i8** %44)
%46 = load i8**, i8*** %11
%47 = call i32 @free(i8** %46)
store i32 0, i32* %5
br label %48
48: ; preds = %38, %37, %32, %26, %19, %15
%49 = load i32, i32* %5
ret i32 %49
}

LLVM IR (-O2):
define i32 @d_arrow_left(i8** %0, i8** %1, i8** %2, i32 %3) {
%5 = tail call i8** @malloc(i32 32768)
%6 = icmp eq i8** %5, null
%7 = icmp eq i8** %1, null
%8 = or i1 %7, %6
br i1 %8, label %23, label %9
9: ; preds = %4
%10 = tail call i8** @boucle(i8** %5, i8** %1)
%11 = icmp eq i8** %10, null
br i1 %11, label %23, label %12
12: ; preds = %9
%13 = load i8*, i8** %0
%14 = icmp eq i8* %13, null
br i1 %14, label %23, label %15
15: ; preds = %12
%16 = tail call i32 @creat_file(i8** %10)
%17 = icmp eq i32 %16, 1
br i1 %17, label %23, label %18
18: ; preds = %15
%19 = tail call i8** @exec_redir(i8** %2, i8** %0)
%20 = tail call i32 @exec_rm(i8** %2)
%21 = tail call i32 @free(i8** %10)
%22 = tail call i32 @free(i8** %19)
br label %23
23: ; preds = %15, %12, %9, %4, %18
ret i32 0
}