#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 */
typedef int mode_t;

/* Variables and functions */
int /*<<< orphan*/ drmake(int, char **, int, int, int);
int getopt(int, char **, char *);
int /*<<< orphan*/ mkdir_exit(char *, int);
int /*<<< orphan*/ optarg;
scalar_t__ optind;
int strtol(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  mode_t mode = 0755;
  int o, parents, verbose;
  o = parents = verbose = 0;
  while ((o = getopt(argc, argv, "hvpm:")) != -1)
    switch (o) {
    case 'm':
      mode = strtol(optarg, NULL, 8);
      break;
    case 'p':
      parents = 1;
      break;
    case 'v':
      verbose = 1;
      break;
    case 'h':
      mkdir_exit("Usage  mkdir -pvm:\n", 0);
      break;
    case '?':
      mkdir_exit("", 1);
      break;
    default:
      break;
    }
  argv += optind;
  argc -= optind;
  drmake(argc, argv, mode, verbose, parents);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1ed,-0x14(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe80(%rip),%rdx
call   1050 <getopt@plt>
mov    %eax,-0x18(%rbp)
cmp    $0xffffffff,%eax
je     1253 <main+0x113>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x3f,%eax
je     1233 <main+0xf3>
jmp    11a5 <main+0x65>
mov    -0x24(%rbp),%eax
sub    $0x68,%eax
je     1220 <main+0xe0>
jmp    11b6 <main+0x76>
mov    -0x24(%rbp),%eax
sub    $0x6d,%eax
je     11e9 <main+0xa9>
jmp    11c7 <main+0x87>
mov    -0x24(%rbp),%eax
sub    $0x70,%eax
je     1208 <main+0xc8>
jmp    11d8 <main+0x98>
mov    -0x24(%rbp),%eax
sub    $0x76,%eax
je     1214 <main+0xd4>
jmp    1249 <main+0x109>
mov    0x2e08(%rip),%rax
mov    (%rax),%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x8,%edx
call   1040 <strtol@plt>
mov    %eax,-0x14(%rbp)
jmp    124e <main+0x10e>
movl   $0x1,-0x1c(%rbp)
jmp    124e <main+0x10e>
movl   $0x1,-0x20(%rbp)
jmp    124e <main+0x10e>
lea    0xddf(%rip),%rdi
xor    %esi,%esi
call   1060 <mkdir_exit@plt>
jmp    124e <main+0x10e>
lea    0xddf(%rip),%rdi
mov    $0x1,%esi
call   1060 <mkdir_exit@plt>
jmp    124e <main+0x10e>
jmp    124e <main+0x10e>
jmp    1172 <main+0x32>
mov    0x2d86(%rip),%rax
mov    (%rax),%rax
shl    $0x3,%rax
add    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    0x2d70(%rip),%rax
mov    (%rax),%rcx
movslq -0x8(%rbp),%rax
sub    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
call   1030 <drmake@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movl   $0x1ed,0xc(%rsp)
lea    0xed3(%rip),%r13
lea    0xee5(%rip),%r14
lea    0xe89(%rip),%r12
lea    0xec4(%rip),%r15
movl   $0x0,0x8(%rsp)
jmp    119d <main+0x5d>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    $0x1,%esi
call   1060 <mkdir_exit@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r13,%rdx
call   1050 <getopt@plt>
lea    -0x68(%rax),%ecx
cmp    $0xe,%ecx
ja     11d0 <main+0x90>
movslq (%r12,%rcx,4),%rax
add    %r12,%rax
jmp    *%rax
mov    %r15,%rdi
xor    %esi,%esi
call   1060 <mkdir_exit@plt>
jmp    119d <main+0x5d>
nopw   0x0(%rax,%rax,1)
cmp    $0x3f,%eax
je     1190 <main+0x50>
cmp    $0xffffffff,%eax
jne    119d <main+0x5d>
jmp    120d <main+0xcd>
mov    0x2e15(%rip),%rax
mov    (%rax),%edi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <strtol@plt>
mov    %eax,0xc(%rsp)
jmp    119d <main+0x5d>
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
jmp    119d <main+0x5d>
movl   $0x1,0x8(%rsp)
jmp    119d <main+0x5d>
mov    0x2dcc(%rip),%rax
mov    (%rax),%rax
lea    (%rbx,%rax,8),%rsi
sub    %eax,%ebp
mov    %ebp,%edi
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    0x10(%rsp),%r8
call   1030 <drmake@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"hvpm:\00"
@optarg = global i32 0
@.str.1 = [20 x i8] c"Usage mkdir -pvm:\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@optind = global i64 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 493, i32* %6
store i32 0, i32* %9
store i32 0, i32* %8
store i32 0, i32* %7
br label %10
10: ; preds = %27, %2
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = call i32 @getopt(i32 %11, i8** %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %13, i32* %7
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = load i32, i32* %7
switch i32 %16, label %26 [
i32 109, label %17
i32 112, label %20
i32 118, label %21
i32 104, label %22
i32 63, label %24
]
17: ; preds = %15
%18 = load i32, i32* @optarg
%19 = call i32 @strtol(i32 %18, i32* null, i32 8)
store i32 %19, i32* %6
br label %27
20: ; preds = %15
store i32 1, i32* %8
br label %27
21: ; preds = %15
store i32 1, i32* %9
br label %27
22: ; preds = %15
%23 = call i32 @mkdir_exit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %27
24: ; preds = %15
%25 = call i32 @mkdir_exit(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %27
26: ; preds = %15
br label %27
27: ; preds = %26, %24, %22, %21, %20, %17
br label %10
28: ; preds = %10
%29 = load i64, i64* @optind
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 %29
store i8** %31, i8*** %5
%32 = load i64, i64* @optind
%33 = load i32, i32* %4
%34 = sext i32 %33 to i64
%35 = sub nsw i64 %34, %32
%36 = trunc i64 %35 to i32
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = load i8**, i8*** %5
%39 = load i32, i32* %6
%40 = load i32, i32* %9
%41 = load i32, i32* %8
%42 = call i32 @drmake(i32 %37, i8** %38, i32 %39, i32 %40, i32 %41)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"hvpm:\00"
@optarg = global i32 0
@.str.1 = [20 x i8] c"Usage mkdir -pvm:\0A\00"
@.str.2 = [1 x i8] zeroinitializer
@optind = global i64 0
define i32 @main(i32 %0, i8** %1) {
br label %3
3: ; preds = %15, %2
%4 = phi i32 [ %17, %15 ], [ 493, %2 ]
%5 = phi i32 [ %8, %15 ], [ 0, %2 ]
%6 = phi i32 [ %11, %15 ], [ 0, %2 ]
br label %7
7: ; preds = %12, %3
%8 = phi i32 [ %5, %3 ], [ 1, %12 ]
%9 = phi i32 [ %6, %3 ], [ %11, %12 ]
br label %10
10: ; preds = %12, %7
%11 = phi i32 [ %9, %7 ], [ 1, %12 ]
br label %12
12: ; preds = %14, %10
%13 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
switch i32 %13, label %14 [
i32 -1, label %22
i32 109, label %15
i32 112, label %7
i32 118, label %10
i32 104, label %18
i32 63, label %20
]
14: ; preds = %12, %20, %18
br label %12
15: ; preds = %12
%16 = load i32, i32* @optarg
%17 = tail call i32 @strtol(i32 %16, i32* null, i32 8)
br label %3
18: ; preds = %12
%19 = tail call i32 @mkdir_exit(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 0)
br label %14
20: ; preds = %12
%21 = tail call i32 @mkdir_exit(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i32 1)
br label %14
22: ; preds = %12
%23 = load i64, i64* @optind
%24 = getelementptr inbounds i8*, i8** %1, i64 %23
%25 = trunc i64 %23 to i32
%26 = sub i32 %0, %25
%27 = tail call i32 @drmake(i32 %26, i8** %24, i32 %4, i32 %11, i32 %8)
ret i32 0
}