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

/* Variables and functions */
int Com_LocalPlayerForCvarName(char const *);
int /*<<< orphan*/ Q_strncpyz(char *, char const *, int);
const char *Com_LocalPlayerBaseCvarName(const char *in_cvarName) {
  static char baseName[256];
  int localPlayerNum;
  localPlayerNum = Com_LocalPlayerForCvarName(in_cvarName);
  if (localPlayerNum == 0) {
    Q_strncpyz(baseName, in_cvarName, sizeof(baseName));
  } else if (in_cvarName[0] == '+' || in_cvarName[0] == '-') {
    baseName[0] = in_cvarName[0];
    Q_strncpyz(baseName + 1, in_cvarName + 2, sizeof(baseName) - 1);
  } else {
    Q_strncpyz(baseName, in_cvarName + 1, sizeof(baseName));
  }
  return baseName;
}


x86 assembly (clang, -O0):
<Com_LocalPlayerBaseCvarName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <Com_LocalPlayerForCvarName@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    115c <Com_LocalPlayerBaseCvarName+0x3c>
mov    -0x8(%rbp),%rsi
lea    0x2ef3(%rip),%rdi
mov    $0x100,%edx
call   1040 <Q_strncpyz@plt>
jmp    11c8 <Com_LocalPlayerBaseCvarName+0xa8>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     117c <Com_LocalPlayerBaseCvarName+0x5c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    11aa <Com_LocalPlayerBaseCvarName+0x8a>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,0x2eb8(%rip)
mov    -0x8(%rbp),%rsi
add    $0x2,%rsi
lea    0x2ea9(%rip),%rdi
add    $0x1,%rdi
mov    $0xff,%edx
call   1040 <Q_strncpyz@plt>
jmp    11c3 <Com_LocalPlayerBaseCvarName+0xa3>
mov    -0x8(%rbp),%rsi
add    $0x1,%rsi
lea    0x2e87(%rip),%rdi
mov    $0x100,%edx
call   1040 <Q_strncpyz@plt>
jmp    11c8 <Com_LocalPlayerBaseCvarName+0xa8>
lea    0x2e71(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_LocalPlayerBaseCvarName>:
push   %rbx
mov    %rdi,%rbx
call   1030 <Com_LocalPlayerForCvarName@plt>
test   %eax,%eax
je     1156 <Com_LocalPlayerBaseCvarName+0x36>
mov    (%rbx),%al
cmp    $0x2d,%al
je     1137 <Com_LocalPlayerBaseCvarName+0x17>
cmp    $0x2b,%al
jne    1152 <Com_LocalPlayerBaseCvarName+0x32>
mov    %al,0x2f03(%rip)
add    $0x2,%rbx
lea    0x2ef9(%rip),%rdi
mov    %rbx,%rsi
mov    $0xff,%edx
jmp    1165 <Com_LocalPlayerBaseCvarName+0x45>
add    $0x1,%rbx
lea    0x2ee3(%rip),%rdi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <Q_strncpyz@plt>
lea    0x2ecf(%rip),%rax
pop    %rbx
ret

LLVM IR (-O0):
@Com_LocalPlayerBaseCvarName.baseName = internal global [256 x i8] zeroinitializer
define i8* @Com_LocalPlayerBaseCvarName(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @Com_LocalPlayerForCvarName(i8* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @Q_strncpyz(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0), i8* %9, i32 256)
br label %35
11: ; preds = %1
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp eq i32 %15, 43
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 0
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 45
br i1 %22, label %23, label %30
23: ; preds = %17, %11
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
store i8 %26, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0)
%27 = load i8*, i8** %2
%28 = getelementptr inbounds i8, i8* %27, i64 2
%29 = call i32 @Q_strncpyz(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 1), i8* %28, i32 255)
br label %34
30: ; preds = %17
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 1
%33 = call i32 @Q_strncpyz(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0), i8* %32, i32 256)
br label %34
34: ; preds = %30, %23
br label %35
35: ; preds = %34, %8
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0)
}

LLVM IR (-O2):
@Com_LocalPlayerBaseCvarName.baseName = internal global [256 x i8] zeroinitializer
define i8* @Com_LocalPlayerBaseCvarName(i8* %0) {
%2 = tail call i32 @Com_LocalPlayerForCvarName(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @Q_strncpyz(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0), i8* %0, i32 256)
br label %14
6: ; preds = %1
%7 = load i8, i8* %0
switch i8 %7, label %11 [
i8 43, label %8
i8 45, label %8
]
8: ; preds = %6, %6
store i8 %7, i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0)
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = tail call i32 @Q_strncpyz(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 1), i8* %9, i32 255)
br label %14
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %0, i64 1
%13 = tail call i32 @Q_strncpyz(i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0), i8* %12, i32 256)
br label %14
14: ; preds = %8, %11, %4
ret i8* getelementptr inbounds ([256 x i8], [256 x i8]* @Com_LocalPlayerBaseCvarName.baseName, i64 0, i64 0)
}