#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*/ my_io_createDir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ my_io_existsDir(char *);
char *my_io_getDirname(char const *);
int /*<<< orphan*/ my_memory_free(void *);
int /*<<< orphan*/ my_string_equals(char *, char *);
void my_io_createParentDir(const char *file_path) {
  char *parent = my_io_getDirname(file_path);
  if (!my_string_equals(parent, ".") && !my_string_equals(parent, "..")) {
    if (!my_io_existsDir(parent))
      my_io_createDir(parent, 0);
  }
  (my_memory_free((void *)(parent)));
}


x86 assembly (clang, -O0):
<my_io_createParentDir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <my_io_getDirname@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1070 <my_string_equals@plt>
cmp    $0x0,%eax
jne    11bd <my_io_createParentDir+0x6d>
mov    -0x10(%rbp),%rdi
lea    0xe73(%rip),%rsi
call   1070 <my_string_equals@plt>
cmp    $0x0,%eax
jne    11bd <my_io_createParentDir+0x6d>
mov    -0x10(%rbp),%rdi
call   1060 <my_io_existsDir@plt>
cmp    $0x0,%eax
jne    11b8 <my_io_createParentDir+0x68>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1050 <my_io_createDir@plt>
jmp    11bd <my_io_createParentDir+0x6d>
mov    -0x10(%rbp),%rdi
call   1030 <my_memory_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_io_createParentDir>:
push   %rbx
call   1040 <my_io_getDirname@plt>
mov    %rax,%rbx
lea    0xea1(%rip),%rsi
mov    %rax,%rdi
call   1070 <my_string_equals@plt>
test   %eax,%eax
jne    1195 <my_io_createParentDir+0x45>
lea    0xe8d(%rip),%rsi
mov    %rbx,%rdi
call   1070 <my_string_equals@plt>
test   %eax,%eax
jne    1195 <my_io_createParentDir+0x45>
mov    %rbx,%rdi
call   1060 <my_io_existsDir@plt>
test   %eax,%eax
jne    1195 <my_io_createParentDir+0x45>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <my_io_createDir@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <my_memory_free@plt>

LLVM IR (-O0):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define void @my_io_createParentDir(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @my_io_getDirname(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @my_string_equals(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %21, label %9
9: ; preds = %1
%10 = load i8*, i8** %3
%11 = call i32 @my_string_equals(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp ne i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = call i32 @my_io_existsDir(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = load i8*, i8** %3
%19 = call i32 @my_io_createDir(i8* %18, i32 0)
br label %20
20: ; preds = %17, %13
br label %21
21: ; preds = %20, %9, %1
%22 = load i8*, i8** %3
%23 = call i32 @my_memory_free(i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c".\00"
@.str.1 = [3 x i8] c"..\00"
define void @my_io_createParentDir(i8* %0) {
%2 = tail call i8* @my_io_getDirname(i8* %0)
%3 = tail call i32 @my_string_equals(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %1
%6 = tail call i32 @my_string_equals(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = tail call i32 @my_io_existsDir(i8* %2)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = tail call i32 @my_io_createDir(i8* %2, i32 0)
br label %13
13: ; preds = %8, %11, %5, %1
%14 = tail call i32 @my_memory_free(i8* %2)
ret void
}