#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 /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int strlen(char *);
void main(int argc, char **argv) {
  if (*(argv[argc - 1] + strlen(argv[argc - 1]) - 1) == '/')
    if (*(argv[argc - 1]) == '/')
      if (*(argv[argc - 1] - 1) == '~') {
        printf("directory creation fails\n");
        exit(0);
      }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
movsbl -0x1(%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    11d9 <main+0xa9>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
jne    11d4 <main+0xa4>
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rax
movsbl -0x1(%rax),%eax
cmp    $0x7e,%eax
jne    11cf <main+0x9f>
lea    0xe3d(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
jmp    11d4 <main+0xa4>
jmp    11d9 <main+0xa9>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
movslq %edi,%r15
mov    -0x8(%rsi,%r15,8),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
cltq
cmpb   $0x2f,-0x1(%rbx,%rax,1)
jne    1164 <main+0x34>
add    $0xffffffffffffffff,%r15
mov    (%r14,%r15,8),%rax
cmpb   $0x2f,(%rax)
jne    1164 <main+0x34>
cmpb   $0x7e,-0x1(%rax)
je     116a <main+0x3a>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"directory creation fails\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = load i8**, i8*** %4
%6 = load i32, i32* %3
%7 = sub nsw i32 %6, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8*, i8** %5, i64 %8
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %4
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %11, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @strlen(i8* %16)
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %10, i64 %18
%20 = getelementptr inbounds i8, i8* %19, i64 -1
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 47
br i1 %23, label %24, label %50
24: ; preds = %2
%25 = load i8**, i8*** %4
%26 = load i32, i32* %3
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8*, i8** %25, i64 %28
%30 = load i8*, i8** %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 47
br i1 %33, label %34, label %49
34: ; preds = %24
%35 = load i8**, i8*** %4
%36 = load i32, i32* %3
%37 = sub nsw i32 %36, 1
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %35, i64 %38
%40 = load i8*, i8** %39
%41 = getelementptr inbounds i8, i8* %40, i64 -1
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 126
br i1 %44, label %45, label %48
45: ; preds = %34
%46 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%47 = call i32 @exit(i32 0)
unreachable
48: ; preds = %34
br label %49
49: ; preds = %48, %24
br label %50
50: ; preds = %49, %2
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"directory creation fails\00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = add nsw i32 %0, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8*, i8** %1, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = getelementptr inbounds i8, i8* %9, i64 -1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 47
br i1 %12, label %13, label %24
13: ; preds = %2
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 47
br i1 %16, label %17, label %24
17: ; preds = %13
%18 = getelementptr inbounds i8, i8* %14, i64 -1
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 126
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%23 = tail call i32 @exit(i32 0)
unreachable
24: ; preds = %13, %17, %2
ret void
}