#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*/ m_skynetpath();
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
char *prodefault() {
  static char *xfn = NULL;
  static char xbuf[128];
  if (xfn == NULL) {
    strcpy(xbuf, m_skynetpath());
    strcat(xbuf, "/lib/");
    strcat(xbuf, "protos");
    xfn = xbuf;
  }
  return (xbuf);
}


x86 assembly (clang, -O0):
<prodefault>:
push   %rbp
mov    %rsp,%rbp
cmpq   $0x0,0x2f14(%rip)
jne    118b <prodefault+0x5b>
mov    $0x0,%al
call   1050 <m_skynetpath@plt>
mov    %eax,%esi
lea    0x2f0e(%rip),%rdi
call   1030 <strcpy@plt>
lea    0x2f02(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2eef(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2edc(%rip),%rax
mov    %rax,0x2ec5(%rip)
lea    0x2ece(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prodefault>:
push   %rbx
cmpq   $0x0,0x2f17(%rip)
jne    1178 <prodefault+0x48>
xor    %eax,%eax
call   1050 <m_skynetpath@plt>
lea    0x2f17(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
lea    0xea6(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
lea    0xe9d(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,0x2ed8(%rip)
lea    0x2ee1(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@prodefault.xfn = internal global i8* null
@prodefault.xbuf = internal global [128 x i8] zeroinitializer
@.str = [6 x i8] c"/lib/\00"
@.str.1 = [7 x i8] c"protos\00"
define i8* @prodefault() {
%1 = load i8*, i8** @prodefault.xfn
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = call i32 (...) @m_skynetpath()
%5 = call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i32 %4)
%6 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i8** @prodefault.xfn
br label %8
8: ; preds = %3, %0
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0)
}

LLVM IR (-O2):
@prodefault.xfn = internal unnamed_addr global i8* null
@prodefault.xbuf = internal global [128 x i8] zeroinitializer
@.str = [6 x i8] c"/lib/\00"
@.str.1 = [7 x i8] c"protos\00"
define i8* @prodefault() {
%1 = load i8*, i8** @prodefault.xfn
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %8
3: ; preds = %0
%4 = tail call i32 (...) @m_skynetpath()
%5 = tail call i32 @strcpy(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i32 %4)
%6 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0), i8** @prodefault.xfn
br label %8
8: ; preds = %3, %0
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @prodefault.xbuf, i64 0, i64 0)
}