#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*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
char *RoomFilePath(char *dirRooms, char *strRoom) {
  char *RetVal;
  strcpy(RetVal, "");
  strcat(RetVal, "~/");
  strcat(RetVal, dirRooms);
  strcat(RetVal, "/");
  strcat(RetVal, strRoom);
  strcat(RetVal, ".txt");
  return RetVal;
}


x86 assembly (clang, -O0):
<RoomFilePath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xec7(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xe99(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcat@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RoomFilePath>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xed1(%rip),%rsi
call   1030 <strcpy@plt>
lea    0xec3(%rip),%rsi
call   1040 <strcat@plt>
mov    %rbx,%rsi
call   1040 <strcat@plt>
lea    0xeb0(%rip),%rsi
call   1040 <strcat@plt>
mov    %r14,%rsi
call   1040 <strcat@plt>
lea    0xe9e(%rip),%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <strcat@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"~/\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [5 x i8] c".txt\00"
define i8* @RoomFilePath(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %5
%7 = call i32 @strcpy(i8* %6, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %5
%9 = call i32 @strcat(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8*, i8** %5
%11 = load i8*, i8** %3
%12 = call i32 @strcat(i8* %10, i8* %11)
%13 = load i8*, i8** %5
%14 = call i32 @strcat(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8*, i8** %5
%16 = load i8*, i8** %4
%17 = call i32 @strcat(i8* %15, i8* %16)
%18 = load i8*, i8** %5
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
%20 = load i8*, i8** %5
ret i8* %20
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"~/\00"
@.str.2 = [2 x i8] c"/\00"
@.str.3 = [5 x i8] c".txt\00"
define noalias i8* @RoomFilePath(i8* %0, i8* %1) {
%3 = tail call i32 @strcpy(i8* undef, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcat(i8* undef, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @strcat(i8* undef, i8* %0)
%6 = tail call i32 @strcat(i8* undef, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @strcat(i8* undef, i8* %1)
%8 = tail call i32 @strcat(i8* undef, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
ret i8* undef
}