#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 /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
int strcmp(char *, char *);
int strlen(char *);
int ziXACCompareTwoDirectoryEntries(char *sA, char *sB) {
  char cA, cB;
  if (strlen(sA) == 0 || strlen(sB) == 0) {
    {
      printf("%cFATAL ERROR----------------------------------------\n", '!');
      printf("%cFATAL:    In file [%s], line %d\n", '!',
             "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/choderalab/ambermini/refs/heads/master/"
             "leap/src/leap/xaCommand.c",
             332);
      printf("%cFATAL:    Message: ", '!');
      printf("Zero length directory name\n");
      printf("%c\n", '!');
      printf("%cABORTING.\n", '!');
      exit(1);
    };
  }
  cA = sA[strlen(sA) - 1];
  cB = sB[strlen(sB) - 1];
  if (cA == '/' && cB != '/')
    return (-1);
  if (cA != '/' && cB == '/')
    return (1);
  if (sA[0] == '.' && sB[0] == '.') {
    if (strlen(sA) == 1) {
      return (1);
    } else {
      return (-1);
    }
  }
  return (strcmp(sA, sB));
}


x86 assembly (clang, -O0):
<ziXACCompareTwoDirectoryEntries>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
je     1174 <ziXACCompareTwoDirectoryEntries+0x34>
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x0,%eax
jne    11f7 <ziXACCompareTwoDirectoryEntries+0xb7>
lea    0xe85(%rip),%rdi
mov    $0x21,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x21,%esi
lea    0xec0(%rip),%rdx
mov    $0x14c,%ecx
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf48(%rip),%rdi
mov    $0x21,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf4b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf59(%rip),%rdi
mov    $0x21,%esi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf4a(%rip),%rdi
mov    $0x21,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x1a(%rbp)
movsbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
jne    1263 <ziXACCompareTwoDirectoryEntries+0x123>
movsbl -0x1a(%rbp),%eax
cmp    $0x2f,%eax
je     1263 <ziXACCompareTwoDirectoryEntries+0x123>
movl   $0xffffffff,-0x4(%rbp)
jmp    12e3 <ziXACCompareTwoDirectoryEntries+0x1a3>
movsbl -0x19(%rbp),%eax
cmp    $0x2f,%eax
je     1289 <ziXACCompareTwoDirectoryEntries+0x149>
movsbl -0x1a(%rbp),%eax
cmp    $0x2f,%eax
jne    1289 <ziXACCompareTwoDirectoryEntries+0x149>
movl   $0x1,-0x4(%rbp)
jmp    12e3 <ziXACCompareTwoDirectoryEntries+0x1a3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    12d3 <ziXACCompareTwoDirectoryEntries+0x193>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    12d3 <ziXACCompareTwoDirectoryEntries+0x193>
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x1,%eax
jne    12c7 <ziXACCompareTwoDirectoryEntries+0x187>
movl   $0x1,-0x4(%rbp)
jmp    12e3 <ziXACCompareTwoDirectoryEntries+0x1a3>
movl   $0xffffffff,-0x4(%rbp)
jmp    12e3 <ziXACCompareTwoDirectoryEntries+0x1a3>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcmp@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ziXACCompareTwoDirectoryEntries>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
test   %eax,%eax
je     11e8 <ziXACCompareTwoDirectoryEntries+0x98>
mov    %r14,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
je     11e8 <ziXACCompareTwoDirectoryEntries+0x98>
mov    %r15,%rdi
call   1040 <strlen@plt>
cltq
mov    -0x1(%rax,%r15,1),%bl
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
mov    -0x1(%rax,%r14,1),%cl
cmp    $0x2f,%bl
jne    11a1 <ziXACCompareTwoDirectoryEntries+0x51>
mov    $0xffffffff,%eax
cmp    $0x2f,%cl
jne    11d2 <ziXACCompareTwoDirectoryEntries+0x82>
cmp    $0x2f,%bl
je     11b0 <ziXACCompareTwoDirectoryEntries+0x60>
mov    $0x1,%eax
cmp    $0x2f,%cl
je     11d2 <ziXACCompareTwoDirectoryEntries+0x82>
cmpb   $0x2e,(%r15)
jne    11d8 <ziXACCompareTwoDirectoryEntries+0x88>
cmpb   $0x2e,(%r14)
jne    11d8 <ziXACCompareTwoDirectoryEntries+0x88>
mov    %r15,%rdi
call   1040 <strlen@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
lea    (%rcx,%rcx,1),%eax
add    $0xffffffff,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r15,%rdi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <strcmp@plt>
lea    0xe11(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe35(%rip),%rdi
lea    0xe51(%rip),%rdx
mov    $0x21,%esi
mov    $0x14c,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xed4(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xecb(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x21,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"%cFATAL ERROR----------------------------------------\0A\00"
@.str.1 = [35 x i8] c"%cFATAL: In file [%s], line %d\0A\00"
@.str.2 = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/choderalab/ambermini/refs/heads/master/leap/src/leap/xaCommand.c\00"
@.str.3 = [22 x i8] c"%cFATAL: Message: \00"
@.str.4 = [28 x i8] c"Zero length directory name\0A\00"
@.str.5 = [4 x i8] c"%c\0A\00"
@.str.6 = [13 x i8] c"%cABORTING.\0A\00"
define i32 @ziXACCompareTwoDirectoryEntries(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8
%7 = alloca i8
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = call i32 @strlen(i8* %12)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %11, %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 33)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.2, i64 0, i64 0), i32 332)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 33)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 33)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 33)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %11
%24 = load i8*, i8** %4
%25 = load i8*, i8** %4
%26 = call i32 @strlen(i8* %25)
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %24, i64 %28
%30 = load i8, i8* %29
store i8 %30, i8* %6
%31 = load i8*, i8** %5
%32 = load i8*, i8** %5
%33 = call i32 @strlen(i8* %32)
%34 = sub nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %31, i64 %35
%37 = load i8, i8* %36
store i8 %37, i8* %7
%38 = load i8, i8* %6
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 47
br i1 %40, label %41, label %46
41: ; preds = %23
%42 = load i8, i8* %7
%43 = sext i8 %42 to i32
%44 = icmp ne i32 %43, 47
br i1 %44, label %45, label %46
45: ; preds = %41
store i32 -1, i32* %3
br label %77
46: ; preds = %41, %23
%47 = load i8, i8* %6
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 47
br i1 %49, label %50, label %55
50: ; preds = %46
%51 = load i8, i8* %7
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 47
br i1 %53, label %54, label %55
54: ; preds = %50
store i32 1, i32* %3
br label %77
55: ; preds = %50, %46
%56 = load i8*, i8** %4
%57 = getelementptr inbounds i8, i8* %56, i64 0
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 46
br i1 %60, label %61, label %73
61: ; preds = %55
%62 = load i8*, i8** %5
%63 = getelementptr inbounds i8, i8* %62, i64 0
%64 = load i8, i8* %63
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 46
br i1 %66, label %67, label %73
67: ; preds = %61
%68 = load i8*, i8** %4
%69 = call i32 @strlen(i8* %68)
%70 = icmp eq i32 %69, 1
br i1 %70, label %71, label %72
71: ; preds = %67
store i32 1, i32* %3
br label %77
72: ; preds = %67
store i32 -1, i32* %3
br label %77
73: ; preds = %61, %55
%74 = load i8*, i8** %4
%75 = load i8*, i8** %5
%76 = call i32 @strcmp(i8* %74, i8* %75)
store i32 %76, i32* %3
br label %77
77: ; preds = %73, %72, %71, %54, %45
%78 = load i32, i32* %3
ret i32 %78
}

LLVM IR (-O2):
@.str = [55 x i8] c"%cFATAL ERROR----------------------------------------\0A\00"
@.str.1 = [35 x i8] c"%cFATAL: In file [%s], line %d\0A\00"
@.str.2 = [155 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/choderalab/ambermini/refs/heads/master/leap/src/leap/xaCommand.c\00"
@.str.3 = [22 x i8] c"%cFATAL: Message: \00"
@.str.5 = [4 x i8] c"%c\0A\00"
@.str.6 = [13 x i8] c"%cABORTING.\0A\00"
@str = [27 x i8] c"Zero length directory name\00"
define i32 @ziXACCompareTwoDirectoryEntries(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strlen(i8* %1)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %5, %2
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 33)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 33, i8* getelementptr inbounds ([155 x i8], [155 x i8]* @.str.2, i64 0, i64 0), i32 332)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 33)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 33)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 33)
%15 = tail call i32 @exit(i32 1)
unreachable
16: ; preds = %5
%17 = tail call i32 @strlen(i8* %0)
%18 = add nsw i32 %17, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = tail call i32 @strlen(i8* %1)
%23 = add nsw i32 %22, -1
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %1, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %21, 47
%28 = icmp ne i8 %26, 47
%29 = select i1 %27, i1 %28, i1 false
br i1 %29, label %46, label %30
30: ; preds = %16
%31 = icmp ne i8 %21, 47
%32 = icmp eq i8 %26, 47
%33 = select i1 %31, i1 %32, i1 false
br i1 %33, label %46, label %34
34: ; preds = %30
%35 = load i8, i8* %0
%36 = icmp eq i8 %35, 46
br i1 %36, label %37, label %44
37: ; preds = %34
%38 = load i8, i8* %1
%39 = icmp eq i8 %38, 46
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = tail call i32 @strlen(i8* %0)
%42 = icmp eq i32 %41, 1
%43 = select i1 %42, i32 1, i32 -1
br label %46
44: ; preds = %37, %34
%45 = tail call i32 @strcmp(i8* %0, i8* dereferenceable(1) %1)
br label %46
46: ; preds = %40, %30, %16, %44
%47 = phi i32 [ %45, %44 ], [ -1, %16 ], [ 1, %30 ], [ %43, %40 ]
ret i32 %47
}