#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 */
char *getenv(char *);
int /*<<< orphan*/ strcat(char *, char const *);
int /*<<< orphan*/ strcpy(char *, char const *);
void make_config_dir_name(char *oname, const char *iname) {
  const char *home_dir = getenv("HOME");
  if (home_dir) {
    strcpy(oname, home_dir);
    strcat(oname, "/.find_orb/");
  } else
    *oname = '\0';
  strcat(oname, iname);
}


x86 assembly (clang, -O0):
<make_config_dir_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117d <make_config_dir_name+0x4d>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <strcat@plt>
jmp    1184 <make_config_dir_name+0x54>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_config_dir_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xebf(%rip),%rdi
call   1030 <getenv@plt>
test   %rax,%rax
je     1167 <make_config_dir_name+0x37>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1040 <strcpy@plt>
lea    0xea8(%rip),%rsi
mov    %rbx,%rdi
call   1050 <strcat@plt>
jmp    116a <make_config_dir_name+0x3a>
movb   $0x0,(%rbx)
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <strcat@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [12 x i8] c"/.find_orb/\00"
define void @make_config_dir_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8* %6, i8** %5
%7 = load i8*, i8** %5
%8 = icmp ne i8* %7, null
br i1 %8, label %9, label %15
9: ; preds = %2
%10 = load i8*, i8** %3
%11 = load i8*, i8** %5
%12 = call i32 @strcpy(i8* %10, i8* %11)
%13 = load i8*, i8** %3
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %17
15: ; preds = %2
%16 = load i8*, i8** %3
store i8 0, i8* %16
br label %17
17: ; preds = %15, %9
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @strcat(i8* %18, i8* %19)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"HOME\00"
@.str.1 = [12 x i8] c"/.find_orb/\00"
define void @make_config_dir_name(i8* %0, i8* %1) {
%3 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @strcpy(i8* %0, i8* %3)
%7 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %9
8: ; preds = %2
store i8 0, i8* %0
br label %9
9: ; preds = %8, %5
%10 = tail call i32 @strcat(i8* %0, i8* %1)
ret void
}