bg_lib.asm
themuffinator_dm-game/build/win32-qvm/vm/game/bg_lib.asm
code
proc swapfunc 24 0
file "..\..\..\..\code\bgame\bg_lib.c"
line 76
;1:// Copyright (C) 1999-2000 Id Software, Inc.
;2://
;3:// Copyright (C) 1999-2000 Id Software, Inc.
;4://
;5:// bg_lib,c -- standard C library replacement routines used by code
;6:// compiled for the virtual machine
;7:
;8:#include "../qcommon/q_shared.h"
;9:
;10:/*-
;11: * Copyright (c) 1992, 1993
;12: *	The Regents of the University of California.  All rights reserved.
;13: *
;14: * Redistribution and use in source and binary forms, with or without
;15: * modification, are permitted provided that the following conditions
;16: * are met:
;17: * 1. Redistributions of source code must retain the above copyright
;18: *    notice, this list of conditions and the following disclaimer.
;19: * 2. Redistributions in binary form must reproduce the above copyright
;20: *    notice, this list of conditions and the following disclaimer in the
;21: *    documentation and/or other materials provided with the distribution.
;22: * 3. All advertising materials mentioning features or use of this software
;23: *    must display the following acknowledgement:
;24: *	This product includes software developed by the University of
;25: *	California, Berkeley and its contributors.
;26: * 4. Neither the name of the University nor the names of its contributors
;27: *    may be used to endorse or promote products derived from this software
;28: *    without specific prior written permission.
;29: *
;30: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
;31: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
;32: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
;33: * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
;34: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
;35: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
;36: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
;37: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
;38: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
;39: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
;40: * SUCH DAMAGE.
;41: */
;42:
;43:// bk001127 - needed for DLL's
;44:#if !defined( Q3_VM )
;45:typedef int		 cmp_t(const void *, const void *);
;46:#endif
;47:
;48:static char* med3(char *, char *, char *, cmp_t *);
;49:static void	 swapfunc(char *, char *, int, int);
;50:
;51:#ifndef min
;52:#define min(a, b)	((a) < (b) ? a : b)
;53:#endif
;54:
;55:/*
;56: * Qsort routine from Bentley & McIlroy's "Engineering a Sort Function".
;57: */
;58:#define swapcode(TYPE, parmi, parmj, n) { 		\
;59:	long i = (n) / sizeof (TYPE); 			\
;60:	register TYPE *pi = (TYPE *) (parmi); 		\
;61:	register TYPE *pj = (TYPE *) (parmj); 		\
;62:	do { 						\
;63:		register TYPE	t = *pi;		\
;64:		*pi++ = *pj;				\
;65:		*pj++ = t;				\
;66:        } while (--i > 0);				\
;67:}
;68:
;69:#define SWAPINIT(a, es) swaptype = ((char *)a - (char *)0) % sizeof(long) || \
;70:	es % sizeof(long) ? 2 : es == sizeof(long)? 0 : 1;
;71:
;72:static void
;73:swapfunc(a, b, n, swaptype)
;74:	char *a, *b;
;75:	int n, swaptype;
;76:{
line 77
;77:	if(swaptype <= 1)
ADDRFP4 12
INDIRI4
CNSTI4 1
GTI4 $22
line 78
;78:		swapcode(long, a, b, n)
ADDRLP4 8
ADDRFP4 8
INDIRI4
CVIU4 4
CNSTI4 2
RSHU4
CVUI4 4
ASGNI4
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
LABELV $24
ADDRLP4 12
ADDRLP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 16
ADDRLP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 16
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 4
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 20
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 4
ADDRLP4 20
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 20
INDIRP4
ADDRLP4 12
INDIRI4
ASGNI4
LABELV $25
ADDRLP4 12
ADDRLP4 8
INDIRI4
CNSTI4 1
SUBI4
ASGNI4
ADDRLP4 8
ADDRLP4 12
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 0
GTI4 $24
ADDRGP4 $23
JUMPV
LABELV $22
line 80
;79:	else
;80:		swapcode(char, a, b, n)
ADDRLP4 8
ADDRFP4 8
INDIRI4
CVIU4 4
CVUI4 4
ASGNI4
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
LABELV $27
ADDRLP4 12
ADDRLP4 0
INDIRP4
INDIRI1
ASGNI1
ADDRLP4 16
ADDRLP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 16
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
ADDRLP4 16
INDIRP4
ADDRLP4 4
INDIRP4
INDIRI1
ASGNI1
ADDRLP4 20
ADDRLP4 4
INDIRP4
ASGNP4
ADDRLP4 4
ADDRLP4 20
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
ADDRLP4 20
INDIRP4
ADDRLP4 12
INDIRI1
ASGNI1
LABELV $28
ADDRLP4 12
ADDRLP4 8
INDIRI4
CNSTI4 1
SUBI4
ASGNI4
ADDRLP4 8
ADDRLP4 12
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 0
GTI4 $27
LABELV $23
line 81
;81:}
LABELV $21
endproc swapfunc 24 0
proc med3 40 8
line 97
;82:
;83:#define swap(a, b)					\
;84:	if (swaptype == 0) {				\
;85:		long t = *(long *)(a);			\
;86:		*(long *)(a) = *(long *)(b);		\
;87:		*(long *)(b) = t;			\
;88:	} else						\
;89:		swapfunc(a, b, es, swaptype)
;90:
;91:#define vecswap(a, b, n) 	if ((n) > 0) swapfunc(a, b, n, swaptype)
;92:
;93:static char *
;94:med3(a, b, c, cmp)
;95:	char *a, *b, *c;
;96:	cmp_t *cmp;
;97:{
line 98
;98:	return cmp(a, b) < 0 ?
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRLP4 20
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 20
INDIRI4
CNSTI4 0
GEI4 $36
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRLP4 24
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 24
INDIRI4
CNSTI4 0
GEI4 $38
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRGP4 $39
JUMPV
LABELV $38
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRLP4 28
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 28
INDIRI4
CNSTI4 0
GEI4 $40
ADDRLP4 8
ADDRFP4 8
INDIRP4
ASGNP4
ADDRGP4 $41
JUMPV
LABELV $40
ADDRLP4 8
ADDRFP4 0
INDIRP4
ASGNP4
LABELV $41
ADDRLP4 4
ADDRLP4 8
INDIRP4
ASGNP4
LABELV $39
ADDRLP4 0
ADDRLP4 4
INDIRP4
ASGNP4
ADDRGP4 $37
JUMPV
LABELV $36
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRLP4 32
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 32
INDIRI4
CNSTI4 0
LEI4 $42
ADDRLP4 12
ADDRFP4 4
INDIRP4
ASGNP4
ADDRGP4 $43
JUMPV
LABELV $42
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRLP4 36
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 36
INDIRI4
CNSTI4 0
GEI4 $44
ADDRLP4 16
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 $45
JUMPV
LABELV $44
ADDRLP4 16
ADDRFP4 8
INDIRP4
ASGNP4
LABELV $45
ADDRLP4 12
ADDRLP4 16
INDIRP4
ASGNP4
LABELV $43
ADDRLP4 0
ADDRLP4 12
INDIRP4
ASGNP4
LABELV $37
ADDRLP4 0
INDIRP4
RETP4
LABELV $30
endproc med3 40 8
export qsort
proc qsort 96 16
line 108
;99:	       (cmp(b, c) < 0 ? b : (cmp(a, c) < 0 ? c : a ))
;100:              :(cmp(b, c) > 0 ? b : (cmp(a, c) < 0 ? a : c ));
;101:}
;102:
;103:void
;104:qsort(a, n, es, cmp)
;105:	void *a;
;106:	size_t n, es;
;107:	cmp_t *cmp;
;108:{
LABELV $47
line 112
;109:	char *pa, *pb, *pc, *pd, *pl, *pm, *pn;
;110:	int d, r, swaptype, swap_cnt;
;111:
;112:loop:	SWAPINIT(a, es);
ADDRFP4 0
INDIRP4
CVPU4 4
CVUI4 4
CVIU4 4
CNSTU4 3
BANDU4
CNSTU4 0
NEU4 $52
ADDRFP4 8
INDIRI4
CVIU4 4
CNSTU4 3
BANDU4
CNSTU4 0
EQU4 $50
LABELV $52
ADDRLP4 44
CNSTI4 2
ASGNI4
ADDRGP4 $51
JUMPV
LABELV $50
ADDRFP4 8
INDIRI4
CVIU4 4
CNSTU4 4
NEU4 $53
ADDRLP4 48
CNSTI4 0
ASGNI4
ADDRGP4 $54
JUMPV
LABELV $53
ADDRLP4 48
CNSTI4 1
ASGNI4
LABELV $54
ADDRLP4 44
ADDRLP4 48
INDIRI4
ASGNI4
LABELV $51
ADDRLP4 16
ADDRLP4 44
INDIRI4
ASGNI4
line 113
;113:	swap_cnt = 0;
ADDRLP4 28
CNSTI4 0
ASGNI4
line 114
;114:	if (n < 7) {
ADDRFP4 4
INDIRI4
CNSTI4 7
GEI4 $55
line 115
;115:		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
ADDRLP4 32
ADDRFP4 8
INDIRI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
ADDRGP4 $60
JUMPV
LABELV $57
line 116
;116:			for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
ADDRLP4 0
ADDRLP4 32
INDIRP4
ASGNP4
ADDRGP4 $64
JUMPV
LABELV $61
line 118
;117:			     pl -= es)
;118:				swap(pl, pl - es);
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $65
ADDRLP4 52
ADDRLP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ADDRLP4 52
INDIRI4
ASGNI4
ADDRGP4 $66
JUMPV
LABELV $65
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 56
ADDRFP4 8
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRLP4 56
INDIRI4
SUBP4
ARGP4
ADDRLP4 56
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $66
LABELV $62
line 117
ADDRLP4 0
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ASGNP4
LABELV $64
line 116
ADDRLP4 0
INDIRP4
CVPU4 4
ADDRFP4 0
INDIRP4
CVPU4 4
LEU4 $67
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ARGP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 64
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 64
INDIRI4
CNSTI4 0
GTI4 $61
LABELV $67
LABELV $58
line 115
ADDRLP4 32
ADDRFP4 8
INDIRI4
ADDRLP4 32
INDIRP4
ADDP4
ASGNP4
LABELV $60
ADDRLP4 32
INDIRP4
CVPU4 4
ADDRFP4 4
INDIRI4
ADDRFP4 8
INDIRI4
MULI4
ADDRFP4 0
INDIRP4
ADDP4
CVPU4 4
LTU4 $57
line 119
;119:		return;
ADDRGP4 $46
JUMPV
LABELV $55
line 121
;120:	}
;121:	pm = (char *)a + (n / 2) * es;
ADDRLP4 32
ADDRFP4 4
INDIRI4
CNSTI4 2
DIVI4
ADDRFP4 8
INDIRI4
MULI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
line 122
;122:	if (n > 7) {
ADDRFP4 4
INDIRI4
CNSTI4 7
LEI4 $68
line 123
;123:		pl = a;
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
line 124
;124:		pn = (char *)a + (n - 1) * es;
ADDRLP4 36
ADDRFP4 4
INDIRI4
CNSTI4 1
SUBI4
ADDRFP4 8
INDIRI4
MULI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
line 125
;125:		if (n > 40) {
ADDRFP4 4
INDIRI4
CNSTI4 40
LEI4 $70
line 126
;126:			d = (n / 8) * es;
ADDRLP4 40
ADDRFP4 4
INDIRI4
CNSTI4 8
DIVI4
ADDRFP4 8
INDIRI4
MULI4
ASGNI4
line 127
;127:			pl = med3(pl, pl + d, pl + 2 * d, cmp);
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 56
ADDRLP4 40
INDIRI4
ASGNI4
ADDRLP4 56
INDIRI4
ADDRLP4 0
INDIRP4
ADDP4
ARGP4
ADDRLP4 56
INDIRI4
CNSTI4 1
LSHI4
ADDRLP4 0
INDIRP4
ADDP4
ARGP4
ADDRFP4 12
INDIRP4
ARGP4
ADDRLP4 60
ADDRGP4 med3
CALLP4
ASGNP4
ADDRLP4 0
ADDRLP4 60
INDIRP4
ASGNP4
line 128
;128:			pm = med3(pm - d, pm, pm + d, cmp);
ADDRLP4 68
ADDRLP4 40
INDIRI4
ASGNI4
ADDRLP4 32
INDIRP4
ADDRLP4 68
INDIRI4
SUBP4
ARGP4
ADDRLP4 32
INDIRP4
ARGP4
ADDRLP4 68
INDIRI4
ADDRLP4 32
INDIRP4
ADDP4
ARGP4
ADDRFP4 12
INDIRP4
ARGP4
ADDRLP4 72
ADDRGP4 med3
CALLP4
ASGNP4
ADDRLP4 32
ADDRLP4 72
INDIRP4
ASGNP4
line 129
;129:			pn = med3(pn - 2 * d, pn - d, pn, cmp);
ADDRLP4 80
ADDRLP4 40
INDIRI4
ASGNI4
ADDRLP4 36
INDIRP4
ADDRLP4 80
INDIRI4
CNSTI4 1
LSHI4
SUBP4
ARGP4
ADDRLP4 36
INDIRP4
ADDRLP4 80
INDIRI4
SUBP4
ARGP4
ADDRLP4 36
INDIRP4
ARGP4
ADDRFP4 12
INDIRP4
ARGP4
ADDRLP4 84
ADDRGP4 med3
CALLP4
ASGNP4
ADDRLP4 36
ADDRLP4 84
INDIRP4
ASGNP4
line 130
;130:		}
LABELV $70
line 131
;131:		pm = med3(pl, pm, pn, cmp);
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 32
INDIRP4
ARGP4
ADDRLP4 36
INDIRP4
ARGP4
ADDRFP4 12
INDIRP4
ARGP4
ADDRLP4 52
ADDRGP4 med3
CALLP4
ASGNP4
ADDRLP4 32
ADDRLP4 52
INDIRP4
ASGNP4
line 132
;132:	}
LABELV $68
line 133
;133:	swap(a, pm);
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $72
ADDRLP4 52
ADDRFP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 32
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 32
INDIRP4
ADDRLP4 52
INDIRI4
ASGNI4
ADDRGP4 $73
JUMPV
LABELV $72
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 32
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $73
line 134
;134:	pa = pb = (char *)a + es;
ADDRLP4 52
ADDRFP4 8
INDIRI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
ADDRLP4 4
ADDRLP4 52
INDIRP4
ASGNP4
ADDRLP4 20
ADDRLP4 52
INDIRP4
ASGNP4
line 136
;135:
;136:	pc = pd = (char *)a + (n - 1) * es;
ADDRLP4 56
ADDRFP4 4
INDIRI4
CNSTI4 1
SUBI4
ADDRFP4 8
INDIRI4
MULI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
ADDRLP4 24
ADDRLP4 56
INDIRP4
ASGNP4
ADDRLP4 8
ADDRLP4 56
INDIRP4
ASGNP4
line 137
;137:	for (;;) {
ADDRGP4 $79
JUMPV
LABELV $78
line 138
;138:		while (pb <= pc && (r = cmp(pb, a)) <= 0) {
line 139
;139:			if (r == 0) {
ADDRLP4 12
INDIRI4
CNSTI4 0
NEI4 $81
line 140
;140:				swap_cnt = 1;
ADDRLP4 28
CNSTI4 1
ASGNI4
line 141
;141:				swap(pa, pb);
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $83
ADDRLP4 60
ADDRLP4 20
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 20
INDIRP4
ADDRLP4 4
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 4
INDIRP4
ADDRLP4 60
INDIRI4
ASGNI4
ADDRGP4 $84
JUMPV
LABELV $83
ADDRLP4 20
INDIRP4
ARGP4
ADDRLP4 4
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $84
line 142
;142:				pa += es;
ADDRLP4 20
ADDRFP4 8
INDIRI4
ADDRLP4 20
INDIRP4
ADDP4
ASGNP4
line 143
;143:			}
LABELV $81
line 144
;144:			pb += es;
ADDRLP4 4
ADDRFP4 8
INDIRI4
ADDRLP4 4
INDIRP4
ADDP4
ASGNP4
line 145
;145:		}
LABELV $79
line 138
ADDRLP4 4
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRP4
CVPU4 4
GTU4 $85
ADDRLP4 4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 64
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 12
ADDRLP4 64
INDIRI4
ASGNI4
ADDRLP4 64
INDIRI4
CNSTI4 0
LEI4 $78
LABELV $85
ADDRGP4 $87
JUMPV
LABELV $86
line 146
;146:		while (pb <= pc && (r = cmp(pc, a)) >= 0) {
line 147
;147:			if (r == 0) {
ADDRLP4 12
INDIRI4
CNSTI4 0
NEI4 $89
line 148
;148:				swap_cnt = 1;
ADDRLP4 28
CNSTI4 1
ASGNI4
line 149
;149:				swap(pc, pd);
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $91
ADDRLP4 68
ADDRLP4 8
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 8
INDIRP4
ADDRLP4 24
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 24
INDIRP4
ADDRLP4 68
INDIRI4
ASGNI4
ADDRGP4 $92
JUMPV
LABELV $91
ADDRLP4 8
INDIRP4
ARGP4
ADDRLP4 24
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $92
line 150
;150:				pd -= es;
ADDRLP4 24
ADDRLP4 24
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ASGNP4
line 151
;151:			}
LABELV $89
line 152
;152:			pc -= es;
ADDRLP4 8
ADDRLP4 8
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ASGNP4
line 153
;153:		}
LABELV $87
line 146
ADDRLP4 4
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRP4
CVPU4 4
GTU4 $93
ADDRLP4 8
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 72
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 12
ADDRLP4 72
INDIRI4
ASGNI4
ADDRLP4 72
INDIRI4
CNSTI4 0
GEI4 $86
LABELV $93
line 154
;154:		if (pb > pc)
ADDRLP4 4
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRP4
CVPU4 4
LEU4 $94
line 155
;155:			break;
ADDRGP4 $76
JUMPV
LABELV $94
line 156
;156:		swap(pb, pc);
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $96
ADDRLP4 76
ADDRLP4 4
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 4
INDIRP4
ADDRLP4 8
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 8
INDIRP4
ADDRLP4 76
INDIRI4
ASGNI4
ADDRGP4 $97
JUMPV
LABELV $96
ADDRLP4 4
INDIRP4
ARGP4
ADDRLP4 8
INDIRP4
ARGP4
ADDRFP4 8
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $97
line 157
;157:		swap_cnt = 1;
ADDRLP4 28
CNSTI4 1
ASGNI4
line 158
;158:		pb += es;
ADDRLP4 4
ADDRFP4 8
INDIRI4
ADDRLP4 4
INDIRP4
ADDP4
ASGNP4
line 159
;159:		pc -= es;
ADDRLP4 8
ADDRLP4 8
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ASGNP4
line 160
;160:	}
line 137
ADDRGP4 $79
JUMPV
LABELV $76
line 161
;161:	if (swap_cnt == 0) {  /* Switch to insertion sort */
ADDRLP4 28
INDIRI4
CNSTI4 0
NEI4 $98
line 162
;162:		for (pm = (char *)a + es; pm < (char *)a + n * es; pm += es)
ADDRLP4 32
ADDRFP4 8
INDIRI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
ADDRGP4 $103
JUMPV
LABELV $100
line 163
;163:			for (pl = pm; pl > (char *)a && cmp(pl - es, pl) > 0;
ADDRLP4 0
ADDRLP4 32
INDIRP4
ASGNP4
ADDRGP4 $107
JUMPV
LABELV $104
line 165
;164:			     pl -= es)
;165:				swap(pl, pl - es);
ADDRLP4 16
INDIRI4
CNSTI4 0
NEI4 $108
ADDRLP4 60
ADDRLP4 0
INDIRP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ADDRLP4 60
INDIRI4
ASGNI4
ADDRGP4 $109
JUMPV
LABELV $108
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 64
ADDRFP4 8
INDIRI4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRLP4 64
INDIRI4
SUBP4
ARGP4
ADDRLP4 64
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $109
LABELV $105
line 164
ADDRLP4 0
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ASGNP4
LABELV $107
line 163
ADDRLP4 0
INDIRP4
CVPU4 4
ADDRFP4 0
INDIRP4
CVPU4 4
LEU4 $110
ADDRLP4 0
INDIRP4
ADDRFP4 8
INDIRI4
SUBP4
ARGP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 72
ADDRFP4 12
INDIRP4
CALLI4
ASGNI4
ADDRLP4 72
INDIRI4
CNSTI4 0
GTI4 $104
LABELV $110
LABELV $101
line 162
ADDRLP4 32
ADDRFP4 8
INDIRI4
ADDRLP4 32
INDIRP4
ADDP4
ASGNP4
LABELV $103
ADDRLP4 32
INDIRP4
CVPU4 4
ADDRFP4 4
INDIRI4
ADDRFP4 8
INDIRI4
MULI4
ADDRFP4 0
INDIRP4
ADDP4
CVPU4 4
LTU4 $100
line 166
;166:		return;
ADDRGP4 $46
JUMPV
LABELV $98
line 169
;167:	}
;168:
;169:	pn = (char *)a + n * es;
ADDRLP4 36
ADDRFP4 4
INDIRI4
ADDRFP4 8
INDIRI4
MULI4
ADDRFP4 0
INDIRP4
ADDP4
ASGNP4
line 170
;170:	r = min(pa - (char *)a, pb - pa);
ADDRLP4 64
ADDRLP4 20
INDIRP4
CVPU4 4
ASGNU4
ADDRLP4 64
INDIRU4
ADDRFP4 0
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ADDRLP4 4
INDIRP4
CVPU4 4
ADDRLP4 64
INDIRU4
SUBU4
CVUI4 4
GEI4 $112
ADDRLP4 60
ADDRLP4 20
INDIRP4
CVPU4 4
ADDRFP4 0
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ASGNI4
ADDRGP4 $113
JUMPV
LABELV $112
ADDRLP4 60
ADDRLP4 4
INDIRP4
CVPU4 4
ADDRLP4 20
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ASGNI4
LABELV $113
ADDRLP4 12
ADDRLP4 60
INDIRI4
ASGNI4
line 171
;171:	vecswap(a, pb - r, r);
ADDRLP4 12
INDIRI4
CNSTI4 0
LEI4 $114
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 4
INDIRP4
ADDRLP4 12
INDIRI4
SUBP4
ARGP4
ADDRLP4 12
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $114
line 172
;172:	r = min(pd - pc, pn - pd - (int)es);
ADDRLP4 76
ADDRLP4 24
INDIRP4
CVPU4 4
ASGNU4
ADDRLP4 76
INDIRU4
ADDRLP4 8
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ADDRLP4 36
INDIRP4
CVPU4 4
ADDRLP4 76
INDIRU4
SUBU4
CVUI4 4
ADDRFP4 8
INDIRI4
SUBI4
GEI4 $117
ADDRLP4 72
ADDRLP4 24
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ASGNI4
ADDRGP4 $118
JUMPV
LABELV $117
ADDRLP4 72
ADDRLP4 36
INDIRP4
CVPU4 4
ADDRLP4 24
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ADDRFP4 8
INDIRI4
SUBI4
ASGNI4
LABELV $118
ADDRLP4 12
ADDRLP4 72
INDIRI4
ASGNI4
line 173
;173:	vecswap(pb, pn - r, r);
ADDRLP4 12
INDIRI4
CNSTI4 0
LEI4 $119
ADDRLP4 4
INDIRP4
ARGP4
ADDRLP4 36
INDIRP4
ADDRLP4 12
INDIRI4
SUBP4
ARGP4
ADDRLP4 12
INDIRI4
ARGI4
ADDRLP4 16
INDIRI4
ARGI4
ADDRGP4 swapfunc
CALLV
pop
LABELV $119
line 174
;174:	if ((r = pb - pa) > (int)es)
ADDRLP4 84
ADDRLP4 4
INDIRP4
CVPU4 4
ADDRLP4 20
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ASGNI4
ADDRLP4 12
ADDRLP4 84
INDIRI4
ASGNI4
ADDRLP4 84
INDIRI4
ADDRFP4 8
INDIRI4
LEI4 $121
line 175
;175:		qsort(a, r / es, es, cmp);
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 88
ADDRFP4 8
INDIRI4
ASGNI4
ADDRLP4 12
INDIRI4
ADDRLP4 88
INDIRI4
DIVI4
ARGI4
ADDRLP4 88
INDIRI4
ARGI4
ADDRFP4 12
INDIRP4
ARGP4
ADDRGP4 qsort
CALLV
pop
LABELV $121
line 176
;176:	if ((r = pd - pc) > (int)es) {
ADDRLP4 92
ADDRLP4 24
INDIRP4
CVPU4 4
ADDRLP4 8
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
ASGNI4
ADDRLP4 12
ADDRLP4 92
INDIRI4
ASGNI4
ADDRLP4 92
INDIRI4
ADDRFP4 8
INDIRI4
LEI4 $123
line 178
;177:		/* Iterate rather than recurse to save stack space */
;178:		a = pn - r;
ADDRFP4 0
ADDRLP4 36
INDIRP4
ADDRLP4 12
INDIRI4
SUBP4
ASGNP4
line 179
;179:		n = r / es;
ADDRFP4 4
ADDRLP4 12
INDIRI4
ADDRFP4 8
INDIRI4
DIVI4
ASGNI4
line 180
;180:		goto loop;
ADDRGP4 $47
JUMPV
LABELV $123
line 183
;181:	}
;182:/*		qsort(pn - r, r / es, es, cmp);*/
;183:}
LABELV $46
endproc qsort 96 16
export strlen
proc strlen 4 0
line 192
;184:
;185://==================================================================================
;186:
;187:
;188:// this file is excluded from release builds because of intrinsics
;189:
;190:#if defined ( Q3_VM )
;191:
;192:size_t strlen( const char *string ) {
line 195
;193:	const char	*s;
;194:
;195:	s = string;
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 $127
JUMPV
LABELV $126
line 196
;196:	while ( *s ) {
line 197
;197:		s++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 198
;198:	}
LABELV $127
line 196
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $126
line 199
;199:	return s - string;
ADDRLP4 0
INDIRP4
CVPU4 4
ADDRFP4 0
INDIRP4
CVPU4 4
SUBU4
CVUI4 4
RETI4
LABELV $125
endproc strlen 4 0
export strcat
proc strcat 4 0
line 203
;200:}
;201:
;202:
;203:char *strcat( char *strDestination, const char *strSource ) {
line 206
;204:	char	*s;
;205:
;206:	s = strDestination;
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 $131
JUMPV
LABELV $130
line 207
;207:	while ( *s ) {
line 208
;208:		s++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 209
;209:	}
LABELV $131
line 207
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $130
ADDRGP4 $134
JUMPV
LABELV $133
line 210
;210:	while ( *strSource ) {
line 211
;211:		*s = *strSource;
ADDRLP4 0
INDIRP4
ADDRFP4 4
INDIRP4
INDIRI1
ASGNI1
line 212
;212:		s++; strSource++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 213
;213:	}
LABELV $134
line 210
ADDRFP4 4
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $133
line 214
;214:	*s = 0;
ADDRLP4 0
INDIRP4
CNSTI1 0
ASGNI1
line 215
;215:	return strDestination;
ADDRFP4 0
INDIRP4
RETP4
LABELV $129
endproc strcat 4 0
export strcpy
proc strcpy 4 0
line 218
;216:}
;217:
;218:char *strcpy( char *strDestination, const char *strSource ) {
line 221
;219:	char *s;
;220:
;221:	s = strDestination;
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRGP4 $138
JUMPV
LABELV $137
line 222
;222:	while ( *strSource ) {
line 223
;223:		*s = *strSource;
ADDRLP4 0
INDIRP4
ADDRFP4 4
INDIRP4
INDIRI1
ASGNI1
line 224
;224:		s++; strSource++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
ADDRFP4 4
ADDRFP4 4
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 225
;225:	}
LABELV $138
line 222
ADDRFP4 4
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $137
line 226
;226:	*s = 0;
ADDRLP4 0
INDIRP4
CNSTI1 0
ASGNI1
line 227
;227:	return strDestination;
ADDRFP4 0
INDIRP4
RETP4
LABELV $136
endproc strcpy 4 0
export strcmp
proc strcmp 8 0
line 231
;228:}
;229:
;230:
;231:int strcmp( const char *string1, const char *string2 ) {
ADDRGP4 $142
JUMPV
LABELV $141
line 232
;232:	while ( *string1 == *string2 && *string1 && *string2 ) {
line 233
;233:		string1++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 234
;234:		string2++;
ADDRFP4 4
ADDRFP4 4
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 235
;235:	}
LABELV $142
line 232
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 4
ADDRFP4 4
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 0
INDIRI4
ADDRLP4 4
INDIRI4
NEI4 $145
ADDRLP4 0
INDIRI4
CNSTI4 0
EQI4 $145
ADDRLP4 4
INDIRI4
CNSTI4 0
NEI4 $141
LABELV $145
line 236
;236:	return *string1 - *string2;
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ADDRFP4 4
INDIRP4
INDIRI1
CVII4 1
SUBI4
RETI4
LABELV $140
endproc strcmp 8 0
export strchr
proc strchr 0 0
line 240
;237:}
;238:
;239:
;240:char *strchr( const char *string, int c ) {
ADDRGP4 $148
JUMPV
LABELV $147
line 241
;241:	while ( *string ) {
line 242
;242:		if ( *string == c ) {
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ADDRFP4 4
INDIRI4
NEI4 $150
line 243
;243:			return ( char * )string;
ADDRFP4 0
INDIRP4
RETP4
ADDRGP4 $146
JUMPV
LABELV $150
line 245
;244:		}
;245:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 246
;246:	}
LABELV $148
line 241
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $147
line 247
;247:	if(c)
ADDRFP4 4
INDIRI4
CNSTI4 0
EQI4 $152
line 248
;248:		return NULL;
CNSTP4 0
RETP4
ADDRGP4 $146
JUMPV
LABELV $152
line 250
;249:	else
;250:		return (char *) string;
ADDRFP4 0
INDIRP4
RETP4
LABELV $146
endproc strchr 0 0
export strstr
proc strstr 8 0
line 254
;251:}
;252:
;253:
;254:char *strstr( const char *string, const char *strCharSet ) {
ADDRGP4 $156
JUMPV
LABELV $155
line 255
;255:	while ( *string ) {
line 258
;256:		int		i;
;257:
;258:		for ( i = 0 ; strCharSet[i] ; i++ ) {
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRGP4 $161
JUMPV
LABELV $158
line 259
;259:			if ( string[i] != strCharSet[i] ) {
ADDRLP4 0
INDIRI4
ADDRFP4 0
INDIRP4
ADDP4
INDIRI1
CVII4 1
ADDRLP4 0
INDIRI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRI1
CVII4 1
EQI4 $162
line 260
;260:				break;
ADDRGP4 $160
JUMPV
LABELV $162
line 262
;261:			}
;262:		}
LABELV $159
line 258
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $161
ADDRLP4 0
INDIRI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $158
LABELV $160
line 263
;263:		if ( !strCharSet[i] ) {
ADDRLP4 0
INDIRI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $164
line 264
;264:			return (char *)string;
ADDRFP4 0
INDIRP4
RETP4
ADDRGP4 $154
JUMPV
LABELV $164
line 266
;265:		}
;266:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 267
;267:	}
LABELV $156
line 255
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $155
line 268
;268:	return (char *)0;
CNSTP4 0
RETP4
LABELV $154
endproc strstr 8 0
export tolower
proc tolower 4 0
line 271
;269:}
;270:
;271:int tolower( int c ) {
line 272
;272:	if ( c >= 'A' && c <= 'Z' ) {
ADDRLP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 65
LTI4 $167
ADDRLP4 0
INDIRI4
CNSTI4 90
GTI4 $167
line 273
;273:		c += 'a' - 'A';
ADDRFP4 0
ADDRFP4 0
INDIRI4
CNSTI4 32
ADDI4
ASGNI4
line 274
;274:	}
LABELV $167
line 275
;275:	return c;
ADDRFP4 0
INDIRI4
RETI4
LABELV $166
endproc tolower 4 0
export toupper
proc toupper 4 0
line 278
;276:}
;277:
;278:int toupper( int c ) {
line 279
;279:	if ( c >= 'a' && c <= 'z' ) {
ADDRLP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 97
LTI4 $170
ADDRLP4 0
INDIRI4
CNSTI4 122
GTI4 $170
line 280
;280:		c += 'A' - 'a';
ADDRFP4 0
ADDRFP4 0
INDIRI4
CNSTI4 -32
ADDI4
ASGNI4
line 281
;281:	}
LABELV $170
line 282
;282:	return c;
ADDRFP4 0
INDIRI4
RETI4
LABELV $169
endproc toupper 4 0
export memmove
proc memmove 8 0
line 285
;283:}
;284:
;285:void *memmove( void *dest, const void *src, size_t count ) {
line 288
;286:	int		i;
;287:
;288:	if ( dest > src ) {
ADDRFP4 0
INDIRP4
CVPU4 4
ADDRFP4 4
INDIRP4
CVPU4 4
LEU4 $173
line 289
;289:		for ( i = count-1 ; i >= 0 ; i-- ) {
ADDRLP4 0
ADDRFP4 8
INDIRI4
CNSTI4 1
SUBI4
ASGNI4
ADDRGP4 $178
JUMPV
LABELV $175
line 290
;290:			((char *)dest)[i] = ((char *)src)[i];
ADDRLP4 0
INDIRI4
ADDRFP4 0
INDIRP4
ADDP4
ADDRLP4 0
INDIRI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRI1
ASGNI1
line 291
;291:		}
LABELV $176
line 289
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
SUBI4
ASGNI4
LABELV $178
ADDRLP4 0
INDIRI4
CNSTI4 0
GEI4 $175
line 292
;292:	} else {
ADDRGP4 $174
JUMPV
LABELV $173
line 293
;293:		for ( i = 0 ; i < count ; i++ ) {
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRGP4 $182
JUMPV
LABELV $179
line 294
;294:			((char *)dest)[i] = ((char *)src)[i];
ADDRLP4 0
INDIRI4
ADDRFP4 0
INDIRP4
ADDP4
ADDRLP4 0
INDIRI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRI1
ASGNI1
line 295
;295:		}
LABELV $180
line 293
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $182
ADDRLP4 0
INDIRI4
ADDRFP4 8
INDIRI4
LTI4 $179
line 296
;296:	}
LABELV $174
line 297
;297:	return dest;
ADDRFP4 0
INDIRP4
RETP4
LABELV $172
endproc memmove 8 0
export tan
proc tan 8 4
line 560
;298:}
;299:#endif
;300:
;301:#if 0
;302:
;303:double floor( double x ) {
;304:	return (int)(x + 0x40000000) - 0x40000000;
;305:}
;306:
;307:void *memset( void *dest, int c, size_t count ) {
;308:	while ( count-- ) {
;309:		((char *)dest)[count] = c;
;310:	}
;311:	return dest;
;312:}
;313:
;314:void *memcpy( void *dest, const void *src, size_t count ) {
;315:	while ( count-- ) {
;316:		((char *)dest)[count] = ((char *)src)[count];
;317:	}
;318:	return dest;
;319:}
;320:
;321:char *strncpy( char *strDest, const char *strSource, size_t count ) {
;322:	char	*s;
;323:
;324:	s = strDest;
;325:	while ( *strSource && count ) {
;326:		*s = *strSource;
;327:		s++; strSource++;
;328:		count--;
;329:	}
;330:	while ( count-- ) {
;331:		*s = '\0'; s++;
;332:	}
;333:	return strDest;
;334:}
;335:
;336:
;337:/*
;338:void create_acostable( void ) {
;339:	int i;
;340:	FILE *fp;
;341:	float a;
;342:
;343:	fp = fopen("c:\\acostable.txt", "w");
;344:	fprintf(fp, "float acostable[] = {");
;345:	for (i = 0; i < 1024; i++) {
;346:		if (!(i & 7))
;347:			fprintf(fp, "\n");
;348:		a = acos( (float) -1 + i / 512 );
;349:		fprintf(fp, "%1.8f,", a);
;350:	}
;351:	fprintf(fp, "\n}\n");
;352:	fclose(fp);
;353:}
;354:*/
;355:
;356:float acostable[] = {
;357:3.14159265,3.07908248,3.05317551,3.03328655,3.01651113,3.00172442,2.98834964,2.97604422,
;358:2.96458497,2.95381690,2.94362719,2.93393068,2.92466119,2.91576615,2.90720289,2.89893629,
;359:2.89093699,2.88318015,2.87564455,2.86831188,2.86116621,2.85419358,2.84738169,2.84071962,
;360:2.83419760,2.82780691,2.82153967,2.81538876,2.80934770,2.80341062,2.79757211,2.79182724,
;361:2.78617145,2.78060056,2.77511069,2.76969824,2.76435988,2.75909250,2.75389319,2.74875926,
;362:2.74368816,2.73867752,2.73372510,2.72882880,2.72398665,2.71919677,2.71445741,2.70976688,
;363:2.70512362,2.70052613,2.69597298,2.69146283,2.68699438,2.68256642,2.67817778,2.67382735,
;364:2.66951407,2.66523692,2.66099493,2.65678719,2.65261279,2.64847088,2.64436066,2.64028133,
;365:2.63623214,2.63221238,2.62822133,2.62425835,2.62032277,2.61641398,2.61253138,2.60867440,
;366:2.60484248,2.60103507,2.59725167,2.59349176,2.58975488,2.58604053,2.58234828,2.57867769,
;367:2.57502832,2.57139977,2.56779164,2.56420354,2.56063509,2.55708594,2.55355572,2.55004409,
;368:2.54655073,2.54307530,2.53961750,2.53617701,2.53275354,2.52934680,2.52595650,2.52258238,
;369:2.51922417,2.51588159,2.51255441,2.50924238,2.50594525,2.50266278,2.49939476,2.49614096,
;370:2.49290115,2.48967513,2.48646269,2.48326362,2.48007773,2.47690482,2.47374472,2.47059722,
;371:2.46746215,2.46433933,2.46122860,2.45812977,2.45504269,2.45196720,2.44890314,2.44585034,
;372:2.44280867,2.43977797,2.43675809,2.43374890,2.43075025,2.42776201,2.42478404,2.42181622,
;373:2.41885841,2.41591048,2.41297232,2.41004380,2.40712480,2.40421521,2.40131491,2.39842379,
;374:2.39554173,2.39266863,2.38980439,2.38694889,2.38410204,2.38126374,2.37843388,2.37561237,
;375:2.37279910,2.36999400,2.36719697,2.36440790,2.36162673,2.35885335,2.35608768,2.35332964,
;376:2.35057914,2.34783610,2.34510044,2.34237208,2.33965094,2.33693695,2.33423003,2.33153010,
;377:2.32883709,2.32615093,2.32347155,2.32079888,2.31813284,2.31547337,2.31282041,2.31017388,
;378:2.30753373,2.30489988,2.30227228,2.29965086,2.29703556,2.29442632,2.29182309,2.28922580,
;379:2.28663439,2.28404881,2.28146900,2.27889490,2.27632647,2.27376364,2.27120637,2.26865460,
;380:2.26610827,2.26356735,2.26103177,2.25850149,2.25597646,2.25345663,2.25094195,2.24843238,
;381:2.24592786,2.24342836,2.24093382,2.23844420,2.23595946,2.23347956,2.23100444,2.22853408,
;382:2.22606842,2.22360742,2.22115104,2.21869925,2.21625199,2.21380924,2.21137096,2.20893709,
;383:2.20650761,2.20408248,2.20166166,2.19924511,2.19683280,2.19442469,2.19202074,2.18962092,
;384:2.18722520,2.18483354,2.18244590,2.18006225,2.17768257,2.17530680,2.17293493,2.17056692,
;385:2.16820274,2.16584236,2.16348574,2.16113285,2.15878367,2.15643816,2.15409630,2.15175805,
;386:2.14942338,2.14709226,2.14476468,2.14244059,2.14011997,2.13780279,2.13548903,2.13317865,
;387:2.13087163,2.12856795,2.12626757,2.12397047,2.12167662,2.11938600,2.11709859,2.11481435,
;388:2.11253326,2.11025530,2.10798044,2.10570867,2.10343994,2.10117424,2.09891156,2.09665185,
;389:2.09439510,2.09214129,2.08989040,2.08764239,2.08539725,2.08315496,2.08091550,2.07867884,
;390:2.07644495,2.07421383,2.07198545,2.06975978,2.06753681,2.06531651,2.06309887,2.06088387,
;391:2.05867147,2.05646168,2.05425445,2.05204979,2.04984765,2.04764804,2.04545092,2.04325628,
;392:2.04106409,2.03887435,2.03668703,2.03450211,2.03231957,2.03013941,2.02796159,2.02578610,
;393:2.02361292,2.02144204,2.01927344,2.01710710,2.01494300,2.01278113,2.01062146,2.00846399,
;394:2.00630870,2.00415556,2.00200457,1.99985570,1.99770895,1.99556429,1.99342171,1.99128119,
;395:1.98914271,1.98700627,1.98487185,1.98273942,1.98060898,1.97848051,1.97635399,1.97422942,
;396:1.97210676,1.96998602,1.96786718,1.96575021,1.96363511,1.96152187,1.95941046,1.95730088,
;397:1.95519310,1.95308712,1.95098292,1.94888050,1.94677982,1.94468089,1.94258368,1.94048818,
;398:1.93839439,1.93630228,1.93421185,1.93212308,1.93003595,1.92795046,1.92586659,1.92378433,
;399:1.92170367,1.91962459,1.91754708,1.91547113,1.91339673,1.91132385,1.90925250,1.90718266,
;400:1.90511432,1.90304746,1.90098208,1.89891815,1.89685568,1.89479464,1.89273503,1.89067683,
;401:1.88862003,1.88656463,1.88451060,1.88245794,1.88040664,1.87835668,1.87630806,1.87426076,
;402:1.87221477,1.87017008,1.86812668,1.86608457,1.86404371,1.86200412,1.85996577,1.85792866,
;403:1.85589277,1.85385809,1.85182462,1.84979234,1.84776125,1.84573132,1.84370256,1.84167495,
;404:1.83964848,1.83762314,1.83559892,1.83357582,1.83155381,1.82953289,1.82751305,1.82549429,
;405:1.82347658,1.82145993,1.81944431,1.81742973,1.81541617,1.81340362,1.81139207,1.80938151,
;406:1.80737194,1.80536334,1.80335570,1.80134902,1.79934328,1.79733848,1.79533460,1.79333164,
;407:1.79132959,1.78932843,1.78732817,1.78532878,1.78333027,1.78133261,1.77933581,1.77733985,
;408:1.77534473,1.77335043,1.77135695,1.76936428,1.76737240,1.76538132,1.76339101,1.76140148,
;409:1.75941271,1.75742470,1.75543743,1.75345090,1.75146510,1.74948002,1.74749565,1.74551198,
;410:1.74352900,1.74154672,1.73956511,1.73758417,1.73560389,1.73362426,1.73164527,1.72966692,
;411:1.72768920,1.72571209,1.72373560,1.72175971,1.71978441,1.71780969,1.71583556,1.71386199,
;412:1.71188899,1.70991653,1.70794462,1.70597325,1.70400241,1.70203209,1.70006228,1.69809297,
;413:1.69612416,1.69415584,1.69218799,1.69022062,1.68825372,1.68628727,1.68432127,1.68235571,
;414:1.68039058,1.67842588,1.67646160,1.67449772,1.67253424,1.67057116,1.66860847,1.66664615,
;415:1.66468420,1.66272262,1.66076139,1.65880050,1.65683996,1.65487975,1.65291986,1.65096028,
;416:1.64900102,1.64704205,1.64508338,1.64312500,1.64116689,1.63920905,1.63725148,1.63529416,
;417:1.63333709,1.63138026,1.62942366,1.62746728,1.62551112,1.62355517,1.62159943,1.61964388,
;418:1.61768851,1.61573332,1.61377831,1.61182346,1.60986877,1.60791422,1.60595982,1.60400556,
;419:1.60205142,1.60009739,1.59814349,1.59618968,1.59423597,1.59228235,1.59032882,1.58837536,
;420:1.58642196,1.58446863,1.58251535,1.58056211,1.57860891,1.57665574,1.57470259,1.57274945,
;421:1.57079633,1.56884320,1.56689007,1.56493692,1.56298375,1.56103055,1.55907731,1.55712403,
;422:1.55517069,1.55321730,1.55126383,1.54931030,1.54735668,1.54540297,1.54344917,1.54149526,
;423:1.53954124,1.53758710,1.53563283,1.53367843,1.53172389,1.52976919,1.52781434,1.52585933,
;424:1.52390414,1.52194878,1.51999323,1.51803748,1.51608153,1.51412537,1.51216900,1.51021240,
;425:1.50825556,1.50629849,1.50434117,1.50238360,1.50042576,1.49846765,1.49650927,1.49455060,
;426:1.49259163,1.49063237,1.48867280,1.48671291,1.48475270,1.48279215,1.48083127,1.47887004,
;427:1.47690845,1.47494650,1.47298419,1.47102149,1.46905841,1.46709493,1.46513106,1.46316677,
;428:1.46120207,1.45923694,1.45727138,1.45530538,1.45333893,1.45137203,1.44940466,1.44743682,
;429:1.44546850,1.44349969,1.44153038,1.43956057,1.43759024,1.43561940,1.43364803,1.43167612,
;430:1.42970367,1.42773066,1.42575709,1.42378296,1.42180825,1.41983295,1.41785705,1.41588056,
;431:1.41390346,1.41192573,1.40994738,1.40796840,1.40598877,1.40400849,1.40202755,1.40004594,
;432:1.39806365,1.39608068,1.39409701,1.39211264,1.39012756,1.38814175,1.38615522,1.38416795,
;433:1.38217994,1.38019117,1.37820164,1.37621134,1.37422025,1.37222837,1.37023570,1.36824222,
;434:1.36624792,1.36425280,1.36225684,1.36026004,1.35826239,1.35626387,1.35426449,1.35226422,
;435:1.35026307,1.34826101,1.34625805,1.34425418,1.34224937,1.34024364,1.33823695,1.33622932,
;436:1.33422072,1.33221114,1.33020059,1.32818904,1.32617649,1.32416292,1.32214834,1.32013273,
;437:1.31811607,1.31609837,1.31407960,1.31205976,1.31003885,1.30801684,1.30599373,1.30396951,
;438:1.30194417,1.29991770,1.29789009,1.29586133,1.29383141,1.29180031,1.28976803,1.28773456,
;439:1.28569989,1.28366400,1.28162688,1.27958854,1.27754894,1.27550809,1.27346597,1.27142257,
;440:1.26937788,1.26733189,1.26528459,1.26323597,1.26118602,1.25913471,1.25708205,1.25502803,
;441:1.25297262,1.25091583,1.24885763,1.24679802,1.24473698,1.24267450,1.24061058,1.23854519,
;442:1.23647833,1.23440999,1.23234015,1.23026880,1.22819593,1.22612152,1.22404557,1.22196806,
;443:1.21988898,1.21780832,1.21572606,1.21364219,1.21155670,1.20946958,1.20738080,1.20529037,
;444:1.20319826,1.20110447,1.19900898,1.19691177,1.19481283,1.19271216,1.19060973,1.18850553,
;445:1.18639955,1.18429178,1.18218219,1.18007079,1.17795754,1.17584244,1.17372548,1.17160663,
;446:1.16948589,1.16736324,1.16523866,1.16311215,1.16098368,1.15885323,1.15672081,1.15458638,
;447:1.15244994,1.15031147,1.14817095,1.14602836,1.14388370,1.14173695,1.13958808,1.13743709,
;448:1.13528396,1.13312866,1.13097119,1.12881153,1.12664966,1.12448556,1.12231921,1.12015061,
;449:1.11797973,1.11580656,1.11363107,1.11145325,1.10927308,1.10709055,1.10490563,1.10271831,
;450:1.10052856,1.09833638,1.09614174,1.09394462,1.09174500,1.08954287,1.08733820,1.08513098,
;451:1.08292118,1.08070879,1.07849378,1.07627614,1.07405585,1.07183287,1.06960721,1.06737882,
;452:1.06514770,1.06291382,1.06067715,1.05843769,1.05619540,1.05395026,1.05170226,1.04945136,
;453:1.04719755,1.04494080,1.04268110,1.04041841,1.03815271,1.03588399,1.03361221,1.03133735,
;454:1.02905939,1.02677830,1.02449407,1.02220665,1.01991603,1.01762219,1.01532509,1.01302471,
;455:1.01072102,1.00841400,1.00610363,1.00378986,1.00147268,0.99915206,0.99682798,0.99450039,
;456:0.99216928,0.98983461,0.98749636,0.98515449,0.98280898,0.98045980,0.97810691,0.97575030,
;457:0.97338991,0.97102573,0.96865772,0.96628585,0.96391009,0.96153040,0.95914675,0.95675912,
;458:0.95436745,0.95197173,0.94957191,0.94716796,0.94475985,0.94234754,0.93993099,0.93751017,
;459:0.93508504,0.93265556,0.93022170,0.92778341,0.92534066,0.92289341,0.92044161,0.91798524,
;460:0.91552424,0.91305858,0.91058821,0.90811309,0.90563319,0.90314845,0.90065884,0.89816430,
;461:0.89566479,0.89316028,0.89065070,0.88813602,0.88561619,0.88309116,0.88056088,0.87802531,
;462:0.87548438,0.87293806,0.87038629,0.86782901,0.86526619,0.86269775,0.86012366,0.85754385,
;463:0.85495827,0.85236686,0.84976956,0.84716633,0.84455709,0.84194179,0.83932037,0.83669277,
;464:0.83405893,0.83141877,0.82877225,0.82611928,0.82345981,0.82079378,0.81812110,0.81544172,
;465:0.81275556,0.81006255,0.80736262,0.80465570,0.80194171,0.79922057,0.79649221,0.79375655,
;466:0.79101352,0.78826302,0.78550497,0.78273931,0.77996593,0.77718475,0.77439569,0.77159865,
;467:0.76879355,0.76598029,0.76315878,0.76032891,0.75749061,0.75464376,0.75178826,0.74892402,
;468:0.74605092,0.74316887,0.74027775,0.73737744,0.73446785,0.73154885,0.72862033,0.72568217,
;469:0.72273425,0.71977644,0.71680861,0.71383064,0.71084240,0.70784376,0.70483456,0.70181469,
;470:0.69878398,0.69574231,0.69268952,0.68962545,0.68654996,0.68346288,0.68036406,0.67725332,
;471:0.67413051,0.67099544,0.66784794,0.66468783,0.66151492,0.65832903,0.65512997,0.65191753,
;472:0.64869151,0.64545170,0.64219789,0.63892987,0.63564741,0.63235028,0.62903824,0.62571106,
;473:0.62236849,0.61901027,0.61563615,0.61224585,0.60883911,0.60541564,0.60197515,0.59851735,
;474:0.59504192,0.59154856,0.58803694,0.58450672,0.58095756,0.57738911,0.57380101,0.57019288,
;475:0.56656433,0.56291496,0.55924437,0.55555212,0.55183778,0.54810089,0.54434099,0.54055758,
;476:0.53675018,0.53291825,0.52906127,0.52517867,0.52126988,0.51733431,0.51337132,0.50938028,
;477:0.50536051,0.50131132,0.49723200,0.49312177,0.48897987,0.48480547,0.48059772,0.47635573,
;478:0.47207859,0.46776530,0.46341487,0.45902623,0.45459827,0.45012983,0.44561967,0.44106652,
;479:0.43646903,0.43182577,0.42713525,0.42239588,0.41760600,0.41276385,0.40786755,0.40291513,
;480:0.39790449,0.39283339,0.38769946,0.38250016,0.37723277,0.37189441,0.36648196,0.36099209,
;481:0.35542120,0.34976542,0.34402054,0.33818204,0.33224495,0.32620390,0.32005298,0.31378574,
;482:0.30739505,0.30087304,0.29421096,0.28739907,0.28042645,0.27328078,0.26594810,0.25841250,
;483:0.25065566,0.24265636,0.23438976,0.22582651,0.21693146,0.20766198,0.19796546,0.18777575,
;484:0.17700769,0.16554844,0.15324301,0.13986823,0.12508152,0.10830610,0.08841715,0.06251018,
;485:}
;486:
;487:double acos( double x ) {
;488:	int index;
;489:
;490:	if (x < -1)
;491:		x = -1;
;492:	if (x > 1)
;493:		x = 1;
;494:	index = (float) (1.0 + x) * 511.9;
;495:	return acostable[index];
;496:}
;497:
;498:double atan2( double y, double x ) {
;499:	float	base;
;500:	float	temp;
;501:	float	dir;
;502:	float	test;
;503:	int		i;
;504:
;505:	if ( x < 0 ) {
;506:		if ( y >= 0 ) {
;507:			// quad 1
;508:			base = M_PI / 2;
;509:			temp = x;
;510:			x = y;
;511:			y = -temp;
;512:		} else {
;513:			// quad 2
;514:			base = M_PI;
;515:			x = -x;
;516:			y = -y;
;517:		}
;518:	} else {
;519:		if ( y < 0 ) {
;520:			// quad 3
;521:			base = 3 * M_PI / 2;
;522:			temp = x;
;523:			x = -y;
;524:			y = temp;
;525:		}
;526:	}
;527:
;528:	if ( y > x ) {
;529:		base += M_PI/2;
;530:		temp = x;
;531:		x = y;
;532:		y = temp;
;533:		dir = -1;
;534:	} else {
;535:		dir = 1;
;536:	}
;537:
;538:	// calcualte angle in octant 0
;539:	if ( x == 0 ) {
;540:		return base;
;541:	}
;542:	y /= x;
;543:
;544:	for ( i = 0 ; i < 512 ; i++ ) {
;545:		test = sintable[i] / sintable[1023-i];
;546:		if ( test > y ) {
;547:			break;
;548:		}
;549:	}
;550:
;551:	return base + dir * i * ( M_PI/2048); 
;552:}
;553:
;554:
;555:#endif
;556:
;557:#ifdef Q3_VM
;558:// bk001127 - guarded this tan replacement 
;559:// ld: undefined versioned symbol name tan@@GLIBC_2.0
;560:double tan( double x ) {
line 561
;561:	return sin(x) / cos(x);
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
DIVF4
RETF4
LABELV $183
endproc tan 8 4
data
align 4
LABELV randSeed
byte 4 0
export srand
code
proc srand 0 0
line 568
;562:}
;563:#endif
;564:
;565:
;566:static int randSeed = 0;
;567:
;568:void	srand( unsigned seed ) {
line 569
;569:	randSeed = seed;
ADDRGP4 randSeed
ADDRFP4 0
INDIRU4
CVUI4 4
ASGNI4
line 570
;570:}
LABELV $184
endproc srand 0 0
export rand
proc rand 4 0
line 572
;571:
;572:int		rand( void ) {
line 573
;573:	randSeed = (69069 * randSeed + 1);
ADDRLP4 0
ADDRGP4 randSeed
ASGNP4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
INDIRI4
CNSTI4 69069
MULI4
CNSTI4 1
ADDI4
ASGNI4
line 574
;574:	return randSeed & 0x7fff;
ADDRGP4 randSeed
INDIRI4
CNSTI4 32767
BANDI4
RETI4
LABELV $185
endproc rand 4 0
export atof
proc atof 28 0
line 577
;575:}
;576:
;577:double atof( const char *string ) {
ADDRGP4 $188
JUMPV
LABELV $187
line 584
;578:	float sign;
;579:	float value;
;580:	int		c;
;581:
;582:
;583:	// skip whitespace
;584:	while ( *string <= ' ' ) {
line 585
;585:		if ( !*string ) {
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $190
line 586
;586:			return 0;
CNSTF4 0
RETF4
ADDRGP4 $186
JUMPV
LABELV $190
line 588
;587:		}
;588:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 589
;589:	}
LABELV $188
line 584
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 32
LEI4 $187
line 592
;590:
;591:	// check sign
;592:	switch ( *string ) {
ADDRLP4 12
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 43
EQI4 $195
ADDRLP4 12
INDIRI4
CNSTI4 45
EQI4 $196
ADDRGP4 $192
JUMPV
LABELV $195
line 594
;593:	case '+':
;594:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 595
;595:		sign = 1;
ADDRLP4 8
CNSTF4 1065353216
ASGNF4
line 596
;596:		break;
ADDRGP4 $193
JUMPV
LABELV $196
line 598
;597:	case '-':
;598:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 599
;599:		sign = -1;
ADDRLP4 8
CNSTF4 3212836864
ASGNF4
line 600
;600:		break;
ADDRGP4 $193
JUMPV
LABELV $192
line 602
;601:	default:
;602:		sign = 1;
ADDRLP4 8
CNSTF4 1065353216
ASGNF4
line 603
;603:		break;
LABELV $193
line 607
;604:	}
;605:
;606:	// read digits
;607:	value = 0;
ADDRLP4 4
CNSTF4 0
ASGNF4
line 608
;608:	c = string[0];
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
line 609
;609:	if ( c != '.' ) {
ADDRLP4 0
INDIRI4
CNSTI4 46
EQI4 $197
LABELV $199
line 610
;610:		do {
line 611
;611:			c = *string; string++;
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 612
;612:			if ( c < '0' || c > '9' ) {
ADDRLP4 0
INDIRI4
CNSTI4 48
LTI4 $204
ADDRLP4 0
INDIRI4
CNSTI4 57
LEI4 $202
LABELV $204
line 613
;613:				break;
ADDRGP4 $198
JUMPV
LABELV $202
line 615
;614:			}
;615:			c -= '0';
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 48
SUBI4
ASGNI4
line 616
;616:			value = value * 10 + c;
ADDRLP4 4
ADDRLP4 4
INDIRF4
CNSTF4 1092616192
MULF4
ADDRLP4 0
INDIRI4
CVIF4 4
ADDF4
ASGNF4
line 617
;617:		} while ( 1 );
LABELV $200
ADDRGP4 $199
JUMPV
line 618
;618:	} else {
ADDRGP4 $198
JUMPV
LABELV $197
line 619
;619:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 620
;620:	}
LABELV $198
line 623
;621:
;622:	// check for decimal point
;623:	if ( c == '.' ) {
ADDRLP4 0
INDIRI4
CNSTI4 46
NEI4 $205
line 626
;624:		double fraction;
;625:
;626:		fraction = 0.1;
ADDRLP4 20
CNSTF4 1036831949
ASGNF4
LABELV $207
line 627
;627:		do {
line 628
;628:			c = *string; string++;
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 629
;629:			if ( c < '0' || c > '9' ) {
ADDRLP4 0
INDIRI4
CNSTI4 48
LTI4 $212
ADDRLP4 0
INDIRI4
CNSTI4 57
LEI4 $210
LABELV $212
line 630
;630:				break;
ADDRGP4 $209
JUMPV
LABELV $210
line 632
;631:			}
;632:			c -= '0';
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 48
SUBI4
ASGNI4
line 633
;633:			value += c * fraction;
ADDRLP4 4
ADDRLP4 4
INDIRF4
ADDRLP4 0
INDIRI4
CVIF4 4
ADDRLP4 20
INDIRF4
MULF4
ADDF4
ASGNF4
line 634
;634:			fraction *= 0.1;
ADDRLP4 20
ADDRLP4 20
INDIRF4
CNSTF4 1036831949
MULF4
ASGNF4
line 635
;635:		} while ( 1 );
LABELV $208
ADDRGP4 $207
JUMPV
LABELV $209
line 637
;636:
;637:	}
LABELV $205
line 641
;638:
;639:	// not handling 10e10 notation...
;640:
;641:	return value * sign;
ADDRLP4 4
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
RETF4
LABELV $186
endproc atof 28 0
export _atof
proc _atof 32 0
line 644
;642:}
;643:
;644:double _atof( const char **stringPtr ) {
line 648
;645:	const char	*string;
;646:	float sign;
;647:	float value;
;648:	int		c = '0'; // bk001211 - uninitialized use possible
ADDRLP4 4
CNSTI4 48
ASGNI4
line 650
;649:
;650:	string = *stringPtr;
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRP4
ASGNP4
ADDRGP4 $215
JUMPV
LABELV $214
line 653
;651:
;652:	// skip whitespace
;653:	while ( *string <= ' ' ) {
line 654
;654:		if ( !*string ) {
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $217
line 655
;655:			*stringPtr = string;
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRP4
ASGNP4
line 656
;656:			return 0;
CNSTF4 0
RETF4
ADDRGP4 $213
JUMPV
LABELV $217
line 658
;657:		}
;658:		string++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 659
;659:	}
LABELV $215
line 653
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 32
LEI4 $214
line 662
;660:
;661:	// check sign
;662:	switch ( *string ) {
ADDRLP4 16
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 16
INDIRI4
CNSTI4 43
EQI4 $222
ADDRLP4 16
INDIRI4
CNSTI4 45
EQI4 $223
ADDRGP4 $219
JUMPV
LABELV $222
line 664
;663:	case '+':
;664:		string++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 665
;665:		sign = 1;
ADDRLP4 12
CNSTF4 1065353216
ASGNF4
line 666
;666:		break;
ADDRGP4 $220
JUMPV
LABELV $223
line 668
;667:	case '-':
;668:		string++;
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 669
;669:		sign = -1;
ADDRLP4 12
CNSTF4 3212836864
ASGNF4
line 670
;670:		break;
ADDRGP4 $220
JUMPV
LABELV $219
line 672
;671:	default:
;672:		sign = 1;
ADDRLP4 12
CNSTF4 1065353216
ASGNF4
line 673
;673:		break;
LABELV $220
line 677
;674:	}
;675:
;676:	// read digits
;677:	value = 0;
ADDRLP4 8
CNSTF4 0
ASGNF4
line 678
;678:	if ( string[0] != '.' ) {
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 46
EQI4 $224
LABELV $226
line 679
;679:		do {
line 680
;680:			c = *string; string++;
ADDRLP4 4
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 681
;681:			if ( c < '0' || c > '9' ) {
ADDRLP4 4
INDIRI4
CNSTI4 48
LTI4 $231
ADDRLP4 4
INDIRI4
CNSTI4 57
LEI4 $229
LABELV $231
line 682
;682:				break;
ADDRGP4 $228
JUMPV
LABELV $229
line 684
;683:			}
;684:			c -= '0';
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 48
SUBI4
ASGNI4
line 685
;685:			value = value * 10 + c;
ADDRLP4 8
ADDRLP4 8
INDIRF4
CNSTF4 1092616192
MULF4
ADDRLP4 4
INDIRI4
CVIF4 4
ADDF4
ASGNF4
line 686
;686:		} while ( 1 );
LABELV $227
ADDRGP4 $226
JUMPV
LABELV $228
line 687
;687:	}
LABELV $224
line 690
;688:
;689:	// check for decimal point
;690:	if ( c == '.' ) {
ADDRLP4 4
INDIRI4
CNSTI4 46
NEI4 $232
line 693
;691:		double fraction;
;692:
;693:		fraction = 0.1;
ADDRLP4 24
CNSTF4 1036831949
ASGNF4
LABELV $234
line 694
;694:		do {
line 695
;695:			c = *string; string++;
ADDRLP4 4
ADDRLP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 696
;696:			if ( c < '0' || c > '9' ) {
ADDRLP4 4
INDIRI4
CNSTI4 48
LTI4 $239
ADDRLP4 4
INDIRI4
CNSTI4 57
LEI4 $237
LABELV $239
line 697
;697:				break;
ADDRGP4 $236
JUMPV
LABELV $237
line 699
;698:			}
;699:			c -= '0';
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 48
SUBI4
ASGNI4
line 700
;700:			value += c * fraction;
ADDRLP4 8
ADDRLP4 8
INDIRF4
ADDRLP4 4
INDIRI4
CVIF4 4
ADDRLP4 24
INDIRF4
MULF4
ADDF4
ASGNF4
line 701
;701:			fraction *= 0.1;
ADDRLP4 24
ADDRLP4 24
INDIRF4
CNSTF4 1036831949
MULF4
ASGNF4
line 702
;702:		} while ( 1 );
LABELV $235
ADDRGP4 $234
JUMPV
LABELV $236
line 704
;703:
;704:	}
LABELV $232
line 707
;705:
;706:	// not handling 10e10 notation...
;707:	*stringPtr = string;
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRP4
ASGNP4
line 709
;708:
;709:	return value * sign;
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
RETF4
LABELV $213
endproc _atof 32 0
export atoi
proc atoi 24 0
line 714
;710:}
;711:
;712:
;713:#if defined ( Q3_VM )
;714:int atoi( const char *string ) {
ADDRGP4 $242
JUMPV
LABELV $241
line 721
;715:	int		sign;
;716:	int		value;
;717:	int		c;
;718:
;719:
;720:	// skip whitespace
;721:	while ( *string <= ' ' ) {
line 722
;722:		if ( !*string ) {
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 0
NEI4 $244
line 723
;723:			return 0;
CNSTI4 0
RETI4
ADDRGP4 $240
JUMPV
LABELV $244
line 725
;724:		}
;725:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 726
;726:	}
LABELV $242
line 721
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
CNSTI4 32
LEI4 $241
line 729
;727:
;728:	// check sign
;729:	switch ( *string ) {
ADDRLP4 12
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 43
EQI4 $249
ADDRLP4 12
INDIRI4
CNSTI4 45
EQI4 $250
ADDRGP4 $246
JUMPV
LABELV $249
line 731
;730:	case '+':
;731:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 732
;732:		sign = 1;
ADDRLP4 8
CNSTI4 1
ASGNI4
line 733
;733:		break;
ADDRGP4 $247
JUMPV
LABELV $250
line 735
;734:	case '-':
;735:		string++;
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 736
;736:		sign = -1;
ADDRLP4 8
CNSTI4 -1
ASGNI4
line 737
;737:		break;
ADDRGP4 $247
JUMPV
LABELV $246
line 739
;738:	default:
;739:		sign = 1;
ADDRLP4 8
CNSTI4 1
ASGNI4
line 740
;740:		break;
LABELV $247
line 744
;741:	}
;742:
;743:	// read digits
;744:	value = 0;
ADDRLP4 4
CNSTI4 0
ASGNI4
LABELV $251
line 745
;745:	do {
line 746
;746:		c = *string; string++;
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRI1
CVII4 1
ASGNI4
ADDRFP4 0
ADDRFP4 0
INDIRP4
CNSTI4 1
ADDP4
ASGNP4
line 747
;747:		if ( c < '0' || c > '9' ) {
ADDRLP4 0
INDIRI4
CNSTI4 48
LTI4 $256
ADDRLP4 0
INDIRI4
CNSTI4 57
LEI4 $254
LABELV $256
line 748
;748:			break;
ADDRGP4 $253
JUMPV
LABELV $254
line 750
;749:		}
;750:		c -= '0';
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 48
SUBI4
ASGNI4
line 751
;751:		value = value * 10 + c;
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 10
MULI4
ADDRLP4 0
INDIRI4
ADDI4
ASGNI4
line 752
;752:	} while ( 1 );
LABELV $252
ADDRGP4 $251
JUMPV
LABELV $253
line 756
;753:
;754:	// not handling 10e10 notation...
;755:
;756:	return value * sign;
ADDRLP4 4
INDIRI4
ADDRLP4 8
INDIRI4
MULI4
RETI4
LABELV $240
endproc atoi 24 0
export abs
proc abs 4 0
line 759
;757:}
;758:
;759:int abs( int n ) {
line 760
;760:	return n < 0 ? -n : n;
ADDRFP4 0
INDIRI4
CNSTI4 0
GEI4 $259
ADDRLP4 0
ADDRFP4 0
INDIRI4
NEGI4
ASGNI4
ADDRGP4 $260
JUMPV
LABELV $259
ADDRLP4 0
ADDRFP4 0
INDIRI4
ASGNI4
LABELV $260
ADDRLP4 0
INDIRI4
RETI4
LABELV $257
endproc abs 4 0
export fabs
proc fabs 4 0
line 763
;761:}
;762:
;763:double fabs( double x ) {
line 764
;764:	return x < 0 ? -x : x;
ADDRFP4 0
INDIRF4
CNSTF4 0
GEF4 $263
ADDRLP4 0
ADDRFP4 0
INDIRF4
NEGF4
ASGNF4
ADDRGP4 $264
JUMPV
LABELV $263
ADDRLP4 0
ADDRFP4 0
INDIRF4
ASGNF4
LABELV $264
ADDRLP4 0
INDIRF4
RETF4
LABELV $261
endproc fabs 4 0
import Com_Printf
import Com_Error
import Info_NextPair
import Info_ValidateKeyValue
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_ValueForKey
import va
import Q_CleanStr
import Q_PrintStrlen
import Q_strcat
import Q_strncpyz
import Q_strrchr
import Q_strupr
import Q_strlwr
import Q_stricmpn
import Q_strncmp
import Q_stricmp
import Q_isalpha
import Q_isupper
import Q_islower
import Q_isprint
import locase
import Com_sprintf
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import Com_Split
import COM_ParseSep
import Com_InitSeparators
import SkipTillSeparators
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_StripExtension
import COM_SkipPath
import Com_Clamp
import PerpendicularVector
import AngleVectors
import MatrixMultiply
import MakeNormalVectors
import RotateAroundDirection
import RotatePointAroundVector
import ProjectPointOnPlane
import PlaneFromPoints
import AngleDelta
import AngleNormalize180
import AngleNormalize360
import AnglesSubtract
import AngleSubtract
import LerpAngle
import AngleMod
import BoxOnPlaneSide
import SetPlaneSignbits
import AxisCopy
import AxisClear
import AnglesToAxis
import vectoangles
import Q_crandom
import Q_random
import Q_rand
import Q_acos
import Q_log2
import VectorRotate
import Vector4Scale
import VectorNormalize2
import VectorNormalize
import CrossProduct
import VectorInverse
import VectorNormalizeFast
import DistanceSquared
import Distance
import VectorLengthSquared
import VectorLength
import VectorCompare
import AddPointToBounds
import ClearBounds
import RadiusFromBounds
import NormalizeColor
import ColorBytes4
import ColorBytes3
import _VectorMA
import _VectorScale
import _VectorCopy
import _VectorAdd
import _VectorSubtract
import _DotProduct
import ByteToDir
import DirToByte
import ClampShort
import ClampChar
import Q_rsqrt
import Q_fabs
import axisDefault
import vec3_origin
import g_color_table
import colorDkGrey
import colorMdGrey
import colorLtGrey
import colorWhite
import colorCyan
import colorMagenta
import colorYellow
import colorBlue
import colorGreen
import colorRed
import colorBlack
import bytedirs
import Hunk_Alloc
import acos
import atan2
import cos
import sin
import sqrt
import floor
import ceil
import memcpy
import memset
import Q_sscanf
import ED_vsprintf
import strncpy
