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

/* Variables and functions */
int /*<<< orphan*/ Com_sprintf(char *, int, char *, char *);
scalar_t__ trap_Cvar_VariableValue(char *);
int /*<<< orphan*/ trap_R_RegisterModel(char *);
void UI_RegisterHeadstyle(char *mouthName, char *eyesName, char *headName) {
  char filename[64];
  if (trap_Cvar_VariableValue("cg_disableHeadstuff")) {
    return;
  }
  if (mouthName) {
    Com_sprintf(filename, sizeof(filename),
                "models/players/heads/accessoires/m_%s.md3", mouthName);
    trap_R_RegisterModel(filename);
  }
  if (headName) {
    Com_sprintf(filename, sizeof(filename),
                "models/players/heads/accessoires/h_%s.md3", headName);
    trap_R_RegisterModel(filename);
  }
  if (eyesName) {
    Com_sprintf(filename, sizeof(filename),
                "models/players/heads/accessoires/e_%s.md3", eyesName);
    trap_R_RegisterModel(filename);
  }
}


x86 assembly (clang, -O0):
<UI_RegisterHeadstyle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
call   1050 <trap_Cvar_VariableValue@plt>
cmp    $0x0,%rax
je     115f <UI_RegisterHeadstyle+0x2f>
jmp    11e6 <UI_RegisterHeadstyle+0xb6>
cmpq   $0x0,-0x8(%rbp)
je     118c <UI_RegisterHeadstyle+0x5c>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x40,%esi
lea    0xe96(%rip),%rdx
call   1040 <Com_sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <trap_R_RegisterModel@plt>
cmpq   $0x0,-0x18(%rbp)
je     11b9 <UI_RegisterHeadstyle+0x89>
lea    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x40,%esi
lea    0xe93(%rip),%rdx
call   1040 <Com_sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <trap_R_RegisterModel@plt>
cmpq   $0x0,-0x10(%rbp)
je     11e6 <UI_RegisterHeadstyle+0xb6>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    $0x40,%esi
lea    0xe90(%rip),%rdx
call   1040 <Com_sprintf@plt>
lea    -0x60(%rbp),%rdi
call   1030 <trap_R_RegisterModel@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UI_RegisterHeadstyle>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb5(%rip),%rdi
call   1050 <trap_Cvar_VariableValue@plt>
test   %rax,%rax
jne    11ca <UI_RegisterHeadstyle+0x9a>
test   %rbx,%rbx
je     117c <UI_RegisterHeadstyle+0x4c>
lea    0xeb3(%rip),%rdx
mov    %rsp,%r12
mov    %r12,%rdi
mov    $0x40,%esi
mov    %rbx,%rcx
call   1040 <Com_sprintf@plt>
mov    %r12,%rdi
call   1030 <trap_R_RegisterModel@plt>
test   %r15,%r15
je     11a3 <UI_RegisterHeadstyle+0x73>
lea    0xeb6(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r15,%rcx
call   1040 <Com_sprintf@plt>
mov    %rbx,%rdi
call   1030 <trap_R_RegisterModel@plt>
test   %r14,%r14
je     11ca <UI_RegisterHeadstyle+0x9a>
lea    0xeb9(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
mov    %r14,%rcx
call   1040 <Com_sprintf@plt>
mov    %rbx,%rdi
call   1030 <trap_R_RegisterModel@plt>
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"cg_disableHeadstuff\00"
@.str.1 = [42 x i8] c"models/players/heads/accessoires/m_%s.md3\00"
@.str.2 = [42 x i8] c"models/players/heads/accessoires/h_%s.md3\00"
@.str.3 = [42 x i8] c"models/players/heads/accessoires/e_%s.md3\00"
define void @UI_RegisterHeadstyle(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [64 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = call i64 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %3
br label %38
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %20
14: ; preds = %11
%15 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%16 = load i8*, i8** %4
%17 = call i32 @Com_sprintf(i8* %15, i32 64, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%19 = call i32 @trap_R_RegisterModel(i8* %18)
br label %20
20: ; preds = %14, %11
%21 = load i8*, i8** %6
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%25 = load i8*, i8** %6
%26 = call i32 @Com_sprintf(i8* %24, i32 64, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %25)
%27 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%28 = call i32 @trap_R_RegisterModel(i8* %27)
br label %29
29: ; preds = %23, %20
%30 = load i8*, i8** %5
%31 = icmp ne i8* %30, null
br i1 %31, label %32, label %38
32: ; preds = %29
%33 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%34 = load i8*, i8** %5
%35 = call i32 @Com_sprintf(i8* %33, i32 64, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [64 x i8], [64 x i8]* %7, i64 0, i64 0
%37 = call i32 @trap_R_RegisterModel(i8* %36)
br label %38
38: ; preds = %10, %32, %29
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"cg_disableHeadstuff\00"
@.str.1 = [42 x i8] c"models/players/heads/accessoires/m_%s.md3\00"
@.str.2 = [42 x i8] c"models/players/heads/accessoires/h_%s.md3\00"
@.str.3 = [42 x i8] c"models/players/heads/accessoires/e_%s.md3\00"
define void @UI_RegisterHeadstyle(i8* %0, i8* %1, i8* %2) {
%4 = alloca [64 x i8]
%5 = getelementptr inbounds [64 x i8], [64 x i8]* %4, i64 0, i64 0
%6 = tail call i64 @trap_Cvar_VariableValue(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %23
8: ; preds = %3
%9 = icmp eq i8* %0, null
br i1 %9, label %13, label %10
10: ; preds = %8
%11 = call i32 @Com_sprintf(i8* %5, i32 64, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%12 = call i32 @trap_R_RegisterModel(i8* %5)
br label %13
13: ; preds = %10, %8
%14 = icmp eq i8* %2, null
br i1 %14, label %18, label %15
15: ; preds = %13
%16 = call i32 @Com_sprintf(i8* %5, i32 64, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%17 = call i32 @trap_R_RegisterModel(i8* %5)
br label %18
18: ; preds = %15, %13
%19 = icmp eq i8* %1, null
br i1 %19, label %23, label %20
20: ; preds = %18
%21 = call i32 @Com_sprintf(i8* %5, i32 64, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%22 = call i32 @trap_R_RegisterModel(i8* %5)
br label %23
23: ; preds = %18, %20, %3
ret void
}