#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*/ chmod(char *, int);
scalar_t__ mkdir(char *);
int /*<<< orphan*/ printf(char *);
int strtol(char *, int /*<<< orphan*/, int);
int main(int argc, char *argv[]) {
  if (argc < 2) {
    printf("Falta un argumento\n");
    return 0;
  } else if (argc == 2) {
    if (mkdir(argv[1]) != 0) {
      printf("Error, no he podido crear el directirio");
    }
    char mode[] = "0755";
    int i = strtol(mode, 0, 8);
    chmod(argv[1], i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1178 <main+0x38>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e6 <main+0xa6>
cmpl   $0x2,-0x8(%rbp)
jne    11da <main+0x9a>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <mkdir@plt>
cmp    $0x0,%rax
je     11a5 <main+0x65>
lea    0xe74(%rip),%rdi
call   1040 <printf@plt>
mov    0xe91(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xe8c(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x15(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <strtol@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <chmod@plt>
jmp    11df <main+0x9f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x1,%edi
jg     1168 <main+0x18>
lea    0xecc(%rip),%rdi
call   1040 <puts@plt>
jmp    11b3 <main+0x63>
cmp    $0x2,%edi
jne    11b3 <main+0x63>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <mkdir@plt>
test   %rax,%rax
je     118a <main+0x3a>
lea    0xe7b(%rip),%rdi
call   1050 <printf@plt>
movb   $0x0,0xc(%rsp)
movl   $0x35353730,0x8(%rsp)
35
lea    0x8(%rsp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1060 <strtol@plt>
mov    0x8(%rbx),%rdi
mov    %eax,%esi
call   1070 <chmod@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Falta un argumento\0A\00"
@.str.1 = [40 x i8] c"Error, no he podido crear el directirio\00"
@__const.main.mode = [5 x i8] c"0755\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %34
12: ; preds = %2
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = load i8**, i8*** %5
%17 = getelementptr inbounds i8*, i8** %16, i64 1
%18 = load i8*, i8** %17
%19 = call i64 @mkdir(i8* %18)
%20 = icmp ne i64 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %15
%24 = bitcast [5 x i8]* %6 to i8*
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%26 = call i32 @strtol(i8* %25, i32 0, i32 8)
store i32 %26, i32* %7
%27 = load i8**, i8*** %5
%28 = getelementptr inbounds i8*, i8** %27, i64 1
%29 = load i8*, i8** %28
%30 = load i32, i32* %7
%31 = call i32 @chmod(i8* %29, i32 %30)
br label %32
32: ; preds = %23, %12
br label %33
33: ; preds = %32
store i32 0, i32* %3
br label %34
34: ; preds = %33, %10
%35 = load i32, i32* %3
ret i32 %35
}

LLVM IR (-O2):
@.str.1 = [40 x i8] c"Error, no he podido crear el directirio\00"
@__const.main.mode = [5 x i8] c"0755\00"
@str = [19 x i8] c"Falta un argumento\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [5 x i8]
%4 = icmp slt i32 %0, 2
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %21
7: ; preds = %2
%8 = icmp eq i32 %0, 2
br i1 %8, label %9, label %21
9: ; preds = %7
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @mkdir(i8* %11)
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %9
%15 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
br label %16
16: ; preds = %14, %9
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%18 = call i32 @strtol(i8* %17, i32 0, i32 8)
%19 = load i8*, i8** %10
%20 = call i32 @chmod(i8* %19, i32 %18)
br label %21
21: ; preds = %16, %7, %5
ret i32 0
}