#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*/ mkdir(char *, int);
int /*<<< orphan*/ rmdir(char *);
int main() {
  mkdir("tmp", 777);
  mkdir("./tmp", 777);
  mkdir("../tmp", 777);
  mkdir("tmp/one", 777);
  mkdir("/tmp/one", 777);
  mkdir("./tmp/one", 777);
  mkdir("../tmp/one", 777);
  rmdir("tmp/one");
  rmdir("/tmp/one");
  rmdir("./tmp/one");
  rmdir("../tmp/one");
  rmdir("tmp");
  rmdir("./tmp");
  rmdir("../tmp");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
lea    0xed8(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xec5(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xeb3(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xeac(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe9a(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe88(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe76(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe68(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xe5b(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xe4e(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xe41(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xe31(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xe23(%rip),%rdi
call   1040 <rmdir@plt>
lea    0xe16(%rip),%rdi
call   1040 <rmdir@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xed1(%rip),%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xebe(%rip),%r15
mov    %r15,%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xea9(%rip),%r12
mov    %r12,%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe9f(%rip),%r13
mov    %r13,%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe8a(%rip),%rbx
mov    %rbx,%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe75(%rip),%rbp
mov    %rbp,%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
lea    0xe60(%rip),%r14
mov    %r14,%rdi
mov    $0x309,%esi
call   1030 <mkdir@plt>
mov    %r13,%rdi
call   1040 <rmdir@plt>
mov    %rbx,%rdi
call   1040 <rmdir@plt>
mov    %rbp,%rdi
call   1040 <rmdir@plt>
mov    %r14,%rdi
call   1040 <rmdir@plt>
lea    0xe28(%rip),%rdi
call   1040 <rmdir@plt>
mov    %r15,%rdi
call   1040 <rmdir@plt>
mov    %r12,%rdi
call   1040 <rmdir@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"tmp\00"
@.str.1 = [6 x i8] c"./tmp\00"
@.str.2 = [7 x i8] c"../tmp\00"
@.str.3 = [8 x i8] c"tmp/one\00"
@.str.4 = [9 x i8] c"/tmp/one\00"
@.str.5 = [10 x i8] c"./tmp/one\00"
@.str.6 = [11 x i8] c"../tmp/one\00"
define i32 @main() {
%1 = call i32 @mkdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 777)
%2 = call i32 @mkdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 777)
%3 = call i32 @mkdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 777)
%4 = call i32 @mkdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 777)
%5 = call i32 @mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 777)
%6 = call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 777)
%7 = call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 777)
%8 = call i32 @rmdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @rmdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @rmdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @rmdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"tmp\00"
@.str.1 = [6 x i8] c"./tmp\00"
@.str.2 = [7 x i8] c"../tmp\00"
@.str.3 = [8 x i8] c"tmp/one\00"
@.str.4 = [9 x i8] c"/tmp/one\00"
@.str.5 = [10 x i8] c"./tmp/one\00"
@.str.6 = [11 x i8] c"../tmp/one\00"
define i32 @main() {
%1 = tail call i32 @mkdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 777)
%2 = tail call i32 @mkdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 777)
%3 = tail call i32 @mkdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 777)
%4 = tail call i32 @mkdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 777)
%5 = tail call i32 @mkdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 777)
%6 = tail call i32 @mkdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 777)
%7 = tail call i32 @mkdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0), i32 777)
%8 = tail call i32 @rmdir(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%9 = tail call i32 @rmdir(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @rmdir(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @rmdir(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%12 = tail call i32 @rmdir(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @rmdir(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = tail call i32 @rmdir(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}