#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char const *);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
FILE *fopenaaa(char *path, char *add0, char *add1, char *name,
               const char *mode) {
  char wholename[200];
  strcpy(wholename, path);
  strcat(wholename, add0);
  strcat(wholename, add1);
  strcat(wholename, name);
  FILE *pointer;
  pointer = fopen(wholename, mode);
  return pointer;
}


x86 assembly (clang, -O0):
<fopenaaa>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0xf0(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <strcat@plt>
lea    -0xf0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <fopen@plt>
mov    %rax,-0xf8(%rbp)
mov    -0xf8(%rbp),%rax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopenaaa>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd0,%rsp
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strcat@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <fopen@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32* @fopenaaa(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [200 x i8]
%12 = alloca i32*
store i8* %0, i8** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%14 = load i8*, i8** %6
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%17 = load i8*, i8** %7
%18 = call i32 @strcat(i8* %16, i8* %17)
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%20 = load i8*, i8** %8
%21 = call i32 @strcat(i8* %19, i8* %20)
%22 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%23 = load i8*, i8** %9
%24 = call i32 @strcat(i8* %22, i8* %23)
%25 = getelementptr inbounds [200 x i8], [200 x i8]* %11, i64 0, i64 0
%26 = load i8*, i8** %10
%27 = call i32* @fopen(i8* %25, i8* %26)
store i32* %27, i32** %12
%28 = load i32*, i32** %12
ret i32* %28
}

LLVM IR (-O2):
define noalias i32* @fopenaaa(i8* %0, i8* %1, i8* %2, i8* %3, i8* nocapture %4) {
%6 = alloca [200 x i8]
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%8 = call i32 @strcpy(i8* %7, i8* %0)
%9 = call i32 @strcat(i8* %7, i8* %1)
%10 = call i32 @strcat(i8* %7, i8* %2)
%11 = call i32 @strcat(i8* %7, i8* %3)
%12 = call i32* @fopen(i8* %7, i8* %4)
ret i32* %12
}