#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*/ S_IRWXU;
int mkdir(char *, int /*<<< orphan*/);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  if (argc == 1) {
    write(1,
          "Please specify as an argument the name of the directory you wish to "
          "create.\n",
          76);
    return 1;
  }
  if (mkdir(argv[1], S_IRWXU) == -1) {
    perror("Error");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1172 <main+0x42>
mov    $0x1,%edi
lea    0xea4(%rip),%rsi
mov    $0x4c,%edx
call   1040 <write@plt>
movl   $0x1,-0x4(%rbp)
jmp    11a4 <main+0x74>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2e67(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
cmp    $0xffffffff,%eax
jne    119d <main+0x6d>
lea    0xeb5(%rip),%rdi
call   1050 <perror@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    1153 <main+0x23>
lea    0xec3(%rip),%rsi
mov    $0x1,%ebx
mov    $0x1,%edi
mov    $0x4c,%edx
call   1040 <write@plt>
jmp    116c <main+0x3c>
mov    0x8(%rsi),%rdi
mov    0x2e8a(%rip),%rax
mov    (%rax),%esi
call   1030 <mkdir@plt>
xor    %ebx,%ebx
cmp    $0xffffffff,%eax
je     1170 <main+0x40>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xed6(%rip),%rdi
call   1050 <perror@plt>
jmp    116c <main+0x3c>

LLVM IR (-O0):
@.str = [77 x i8] c"Please specify as an argument the name of the directory you wish to create.\0A\00"
@S_IRWXU = global i32 0
@.str.1 = [6 x i8] c"Error\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 @write(i32 1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 76)
store i32 1, i32* %3
br label %20
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i32, i32* @S_IRWXU
%15 = call i32 @mkdir(i8* %13, i32 %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %19
19: ; preds = %17, %10
store i32 0, i32* %3
br label %20
20: ; preds = %19, %8
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [77 x i8] c"Please specify as an argument the name of the directory you wish to create.\0A\00"
@S_IRWXU = global i32 0
@.str.1 = [6 x i8] c"Error\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str, i64 0, i64 0), i32 76)
br label %14
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = load i32, i32* @S_IRWXU
%10 = tail call i32 @mkdir(i8* %8, i32 %9)
%11 = icmp eq i32 %10, -1
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 @perror(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %6, %12, %4
%15 = phi i32 [ 1, %4 ], [ 0, %12 ], [ 0, %6 ]
ret i32 %15
}