#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 debugfs__strerror_open(int, char *, size_t, char *);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char *);
int debugfs__strerror_open_tp(int err, char *buf, size_t size, const char *sys,
                              const char *name) {
  char path[4096];
  snprintf(path, 4096, "tracing/events/%s/%s", sys, name ?: "*");
  return debugfs__strerror_open(err, buf, size, path);
}


x86 assembly (clang, -O0):
<debugfs__strerror_open_tp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1050,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    -0x1030(%rbp),%rax
mov    %rax,-0x1048(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x1040(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x1038(%rbp)
cmp    $0x0,%rax
je     117f <debugfs__strerror_open_tp+0x5f>
mov    -0x1038(%rbp),%rax
mov    %rax,-0x1050(%rbp)
jmp    1192 <debugfs__strerror_open_tp+0x72>
lea    0xe8f(%rip),%rax
mov    %rax,-0x1050(%rbp)
jmp    1192 <debugfs__strerror_open_tp+0x72>
mov    -0x1040(%rbp),%rcx
mov    -0x1048(%rbp),%rdi
mov    -0x1050(%rbp),%r8
mov    $0x1000,%esi
lea    0xe4d(%rip),%rdx
call   1030 <snprintf@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x1030(%rbp),%rcx
call   1040 <debugfs__strerror_open@plt>
add    $0x1050,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debugfs__strerror_open_tp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x1008,%rsp
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %edi,%ebp
test   %r8,%r8
lea    0xed6(%rip),%rax
cmove  %rax,%r8
lea    0xeb6(%rip),%rdx
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1000,%esi
call   1030 <snprintf@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    %r15,%rcx
call   1040 <debugfs__strerror_open@plt>
add    $0x1008,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"tracing/events/%s/%s\00"
@.str.1 = [2 x i8] c"*\00"
define i32 @debugfs__strerror_open_tp(i32 %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca [4096 x i8]
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%12 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%13 = load i8*, i8** %9
%14 = load i8*, i8** %10
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %5
br label %18
17: ; preds = %5
br label %18
18: ; preds = %17, %16
%19 = phi i8* [ %14, %16 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), %17 ]
%20 = call i32 @snprintf(i8* %12, i32 4096, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %13, i8* %19)
%21 = load i32, i32* %6
%22 = load i8*, i8** %7
%23 = load i64, i64* %8
%24 = getelementptr inbounds [4096 x i8], [4096 x i8]* %11, i64 0, i64 0
%25 = call i32 @debugfs__strerror_open(i32 %21, i8* %22, i64 %23, i8* %24)
ret i32 %25
}

LLVM IR (-O2):
@.str = [21 x i8] c"tracing/events/%s/%s\00"
@.str.1 = [2 x i8] c"*\00"
define i32 @debugfs__strerror_open_tp(i32 %0, i8* %1, i64 %2, i8* %3, i8* %4) {
%6 = alloca [4096 x i8]
%7 = getelementptr inbounds [4096 x i8], [4096 x i8]* %6, i64 0, i64 0
%8 = icmp eq i8* %4, null
%9 = select i1 %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %4
%10 = call i32 @snprintf(i8* %7, i32 4096, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %9)
%11 = call i32 @debugfs__strerror_open(i32 %0, i8* %1, i64 %2, i8* %7)
ret i32 %11
}