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

/* Variables and functions */
scalar_t__ ChangeFile_modtime(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ Getmodtime(char *, int);
int USB_mkdir(char *, int);
int /*<<< orphan*/ USB_rm(char *, int);
int USB_upload(char *, int);
int /*<<< orphan*/ closedir(int /*<<< orphan*/ *);
int /*<<< orphan*/ free(char *);
char *localpath_to_serverpath(char *, int);
char *my_malloc(scalar_t__);
int /*<<< orphan*/ *opendir(char *);
struct dirent *readdir(int /*<<< orphan*/ *);
int socket_check(char *, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
scalar_t__ strlen(char *);
int test_if_dir(char *);
int moveFolder(char *old_dir, char *new_dir, int index) {
  USB_rm(old_dir, index);
  int status;
  struct dirent *ent = NULL;
  DIR *pDir;
  pDir = opendir(new_dir);
  if (pDir != NULL) {
    status = USB_mkdir(new_dir, index);
    if (status == 0) {
      while ((ent = readdir(pDir)) != NULL) {
        if (!strcmp(ent->d_name, ".") || !strcmp(ent->d_name, ".."))
          continue;
        char *old_fullname =
            my_malloc(strlen(old_dir) + strlen(ent->d_name) + 2);
        if (old_fullname == NULL)
          return -1;
        char *new_fullname =
            my_malloc(strlen(new_dir) + strlen(ent->d_name) + 2);
        if (new_fullname == NULL)
          return -1;
        sprintf(new_fullname, "%s/%s", new_dir, ent->d_name);
        sprintf(old_fullname, "%s/%s", old_dir, ent->d_name);
        if (socket_check(new_dir, ent->d_name, index) == 1)
          continue;
        if (test_if_dir(new_fullname) == 1) {
          status = moveFolder(old_fullname, new_fullname, index);
        } else {
          status = USB_upload(new_fullname, index);
          if (status == 0) {
            char *serverpath = localpath_to_serverpath(new_fullname, index);
            time_t modtime = Getmodtime(serverpath, index);
            free(serverpath);
            if (ChangeFile_modtime(new_fullname, modtime, index)) {
            }
          }
        }
        free(new_fullname);
        free(old_fullname);
      }
    }
    closedir(pDir);
    return status;
  } else {
    return 902;
  }
}


x86 assembly (clang, -O0):
<moveFolder>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10f0 <USB_rm@plt>
movq   $0x0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <opendir@plt>
mov    %rax,-0x30(%rbp)
cmpq   $0x0,-0x30(%rbp)
je     1463 <moveFolder+0x253>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <USB_mkdir@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    144f <moveFolder+0x23f>
jmp    126d <moveFolder+0x5d>
mov    -0x30(%rbp),%rdi
call   10c0 <readdir@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
je     144a <moveFolder+0x23a>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xd6f(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
je     12bc <moveFolder+0xac>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xd52(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%eax
jne    12c1 <moveFolder+0xb1>
jmp    126d <moveFolder+0x5d>
mov    -0x10(%rbp),%rdi
call   1080 <strlen@plt>
mov    %rax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1080 <strlen@plt>
mov    -0x58(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1040 <my_malloc@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
jne    1305 <moveFolder+0xf5>
movl   $0xffffffff,-0x4(%rbp)
jmp    146a <moveFolder+0x25a>
mov    -0x18(%rbp),%rdi
call   1080 <strlen@plt>
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
call   1080 <strlen@plt>
mov    -0x60(%rbp),%rdi
add    %rax,%rdi
add    $0x2,%rdi
call   1040 <my_malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    1349 <moveFolder+0x139>
movl   $0xffffffff,-0x4(%rbp)
jmp    146a <moveFolder+0x25a>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
lea    0xca4(%rip),%rsi
call   1120 <sprintf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
lea    0xc89(%rip),%rsi
call   1120 <sprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rax
mov    (%rax),%rsi
mov    -0x1c(%rbp),%edx
call   1060 <socket_check@plt>
cmp    $0x1,%eax
jne    13a0 <moveFolder+0x190>
jmp    126d <moveFolder+0x5d>
mov    -0x40(%rbp),%rdi
call   1110 <test_if_dir@plt>
cmp    $0x1,%eax
jne    13ca <moveFolder+0x1ba>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   10d0 <moveFolder@plt>
mov    %eax,-0x20(%rbp)
jmp    1433 <moveFolder+0x223>
mov    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10e0 <USB_upload@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    142e <moveFolder+0x21e>
mov    -0x40(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1100 <localpath_to_serverpath@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1050 <Getmodtime@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
mov    -0x4c(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1130 <ChangeFile_modtime@plt>
cmp    $0x0,%rax
je     1429 <moveFolder+0x219>
jmp    1429 <moveFolder+0x219>
jmp    142e <moveFolder+0x21e>
jmp    1433 <moveFolder+0x223>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
jmp    126d <moveFolder+0x5d>
jmp    144f <moveFolder+0x23f>
mov    -0x30(%rbp),%rdi
call   1090 <closedir@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    146a <moveFolder+0x25a>
movl   $0x386,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moveFolder>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r13d
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %edx,%esi
call   10f0 <USB_rm@plt>
mov    %r14,%rdi
call   1070 <opendir@plt>
test   %rax,%rax
je     125d <moveFolder+0x4d>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %r13d,%esi
call   10a0 <USB_mkdir@plt>
mov    %eax,%r12d
test   %eax,%eax
je     1275 <moveFolder+0x65>
mov    %rbp,%rdi
call   1090 <closedir@plt>
mov    %r12d,%r13d
jmp    1263 <moveFolder+0x53>
mov    $0x386,%r13d
mov    %r13d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %rbp,%rdi
call   10c0 <readdir@plt>
test   %rax,%rax
je     128f <moveFolder+0x7f>
mov    %rax,%r15
xor    %r12d,%r12d
mov    %rbx,0x20(%rsp)
jmp    12d0 <moveFolder+0xc0>
xor    %r12d,%r12d
jmp    1250 <moveFolder+0x40>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %r13d,%edx
call   10d0 <moveFolder@plt>
mov    %eax,%r12d
mov    0x8(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <free@plt>
nopl   (%rax)
mov    %rbp,%rdi
call   10c0 <readdir@plt>
mov    %rax,%r15
test   %rax,%rax
je     1250 <moveFolder+0x40>
mov    (%r15),%rbx
mov    %rbx,%rdi
lea    0xd24(%rip),%rsi
call   10b0 <strcmp@plt>
test   %eax,%eax
je     12c0 <moveFolder+0xb0>
mov    %rbx,%rdi
lea    0xd10(%rip),%rsi
call   10b0 <strcmp@plt>
test   %eax,%eax
je     12c0 <moveFolder+0xb0>
mov    %r13d,0x1c(%rsp)
mov    0x20(%rsp),%rdi
call   1080 <strlen@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1080 <strlen@plt>
lea    (%rax,%r13,1),%rdi
add    $0x2,%rdi
call   1040 <my_malloc@plt>
mov    $0xffffffff,%r13d
mov    %rax,0x10(%rsp)
test   %rax,%rax
je     1263 <moveFolder+0x53>
mov    %r14,%rdi
call   1080 <strlen@plt>
mov    %rax,%rbx
mov    (%r15),%rdi
call   1080 <strlen@plt>
lea    (%rbx,%rax,1),%rdi
add    $0x2,%rdi
call   1040 <my_malloc@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     1263 <moveFolder+0x53>
mov    (%r15),%rcx
mov    0x8(%rsp),%rdi
lea    0xc92(%rip),%rbx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1120 <sprintf@plt>
mov    (%r15),%rcx
mov    0x10(%rsp),%rdi
mov    %rbx,%rsi
mov    0x20(%rsp),%rdx
call   1120 <sprintf@plt>
mov    (%r15),%rsi
mov    %r14,%rdi
mov    0x1c(%rsp),%r13d
mov    %r13d,%edx
call   1060 <socket_check@plt>
cmp    $0x1,%eax
je     12c0 <moveFolder+0xb0>
mov    0x8(%rsp),%rdi
call   1110 <test_if_dir@plt>
cmp    $0x1,%eax
je     1294 <moveFolder+0x84>
mov    0x8(%rsp),%rdi
mov    %r13d,%esi
call   10e0 <USB_upload@plt>
mov    %eax,%r12d
test   %eax,%eax
jne    12a9 <moveFolder+0x99>
mov    0x8(%rsp),%r12
mov    %r12,%rdi
mov    %r13d,%esi
call   1100 <localpath_to_serverpath@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r13d,%esi
call   1050 <Getmodtime@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
mov    %r15d,%esi
mov    %r13d,%edx
call   1130 <ChangeFile_modtime@plt>
xor    %r12d,%r12d
jmp    12a9 <moveFolder+0x99>

LLVM IR (-O0):
%struct.dirent = type { i8* }
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
@.str.2 = [6 x i8] c"%s/%s\00"
define i32 @moveFolder(i8* %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.dirent*
%10 = alloca i32*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
%15 = load i8*, i8** %5
%16 = load i32, i32* %7
%17 = call i32 @USB_rm(i8* %15, i32 %16)
store %struct.dirent* null, %struct.dirent** %9
%18 = load i8*, i8** %6
%19 = call i32* @opendir(i8* %18)
store i32* %19, i32** %10
%20 = load i32*, i32** %10
%21 = icmp ne i32* %20, null
br i1 %21, label %22, label %135
22: ; preds = %3
%23 = load i8*, i8** %6
%24 = load i32, i32* %7
%25 = call i32 @USB_mkdir(i8* %23, i32 %24)
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %131
28: ; preds = %22
br label %29
29: ; preds = %125, %92, %45, %28
%30 = load i32*, i32** %10
%31 = call %struct.dirent* @readdir(i32* %30)
store %struct.dirent* %31, %struct.dirent** %9
%32 = icmp ne %struct.dirent* %31, null
br i1 %32, label %33, label %130
33: ; preds = %29
%34 = load %struct.dirent*, %struct.dirent** %9
%35 = getelementptr inbounds %struct.dirent, %struct.dirent* %34, i32 0, i32 0
%36 = load i8*, i8** %35
%37 = call i32 @strcmp(i8* %36, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %45
39: ; preds = %33
%40 = load %struct.dirent*, %struct.dirent** %9
%41 = getelementptr inbounds %struct.dirent, %struct.dirent* %40, i32 0, i32 0
%42 = load i8*, i8** %41
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %39, %33
br label %29
46: ; preds = %39
%47 = load i8*, i8** %5
%48 = call i64 @strlen(i8* %47)
%49 = load %struct.dirent*, %struct.dirent** %9
%50 = getelementptr inbounds %struct.dirent, %struct.dirent* %49, i32 0, i32 0
%51 = load i8*, i8** %50
%52 = call i64 @strlen(i8* %51)
%53 = add nsw i64 %48, %52
%54 = add nsw i64 %53, 2
%55 = call i8* @my_malloc(i64 %54)
store i8* %55, i8** %11
%56 = load i8*, i8** %11
%57 = icmp eq i8* %56, null
br i1 %57, label %58, label %59
58: ; preds = %46
store i32 -1, i32* %4
br label %136
59: ; preds = %46
%60 = load i8*, i8** %6
%61 = call i64 @strlen(i8* %60)
%62 = load %struct.dirent*, %struct.dirent** %9
%63 = getelementptr inbounds %struct.dirent, %struct.dirent* %62, i32 0, i32 0
%64 = load i8*, i8** %63
%65 = call i64 @strlen(i8* %64)
%66 = add nsw i64 %61, %65
%67 = add nsw i64 %66, 2
%68 = call i8* @my_malloc(i64 %67)
store i8* %68, i8** %12
%69 = load i8*, i8** %12
%70 = icmp eq i8* %69, null
br i1 %70, label %71, label %72
71: ; preds = %59
store i32 -1, i32* %4
br label %136
72: ; preds = %59
%73 = load i8*, i8** %12
%74 = load i8*, i8** %6
%75 = load %struct.dirent*, %struct.dirent** %9
%76 = getelementptr inbounds %struct.dirent, %struct.dirent* %75, i32 0, i32 0
%77 = load i8*, i8** %76
%78 = call i32 @sprintf(i8* %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %74, i8* %77)
%79 = load i8*, i8** %11
%80 = load i8*, i8** %5
%81 = load %struct.dirent*, %struct.dirent** %9
%82 = getelementptr inbounds %struct.dirent, %struct.dirent* %81, i32 0, i32 0
%83 = load i8*, i8** %82
%84 = call i32 @sprintf(i8* %79, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %80, i8* %83)
%85 = load i8*, i8** %6
%86 = load %struct.dirent*, %struct.dirent** %9
%87 = getelementptr inbounds %struct.dirent, %struct.dirent* %86, i32 0, i32 0
%88 = load i8*, i8** %87
%89 = load i32, i32* %7
%90 = call i32 @socket_check(i8* %85, i8* %88, i32 %89)
%91 = icmp eq i32 %90, 1
br i1 %91, label %92, label %93
92: ; preds = %72
br label %29
93: ; preds = %72
%94 = load i8*, i8** %12
%95 = call i32 @test_if_dir(i8* %94)
%96 = icmp eq i32 %95, 1
br i1 %96, label %97, label %102
97: ; preds = %93
%98 = load i8*, i8** %11
%99 = load i8*, i8** %12
%100 = load i32, i32* %7
%101 = call i32 @moveFolder(i8* %98, i8* %99, i32 %100)
store i32 %101, i32* %8
br label %125
102: ; preds = %93
%103 = load i8*, i8** %12
%104 = load i32, i32* %7
%105 = call i32 @USB_upload(i8* %103, i32 %104)
store i32 %105, i32* %8
%106 = load i32, i32* %8
%107 = icmp eq i32 %106, 0
br i1 %107, label %108, label %124
108: ; preds = %102
%109 = load i8*, i8** %12
%110 = load i32, i32* %7
%111 = call i8* @localpath_to_serverpath(i8* %109, i32 %110)
store i8* %111, i8** %13
%112 = load i8*, i8** %13
%113 = load i32, i32* %7
%114 = call i32 @Getmodtime(i8* %112, i32 %113)
store i32 %114, i32* %14
%115 = load i8*, i8** %13
%116 = call i32 @free(i8* %115)
%117 = load i8*, i8** %12
%118 = load i32, i32* %14
%119 = load i32, i32* %7
%120 = call i64 @ChangeFile_modtime(i8* %117, i32 %118, i32 %119)
%121 = icmp ne i64 %120, 0
br i1 %121, label %122, label %123
122: ; preds = %108
br label %123
123: ; preds = %122, %108
br label %124
124: ; preds = %123, %102
br label %125
125: ; preds = %124, %97
%126 = load i8*, i8** %12
%127 = call i32 @free(i8* %126)
%128 = load i8*, i8** %11
%129 = call i32 @free(i8* %128)
br label %29
130: ; preds = %29
br label %131
131: ; preds = %130, %22
%132 = load i32*, i32** %10
%133 = call i32 @closedir(i32* %132)
%134 = load i32, i32* %8
store i32 %134, i32* %4
br label %136
135: ; preds = %3
store i32 902, i32* %4
br label %136
136: ; preds = %135, %131, %71, %58
%137 = load i32, i32* %4
ret i32 %137
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
@.str.2 = [6 x i8] c"%s/%s\00"
define i32 @moveFolder(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @USB_rm(i8* %0, i32 %2)
%5 = tail call i32* @opendir(i8* %1)
%6 = icmp eq i32* %5, null
br i1 %6, label %76, label %7
7: ; preds = %3
%8 = tail call i32 @USB_mkdir(i8* %1, i32 %2)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %73
10: ; preds = %7
%11 = tail call %struct.dirent* @readdir(i32* %5)
%12 = icmp eq %struct.dirent* %11, null
br i1 %12, label %73, label %13
13: ; preds = %10, %69
%14 = phi %struct.dirent* [ %71, %69 ], [ %11, %10 ]
%15 = phi i32 [ %70, %69 ], [ 0, %10 ]
br label %16
16: ; preds = %13, %25
%17 = phi %struct.dirent* [ %14, %13 ], [ %26, %25 ]
%18 = getelementptr inbounds %struct.dirent, %struct.dirent* %17, i64 0, i32 0
%19 = load i8*, i8** %18
%20 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %16
%23 = tail call i32 @strcmp(i8* dereferenceable(1) %19, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %22, %16
%26 = tail call %struct.dirent* @readdir(i32* %5)
%27 = icmp eq %struct.dirent* %26, null
br i1 %27, label %73, label %16
28: ; preds = %22
%29 = getelementptr inbounds %struct.dirent, %struct.dirent* %17, i64 0, i32 0
%30 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%31 = tail call i64 @strlen(i8* dereferenceable(1) %19)
%32 = add i64 %30, 2
%33 = add i64 %32, %31
%34 = tail call i8* @my_malloc(i64 %33)
%35 = icmp eq i8* %34, null
br i1 %35, label %76, label %36
36: ; preds = %28
%37 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%38 = load i8*, i8** %29
%39 = tail call i64 @strlen(i8* dereferenceable(1) %38)
%40 = add i64 %37, 2
%41 = add i64 %40, %39
%42 = tail call i8* @my_malloc(i64 %41)
%43 = icmp eq i8* %42, null
br i1 %43, label %76, label %44
44: ; preds = %36
%45 = load i8*, i8** %29
%46 = tail call i32 @sprintf(i8* %42, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %45)
%47 = load i8*, i8** %29
%48 = tail call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %0, i8* %47)
%49 = load i8*, i8** %29
%50 = tail call i32 @socket_check(i8* %1, i8* %49, i32 %2)
%51 = icmp eq i32 %50, 1
br i1 %51, label %69, label %52
52: ; preds = %44
%53 = tail call i32 @test_if_dir(i8* %42)
%54 = icmp eq i32 %53, 1
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = tail call i32 @moveFolder(i8* %34, i8* %42, i32 %2)
br label %65
57: ; preds = %52
%58 = tail call i32 @USB_upload(i8* %42, i32 %2)
%59 = icmp eq i32 %58, 0
br i1 %59, label %60, label %65
60: ; preds = %57
%61 = tail call i8* @localpath_to_serverpath(i8* %42, i32 %2)
%62 = tail call i32 @Getmodtime(i8* %61, i32 %2)
%63 = tail call i32 @free(i8* %61)
%64 = tail call i64 @ChangeFile_modtime(i8* %42, i32 %62, i32 %2)
br label %65
65: ; preds = %57, %60, %55
%66 = phi i32 [ %56, %55 ], [ 0, %60 ], [ %58, %57 ]
%67 = tail call i32 @free(i8* %42)
%68 = tail call i32 @free(i8* %34)
br label %69
69: ; preds = %65, %44
%70 = phi i32 [ %66, %65 ], [ %15, %44 ]
%71 = tail call %struct.dirent* @readdir(i32* %5)
%72 = icmp eq %struct.dirent* %71, null
br i1 %72, label %73, label %13
73: ; preds = %69, %25, %10, %7
%74 = phi i32 [ %8, %7 ], [ 0, %10 ], [ %15, %25 ], [ %70, %69 ]
%75 = tail call i32 @closedir(i32* %5)
br label %76
76: ; preds = %36, %28, %3, %73
%77 = phi i32 [ %74, %73 ], [ 902, %3 ], [ -1, %28 ], [ -1, %36 ]
ret i32 %77
}