#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*/ path;

/* Variables and functions */
size_t strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int);
const char *fixture_path(const char *base, const char *filename) {
  static char path[1024];
  size_t path_len;
  path_len = strlen(base);
  strncpy(path, base, path_len);
  strncpy(path + path_len, filename, sizeof(path) - path_len);
  return path;
}


x86 assembly (clang, -O0):
<fixture_path>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    %eax,%edx
lea    0x2ef2(%rip),%rdi
call   1030 <strncpy@plt>
lea    0x2ee6(%rip),%rdi
add    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x400,%eax
sub    -0x18(%rbp),%rax
mov    %eax,%edx
call   1030 <strncpy@plt>
lea    0x2ec7(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixture_path>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%rbx
lea    0x2f03(%rip),%r12
mov    %r12,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <strncpy@plt>
mov    %rbx,%rdi
add    %r12,%rdi
mov    $0x400,%edx
sub    %ebx,%edx
mov    %r14,%rsi
call   1030 <strncpy@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@fixture_path.path = internal global [1024 x i8] zeroinitializer
define i8* @fixture_path(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
store i64 %7, i64* %5
%8 = load i8*, i8** %3
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
%11 = call i32 @strncpy(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fixture_path.path, i64 0, i64 0), i8* %8, i32 %10)
%12 = load i64, i64* %5
%13 = getelementptr inbounds i8, i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fixture_path.path, i64 0, i64 0), i64 %12
%14 = load i8*, i8** %4
%15 = load i64, i64* %5
%16 = sub i64 1024, %15
%17 = trunc i64 %16 to i32
%18 = call i32 @strncpy(i8* %13, i8* %14, i32 %17)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fixture_path.path, i64 0, i64 0)
}

LLVM IR (-O2):
@fixture_path.path = internal global [1024 x i8] zeroinitializer
define i8* @fixture_path(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @strncpy(i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fixture_path.path, i64 0, i64 0), i8* %0, i32 %4)
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* @fixture_path.path, i64 0, i64 %3
%7 = sub i32 1024, %4
%8 = tail call i32 @strncpy(i8* %6, i8* %1, i32 %7)
ret i8* getelementptr inbounds ([1024 x i8], [1024 x i8]* @fixture_path.path, i64 0, i64 0)
}