const char *aoran(const char *str) {
  static char temp[4096];
  if (!str) {
    bug("Aoran(): NULL str");
    return "";
  }
  if (isavowel(str[0]) ||
      (strlen(str) > 1 &&
       ((str[0]) >= 'A' && (str[0]) <= 'Z' ? (str[0]) + 'a' - 'A' : (str[0])) ==
           'y' &&
       !isavowel(str[1])))
    mudstrlcpy(temp, "an ", 4096);
  else
    mudstrlcpy(temp, "a ", 4096);
  mudstrlcat(temp, str, 4096);
  return temp;
}


x86 assembly (clang, -O0):
<aoran>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1185 <aoran+0x35>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <bug@plt>
lea    0xe9c(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    126d <aoran+0x11d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
mov    $0x0,%al
call   1070 <isavowel@plt>
cmp    $0x0,%eax
jne    1212 <aoran+0xc2>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%rax
jbe    1231 <aoran+0xe1>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x41,%eax
jl     11e4 <aoran+0x94>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5a,%eax
jg     11e4 <aoran+0x94>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0x61,%eax
sub    $0x41,%eax
mov    %eax,-0x14(%rbp)
jmp    11ee <aoran+0x9e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    $0x79,%eax
jne    1231 <aoran+0xe1>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%edi
mov    $0x0,%al
call   1070 <isavowel@plt>
cmp    $0x0,%eax
jne    1231 <aoran+0xe1>
lea    0x2e47(%rip),%rdi
lea    0xdf2(%rip),%rsi
mov    $0x1000,%edx
mov    $0x0,%al
call   1050 <mudstrlcpy@plt>
jmp    124b <aoran+0xfb>
lea    0x2e28(%rip),%rdi
lea    0xdd7(%rip),%rsi
mov    $0x1000,%edx
mov    $0x0,%al
call   1050 <mudstrlcpy@plt>
mov    -0x10(%rbp),%rsi
lea    0x2e0a(%rip),%rdi
mov    $0x1000,%edx
mov    $0x0,%al
call   1060 <mudstrlcat@plt>
lea    0x2df7(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aoran>:
push   %r15
push   %r14
push   %rbx
test   %rdi,%rdi
je     11d9 <aoran+0x89>
mov    %rdi,%r15
movsbl (%rdi),%edi
xor    %eax,%eax
call   1070 <isavowel@plt>
lea    0xea4(%rip),%r14
test   %eax,%eax
jne    11ac <aoran+0x5c>
mov    %r15,%rdi
call   1040 <strlen@plt>
cmp    $0x2,%rax
jb     11a5 <aoran+0x55>
movsbl (%r15),%eax
lea    -0x41(%rax),%ecx
lea    0x20(%rax),%edx
cmp    $0x1a,%cl
cmovae %eax,%edx
cmp    $0x79,%edx
jne    11a5 <aoran+0x55>
movsbl 0x1(%r15),%edi
xor    %eax,%eax
call   1070 <isavowel@plt>
test   %eax,%eax
je     11ac <aoran+0x5c>
lea    0xe6a(%rip),%r14
lea    0x2ead(%rip),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1000,%edx
xor    %eax,%eax
call   1050 <mudstrlcpy@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x1000,%edx
xor    %eax,%eax
call   1060 <mudstrlcat@plt>
jmp    11ee <aoran+0x9e>
lea    0xe20(%rip),%rdi
xor    %eax,%eax
call   1030 <bug@plt>
lea    0xe2a(%rip),%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@aoran.temp = internal global [4096 x i8] zeroinitializer
@.str = [18 x i8] c"Aoran(): NULL str\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"an \00"
@.str.3 = [3 x i8] c"a \00"
define i8* @aoran(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @bug to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %60
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = call i32 (i32, ...) bitcast (i32 (...)* @isavowel to i32 (i32, ...)*)(i32 %12)
%14 = icmp ne i32 %13, 0
br i1 %14, label %53, label %15
15: ; preds = %8
%16 = load i8*, i8** %3
%17 = call i64 @strlen(i8* %16)
%18 = icmp ugt i64 %17, 1
br i1 %18, label %19, label %55
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp sge i32 %23, 65
br i1 %24, label %25, label %38
25: ; preds = %19
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 90
br i1 %30, label %31, label %38
31: ; preds = %25
%32 = load i8*, i8** %3
%33 = getelementptr inbounds i8, i8* %32, i64 0
%34 = load i8, i8* %33
%35 = sext i8 %34 to i32
%36 = add nsw i32 %35, 97
%37 = sub nsw i32 %36, 65
br label %43
38: ; preds = %25, %19
%39 = load i8*, i8** %3
%40 = getelementptr inbounds i8, i8* %39, i64 0
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
br label %43
43: ; preds = %38, %31
%44 = phi i32 [ %37, %31 ], [ %42, %38 ]
%45 = icmp eq i32 %44, 121
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i8*, i8** %3
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = call i32 (i32, ...) bitcast (i32 (...)* @isavowel to i32 (i32, ...)*)(i32 %50)
%52 = icmp ne i32 %51, 0
br i1 %52, label %55, label %53
53: ; preds = %46, %8
%54 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mudstrlcpy to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 4096)
br label %57
55: ; preds = %46, %43, %15
%56 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mudstrlcpy to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 4096)
br label %57
57: ; preds = %55, %53
%58 = load i8*, i8** %3
%59 = call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mudstrlcat to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), i8* %58, i32 4096)
store i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), i8** %2
br label %60
60: ; preds = %57, %6
%61 = load i8*, i8** %2
ret i8* %61
}

LLVM IR (-O2):
@aoran.temp = internal global [4096 x i8] zeroinitializer
@.str = [18 x i8] c"Aoran(): NULL str\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [4 x i8] c"an \00"
@.str.3 = [3 x i8] c"a \00"
define i8* @aoran(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @bug to i32 (i8*, ...)*)(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
br label %32
5: ; preds = %1
%6 = load i8, i8* %0
%7 = sext i8 %6 to i32
%8 = tail call i32 (i32, ...) bitcast (i32 (...)* @isavowel to i32 (i32, ...)*)(i32 %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %5
%11 = tail call i64 @strlen(i8* %0)
%12 = icmp ugt i64 %11, 1
br i1 %12, label %13, label %27
13: ; preds = %10
%14 = load i8, i8* %0
%15 = sext i8 %14 to i32
%16 = add i8 %14, -65
%17 = icmp ult i8 %16, 26
%18 = add nsw i32 %15, 32
%19 = select i1 %17, i32 %18, i32 %15
%20 = icmp eq i32 %19, 121
br i1 %20, label %21, label %27
21: ; preds = %13
%22 = getelementptr inbounds i8, i8* %0, i64 1
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = tail call i32 (i32, ...) bitcast (i32 (...)* @isavowel to i32 (i32, ...)*)(i32 %24)
%26 = icmp eq i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %21, %13, %10
br label %28
28: ; preds = %5, %21, %27
%29 = phi i8* [ getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), %27 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %21 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), %5 ]
%30 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mudstrlcpy to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), i8* %29, i32 4096)
%31 = tail call i32 (i8*, i8*, i32, ...) bitcast (i32 (...)* @mudstrlcat to i32 (i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), i8* %0, i32 4096)
br label %32
32: ; preds = %28, %3
%33 = phi i8* [ getelementptr inbounds ([4096 x i8], [4096 x i8]* @aoran.temp, i64 0, i64 0), %28 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %3 ]
ret i8* %33
}