#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 /*<<< orphan*/ subdirpath;
typedef int /*<<< orphan*/ dirpath;

/* Variables and functions */
int /*<<< orphan*/ mkdir(char *, int);
int /*<<< orphan*/ path_build(char *, int, char *, char *);
int /*<<< orphan*/ path_parse(char *, int, char *);
void create_user_dirs(void) {
  char dirpath[1024];
  char subdirpath[1024];
  path_parse(dirpath, sizeof(dirpath), "~/.angband");
  mkdir(dirpath, 0700);
  path_build(subdirpath, sizeof(subdirpath), dirpath, "Unangband");
  mkdir(subdirpath, 0700);
}


x86 assembly (clang, -O0):
<create_user_dirs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
lea    -0x400(%rbp),%rdi
mov    $0x400,%esi
lea    0xeb2(%rip),%rdx
call   1050 <path_parse@plt>
lea    -0x400(%rbp),%rdi
mov    $0x1c0,%esi
call   1040 <mkdir@plt>
lea    -0x800(%rbp),%rdi
lea    -0x400(%rbp),%rdx
mov    $0x400,%esi
lea    0xe8d(%rip),%rcx
call   1030 <path_build@plt>
lea    -0x800(%rbp),%rdi
mov    $0x1c0,%esi
call   1040 <mkdir@plt>
add    $0x800,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_user_dirs>:
push   %r14
push   %rbx
sub    $0x808,%rsp
lea    0xebf(%rip),%rdx
lea    0x400(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x400,%esi
call   1050 <path_parse@plt>
mov    %rbx,%rdi
mov    $0x1c0,%esi
call   1040 <mkdir@plt>
lea    0xea1(%rip),%rcx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x400,%esi
mov    %rbx,%rdx
call   1030 <path_build@plt>
mov    %r14,%rdi
mov    $0x1c0,%esi
call   1040 <mkdir@plt>
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [11 x i8] c"~/.angband\00"
@.str.1 = [10 x i8] c"Unangband\00"
define void @create_user_dirs() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = call i32 @path_parse(i8* %3, i32 1024, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%6 = call i32 @mkdir(i8* %5, i32 448)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%9 = call i32 @path_build(i8* %7, i32 1024, i8* %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%10 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%11 = call i32 @mkdir(i8* %10, i32 448)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"~/.angband\00"
@.str.1 = [10 x i8] c"Unangband\00"
define void @create_user_dirs() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i32 @path_parse(i8* %3, i32 1024, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @mkdir(i8* %3, i32 448)
%7 = call i32 @path_build(i8* %4, i32 1024, i8* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @mkdir(i8* %4, i32 448)
ret void
}