char *related_folder_get_hint_message(char *attribute_hint_message,
                                      char *related_folder_hint_message,
                                      char *folder_notepad) {
  char *hint_message;
  if (related_folder_hint_message && *related_folder_hint_message) {
    hint_message = related_folder_hint_message;
  } else if (attribute_hint_message && *attribute_hint_message) {
    hint_message = attribute_hint_message;
  } else {
    hint_message = folder_notepad;
  }
  return hint_message;
}


x86 assembly (clang, -O0):
<related_folder_get_hint_message>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1138 <related_folder_get_hint_message+0x38>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <related_folder_get_hint_message+0x38>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    116d <related_folder_get_hint_message+0x6d>
cmpq   $0x0,-0x8(%rbp)
je     1160 <related_folder_get_hint_message+0x60>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1160 <related_folder_get_hint_message+0x60>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1168 <related_folder_get_hint_message+0x68>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    116d <related_folder_get_hint_message+0x6d>
mov    -0x20(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<related_folder_get_hint_message>:
test   %rsi,%rsi
je     110e <related_folder_get_hint_message+0xe>
mov    %rsi,%rax
cmpb   $0x0,(%rsi)
je     110e <related_folder_get_hint_message+0xe>
ret
test   %rdi,%rdi
je     111b <related_folder_get_hint_message+0x1b>
cmpb   $0x0,(%rdi)
mov    %rdi,%rax
jne    110d <related_folder_get_hint_message+0xd>
mov    %rdx,%rax
ret

LLVM IR (-O0):
define i8* @related_folder_get_hint_message(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %17
10: ; preds = %3
%11 = load i8*, i8** %5
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i8*, i8** %5
store i8* %16, i8** %7
br label %30
17: ; preds = %10, %3
%18 = load i8*, i8** %4
%19 = icmp ne i8* %18, null
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = load i8*, i8** %4
store i8* %26, i8** %7
br label %29
27: ; preds = %20, %17
%28 = load i8*, i8** %6
store i8* %28, i8** %7
br label %29
29: ; preds = %27, %25
br label %30
30: ; preds = %29, %15
%31 = load i8*, i8** %7
ret i8* %31
}

LLVM IR (-O2):
define i8* @related_folder_get_hint_message(i8* %0, i8* %1, i8* readnone %2) {
%4 = icmp eq i8* %1, null
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = icmp eq i8 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5, %3
%9 = icmp eq i8* %0, null
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = load i8, i8* %0
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10, %8
br label %14
14: ; preds = %10, %5, %13
%15 = phi i8* [ %2, %13 ], [ %1, %5 ], [ %0, %10 ]
ret i8* %15
}