#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*/ memcpy(char *, char *, int);
int /*<<< orphan*/ mkdir(char *, int);
int DataFilePath(unsigned char *key, char *buf) {
  memcpy(buf, ("files/"), sizeof(("files/")) - 1);
  char *p = buf + sizeof(("files/")) - 1;
  int i;
  for (i = 0; i < 16; ++i) {
    *p++ = (char)((key[i] >> 4) > 9 ? 'a' + ((key[i] >> 4) - 10)
                                    : '0' + (key[i] >> 4));
    *p++ = (char)((key[i] & 0xf) > 9 ? 'a' + ((key[i] & 0xf) - 10)
                                     : '0' + (key[i] & 0xf));
    if (i < 2) {
      *p++ = '/';
      *p = 0;
      mkdir(buf, 0700);
    }
  }
  *p = 0;
  return 1;
}


x86 assembly (clang, -O0):
<DataFilePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec5(%rip),%rsi
mov    $0x6,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x7,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    126a <DataFilePath+0x14a>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
cmp    $0x9,%eax
jle    119b <DataFilePath+0x7b>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x20(%rbp)
jmp    11b0 <DataFilePath+0x90>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
sar    $0x4,%eax
add    $0x30,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xf,%eax
cmp    $0x9,%eax
jle    11fb <DataFilePath+0xdb>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xf,%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x24(%rbp)
jmp    1210 <DataFilePath+0xf0>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0xf,%eax
add    $0x30,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
cmpl   $0x2,-0x1c(%rbp)
jge    1257 <DataFilePath+0x137>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2f,(%rax)
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
jmp    125c <DataFilePath+0x13c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115c <DataFilePath+0x3c>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DataFilePath>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xecf(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
call   1040 <memcpy@plt>
mov    (%r14),%al
mov    %eax,%ecx
shr    $0x4,%cl
lea    0x57(%rcx),%edx
or     $0x30,%cl
cmp    $0xa0,%al
movzbl %dl,%eax
movzbl %cl,%ecx
cmovae %eax,%ecx
mov    %cl,0x6(%rbx)
mov    (%r14),%al
and    $0xf,%al
lea    0x57(%rax),%ecx
lea    0x30(%rax),%edx
cmp    $0xa,%al
movzbl %cl,%eax
movzbl %dl,%ecx
cmovae %eax,%ecx
mov    %cl,0x7(%rbx)
movw   $0x2f,0x8(%rbx)
mov    %rbx,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
mov    0x1(%r14),%al
mov    %eax,%ecx
shr    $0x4,%cl
lea    0x57(%rcx),%edx
or     $0x30,%cl
cmp    $0xa0,%al
movzbl %dl,%eax
movzbl %cl,%ecx
cmovae %eax,%ecx
mov    %cl,0x9(%rbx)
mov    0x1(%r14),%al
and    $0xf,%al
lea    0x57(%rax),%ecx
lea    0x30(%rax),%edx
cmp    $0xa,%al
movzbl %cl,%eax
movzbl %dl,%ecx
cmovae %eax,%ecx
mov    %cl,0xa(%rbx)
movw   $0x2f,0xb(%rbx)
mov    %rbx,%rdi
mov    $0x1c0,%esi
call   1030 <mkdir@plt>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x2(%r14,%rax,1),%ecx
mov    %ecx,%edx
shr    $0x4,%dl
lea    0x57(%rdx),%esi
or     $0x30,%dl
cmp    $0xa0,%cl
movzbl %sil,%ecx
movzbl %dl,%edx
cmovae %ecx,%edx
mov    %dl,0xc(%rbx,%rax,2)
movzbl 0x2(%r14,%rax,1),%ecx
and    $0xf,%cl
lea    0x57(%rcx),%edx
lea    0x30(%rcx),%esi
cmp    $0xa,%cl
movzbl %dl,%ecx
movzbl %sil,%edx
cmovae %ecx,%edx
mov    %dl,0xd(%rbx,%rax,2)
add    $0x1,%rax
cmp    $0xe,%rax
jne    11e0 <DataFilePath+0xc0>
movb   $0x0,0xc(%rbx,%rax,2)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"files/\00"
define i32 @DataFilePath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @memcpy(i8* %7, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 7
%11 = getelementptr inbounds i8, i8* %10, i64 -1
store i8* %11, i8** %5
store i32 0, i32* %6
br label %12
12: ; preds = %89, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 16
br i1 %14, label %15, label %92
15: ; preds = %12
%16 = load i8*, i8** %3
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = ashr i32 %21, 4
%23 = icmp sgt i32 %22, 9
br i1 %23, label %24, label %34
24: ; preds = %15
%25 = load i8*, i8** %3
%26 = load i32, i32* %6
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i8, i8* %25, i64 %27
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = ashr i32 %30, 4
%32 = sub nsw i32 %31, 10
%33 = add nsw i32 97, %32
br label %43
34: ; preds = %15
%35 = load i8*, i8** %3
%36 = load i32, i32* %6
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8, i8* %35, i64 %37
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = ashr i32 %40, 4
%42 = add nsw i32 48, %41
br label %43
43: ; preds = %34, %24
%44 = phi i32 [ %33, %24 ], [ %42, %34 ]
%45 = trunc i32 %44 to i8
%46 = load i8*, i8** %5
%47 = getelementptr inbounds i8, i8* %46, i32 1
store i8* %47, i8** %5
store i8 %45, i8* %46
%48 = load i8*, i8** %3
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds i8, i8* %48, i64 %50
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = and i32 %53, 15
%55 = icmp sgt i32 %54, 9
br i1 %55, label %56, label %66
56: ; preds = %43
%57 = load i8*, i8** %3
%58 = load i32, i32* %6
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i8, i8* %57, i64 %59
%61 = load i8, i8* %60
%62 = zext i8 %61 to i32
%63 = and i32 %62, 15
%64 = sub nsw i32 %63, 10
%65 = add nsw i32 97, %64
br label %75
66: ; preds = %43
%67 = load i8*, i8** %3
%68 = load i32, i32* %6
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8, i8* %67, i64 %69
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = and i32 %72, 15
%74 = add nsw i32 48, %73
br label %75
75: ; preds = %66, %56
%76 = phi i32 [ %65, %56 ], [ %74, %66 ]
%77 = trunc i32 %76 to i8
%78 = load i8*, i8** %5
%79 = getelementptr inbounds i8, i8* %78, i32 1
store i8* %79, i8** %5
store i8 %77, i8* %78
%80 = load i32, i32* %6
%81 = icmp slt i32 %80, 2
br i1 %81, label %82, label %88
82: ; preds = %75
%83 = load i8*, i8** %5
%84 = getelementptr inbounds i8, i8* %83, i32 1
store i8* %84, i8** %5
store i8 47, i8* %83
%85 = load i8*, i8** %5
store i8 0, i8* %85
%86 = load i8*, i8** %4
%87 = call i32 @mkdir(i8* %86, i32 448)
br label %88
88: ; preds = %82, %75
br label %89
89: ; preds = %88
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 1
store i32 %91, i32* %6
br label %12
92: ; preds = %12
%93 = load i8*, i8** %5
store i8 0, i8* %93
ret i32 1
}

LLVM IR (-O2):
@.str = [7 x i8] c"files/\00"
define i32 @DataFilePath(i8* nocapture %0, i8* %1) {
%3 = tail call i32 @memcpy(i8* %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 6)
%4 = getelementptr inbounds i8, i8* %1, i64 6
%5 = load i8, i8* %0
%6 = lshr i8 %5, 4
%7 = icmp ugt i8 %5, -97
%8 = add nuw nsw i8 %6, 87
%9 = or i8 %6, 48
%10 = select i1 %7, i8 %8, i8 %9
%11 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %10, i8* %4
%12 = load i8, i8* %0
%13 = and i8 %12, 15
%14 = icmp ugt i8 %13, 9
%15 = add nuw nsw i8 %13, 87
%16 = or i8 %13, 48
%17 = select i1 %14, i8 %15, i8 %16
store i8 %17, i8* %11
%18 = getelementptr inbounds i8, i8* %1, i64 8
%19 = getelementptr inbounds i8, i8* %1, i64 9
store i8 47, i8* %18
store i8 0, i8* %19
%20 = tail call i32 @mkdir(i8* %1, i32 448)
%21 = getelementptr inbounds i8, i8* %0, i64 1
%22 = load i8, i8* %21
%23 = lshr i8 %22, 4
%24 = icmp ugt i8 %22, -97
%25 = add nuw nsw i8 %23, 87
%26 = or i8 %23, 48
%27 = select i1 %24, i8 %25, i8 %26
%28 = getelementptr inbounds i8, i8* %1, i64 10
store i8 %27, i8* %19
%29 = load i8, i8* %21
%30 = and i8 %29, 15
%31 = icmp ugt i8 %30, 9
%32 = add nuw nsw i8 %30, 87
%33 = or i8 %30, 48
%34 = select i1 %31, i8 %32, i8 %33
store i8 %34, i8* %28
%35 = getelementptr inbounds i8, i8* %1, i64 11
%36 = getelementptr inbounds i8, i8* %1, i64 12
store i8 47, i8* %35
store i8 0, i8* %36
%37 = tail call i32 @mkdir(i8* %1, i32 448)
br label %38
38: ; preds = %38, %2
%39 = phi i64 [ 2, %2 ], [ %56, %38 ]
%40 = phi i8* [ %36, %2 ], [ %55, %38 ]
%41 = getelementptr inbounds i8, i8* %0, i64 %39
%42 = load i8, i8* %41
%43 = lshr i8 %42, 4
%44 = icmp ugt i8 %42, -97
%45 = add nuw nsw i8 %43, 87
%46 = or i8 %43, 48
%47 = select i1 %44, i8 %45, i8 %46
%48 = getelementptr inbounds i8, i8* %40, i64 1
store i8 %47, i8* %40
%49 = load i8, i8* %41
%50 = and i8 %49, 15
%51 = icmp ugt i8 %50, 9
%52 = add nuw nsw i8 %50, 87
%53 = or i8 %50, 48
%54 = select i1 %51, i8 %52, i8 %53
%55 = getelementptr inbounds i8, i8* %40, i64 2
store i8 %54, i8* %48
%56 = add nuw nsw i64 %39, 1
%57 = icmp eq i64 %56, 16
br i1 %57, label %58, label %38
58: ; preds = %38
store i8 0, i8* %55
ret i32 1
}