LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_stats.c
// Function: Cmd_PlayerStats_f
void Cmd_PlayerStats_f (edict_t *ent)
{
	edict_t *temp, *target;
	stats_player_s *p_player;
	int i;
	char *p;
	char lowerstr[MAX_INFO_STRING];

	p = gi.args();

	if (p && strlen(p))
	{
		LowerCase(p);
		target = NULL;
		for (i=0 ; i<game.maxclients ; i++)
		{
			temp = g_edicts + 1 + i;
			strcpy(lowerstr, temp->client->pers.netname);
			LowerCase(lowerstr);
			if (strstr(lowerstr, p))
			{
				target = temp;
				break;
			}
		}
	}
	else
		target = ent;

	if (!target)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Cannot find a matching player.\n");
		return;
	}

	p_player = target->client->p_stats_player;
	stats_output(ent, p_player);

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq %rdi, %rbx
movq 0x43014(%rip), %rax     # 0x66600
callq *0x148(%rax)
testq %rax, %rax
movq %rbx, 0x8(%rsp)
je 0x23674
movq %rax, %r14
cmpb $0x0, (%rax)
je 0x23674
movq %r14, %rdi
callq 0x18e00
pushq $-0x1
popq %r13
xorl %r12d, %r12d
movl $0x2c0, %ebx            # imm = 0x2C0
leaq 0x10(%rsp), %r15
movq 0x4371c(%rip), %rax     # 0x66d40
movslq 0x610(%rax), %rax
incq %r13
cmpq %rax, %r13
jge 0x23693
movq 0x42f1e(%rip), %rax     # 0x66558
movq (%rax), %rbp
movq 0x500(%rbp,%r12), %rsi
addq %rbx, %rsi
addq $0x4a8, %r12            # imm = 0x4A8
movq %r15, %rdi
callq 0x182c0
movq %r15, %rdi
callq 0x18e00
movq %r15, %rdi
movq %r14, %rsi
callq 0x19b60
testq %rax, %rax
je 0x2361d
addq %r12, %rbp
jmp 0x2367c
movq %rbx, %rbp
testq %rbx, %rbx
je 0x23693
movq 0x58(%rbp), %rax
movq 0x9138(%rax), %rsi
movq 0x8(%rsp), %rdi
callq 0x19aa0
jmp 0x236a7
leaq 0x2c829(%rip), %rdx     # 0x4fec3
pushq $0x2
popq %rsi
movq 0x8(%rsp), %rdi
callq 0x18ec0
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/p_stats.c
// Function: Cmd_StatsAll_f
void Cmd_StatsAll_f (edict_t *ent)
{
	stats_player_s *p_player;

	p_player = p_start_player;
	while (p_player != NULL)
	{
		stats_output(ent, p_player);
		p_player = p_player->pNext;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x43271(%rip), %r14     # 0x66938
movq (%r14), %r14
testq %r14, %r14
je 0x236e3
movq %rbx, %rdi
movq %r14, %rsi
callq 0x19aa0
addq $0x280, %r14            # imm = 0x280
jmp 0x236c7
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_MaybeOpenFile
static int _sl_MaybeOpenFile( game_import_t  *gi )
{
    if( NULL == logfile )
        logfile = gi->cvar( "stdlogfile", "0", CVAR_SERVERINFO );

    if( (NULL != logfile) && (logfile->value != 0) )
    {
        if( NULL == StdLogFile )
        {
            cvar_t   *filename  = gi->cvar( "stdlogname", "StdLog.log", CVAR_SERVERINFO );
            char     *pName     = "StdLog.log";

            // Open File
            if( filename )
                pName = filename->string;

            StdLogFile = fopen( pName, "a+t" );

            if( NULL == StdLogFile )
            {
                gi->error( "Couldn't open %s", pName );
            }
        }
    }

    return (NULL != StdLogFile);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x4d28c(%rip), %rax     # 0x70988
testq %rax, %rax
jne 0x23724
leaq 0x2c7db(%rip), %rdi     # 0x4fee3
leaq 0x3399d(%rip), %rsi     # 0x570ac
pushq $0x4
popq %rdx
callq *0x120(%rbx)
movq %rax, 0x4d269(%rip)     # 0x70988
testq %rax, %rax
je 0x2378a
movss 0x20(%rax), %xmm0
xorps %xmm1, %xmm1
ucomiss %xmm1, %xmm0
jne 0x23733
jnp 0x2378a
cmpq $0x0, 0x4d255(%rip)     # 0x70990
jne 0x2378a
leaq 0x2c197(%rip), %rdi     # 0x4f8db
leaq 0x2c7a3(%rip), %r14     # 0x4feee
pushq $0x4
popq %rdx
movq %r14, %rsi
callq *0x120(%rbx)
testq %rax, %rax
je 0x23760
movq 0x8(%rax), %r14
leaq 0x2c792(%rip), %rsi     # 0x4fef9
movq %r14, %rdi
callq 0x19620
movq %rax, 0x4d21a(%rip)     # 0x70990
testq %rax, %rax
jne 0x2378a
leaq 0x2c77b(%rip), %rdi     # 0x4fefd
movq %r14, %rsi
xorl %eax, %eax
callq *0x38(%rbx)
xorl %eax, %eax
cmpq $0x0, 0x4d1fc(%rip)     # 0x70990
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_CloseLogFile
static void _sl_MaybeCloseFile( void )
{
    if( logfile && StdLogFile) // LM_JORM -- was "if ( NULL != logfile)"
    {
        fclose( StdLogFile );
    }

    StdLogFile = NULL;
    logfile    = NULL;
    logstyle   = NULL;
    uiLogstyle  = 0;
}

// Assembly:
cmpq $0x0, 0x4d1e1(%rip)     # 0x70988
setne %al
movq 0x4d1df(%rip), %rdi     # 0x70990
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x237c8
pushq %rax
callq 0x185e0
addq $0x8, %rsp
andq $0x0, 0x4d1c0(%rip)     # 0x70990
andq $0x0, 0x4d1b0(%rip)     # 0x70988
andq $0x0, 0x4d1b8(%rip)     # 0x70998
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_LogScore
void sl_LogScore( game_import_t  *gi,
                  char           *pKillerName,
                  char           *pTargetName,
                  char           *pScoreType,
                  char           *pWeaponName,
                  int             iScore,
                  float           timeInSeconds )
{
    if (!Match_CanScore())
        return;

    if( _sl_MaybeOpenFile( gi ) )
    {
        _sl_SetStyle( gi );
        _sl_LogStyles[uiLogstyle].pLogScore( pKillerName, pTargetName, pScoreType, pWeaponName, iScore, timeInSeconds );
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movl %r9d, %ebx
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbp
xorl %eax, %eax
callq 0x19130
testl %eax, %eax
je 0x239b7
movq %rbp, %rdi
callq 0x236ee
testl %eax, %eax
je 0x239b7
movq %rbp, %rdi
callq 0x237fe
movq %r13, %rdi
movq %r12, %rsi
movq %r15, %rdx
movq %r14, %rcx
movl %ebx, %r8d
movss 0x4(%rsp), %xmm0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x23cd3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_LogPatch
static void _sl_LogPatch( char *pPatchName )
{
    if( NULL != pPatchName )
    {
        fprintf( StdLogFile, "\t\tPatchName\t%s\n", pPatchName );
    }
    else
    {
        fprintf( StdLogFile, "\t\tPatchName\t\n" );
    }
}

// Assembly:
movq 0x4ce1b(%rip), %rcx     # 0x70990
testq %rdi, %rdi
je 0x23b8e
movq %rdi, %rdx
leaq 0x2c3a4(%rip), %rsi     # 0x4ff28
movq %rcx, %rdi
xorl %eax, %eax
jmp 0x18cb0
leaq 0x2c3a3(%rip), %rdi     # 0x4ff38
pushq $0xd
popq %rsi
pushq $0x1
popq %rdx
jmp 0x198e0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_LogDate
static void _sl_LogDate( void )
{
    time_t t;

    /* Get the time */
    t = time(NULL);
    if( -1 != t )
    {
        struct tm  *ptm;

        ptm = localtime( &t );
        if( NULL != ptm )
        {
            char        date[MAX_DATE_STRLEN+1] = {0};

            strftime( &date[0],
                      (sizeof(date)/sizeof(date[0]))-1,
                      "%d %b %Y",
                      ptm );

            fprintf( StdLogFile, "\t\tLogDate\t%s\n", &date[0] );
        }
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
xorl %edi, %edi
callq 0x18f10
movq %rax, 0x8(%rsp)
cmpq $-0x1, %rax
je 0x23c03
leaq 0x8(%rsp), %rdi
callq 0x181a0
testq %rax, %rax
je 0x23c03
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
andq $0x0, 0xe(%rbx)
leaq 0x2c369(%rip), %rdx     # 0x4ff46
pushq $0x15
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x19450
movq 0x4cd9e(%rip), %rdi     # 0x70990
leaq 0x2c356(%rip), %rsi     # 0x4ff4f
movq %rbx, %rdx
xorl %eax, %eax
callq 0x18cb0
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_LogTime
static void _sl_LogTime( void )
{
    time_t t;

    /* Get the time */
    t = time(NULL);
    if( -1 != t )
    {
        struct tm  *ptm;

        ptm = localtime( &t );
        if( NULL != ptm )
        {
            char        time[MAX_TIME_STRLEN+1] = {0};

            strftime( &time[0],
                      (sizeof(time)/sizeof(time[0]))-1,
                      "%H:%M:%S",
                      ptm );

            fprintf( StdLogFile, "\t\tLogTime\t%s\n", &time[0] );
        }
    }
}

// Assembly:
pushq %rbx
subq $0x30, %rsp
xorl %edi, %edi
callq 0x18f10
movq %rax, 0x8(%rsp)
cmpq $-0x1, %rax
je 0x23c6b
leaq 0x8(%rsp), %rdi
callq 0x181a0
testq %rax, %rax
je 0x23c6b
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rbx
movaps %xmm0, (%rbx)
andl $0x0, 0xf(%rbx)
leaq 0x2c318(%rip), %rdx     # 0x4ff5d
pushq $0x12
popq %rsi
movq %rbx, %rdi
movq %rax, %rcx
callq 0x19450
movq 0x4cd36(%rip), %rdi     # 0x70990
leaq 0x2c305(%rip), %rsi     # 0x4ff66
movq %rbx, %rdx
xorl %eax, %eax
callq 0x18cb0
addq $0x30, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/stdlog.c
// Function: sl_LogScore
static void _sl_LogScore( char *pKillerName,
                          char *pTargetName,
                          char *pScoreType,
                          char *pWeaponName,
                          int   iScore,
                          float timeInSeconds )
{
    /* Killer Name */
    if( NULL != pKillerName )
        fprintf( StdLogFile, "%s", pKillerName );
    fprintf( StdLogFile, "\t" );

    /* Target Name */
    if( NULL != pTargetName )
        fprintf( StdLogFile, "%s", pTargetName );
    fprintf( StdLogFile, "\t" );

    /* Score Type */
    if( NULL != pScoreType )
        fprintf( StdLogFile, "%s", pScoreType );
    fprintf( StdLogFile, "\t" );

    /* Weapon Name */
    if( NULL != pWeaponName )
        fprintf( StdLogFile, "%s", pWeaponName );
    fprintf( StdLogFile, "\t" );

    /* Score & Time */
    fprintf( StdLogFile, "%d\t%.1f\n", iScore, timeInSeconds );
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movss %xmm0, 0x4(%rsp)
movl %r8d, %ebx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r12
testq %rdi, %rdi
je 0x23cfe
movq 0x4cc97(%rip), %rsi     # 0x70990
callq 0x18850
movq 0x4cc8b(%rip), %rsi     # 0x70990
pushq $0x9
popq %rdi
callq 0x18a30
testq %r12, %r12
je 0x23d21
movq 0x4cc77(%rip), %rsi     # 0x70990
movq %r12, %rdi
callq 0x18850
movq 0x4cc68(%rip), %rsi     # 0x70990
pushq $0x9
popq %rdi
callq 0x18a30
testq %r15, %r15
je 0x23d44
movq 0x4cc54(%rip), %rsi     # 0x70990
movq %r15, %rdi
callq 0x18850
movq 0x4cc45(%rip), %rsi     # 0x70990
pushq $0x9
popq %rdi
callq 0x18a30
testq %r14, %r14
je 0x23d67
movq 0x4cc31(%rip), %rsi     # 0x70990
movq %r14, %rdi
callq 0x18850
movq 0x4cc22(%rip), %rsi     # 0x70990
pushq $0x9
popq %rdi
callq 0x18a30
movq 0x4cc13(%rip), %rdi     # 0x70990
cvtss2sd 0x4(%rsp), %xmm0
leaq 0x2c231(%rip), %rsi     # 0x4ffbb
movl %ebx, %edx
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x18cb0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/gslog.c
// Function: sl_Logging
int sl_Logging( game_import_t  *gi,
                char           *pPatchName )
{
    int fFileOpen = sl_OpenLogFile( gi );

    if( fFileOpen && !fWasAlreadyOpen )
    {
        cvar_t *deathflags = gi->cvar( "dmflags", "0", CVAR_SERVERINFO );

        sl_LogVers( gi );
        
        pPatch = pPatchName;
        sl_LogPatch( gi, pPatchName );

        sl_LogDate( gi );
        sl_LogTime( gi );
        sl_LogDeathFlags( gi, (unsigned long)deathflags->value );

        fWasAlreadyOpen = fFileOpen;
    }

    return fFileOpen;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r15
movq %rdi, %r14
callq 0x18060
movl %eax, %ebx
testl %eax, %eax
je 0x23f0f
cmpl $0x0, 0x4cb0c(%rip)     # 0x709a0
jne 0x23f0f
leaq 0x2a67a(%rip), %rdi     # 0x4e517
leaq 0x33208(%rip), %rsi     # 0x570ac
pushq $0x4
popq %rdx
callq *0x120(%r14)
movq %rax, %r12
movq %r14, %rdi
callq 0x19890
movq %r15, 0x4cae8(%rip)     # 0x709a8
movq %r14, %rdi
movq %r15, %rsi
callq 0x18370
movq %r14, %rdi
callq 0x18260
movq %r14, %rdi
callq 0x19050
movss 0x20(%r12), %xmm0
cvttss2si %xmm0, %rax
movq %rax, %rcx
sarq $0x3f, %rcx
subss 0x2c19a(%rip), %xmm0    # 0x50090
cvttss2si %xmm0, %rsi
andq %rcx, %rsi
orq %rax, %rsi
movq %r14, %rdi
callq 0x19b00
movl %ebx, 0x4ca91(%rip)     # 0x709a0
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/gslog.c
// Function: sl_GameEnd
void sl_GameEnd( game_import_t      *gi,
                 level_locals_t      level )
{
    if( sl_Logging( gi, pPatch ) )
    {
        sl_LogGameEnd( gi, level.time );
        sl_CloseLogFile();

        fWasAlreadyOpen = 0;
    }   
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x4ca42(%rip), %rsi     # 0x709a8
callq 0x19740
testl %eax, %eax
je 0x23f8d
leaq 0x10(%rsp), %rax
movss 0x4(%rax), %xmm0
movq %rbx, %rdi
callq 0x18ee0
callq 0x184d0
andl $0x0, 0x4ca13(%rip)     # 0x709a0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/gslog.c
// Function: sl_WriteStdLogPlayerEntered
void sl_WriteStdLogPlayerEntered( game_import_t     *gi,
                                  level_locals_t     level,
                                  edict_t           *ent )
{
    if( sl_Logging( gi, pPatch ) )
    {
        sl_LogPlayerConnect( gi,
                             ent->client->pers.netname,
                             NULL,
                             level.time);        
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x4c8a3(%rip), %rsi     # 0x709a8
callq 0x19740
testl %eax, %eax
je 0x24132
leaq 0x20(%rsp), %rax
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%r14), %rsi
movss 0x4(%rax), %xmm0
movq %rbx, %rdi
xorl %edx, %edx
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18130
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/gslog.c
// Function: sl_LogPlayerDisconnect
void sl_LogPlayerDisconnect( game_import_t      *gi,
                             level_locals_t      level,
                             edict_t            *ent )
{
    // GSLogMod Start: Player disconnected
    if( sl_Logging( gi, pPatch ) )
    {
        sl_LogPlayerLeft( gi,
                          ent->client->pers.netname,
                          level.time );
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x4c85d(%rip), %rsi     # 0x709a8
callq 0x19740
testl %eax, %eax
je 0x24176
leaq 0x20(%rsp), %rax
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%r14), %rsi
movss 0x4(%rax), %xmm0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x18eb0
addq $0x8, %rsp
popq %rbx
popq %r14
retq
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_vote.c
// Function: Clear_All_Ballots
int Clear_All_Ballots (edict_t *ent)
{
	edict_t * player = NULL;
	unsigned int num_players = 0;

	//Reset the flags to neither yes or no (ie abstain) to prepare for next vote
	player = ctf_findplayer(NULL, NULL, CTF_TEAM_IGNORETEAM);
	while (player)
	{
		num_players++;
		//gi.bprintf(PRINT_HIGH, "processing: %s --", player->client->pers.netname); //for debugging
		player->client->ctf.extra_flags &= ~CTF_EXTRAFLAGS_VOTE_NO; //reset all players so they are all in
		player->client->ctf.extra_flags &= ~CTF_EXTRAFLAGS_VOTE_YES;  //'abstain' mode.
		//gi.bprintf(PRINT_HIGH," reset\n"); //for debugging
		player = ctf_findplayer(player, NULL, CTF_TEAM_IGNORETEAM);
	}
	return (num_players);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
xorl %ebx, %ebx
pushq $-0x4
popq %rbp
xorl %edi, %edi
xorl %esi, %esi
movl %ebp, %edx
callq 0x192e0
testq %rax, %rax
je 0x241ad
incl %ebx
movq 0x58(%rax), %rcx
andl $0xffffff3f, 0x1108(%rcx) # imm = 0xFFFFFF3F
movq %rax, %rdi
jmp 0x2418a
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_vote.c
// Function: Vote_Skip_Level
void Vote_Skip_Level (edict_t *ent)
{
	unsigned int num_players = 0;

	num_players = Clear_All_Ballots (ent);
	if (num_players < 4 )
		gi.cprintf(ent, PRINT_HIGH,"You need at least four players on the server to initiate a vote\n");
	else if (VoteStarted)
		gi.cprintf(ent, PRINT_HIGH,"Vote has already been started\n");
	else
	{
		VoteStarted = true;
		VoteTime = level.time;  //start the 30 second timer
		VoteType |= CTF_VOTETYPE_SKIP;

		gi.bprintf(PRINT_HIGH,"%s started vote to skip level.\n", ent->client->pers.netname);
		gi.sound(ent, CHAN_ITEM, gi.soundindex("misc/secret.wav"), 1, ATTN_NONE, 0);
		ent->client->ctf.extra_flags |= CTF_EXTRAFLAGS_VOTE_YES; //client who initiates vote must vote yes by default
		ent->client->ctf.extra_flags &= ~CTF_EXTRAFLAGS_VOTE_NO;
	}
	Vote_Menu(ent);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x18040
cmpl $0x3, %eax
ja 0x241d8
movq 0x42431(%rip), %rcx     # 0x66600
leaq 0x2bf15(%rip), %rdx     # 0x500eb
jmp 0x241f2
movq 0x424c9(%rip), %rax     # 0x666a8
cmpl $0x0, (%rax)
je 0x2420a
movq 0x42415(%rip), %rcx     # 0x66600
leaq 0x2bf3a(%rip), %rdx     # 0x5012c
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq *0x10(%rcx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x19d30
movl $0x1, (%rax)
movq 0x42b89(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x424b5(%rip), %rax     # 0x666d8
movss %xmm0, (%rax)
movq 0x42da2(%rip), %rax     # 0x66fd0
orb $0x1, (%rax)
movq 0x423c8(%rip), %r14     # 0x66600
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x2bf03(%rip), %rsi     # 0x5014b
pushq $0x2
popq %rdi
xorl %eax, %eax
callq *(%r14)
movq 0x20(%r14), %r15
leaq 0x2bf10(%rip), %rdi     # 0x5016b
callq *0x48(%r14)
pushq $0x3
popq %rsi
movss 0x2acbe(%rip), %xmm0    # 0x4ef28
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
callq *%r15
movq 0x58(%rbx), %rax
movl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
andl 0x1108(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x1108(%rax)
jmp 0x241fd
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_vote.c
// Function: Vote_Ref_Player
void Vote_Ref_Player (edict_t *ent)
{
	unsigned int num_players = 0;

	num_players = Clear_All_Ballots (ent);
	if (num_players < 4 )
		gi.cprintf(ent, PRINT_HIGH,"You need at least four players on the server to initiate a vote\n");
	else if (VoteStarted)
		gi.cprintf(ent, PRINT_HIGH,"Vote has already been started\n");
	else
	{
		VoteStarted = true;
		VoteTime = level.time;  //start the 30 second timer
		VoteType |= CTF_VOTETYPE_REFPLAYER;

		gi.bprintf(PRINT_HIGH,"%s started vote to referee a player.\n", ent->client->pers.netname);
		gi.sound(ent, CHAN_ITEM, gi.soundindex("misc/secret.wav"), 1, ATTN_NONE, 0);
		ent->client->ctf.extra_flags |= CTF_EXTRAFLAGS_VOTE_YES; //client who initiates vote must vote yes by default
		ent->client->ctf.extra_flags &= ~CTF_EXTRAFLAGS_VOTE_NO;
	}	
	Vote_Menu(ent);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x18040
cmpl $0x3, %eax
ja 0x24538
movq 0x420d1(%rip), %rcx     # 0x66600
leaq 0x2bbb5(%rip), %rdx     # 0x500eb
jmp 0x24552
movq 0x42169(%rip), %rax     # 0x666a8
cmpl $0x0, (%rax)
je 0x2456a
movq 0x420b5(%rip), %rcx     # 0x66600
leaq 0x2bbda(%rip), %rdx     # 0x5012c
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq *0x10(%rcx)
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x19d30
movl $0x1, (%rax)
movq 0x42829(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x42155(%rip), %rax     # 0x666d8
movss %xmm0, (%rax)
movq 0x42a42(%rip), %rax     # 0x66fd0
orb $0x4, (%rax)
movq 0x42068(%rip), %r14     # 0x66600
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x2bbff(%rip), %rsi     # 0x501a7
pushq $0x2
popq %rdi
xorl %eax, %eax
callq *(%r14)
movq 0x20(%r14), %r15
leaq 0x2bbb0(%rip), %rdi     # 0x5016b
callq *0x48(%r14)
pushq $0x3
popq %rsi
movss 0x2a95e(%rip), %xmm0    # 0x4ef28
xorps %xmm1, %xmm1
xorps %xmm2, %xmm2
movq %rbx, %rdi
movl %eax, %edx
callq *%r15
movq 0x58(%rbx), %rax
movl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
andl 0x1108(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x1108(%rax)
jmp 0x2455d
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_vote.c
// Function: Vote_YES
void Vote_YES (edict_t *ent)
{
	gi.cprintf(ent, PRINT_HIGH,"You have voted YES\n");
	ent->client->ctf.extra_flags |= CTF_EXTRAFLAGS_VOTE_YES;
	ent->client->ctf.extra_flags &= ~CTF_EXTRAFLAGS_VOTE_NO;
	Vote_Menu(ent);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x41e9f(%rip), %rcx     # 0x66600
leaq 0x2bbc0(%rip), %rdx     # 0x50328
pushq $0x2
popq %rsi
xorl %eax, %eax
callq *0x10(%rcx)
movq 0x58(%rbx), %rax
movl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
andl 0x1108(%rax), %ecx
orl $0x40, %ecx
movl %ecx, 0x1108(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19d30
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_vote.c
// Function: Vote_NO
void Vote_NO (edict_t *ent)
{
	gi.cprintf(ent, PRINT_HIGH,"You have voted NO\n");
	ent->client->ctf.extra_flags &= ~CTF_EXTRAFLAGS_VOTE_YES;
	ent->client->ctf.extra_flags |= CTF_EXTRAFLAGS_VOTE_NO;
	Vote_Menu(ent);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x41e64(%rip), %rcx     # 0x66600
leaq 0x2bb99(%rip), %rdx     # 0x5033c
pushq $0x2
popq %rsi
xorl %eax, %eax
callq *0x10(%rcx)
movq 0x58(%rbx), %rax
movl $0xffffff3f, %ecx       # imm = 0xFFFFFF3F
andl 0x1108(%rax), %ecx
orl $0x80, %ecx
movl %ecx, 0x1108(%rax)
movq %rbx, %rdi
popq %rbx
jmp 0x19d30
nop
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_LockTeams_f
void Cmd_LockTeams_f(edict_t *ent)
{
	if (!ISREF(ent)) {
		gi.cprintf(ent, PRINT_HIGH, "Only referees can (un)lock teams.\n");
		return;
	}

	game.teamslocked = !game.teamslocked;
	gi.bprintf(PRINT_HIGH, "Teams are now %slocked\n", game.teamslocked ? "" : "un");
}

// Assembly:
movq 0x58(%rdi), %rax
testb $0x2, 0x1108(%rax)
jne 0x247f6
movq 0x41e1c(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2bcb1(%rip), %rdx     # 0x504a0
pushq $0x2
popq %rsi
xorl %eax, %eax
jmpq *%rcx
movq 0x42543(%rip), %rax     # 0x66d40
xorl %ecx, %ecx
cmpl $0x0, 0x624(%rax)
sete %cl
movl %ecx, 0x624(%rax)
movq 0x41dea(%rip), %rax     # 0x66600
movq (%rax), %rcx
leaq 0x2b725(%rip), %rax     # 0x4ff45
leaq 0x317d8(%rip), %rdx     # 0x55fff
cmoveq %rax, %rdx
leaq 0x2bc91(%rip), %rsi     # 0x504c3
pushq $0x2
popq %rdi
xorl %eax, %eax
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_StartMatch_f
void Cmd_StartMatch_f(edict_t *ent) {
	if (!ISREF(ent)) {
		gi.cprintf(ent, PRINT_HIGH, "Referee-only command denied.\n");
		return;
	}

	if (matchstate > MATCH_NONE) {
		gi.cprintf(ent, PRINT_HIGH, "Match already running, stop it first\n");
		return;
	}

	// start countdown
	SpawnTourneyClock();
}

// Assembly:
movq 0x58(%rdi), %rax
testb $0x2, 0x1108(%rax)
jne 0x2485a
movq 0x41db3(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2bc83(%rip), %rdx     # 0x504db
jmp 0x24878
movq 0x41f77(%rip), %rax     # 0x667d8
cmpl $0x0, (%rax)
jle 0x2487f
movq 0x41d93(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2bc81(%rip), %rdx     # 0x504f9
pushq $0x2
popq %rsi
xorl %eax, %eax
jmpq *%rcx
xorl %eax, %eax
jmp 0x189f0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_StopMatch_f
void Cmd_StopMatch_f(edict_t *ent) {
	if (!ISREF(ent)) {
		gi.cprintf(ent, PRINT_HIGH, "Referee-only command denied.\n");
		return;
	}

	if (matchstate == MATCH_NONE) {
		gi.cprintf(ent, PRINT_HIGH, "No match running\n");
		return;
	}

	KillMatch();
	gi.bprintf(PRINT_HIGH, "Match stopped by %s\n", ent->client->pers.netname);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
testb $0x2, 0x1108(%rax)
jne 0x248ab
movq 0x41d62(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2bc32(%rip), %rdx     # 0x504db
jmp 0x248f2
movq 0x41f26(%rip), %rax     # 0x667d8
cmpl $0x0, (%rax)
je 0x248e0
xorl %eax, %eax
callq 0x180d0
movq 0x41d3b(%rip), %rax     # 0x66600
movq (%rax), %rcx
movl $0x2c0, %edx            # imm = 0x2C0
addq 0x58(%rbx), %rdx
leaq 0x2bc59(%rip), %rsi     # 0x50531
pushq $0x2
popq %rdi
xorl %eax, %eax
popq %rbx
jmpq *%rcx
movq 0x41d19(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2bc2d(%rip), %rdx     # 0x5051f
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
jmpq *%rcx
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: ForceCommand
void ForceCommand(edict_t *ent, char *command)
{
	if (!command || strlen(command) > MAX_INFO_STRING)
		return;
	if (strcmp(level.level_name, "") == 0)
		return;

   	gi.WriteByte (11);
	gi.WriteString (command);
    gi.unicast (ent, true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rsi, %rsi
je 0x2495e
movq %rsi, %r14
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x186c0
cmpq $0x200, %rax            # imm = 0x200
ja 0x2495e
movq 0x42477(%rip), %rax     # 0x66da0
cmpb $0x0, 0x8(%rax)
je 0x2495e
movq 0x41cca(%rip), %r15     # 0x66600
pushq $0xb
popq %rdi
callq *0xc8(%r15)
movq %r14, %rdi
callq *0xe8(%r15)
movq 0xb8(%r15), %rax
pushq $0x1
popq %rsi
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *%rax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_SetPassword_f
void Cmd_SetPassword_f(edict_t *ent)
{
	if (!ISREF(ent)) {
		gi.cprintf(ent, PRINT_HIGH, "Referee-only command\n");
		return;
	}

	// no password supplied, clear current password
	if (gi.argc() < 2) {
		gi.cvar_set("password", "");
		gi.cprintf(ent, PRINT_HIGH, "Server password has been cleared\n");
		return;
	}

	char *pw = gi.argv(1);
	gi.cvar_set("password", pw);
	gi.cprintf(ent, PRINT_HIGH, "Server password set to \"%s\"\n", pw);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
testb $0x2, 0x1108(%rax)
jne 0x2498d
movq 0x41c80(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2bbbb(%rip), %rdx     # 0x50546
jmp 0x249c0
movq 0x41c6c(%rip), %r15     # 0x66600
callq *0x138(%r15)
cmpl $0x1, %eax
jg 0x249cf
leaq 0x2f552(%rip), %rdi     # 0x53ef9
leaq 0x2b597(%rip), %rsi     # 0x4ff45
callq *0x128(%r15)
movq 0x10(%r15), %rcx
leaq 0x2bb9c(%rip), %rdx     # 0x5055c
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmpq *%rcx
pushq $0x1
popq %rdi
callq *0x140(%r15)
movq %rax, %r14
leaq 0x2f516(%rip), %rdi     # 0x53ef9
movq %rax, %rsi
callq *0x128(%r15)
movq 0x10(%r15), %r8
leaq 0x2bb86(%rip), %rdx     # 0x5057e
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmpq *%r8
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: OnSameTeam
qboolean OnSameTeam (edict_t *ent1, edict_t *ent2)
{
	if ((int)ctfflags->value & CTF_TEAM_NOTEAMS)
		return false; //surt there are no teams allowed

	if (ent1->client && ent2->client &&
		(ent1->client->ctf.teamnum == ent2->client->ctf.teamnum) &&
		ent1->inuse && ent2->inuse)
		return true;
	return false;
}

// Assembly:
movq 0x41f1d(%rip), %rax     # 0x66b58
movq (%rax), %rax
cvttss2si 0x20(%rax), %ecx
xorl %eax, %eax
testb %cl, %cl
js 0x24c78
movq 0x58(%rdi), %rcx
testq %rcx, %rcx
je 0x24c78
movq 0x58(%rsi), %rdx
testq %rdx, %rdx
je 0x24c78
movl 0x1100(%rcx), %ecx
cmpl 0x1100(%rdx), %ecx
jne 0x24c78
cmpl $0x0, 0x60(%rdi)
je 0x24c78
cmpl $0x0, 0x60(%rsi)
je 0x24c78
pushq $0x1
popq %rax
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: PlayVoiceSound
void PlayVoiceSound(edict_t *ent, char *sound)
{
	char	command [MAX_INFO_STRING];
	char	*s, *gender;

	//bat
	//if (ent->client->ctf.teamnum == CTF_TEAM_OBSERVER)
	if (ent->client->ctf.teamnum <= CTF_TEAM_OBSERVER)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Observers can't use voice.\n");
		return;
	}

#ifdef NOVOICE_OK
	if ((int)ctfflags->value & CTF_NOVOICE)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "It's quiet time, no talking.\n");
		return;
	}
#endif

	if (!ctf_SpamCheck(ent))
		return;

	s = Info_ValueForKey (ent->client->pers.userinfo, "skin");

	// decide gender


	if (sound[0] == '_' || !strncmp(sound, "male_", 5)	|| !strncmp(sound, "fem_", 4))
	{
		Com_sprintf (command, sizeof(command), "voice/%s.wav", sound);
	}
	else // Append gender
	{
		if (s[0] == 'f' || s[0] == 'F') // Female
		{
			gender = "fem";
		}
		else
		{
			gender = "male";
		}

		Com_sprintf (command, sizeof(command), "voice/%s_%s.wav", gender, sound);
	}

	gi.sound(ent, CHAN_AUTO, gi.soundindex(command), 1, ATTN_IDLE, 0);

	gi.dprintf("%s (voicetext): %s\n",
			ent->client->pers.netname, command);

	ent->client->spam_band_count -= CTF_SPAM_BAND_VOICE; //75 units of spam control for the voice
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x208, %rsp            # imm = 0x208
movq %rdi, %rbx
movq 0x58(%rdi), %rax
cmpl $0x0, 0x1100(%rax)
js 0x24d30
movq %rsi, %r14
movq %rbx, %rdi
callq 0x19770
testl %eax, %eax
je 0x24dc0
movl $0xc0, %edi
addq 0x58(%rbx), %rdi
leaq 0x29682(%rip), %rsi     # 0x4e340
callq 0x18c70
cmpb $0x5f, (%r14)
je 0x24d50
movq %rax, %r15
leaq 0x2b8f2(%rip), %rsi     # 0x505c9
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x18200
testl %eax, %eax
je 0x24d50
leaq 0x2b8e2(%rip), %rsi     # 0x505cf
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x18200
testl %eax, %eax
je 0x24d50
movb (%r15), %al
addb $-0x46, %al
testb $-0x21, %al
leaq 0x2b8d9(%rip), %rax     # 0x505e3
leaq 0x2936f(%rip), %rcx     # 0x4e080
cmoveq %rax, %rcx
leaq 0x2b91a(%rip), %rdx     # 0x50636
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %r8
xorl %eax, %eax
callq 0x18f30
jmp 0x24d69
leaq 0x2b8d6(%rip), %rdx     # 0x5060d
pushq $0x2
popq %rsi
movq %rbx, %rdi
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x18ec0
leaq 0x2b8d2(%rip), %rdx     # 0x50629
movq %rsp, %rdi
movl $0x200, %esi            # imm = 0x200
movq %r14, %rcx
xorl %eax, %eax
callq 0x18f30
movq 0x41890(%rip), %r15     # 0x66600
movq 0x20(%r15), %r12
movq %rsp, %r14
movq %r14, %rdi
callq *0x48(%r15)
movss 0x2a1a2(%rip), %xmm0    # 0x4ef28
movss 0x2a6de(%rip), %xmm1    # 0x4f46c
xorps %xmm2, %xmm2
movq %rbx, %rdi
xorl %esi, %esi
movl %eax, %edx
callq *%r12
movl $0x2c0, %esi            # imm = 0x2C0
addq 0x58(%rbx), %rsi
leaq 0x2b89b(%rip), %rdi     # 0x50646
movq %r14, %rdx
xorl %eax, %eax
callq *0x8(%r15)
movq 0x58(%rbx), %rax
addq $-0x4b, 0x10e0(%rax)
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: SelectNextItem
void SelectNextItem (edict_t *ent, int itflags)
{
	gclient_t	*cl;
	int			i, index;
	gitem_t		*it;
	it = 0;

	cl = ent->client;

	if (cl->showmenu)
	{
		Menu_Next(ent);
//		return; //surt, this causes a bug with dropping items ... this can
		//be called from validate selected item in which case it must _not_
		//return early!!!!
	}

	if (cl->chase_target) {
		ChaseNext(ent);
		return;
	}

	// scan  for the next valid one
	for (i=1 ; i<=MAX_ITEMS ; i++)
	{
		index = (cl->pers.selected_item + i)%MAX_ITEMS;
		if (!cl->pers.inventory[index])
			continue;
		it = &itemlist[index];
		if (!it->use)
			continue;
		if (!(it->flags & itflags))
			continue;

		cl->pers.selected_item = index;
		return;
	}

	cl->pers.selected_item = -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x58(%rdi), %r15
cmpl $0x0, 0xf80(%r15)
je 0x24ea7
movq %r14, %rdi
callq 0x18c90
cmpq $0x0, 0xf30(%r15)
je 0x24ebe
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x19730
movl 0x314(%r15), %ecx
incl %ecx
xorl %esi, %esi
movl $0x100, %edi            # imm = 0x100
movq 0x41f6b(%rip), %r8      # 0x66e40
cmpl $0x100, %esi            # imm = 0x100
je 0x24f0c
leal (%rcx,%rsi), %eax
cltd
idivl %edi
movslq %edx, %rax
cmpl $0x0, 0x318(%r15,%rax,4)
je 0x24f08
imulq $0x88, %rax, %rax
cmpq $0x0, 0x10(%r8,%rax)
je 0x24f08
addq %r8, %rax
testl %ebx, 0x68(%rax)
jne 0x24f16
incl %esi
jmp 0x24ed5
orl $-0x1, 0x314(%r15)
jmp 0x24f1d
movl %edx, 0x314(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: SelectPrevItem
void SelectPrevItem (edict_t *ent, int itflags)
{
	gclient_t	*cl;
	int			i;
	int			index;
	gitem_t		*it;

	it = 0;

	cl = ent->client;

	if (cl->showmenu)
	{
		Menu_Prev(ent);
//		return; //surt, see above ... this should not fail!!
	}

	if (cl->chase_target) {
		ChasePrev(ent);
		return;
	}

	// scan  for the next valid one
	for (i=1 ; i<=MAX_ITEMS ; i++)
	{
		index = (cl->pers.selected_item + MAX_ITEMS - i)%MAX_ITEMS;
		if (!cl->pers.inventory[index])
			continue;
		it = &itemlist[index];
		if (!it->use)
			continue;
		if (!(it->flags & itflags))
			continue;

		cl->pers.selected_item = index;
		return;
	}

	cl->pers.selected_item = -1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movl %esi, %ebx
movq %rdi, %r14
movq 0x58(%rdi), %r15
cmpl $0x0, 0xf80(%r15)
je 0x24f43
movq %r14, %rdi
callq 0x19b50
cmpq $0x0, 0xf30(%r15)
je 0x24f5a
movq %r14, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x18930
movl 0x314(%r15), %ecx
movl $0xff, %esi
movl $0x100, %edi            # imm = 0x100
movq 0x41ece(%rip), %r8      # 0x66e40
cmpl $-0x1, %esi
je 0x24fa6
leal (%rcx,%rsi), %eax
cltd
idivl %edi
movslq %edx, %rax
cmpl $0x0, 0x318(%r15,%rax,4)
je 0x24fa2
imulq $0x88, %rax, %rax
cmpq $0x0, 0x10(%r8,%rax)
je 0x24fa2
addq %r8, %rax
testl %ebx, 0x68(%rax)
jne 0x24fb0
decl %esi
jmp 0x24f72
orl $-0x1, 0x314(%r15)
jmp 0x24fb7
movl %edx, 0x314(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Use_f
void Cmd_Use_f (edict_t *ent)
{
	int			index;
	gitem_t		*it;
	char		*s;
	char message[MAX_INFO_STRING];

	s = gi.args();

	// CTF CODE -- LM_JORM
	if (Q_stricmp(s, "hook") == 0)
		s = "grappling hook";
	else if (Q_stricmp(s, "grapple") == 0)
		s = "grappling hook";
	if (Q_stricmp(s, "flag") == 0)
		s = "Enemy Flag";
	// END CTF CODE -- LM_JORM

	it = FindItem (s);
	if (!it)
	{
		sprintf(message, "unknown item: %s\n", s);
		ctf_SafePrint(ent, PRINT_HIGH, message);
		return;
	}
	if (!it->use)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Item is not usable.\n");
		return;
	}
	index = ITEM_INDEX(it);
	if (!ent->client->pers.inventory[index])
	{
		sprintf(message, "Out of item: %s\n", s);
		ctf_SafePrint(ent, PRINT_HIGH, message);
		return;
	}

		it->use (ent, it);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x200, %rsp            # imm = 0x200
movq %rdi, %rbx
movq 0x410bc(%rip), %rax     # 0x66600
callq *0x148(%rax)
movq %rax, %r14
leaq 0x30d11(%rip), %rsi     # 0x56265
movq %rax, %rdi
callq 0x186d0
testl %eax, %eax
je 0x2557e
leaq 0x2b1b6(%rip), %rsi     # 0x5071d
movq %r14, %rdi
callq 0x186d0
testl %eax, %eax
leaq 0x30ce3(%rip), %r15     # 0x5625b
cmovneq %r14, %r15
jmp 0x25585
leaq 0x30cd6(%rip), %r15     # 0x5625b
leaq 0x3196f(%rip), %rsi     # 0x56efb
movq %r15, %rdi
callq 0x186d0
testl %eax, %eax
leaq 0x2b188(%rip), %r14     # 0x50725
cmovneq %r15, %r14
movq %r14, %rdi
callq 0x18a80
testq %rax, %rax
je 0x255ef
movq %rax, %rsi
movq 0x10(%rax), %rcx
testq %rcx, %rcx
je 0x255f8
movq %rsi, %rax
subq 0x4187c(%rip), %rax     # 0x66e40
movl $0x88, %edi
cqto
idivq %rdi
movq 0x58(%rbx), %rdx
cltq
cmpl $0x0, 0x318(%rdx,%rax,4)
je 0x25616
movq %rbx, %rdi
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
jmpq *%rcx
leaq 0x2b13a(%rip), %rsi     # 0x50730
jmp 0x2561d
leaq 0x2b143(%rip), %rdx     # 0x50742
pushq $0x2
popq %rsi
movq %rbx, %rdi
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
jmp 0x18ec0
leaq 0x2b13a(%rip), %rsi     # 0x50757
movq %rsp, %r15
movq %r15, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x198c0
pushq $0x2
popq %rsi
movq %rbx, %rdi
movq %r15, %rdx
callq 0x18ec0
addq $0x200, %rsp            # imm = 0x200
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Inven_f
void Cmd_Inven_f (edict_t *ent)
{
	int			i;
	gclient_t	*cl;

	cl = ent->client;

	ent->client->showscores = false;
	ent->client->showhelp = false;
	ent->client->showctfhud = false;
	ent->client->showmod = false;
	ent->client->showmenu = false;
	cl->showsquadboard = false; // ADC

	if (cl->showinventory)
	{
		cl->showinventory = false;
		return;
	}

	cl->showinventory = true;

	gi.WriteByte (svc_inventory);
	for (i=0 ; i<MAX_ITEMS ; i++)
	{
		gi.WriteShort (cl->pers.inventory[i]);
	}
	gi.unicast (ent, true);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq 0x58(%rdi), %r14
andl $0x0, 0xe24(%r14)
andl $0x0, 0xe2c(%r14)
andq $0x0, 0xf74(%r14)
andl $0x0, 0xf80(%r14)
andl $0x0, 0xe34(%r14)
xorl %eax, %eax
cmpl %eax, 0xe28(%r14)
je 0x2587b
andl $0x0, 0xe28(%r14)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdi, %rbx
movl $0x1, 0xe28(%r14)
movq 0x40d70(%rip), %r15     # 0x66600
pushq $0x5
popq %rdi
callq *0xc8(%r15)
xorl %r12d, %r12d
cmpq $0x100, %r12            # imm = 0x100
je 0x258ba
movl 0x318(%r14,%r12,4), %edi
callq *0xd0(%r15)
incq %r12
jmp 0x2589d
movq 0xb8(%r15), %rax
pushq $0x1
popq %rsi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_InvUse_f
void Cmd_InvUse_f (edict_t *ent)
{
	gitem_t		*it;

	if (ent->client->showmenu)
	{
		Menu_Use(ent);
		return;
	}

	ValidateSelectedItem (ent);

	if (ent->client->pers.selected_item == -1)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "No item to use.\n");
		return;
	}

	it = &itemlist[ent->client->pers.selected_item];
	if (!it->use)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Item is not usable.\n");
		return;
	}
	it->use (ent, it);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movq 0x58(%rdi), %rax
cmpl $0x0, 0xf80(%rax)
je 0x258ee
movq %rbx, %rdi
popq %rbx
jmp 0x19690
movq %rbx, %rdi
callq 0x182a0
movq 0x58(%rbx), %rax
movslq 0x314(%rax), %rax
cmpq $-0x1, %rax
je 0x25928
imulq $0x88, %rax, %rcx
movq 0x4152b(%rip), %rsi     # 0x66e40
movq 0x10(%rsi,%rcx), %rax
testq %rax, %rax
je 0x25931
addq %rcx, %rsi
movq %rbx, %rdi
popq %rbx
jmpq *%rax
leaq 0x2ae70(%rip), %rdx     # 0x5079f
jmp 0x25938
leaq 0x2ae0a(%rip), %rdx     # 0x50742
pushq $0x2
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x18ec0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_WeapPrev_f
void Cmd_WeapPrev_f (edict_t *ent)
{
	gclient_t	*cl;
	int			i, index;
	gitem_t		*it;
	int			selected_weapon;


	if(matchstate == MATCH_RAILGUN_INPLAY)
		return;


	cl = ent->client;

	if (!cl->pers.weapon)
		return;

	selected_weapon = ITEM_INDEX(cl->pers.weapon);

	// scan  for the next valid one
	for (i=1 ; i<=MAX_ITEMS ; i++)
	{
		index = (selected_weapon + i)%MAX_ITEMS;
		if (!cl->pers.inventory[index])
			continue;
		it = &itemlist[index];
		if (!it->use)
			continue;
		if (! (it->flags & IT_WEAPON) )
			continue;

		// LM_JORM -- Remove grapple from list if offhand is on
		if ((int)ctfflags->value & CTF_OFFHAND_HOOK &&
			it == FindItem("Grappling Hook"))
			continue;
		// END LM_JORM

		it->use (ent, it);
		if (cl->pers.weapon == it)
			return;	// successful
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, (%rsp)
movq 0x40e7e(%rip), %rax     # 0x667d8
cmpl $0x6, (%rax)
je 0x25a1b
movq (%rsp), %rax
movq 0x58(%rax), %r13
movq 0x730(%r13), %rax
testq %rax, %rax
je 0x25a1b
subq 0x414be(%rip), %rax     # 0x66e40
movl $0x88, %ecx
cqto
idivq %rcx
movq %rax, %r14
incl %r14d
xorl %ebp, %ebp
movl $0x100, %r15d           # imm = 0x100
movq 0x4149f(%rip), %rbx     # 0x66e40
cmpl $0x100, %ebp            # imm = 0x100
je 0x25a1b
leal (%r14,%rbp), %eax
cltd
idivl %r15d
movslq %edx, %rax
cmpl $0x0, 0x318(%r13,%rax,4)
je 0x25a17
imulq $0x88, %rax, %r12
movq 0x10(%rbx,%r12), %rax
testq %rax, %rax
je 0x25a17
addq %rbx, %r12
testb $0x1, 0x68(%r12)
je 0x25a17
movq 0x41176(%rip), %rcx     # 0x66b58
movq (%rcx), %rcx
cvttss2si 0x20(%rcx), %ecx
testb $0x10, %cl
je 0x25a05
leaq 0x29e01(%rip), %rdi     # 0x4f7f7
callq 0x18a80
cmpq %rax, %r12
je 0x25a17
movq 0x10(%r12), %rax
movq (%rsp), %rdi
movq %r12, %rsi
callq *%rax
cmpq %r12, 0x730(%r13)
je 0x25a1b
incl %ebp
jmp 0x259a1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_WeapLast_f
void Cmd_WeapLast_f (edict_t *ent)
{
	gclient_t	*cl;
	int			index;
	gitem_t		*it;


	if(matchstate == MATCH_RAILGUN_INPLAY)
		return;


	cl = ent->client;

	if (!cl->pers.weapon || !cl->pers.lastweapon)
		return;

	index = ITEM_INDEX(cl->pers.lastweapon);
	if (!cl->pers.inventory[index])
		return;
	it = &itemlist[index];
	if (!it->use)
		return;
	if (! (it->flags & IT_WEAPON) )
		return;
	it->use (ent, it);
}

// Assembly:
movq 0x40cc4(%rip), %rax     # 0x667d8
cmpl $0x6, (%rax)
je 0x25b71
movq 0x58(%rdi), %rcx
cmpq $0x0, 0x730(%rcx)
je 0x25b71
movq 0x738(%rcx), %rax
testq %rax, %rax
je 0x25b71
subq 0x41306(%rip), %rax     # 0x66e40
movl $0x88, %esi
cqto
idivq %rsi
cltq
cmpl $0x0, 0x318(%rcx,%rax,4)
je 0x25b71
imulq $0x88, %rax, %rcx
movq 0x412e2(%rip), %rsi     # 0x66e40
movq 0x10(%rsi,%rcx), %rax
testq %rax, %rax
je 0x25b71
addq %rcx, %rsi
testb $0x1, 0x68(%rsi)
jne 0x25b72
retq
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_InvDrop_f
void Cmd_InvDrop_f (edict_t *ent)
{
	gitem_t		*it;

	ValidateSelectedItem (ent);

	if (ent->client->pers.selected_item == -1)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "No item to drop.\n");
		return;
	}

	it = &itemlist[ent->client->pers.selected_item];
	if (!it->drop)
	{
		ctf_SafePrint(ent, PRINT_HIGH, "Item is not dropable.\n");
		return;
	}
	it->drop (ent, it);
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x182a0
movq 0x58(%rbx), %rax
movslq 0x314(%rax), %rax
cmpq $-0x1, %rax
je 0x25baf
imulq $0x88, %rax, %rcx
movq 0x412a4(%rip), %rsi     # 0x66e40
movq 0x18(%rsi,%rcx), %rax
testq %rax, %rax
je 0x25bb8
addq %rcx, %rsi
movq %rbx, %rdi
popq %rbx
jmpq *%rax
leaq 0x2abfa(%rip), %rdx     # 0x507b0
jmp 0x25bbf
leaq 0x2abc9(%rip), %rdx     # 0x50788
pushq $0x2
popq %rsi
movq %rbx, %rdi
popq %rbx
jmp 0x18ec0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_Kill_f
void Cmd_Kill_f (edict_t *ent)
{
	if((level.time - ent->client->respawn_time) < 5)
		return;
	ent->flags &= ~FL_GODMODE;
	ent->health = 0;
	meansOfDeath = MOD_SUICIDE;
	player_die (ent, ent, ent, 100000, vec3_origin);
#ifdef OLDOBSERVERCODE
	if (ent->client->ctf.teamnum == CTF_TEAM_OBSERVER) // An observer
		Observer_Start(ent);
#endif
}

// Assembly:
movq 0x411ce(%rip), %rax     # 0x66da0
movss 0x4(%rax), %xmm0
movq 0x58(%rdi), %rax
subss 0xf28(%rax), %xmm0
movss 0x29319(%rip), %xmm1    # 0x4ef04
ucomiss %xmm0, %xmm1
jbe 0x25bf1
retq
andb $-0x11, 0x11c(%rdi)
andl $0x0, 0x254(%rdi)
movq 0x40f22(%rip), %rax     # 0x66b28
movl $0x17, (%rax)
movq 0x40b55(%rip), %r8      # 0x66768
movq %rdi, %rsi
movq %rdi, %rdx
movl $0x186a0, %ecx          # imm = 0x186A0
jmp 0x19ca8
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Cmd_PutAway_f
void Cmd_PutAway_f (edict_t *ent)
{
	ent->client->showscores = false;
	ent->client->showhelp = false;
	ent->client->showinventory = false;
	ent->client->showctfhud = false;
	ent->client->showmod = false;
	ent->client->showmenu = false;
	ent->client->showsquadboard = false; // ADC
	//ent->client->awayframe = level.framenum;
	gi.WriteByte (svc_layout);
	gi.WriteString ("");
	gi.unicast (ent, false);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x58(%rdi), %rax
andq $0x0, 0xe24(%rax)
andl $0x0, 0xe2c(%rax)
andq $0x0, 0xf74(%rax)
andl $0x0, 0xf80(%rax)
andl $0x0, 0xe34(%rax)
movq 0x409a6(%rip), %r14     # 0x66600
pushq $0x4
popq %rdi
callq *0xc8(%r14)
leaq 0x2a2da(%rip), %rdi     # 0x4ff45
callq *0xe8(%r14)
movq 0xb8(%r14), %rax
movq %rbx, %rdi
xorl %esi, %esi
addq $0x8, %rsp
popq %rbx
popq %r14
jmpq *%rax
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Team_Change
void Team_Change (edict_t *ent, int newnum)
{
	if (!newnum) {
		return;
	}

	if (game.teamslocked) {
		gi.cprintf(ent, PRINT_HIGH, "Teams are locked\n");
		return;
	}

	ent->health = 0;
	player_die (ent, ent, ent, 100000, vec3_origin);
	ent->client->resp.score++;
	stats_add(ent, STATS_SCORE, 1);
	stats_add(ent, STATS_DEATHS, -1);

	// don't even bother waiting for death frames
	ctf_SetEntTeam(ent, newnum); //switch teams after they die

	respawn (ent); //force them to respawn on the new team
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testl %esi, %esi
je 0x25cc3
movq %rdi, %rbx
movq 0x410a8(%rip), %rax     # 0x66d40
cmpl $0x0, 0x624(%rax)
je 0x25cca
movq 0x40958(%rip), %rax     # 0x66600
movq 0x10(%rax), %rcx
leaq 0x2ab0f(%rip), %rdx     # 0x507c2
pushq $0x2
popq %rsi
movq %rbx, %rdi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
jmpq *%rcx
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movl %esi, %ebp
andl $0x0, 0x254(%rbx)
movq 0x40a8e(%rip), %r8      # 0x66768
movq %rbx, %rdi
movq %rbx, %rsi
movq %rbx, %rdx
movl $0x186a0, %ecx          # imm = 0x186A0
callq 0x19ca8
movq 0x58(%rbx), %rax
incl 0xdf4(%rax)
pushq $0x3
popq %rsi
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0x194d0
pushq $0x6
popq %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x194d0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x18240
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x197d0
// File: /workspace/github_c_makefile_star2_O2/QwazyWabbitWOS[P]lmctf60/g_cmds.c
// Function: Drop_All
void Drop_All (edict_t *ent)
{
	edict_t *flag;
	flag = ClientHasFlag(ent);
	if (flag)
	{
		ctf_playerdropflag(ent, flag->item);
	}

	if (ent->client->hook)
	{
		G_FreeEdict (ent->client->hook);
		ent->client->hook = NULL;
	}

	if (ent->client->rune && ent->client->rune->item)
	{
		Drop_Rune(ent, ent->client->rune->item);
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
callq 0x18150
testq %rax, %rax
je 0x25d48
movq 0x330(%rax), %rsi
movq %rbx, %rdi
callq 0x19a00
movq 0x58(%rbx), %rax
movq 0xf60(%rax), %rdi
testq %rdi, %rdi
je 0x25d69
callq 0x19c50
movq 0x58(%rbx), %rax
andq $0x0, 0xf60(%rax)
movq 0xf68(%rax), %rax
testq %rax, %rax
je 0x25d8a
movq 0x330(%rax), %rsi
testq %rsi, %rsi
je 0x25d8a
movq %rbx, %rdi
popq %rbx
jmp 0x19b20
popq %rbx
retq