#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 System(char *);
int /*<<< orphan*/ q_internal(char *, char *, int);
char *s_cat2(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ s_internal(char *, char *, char *, int);
int delete_directory(char *pathspec, int recursive) {
  char *cmd =
      s_cat2((q_internal(recursive ? "rm -rf " : "rmdir ",
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/roswell/"
                         "roswell/refs/heads/master/src/util-dir.c",
                         63)),
             (q_internal(pathspec,
                         "/scratch/repos/new/home/jordi_armengol_estape/"
                         "c-scraper/outputs/2022-01-22/02-19-57/repos/roswell/"
                         "roswell/refs/heads/master/src/util-dir.c",
                         63)));
  int ret = System(cmd);
  (s_internal(cmd, "cmd",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/roswell/roswell/refs/heads/master/src/"
              "util-dir.c",
              65));
  return ret == 0;
}


x86 assembly (clang, -O0):
<delete_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
lea    0xeaf(%rip),%rdi
lea    0xea0(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
lea    0xea1(%rip),%rsi
mov    $0x3f,%edx
call   1060 <q_internal@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe89(%rip),%rsi
mov    $0x3f,%edx
call   1060 <q_internal@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1040 <s_cat2@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <System@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xee5(%rip),%rsi
lea    0xe53(%rip),%rdx
mov    $0x41,%ecx
call   1030 <s_internal@plt>
cmpl   $0x0,-0x1c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_directory>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
test   %esi,%esi
lea    0xeb8(%rip),%rax
lea    0xea9(%rip),%rdi
cmove  %rax,%rdi
lea    0xead(%rip),%r14
mov    %r14,%rsi
mov    $0x3f,%edx
call   1060 <q_internal@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3f,%edx
call   1060 <q_internal@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <s_cat2@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1050 <System@plt>
mov    %eax,%ebp
lea    0xefc(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
mov    $0x41,%ecx
call   1030 <s_internal@plt>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"rm -rf \00"
@.str.1 = [7 x i8] c"rmdir \00"
@.str.2 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/roswell/roswell/refs/heads/master/src/util-dir.c\00"
@.str.3 = [4 x i8] c"cmd\00"
define i32 @delete_directory(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0)
%11 = call i32 @q_internal(i8* %10, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 63)
%12 = load i8*, i8** %3
%13 = call i32 @q_internal(i8* %12, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 63)
%14 = call i8* @s_cat2(i32 %11, i32 %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = call i32 @System(i8* %15)
store i32 %16, i32* %6
%17 = load i8*, i8** %5
%18 = call i32 @s_internal(i8* %17, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 65)
%19 = load i32, i32* %6
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
@.str = [8 x i8] c"rm -rf \00"
@.str.1 = [7 x i8] c"rmdir \00"
@.str.2 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/roswell/roswell/refs/heads/master/src/util-dir.c\00"
@.str.3 = [4 x i8] c"cmd\00"
define i32 @delete_directory(i8* %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0)
%5 = tail call i32 @q_internal(i8* %4, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 63)
%6 = tail call i32 @q_internal(i8* %0, i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 63)
%7 = tail call i8* @s_cat2(i32 %5, i32 %6)
%8 = tail call i32 @System(i8* %7)
%9 = tail call i32 @s_internal(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 65)
%10 = icmp eq i32 %8, 0
%11 = zext i1 %10 to i32
ret i32 %11
}