#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 */
struct stat {
  int /*<<< orphan*/ st_mode;
};
struct dirent {
  char const *d_name;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
scalar_t__ S_ISDIR(int /*<<< orphan*/);
scalar_t__ S_ISREG(int /*<<< orphan*/);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ cp_file(char *, char *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, char *,
                           char *);
int lstat(char *, struct stat *);
char *malloc(scalar_t__);
int /*<<< orphan*/ mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ *opendir(char const *);
struct dirent *readdir(int /*<<< orphan*/ *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, char const *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char *);
char *strerror(int /*<<< orphan*/);
scalar_t__ strlen(char const *);
void cp_dir(const char *src, const char *dest) {
  DIR *dp;
  struct dirent *entp;
  struct stat sbuf;
  if ((dp = opendir(src)) == NULL)
    do {
      fprintf(stderr, "[%s][%d]:%s %s\n",
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/drsin/linuxCoreLearn/refs/heads/"
              "master/apue/day03/mycp.c",
              56, "opendir", strerror(errno));
      exit(EXIT_FAILURE);
    } while (0);
  while ((entp = readdir(dp)) != NULL) {
    if (strcmp(entp->d_name, "..") == 0 || strcmp(entp->d_name, ".") == 0)
      continue;
    char *name_dest = malloc(strlen(dest) + 1 + strlen(entp->d_name) + 1);
    char *name_src = malloc(strlen(src) + 1 + strlen(entp->d_name) + 1);
    sprintf(name_dest, "%s/%s", dest, entp->d_name);
    sprintf(name_src, "%s/%s", src, entp->d_name);
    if (lstat(name_src, &sbuf) == -1)
      do {
        fprintf(stderr, "[%s][%d]:%s %s\n",
                "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/drsin/linuxCoreLearn/refs/"
                "heads/master/apue/day03/mycp.c",
                68, "lstat", strerror(errno));
        exit(EXIT_FAILURE);
      } while (0);
    if (S_ISREG(sbuf.st_mode)) {
      cp_file(name_src, name_dest, sbuf.st_mode);
    } else if (S_ISDIR(sbuf.st_mode)) {
      mkdir(name_dest, sbuf.st_mode);
      cp_dir(name_src, name_dest);
    }
  }
  closedir(dp);
}


x86 assembly (clang, -O0):
<cp_dir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <opendir@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1279 <cp_dir+0x79>
jmp    122c <cp_dir+0x2c>
mov    0x2dad(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    0x2d99(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x3c(%rbp),%edi
mov    %rax,%r9
lea    0xdad(%rip),%rsi
lea    0xdb6(%rip),%rdx
mov    $0x38,%ecx
lea    0xe3d(%rip),%r8
call   10a0 <fprintf@plt>
mov    0x2d5e(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
jmp    127e <cp_dir+0x7e>
mov    -0x18(%rbp),%rdi
call   10d0 <readdir@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1430 <cp_dir+0x230>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xe08(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     12cf <cp_dir+0xcf>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xdec(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    12d4 <cp_dir+0xd4>
jmp    127e <cp_dir+0x7e>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    -0x50(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1050 <strlen@plt>
mov    -0x48(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
call   10e0 <malloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
lea    0xd62(%rip),%rsi
call   1100 <sprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
lea    0xd47(%rip),%rsi
call   1100 <sprintf@plt>
mov    -0x38(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
jne    13d4 <cp_dir+0x1d4>
jmp    1387 <cp_dir+0x187>
mov    0x2c52(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
mov    -0x54(%rbp),%edi
mov    %rax,%r9
lea    0xc52(%rip),%rsi
lea    0xc5b(%rip),%rdx
mov    $0x44,%ecx
lea    0xcf3(%rip),%r8
call   10a0 <fprintf@plt>
mov    0x2c03(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    -0x28(%rbp),%edi
call   10c0 <S_ISREG@plt>
cmp    $0x0,%rax
je     13fb <cp_dir+0x1fb>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   10f0 <cp_file@plt>
jmp    142b <cp_dir+0x22b>
mov    -0x28(%rbp),%edi
call   1060 <S_ISDIR@plt>
cmp    $0x0,%rax
je     1426 <cp_dir+0x226>
mov    -0x30(%rbp),%rdi
mov    -0x28(%rbp),%esi
call   1030 <mkdir@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   10b0 <cp_dir@plt>
jmp    142b <cp_dir+0x22b>
jmp    127e <cp_dir+0x7e>
mov    -0x18(%rbp),%rdi
call   1070 <closedir@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cp_dir>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,0x18(%rsp)
mov    %rdi,0x20(%rsp)
call   1040 <opendir@plt>
test   %rax,%rax
je     13d3 <cp_dir+0x1d3>
mov    %rax,%r15
mov    %rax,%rdi
call   10d0 <readdir@plt>
test   %rax,%rax
je     1374 <cp_dir+0x174>
mov    %rax,%r13
lea    0xe67(%rip),%rbp
mov    %r15,0x10(%rsp)
jmp    127d <cp_dir+0x7d>
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   10f0 <cp_file@plt>
mov    0x10(%rsp),%r15
lea    0xe42(%rip),%rbp
mov    %r15,%rdi
call   10d0 <readdir@plt>
mov    %rax,%r13
test   %rax,%rax
je     1374 <cp_dir+0x174>
mov    0x0(%r13),%rdi
mov    %rbp,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1269 <cp_dir+0x69>
mov    0x0(%r13),%rdi
lea    0xe13(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1269 <cp_dir+0x69>
mov    0x18(%rsp),%rdi
call   1050 <strlen@plt>
mov    %rax,%rbx
mov    0x0(%r13),%r15
mov    %r15,%rdi
call   1050 <strlen@plt>
mov    %rax,%rbp
lea    (%rbx,%rax,1),%rdi
add    $0x2,%rdi
call   10e0 <malloc@plt>
mov    %rax,%r14
mov    0x20(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strlen@plt>
lea    (%rax,%rbp,1),%rdi
add    $0x2,%rdi
call   10e0 <malloc@plt>
mov    %rax,%r12
mov    %r14,%rdi
lea    0xdb8(%rip),%rbp
mov    %rbp,%rsi
mov    0x18(%rsp),%rdx
mov    %r15,%rcx
call   1100 <sprintf@plt>
mov    0x0(%r13),%rcx
mov    %r12,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1100 <sprintf@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
call   1080 <lstat@plt>
cmp    $0xffffffff,%eax
je     138a <cp_dir+0x18a>
mov    0x8(%rsp),%ebx
mov    %ebx,%edi
call   10c0 <S_ISREG@plt>
test   %rax,%rax
jne    1250 <cp_dir+0x50>
mov    %ebx,%edi
call   1060 <S_ISDIR@plt>
test   %rax,%rax
mov    0x10(%rsp),%r15
lea    0xd57(%rip),%rbp
je     1269 <cp_dir+0x69>
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <mkdir@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   10b0 <cp_dir@plt>
jmp    1269 <cp_dir+0x69>
mov    %r15,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <closedir@plt>
mov    0x2c4f(%rip),%rax
mov    (%rax),%ebx
mov    0x2c3e(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc58(%rip),%rsi
lea    0xc61(%rip),%rdx
lea    0xcfe(%rip),%r8
mov    %ebx,%edi
mov    $0x44,%ecx
mov    %rax,%r9
call   10a0 <fprintf@plt>
mov    0x2c04(%rip),%rax
mov    (%rax),%edi
call   1110 <exit@plt>
mov    0x2c06(%rip),%rax
mov    (%rax),%ebx
mov    0x2bf5(%rip),%rax
mov    (%rax),%edi
call   1120 <strerror@plt>
lea    0xc0f(%rip),%rsi
lea    0xc18(%rip),%rdx
lea    0xca4(%rip),%r8
mov    %ebx,%edi
mov    $0x38,%ecx
jmp    13bd <cp_dir+0x1bd>

LLVM IR (-O0):
%struct.dirent = type { i8* }
%struct.stat = type { i32 }
@stderr = global i32 0
@.str = [16 x i8] c"[%s][%d]:%s %s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/drsin/linuxCoreLearn/refs/heads/master/apue/day03/mycp.c\00"
@.str.2 = [8 x i8] c"opendir\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c".\00"
@.str.5 = [6 x i8] c"%s/%s\00"
@.str.6 = [6 x i8] c"lstat\00"
define void @cp_dir(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca %struct.dirent*
%7 = alloca %struct.stat
%8 = alloca i8*
%9 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%10 = load i8*, i8** %3
%11 = call i32* @opendir(i8* %10)
store i32* %11, i32** %5
%12 = icmp eq i32* %11, null
br i1 %12, label %13, label %22
13: ; preds = %2
br label %14
14: ; preds = %13
%15 = load i32, i32* @stderr
%16 = load i32, i32* @errno
%17 = call i8* @strerror(i32 %16)
%18 = call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %17)
%19 = load i32, i32* @EXIT_FAILURE
%20 = call i32 @exit(i32 %19)
unreachable
21: ; No predecessors!
br label %22
22: ; preds = %21, %2
br label %23
23: ; preds = %109, %39, %22
%24 = load i32*, i32** %5
%25 = call %struct.dirent* @readdir(i32* %24)
store %struct.dirent* %25, %struct.dirent** %6
%26 = icmp ne %struct.dirent* %25, null
br i1 %26, label %27, label %110
27: ; preds = %23
%28 = load %struct.dirent*, %struct.dirent** %6
%29 = getelementptr inbounds %struct.dirent, %struct.dirent* %28, i32 0, i32 0
%30 = load i8*, i8** %29
%31 = call i64 @strcmp(i8* %30, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %39, label %33
33: ; preds = %27
%34 = load %struct.dirent*, %struct.dirent** %6
%35 = getelementptr inbounds %struct.dirent, %struct.dirent* %34, i32 0, i32 0
%36 = load i8*, i8** %35
%37 = call i64 @strcmp(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %39, label %40
39: ; preds = %33, %27
br label %23
40: ; preds = %33
%41 = load i8*, i8** %4
%42 = call i64 @strlen(i8* %41)
%43 = add nsw i64 %42, 1
%44 = load %struct.dirent*, %struct.dirent** %6
%45 = getelementptr inbounds %struct.dirent, %struct.dirent* %44, i32 0, i32 0
%46 = load i8*, i8** %45
%47 = call i64 @strlen(i8* %46)
%48 = add nsw i64 %43, %47
%49 = add nsw i64 %48, 1
%50 = call i8* @malloc(i64 %49)
store i8* %50, i8** %8
%51 = load i8*, i8** %3
%52 = call i64 @strlen(i8* %51)
%53 = add nsw i64 %52, 1
%54 = load %struct.dirent*, %struct.dirent** %6
%55 = getelementptr inbounds %struct.dirent, %struct.dirent* %54, i32 0, i32 0
%56 = load i8*, i8** %55
%57 = call i64 @strlen(i8* %56)
%58 = add nsw i64 %53, %57
%59 = add nsw i64 %58, 1
%60 = call i8* @malloc(i64 %59)
store i8* %60, i8** %9
%61 = load i8*, i8** %8
%62 = load i8*, i8** %4
%63 = load %struct.dirent*, %struct.dirent** %6
%64 = getelementptr inbounds %struct.dirent, %struct.dirent* %63, i32 0, i32 0
%65 = load i8*, i8** %64
%66 = call i32 @sprintf(i8* %61, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %62, i8* %65)
%67 = load i8*, i8** %9
%68 = load i8*, i8** %3
%69 = load %struct.dirent*, %struct.dirent** %6
%70 = getelementptr inbounds %struct.dirent, %struct.dirent* %69, i32 0, i32 0
%71 = load i8*, i8** %70
%72 = call i32 @sprintf(i8* %67, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %68, i8* %71)
%73 = load i8*, i8** %9
%74 = call i32 @lstat(i8* %73, %struct.stat* %7)
%75 = icmp eq i32 %74, -1
br i1 %75, label %76, label %85
76: ; preds = %40
br label %77
77: ; preds = %76
%78 = load i32, i32* @stderr
%79 = load i32, i32* @errno
%80 = call i8* @strerror(i32 %79)
%81 = call i32 @fprintf(i32 %78, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %80)
%82 = load i32, i32* @EXIT_FAILURE
%83 = call i32 @exit(i32 %82)
unreachable
84: ; No predecessors!
br label %85
85: ; preds = %84, %40
%86 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%87 = load i32, i32* %86
%88 = call i64 @S_ISREG(i32 %87)
%89 = icmp ne i64 %88, 0
br i1 %89, label %90, label %96
90: ; preds = %85
%91 = load i8*, i8** %9
%92 = load i8*, i8** %8
%93 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%94 = load i32, i32* %93
%95 = call i32 @cp_file(i8* %91, i8* %92, i32 %94)
br label %109
96: ; preds = %85
%97 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%98 = load i32, i32* %97
%99 = call i64 @S_ISDIR(i32 %98)
%100 = icmp ne i64 %99, 0
br i1 %100, label %101, label %108
101: ; preds = %96
%102 = load i8*, i8** %8
%103 = getelementptr inbounds %struct.stat, %struct.stat* %7, i32 0, i32 0
%104 = load i32, i32* %103
%105 = call i32 @mkdir(i8* %102, i32 %104)
%106 = load i8*, i8** %9
%107 = load i8*, i8** %8
br label %108
108: ; preds = %101, %96
br label %109
109: ; preds = %108, %90
br label %23
110: ; preds = %23
%111 = load i32*, i32** %5
%112 = call i32 @closedir(i32* %111)
ret void
}

LLVM IR (-O2):
%struct.stat = type { i32 }
%struct.dirent = type { i8* }
@stderr = global i32 0
@.str = [16 x i8] c"[%s][%d]:%s %s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/drsin/linuxCoreLearn/refs/heads/master/apue/day03/mycp.c\00"
@.str.2 = [8 x i8] c"opendir\00"
@errno = global i32 0
@EXIT_FAILURE = global i32 0
@.str.3 = [3 x i8] c"..\00"
@.str.4 = [2 x i8] c".\00"
@.str.5 = [6 x i8] c"%s/%s\00"
@.str.6 = [6 x i8] c"lstat\00"
define void @cp_dir(i8* %0, i8* %1) {
%3 = alloca %struct.stat
%4 = bitcast %struct.stat* %3 to i8*
%5 = tail call i32* @opendir(i8* %0)
%6 = icmp eq i32* %5, null
br i1 %6, label %12, label %7
7: ; preds = %2
%8 = tail call %struct.dirent* @readdir(i32* %5)
%9 = icmp eq %struct.dirent* %8, null
br i1 %9, label %66, label %10
10: ; preds = %7
%11 = getelementptr inbounds %struct.stat, %struct.stat* %3, i64 0, i32 0
br label %19
12: ; preds = %2
%13 = load i32, i32* @stderr
%14 = load i32, i32* @errno
%15 = tail call i8* @strerror(i32 %14)
%16 = tail call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 56, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %15)
%17 = load i32, i32* @EXIT_FAILURE
%18 = tail call i32 @exit(i32 %17)
unreachable
19: ; preds = %10, %29
%20 = phi %struct.dirent* [ %8, %10 ], [ %30, %29 ]
%21 = getelementptr inbounds %struct.dirent, %struct.dirent* %20, i64 0, i32 0
%22 = load i8*, i8** %21
%23 = tail call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp eq i64 %23, 0
br i1 %24, label %29, label %25
25: ; preds = %19
%26 = load i8*, i8** %21
%27 = tail call i64 @strcmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp eq i64 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %59, %64, %61, %19, %25
%30 = tail call %struct.dirent* @readdir(i32* %5)
%31 = icmp eq %struct.dirent* %30, null
br i1 %31, label %66, label %19
32: ; preds = %25
%33 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%34 = load i8*, i8** %21
%35 = tail call i64 @strlen(i8* dereferenceable(1) %34)
%36 = add i64 %33, 2
%37 = add i64 %36, %35
%38 = tail call i8* @malloc(i64 %37)
%39 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%40 = add i64 %35, 2
%41 = add i64 %40, %39
%42 = tail call i8* @malloc(i64 %41)
%43 = tail call i32 @sprintf(i8* dereferenceable(1) %38, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %1, i8* %34)
%44 = load i8*, i8** %21
%45 = tail call i32 @sprintf(i8* dereferenceable(1) %42, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %0, i8* %44)
%46 = call i32 @lstat(i8* %42, %struct.stat* %3)
%47 = icmp eq i32 %46, -1
br i1 %47, label %48, label %55
48: ; preds = %32
%49 = load i32, i32* @stderr
%50 = load i32, i32* @errno
%51 = tail call i8* @strerror(i32 %50)
%52 = tail call i32 @fprintf(i32 %49, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0), i32 68, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i8* %51)
%53 = load i32, i32* @EXIT_FAILURE
%54 = tail call i32 @exit(i32 %53)
unreachable
55: ; preds = %32
%56 = load i32, i32* %11
%57 = tail call i64 @S_ISREG(i32 %56)
%58 = icmp eq i64 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %55
%60 = tail call i32 @cp_file(i8* %42, i8* %38, i32 %56)
br label %29
61: ; preds = %55
%62 = tail call i64 @S_ISDIR(i32 %56)
%63 = icmp eq i64 %62, 0
br i1 %63, label %29, label %64
64: ; preds = %61
%65 = tail call i32 @mkdir(i8* %38, i32 %56)
tail call void @cp_dir(i8* %42, i8* %38)
br label %29
66: ; preds = %29, %7
%67 = tail call i32 @closedir(i32* %5)
ret void
}