data
export vec3_origin
align 4
LABELV vec3_origin
byte 4 0
byte 4 0
byte 4 0
export axisDefault
align 4
LABELV axisDefault
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 0
byte 4 1065353216
export colorBlack
align 4
LABELV colorBlack
byte 4 0
byte 4 0
byte 4 0
byte 4 1065353216
export colorRed
align 4
LABELV colorRed
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 1065353216
export colorGreen
align 4
LABELV colorGreen
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 1065353216
export colorBlue
align 4
LABELV colorBlue
byte 4 0
byte 4 0
byte 4 1065353216
byte 4 1065353216
export colorYellow
align 4
LABELV colorYellow
byte 4 1065353216
byte 4 1065353216
byte 4 0
byte 4 1065353216
export colorMagenta
align 4
LABELV colorMagenta
byte 4 1065353216
byte 4 0
byte 4 1065353216
byte 4 1065353216
export colorCyan
align 4
LABELV colorCyan
byte 4 0
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
export colorWhite
align 4
LABELV colorWhite
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
export colorLtGrey
align 4
LABELV colorLtGrey
byte 4 1061158912
byte 4 1061158912
byte 4 1061158912
byte 4 1065353216
export colorMdGrey
align 4
LABELV colorMdGrey
byte 4 1056964608
byte 4 1056964608
byte 4 1056964608
byte 4 1065353216
export colorDkGrey
align 4
LABELV colorDkGrey
byte 4 1048576000
byte 4 1048576000
byte 4 1048576000
byte 4 1065353216
export colorLtBlue
align 4
LABELV colorLtBlue
byte 4 1052501869
byte 4 1048945099
byte 4 1060689150
byte 4 1065353216
export colorDkBlue
align 4
LABELV colorDkBlue
byte 4 1045153448
byte 4 0
byte 4 1053542056
byte 4 1065353216
export g_color_table
align 4
LABELV g_color_table
byte 4 0
byte 4 0
byte 4 0
byte 4 1065353216
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 1065353216
byte 4 1065353216
byte 4 0
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 0
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
byte 4 1065353216
export bytedirs
align 4
LABELV bytedirs
byte 4 3204879951
byte 4 0
byte 4 1062847556
byte 4 3202531056
byte 4 1047828139
byte 4 1063074669
byte 4 3197577718
byte 4 0
byte 4 1064605338
byte 4 3198039930
byte 4 1056964608
byte 4 1062149053
byte 4 3190184938
byte 4 1049007711
byte 4 1064532072
byte 4 0
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 1062847556
byte 4 1057396303
byte 4 3189189110
byte 4 1060597999
byte 4 1060013330
byte 4 1041705462
byte 4 1060597999
byte 4 1060013330
byte 4 0
byte 4 1057396303
byte 4 1062847556
byte 4 1050556282
byte 4 1056964608
byte 4 1062149053
byte 4 1057396303
byte 4 0
byte 4 1062847556
byte 4 1050094070
byte 4 0
byte 4 1064605338
byte 4 1055047408
byte 4 1047828139
byte 4 1063074669
byte 4 1042701290
byte 4 1049007711
byte 4 1064532072
byte 4 3207496978
byte 4 1041705462
byte 4 1060597999
byte 4 3209632701
byte 4 1050556282
byte 4 1056964608
byte 4 3205921044
byte 4 1054458931
byte 4 1060121929
byte 4 3210331204
byte 4 1057396303
byte 4 0
byte 4 3210558317
byte 4 1055047408
byte 4 1047828139
byte 4 3208081647
byte 4 1060013330
byte 4 1041705462
byte 4 3207605577
byte 4 1058437396
byte 4 1054458931
byte 4 3204448256
byte 4 1062149053
byte 4 1050556282
byte 4 3195311787
byte 4 1063074669
byte 4 1055047408
byte 4 3201942579
byte 4 1060121929
byte 4 1058437396
byte 4 3208081647
byte 4 1060013330
byte 4 3189189110
byte 4 3204448256
byte 4 1062149053
byte 4 3198039930
byte 4 3204879951
byte 4 1062847556
byte 4 0
byte 4 0
byte 4 1062847556
byte 4 3204879951
byte 4 3195311787
byte 4 1063074669
byte 4 3202531056
byte 4 0
byte 4 1064605338
byte 4 3197577718
byte 4 3196491359
byte 4 1064532072
byte 4 3190184938
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 1064605338
byte 4 1050094070
byte 4 3196491359
byte 4 1064532072
byte 4 1042701290
byte 4 1047828139
byte 4 1063074669
byte 4 1055047408
byte 4 1049007711
byte 4 1064532072
byte 4 1042701290
byte 4 1056964608
byte 4 1062149053
byte 4 1050556282
byte 4 1047828139
byte 4 1063074669
byte 4 3202531056
byte 4 1049007711
byte 4 1064532072
byte 4 3190184938
byte 4 1056964608
byte 4 1062149053
byte 4 3198039930
byte 4 1062847556
byte 4 1057396303
byte 4 0
byte 4 1060597999
byte 4 1060013330
byte 4 1041705462
byte 4 1060597999
byte 4 1060013330
byte 4 3189189110
byte 4 1057396303
byte 4 1062847556
byte 4 0
byte 4 1054458931
byte 4 1060121929
byte 4 1058437396
byte 4 1063074669
byte 4 1055047408
byte 4 1047828139
byte 4 1060121929
byte 4 1058437396
byte 4 1054458931
byte 4 1062149053
byte 4 1050556282
byte 4 1056964608
byte 4 1060013330
byte 4 1041705462
byte 4 1060597999
byte 4 1058437396
byte 4 1054458931
byte 4 1060121929
byte 4 1064605338
byte 4 1050094070
byte 4 0
byte 4 1065353216
byte 4 0
byte 4 0
byte 4 1064532072
byte 4 1042701290
byte 4 1049007711
byte 4 1062847556
byte 4 3204879951
byte 4 0
byte 4 1064605338
byte 4 3197577718
byte 4 0
byte 4 1063074669
byte 4 3202531056
byte 4 1047828139
byte 4 1064532072
byte 4 3190184938
byte 4 1049007711
byte 4 1062149053
byte 4 3198039930
byte 4 1056964608
byte 4 1060013330
byte 4 3189189110
byte 4 1060597999
byte 4 1062847556
byte 4 0
byte 4 1057396303
byte 4 1063074669
byte 4 1055047408
byte 4 3195311787
byte 4 1062149053
byte 4 1050556282
byte 4 3204448256
byte 4 1064532072
byte 4 1042701290
byte 4 3196491359
byte 4 1057396303
byte 4 0
byte 4 3210331204
byte 4 1060013330
byte 4 1041705462
byte 4 3208081647
byte 4 1060013330
byte 4 3189189110
byte 4 3208081647
byte 4 1062847556
byte 4 0
byte 4 3204879951
byte 4 1062149053
byte 4 3198039930
byte 4 3204448256
byte 4 1063074669
byte 4 3202531056
byte 4 3195311787
byte 4 1064532072
byte 4 3190184938
byte 4 3196491359
byte 4 1041705462
byte 4 1060597999
byte 4 3207496978
byte 4 1050556282
byte 4 1056964608
byte 4 3209632701
byte 4 1054458931
byte 4 1060121929
byte 4 3205921044
byte 4 1055047408
byte 4 1047828139
byte 4 3210558317
byte 4 1058437396
byte 4 1054458931
byte 4 3207605577
byte 4 1060121929
byte 4 1058437396
byte 4 3201942579
byte 4 3189189110
byte 4 1060597999
byte 4 3207496978
byte 4 3198039930
byte 4 1056964608
byte 4 3209632701
byte 4 0
byte 4 1057396303
byte 4 3210331204
byte 4 3204879951
byte 4 0
byte 4 3210331204
byte 4 3202531056
byte 4 1047828139
byte 4 3210558317
byte 4 3197577718
byte 4 0
byte 4 3212088986
byte 4 3190184938
byte 4 1049007711
byte 4 3212015720
byte 4 0
byte 4 0
byte 4 3212836864
byte 4 1050094070
byte 4 0
byte 4 3212088986
byte 4 1042701290
byte 4 1049007711
byte 4 3212015720
byte 4 3202531056
byte 4 3195311787
byte 4 3210558317
byte 4 3198039930
byte 4 3204448256
byte 4 3209632701
byte 4 3190184938
byte 4 3196491359
byte 4 3212015720
byte 4 0
byte 4 3210331204
byte 4 3204879951
byte 4 3189189110
byte 4 3208081647
byte 4 3207496978
byte 4 1041705462
byte 4 3208081647
byte 4 3207496978
byte 4 0
byte 4 3204879951
byte 4 3210331204
byte 4 1050556282
byte 4 3204448256
byte 4 3209632701
byte 4 1055047408
byte 4 3195311787
byte 4 3210558317
byte 4 1042701290
byte 4 3196491359
byte 4 3212015720
byte 4 1047828139
byte 4 3210558317
byte 4 3202531056
byte 4 1056964608
byte 4 3209632701
byte 4 3198039930
byte 4 1054458931
byte 4 3207605577
byte 4 3205921044
byte 4 1060597999
byte 4 3207496978
byte 4 3189189110
byte 4 1060121929
byte 4 3205921044
byte 4 3201942579
byte 4 1058437396
byte 4 3201942579
byte 4 3207605577
byte 4 0
byte 4 3212088986
byte 4 3197577718
byte 4 0
byte 4 3212836864
byte 4 0
byte 4 1049007711
byte 4 3212015720
byte 4 3190184938
byte 4 0
byte 4 3210331204
byte 4 1057396303
byte 4 0
byte 4 3212088986
byte 4 1050094070
byte 4 1047828139
byte 4 3210558317
byte 4 1055047408
byte 4 1049007711
byte 4 3212015720
byte 4 1042701290
byte 4 1056964608
byte 4 3209632701
byte 4 1050556282
byte 4 1060597999
byte 4 3207496978
byte 4 1041705462
byte 4 1057396303
byte 4 3210331204
byte 4 0
byte 4 3195311787
byte 4 3210558317
byte 4 3202531056
byte 4 3204448256
byte 4 3209632701
byte 4 3198039930
byte 4 3196491359
byte 4 3212015720
byte 4 3190184938
byte 4 3210331204
byte 4 3204879951
byte 4 0
byte 4 3208081647
byte 4 3207496978
byte 4 3189189110
byte 4 3208081647
byte 4 3207496978
byte 4 1041705462
byte 4 3204879951
byte 4 3210331204
byte 4 0
byte 4 3204448256
byte 4 3209632701
byte 4 1050556282
byte 4 3195311787
byte 4 3210558317
byte 4 1055047408
byte 4 3196491359
byte 4 3212015720
byte 4 1042701290
byte 4 3210558317
byte 4 3202531056
byte 4 1047828139
byte 4 3209632701
byte 4 3198039930
byte 4 1056964608
byte 4 3207605577
byte 4 3205921044
byte 4 1054458931
byte 4 3207496978
byte 4 3189189110
byte 4 1060597999
byte 4 3202531056
byte 4 3195311787
byte 4 1063074669
byte 4 3205921044
byte 4 3201942579
byte 4 1060121929
byte 4 3198039930
byte 4 3204448256
byte 4 1062149053
byte 4 3189189110
byte 4 3208081647
byte 4 1060013330
byte 4 3201942579
byte 4 3207605577
byte 4 1058437396
byte 4 3190184938
byte 4 3196491359
byte 4 1064532072
byte 4 1055047408
byte 4 3195311787
byte 4 1063074669
byte 4 1042701290
byte 4 3196491359
byte 4 1064532072
byte 4 1050556282
byte 4 3204448256
byte 4 1062149053
byte 4 1041705462
byte 4 3208081647
byte 4 1060013330
byte 4 0
byte 4 3204879951
byte 4 1062847556
byte 4 1054458931
byte 4 3207605577
byte 4 1058437396
byte 4 1058437396
byte 4 3201942579
byte 4 1060121929
byte 4 1060121929
byte 4 3205921044
byte 4 1054458931
byte 4 3212088986
byte 4 1050094070
byte 4 0
byte 4 3212015720
byte 4 1042701290
byte 4 1049007711
byte 4 3212836864
byte 4 0
byte 4 0
byte 4 3210331204
byte 4 0
byte 4 1057396303
byte 4 3212088986
byte 4 3197577718
byte 4 0
byte 4 3212015720
byte 4 3190184938
byte 4 1049007711
byte 4 3210558317
byte 4 1055047408
byte 4 3195311787
byte 4 3212015720
byte 4 1042701290
byte 4 3196491359
byte 4 3209632701
byte 4 1050556282
byte 4 3204448256
byte 4 3210558317
byte 4 3202531056
byte 4 3195311787
byte 4 3212015720
byte 4 3190184938
byte 4 3196491359
byte 4 3209632701
byte 4 3198039930
byte 4 3204448256
byte 4 3207496978
byte 4 1041705462
byte 4 3208081647
byte 4 3207496978
byte 4 3189189110
byte 4 3208081647
byte 4 3210331204
byte 4 0
byte 4 3204879951
byte 4 3207605577
byte 4 1058437396
byte 4 3201942579
byte 4 3205921044
byte 4 1054458931
byte 4 3207605577
byte 4 3201942579
byte 4 1060121929
byte 4 3205921044
byte 4 3201942579
byte 4 3207605577
byte 4 3205921044
byte 4 3205921044
byte 4 3201942579
byte 4 3207605577
byte 4 3207605577
byte 4 3205921044
byte 4 3201942579
export Q_rand
code
proc Q_rand 4 0
file "../q_math.c"
line 126
;1:// Copyright (C) 1999-2000 Id Software, Inc.
;2://
;3:// q_math.c -- stateless support routines that are included in each code module
;4:#include "q_shared.h"
;5:
;6:
;7:vec3_t	vec3_origin = {0,0,0};
;8:vec3_t	axisDefault[3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } };
;9:
;10:
;11:vec4_t		colorBlack	= {0, 0, 0, 1};
;12:vec4_t		colorRed	= {1, 0, 0, 1};
;13:vec4_t		colorGreen	= {0, 1, 0, 1};
;14:vec4_t		colorBlue	= {0, 0, 1, 1};
;15:vec4_t		colorYellow	= {1, 1, 0, 1};
;16:vec4_t		colorMagenta= {1, 0, 1, 1};
;17:vec4_t		colorCyan	= {0, 1, 1, 1};
;18:vec4_t		colorWhite	= {1, 1, 1, 1};
;19:vec4_t		colorLtGrey	= {0.75, 0.75, 0.75, 1};
;20:vec4_t		colorMdGrey	= {0.5, 0.5, 0.5, 1};
;21:vec4_t		colorDkGrey	= {0.25, 0.25, 0.25, 1};
;22:
;23:vec4_t		colorLtBlue	= {0.367f, 0.261f, 0.722f, 1};
;24:vec4_t		colorDkBlue	= {0.199f, 0.0f,   0.398f, 1};
;25:
;26:vec4_t	g_color_table[8] =
;27:	{
;28:	{0.0, 0.0, 0.0, 1.0},
;29:	{1.0, 0.0, 0.0, 1.0},
;30:	{0.0, 1.0, 0.0, 1.0},
;31:	{1.0, 1.0, 0.0, 1.0},
;32:	{0.0, 0.0, 1.0, 1.0},
;33:	{0.0, 1.0, 1.0, 1.0},
;34:	{1.0, 0.0, 1.0, 1.0},
;35:	{1.0, 1.0, 1.0, 1.0},
;36:	};
;37:
;38:
;39:vec3_t	bytedirs[NUMVERTEXNORMALS] =
;40:{
;41:{-0.525731f, 0.000000f, 0.850651f}, {-0.442863f, 0.238856f, 0.864188f}, 
;42:{-0.295242f, 0.000000f, 0.955423f}, {-0.309017f, 0.500000f, 0.809017f}, 
;43:{-0.162460f, 0.262866f, 0.951056f}, {0.000000f, 0.000000f, 1.000000f}, 
;44:{0.000000f, 0.850651f, 0.525731f}, {-0.147621f, 0.716567f, 0.681718f}, 
;45:{0.147621f, 0.716567f, 0.681718f}, {0.000000f, 0.525731f, 0.850651f}, 
;46:{0.309017f, 0.500000f, 0.809017f}, {0.525731f, 0.000000f, 0.850651f}, 
;47:{0.295242f, 0.000000f, 0.955423f}, {0.442863f, 0.238856f, 0.864188f}, 
;48:{0.162460f, 0.262866f, 0.951056f}, {-0.681718f, 0.147621f, 0.716567f}, 
;49:{-0.809017f, 0.309017f, 0.500000f},{-0.587785f, 0.425325f, 0.688191f}, 
;50:{-0.850651f, 0.525731f, 0.000000f},{-0.864188f, 0.442863f, 0.238856f}, 
;51:{-0.716567f, 0.681718f, 0.147621f},{-0.688191f, 0.587785f, 0.425325f}, 
;52:{-0.500000f, 0.809017f, 0.309017f}, {-0.238856f, 0.864188f, 0.442863f}, 
;53:{-0.425325f, 0.688191f, 0.587785f}, {-0.716567f, 0.681718f, -0.147621f}, 
;54:{-0.500000f, 0.809017f, -0.309017f}, {-0.525731f, 0.850651f, 0.000000f}, 
;55:{0.000000f, 0.850651f, -0.525731f}, {-0.238856f, 0.864188f, -0.442863f}, 
;56:{0.000000f, 0.955423f, -0.295242f}, {-0.262866f, 0.951056f, -0.162460f}, 
;57:{0.000000f, 1.000000f, 0.000000f}, {0.000000f, 0.955423f, 0.295242f}, 
;58:{-0.262866f, 0.951056f, 0.162460f}, {0.238856f, 0.864188f, 0.442863f}, 
;59:{0.262866f, 0.951056f, 0.162460f}, {0.500000f, 0.809017f, 0.309017f}, 
;60:{0.238856f, 0.864188f, -0.442863f},{0.262866f, 0.951056f, -0.162460f}, 
;61:{0.500000f, 0.809017f, -0.309017f},{0.850651f, 0.525731f, 0.000000f}, 
;62:{0.716567f, 0.681718f, 0.147621f}, {0.716567f, 0.681718f, -0.147621f}, 
;63:{0.525731f, 0.850651f, 0.000000f}, {0.425325f, 0.688191f, 0.587785f}, 
;64:{0.864188f, 0.442863f, 0.238856f}, {0.688191f, 0.587785f, 0.425325f}, 
;65:{0.809017f, 0.309017f, 0.500000f}, {0.681718f, 0.147621f, 0.716567f}, 
;66:{0.587785f, 0.425325f, 0.688191f}, {0.955423f, 0.295242f, 0.000000f}, 
;67:{1.000000f, 0.000000f, 0.000000f}, {0.951056f, 0.162460f, 0.262866f}, 
;68:{0.850651f, -0.525731f, 0.000000f},{0.955423f, -0.295242f, 0.000000f}, 
;69:{0.864188f, -0.442863f, 0.238856f}, {0.951056f, -0.162460f, 0.262866f}, 
;70:{0.809017f, -0.309017f, 0.500000f}, {0.681718f, -0.147621f, 0.716567f}, 
;71:{0.850651f, 0.000000f, 0.525731f}, {0.864188f, 0.442863f, -0.238856f}, 
;72:{0.809017f, 0.309017f, -0.500000f}, {0.951056f, 0.162460f, -0.262866f}, 
;73:{0.525731f, 0.000000f, -0.850651f}, {0.681718f, 0.147621f, -0.716567f}, 
;74:{0.681718f, -0.147621f, -0.716567f},{0.850651f, 0.000000f, -0.525731f}, 
;75:{0.809017f, -0.309017f, -0.500000f}, {0.864188f, -0.442863f, -0.238856f}, 
;76:{0.951056f, -0.162460f, -0.262866f}, {0.147621f, 0.716567f, -0.681718f}, 
;77:{0.309017f, 0.500000f, -0.809017f}, {0.425325f, 0.688191f, -0.587785f}, 
;78:{0.442863f, 0.238856f, -0.864188f}, {0.587785f, 0.425325f, -0.688191f}, 
;79:{0.688191f, 0.587785f, -0.425325f}, {-0.147621f, 0.716567f, -0.681718f}, 
;80:{-0.309017f, 0.500000f, -0.809017f}, {0.000000f, 0.525731f, -0.850651f}, 
;81:{-0.525731f, 0.000000f, -0.850651f}, {-0.442863f, 0.238856f, -0.864188f}, 
;82:{-0.295242f, 0.000000f, -0.955423f}, {-0.162460f, 0.262866f, -0.951056f}, 
;83:{0.000000f, 0.000000f, -1.000000f}, {0.295242f, 0.000000f, -0.955423f}, 
;84:{0.162460f, 0.262866f, -0.951056f}, {-0.442863f, -0.238856f, -0.864188f}, 
;85:{-0.309017f, -0.500000f, -0.809017f}, {-0.162460f, -0.262866f, -0.951056f}, 
;86:{0.000000f, -0.850651f, -0.525731f}, {-0.147621f, -0.716567f, -0.681718f}, 
;87:{0.147621f, -0.716567f, -0.681718f}, {0.000000f, -0.525731f, -0.850651f}, 
;88:{0.309017f, -0.500000f, -0.809017f}, {0.442863f, -0.238856f, -0.864188f}, 
;89:{0.162460f, -0.262866f, -0.951056f}, {0.238856f, -0.864188f, -0.442863f}, 
;90:{0.500000f, -0.809017f, -0.309017f}, {0.425325f, -0.688191f, -0.587785f}, 
;91:{0.716567f, -0.681718f, -0.147621f}, {0.688191f, -0.587785f, -0.425325f}, 
;92:{0.587785f, -0.425325f, -0.688191f}, {0.000000f, -0.955423f, -0.295242f}, 
;93:{0.000000f, -1.000000f, 0.000000f}, {0.262866f, -0.951056f, -0.162460f}, 
;94:{0.000000f, -0.850651f, 0.525731f}, {0.000000f, -0.955423f, 0.295242f}, 
;95:{0.238856f, -0.864188f, 0.442863f}, {0.262866f, -0.951056f, 0.162460f}, 
;96:{0.500000f, -0.809017f, 0.309017f}, {0.716567f, -0.681718f, 0.147621f}, 
;97:{0.525731f, -0.850651f, 0.000000f}, {-0.238856f, -0.864188f, -0.442863f}, 
;98:{-0.500000f, -0.809017f, -0.309017f}, {-0.262866f, -0.951056f, -0.162460f}, 
;99:{-0.850651f, -0.525731f, 0.000000f}, {-0.716567f, -0.681718f, -0.147621f}, 
;100:{-0.716567f, -0.681718f, 0.147621f}, {-0.525731f, -0.850651f, 0.000000f}, 
;101:{-0.500000f, -0.809017f, 0.309017f}, {-0.238856f, -0.864188f, 0.442863f}, 
;102:{-0.262866f, -0.951056f, 0.162460f}, {-0.864188f, -0.442863f, 0.238856f}, 
;103:{-0.809017f, -0.309017f, 0.500000f}, {-0.688191f, -0.587785f, 0.425325f}, 
;104:{-0.681718f, -0.147621f, 0.716567f}, {-0.442863f, -0.238856f, 0.864188f}, 
;105:{-0.587785f, -0.425325f, 0.688191f}, {-0.309017f, -0.500000f, 0.809017f}, 
;106:{-0.147621f, -0.716567f, 0.681718f}, {-0.425325f, -0.688191f, 0.587785f}, 
;107:{-0.162460f, -0.262866f, 0.951056f}, {0.442863f, -0.238856f, 0.864188f}, 
;108:{0.162460f, -0.262866f, 0.951056f}, {0.309017f, -0.500000f, 0.809017f}, 
;109:{0.147621f, -0.716567f, 0.681718f}, {0.000000f, -0.525731f, 0.850651f}, 
;110:{0.425325f, -0.688191f, 0.587785f}, {0.587785f, -0.425325f, 0.688191f}, 
;111:{0.688191f, -0.587785f, 0.425325f}, {-0.955423f, 0.295242f, 0.000000f}, 
;112:{-0.951056f, 0.162460f, 0.262866f}, {-1.000000f, 0.000000f, 0.000000f}, 
;113:{-0.850651f, 0.000000f, 0.525731f}, {-0.955423f, -0.295242f, 0.000000f}, 
;114:{-0.951056f, -0.162460f, 0.262866f}, {-0.864188f, 0.442863f, -0.238856f}, 
;115:{-0.951056f, 0.162460f, -0.262866f}, {-0.809017f, 0.309017f, -0.500000f}, 
;116:{-0.864188f, -0.442863f, -0.238856f}, {-0.951056f, -0.162460f, -0.262866f}, 
;117:{-0.809017f, -0.309017f, -0.500000f}, {-0.681718f, 0.147621f, -0.716567f}, 
;118:{-0.681718f, -0.147621f, -0.716567f}, {-0.850651f, 0.000000f, -0.525731f}, 
;119:{-0.688191f, 0.587785f, -0.425325f}, {-0.587785f, 0.425325f, -0.688191f}, 
;120:{-0.425325f, 0.688191f, -0.587785f}, {-0.425325f, -0.688191f, -0.587785f}, 
;121:{-0.587785f, -0.425325f, -0.688191f}, {-0.688191f, -0.587785f, -0.425325f}
;122:};
;123:
;124://==============================================================
;125:
;126:int		Q_rand( int *seed ) {
line 127
;127:	*seed = (69069 * *seed + 1);
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 69069
ADDRLP4 0
INDIRP4
INDIRI4
MULI4
CNSTI4 1
ADDI4
ASGNI4
line 128
;128:	return *seed;
ADDRFP4 0
INDIRP4
INDIRI4
RETI4
LABELV $38
endproc Q_rand 4 0
export Q_random
proc Q_random 4 4
line 131
;129:}
;130:
;131:float	Q_random( int *seed ) {
line 132
;132:	return ( Q_rand( seed ) & 0xffff ) / (float)0x10000;
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 0
ADDRGP4 Q_rand
CALLI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 65535
BANDI4
CVIF4 4
CNSTF4 1199570944
DIVF4
RETF4
LABELV $39
endproc Q_random 4 4
export Q_crandom
proc Q_crandom 4 4
line 135
;133:}
;134:
;135:float	Q_crandom( int *seed ) {
line 136
;136:	return 2.0 * ( Q_random( seed ) - 0.5 );
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 0
ADDRGP4 Q_random
CALLF4
ASGNF4
CNSTF4 1073741824
ADDRLP4 0
INDIRF4
CNSTF4 1056964608
SUBF4
MULF4
RETF4
LABELV $40
endproc Q_crandom 4 4
export VectorCompare
proc VectorCompare 16 0
line 141
;137:}
;138:
;139:#ifdef __LCC__
;140:
;141:int VectorCompare( const vec3_t v1, const vec3_t v2 ) {
line 142
;142:	if (v1[0] != v2[0] || v1[1] != v2[1] || v1[2] != v2[2]) {
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRP4
INDIRF4
NEF4 $45
ADDRLP4 8
CNSTI4 4
ASGNI4
ADDRLP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
NEF4 $45
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRLP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
EQF4 $42
LABELV $45
line 143
;143:		return 0;
CNSTI4 0
RETI4
ADDRGP4 $41
JUMPV
LABELV $42
line 145
;144:	}			
;145:	return 1;
CNSTI4 1
RETI4
LABELV $41
endproc VectorCompare 16 0
export VectorLength
proc VectorLength 20 4
line 148
;146:}
;147:
;148:vec_t VectorLength( const vec3_t v ) {
line 149
;149:	return (vec_t)sqrt (v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRLP4 0
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDF4
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
ADDF4
ARGF4
ADDRLP4 16
ADDRGP4 sqrt
CALLF4
ASGNF4
ADDRLP4 16
INDIRF4
RETF4
LABELV $46
endproc VectorLength 20 4
export VectorLengthSquared
proc VectorLengthSquared 16 0
line 152
;150:}
;151:
;152:vec_t VectorLengthSquared( const vec3_t v ) {
line 153
;153:	return (v[0]*v[0] + v[1]*v[1] + v[2]*v[2]);
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRLP4 0
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDF4
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
ADDF4
RETF4
LABELV $47
endproc VectorLengthSquared 16 0
export Distance
proc Distance 32 4
line 156
;154:}
;155:
;156:vec_t Distance( const vec3_t p1, const vec3_t p2 ) {
line 159
;157:	vec3_t	v;
;158:
;159:	VectorSubtract (p2, p1, v);
ADDRLP4 12
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 16
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 12
INDIRP4
INDIRF4
ADDRLP4 16
INDIRP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 20
CNSTI4 4
ASGNI4
ADDRLP4 0+4
ADDRLP4 12
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
ADDRLP4 16
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 24
CNSTI4 8
ASGNI4
ADDRLP4 0+8
ADDRFP4 4
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
line 160
;160:	return VectorLength( v );
ADDRLP4 0
ARGP4
ADDRLP4 28
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 28
INDIRF4
RETF4
LABELV $48
endproc Distance 32 4
export DistanceSquared
proc DistanceSquared 32 0
line 163
;161:}
;162:
;163:vec_t DistanceSquared( const vec3_t p1, const vec3_t p2 ) {
line 166
;164:	vec3_t	v;
;165:
;166:	VectorSubtract (p2, p1, v);
ADDRLP4 12
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 16
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 12
INDIRP4
INDIRF4
ADDRLP4 16
INDIRP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 20
CNSTI4 4
ASGNI4
ADDRLP4 0+4
ADDRLP4 12
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
ADDRLP4 16
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 24
CNSTI4 8
ASGNI4
ADDRLP4 0+8
ADDRFP4 4
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
line 167
;167:	return v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
ADDRLP4 28
ADDRLP4 0
INDIRF4
ASGNF4
ADDRLP4 28
INDIRF4
ADDRLP4 28
INDIRF4
MULF4
ADDRLP4 0+4
INDIRF4
ADDRLP4 0+4
INDIRF4
MULF4
ADDF4
ADDRLP4 0+8
INDIRF4
ADDRLP4 0+8
INDIRF4
MULF4
ADDF4
RETF4
LABELV $51
endproc DistanceSquared 32 0
export VectorNormalizeFast
proc VectorNormalizeFast 36 4
line 173
;168:}
;169:
;170:// fast vector normalize routine that does not check to make sure
;171:// that length != 0, nor does it return length, uses rsqrt approximation
;172:void VectorNormalizeFast( vec3_t v )
;173:{
line 176
;174:	float ilength;
;175:
;176:	ilength = Q_rsqrt( DotProduct( v, v ) );
ADDRLP4 4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 8
ADDRLP4 4
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 12
ADDRLP4 4
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 16
ADDRLP4 4
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 8
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
ADDF4
ADDRLP4 16
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDF4
ARGF4
ADDRLP4 20
ADDRGP4 Q_rsqrt
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 20
INDIRF4
ASGNF4
line 178
;177:
;178:	v[0] *= ilength;
ADDRLP4 24
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 24
INDIRP4
ADDRLP4 24
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 179
;179:	v[1] *= ilength;
ADDRLP4 28
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 180
;180:	v[2] *= ilength;
ADDRLP4 32
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
ASGNP4
ADDRLP4 32
INDIRP4
ADDRLP4 32
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 181
;181:}
LABELV $58
endproc VectorNormalizeFast 36 4
export VectorInverse
proc VectorInverse 12 0
line 183
;182:
;183:void VectorInverse( vec3_t v ){
line 184
;184:	v[0] = -v[0];
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
ADDRLP4 0
INDIRP4
INDIRF4
NEGF4
ASGNF4
line 185
;185:	v[1] = -v[1];
ADDRLP4 4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 4
INDIRP4
ADDRLP4 4
INDIRP4
INDIRF4
NEGF4
ASGNF4
line 186
;186:	v[2] = -v[2];
ADDRLP4 8
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
ASGNP4
ADDRLP4 8
INDIRP4
ADDRLP4 8
INDIRP4
INDIRF4
NEGF4
ASGNF4
line 187
;187:}
LABELV $59
endproc VectorInverse 12 0
export CrossProduct
proc CrossProduct 40 0
line 189
;188:
;189:void CrossProduct( const vec3_t v1, const vec3_t v2, vec3_t cross ) {
line 190
;190:	cross[0] = v1[1]*v2[2] - v1[2]*v2[1];
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
CNSTI4 4
ASGNI4
ADDRLP4 8
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
MULF4
SUBF4
ASGNF4
line 191
;191:	cross[1] = v1[2]*v2[0] - v1[0]*v2[2];
ADDRLP4 16
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 20
CNSTI4 8
ASGNI4
ADDRLP4 24
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 16
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
ADDRLP4 24
INDIRP4
INDIRF4
MULF4
ADDRLP4 16
INDIRP4
INDIRF4
ADDRLP4 24
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
MULF4
SUBF4
ASGNF4
line 192
;192:	cross[2] = v1[0]*v2[1] - v1[1]*v2[0];
ADDRLP4 28
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 32
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 36
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 28
INDIRP4
INDIRF4
ADDRLP4 32
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 28
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
ADDRLP4 32
INDIRP4
INDIRF4
MULF4
SUBF4
ASGNF4
line 193
;193:}
LABELV $60
endproc CrossProduct 40 0
export ClampChar
proc ClampChar 0 0
line 198
;194:#endif
;195:
;196://=======================================================
;197:
;198:signed char ClampChar( int i ) {
line 199
;199:	if ( i < -128 ) {
ADDRFP4 0
INDIRI4
CNSTI4 -128
GEI4 $62
line 200
;200:		return -128;
CNSTI4 -128
RETI4
ADDRGP4 $61
JUMPV
LABELV $62
line 202
;201:	}
;202:	if ( i > 127 ) {
ADDRFP4 0
INDIRI4
CNSTI4 127
LEI4 $64
line 203
;203:		return 127;
CNSTI4 127
RETI4
ADDRGP4 $61
JUMPV
LABELV $64
line 205
;204:	}
;205:	return i;
ADDRFP4 0
INDIRI4
CVII1 4
CVII4 1
RETI4
LABELV $61
endproc ClampChar 0 0
export ClampShort
proc ClampShort 0 0
line 208
;206:}
;207:
;208:signed short ClampShort( int i ) {
line 209
;209:	if ( i < -32768 ) {
ADDRFP4 0
INDIRI4
CNSTI4 -32768
GEI4 $67
line 210
;210:		return -32768;
CNSTI4 -32768
RETI4
ADDRGP4 $66
JUMPV
LABELV $67
line 212
;211:	}
;212:	if ( i > 0x7fff ) {
ADDRFP4 0
INDIRI4
CNSTI4 32767
LEI4 $69
line 213
;213:		return 0x7fff;
CNSTI4 32767
RETI4
ADDRGP4 $66
JUMPV
LABELV $69
line 215
;214:	}
;215:	return i;
ADDRFP4 0
INDIRI4
CVII2 4
CVII4 2
RETI4
LABELV $66
endproc ClampShort 0 0
export DirToByte
proc DirToByte 24 0
line 220
;216:}
;217:
;218:
;219:// this isn't a real cheap function to call!
;220:int DirToByte( vec3_t dir ) {
line 224
;221:	int		i, best;
;222:	float	d, bestd;
;223:
;224:	if ( !dir ) {
ADDRFP4 0
INDIRP4
CVPU4 4
CNSTU4 0
NEU4 $72
line 225
;225:		return 0;
CNSTI4 0
RETI4
ADDRGP4 $71
JUMPV
LABELV $72
line 228
;226:	}
;227:
;228:	bestd = 0;
ADDRLP4 8
CNSTF4 0
ASGNF4
line 229
;229:	best = 0;
ADDRLP4 12
CNSTI4 0
ASGNI4
line 230
;230:	for (i=0 ; i<NUMVERTEXNORMALS ; i++)
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $74
line 231
;231:	{
line 232
;232:		d = DotProduct (dir, bytedirs[i]);
ADDRLP4 16
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 20
CNSTI4 12
ADDRLP4 0
INDIRI4
MULI4
ASGNI4
ADDRLP4 4
ADDRLP4 16
INDIRP4
INDIRF4
ADDRLP4 20
INDIRI4
ADDRGP4 bytedirs
ADDP4
INDIRF4
MULF4
ADDRLP4 16
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 20
INDIRI4
ADDRGP4 bytedirs+4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 16
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 20
INDIRI4
ADDRGP4 bytedirs+8
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 233
;233:		if (d > bestd)
ADDRLP4 4
INDIRF4
ADDRLP4 8
INDIRF4
LEF4 $80
line 234
;234:		{
line 235
;235:			bestd = d;
ADDRLP4 8
ADDRLP4 4
INDIRF4
ASGNF4
line 236
;236:			best = i;
ADDRLP4 12
ADDRLP4 0
INDIRI4
ASGNI4
line 237
;237:		}
LABELV $80
line 238
;238:	}
LABELV $75
line 230
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 162
LTI4 $74
line 240
;239:
;240:	return best;
ADDRLP4 12
INDIRI4
RETI4
LABELV $71
endproc DirToByte 24 0
export ByteToDir
proc ByteToDir 4 0
line 243
;241:}
;242:
;243:void ByteToDir( int b, vec3_t dir ) {
line 244
;244:	if ( b < 0 || b >= NUMVERTEXNORMALS ) {
ADDRLP4 0
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 0
LTI4 $85
ADDRLP4 0
INDIRI4
CNSTI4 162
LTI4 $83
LABELV $85
line 245
;245:		VectorCopy( vec3_origin, dir );
ADDRFP4 4
INDIRP4
ADDRGP4 vec3_origin
INDIRB
ASGNB 12
line 246
;246:		return;
ADDRGP4 $82
JUMPV
LABELV $83
line 248
;247:	}
;248:	VectorCopy (bytedirs[b], dir);
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDRFP4 0
INDIRI4
MULI4
ADDRGP4 bytedirs
ADDP4
INDIRB
ASGNB 12
line 249
;249:}
LABELV $82
endproc ByteToDir 4 0
export ColorBytes3
proc ColorBytes3 40 0
line 252
;250:
;251:
;252:unsigned ColorBytes3 (float r, float g, float b) {
line 255
;253:	unsigned	i;
;254:
;255:	( (byte *)&i )[0] = r * 255;
ADDRLP4 8
CNSTF4 1132396544
ADDRFP4 0
INDIRF4
MULF4
ASGNF4
ADDRLP4 12
CNSTF4 1325400064
ASGNF4
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
LTF4 $88
ADDRLP4 4
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $89
JUMPV
LABELV $88
ADDRLP4 4
ADDRLP4 8
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $89
ADDRLP4 0
ADDRLP4 4
INDIRU4
CVUU1 4
ASGNU1
line 256
;256:	( (byte *)&i )[1] = g * 255;
ADDRLP4 20
CNSTF4 1132396544
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
ADDRLP4 24
CNSTF4 1325400064
ASGNF4
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
LTF4 $92
ADDRLP4 16
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $93
JUMPV
LABELV $92
ADDRLP4 16
ADDRLP4 20
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $93
ADDRLP4 0+1
ADDRLP4 16
INDIRU4
CVUU1 4
ASGNU1
line 257
;257:	( (byte *)&i )[2] = b * 255;
ADDRLP4 32
CNSTF4 1132396544
ADDRFP4 8
INDIRF4
MULF4
ASGNF4
ADDRLP4 36
CNSTF4 1325400064
ASGNF4
ADDRLP4 32
INDIRF4
ADDRLP4 36
INDIRF4
LTF4 $96
ADDRLP4 28
ADDRLP4 32
INDIRF4
ADDRLP4 36
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $97
JUMPV
LABELV $96
ADDRLP4 28
ADDRLP4 32
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $97
ADDRLP4 0+2
ADDRLP4 28
INDIRU4
CVUU1 4
ASGNU1
line 259
;258:
;259:	return i;
ADDRLP4 0
INDIRU4
RETU4
LABELV $86
endproc ColorBytes3 40 0
export ColorBytes4
proc ColorBytes4 52 0
line 262
;260:}
;261:
;262:unsigned ColorBytes4 (float r, float g, float b, float a) {
line 265
;263:	unsigned	i;
;264:
;265:	( (byte *)&i )[0] = r * 255;
ADDRLP4 8
CNSTF4 1132396544
ADDRFP4 0
INDIRF4
MULF4
ASGNF4
ADDRLP4 12
CNSTF4 1325400064
ASGNF4
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
LTF4 $100
ADDRLP4 4
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $101
JUMPV
LABELV $100
ADDRLP4 4
ADDRLP4 8
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $101
ADDRLP4 0
ADDRLP4 4
INDIRU4
CVUU1 4
ASGNU1
line 266
;266:	( (byte *)&i )[1] = g * 255;
ADDRLP4 20
CNSTF4 1132396544
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
ADDRLP4 24
CNSTF4 1325400064
ASGNF4
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
LTF4 $104
ADDRLP4 16
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $105
JUMPV
LABELV $104
ADDRLP4 16
ADDRLP4 20
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $105
ADDRLP4 0+1
ADDRLP4 16
INDIRU4
CVUU1 4
ASGNU1
line 267
;267:	( (byte *)&i )[2] = b * 255;
ADDRLP4 32
CNSTF4 1132396544
ADDRFP4 8
INDIRF4
MULF4
ASGNF4
ADDRLP4 36
CNSTF4 1325400064
ASGNF4
ADDRLP4 32
INDIRF4
ADDRLP4 36
INDIRF4
LTF4 $108
ADDRLP4 28
ADDRLP4 32
INDIRF4
ADDRLP4 36
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $109
JUMPV
LABELV $108
ADDRLP4 28
ADDRLP4 32
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $109
ADDRLP4 0+2
ADDRLP4 28
INDIRU4
CVUU1 4
ASGNU1
line 268
;268:	( (byte *)&i )[3] = a * 255;
ADDRLP4 44
CNSTF4 1132396544
ADDRFP4 12
INDIRF4
MULF4
ASGNF4
ADDRLP4 48
CNSTF4 1325400064
ASGNF4
ADDRLP4 44
INDIRF4
ADDRLP4 48
INDIRF4
LTF4 $112
ADDRLP4 40
ADDRLP4 44
INDIRF4
ADDRLP4 48
INDIRF4
SUBF4
CVFI4 4
CVIU4 4
CNSTU4 2147483648
ADDU4
ASGNU4
ADDRGP4 $113
JUMPV
LABELV $112
ADDRLP4 40
ADDRLP4 44
INDIRF4
CVFI4 4
CVIU4 4
ASGNU4
LABELV $113
ADDRLP4 0+3
ADDRLP4 40
INDIRU4
CVUU1 4
ASGNU1
line 270
;269:
;270:	return i;
ADDRLP4 0
INDIRU4
RETU4
LABELV $98
endproc ColorBytes4 52 0
export NormalizeColor
proc NormalizeColor 12 0
line 273
;271:}
;272:
;273:float NormalizeColor( const vec3_t in, vec3_t out ) {
line 276
;274:	float	max;
;275:	
;276:	max = in[0];
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
line 277
;277:	if ( in[1] > max ) {
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
LEF4 $115
line 278
;278:		max = in[1];
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
line 279
;279:	}
LABELV $115
line 280
;280:	if ( in[2] > max ) {
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
LEF4 $117
line 281
;281:		max = in[2];
ADDRLP4 0
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
line 282
;282:	}
LABELV $117
line 284
;283:
;284:	if ( !max ) {
ADDRLP4 0
INDIRF4
CNSTF4 0
NEF4 $119
line 285
;285:		VectorClear( out );
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 8
CNSTF4 0
ASGNF4
ADDRLP4 4
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 8
INDIRF4
ASGNF4
ADDRLP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 8
INDIRF4
ASGNF4
ADDRLP4 4
INDIRP4
ADDRLP4 8
INDIRF4
ASGNF4
line 286
;286:	} else {
ADDRGP4 $120
JUMPV
LABELV $119
line 287
;287:		out[0] = in[0] / max;
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 288
;288:		out[1] = in[1] / max;
ADDRLP4 4
CNSTI4 4
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 289
;289:		out[2] = in[2] / max;
ADDRLP4 8
CNSTI4 8
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 290
;290:	}
LABELV $120
line 291
;291:	return max;
ADDRLP4 0
INDIRF4
RETF4
LABELV $114
endproc NormalizeColor 12 0
export PlaneFromPoints
proc PlaneFromPoints 76 12
line 303
;292:}
;293:
;294:
;295:/*
;296:=====================
;297:PlaneFromPoints
;298:
;299:Returns false if the triangle is degenrate.
;300:The normal will point out of the clock for clockwise ordered points
;301:=====================
;302:*/
;303:qboolean PlaneFromPoints( vec4_t plane, const vec3_t a, const vec3_t b, const vec3_t c ) {
line 306
;304:	vec3_t	d1, d2;
;305:
;306:	VectorSubtract( b, a, d1 );
ADDRLP4 24
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 28
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 24
INDIRP4
INDIRF4
ADDRLP4 28
INDIRP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 32
CNSTI4 4
ASGNI4
ADDRLP4 0+4
ADDRLP4 24
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
ADDRLP4 28
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 36
CNSTI4 8
ASGNI4
ADDRLP4 0+8
ADDRFP4 8
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
line 307
;307:	VectorSubtract( c, a, d2 );
ADDRLP4 40
ADDRFP4 12
INDIRP4
ASGNP4
ADDRLP4 44
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 12
ADDRLP4 40
INDIRP4
INDIRF4
ADDRLP4 44
INDIRP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 48
CNSTI4 4
ASGNI4
ADDRLP4 12+4
ADDRLP4 40
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
ADDRLP4 44
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 52
CNSTI4 8
ASGNI4
ADDRLP4 12+8
ADDRFP4 12
INDIRP4
ADDRLP4 52
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 52
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
line 308
;308:	CrossProduct( d2, d1, plane );
ADDRLP4 12
ARGP4
ADDRLP4 0
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 CrossProduct
CALLV
pop
line 309
;309:	if ( VectorNormalize( plane ) == 0 ) {
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 56
ADDRGP4 VectorNormalize
CALLF4
ASGNF4
ADDRLP4 56
INDIRF4
CNSTF4 0
NEF4 $126
line 310
;310:		return qfalse;
CNSTI4 0
RETI4
ADDRGP4 $121
JUMPV
LABELV $126
line 313
;311:	}
;312:
;313:	plane[3] = DotProduct( a, plane );
ADDRLP4 60
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 64
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 68
CNSTI4 4
ASGNI4
ADDRLP4 72
CNSTI4 8
ASGNI4
ADDRLP4 60
INDIRP4
CNSTI4 12
ADDP4
ADDRLP4 64
INDIRP4
INDIRF4
ADDRLP4 60
INDIRP4
INDIRF4
MULF4
ADDRLP4 64
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRF4
ADDRLP4 60
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 64
INDIRP4
ADDRLP4 72
INDIRI4
ADDP4
INDIRF4
ADDRLP4 60
INDIRP4
ADDRLP4 72
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 314
;314:	return qtrue;
CNSTI4 1
RETI4
LABELV $121
endproc PlaneFromPoints 76 12
export RotatePointAroundVector
proc RotatePointAroundVector 256 12
line 325
;315:}
;316:
;317:/*
;318:===============
;319:RotatePointAroundVector
;320:
;321:This is not implemented very well...
;322:===============
;323:*/
;324:void RotatePointAroundVector( vec3_t dst, const vec3_t dir, const vec3_t point,
;325:							 float degrees ) {
line 335
;326:	float	m[3][3];
;327:	float	im[3][3];
;328:	float	zrot[3][3];
;329:	float	tmpmat[3][3];
;330:	float	rot[3][3];
;331:	int	i;
;332:	vec3_t vr, vup, vf;
;333:	float	rad;
;334:
;335:	vf[0] = dir[0];
ADDRLP4 148
ADDRFP4 4
INDIRP4
INDIRF4
ASGNF4
line 336
;336:	vf[1] = dir[1];
ADDRLP4 148+4
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
line 337
;337:	vf[2] = dir[2];
ADDRLP4 148+8
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
line 339
;338:
;339:	PerpendicularVector( vr, dir );
ADDRLP4 160
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 PerpendicularVector
CALLV
pop
line 340
;340:	CrossProduct( vr, vf, vup );
ADDRLP4 160
ARGP4
ADDRLP4 148
ARGP4
ADDRLP4 176
ARGP4
ADDRGP4 CrossProduct
CALLV
pop
line 342
;341:
;342:	m[0][0] = vr[0];
ADDRLP4 40
ADDRLP4 160
INDIRF4
ASGNF4
line 343
;343:	m[1][0] = vr[1];
ADDRLP4 40+12
ADDRLP4 160+4
INDIRF4
ASGNF4
line 344
;344:	m[2][0] = vr[2];
ADDRLP4 40+24
ADDRLP4 160+8
INDIRF4
ASGNF4
line 346
;345:
;346:	m[0][1] = vup[0];
ADDRLP4 40+4
ADDRLP4 176
INDIRF4
ASGNF4
line 347
;347:	m[1][1] = vup[1];
ADDRLP4 40+12+4
ADDRLP4 176+4
INDIRF4
ASGNF4
line 348
;348:	m[2][1] = vup[2];
ADDRLP4 40+24+4
ADDRLP4 176+8
INDIRF4
ASGNF4
line 350
;349:
;350:	m[0][2] = vf[0];
ADDRLP4 40+8
ADDRLP4 148
INDIRF4
ASGNF4
line 351
;351:	m[1][2] = vf[1];
ADDRLP4 40+12+8
ADDRLP4 148+4
INDIRF4
ASGNF4
line 352
;352:	m[2][2] = vf[2];
ADDRLP4 40+24+8
ADDRLP4 148+8
INDIRF4
ASGNF4
line 354
;353:
;354:	memcpy( im, m, sizeof( im ) );
ADDRLP4 112
ARGP4
ADDRLP4 40
ARGP4
CNSTI4 36
ARGI4
ADDRGP4 memcpy
CALLP4
pop
line 356
;355:
;356:	im[0][1] = m[1][0];
ADDRLP4 112+4
ADDRLP4 40+12
INDIRF4
ASGNF4
line 357
;357:	im[0][2] = m[2][0];
ADDRLP4 112+8
ADDRLP4 40+24
INDIRF4
ASGNF4
line 358
;358:	im[1][0] = m[0][1];
ADDRLP4 112+12
ADDRLP4 40+4
INDIRF4
ASGNF4
line 359
;359:	im[1][2] = m[2][1];
ADDRLP4 112+12+8
ADDRLP4 40+24+4
INDIRF4
ASGNF4
line 360
;360:	im[2][0] = m[0][2];
ADDRLP4 112+24
ADDRLP4 40+8
INDIRF4
ASGNF4
line 361
;361:	im[2][1] = m[1][2];
ADDRLP4 112+24+4
ADDRLP4 40+12+8
INDIRF4
ASGNF4
line 363
;362:
;363:	memset( zrot, 0, sizeof( zrot ) );
ADDRLP4 76
ARGP4
CNSTI4 0
ARGI4
CNSTI4 36
ARGI4
ADDRGP4 memset
CALLP4
pop
line 364
;364:	zrot[0][0] = zrot[1][1] = zrot[2][2] = 1.0F;
ADDRLP4 224
CNSTF4 1065353216
ASGNF4
ADDRLP4 76+24+8
ADDRLP4 224
INDIRF4
ASGNF4
ADDRLP4 76+12+4
ADDRLP4 224
INDIRF4
ASGNF4
ADDRLP4 76
ADDRLP4 224
INDIRF4
ASGNF4
line 366
;365:
;366:	rad = DEG2RAD( degrees );
ADDRLP4 172
CNSTF4 1078530011
ADDRFP4 12
INDIRF4
MULF4
CNSTF4 1127481344
DIVF4
ASGNF4
line 367
;367:	zrot[0][0] = cos( rad );
ADDRLP4 172
INDIRF4
ARGF4
ADDRLP4 228
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 76
ADDRLP4 228
INDIRF4
ASGNF4
line 368
;368:	zrot[0][1] = sin( rad );
ADDRLP4 172
INDIRF4
ARGF4
ADDRLP4 232
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 76+4
ADDRLP4 232
INDIRF4
ASGNF4
line 369
;369:	zrot[1][0] = -sin( rad );
ADDRLP4 172
INDIRF4
ARGF4
ADDRLP4 236
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 76+12
ADDRLP4 236
INDIRF4
NEGF4
ASGNF4
line 370
;370:	zrot[1][1] = cos( rad );
ADDRLP4 172
INDIRF4
ARGF4
ADDRLP4 240
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 76+12+4
ADDRLP4 240
INDIRF4
ASGNF4
line 372
;371:
;372:	MatrixMultiply( m, zrot, tmpmat );
ADDRLP4 40
ARGP4
ADDRLP4 76
ARGP4
ADDRLP4 188
ARGP4
ADDRGP4 MatrixMultiply
CALLV
pop
line 373
;373:	MatrixMultiply( tmpmat, im, rot );
ADDRLP4 188
ARGP4
ADDRLP4 112
ARGP4
ADDRLP4 4
ARGP4
ADDRGP4 MatrixMultiply
CALLV
pop
line 375
;374:
;375:	for ( i = 0; i < 3; i++ ) {
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $173
line 376
;376:		dst[i] = rot[i][0] * point[0] + rot[i][1] * point[1] + rot[i][2] * point[2];
ADDRLP4 248
CNSTI4 12
ADDRLP4 0
INDIRI4
MULI4
ASGNI4
ADDRLP4 252
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 0
INDIRP4
ADDP4
ADDRLP4 248
INDIRI4
ADDRLP4 4
ADDP4
INDIRF4
ADDRLP4 252
INDIRP4
INDIRF4
MULF4
ADDRLP4 248
INDIRI4
ADDRLP4 4+4
ADDP4
INDIRF4
ADDRLP4 252
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 248
INDIRI4
ADDRLP4 4+8
ADDP4
INDIRF4
ADDRLP4 252
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 377
;377:	}
LABELV $174
line 375
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 3
LTI4 $173
line 378
;378:}
LABELV $128
endproc RotatePointAroundVector 256 12
export RotateAroundDirection
proc RotateAroundDirection 20 16
line 385
;379:
;380:/*
;381:===============
;382:RotateAroundDirection
;383:===============
;384:*/
;385:void RotateAroundDirection( vec3_t axis[3], float yaw ) {
line 388
;386:
;387:	// create an arbitrary axis[1] 
;388:	PerpendicularVector( axis[1], axis[0] );
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRGP4 PerpendicularVector
CALLV
pop
line 391
;389:
;390:	// rotate it around axis[0] by yaw
;391:	if ( yaw ) {
ADDRFP4 4
INDIRF4
CNSTF4 0
EQF4 $180
line 394
;392:		vec3_t	temp;
;393:
;394:		VectorCopy( axis[1], temp );
ADDRLP4 4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRB
ASGNB 12
line 395
;395:		RotatePointAroundVector( axis[1], axis[0], temp, yaw );
ADDRLP4 16
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 16
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRLP4 16
INDIRP4
ARGP4
ADDRLP4 4
ARGP4
ADDRFP4 4
INDIRF4
ARGF4
ADDRGP4 RotatePointAroundVector
CALLV
pop
line 396
;396:	}
LABELV $180
line 399
;397:
;398:	// cross to get axis[2]
;399:	CrossProduct( axis[0], axis[1], axis[2] );
ADDRLP4 4
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
INDIRP4
ARGP4
ADDRLP4 4
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRLP4 4
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 CrossProduct
CALLV
pop
line 400
;400:}
LABELV $179
endproc RotateAroundDirection 20 16
export vectoangles
proc vectoangles 40 8
line 404
;401:
;402:
;403:
;404:void vectoangles( const vec3_t value1, vec3_t angles ) {
line 408
;405:	float	forward;
;406:	float	yaw, pitch;
;407:	
;408:	if ( value1[1] == 0 && value1[0] == 0 ) {
ADDRLP4 12
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 16
CNSTF4 0
ASGNF4
ADDRLP4 12
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 16
INDIRF4
NEF4 $183
ADDRLP4 12
INDIRP4
INDIRF4
ADDRLP4 16
INDIRF4
NEF4 $183
line 409
;409:		yaw = 0;
ADDRLP4 0
CNSTF4 0
ASGNF4
line 410
;410:		if ( value1[2] > 0 ) {
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
CNSTF4 0
LEF4 $185
line 411
;411:			pitch = 90;
ADDRLP4 4
CNSTF4 1119092736
ASGNF4
line 412
;412:		}
ADDRGP4 $184
JUMPV
LABELV $185
line 413
;413:		else {
line 414
;414:			pitch = 270;
ADDRLP4 4
CNSTF4 1132920832
ASGNF4
line 415
;415:		}
line 416
;416:	}
ADDRGP4 $184
JUMPV
LABELV $183
line 417
;417:	else {
line 418
;418:		if ( value1[0] ) {
ADDRFP4 0
INDIRP4
INDIRF4
CNSTF4 0
EQF4 $187
line 419
;419:			yaw = ( atan2 ( value1[1], value1[0] ) * 180 / M_PI );
ADDRLP4 20
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 20
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ARGF4
ADDRLP4 20
INDIRP4
INDIRF4
ARGF4
ADDRLP4 24
ADDRGP4 atan2
CALLF4
ASGNF4
ADDRLP4 0
CNSTF4 1127481344
ADDRLP4 24
INDIRF4
MULF4
CNSTF4 1078530011
DIVF4
ASGNF4
line 420
;420:		}
ADDRGP4 $188
JUMPV
LABELV $187
line 421
;421:		else if ( value1[1] > 0 ) {
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
CNSTF4 0
LEF4 $189
line 422
;422:			yaw = 90;
ADDRLP4 0
CNSTF4 1119092736
ASGNF4
line 423
;423:		}
ADDRGP4 $190
JUMPV
LABELV $189
line 424
;424:		else {
line 425
;425:			yaw = 270;
ADDRLP4 0
CNSTF4 1132920832
ASGNF4
line 426
;426:		}
LABELV $190
LABELV $188
line 427
;427:		if ( yaw < 0 ) {
ADDRLP4 0
INDIRF4
CNSTF4 0
GEF4 $191
line 428
;428:			yaw += 360;
ADDRLP4 0
ADDRLP4 0
INDIRF4
CNSTF4 1135869952
ADDF4
ASGNF4
line 429
;429:		}
LABELV $191
line 431
;430:
;431:		forward = sqrt ( value1[0]*value1[0] + value1[1]*value1[1] );
ADDRLP4 20
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 24
ADDRLP4 20
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 28
ADDRLP4 20
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 24
INDIRF4
ADDRLP4 24
INDIRF4
MULF4
ADDRLP4 28
INDIRF4
ADDRLP4 28
INDIRF4
MULF4
ADDF4
ARGF4
ADDRLP4 32
ADDRGP4 sqrt
CALLF4
ASGNF4
ADDRLP4 8
ADDRLP4 32
INDIRF4
ASGNF4
line 432
;432:		pitch = ( atan2(value1[2], forward) * 180 / M_PI );
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ARGF4
ADDRLP4 8
INDIRF4
ARGF4
ADDRLP4 36
ADDRGP4 atan2
CALLF4
ASGNF4
ADDRLP4 4
CNSTF4 1127481344
ADDRLP4 36
INDIRF4
MULF4
CNSTF4 1078530011
DIVF4
ASGNF4
line 433
;433:		if ( pitch < 0 ) {
ADDRLP4 4
INDIRF4
CNSTF4 0
GEF4 $193
line 434
;434:			pitch += 360;
ADDRLP4 4
ADDRLP4 4
INDIRF4
CNSTF4 1135869952
ADDF4
ASGNF4
line 435
;435:		}
LABELV $193
line 436
;436:	}
LABELV $184
line 438
;437:
;438:	angles[PITCH] = -pitch;
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRF4
NEGF4
ASGNF4
line 439
;439:	angles[YAW] = yaw;
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 0
INDIRF4
ASGNF4
line 440
;440:	angles[ROLL] = 0;
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
CNSTF4 0
ASGNF4
line 441
;441:}
LABELV $182
endproc vectoangles 40 8
export AnglesToAxis
proc AnglesToAxis 16 16
line 449
;442:
;443:
;444:/*
;445:=================
;446:AnglesToAxis
;447:=================
;448:*/
;449:void AnglesToAxis( const vec3_t angles, vec3_t axis[3] ) {
line 453
;450:	vec3_t	right;
;451:
;452:	// angle vectors returns "right" instead of "y axis"
;453:	AngleVectors( angles, axis[0], right, axis[2] );
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 12
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 12
INDIRP4
ARGP4
ADDRLP4 0
ARGP4
ADDRLP4 12
INDIRP4
CNSTI4 24
ADDP4
ARGP4
ADDRGP4 AngleVectors
CALLV
pop
line 454
;454:	VectorSubtract( vec3_origin, right, axis[1] );
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ADDRGP4 vec3_origin
INDIRF4
ADDRLP4 0
INDIRF4
SUBF4
ASGNF4
ADDRFP4 4
INDIRP4
CNSTI4 16
ADDP4
ADDRGP4 vec3_origin+4
INDIRF4
ADDRLP4 0+4
INDIRF4
SUBF4
ASGNF4
ADDRFP4 4
INDIRP4
CNSTI4 20
ADDP4
ADDRGP4 vec3_origin+8
INDIRF4
ADDRLP4 0+8
INDIRF4
SUBF4
ASGNF4
line 455
;455:}
LABELV $195
endproc AnglesToAxis 16 16
export AxisClear
proc AxisClear 0 0
line 457
;456:
;457:void AxisClear( vec3_t axis[3] ) {
line 458
;458:	axis[0][0] = 1;
ADDRFP4 0
INDIRP4
CNSTF4 1065353216
ASGNF4
line 459
;459:	axis[0][1] = 0;
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
CNSTF4 0
ASGNF4
line 460
;460:	axis[0][2] = 0;
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
CNSTF4 0
ASGNF4
line 461
;461:	axis[1][0] = 0;
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTF4 0
ASGNF4
line 462
;462:	axis[1][1] = 1;
ADDRFP4 0
INDIRP4
CNSTI4 16
ADDP4
CNSTF4 1065353216
ASGNF4
line 463
;463:	axis[1][2] = 0;
ADDRFP4 0
INDIRP4
CNSTI4 20
ADDP4
CNSTF4 0
ASGNF4
line 464
;464:	axis[2][0] = 0;
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
CNSTF4 0
ASGNF4
line 465
;465:	axis[2][1] = 0;
ADDRFP4 0
INDIRP4
CNSTI4 28
ADDP4
CNSTF4 0
ASGNF4
line 466
;466:	axis[2][2] = 1;
ADDRFP4 0
INDIRP4
CNSTI4 32
ADDP4
CNSTF4 1065353216
ASGNF4
line 467
;467:}
LABELV $200
endproc AxisClear 0 0
export AxisCopy
proc AxisCopy 8 0
line 469
;468:
;469:void AxisCopy( vec3_t in[3], vec3_t out[3] ) {
line 470
;470:	VectorCopy( in[0], out[0] );
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
INDIRB
ASGNB 12
line 471
;471:	VectorCopy( in[1], out[1] );
ADDRLP4 0
CNSTI4 12
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRB
ASGNB 12
line 472
;472:	VectorCopy( in[2], out[2] );
ADDRLP4 4
CNSTI4 24
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRB
ASGNB 12
line 473
;473:}
LABELV $201
endproc AxisCopy 8 0
export ProjectPointOnPlane
proc ProjectPointOnPlane 60 0
line 476
;474:
;475:void ProjectPointOnPlane( vec3_t dst, const vec3_t p, const vec3_t normal )
;476:{
line 481
;477:	float d;
;478:	vec3_t n;
;479:	float inv_denom;
;480:
;481:	inv_denom =  DotProduct( normal, normal );
ADDRLP4 20
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 24
ADDRLP4 20
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 28
ADDRLP4 20
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 32
ADDRLP4 20
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 24
INDIRF4
ADDRLP4 24
INDIRF4
MULF4
ADDRLP4 28
INDIRF4
ADDRLP4 28
INDIRF4
MULF4
ADDF4
ADDRLP4 32
INDIRF4
ADDRLP4 32
INDIRF4
MULF4
ADDF4
ASGNF4
line 485
;482:#ifndef Q3_VM
;483:	assert( Q_fabs(inv_denom) != 0.0f ); // bk010122 - zero vectors get here
;484:#endif
;485:	inv_denom = 1.0f / inv_denom;
ADDRLP4 0
CNSTF4 1065353216
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 487
;486:
;487:	d = DotProduct( normal, p ) * inv_denom;
ADDRLP4 36
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 40
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 44
CNSTI4 4
ASGNI4
ADDRLP4 48
CNSTI4 8
ASGNI4
ADDRLP4 16
ADDRLP4 36
INDIRP4
INDIRF4
ADDRLP4 40
INDIRP4
INDIRF4
MULF4
ADDRLP4 36
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 36
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 489
;488:
;489:	n[0] = normal[0] * inv_denom;
ADDRLP4 4
ADDRFP4 8
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 490
;490:	n[1] = normal[1] * inv_denom;
ADDRLP4 4+4
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 491
;491:	n[2] = normal[2] * inv_denom;
ADDRLP4 4+8
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 493
;492:
;493:	dst[0] = p[0] - d * n[0];
ADDRFP4 0
INDIRP4
ADDRFP4 4
INDIRP4
INDIRF4
ADDRLP4 16
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
SUBF4
ASGNF4
line 494
;494:	dst[1] = p[1] - d * n[1];
ADDRLP4 52
CNSTI4 4
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 52
INDIRI4
ADDP4
ADDRFP4 4
INDIRP4
ADDRLP4 52
INDIRI4
ADDP4
INDIRF4
ADDRLP4 16
INDIRF4
ADDRLP4 4+4
INDIRF4
MULF4
SUBF4
ASGNF4
line 495
;495:	dst[2] = p[2] - d * n[2];
ADDRLP4 56
CNSTI4 8
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
ADDRFP4 4
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
ADDRLP4 16
INDIRF4
ADDRLP4 4+8
INDIRF4
MULF4
SUBF4
ASGNF4
line 496
;496:}
LABELV $202
endproc ProjectPointOnPlane 60 0
export MakeNormalVectors
proc MakeNormalVectors 40 12
line 506
;497:
;498:/*
;499:================
;500:MakeNormalVectors
;501:
;502:Given a normalized forward vector, create two
;503:other perpendicular vectors
;504:================
;505:*/
;506:void MakeNormalVectors( const vec3_t forward, vec3_t right, vec3_t up) {
line 511
;507:	float		d;
;508:
;509:	// this rotate and negate guarantees a vector
;510:	// not colinear with the original
;511:	right[1] = -forward[0];
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRFP4 0
INDIRP4
INDIRF4
NEGF4
ASGNF4
line 512
;512:	right[2] = forward[1];
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
line 513
;513:	right[0] = forward[2];
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
line 515
;514:
;515:	d = DotProduct (right, forward);
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 8
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 12
CNSTI4 4
ASGNI4
ADDRLP4 16
CNSTI4 8
ASGNI4
ADDRLP4 0
ADDRLP4 4
INDIRP4
INDIRF4
ADDRLP4 8
INDIRP4
INDIRF4
MULF4
ADDRLP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 4
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 516
;516:	VectorMA (right, -d, forward, right);
ADDRLP4 20
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 20
INDIRP4
ADDRLP4 20
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
NEGF4
MULF4
ADDF4
ASGNF4
ADDRLP4 24
CNSTI4 4
ASGNI4
ADDRLP4 28
ADDRFP4 4
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
NEGF4
MULF4
ADDF4
ASGNF4
ADDRLP4 32
CNSTI4 8
ASGNI4
ADDRLP4 36
ADDRFP4 4
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
ASGNP4
ADDRLP4 36
INDIRP4
ADDRLP4 36
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
NEGF4
MULF4
ADDF4
ASGNF4
line 517
;517:	VectorNormalize (right);
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
line 518
;518:	CrossProduct (right, forward, up);
ADDRFP4 4
INDIRP4
ARGP4
ADDRFP4 0
INDIRP4
ARGP4
ADDRFP4 8
INDIRP4
ARGP4
ADDRGP4 CrossProduct
CALLV
pop
line 519
;519:}
LABELV $207
endproc MakeNormalVectors 40 12
export VectorRotate
proc VectorRotate 40 0
line 523
;520:
;521:
;522:void VectorRotate( vec3_t in, vec3_t matrix[3], vec3_t out )
;523:{
line 524
;524:	out[0] = DotProduct( in, matrix[0] );
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 8
CNSTI4 4
ASGNI4
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRP4
INDIRF4
MULF4
ADDRLP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 525
;525:	out[1] = DotProduct( in, matrix[1] );
ADDRLP4 16
CNSTI4 4
ASGNI4
ADDRLP4 20
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 24
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
ADDRLP4 20
INDIRP4
INDIRF4
ADDRLP4 24
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
MULF4
ADDRLP4 20
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
INDIRF4
ADDRLP4 24
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 20
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 24
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 526
;526:	out[2] = DotProduct( in, matrix[2] );
ADDRLP4 28
CNSTI4 8
ASGNI4
ADDRLP4 32
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 36
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 28
INDIRI4
ADDP4
ADDRLP4 32
INDIRP4
INDIRF4
ADDRLP4 36
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
MULF4
ADDRLP4 32
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 36
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 32
INDIRP4
ADDRLP4 28
INDIRI4
ADDP4
INDIRF4
ADDRLP4 36
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 527
;527:}
LABELV $208
endproc VectorRotate 40 0
export Q_rsqrt
proc Q_rsqrt 20 0
line 536
;528:
;529://============================================================================
;530:
;531:#if !idppc
;532:/*
;533:** float q_rsqrt( float number )
;534:*/
;535:float Q_rsqrt( float number )
;536:{
line 539
;537:	long i;
;538:	float x2, y;
;539:	const float threehalfs = 1.5F;
ADDRLP4 12
CNSTF4 1069547520
ASGNF4
line 541
;540:
;541:	x2 = number * 0.5F;
ADDRLP4 8
CNSTF4 1056964608
ADDRFP4 0
INDIRF4
MULF4
ASGNF4
line 542
;542:	y  = number;
ADDRLP4 0
ADDRFP4 0
INDIRF4
ASGNF4
line 543
;543:	i  = * ( long * ) &y;						// evil floating point bit level hacking
ADDRLP4 4
ADDRLP4 0
INDIRI4
ASGNI4
line 544
;544:	i  = 0x5f3759df - ( i >> 1 );               // what the fuck?
ADDRLP4 4
CNSTI4 1597463007
ADDRLP4 4
INDIRI4
CNSTI4 1
RSHI4
SUBI4
ASGNI4
line 545
;545:	y  = * ( float * ) &i;
ADDRLP4 0
ADDRLP4 4
INDIRF4
ASGNF4
line 546
;546:	y  = y * ( threehalfs - ( x2 * y * y ) );   // 1st iteration
ADDRLP4 16
ADDRLP4 0
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 16
INDIRF4
ADDRLP4 12
INDIRF4
ADDRLP4 8
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDRLP4 16
INDIRF4
MULF4
SUBF4
MULF4
ASGNF4
line 554
;547://	y  = y * ( threehalfs - ( x2 * y * y ) );   // 2nd iteration, this can be removed
;548:
;549:#ifndef Q3_VM
;550:#ifdef __linux__
;551:	assert( !isnan(y) ); // bk010122 - FPE?
;552:#endif
;553:#endif
;554:	return y;
ADDRLP4 0
INDIRF4
RETF4
LABELV $209
endproc Q_rsqrt 20 0
export Q_fabs
proc Q_fabs 4 0
line 557
;555:}
;556:
;557:float Q_fabs( float f ) {
line 558
;558:	int tmp = * ( int * ) &f;
ADDRLP4 0
ADDRFP4 0
INDIRI4
ASGNI4
line 559
;559:	tmp &= 0x7FFFFFFF;
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 2147483647
BANDI4
ASGNI4
line 560
;560:	return * ( float * ) &tmp;
ADDRLP4 0
INDIRF4
RETF4
LABELV $210
endproc Q_fabs 4 0
export LerpAngle
proc LerpAngle 8 0
line 572
;561:}
;562:#endif
;563:
;564://============================================================
;565:
;566:/*
;567:===============
;568:LerpAngle
;569:
;570:===============
;571:*/
;572:float LerpAngle (float from, float to, float frac) {
line 575
;573:	float	a;
;574:
;575:	if ( to - from > 180 ) {
ADDRFP4 4
INDIRF4
ADDRFP4 0
INDIRF4
SUBF4
CNSTF4 1127481344
LEF4 $212
line 576
;576:		to -= 360;
ADDRFP4 4
ADDRFP4 4
INDIRF4
CNSTF4 1135869952
SUBF4
ASGNF4
line 577
;577:	}
LABELV $212
line 578
;578:	if ( to - from < -180 ) {
ADDRFP4 4
INDIRF4
ADDRFP4 0
INDIRF4
SUBF4
CNSTF4 3274964992
GEF4 $214
line 579
;579:		to += 360;
ADDRFP4 4
ADDRFP4 4
INDIRF4
CNSTF4 1135869952
ADDF4
ASGNF4
line 580
;580:	}
LABELV $214
line 581
;581:	a = from + frac * (to - from);
ADDRLP4 4
ADDRFP4 0
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 4
INDIRF4
ADDRFP4 8
INDIRF4
ADDRFP4 4
INDIRF4
ADDRLP4 4
INDIRF4
SUBF4
MULF4
ADDF4
ASGNF4
line 583
;582:
;583:	return a;
ADDRLP4 0
INDIRF4
RETF4
LABELV $211
endproc LerpAngle 8 0
export AngleSubtract
proc AngleSubtract 4 0
line 594
;584:}
;585:
;586:
;587:/*
;588:=================
;589:AngleSubtract
;590:
;591:Always returns a value from -180 to 180
;592:=================
;593:*/
;594:float	AngleSubtract( float a1, float a2 ) {
line 597
;595:	float	a;
;596:
;597:	a = a1 - a2;
ADDRLP4 0
ADDRFP4 0
INDIRF4
ADDRFP4 4
INDIRF4
SUBF4
ASGNF4
line 598
;598:	assert(fabs(a) < 3600);
ADDRGP4 $218
JUMPV
LABELV $217
line 599
;599:	while ( a > 180 ) {
line 600
;600:		a -= 360;
ADDRLP4 0
ADDRLP4 0
INDIRF4
CNSTF4 1135869952
SUBF4
ASGNF4
line 601
;601:	}
LABELV $218
line 599
ADDRLP4 0
INDIRF4
CNSTF4 1127481344
GTF4 $217
ADDRGP4 $221
JUMPV
LABELV $220
line 602
;602:	while ( a < -180 ) {
line 603
;603:		a += 360;
ADDRLP4 0
ADDRLP4 0
INDIRF4
CNSTF4 1135869952
ADDF4
ASGNF4
line 604
;604:	}
LABELV $221
line 602
ADDRLP4 0
INDIRF4
CNSTF4 3274964992
LTF4 $220
line 605
;605:	return a;
ADDRLP4 0
INDIRF4
RETF4
LABELV $216
endproc AngleSubtract 4 0
export AnglesSubtract
proc AnglesSubtract 20 8
line 609
;606:}
;607:
;608:
;609:void AnglesSubtract( vec3_t v1, vec3_t v2, vec3_t v3 ) {
line 610
;610:	v3[0] = AngleSubtract( v1[0], v2[0] );
ADDRFP4 0
INDIRP4
INDIRF4
ARGF4
ADDRFP4 4
INDIRP4
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 AngleSubtract
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRF4
ASGNF4
line 611
;611:	v3[1] = AngleSubtract( v1[1], v2[1] );
ADDRLP4 4
CNSTI4 4
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ARGF4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ARGF4
ADDRLP4 8
ADDRGP4 AngleSubtract
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRLP4 8
INDIRF4
ASGNF4
line 612
;612:	v3[2] = AngleSubtract( v1[2], v2[2] );
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ARGF4
ADDRFP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ARGF4
ADDRLP4 16
ADDRGP4 AngleSubtract
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
ADDRLP4 16
INDIRF4
ASGNF4
line 613
;613:}
LABELV $223
endproc AnglesSubtract 20 8
export AngleMod
proc AngleMod 0 0
line 616
;614:
;615:
;616:float	AngleMod(float a) {
line 617
;617:	a = (360.0/65536) * ((int)(a*(65536/360.0)) & 65535);
ADDRFP4 0
CNSTF4 1001652224
CNSTF4 1127615329
ADDRFP4 0
INDIRF4
MULF4
CVFI4 4
CNSTI4 65535
BANDI4
CVIF4 4
MULF4
ASGNF4
line 618
;618:	return a;
ADDRFP4 0
INDIRF4
RETF4
LABELV $224
endproc AngleMod 0 0
export AngleNormalize360
proc AngleNormalize360 0 0
line 629
;619:}
;620:
;621:
;622:/*
;623:=================
;624:AngleNormalize360
;625:
;626:returns angle normalized to the range [0 <= angle < 360]
;627:=================
;628:*/
;629:float AngleNormalize360 ( float angle ) {
line 630
;630:	return (360.0 / 65536) * ((int)(angle * (65536 / 360.0)) & 65535);
CNSTF4 1001652224
CNSTF4 1127615329
ADDRFP4 0
INDIRF4
MULF4
CVFI4 4
CNSTI4 65535
BANDI4
CVIF4 4
MULF4
RETF4
LABELV $225
endproc AngleNormalize360 0 0
export AngleNormalize180
proc AngleNormalize180 4 4
line 641
;631:}
;632:
;633:
;634:/*
;635:=================
;636:AngleNormalize180
;637:
;638:returns angle normalized to the range [-180 < angle <= 180]
;639:=================
;640:*/
;641:float AngleNormalize180 ( float angle ) {
line 642
;642:	angle = AngleNormalize360( angle );
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 AngleNormalize360
CALLF4
ASGNF4
ADDRFP4 0
ADDRLP4 0
INDIRF4
ASGNF4
line 643
;643:	if ( angle > 180.0 ) {
ADDRFP4 0
INDIRF4
CNSTF4 1127481344
LEF4 $227
line 644
;644:		angle -= 360.0;
ADDRFP4 0
ADDRFP4 0
INDIRF4
CNSTF4 1135869952
SUBF4
ASGNF4
line 645
;645:	}
LABELV $227
line 646
;646:	return angle;
ADDRFP4 0
INDIRF4
RETF4
LABELV $226
endproc AngleNormalize180 4 4
export AngleDelta
proc AngleDelta 4 4
line 657
;647:}
;648:
;649:
;650:/*
;651:=================
;652:AngleDelta
;653:
;654:returns the normalized delta from angle1 to angle2
;655:=================
;656:*/
;657:float AngleDelta ( float angle1, float angle2 ) {
line 658
;658:	return AngleNormalize180( angle1 - angle2 );
ADDRFP4 0
INDIRF4
ADDRFP4 4
INDIRF4
SUBF4
ARGF4
ADDRLP4 0
ADDRGP4 AngleNormalize180
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
RETF4
LABELV $229
endproc AngleDelta 4 4
export SetPlaneSignbits
proc SetPlaneSignbits 8 0
line 670
;659:}
;660:
;661:
;662://============================================================
;663:
;664:
;665:/*
;666:=================
;667:SetPlaneSignbits
;668:=================
;669:*/
;670:void SetPlaneSignbits (cplane_t *out) {
line 674
;671:	int	bits, j;
;672:
;673:	// for fast box on planeside test
;674:	bits = 0;
ADDRLP4 4
CNSTI4 0
ASGNI4
line 675
;675:	for (j=0 ; j<3 ; j++) {
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $231
line 676
;676:		if (out->normal[j] < 0) {
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 0
INDIRP4
ADDP4
INDIRF4
CNSTF4 0
GEF4 $235
line 677
;677:			bits |= 1<<j;
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDRLP4 0
INDIRI4
LSHI4
BORI4
ASGNI4
line 678
;678:		}
LABELV $235
line 679
;679:	}
LABELV $232
line 675
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 3
LTI4 $231
line 680
;680:	out->signbits = bits;
ADDRFP4 0
INDIRP4
CNSTI4 17
ADDP4
ADDRLP4 4
INDIRI4
CVIU4 4
CVUU1 4
ASGNU1
line 681
;681:}
LABELV $230
endproc SetPlaneSignbits 8 0
export BoxOnPlaneSide
proc BoxOnPlaneSide 280 0
line 729
;682:
;683:
;684:/*
;685:==================
;686:BoxOnPlaneSide
;687:
;688:Returns 1, 2, or 1 + 2
;689:
;690:// this is the slow, general version
;691:int BoxOnPlaneSide2 (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
;692:{
;693:	int		i;
;694:	float	dist1, dist2;
;695:	int		sides;
;696:	vec3_t	corners[2];
;697:
;698:	for (i=0 ; i<3 ; i++)
;699:	{
;700:		if (p->normal[i] < 0)
;701:		{
;702:			corners[0][i] = emins[i];
;703:			corners[1][i] = emaxs[i];
;704:		}
;705:		else
;706:		{
;707:			corners[1][i] = emins[i];
;708:			corners[0][i] = emaxs[i];
;709:		}
;710:	}
;711:	dist1 = DotProduct (p->normal, corners[0]) - p->dist;
;712:	dist2 = DotProduct (p->normal, corners[1]) - p->dist;
;713:	sides = 0;
;714:	if (dist1 >= 0)
;715:		sides = 1;
;716:	if (dist2 < 0)
;717:		sides |= 2;
;718:
;719:	return sides;
;720:}
;721:
;722:==================
;723:*/
;724:#if !( (defined __linux__ || __FreeBSD__) && (defined __i386__) && (!defined C_ONLY)) // rb010123
;725:
;726:#if defined __LCC__ || defined C_ONLY || !id386
;727:
;728:int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
;729:{
line 734
;730:	float	dist1, dist2;
;731:	int		sides;
;732:
;733:// fast axial cases
;734:	if (p->type < 3)
ADDRFP4 8
INDIRP4
CNSTI4 16
ADDP4
INDIRU1
CVUI4 1
CNSTI4 3
GEI4 $238
line 735
;735:	{
line 736
;736:		if (p->dist <= emins[p->type])
ADDRLP4 12
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 12
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 12
INDIRP4
CNSTI4 16
ADDP4
INDIRU1
CVUI4 1
CNSTI4 2
LSHI4
ADDRFP4 0
INDIRP4
ADDP4
INDIRF4
GTF4 $240
line 737
;737:			return 1;
CNSTI4 1
RETI4
ADDRGP4 $237
JUMPV
LABELV $240
line 738
;738:		if (p->dist >= emaxs[p->type])
ADDRLP4 16
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 16
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 16
INDIRP4
CNSTI4 16
ADDP4
INDIRU1
CVUI4 1
CNSTI4 2
LSHI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRF4
LTF4 $242
line 739
;739:			return 2;
CNSTI4 2
RETI4
ADDRGP4 $237
JUMPV
LABELV $242
line 740
;740:		return 3;
CNSTI4 3
RETI4
ADDRGP4 $237
JUMPV
LABELV $238
line 744
;741:	}
;742:
;743:// general case
;744:	switch (p->signbits)
ADDRLP4 12
ADDRFP4 8
INDIRP4
CNSTI4 17
ADDP4
INDIRU1
CVUI4 1
ASGNI4
ADDRLP4 12
INDIRI4
CNSTI4 0
LTI4 $244
ADDRLP4 12
INDIRI4
CNSTI4 7
GTI4 $244
ADDRLP4 12
INDIRI4
CNSTI4 2
LSHI4
ADDRGP4 $255
ADDP4
INDIRP4
JUMPV
lit
align 4
LABELV $255
address $247
address $248
address $249
address $250
address $251
address $252
address $253
address $254
code
line 745
;745:	{
LABELV $247
line 747
;746:	case 0:
;747:		dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
ADDRLP4 20
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 24
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 28
CNSTI4 4
ASGNI4
ADDRLP4 32
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 20
INDIRP4
INDIRF4
ADDRLP4 24
INDIRP4
INDIRF4
MULF4
ADDRLP4 20
INDIRP4
ADDRLP4 28
INDIRI4
ADDP4
INDIRF4
ADDRLP4 24
INDIRP4
ADDRLP4 28
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 20
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
ADDRLP4 24
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 748
;748:		dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
ADDRLP4 36
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 40
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 44
CNSTI4 4
ASGNI4
ADDRLP4 48
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 36
INDIRP4
INDIRF4
ADDRLP4 40
INDIRP4
INDIRF4
MULF4
ADDRLP4 36
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 36
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 749
;749:		break;
ADDRGP4 $245
JUMPV
LABELV $248
line 751
;750:	case 1:
;751:		dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
ADDRLP4 52
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 56
CNSTI4 4
ASGNI4
ADDRLP4 60
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 64
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 52
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
INDIRF4
MULF4
ADDRLP4 52
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
ADDRLP4 60
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 52
INDIRP4
ADDRLP4 64
INDIRI4
ADDP4
INDIRF4
ADDRLP4 60
INDIRP4
ADDRLP4 64
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 752
;752:		dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
ADDRLP4 68
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 72
CNSTI4 4
ASGNI4
ADDRLP4 76
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 80
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 68
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
INDIRF4
MULF4
ADDRLP4 68
INDIRP4
ADDRLP4 72
INDIRI4
ADDP4
INDIRF4
ADDRLP4 76
INDIRP4
ADDRLP4 72
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 68
INDIRP4
ADDRLP4 80
INDIRI4
ADDP4
INDIRF4
ADDRLP4 76
INDIRP4
ADDRLP4 80
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 753
;753:		break;
ADDRGP4 $245
JUMPV
LABELV $249
line 755
;754:	case 2:
;755:		dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
ADDRLP4 84
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 88
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 92
CNSTI4 4
ASGNI4
ADDRLP4 96
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 84
INDIRP4
INDIRF4
ADDRLP4 88
INDIRP4
INDIRF4
MULF4
ADDRLP4 84
INDIRP4
ADDRLP4 92
INDIRI4
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 92
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 84
INDIRP4
ADDRLP4 96
INDIRI4
ADDP4
INDIRF4
ADDRLP4 88
INDIRP4
ADDRLP4 96
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 756
;756:		dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
ADDRLP4 100
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 104
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 108
CNSTI4 4
ASGNI4
ADDRLP4 112
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 100
INDIRP4
INDIRF4
ADDRLP4 104
INDIRP4
INDIRF4
MULF4
ADDRLP4 100
INDIRP4
ADDRLP4 108
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 108
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 100
INDIRP4
ADDRLP4 112
INDIRI4
ADDP4
INDIRF4
ADDRLP4 104
INDIRP4
ADDRLP4 112
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 757
;757:		break;
ADDRGP4 $245
JUMPV
LABELV $250
line 759
;758:	case 3:
;759:		dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
ADDRLP4 116
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 120
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 124
CNSTI4 4
ASGNI4
ADDRLP4 128
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 116
INDIRP4
INDIRF4
ADDRLP4 120
INDIRP4
INDIRF4
MULF4
ADDRLP4 116
INDIRP4
ADDRLP4 124
INDIRI4
ADDP4
INDIRF4
ADDRLP4 120
INDIRP4
ADDRLP4 124
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 116
INDIRP4
ADDRLP4 128
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 128
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 760
;760:		dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
ADDRLP4 132
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 136
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 140
CNSTI4 4
ASGNI4
ADDRLP4 144
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 132
INDIRP4
INDIRF4
ADDRLP4 136
INDIRP4
INDIRF4
MULF4
ADDRLP4 132
INDIRP4
ADDRLP4 140
INDIRI4
ADDP4
INDIRF4
ADDRLP4 136
INDIRP4
ADDRLP4 140
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 132
INDIRP4
ADDRLP4 144
INDIRI4
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 144
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 761
;761:		break;
ADDRGP4 $245
JUMPV
LABELV $251
line 763
;762:	case 4:
;763:		dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
ADDRLP4 148
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 152
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 156
CNSTI4 4
ASGNI4
ADDRLP4 160
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 148
INDIRP4
INDIRF4
ADDRLP4 152
INDIRP4
INDIRF4
MULF4
ADDRLP4 148
INDIRP4
ADDRLP4 156
INDIRI4
ADDP4
INDIRF4
ADDRLP4 152
INDIRP4
ADDRLP4 156
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 148
INDIRP4
ADDRLP4 160
INDIRI4
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 160
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 764
;764:		dist2 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
ADDRLP4 164
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 168
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 172
CNSTI4 4
ASGNI4
ADDRLP4 176
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 164
INDIRP4
INDIRF4
ADDRLP4 168
INDIRP4
INDIRF4
MULF4
ADDRLP4 164
INDIRP4
ADDRLP4 172
INDIRI4
ADDP4
INDIRF4
ADDRLP4 168
INDIRP4
ADDRLP4 172
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 164
INDIRP4
ADDRLP4 176
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 176
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 765
;765:		break;
ADDRGP4 $245
JUMPV
LABELV $252
line 767
;766:	case 5:
;767:		dist1 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emins[2];
ADDRLP4 180
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 184
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 188
CNSTI4 4
ASGNI4
ADDRLP4 192
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 180
INDIRP4
INDIRF4
ADDRLP4 184
INDIRP4
INDIRF4
MULF4
ADDRLP4 180
INDIRP4
ADDRLP4 188
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 188
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 180
INDIRP4
ADDRLP4 192
INDIRI4
ADDP4
INDIRF4
ADDRLP4 184
INDIRP4
ADDRLP4 192
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 768
;768:		dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emaxs[2];
ADDRLP4 196
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 200
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 204
CNSTI4 4
ASGNI4
ADDRLP4 208
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 196
INDIRP4
INDIRF4
ADDRLP4 200
INDIRP4
INDIRF4
MULF4
ADDRLP4 196
INDIRP4
ADDRLP4 204
INDIRI4
ADDP4
INDIRF4
ADDRFP4 0
INDIRP4
ADDRLP4 204
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 196
INDIRP4
ADDRLP4 208
INDIRI4
ADDP4
INDIRF4
ADDRLP4 200
INDIRP4
ADDRLP4 208
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 769
;769:		break;
ADDRGP4 $245
JUMPV
LABELV $253
line 771
;770:	case 6:
;771:		dist1 = p->normal[0]*emaxs[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
ADDRLP4 212
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 216
CNSTI4 4
ASGNI4
ADDRLP4 220
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 224
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 212
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
INDIRF4
MULF4
ADDRLP4 212
INDIRP4
ADDRLP4 216
INDIRI4
ADDP4
INDIRF4
ADDRLP4 220
INDIRP4
ADDRLP4 216
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 212
INDIRP4
ADDRLP4 224
INDIRI4
ADDP4
INDIRF4
ADDRLP4 220
INDIRP4
ADDRLP4 224
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 772
;772:		dist2 = p->normal[0]*emins[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
ADDRLP4 228
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 232
CNSTI4 4
ASGNI4
ADDRLP4 236
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 240
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 228
INDIRP4
INDIRF4
ADDRFP4 0
INDIRP4
INDIRF4
MULF4
ADDRLP4 228
INDIRP4
ADDRLP4 232
INDIRI4
ADDP4
INDIRF4
ADDRLP4 236
INDIRP4
ADDRLP4 232
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 228
INDIRP4
ADDRLP4 240
INDIRI4
ADDP4
INDIRF4
ADDRLP4 236
INDIRP4
ADDRLP4 240
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 773
;773:		break;
ADDRGP4 $245
JUMPV
LABELV $254
line 775
;774:	case 7:
;775:		dist1 = p->normal[0]*emins[0] + p->normal[1]*emins[1] + p->normal[2]*emins[2];
ADDRLP4 244
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 248
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 252
CNSTI4 4
ASGNI4
ADDRLP4 256
CNSTI4 8
ASGNI4
ADDRLP4 4
ADDRLP4 244
INDIRP4
INDIRF4
ADDRLP4 248
INDIRP4
INDIRF4
MULF4
ADDRLP4 244
INDIRP4
ADDRLP4 252
INDIRI4
ADDP4
INDIRF4
ADDRLP4 248
INDIRP4
ADDRLP4 252
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 244
INDIRP4
ADDRLP4 256
INDIRI4
ADDP4
INDIRF4
ADDRLP4 248
INDIRP4
ADDRLP4 256
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 776
;776:		dist2 = p->normal[0]*emaxs[0] + p->normal[1]*emaxs[1] + p->normal[2]*emaxs[2];
ADDRLP4 260
ADDRFP4 8
INDIRP4
ASGNP4
ADDRLP4 264
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 268
CNSTI4 4
ASGNI4
ADDRLP4 272
CNSTI4 8
ASGNI4
ADDRLP4 8
ADDRLP4 260
INDIRP4
INDIRF4
ADDRLP4 264
INDIRP4
INDIRF4
MULF4
ADDRLP4 260
INDIRP4
ADDRLP4 268
INDIRI4
ADDP4
INDIRF4
ADDRLP4 264
INDIRP4
ADDRLP4 268
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 260
INDIRP4
ADDRLP4 272
INDIRI4
ADDP4
INDIRF4
ADDRLP4 264
INDIRP4
ADDRLP4 272
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 777
;777:		break;
ADDRGP4 $245
JUMPV
LABELV $244
line 779
;778:	default:
;779:		dist1 = dist2 = 0;		// shut up compiler
ADDRLP4 276
CNSTF4 0
ASGNF4
ADDRLP4 8
ADDRLP4 276
INDIRF4
ASGNF4
ADDRLP4 4
ADDRLP4 276
INDIRF4
ASGNF4
line 780
;780:		break;
LABELV $245
line 783
;781:	}
;782:
;783:	sides = 0;
ADDRLP4 0
CNSTI4 0
ASGNI4
line 784
;784:	if (dist1 >= p->dist)
ADDRLP4 4
INDIRF4
ADDRFP4 8
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
LTF4 $256
line 785
;785:		sides = 1;
ADDRLP4 0
CNSTI4 1
ASGNI4
LABELV $256
line 786
;786:	if (dist2 < p->dist)
ADDRLP4 8
INDIRF4
ADDRFP4 8
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
GEF4 $258
line 787
;787:		sides |= 2;
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 2
BORI4
ASGNI4
LABELV $258
line 789
;788:
;789:	return sides;
ADDRLP4 0
INDIRI4
RETI4
LABELV $237
endproc BoxOnPlaneSide 280 0
export RadiusFromBounds
proc RadiusFromBounds 36 4
line 1033
;790:}
;791:#else
;792:#pragma warning( disable: 4035 )
;793:
;794:__declspec( naked ) int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct cplane_s *p)
;795:{
;796:	static int bops_initialized;
;797:	static int Ljmptab[8];
;798:
;799:	__asm {
;800:
;801:		push ebx
;802:			
;803:		cmp bops_initialized, 1
;804:		je  initialized
;805:		mov bops_initialized, 1
;806:		
;807:		mov Ljmptab[0*4], offset Lcase0
;808:		mov Ljmptab[1*4], offset Lcase1
;809:		mov Ljmptab[2*4], offset Lcase2
;810:		mov Ljmptab[3*4], offset Lcase3
;811:		mov Ljmptab[4*4], offset Lcase4
;812:		mov Ljmptab[5*4], offset Lcase5
;813:		mov Ljmptab[6*4], offset Lcase6
;814:		mov Ljmptab[7*4], offset Lcase7
;815:			
;816:initialized:
;817:
;818:		mov edx,dword ptr[4+12+esp]
;819:		mov ecx,dword ptr[4+4+esp]
;820:		xor eax,eax
;821:		mov ebx,dword ptr[4+8+esp]
;822:		mov al,byte ptr[17+edx]
;823:		cmp al,8
;824:		jge Lerror
;825:		fld dword ptr[0+edx]
;826:		fld st(0)
;827:		jmp dword ptr[Ljmptab+eax*4]
;828:Lcase0:
;829:		fmul dword ptr[ebx]
;830:		fld dword ptr[0+4+edx]
;831:		fxch st(2)
;832:		fmul dword ptr[ecx]
;833:		fxch st(2)
;834:		fld st(0)
;835:		fmul dword ptr[4+ebx]
;836:		fld dword ptr[0+8+edx]
;837:		fxch st(2)
;838:		fmul dword ptr[4+ecx]
;839:		fxch st(2)
;840:		fld st(0)
;841:		fmul dword ptr[8+ebx]
;842:		fxch st(5)
;843:		faddp st(3),st(0)
;844:		fmul dword ptr[8+ecx]
;845:		fxch st(1)
;846:		faddp st(3),st(0)
;847:		fxch st(3)
;848:		faddp st(2),st(0)
;849:		jmp LSetSides
;850:Lcase1:
;851:		fmul dword ptr[ecx]
;852:		fld dword ptr[0+4+edx]
;853:		fxch st(2)
;854:		fmul dword ptr[ebx]
;855:		fxch st(2)
;856:		fld st(0)
;857:		fmul dword ptr[4+ebx]
;858:		fld dword ptr[0+8+edx]
;859:		fxch st(2)
;860:		fmul dword ptr[4+ecx]
;861:		fxch st(2)
;862:		fld st(0)
;863:		fmul dword ptr[8+ebx]
;864:		fxch st(5)
;865:		faddp st(3),st(0)
;866:		fmul dword ptr[8+ecx]
;867:		fxch st(1)
;868:		faddp st(3),st(0)
;869:		fxch st(3)
;870:		faddp st(2),st(0)
;871:		jmp LSetSides
;872:Lcase2:
;873:		fmul dword ptr[ebx]
;874:		fld dword ptr[0+4+edx]
;875:		fxch st(2)
;876:		fmul dword ptr[ecx]
;877:		fxch st(2)
;878:		fld st(0)
;879:		fmul dword ptr[4+ecx]
;880:		fld dword ptr[0+8+edx]
;881:		fxch st(2)
;882:		fmul dword ptr[4+ebx]
;883:		fxch st(2)
;884:		fld st(0)
;885:		fmul dword ptr[8+ebx]
;886:		fxch st(5)
;887:		faddp st(3),st(0)
;888:		fmul dword ptr[8+ecx]
;889:		fxch st(1)
;890:		faddp st(3),st(0)
;891:		fxch st(3)
;892:		faddp st(2),st(0)
;893:		jmp LSetSides
;894:Lcase3:
;895:		fmul dword ptr[ecx]
;896:		fld dword ptr[0+4+edx]
;897:		fxch st(2)
;898:		fmul dword ptr[ebx]
;899:		fxch st(2)
;900:		fld st(0)
;901:		fmul dword ptr[4+ecx]
;902:		fld dword ptr[0+8+edx]
;903:		fxch st(2)
;904:		fmul dword ptr[4+ebx]
;905:		fxch st(2)
;906:		fld st(0)
;907:		fmul dword ptr[8+ebx]
;908:		fxch st(5)
;909:		faddp st(3),st(0)
;910:		fmul dword ptr[8+ecx]
;911:		fxch st(1)
;912:		faddp st(3),st(0)
;913:		fxch st(3)
;914:		faddp st(2),st(0)
;915:		jmp LSetSides
;916:Lcase4:
;917:		fmul dword ptr[ebx]
;918:		fld dword ptr[0+4+edx]
;919:		fxch st(2)
;920:		fmul dword ptr[ecx]
;921:		fxch st(2)
;922:		fld st(0)
;923:		fmul dword ptr[4+ebx]
;924:		fld dword ptr[0+8+edx]
;925:		fxch st(2)
;926:		fmul dword ptr[4+ecx]
;927:		fxch st(2)
;928:		fld st(0)
;929:		fmul dword ptr[8+ecx]
;930:		fxch st(5)
;931:		faddp st(3),st(0)
;932:		fmul dword ptr[8+ebx]
;933:		fxch st(1)
;934:		faddp st(3),st(0)
;935:		fxch st(3)
;936:		faddp st(2),st(0)
;937:		jmp LSetSides
;938:Lcase5:
;939:		fmul dword ptr[ecx]
;940:		fld dword ptr[0+4+edx]
;941:		fxch st(2)
;942:		fmul dword ptr[ebx]
;943:		fxch st(2)
;944:		fld st(0)
;945:		fmul dword ptr[4+ebx]
;946:		fld dword ptr[0+8+edx]
;947:		fxch st(2)
;948:		fmul dword ptr[4+ecx]
;949:		fxch st(2)
;950:		fld st(0)
;951:		fmul dword ptr[8+ecx]
;952:		fxch st(5)
;953:		faddp st(3),st(0)
;954:		fmul dword ptr[8+ebx]
;955:		fxch st(1)
;956:		faddp st(3),st(0)
;957:		fxch st(3)
;958:		faddp st(2),st(0)
;959:		jmp LSetSides
;960:Lcase6:
;961:		fmul dword ptr[ebx]
;962:		fld dword ptr[0+4+edx]
;963:		fxch st(2)
;964:		fmul dword ptr[ecx]
;965:		fxch st(2)
;966:		fld st(0)
;967:		fmul dword ptr[4+ecx]
;968:		fld dword ptr[0+8+edx]
;969:		fxch st(2)
;970:		fmul dword ptr[4+ebx]
;971:		fxch st(2)
;972:		fld st(0)
;973:		fmul dword ptr[8+ecx]
;974:		fxch st(5)
;975:		faddp st(3),st(0)
;976:		fmul dword ptr[8+ebx]
;977:		fxch st(1)
;978:		faddp st(3),st(0)
;979:		fxch st(3)
;980:		faddp st(2),st(0)
;981:		jmp LSetSides
;982:Lcase7:
;983:		fmul dword ptr[ecx]
;984:		fld dword ptr[0+4+edx]
;985:		fxch st(2)
;986:		fmul dword ptr[ebx]
;987:		fxch st(2)
;988:		fld st(0)
;989:		fmul dword ptr[4+ecx]
;990:		fld dword ptr[0+8+edx]
;991:		fxch st(2)
;992:		fmul dword ptr[4+ebx]
;993:		fxch st(2)
;994:		fld st(0)
;995:		fmul dword ptr[8+ecx]
;996:		fxch st(5)
;997:		faddp st(3),st(0)
;998:		fmul dword ptr[8+ebx]
;999:		fxch st(1)
;1000:		faddp st(3),st(0)
;1001:		fxch st(3)
;1002:		faddp st(2),st(0)
;1003:LSetSides:
;1004:		faddp st(2),st(0)
;1005:		fcomp dword ptr[12+edx]
;1006:		xor ecx,ecx
;1007:		fnstsw ax
;1008:		fcomp dword ptr[12+edx]
;1009:		and ah,1
;1010:		xor ah,1
;1011:		add cl,ah
;1012:		fnstsw ax
;1013:		and ah,1
;1014:		add ah,ah
;1015:		add cl,ah
;1016:		pop ebx
;1017:		mov eax,ecx
;1018:		ret
;1019:Lerror:
;1020:		int 3
;1021:	}
;1022:}
;1023:#pragma warning( default: 4035 )
;1024:
;1025:#endif
;1026:#endif
;1027:
;1028:/*
;1029:=================
;1030:RadiusFromBounds
;1031:=================
;1032:*/
;1033:float RadiusFromBounds( const vec3_t mins, const vec3_t maxs ) {
line 1038
;1034:	int		i;
;1035:	vec3_t	corner;
;1036:	float	a, b;
;1037:
;1038:	for (i=0 ; i<3 ; i++) {
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $261
line 1039
;1039:		a = fabs( mins[i] );
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 0
INDIRP4
ADDP4
INDIRF4
ARGF4
ADDRLP4 24
ADDRGP4 fabs
CALLF4
ASGNF4
ADDRLP4 4
ADDRLP4 24
INDIRF4
ASGNF4
line 1040
;1040:		b = fabs( maxs[i] );
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRF4
ARGF4
ADDRLP4 28
ADDRGP4 fabs
CALLF4
ASGNF4
ADDRLP4 8
ADDRLP4 28
INDIRF4
ASGNF4
line 1041
;1041:		corner[i] = a > b ? a : b;
ADDRLP4 4
INDIRF4
ADDRLP4 8
INDIRF4
LEF4 $266
ADDRLP4 32
ADDRLP4 4
INDIRF4
ASGNF4
ADDRGP4 $267
JUMPV
LABELV $266
ADDRLP4 32
ADDRLP4 8
INDIRF4
ASGNF4
LABELV $267
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 12
ADDP4
ADDRLP4 32
INDIRF4
ASGNF4
line 1042
;1042:	}
LABELV $262
line 1038
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 3
LTI4 $261
line 1044
;1043:
;1044:	return VectorLength (corner);
ADDRLP4 12
ARGP4
ADDRLP4 24
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 24
INDIRF4
RETF4
LABELV $260
endproc RadiusFromBounds 36 4
export ClearBounds
proc ClearBounds 16 0
line 1048
;1045:}
;1046:
;1047:
;1048:void ClearBounds( vec3_t mins, vec3_t maxs ) {
line 1049
;1049:	mins[0] = mins[1] = mins[2] = 99999;
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
CNSTF4 1203982208
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 4
INDIRF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 4
INDIRF4
ASGNF4
ADDRLP4 0
INDIRP4
ADDRLP4 4
INDIRF4
ASGNF4
line 1050
;1050:	maxs[0] = maxs[1] = maxs[2] = -99999;
ADDRLP4 8
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 12
CNSTF4 3351465856
ASGNF4
ADDRLP4 8
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 12
INDIRF4
ASGNF4
ADDRLP4 8
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 12
INDIRF4
ASGNF4
ADDRLP4 8
INDIRP4
ADDRLP4 12
INDIRF4
ASGNF4
line 1051
;1051:}
LABELV $268
endproc ClearBounds 16 0
export AddPointToBounds
proc AddPointToBounds 20 0
line 1053
;1052:
;1053:void AddPointToBounds( const vec3_t v, vec3_t mins, vec3_t maxs ) {
line 1054
;1054:	if ( v[0] < mins[0] ) {
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
INDIRF4
GEF4 $270
line 1055
;1055:		mins[0] = v[0];
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
line 1056
;1056:	}
LABELV $270
line 1057
;1057:	if ( v[0] > maxs[0]) {
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 8
INDIRP4
INDIRF4
LEF4 $272
line 1058
;1058:		maxs[0] = v[0];
ADDRFP4 8
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
line 1059
;1059:	}
LABELV $272
line 1061
;1060:
;1061:	if ( v[1] < mins[1] ) {
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
GEF4 $274
line 1062
;1062:		mins[1] = v[1];
ADDRLP4 4
CNSTI4 4
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1063
;1063:	}
LABELV $274
line 1064
;1064:	if ( v[1] > maxs[1]) {
ADDRLP4 4
CNSTI4 4
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
LEF4 $276
line 1065
;1065:		maxs[1] = v[1];
ADDRLP4 8
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1066
;1066:	}
LABELV $276
line 1068
;1067:
;1068:	if ( v[2] < mins[2] ) {
ADDRLP4 8
CNSTI4 8
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
GEF4 $278
line 1069
;1069:		mins[2] = v[2];
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1070
;1070:	}
LABELV $278
line 1071
;1071:	if ( v[2] > maxs[2]) {
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRFP4 8
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
LEF4 $280
line 1072
;1072:		maxs[2] = v[2];
ADDRLP4 16
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1073
;1073:	}
LABELV $280
line 1074
;1074:}
LABELV $269
endproc AddPointToBounds 20 0
export VectorNormalize
proc VectorNormalize 40 4
line 1077
;1075:
;1076:
;1077:vec_t VectorNormalize( vec3_t v ) {
line 1080
;1078:	float	length, ilength;
;1079:
;1080:	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
ADDRLP4 8
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 12
ADDRLP4 8
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 16
ADDRLP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 20
ADDRLP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDF4
ADDRLP4 20
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ADDF4
ASGNF4
line 1081
;1081:	length = sqrt (length);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 24
ADDRGP4 sqrt
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 24
INDIRF4
ASGNF4
line 1083
;1082:
;1083:	if ( length ) {
ADDRLP4 0
INDIRF4
CNSTF4 0
EQF4 $283
line 1084
;1084:		ilength = 1/length;
ADDRLP4 4
CNSTF4 1065353216
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 1085
;1085:		v[0] *= ilength;
ADDRLP4 28
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1086
;1086:		v[1] *= ilength;
ADDRLP4 32
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 32
INDIRP4
ADDRLP4 32
INDIRP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1087
;1087:		v[2] *= ilength;
ADDRLP4 36
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
ASGNP4
ADDRLP4 36
INDIRP4
ADDRLP4 36
INDIRP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1088
;1088:	}
LABELV $283
line 1090
;1089:		
;1090:	return length;
ADDRLP4 0
INDIRF4
RETF4
LABELV $282
endproc VectorNormalize 40 4
export VectorNormalize2
proc VectorNormalize2 36 4
line 1093
;1091:}
;1092:
;1093:vec_t VectorNormalize2( const vec3_t v, vec3_t out) {
line 1096
;1094:	float	length, ilength;
;1095:
;1096:	length = v[0]*v[0] + v[1]*v[1] + v[2]*v[2];
ADDRLP4 8
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 12
ADDRLP4 8
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 16
ADDRLP4 8
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 20
ADDRLP4 8
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDF4
ADDRLP4 20
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ADDF4
ASGNF4
line 1097
;1097:	length = sqrt (length);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 24
ADDRGP4 sqrt
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 24
INDIRF4
ASGNF4
line 1099
;1098:
;1099:	if (length)
ADDRLP4 0
INDIRF4
CNSTF4 0
EQF4 $286
line 1100
;1100:	{
line 1104
;1101:#ifndef Q3_VM // bk0101022 - FPE related
;1102://	  assert( ((Q_fabs(v[0])!=0.0f) || (Q_fabs(v[1])!=0.0f) || (Q_fabs(v[2])!=0.0f)) );
;1103:#endif
;1104:		ilength = 1/length;
ADDRLP4 4
CNSTF4 1065353216
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 1105
;1105:		out[0] = v[0]*ilength;
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1106
;1106:		out[1] = v[1]*ilength;
ADDRLP4 28
CNSTI4 4
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 28
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 28
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1107
;1107:		out[2] = v[2]*ilength;
ADDRLP4 32
CNSTI4 8
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1108
;1108:	} else {
ADDRGP4 $287
JUMPV
LABELV $286
line 1112
;1109:#ifndef Q3_VM // bk0101022 - FPE related
;1110://	  assert( ((Q_fabs(v[0])==0.0f) && (Q_fabs(v[1])==0.0f) && (Q_fabs(v[2])==0.0f)) );
;1111:#endif
;1112:		VectorClear( out );
ADDRLP4 28
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 32
CNSTF4 0
ASGNF4
ADDRLP4 28
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 32
INDIRF4
ASGNF4
ADDRLP4 28
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 32
INDIRF4
ASGNF4
ADDRLP4 28
INDIRP4
ADDRLP4 32
INDIRF4
ASGNF4
line 1113
;1113:	}
LABELV $287
line 1115
;1114:		
;1115:	return length;
ADDRLP4 0
INDIRF4
RETF4
LABELV $285
endproc VectorNormalize2 36 4
export _VectorMA
proc _VectorMA 8 0
line 1119
;1116:
;1117:}
;1118:
;1119:void _VectorMA( const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc) {
line 1120
;1120:	vecc[0] = veca[0] + scale*vecb[0];
ADDRFP4 12
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 4
INDIRF4
ADDRFP4 8
INDIRP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1121
;1121:	vecc[1] = veca[1] + scale*vecb[1];
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 12
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1122
;1122:	vecc[2] = veca[2] + scale*vecb[2];
ADDRLP4 4
CNSTI4 8
ASGNI4
ADDRFP4 12
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1123
;1123:}
LABELV $288
endproc _VectorMA 8 0
export _DotProduct
proc _DotProduct 16 0
line 1126
;1124:
;1125:
;1126:vec_t _DotProduct( const vec3_t v1, const vec3_t v2 ) {
line 1127
;1127:	return v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2];
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 8
CNSTI4 4
ASGNI4
ADDRLP4 12
CNSTI4 8
ASGNI4
ADDRLP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRP4
INDIRF4
MULF4
ADDRLP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 0
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
RETF4
LABELV $289
endproc _DotProduct 16 0
export _VectorSubtract
proc _VectorSubtract 8 0
line 1130
;1128:}
;1129:
;1130:void _VectorSubtract( const vec3_t veca, const vec3_t vecb, vec3_t out ) {
line 1131
;1131:	out[0] = veca[0]-vecb[0];
ADDRFP4 8
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
INDIRF4
SUBF4
ASGNF4
line 1132
;1132:	out[1] = veca[1]-vecb[1];
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
line 1133
;1133:	out[2] = veca[2]-vecb[2];
ADDRLP4 4
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
SUBF4
ASGNF4
line 1134
;1134:}
LABELV $290
endproc _VectorSubtract 8 0
export _VectorAdd
proc _VectorAdd 8 0
line 1136
;1135:
;1136:void _VectorAdd( const vec3_t veca, const vec3_t vecb, vec3_t out ) {
line 1137
;1137:	out[0] = veca[0]+vecb[0];
ADDRFP4 8
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 4
INDIRP4
INDIRF4
ADDF4
ASGNF4
line 1138
;1138:	out[1] = veca[1]+vecb[1];
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDF4
ASGNF4
line 1139
;1139:	out[2] = veca[2]+vecb[2];
ADDRLP4 4
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDF4
ASGNF4
line 1140
;1140:}
LABELV $291
endproc _VectorAdd 8 0
export _VectorCopy
proc _VectorCopy 8 0
line 1142
;1141:
;1142:void _VectorCopy( const vec3_t in, vec3_t out ) {
line 1143
;1143:	out[0] = in[0];
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
line 1144
;1144:	out[1] = in[1];
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1145
;1145:	out[2] = in[2];
ADDRLP4 4
CNSTI4 8
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1146
;1146:}
LABELV $292
endproc _VectorCopy 8 0
export _VectorScale
proc _VectorScale 8 0
line 1148
;1147:
;1148:void _VectorScale( const vec3_t in, vec_t scale, vec3_t out ) {
line 1149
;1149:	out[0] = in[0]*scale;
ADDRFP4 8
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1150
;1150:	out[1] = in[1]*scale;
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1151
;1151:	out[2] = in[2]*scale;
ADDRLP4 4
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1152
;1152:}
LABELV $293
endproc _VectorScale 8 0
export Vector4Scale
proc Vector4Scale 12 0
line 1154
;1153:
;1154:void Vector4Scale( const vec4_t in, vec_t scale, vec4_t out ) {
line 1155
;1155:	out[0] = in[0]*scale;
ADDRFP4 8
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1156
;1156:	out[1] = in[1]*scale;
ADDRLP4 0
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1157
;1157:	out[2] = in[2]*scale;
ADDRLP4 4
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1158
;1158:	out[3] = in[3]*scale;
ADDRLP4 8
CNSTI4 12
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1159
;1159:}
LABELV $294
endproc Vector4Scale 12 0
export Q_log2
proc Q_log2 8 0
line 1162
;1160:
;1161:
;1162:int Q_log2( int val ) {
line 1165
;1163:	int answer;
;1164:
;1165:	answer = 0;
ADDRLP4 0
CNSTI4 0
ASGNI4
ADDRGP4 $297
JUMPV
LABELV $296
line 1166
;1166:	while ( ( val>>=1 ) != 0 ) {
line 1167
;1167:		answer++;
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
line 1168
;1168:	}
LABELV $297
line 1166
ADDRLP4 4
ADDRFP4 0
INDIRI4
CNSTI4 1
RSHI4
ASGNI4
ADDRFP4 0
ADDRLP4 4
INDIRI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 0
NEI4 $296
line 1169
;1169:	return answer;
ADDRLP4 0
INDIRI4
RETI4
LABELV $295
endproc Q_log2 8 0
export MatrixMultiply
proc MatrixMultiply 104 0
line 1198
;1170:}
;1171:
;1172:
;1173:
;1174:/*
;1175:=================
;1176:PlaneTypeForNormal
;1177:=================
;1178:*/
;1179:/*
;1180:int	PlaneTypeForNormal (vec3_t normal) {
;1181:	if ( normal[0] == 1.0 )
;1182:		return PLANE_X;
;1183:	if ( normal[1] == 1.0 )
;1184:		return PLANE_Y;
;1185:	if ( normal[2] == 1.0 )
;1186:		return PLANE_Z;
;1187:	
;1188:	return PLANE_NON_AXIAL;
;1189:}
;1190:*/
;1191:
;1192:
;1193:/*
;1194:================
;1195:MatrixMultiply
;1196:================
;1197:*/
;1198:void MatrixMultiply(float in1[3][3], float in2[3][3], float out[3][3]) {
line 1199
;1199:	out[0][0] = in1[0][0] * in2[0][0] + in1[0][1] * in2[1][0] +
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRP4
INDIRF4
MULF4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 4
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1201
;1200:				in1[0][2] * in2[2][0];
;1201:	out[0][1] = in1[0][0] * in2[0][1] + in1[0][1] * in2[1][1] +
ADDRLP4 8
CNSTI4 4
ASGNI4
ADDRLP4 12
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 16
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
ADDRLP4 12
INDIRP4
INDIRF4
ADDRLP4 16
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 12
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ADDRLP4 16
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 12
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 16
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1203
;1202:				in1[0][2] * in2[2][1];
;1203:	out[0][2] = in1[0][0] * in2[0][2] + in1[0][1] * in2[1][2] +
ADDRLP4 20
CNSTI4 8
ASGNI4
ADDRLP4 24
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 28
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
ADDRLP4 24
INDIRP4
INDIRF4
ADDRLP4 28
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 24
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 28
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 24
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
ADDRLP4 28
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1205
;1204:				in1[0][2] * in2[2][2];
;1205:	out[1][0] = in1[1][0] * in2[0][0] + in1[1][1] * in2[1][0] +
ADDRLP4 32
CNSTI4 12
ASGNI4
ADDRLP4 36
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 40
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
ADDRLP4 36
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
INDIRF4
MULF4
ADDRLP4 36
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 36
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1207
;1206:				in1[1][2] * in2[2][0];
;1207:	out[1][1] = in1[1][0] * in2[0][1] + in1[1][1] * in2[1][1] +
ADDRLP4 44
CNSTI4 16
ASGNI4
ADDRLP4 48
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 52
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
ADDRLP4 48
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ADDRLP4 48
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
ADDRLP4 44
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 48
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1209
;1208:				in1[1][2] * in2[2][1];
;1209:	out[1][2] = in1[1][0] * in2[0][2] + in1[1][1] * in2[1][2] +
ADDRLP4 56
CNSTI4 20
ASGNI4
ADDRLP4 60
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 64
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
ADDRLP4 60
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 64
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ADDRLP4 60
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
ADDRLP4 64
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 60
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
ADDRLP4 64
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1211
;1210:				in1[1][2] * in2[2][2];
;1211:	out[2][0] = in1[2][0] * in2[0][0] + in1[2][1] * in2[1][0] +
ADDRLP4 68
CNSTI4 24
ASGNI4
ADDRLP4 72
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 76
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
ADDRLP4 72
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRF4
ADDRLP4 76
INDIRP4
INDIRF4
MULF4
ADDRLP4 72
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
ADDRLP4 76
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 72
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
ADDRLP4 76
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1213
;1212:				in1[2][2] * in2[2][0];
;1213:	out[2][1] = in1[2][0] * in2[0][1] + in1[2][1] * in2[1][1] +
ADDRLP4 80
CNSTI4 28
ASGNI4
ADDRLP4 84
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 88
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 80
INDIRI4
ADDP4
ADDRLP4 84
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
ADDRLP4 88
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ADDRLP4 84
INDIRP4
ADDRLP4 80
INDIRI4
ADDP4
INDIRF4
ADDRLP4 88
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 84
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
ADDRLP4 88
INDIRP4
ADDRLP4 80
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1215
;1214:				in1[2][2] * in2[2][1];
;1215:	out[2][2] = in1[2][0] * in2[0][2] + in1[2][1] * in2[1][2] +
ADDRLP4 92
CNSTI4 32
ASGNI4
ADDRLP4 96
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 100
ADDRFP4 4
INDIRP4
ASGNP4
ADDRFP4 8
INDIRP4
ADDRLP4 92
INDIRI4
ADDP4
ADDRLP4 96
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
ADDRLP4 100
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ADDRLP4 96
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
ADDRLP4 100
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 96
INDIRP4
ADDRLP4 92
INDIRI4
ADDP4
INDIRF4
ADDRLP4 100
INDIRP4
ADDRLP4 92
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1217
;1216:				in1[2][2] * in2[2][2];
;1217:}
LABELV $299
endproc MatrixMultiply 104 0
export RotationMatrixAroundDir
proc RotationMatrixAroundDir 112 4
line 1220
;1218:
;1219:// adnan
;1220:void RotationMatrixAroundDir(vec3_t dir, float radians, float r[3][3]) {
line 1225
;1221:   float mag;
;1222:   float ux, uy, uz; // direction cosines...
;1223:   int i, j;
;1224:   
;1225:   radians *= -1;
ADDRFP4 4
CNSTF4 3212836864
ADDRFP4 4
INDIRF4
MULF4
ASGNF4
line 1226
;1226:   mag = VectorLength(dir);
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 24
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 20
ADDRLP4 24
INDIRF4
ASGNF4
line 1228
;1227:
;1228:   for(i = 0; i < 3; i++) {
ADDRLP4 4
CNSTI4 0
ASGNI4
LABELV $301
line 1229
;1229:      for(j = 0; j < 3; j++) {
ADDRLP4 0
CNSTI4 0
ASGNI4
LABELV $305
line 1230
;1230:         if(i == j)
ADDRLP4 4
INDIRI4
ADDRLP4 0
INDIRI4
NEI4 $309
line 1231
;1231:            r[i][j] = 1;
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
CNSTI4 12
ADDRLP4 4
INDIRI4
MULI4
ADDRFP4 8
INDIRP4
ADDP4
ADDP4
CNSTF4 1065353216
ASGNF4
ADDRGP4 $310
JUMPV
LABELV $309
line 1233
;1232:         else
;1233:            r[i][j] = 0;
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
CNSTI4 12
ADDRLP4 4
INDIRI4
MULI4
ADDRFP4 8
INDIRP4
ADDP4
ADDP4
CNSTF4 0
ASGNF4
LABELV $310
line 1234
;1234:      }
LABELV $306
line 1229
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 0
INDIRI4
CNSTI4 3
LTI4 $305
line 1235
;1235:   }
LABELV $302
line 1228
ADDRLP4 4
ADDRLP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 4
INDIRI4
CNSTI4 3
LTI4 $301
line 1237
;1236:
;1237:   if(mag <= 0.0001)
ADDRLP4 20
INDIRF4
CNSTF4 953267991
GTF4 $311
line 1238
;1238:      return;
ADDRGP4 $300
JUMPV
LABELV $311
line 1240
;1239:
;1240:   ux = dir[0] / mag;
ADDRLP4 8
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 20
INDIRF4
DIVF4
ASGNF4
line 1241
;1241:   uy = dir[1] / mag;
ADDRLP4 12
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 20
INDIRF4
DIVF4
ASGNF4
line 1242
;1242:   uz = dir[2] / mag;
ADDRLP4 16
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 20
INDIRF4
DIVF4
ASGNF4
line 1244
;1243:
;1244:   r[0][0] = (ux * ux) * (1 - cos(radians)) + cos(radians);
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 28
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 32
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
ADDRLP4 8
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 28
INDIRF4
SUBF4
MULF4
ADDRLP4 32
INDIRF4
ADDF4
ASGNF4
line 1245
;1245:   r[0][1] = (ux * uy) * (1 - cos(radians)) - (uz * sin(radians));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 40
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 44
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 40
INDIRF4
SUBF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 44
INDIRF4
MULF4
SUBF4
ASGNF4
line 1246
;1246:   r[0][2] = (ux * uz) * (1 - cos(radians)) + (uy * sin(radians));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 48
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 52
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 8
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 48
INDIRF4
SUBF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 52
INDIRF4
MULF4
ADDF4
ASGNF4
line 1247
;1247:   r[1][0] = (ux * uy) * (1 - cos(radians)) + (uz * sin(radians));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 56
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 60
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 12
ADDP4
ADDRLP4 8
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 56
INDIRF4
SUBF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 60
INDIRF4
MULF4
ADDF4
ASGNF4
line 1248
;1248:   r[1][1] = (uy * uy) * (1 - cos(radians)) + cos(radians);
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 64
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 68
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 16
ADDP4
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 64
INDIRF4
SUBF4
MULF4
ADDRLP4 68
INDIRF4
ADDF4
ASGNF4
line 1249
;1249:   r[1][2] = (uy * uz) * (1 - cos(radians)) - (ux * sin(radians));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 76
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 80
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 20
ADDP4
ADDRLP4 12
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 76
INDIRF4
SUBF4
MULF4
ADDRLP4 8
INDIRF4
ADDRLP4 80
INDIRF4
MULF4
SUBF4
ASGNF4
line 1250
;1250:   r[2][0] = (ux * uz) * (1 - cos(radians)) - (uy * sin(radians));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 84
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 88
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 24
ADDP4
ADDRLP4 8
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 84
INDIRF4
SUBF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 88
INDIRF4
MULF4
SUBF4
ASGNF4
line 1251
;1251:   r[2][1] = (uy * uz) * (1 - cos(radians)) + (ux * sin(radians));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 92
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 96
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 28
ADDP4
ADDRLP4 12
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 92
INDIRF4
SUBF4
MULF4
ADDRLP4 8
INDIRF4
ADDRLP4 96
INDIRF4
MULF4
ADDF4
ASGNF4
line 1252
;1252:   r[2][2] = (uz * uz) * (1 - cos(radians)) + cos(radians);
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 100
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 104
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 32
ADDP4
ADDRLP4 16
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
CNSTF4 1065353216
ADDRLP4 100
INDIRF4
SUBF4
MULF4
ADDRLP4 104
INDIRF4
ADDF4
ASGNF4
line 1254
;1253:
;1254:}
LABELV $300
endproc RotationMatrixAroundDir 112 4
bss
align 4
LABELV $314
skip 4
align 4
LABELV $315
skip 4
align 4
LABELV $316
skip 4
align 4
LABELV $317
skip 4
align 4
LABELV $318
skip 4
align 4
LABELV $319
skip 4
export AngleVectors
code
proc AngleVectors 36 4
line 1256
;1255:
;1256:void AngleVectors( const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up) {
line 1261
;1257:	float		angle;
;1258:	static float		sr, sp, sy, cr, cp, cy;
;1259:	// static to help MS compiler fp bugs
;1260:
;1261:	angle = angles[YAW] * (M_PI*2 / 360);
ADDRLP4 0
CNSTF4 1016003125
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
ASGNF4
line 1262
;1262:	sy = sin(angle);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 sin
CALLF4
ASGNF4
ADDRGP4 $316
ADDRLP4 4
INDIRF4
ASGNF4
line 1263
;1263:	cy = cos(angle);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 8
ADDRGP4 cos
CALLF4
ASGNF4
ADDRGP4 $319
ADDRLP4 8
INDIRF4
ASGNF4
line 1264
;1264:	angle = angles[PITCH] * (M_PI*2 / 360);
ADDRLP4 0
CNSTF4 1016003125
ADDRFP4 0
INDIRP4
INDIRF4
MULF4
ASGNF4
line 1265
;1265:	sp = sin(angle);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 12
ADDRGP4 sin
CALLF4
ASGNF4
ADDRGP4 $315
ADDRLP4 12
INDIRF4
ASGNF4
line 1266
;1266:	cp = cos(angle);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 16
ADDRGP4 cos
CALLF4
ASGNF4
ADDRGP4 $318
ADDRLP4 16
INDIRF4
ASGNF4
line 1267
;1267:	angle = angles[ROLL] * (M_PI*2 / 360);
ADDRLP4 0
CNSTF4 1016003125
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ASGNF4
line 1268
;1268:	sr = sin(angle);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 20
ADDRGP4 sin
CALLF4
ASGNF4
ADDRGP4 $314
ADDRLP4 20
INDIRF4
ASGNF4
line 1269
;1269:	cr = cos(angle);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 24
ADDRGP4 cos
CALLF4
ASGNF4
ADDRGP4 $317
ADDRLP4 24
INDIRF4
ASGNF4
line 1271
;1270:
;1271:	if (forward)
ADDRFP4 4
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $320
line 1272
;1272:	{
line 1273
;1273:		forward[0] = cp*cy;
ADDRFP4 4
INDIRP4
ADDRGP4 $318
INDIRF4
ADDRGP4 $319
INDIRF4
MULF4
ASGNF4
line 1274
;1274:		forward[1] = cp*sy;
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRGP4 $318
INDIRF4
ADDRGP4 $316
INDIRF4
MULF4
ASGNF4
line 1275
;1275:		forward[2] = -sp;
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
ADDRGP4 $315
INDIRF4
NEGF4
ASGNF4
line 1276
;1276:	}
LABELV $320
line 1277
;1277:	if (right)
ADDRFP4 8
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $322
line 1278
;1278:	{
line 1279
;1279:		right[0] = (-1*sr*sp*cy+-1*cr*-sy);
ADDRLP4 28
CNSTF4 3212836864
ASGNF4
ADDRFP4 8
INDIRP4
ADDRLP4 28
INDIRF4
ADDRGP4 $314
INDIRF4
MULF4
ADDRGP4 $315
INDIRF4
MULF4
ADDRGP4 $319
INDIRF4
MULF4
ADDRLP4 28
INDIRF4
ADDRGP4 $317
INDIRF4
MULF4
ADDRGP4 $316
INDIRF4
NEGF4
MULF4
ADDF4
ASGNF4
line 1280
;1280:		right[1] = (-1*sr*sp*sy+-1*cr*cy);
ADDRLP4 32
CNSTF4 3212836864
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 32
INDIRF4
ADDRGP4 $314
INDIRF4
MULF4
ADDRGP4 $315
INDIRF4
MULF4
ADDRGP4 $316
INDIRF4
MULF4
ADDRLP4 32
INDIRF4
ADDRGP4 $317
INDIRF4
MULF4
ADDRGP4 $319
INDIRF4
MULF4
ADDF4
ASGNF4
line 1281
;1281:		right[2] = -1*sr*cp;
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
CNSTF4 3212836864
ADDRGP4 $314
INDIRF4
MULF4
ADDRGP4 $318
INDIRF4
MULF4
ASGNF4
line 1282
;1282:	}
LABELV $322
line 1283
;1283:	if (up)
ADDRFP4 12
INDIRP4
CVPU4 4
CNSTU4 0
EQU4 $324
line 1284
;1284:	{
line 1285
;1285:		up[0] = (cr*sp*cy+-sr*-sy);
ADDRFP4 12
INDIRP4
ADDRGP4 $317
INDIRF4
ADDRGP4 $315
INDIRF4
MULF4
ADDRGP4 $319
INDIRF4
MULF4
ADDRGP4 $314
INDIRF4
NEGF4
ADDRGP4 $316
INDIRF4
NEGF4
MULF4
ADDF4
ASGNF4
line 1286
;1286:		up[1] = (cr*sp*sy+-sr*cy);
ADDRFP4 12
INDIRP4
CNSTI4 4
ADDP4
ADDRGP4 $317
INDIRF4
ADDRGP4 $315
INDIRF4
MULF4
ADDRGP4 $316
INDIRF4
MULF4
ADDRGP4 $314
INDIRF4
NEGF4
ADDRGP4 $319
INDIRF4
MULF4
ADDF4
ASGNF4
line 1287
;1287:		up[2] = cr*cp;
ADDRFP4 12
INDIRP4
CNSTI4 8
ADDP4
ADDRGP4 $317
INDIRF4
ADDRGP4 $318
INDIRF4
MULF4
ASGNF4
line 1288
;1288:	}
LABELV $324
line 1289
;1289:}
LABELV $313
endproc AngleVectors 36 4
export PerpendicularVector
proc PerpendicularVector 36 12
line 1295
;1290:
;1291:/*
;1292:** assumes "src" is normalized
;1293:*/
;1294:void PerpendicularVector( vec3_t dst, const vec3_t src )
;1295:{
line 1298
;1296:	int	pos;
;1297:	int i;
;1298:	float minelem = 1.0F;
ADDRLP4 4
CNSTF4 1065353216
ASGNF4
line 1304
;1299:	vec3_t tempvec;
;1300:
;1301:	/*
;1302:	** find the smallest magnitude axially aligned vector
;1303:	*/
;1304:	for ( pos = 0, i = 0; i < 3; i++ )
ADDRLP4 24
CNSTI4 0
ASGNI4
ADDRLP4 8
ADDRLP4 24
INDIRI4
ASGNI4
ADDRLP4 0
ADDRLP4 24
INDIRI4
ASGNI4
ADDRGP4 $330
JUMPV
LABELV $327
line 1305
;1305:	{
line 1306
;1306:		if ( fabs( src[i] ) < minelem )
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRF4
ARGF4
ADDRLP4 28
ADDRGP4 fabs
CALLF4
ASGNF4
ADDRLP4 28
INDIRF4
ADDRLP4 4
INDIRF4
GEF4 $331
line 1307
;1307:		{
line 1308
;1308:			pos = i;
ADDRLP4 8
ADDRLP4 0
INDIRI4
ASGNI4
line 1309
;1309:			minelem = fabs( src[i] );
ADDRLP4 0
INDIRI4
CNSTI4 2
LSHI4
ADDRFP4 4
INDIRP4
ADDP4
INDIRF4
ARGF4
ADDRLP4 32
ADDRGP4 fabs
CALLF4
ASGNF4
ADDRLP4 4
ADDRLP4 32
INDIRF4
ASGNF4
line 1310
;1310:		}
LABELV $331
line 1311
;1311:	}
LABELV $328
line 1304
ADDRLP4 0
ADDRLP4 0
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
LABELV $330
ADDRLP4 0
INDIRI4
CNSTI4 3
LTI4 $327
line 1312
;1312:	tempvec[0] = tempvec[1] = tempvec[2] = 0.0F;
ADDRLP4 28
CNSTF4 0
ASGNF4
ADDRLP4 12+8
ADDRLP4 28
INDIRF4
ASGNF4
ADDRLP4 12+4
ADDRLP4 28
INDIRF4
ASGNF4
ADDRLP4 12
ADDRLP4 28
INDIRF4
ASGNF4
line 1313
;1313:	tempvec[pos] = 1.0F;
ADDRLP4 8
INDIRI4
CNSTI4 2
LSHI4
ADDRLP4 12
ADDP4
CNSTF4 1065353216
ASGNF4
line 1318
;1314:
;1315:	/*
;1316:	** project the point onto the plane defined by src
;1317:	*/
;1318:	ProjectPointOnPlane( dst, tempvec, src );
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 12
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 ProjectPointOnPlane
CALLV
pop
line 1323
;1319:
;1320:	/*
;1321:	** normalize the result
;1322:	*/
;1323:	VectorNormalize( dst );
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 VectorNormalize
CALLF4
pop
line 1324
;1324:}
LABELV $326
endproc PerpendicularVector 36 12
data
align 4
LABELV holdrand
byte 4 2309737967
export Rand_Init
code
proc Rand_Init 0 0
line 1336
;1325:
;1326:// This is the VC libc version of rand() without multiple seeds per thread or 12 levels
;1327:// of subroutine calls.
;1328:// Both calls have been designed to minimise the inherent number of float <--> int 
;1329:// conversions and the additional math required to get the desired value.
;1330:// eg the typical tint = (rand() * 255) / 32768
;1331:// becomes tint = irand(0, 255)
;1332:
;1333:static unsigned long	holdrand = 0x89abcdef;
;1334:
;1335:void Rand_Init(int seed)
;1336:{
line 1337
;1337:	holdrand = seed;
ADDRGP4 holdrand
ADDRFP4 0
INDIRI4
CVIU4 4
ASGNU4
line 1338
;1338:}
LABELV $335
endproc Rand_Init 0 0
export flrand
proc flrand 16 0
line 1343
;1339:
;1340:// Returns a float min <= x < max (exclusive; will get max - 0.00001; but never max)
;1341:
;1342:float flrand(float min, float max)
;1343:{
line 1346
;1344:	float	result;
;1345:
;1346:	assert((max - min) < 32768);
line 1348
;1347:
;1348:	holdrand = (holdrand * 214013L) + 2531011L;
ADDRLP4 4
ADDRGP4 holdrand
ASGNP4
ADDRLP4 4
INDIRP4
CNSTU4 214013
ADDRLP4 4
INDIRP4
INDIRU4
MULU4
CNSTU4 2531011
ADDU4
ASGNU4
line 1349
;1349:	result = (float)(holdrand >> 17);						// 0 - 32767 range
ADDRLP4 8
ADDRGP4 holdrand
INDIRU4
CNSTI4 17
RSHU4
ASGNU4
ADDRLP4 0
CNSTF4 1073741824
ADDRLP4 8
INDIRU4
CNSTI4 1
RSHU4
CVUI4 4
CVIF4 4
MULF4
ADDRLP4 8
INDIRU4
CNSTU4 1
BANDU4
CVUI4 4
CVIF4 4
ADDF4
ASGNF4
line 1350
;1350:	result = ((result * (max - min)) / 32768.0F) + min;
ADDRLP4 12
ADDRFP4 0
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 0
INDIRF4
ADDRFP4 4
INDIRF4
ADDRLP4 12
INDIRF4
SUBF4
MULF4
CNSTF4 1191182336
DIVF4
ADDRLP4 12
INDIRF4
ADDF4
ASGNF4
line 1352
;1351:
;1352:	return(result);
ADDRLP4 0
INDIRF4
RETF4
LABELV $336
endproc flrand 16 0
export irand
proc irand 12 0
line 1358
;1353:}
;1354:
;1355:// Returns an integer min <= x <= max (ie inclusive)
;1356:
;1357:int irand(int min, int max)
;1358:{
line 1361
;1359:	int		result;
;1360:
;1361:	assert((max - min) < 32768);
line 1363
;1362:
;1363:	max++;
ADDRFP4 4
ADDRFP4 4
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
line 1364
;1364:	holdrand = (holdrand * 214013L) + 2531011L;
ADDRLP4 4
ADDRGP4 holdrand
ASGNP4
ADDRLP4 4
INDIRP4
CNSTU4 214013
ADDRLP4 4
INDIRP4
INDIRU4
MULU4
CNSTU4 2531011
ADDU4
ASGNU4
line 1365
;1365:	result = holdrand >> 17;
ADDRLP4 0
ADDRGP4 holdrand
INDIRU4
CNSTI4 17
RSHU4
CVUI4 4
ASGNI4
line 1366
;1366:	result = ((result * (max - min)) >> 15) + min;
ADDRLP4 8
ADDRFP4 0
INDIRI4
ASGNI4
ADDRLP4 0
ADDRLP4 0
INDIRI4
ADDRFP4 4
INDIRI4
ADDRLP4 8
INDIRI4
SUBI4
MULI4
CNSTI4 15
RSHI4
ADDRLP4 8
INDIRI4
ADDI4
ASGNI4
line 1367
;1367:	return(result);
ADDRLP4 0
INDIRI4
RETI4
LABELV $337
endproc irand 12 0
export powf
proc powf 8 0
line 1371
;1368:}
;1369:
;1370:float powf ( float x, int y )
;1371:{
line 1372
;1372:	float r = x;
ADDRLP4 0
ADDRFP4 0
INDIRF4
ASGNF4
line 1373
;1373:	for ( y--; y>0; y-- )
ADDRFP4 4
ADDRFP4 4
INDIRI4
CNSTI4 1
SUBI4
ASGNI4
ADDRGP4 $342
JUMPV
LABELV $339
line 1374
;1374:		r = r * r;
ADDRLP4 0
ADDRLP4 0
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
LABELV $340
line 1373
ADDRFP4 4
ADDRFP4 4
INDIRI4
CNSTI4 1
SUBI4
ASGNI4
LABELV $342
ADDRFP4 4
INDIRI4
CNSTI4 0
GTI4 $339
line 1375
;1375:	return r;
ADDRLP4 0
INDIRF4
RETF4
LABELV $338
endproc powf 8 0
export Quaternion
proc Quaternion 28 4
line 1382
;1376:}
;1377:
;1378:// adnan
;1379:///////////////////
;1380:// begin quat stuff
;1381:///////////////////
;1382:void Quaternion(vec3_t dir, double rads, quat_t *q) {
line 1383
;1383:   float sr = sin( rads / 2 );
ADDRFP4 4
INDIRF4
CNSTF4 1073741824
DIVF4
ARGF4
ADDRLP4 8
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 8
INDIRF4
ASGNF4
line 1384
;1384:   float mag = VectorLength(dir);
ADDRFP4 0
INDIRP4
ARGP4
ADDRLP4 12
ADDRGP4 VectorLength
CALLF4
ASGNF4
ADDRLP4 4
ADDRLP4 12
INDIRF4
ASGNF4
line 1385
;1385:   q->w = cos( rads / 2 );
ADDRFP4 4
INDIRF4
CNSTF4 1073741824
DIVF4
ARGF4
ADDRLP4 16
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRP4
CNSTI4 12
ADDP4
ADDRLP4 16
INDIRF4
ASGNF4
line 1386
;1386:   q->x = dir[0]/mag * sr;
ADDRFP4 8
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRF4
DIVF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1387
;1387:   q->y = dir[1]/mag * sr;
ADDRLP4 20
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 20
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
DIVF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1388
;1388:   q->z = dir[2]/mag * sr;
ADDRLP4 24
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
DIVF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1389
;1389:}
LABELV $343
endproc Quaternion 28 4
export QuaternionIdentity
proc QuaternionIdentity 8 0
line 1391
;1390:
;1391:void QuaternionIdentity(quat_t *q) {
line 1392
;1392:   q->w = 1;
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
CNSTF4 1065353216
ASGNF4
line 1393
;1393:   q->x = q->y = q->z = 0;
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
CNSTF4 0
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 4
INDIRF4
ASGNF4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 4
INDIRF4
ASGNF4
ADDRLP4 0
INDIRP4
ADDRLP4 4
INDIRF4
ASGNF4
line 1394
;1394:}
LABELV $344
endproc QuaternionIdentity 8 0
export QuaternionConjugate
proc QuaternionConjugate 28 8
line 1396
;1395:
;1396:void QuaternionConjugate(quat_t a, quat_t *q) {
line 1397
;1397:   QuaternionNormalize(&a);
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 QuaternionNormalize
CALLF4
pop
line 1398
;1398:   QuaternionCopy(a, q);
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRB
ASGNB 16
ADDRLP4 0
ARGP4
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 QuaternionCopy
CALLV
pop
line 1399
;1399:   q->x *= -1;
ADDRLP4 16
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 16
INDIRP4
CNSTF4 3212836864
ADDRLP4 16
INDIRP4
INDIRF4
MULF4
ASGNF4
line 1400
;1400:   q->y *= -1;
ADDRLP4 20
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 20
INDIRP4
CNSTF4 3212836864
ADDRLP4 20
INDIRP4
INDIRF4
MULF4
ASGNF4
line 1401
;1401:   q->z *= -1;
ADDRLP4 24
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
ASGNP4
ADDRLP4 24
INDIRP4
CNSTF4 3212836864
ADDRLP4 24
INDIRP4
INDIRF4
MULF4
ASGNF4
line 1402
;1402:}
LABELV $345
endproc QuaternionConjugate 28 8
export QuaternionCopy
proc QuaternionCopy 12 0
line 1404
;1403:
;1404:void QuaternionCopy(quat_t a, quat_t *b) {
line 1405
;1405:   b->w = a.w;
ADDRLP4 0
CNSTI4 12
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1406
;1406:   b->x = a.x;
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
line 1407
;1407:   b->y = a.y;
ADDRLP4 4
CNSTI4 4
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 4
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1408
;1408:   b->z = a.z;
ADDRLP4 8
CNSTI4 8
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 8
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1409
;1409:}
LABELV $346
endproc QuaternionCopy 12 0
export QuaternionFromTieFloats
proc QuaternionFromTieFloats 0 0
line 1411
;1410:
;1411:void QuaternionFromTieFloats(float *tieFloats, quat_t *q) {
line 1412
;1412:   q->w = tieFloats[Q_W];
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
ASGNF4
line 1413
;1413:   q->x = tieFloats[Q_X];
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
ASGNF4
line 1414
;1414:   q->y = tieFloats[Q_Y];
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 36
ADDP4
INDIRF4
ASGNF4
line 1415
;1415:   q->z = tieFloats[Q_Z];
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 40
ADDP4
INDIRF4
ASGNF4
line 1416
;1416:}
LABELV $347
endproc QuaternionFromTieFloats 0 0
export QuaternionToTieFloats
proc QuaternionToTieFloats 0 0
line 1418
;1417:
;1418:void QuaternionToTieFloats(float *tieFloats, quat_t *q) {
line 1419
;1419:   tieFloats[Q_W] = q->w;
ADDRFP4 0
INDIRP4
CNSTI4 28
ADDP4
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ASGNF4
line 1420
;1420:   tieFloats[Q_X] = q->x;
ADDRFP4 0
INDIRP4
CNSTI4 32
ADDP4
ADDRFP4 4
INDIRP4
INDIRF4
ASGNF4
line 1421
;1421:   tieFloats[Q_Y] = q->y;
ADDRFP4 0
INDIRP4
CNSTI4 36
ADDP4
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
line 1422
;1422:   tieFloats[Q_Z] = q->z;
ADDRFP4 0
INDIRP4
CNSTI4 40
ADDP4
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
line 1423
;1423:}
LABELV $348
endproc QuaternionToTieFloats 0 0
export AnglesFromTieFloats
proc AnglesFromTieFloats 4 0
line 1425
;1424:
;1425:void AnglesFromTieFloats(float *tieFloats, vec3_t *angles) {
line 1426
;1426:   *angles[PITCH] = tieFloats[PREV_ANGLES_PITCH];
ADDRFP4 4
INDIRP4
ADDRFP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
ASGNF4
line 1427
;1427:   *angles[YAW] = tieFloats[PREV_ANGLES_YAW];
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ADDRFP4 0
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
ASGNF4
line 1428
;1428:   *angles[ROLL] = tieFloats[PREV_ANGLES_ROLL];
ADDRLP4 0
CNSTI4 24
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1429
;1429:}
LABELV $349
endproc AnglesFromTieFloats 4 0
export AnglesToTieFloats
proc AnglesToTieFloats 4 0
line 1431
;1430:
;1431:void AnglesToTieFloats(float *tieFloats, vec3_t *angles) {
line 1432
;1432:   tieFloats[PREV_ANGLES_PITCH] = *angles[PITCH];
ADDRFP4 0
INDIRP4
CNSTI4 16
ADDP4
ADDRFP4 4
INDIRP4
INDIRF4
ASGNF4
line 1433
;1433:   tieFloats[PREV_ANGLES_YAW] = *angles[YAW];
ADDRFP4 0
INDIRP4
CNSTI4 20
ADDP4
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ASGNF4
line 1434
;1434:   tieFloats[PREV_ANGLES_ROLL] = *angles[ROLL];
ADDRLP4 0
CNSTI4 24
ASGNI4
ADDRFP4 0
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRFP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ASGNF4
line 1435
;1435:}
LABELV $350
endproc AnglesToTieFloats 4 0
export QuaternionFromString
proc QuaternionFromString 4 24
line 1437
;1436:
;1437:void QuaternionFromString(char *string, quat_t *q) {
line 1438
;1438:   QuaternionIdentity(q);
ADDRFP4 4
INDIRP4
ARGP4
ADDRGP4 QuaternionIdentity
CALLV
pop
line 1439
;1439:   sscanf(string, "%f,%f,%f,%f", &(q->x), &(q->y), &(q->z), &(q->w)); 
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 $352
ARGP4
ADDRLP4 0
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 0
INDIRP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
ARGP4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
ARGP4
ADDRGP4 sscanf
CALLI4
pop
line 1440
;1440:}
LABELV $351
endproc QuaternionFromString 4 24
export AnglesToQuat
proc AnglesToQuat 68 4
line 1443
;1441:
;1442:void AnglesToQuat (const vec3_t angles, quat_t *q)
;1443:{
line 1453
;1444:	vec3_t a;
;1445:	float cr, cp, cy, sr, sp, sy, cpcy, spsy;
;1446:
;1447:	/*
;1448:   a[PITCH] = (M_PI/360.0) * angles[PITCH];
;1449:	a[YAW] = (M_PI/360.0) * angles[YAW];
;1450:	a[ROLL] = (M_PI/360.0) * angles[ROLL];
;1451:   */
;1452:
;1453:   a[PITCH] = angles[PITCH] / 2.0f;
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRF4
CNSTF4 1073741824
DIVF4
ASGNF4
line 1454
;1454:	a[YAW] = angles[YAW] / 2.0f;
ADDRLP4 0+4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
CNSTF4 1073741824
DIVF4
ASGNF4
line 1455
;1455:	a[ROLL] = angles[ROLL] / 2.0f;
ADDRLP4 0+8
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
CNSTF4 1073741824
DIVF4
ASGNF4
line 1457
;1456:	
;1457:   cr = cos(a[ROLL]);
ADDRLP4 0+8
INDIRF4
ARGF4
ADDRLP4 44
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 12
ADDRLP4 44
INDIRF4
ASGNF4
line 1458
;1458:	cp = cos(a[PITCH]);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 48
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 20
ADDRLP4 48
INDIRF4
ASGNF4
line 1459
;1459:	cy = cos(a[YAW]);
ADDRLP4 0+4
INDIRF4
ARGF4
ADDRLP4 52
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 24
ADDRLP4 52
INDIRF4
ASGNF4
line 1461
;1460:   
;1461:	sr = sin(a[ROLL]);
ADDRLP4 0+8
INDIRF4
ARGF4
ADDRLP4 56
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 16
ADDRLP4 56
INDIRF4
ASGNF4
line 1462
;1462:	sp = sin(a[PITCH]);
ADDRLP4 0
INDIRF4
ARGF4
ADDRLP4 60
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 28
ADDRLP4 60
INDIRF4
ASGNF4
line 1463
;1463:	sy = sin(a[YAW]);
ADDRLP4 0+4
INDIRF4
ARGF4
ADDRLP4 64
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 32
ADDRLP4 64
INDIRF4
ASGNF4
line 1465
;1464:
;1465:	cpcy = cp * cy;
ADDRLP4 36
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
MULF4
ASGNF4
line 1466
;1466:	spsy = sp * sy;
ADDRLP4 40
ADDRLP4 28
INDIRF4
ADDRLP4 32
INDIRF4
MULF4
ASGNF4
line 1467
;1467:   q->w = cr * cpcy + sr * spsy; // w
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ADDRLP4 12
INDIRF4
ADDRLP4 36
INDIRF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 40
INDIRF4
MULF4
ADDF4
ASGNF4
line 1468
;1468:	q->x = sr * cpcy - cr * spsy; // x
ADDRFP4 4
INDIRP4
ADDRLP4 16
INDIRF4
ADDRLP4 36
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 40
INDIRF4
MULF4
SUBF4
ASGNF4
line 1469
;1469:	q->y = cr * sp * cy + sr * cp * sy; // y
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 12
INDIRF4
ADDRLP4 28
INDIRF4
MULF4
ADDRLP4 24
INDIRF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ADDRLP4 32
INDIRF4
MULF4
ADDF4
ASGNF4
line 1470
;1470:	q->z = cr * cp * sy - sr * sp * cy; // z
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 12
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ADDRLP4 32
INDIRF4
MULF4
ADDRLP4 16
INDIRF4
ADDRLP4 28
INDIRF4
MULF4
ADDRLP4 24
INDIRF4
MULF4
SUBF4
ASGNF4
line 1471
;1471:}
LABELV $353
endproc AnglesToQuat 68 4
export QuatToAxis
proc QuatToAxis 40 4
line 1474
;1472:
;1473:void QuatToAxis(quat_t q, vec3_t axis[3])
;1474:{
line 1506
;1475:	/*
;1476:   float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2;
;1477:
;1478:	x2 = q.x + q.x;
;1479:	y2 = q.y + q.y;
;1480:	z2 = q.z + q.z;
;1481:	xx = q.x * x2;
;1482:	xy = q.x * y2;
;1483:	xz = q.x * z2;
;1484:	yy = q.y * y2;
;1485:	yz = q.y * z2;
;1486:	zz = q.z * z2;
;1487:	wx = q.w * x2;
;1488:	wy = q.w * y2;
;1489:	wz = q.w * z2;
;1490:
;1491:	axis[0][0] = 1.0 - (yy + zz);
;1492:	axis[1][0] = xy - wz;
;1493:	axis[2][0] = xz + wy;
;1494:
;1495:	axis[0][1] = xy + wz;
;1496:	axis[1][1] = 1.0 - (xx + zz);
;1497:	axis[2][1] = yz - wx;
;1498:
;1499:	axis[0][2] = xz - wy;
;1500:	axis[1][2] = yz + wx;
;1501:	axis[2][2] = 1.0 - (xx + yy);
;1502:   */
;1503:
;1504:   float w, x, y, z, xx, yy, zz;
;1505:
;1506:   QuaternionNormalize(&q);
ADDRFP4 0
INDIRP4
ARGP4
ADDRGP4 QuaternionNormalize
CALLF4
pop
line 1508
;1507:
;1508:	w = q.w;
ADDRLP4 12
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ASGNF4
line 1509
;1509:	x = q.x;
ADDRLP4 0
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
line 1510
;1510:	y = q.y;
ADDRLP4 4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
line 1511
;1511:	z = q.z;
ADDRLP4 8
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
line 1513
;1512:
;1513:	xx = x * x;
ADDRLP4 16
ADDRLP4 0
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1514
;1514:	yy = y * y;
ADDRLP4 20
ADDRLP4 4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1515
;1515:	zz = z * z;
ADDRLP4 24
ADDRLP4 8
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ASGNF4
line 1517
;1516:
;1517:	axis[0][0] = 1.0 - 2.0 * ( yy + zz );
ADDRFP4 4
INDIRP4
CNSTF4 1065353216
CNSTF4 1073741824
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
ADDF4
MULF4
SUBF4
ASGNF4
line 1518
;1518:	axis[1][0] = 2.0 * ( x * y + w * z );
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
CNSTF4 1073741824
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDF4
MULF4
ASGNF4
line 1519
;1519:	axis[2][0] = 2.0 * ( x * z - w * y );
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
CNSTF4 1073741824
ADDRLP4 0
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
SUBF4
MULF4
ASGNF4
line 1521
;1520:
;1521:	axis[0][1] = 2.0 * ( x * y - w * z );
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
CNSTF4 1073741824
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
SUBF4
MULF4
ASGNF4
line 1522
;1522:	axis[1][1] = 1.0 - 2.0 * ( xx + zz );
ADDRFP4 4
INDIRP4
CNSTI4 16
ADDP4
CNSTF4 1065353216
CNSTF4 1073741824
ADDRLP4 16
INDIRF4
ADDRLP4 24
INDIRF4
ADDF4
MULF4
SUBF4
ASGNF4
line 1523
;1523:	axis[2][1] = 2.0 * ( y * z + w * x );
ADDRFP4 4
INDIRP4
CNSTI4 28
ADDP4
CNSTF4 1073741824
ADDRLP4 4
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ADDF4
MULF4
ASGNF4
line 1525
;1524:
;1525:	axis[0][2] = 2.0 * ( x * z + w * y );
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
CNSTF4 1073741824
ADDRLP4 0
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDF4
MULF4
ASGNF4
line 1526
;1526:	axis[1][2] = 2.0 * ( y * z - w * x );
ADDRFP4 4
INDIRP4
CNSTI4 20
ADDP4
CNSTF4 1073741824
ADDRLP4 4
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
SUBF4
MULF4
ASGNF4
line 1527
;1527:	axis[2][2] = 1.0 - 2.0 * ( xx + yy );
ADDRFP4 4
INDIRP4
CNSTI4 32
ADDP4
CNSTF4 1065353216
CNSTF4 1073741824
ADDRLP4 16
INDIRF4
ADDRLP4 20
INDIRF4
ADDF4
MULF4
SUBF4
ASGNF4
line 1528
;1528:}
LABELV $360
endproc QuatToAxis 40 4
export QuatMul
proc QuatMul 116 0
line 1531
;1529:
;1530:void QuatMul(const quat_t q1, const quat_t q2, quat_t *res)
;1531:{
line 1534
;1532:	float A, B, C, D, E, F, G, H;
;1533:
;1534:	A = (q1.w + q1.x)*(q2.w + q2.x);
ADDRLP4 32
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 36
CNSTI4 12
ASGNI4
ADDRLP4 40
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 16
ADDRLP4 32
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
ADDRLP4 32
INDIRP4
INDIRF4
ADDF4
ADDRLP4 40
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
ADDRLP4 40
INDIRP4
INDIRF4
ADDF4
MULF4
ASGNF4
line 1535
;1535:	B = (q1.z - q1.y)*(q2.y - q2.z);
ADDRLP4 44
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 48
CNSTI4 8
ASGNI4
ADDRLP4 52
CNSTI4 4
ASGNI4
ADDRLP4 56
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 20
ADDRLP4 44
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
ADDRLP4 44
INDIRP4
ADDRLP4 52
INDIRI4
ADDP4
INDIRF4
SUBF4
ADDRLP4 56
INDIRP4
ADDRLP4 52
INDIRI4
ADDP4
INDIRF4
ADDRLP4 56
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
SUBF4
MULF4
ASGNF4
line 1536
;1536:	C = (q1.w - q1.x)*(q2.y + q2.z);
ADDRLP4 60
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 64
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 24
ADDRLP4 60
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 60
INDIRP4
INDIRF4
SUBF4
ADDRLP4 64
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 64
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDF4
MULF4
ASGNF4
line 1537
;1537:	D = (q1.y + q1.z)*(q2.w - q2.x);
ADDRLP4 68
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 72
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 28
ADDRLP4 68
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 68
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDF4
ADDRLP4 72
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 72
INDIRP4
INDIRF4
SUBF4
MULF4
ASGNF4
line 1538
;1538:	E = (q1.x + q1.z)*(q2.x + q2.y);
ADDRLP4 76
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 80
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 0
ADDRLP4 76
INDIRP4
INDIRF4
ADDRLP4 76
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDF4
ADDRLP4 80
INDIRP4
INDIRF4
ADDRLP4 80
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDF4
MULF4
ASGNF4
line 1539
;1539:	F = (q1.x - q1.z)*(q2.x - q2.y);
ADDRLP4 84
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 88
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 4
ADDRLP4 84
INDIRP4
INDIRF4
ADDRLP4 84
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
SUBF4
ADDRLP4 88
INDIRP4
INDIRF4
ADDRLP4 88
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
SUBF4
MULF4
ASGNF4
line 1540
;1540:	G = (q1.w + q1.y)*(q2.w - q2.z);
ADDRLP4 92
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 96
CNSTI4 12
ASGNI4
ADDRLP4 100
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 8
ADDRLP4 92
INDIRP4
ADDRLP4 96
INDIRI4
ADDP4
INDIRF4
ADDRLP4 92
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDF4
ADDRLP4 100
INDIRP4
ADDRLP4 96
INDIRI4
ADDP4
INDIRF4
ADDRLP4 100
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
SUBF4
MULF4
ASGNF4
line 1541
;1541:	H = (q1.w - q1.y)*(q2.w + q2.z);
ADDRLP4 104
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 108
CNSTI4 12
ASGNI4
ADDRLP4 112
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 12
ADDRLP4 104
INDIRP4
ADDRLP4 108
INDIRI4
ADDP4
INDIRF4
ADDRLP4 104
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
SUBF4
ADDRLP4 112
INDIRP4
ADDRLP4 108
INDIRI4
ADDP4
INDIRF4
ADDRLP4 112
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDF4
MULF4
ASGNF4
line 1543
;1542:
;1543:	res->w = B + (H - E - F + G)*0.5;
ADDRFP4 8
INDIRP4
CNSTI4 12
ADDP4
ADDRLP4 20
INDIRF4
CNSTF4 1056964608
ADDRLP4 12
INDIRF4
ADDRLP4 0
INDIRF4
SUBF4
ADDRLP4 4
INDIRF4
SUBF4
ADDRLP4 8
INDIRF4
ADDF4
MULF4
ADDF4
ASGNF4
line 1544
;1544:	res->x = A - (E + F + G + H)*0.5;
ADDRFP4 8
INDIRP4
ADDRLP4 16
INDIRF4
CNSTF4 1056964608
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
ADDF4
ADDRLP4 8
INDIRF4
ADDF4
ADDRLP4 12
INDIRF4
ADDF4
MULF4
SUBF4
ASGNF4
line 1545
;1545:	res->y = C + (E - F + G - H)*0.5;
ADDRFP4 8
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 24
INDIRF4
CNSTF4 1056964608
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
SUBF4
ADDRLP4 8
INDIRF4
ADDF4
ADDRLP4 12
INDIRF4
SUBF4
MULF4
ADDF4
ASGNF4
line 1546
;1546:	res->z = D + (E - F - G + H)*0.5;
ADDRFP4 8
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 28
INDIRF4
CNSTF4 1056964608
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
SUBF4
ADDRLP4 8
INDIRF4
SUBF4
ADDRLP4 12
INDIRF4
ADDF4
MULF4
ADDF4
ASGNF4
line 1547
;1547:}
LABELV $361
endproc QuatMul 116 0
export QuaternionMagnitude
proc QuaternionMagnitude 24 4
line 1551
;1548:
;1549:
;1550:float QuaternionMagnitude( quat_t q )
;1551:{
line 1553
;1552:	/* fp precision isn't really all that precise &gt;_&lt; */
;1553:	return (float)sqrt( (double)(q.w*q.w + q.x*q.x + q.y*q.y + q.z*q.z) );
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ASGNF4
ADDRLP4 8
ADDRLP4 0
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 12
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 16
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
ADDRLP4 8
INDIRF4
MULF4
ADDF4
ADDRLP4 12
INDIRF4
ADDRLP4 12
INDIRF4
MULF4
ADDF4
ADDRLP4 16
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDF4
ARGF4
ADDRLP4 20
ADDRGP4 sqrt
CALLF4
ASGNF4
ADDRLP4 20
INDIRF4
RETF4
LABELV $362
endproc QuaternionMagnitude 24 4
export QuaternionNormalize
proc QuaternionNormalize 40 4
line 1557
;1554:}
;1555:
;1556:float QuaternionNormalize( quat_t *q )
;1557:{
line 1560
;1558:	float mag;
;1559:
;1560:	mag = QuaternionMagnitude( *q );
ADDRLP4 4
ADDRFP4 0
INDIRP4
INDIRB
ASGNB 16
ADDRLP4 4
ARGP4
ADDRLP4 20
ADDRGP4 QuaternionMagnitude
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 20
INDIRF4
ASGNF4
line 1562
;1561:
;1562:	if ( mag == 0.0f )
ADDRLP4 0
INDIRF4
CNSTF4 0
NEF4 $364
line 1563
;1563:		return 0;
CNSTF4 0
RETF4
ADDRGP4 $363
JUMPV
LABELV $364
line 1565
;1564:
;1565:	q->x /= mag;
ADDRLP4 24
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 24
INDIRP4
ADDRLP4 24
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 1566
;1566:	q->y /= mag;
ADDRLP4 28
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
ASGNP4
ADDRLP4 28
INDIRP4
ADDRLP4 28
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 1567
;1567:	q->z /= mag;
ADDRLP4 32
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
ASGNP4
ADDRLP4 32
INDIRP4
ADDRLP4 32
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 1568
;1568:	q->w /= mag;
ADDRLP4 36
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
ASGNP4
ADDRLP4 36
INDIRP4
ADDRLP4 36
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
DIVF4
ASGNF4
line 1570
;1569:
;1570:	return mag;
ADDRLP4 0
INDIRF4
RETF4
LABELV $363
endproc QuaternionNormalize 40 4
export QuaternionMultiply
proc QuaternionMultiply 84 4
line 1574
;1571:}
;1572:
;1573:float QuaternionMultiply( quat_t a, quat_t b, quat_t *r )
;1574:{
line 1596
;1575:	/* Anybody come up with something faster ? */
;1576:
;1577:/*	r[3] = a[3]*b[3] - a[0]*b[0] - a[1]*b[1] - a[2]*b[2];
;1578:	r[0] = a[3]*b[0] + a[0]*b[3] + a[1]*b[2] - a[2]*b[1];
;1579:	r[1] = a[3]*b[1] + a[1]*b[3] + a[2]*b[0] - a[0]*b[2];
;1580:	r[2] = a[3]*b[2] + a[2]*b[3] + a[0]*b[1] - a[1]*b[0]; */
;1581:
;1582:	/*
;1583:   r->w = a.w*b.w - a.x*b.x - a.y*b.y - a.z*b.z;
;1584:	r->x = a.w*b.x + a.x*b.w + a.z*b.y - a.y*b.z;
;1585:	r->z = a.w*b.z + a.z*b.w + a.y*b.x - a.x*b.y;
;1586:	r->y = a.w*b.y + a.y*b.w + a.x*b.z - a.z*b.x; 
;1587:   */
;1588:   
;1589:   /*
;1590:   r->w = a.w*b.w - a.x*b.x - a.y*b.y - a.z*b.z;
;1591:	r->x = a.x*b.w + a.w*b.x - a.z*b.y + a.y*b.z;
;1592:	r->y = a.y*b.w + a.z*b.x - a.w*b.y + a.x*b.z; 
;1593:   r->z = a.z*b.w + a.y*b.x - a.x*b.y + a.w*b.z;
;1594:   */
;1595:
;1596:	r->w =	      b.w * a.w
ADDRLP4 0
CNSTI4 12
ASGNI4
ADDRLP4 4
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 8
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 12
CNSTI4 4
ASGNI4
ADDRLP4 16
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
ADDRLP4 4
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 0
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 4
INDIRP4
INDIRF4
ADDRLP4 8
INDIRP4
INDIRF4
MULF4
SUBF4
ADDRLP4 4
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 12
INDIRI4
ADDP4
INDIRF4
MULF4
SUBF4
ADDRLP4 4
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
INDIRF4
ADDRLP4 8
INDIRP4
ADDRLP4 16
INDIRI4
ADDP4
INDIRF4
MULF4
SUBF4
ASGNF4
line 1601
;1597:						- b.x * a.x
;1598:						- b.y * a.y
;1599:						- b.z * a.z;
;1600:
;1601:	r->x =	      b.w * a.x
ADDRLP4 20
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 24
CNSTI4 12
ASGNI4
ADDRLP4 28
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 32
CNSTI4 4
ASGNI4
ADDRLP4 36
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 20
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
ADDRLP4 28
INDIRP4
INDIRF4
MULF4
ADDRLP4 20
INDIRP4
INDIRF4
ADDRLP4 28
INDIRP4
ADDRLP4 24
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 20
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
ADDRLP4 28
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 20
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
ADDRLP4 28
INDIRP4
ADDRLP4 32
INDIRI4
ADDP4
INDIRF4
MULF4
SUBF4
ASGNF4
line 1606
;1602:						+ b.x * a.w
;1603:						+ b.y * a.z
;1604:						- b.z * a.y;
;1605:
;1606:	r->y =	      b.w * a.y
ADDRLP4 40
CNSTI4 4
ASGNI4
ADDRLP4 44
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 48
CNSTI4 12
ASGNI4
ADDRLP4 52
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 56
CNSTI4 8
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 40
INDIRI4
ADDP4
ADDRLP4 44
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
ADDRLP4 40
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 44
INDIRP4
INDIRF4
ADDRLP4 52
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
MULF4
SUBF4
ADDRLP4 44
INDIRP4
ADDRLP4 40
INDIRI4
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
ADDRLP4 48
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 44
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1611
;1607:						- b.x * a.z
;1608:						+ b.y * a.w
;1609:						+ b.z * a.x;
;1610:
;1611:	r->z =	      b.w * a.z
ADDRLP4 60
CNSTI4 8
ASGNI4
ADDRLP4 64
ADDRFP4 4
INDIRP4
ASGNP4
ADDRLP4 68
CNSTI4 12
ASGNI4
ADDRLP4 72
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 76
CNSTI4 4
ASGNI4
ADDRFP4 8
INDIRP4
ADDRLP4 60
INDIRI4
ADDP4
ADDRLP4 64
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRF4
ADDRLP4 72
INDIRP4
ADDRLP4 60
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 64
INDIRP4
INDIRF4
ADDRLP4 72
INDIRP4
ADDRLP4 76
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ADDRLP4 64
INDIRP4
ADDRLP4 76
INDIRI4
ADDP4
INDIRF4
ADDRLP4 72
INDIRP4
INDIRF4
MULF4
SUBF4
ADDRLP4 64
INDIRP4
ADDRLP4 60
INDIRI4
ADDP4
INDIRF4
ADDRLP4 72
INDIRP4
ADDRLP4 68
INDIRI4
ADDP4
INDIRF4
MULF4
ADDF4
ASGNF4
line 1616
;1612:						+ b.x * a.y
;1613:						- b.y * a.x
;1614:						+ b.z * a.w;
;1615:
;1616:	return QuaternionNormalize( r );
ADDRFP4 8
INDIRP4
ARGP4
ADDRLP4 80
ADDRGP4 QuaternionNormalize
CALLF4
ASGNF4
ADDRLP4 80
INDIRF4
RETF4
LABELV $366
endproc QuaternionMultiply 84 4
export QuaternionToAxis
proc QuaternionToAxis 60 0
line 1621
;1617:}
;1618:
;1619:
;1620:float QuaternionToAxis( quat_t q, vec3_t axis[3])
;1621:{
line 1638
;1622:   /*
;1623:   axis[0][0] = 1 - ( 2*q.z*q.z + 2*q.y*q.y );
;1624:	axis[0][2] = 2*q.x*q.x - 2*q.y*q.w;
;1625:	axis[0][1] = 2*q.x*q.y + 2*q.z*q.w;
;1626:
;1627:   axis[2][0] = 2*q.x*q.z + 2*q.y*q.z;
;1628:   axis[2][2] = 1 - ( 2*q.x*q.x + 2*q.y*q.y);
;1629:   axis[2][1] = 2*q.z*q.y - 2*q.x*q.w;
;1630:	
;1631:   axis[1][0] = 2*q.x*q.y - 2*q.z*q.w;
;1632:   axis[1][2] = 2*q.z*q.y + 2*q.x*q.w;
;1633:   axis[1][1] = 1 - ( 2*q.x*q.x + 2*q.z*q.z );
;1634:   */
;1635:   
;1636:   float wx, wy, wz, xx, yy, yz, xy, xz, zz, x2, y2, z2;
;1637:
;1638:	x2 = q.x + q.x;
ADDRLP4 48
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 44
ADDRLP4 48
INDIRF4
ADDRLP4 48
INDIRF4
ADDF4
ASGNF4
line 1639
;1639:	y2 = q.y + q.y;
ADDRLP4 52
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 4
ADDRLP4 52
INDIRF4
ADDRLP4 52
INDIRF4
ADDF4
ASGNF4
line 1640
;1640:	z2 = q.z + q.z;
ADDRLP4 56
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 56
INDIRF4
ADDRLP4 56
INDIRF4
ADDF4
ASGNF4
line 1641
;1641:	xx = q.x * x2;
ADDRLP4 20
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 44
INDIRF4
MULF4
ASGNF4
line 1642
;1642:	xy = q.x * y2;
ADDRLP4 32
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1643
;1643:	xz = q.x * z2;
ADDRLP4 36
ADDRFP4 0
INDIRP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1644
;1644:	yy = q.y * y2;
ADDRLP4 24
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1645
;1645:	yz = q.y * z2;
ADDRLP4 28
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1646
;1646:	zz = q.z * z2;
ADDRLP4 40
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1647
;1647:	wx = q.w * x2;
ADDRLP4 8
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 44
INDIRF4
MULF4
ASGNF4
line 1648
;1648:	wy = q.w * y2;
ADDRLP4 12
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ASGNF4
line 1649
;1649:	wz = q.w * z2;
ADDRLP4 16
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 0
INDIRF4
MULF4
ASGNF4
line 1651
;1650:
;1651:	axis[0][0] = 1.0 - (yy + zz);
ADDRFP4 4
INDIRP4
CNSTF4 1065353216
ADDRLP4 24
INDIRF4
ADDRLP4 40
INDIRF4
ADDF4
SUBF4
ASGNF4
line 1652
;1652:	axis[1][0] = xy - wz;
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDP4
ADDRLP4 32
INDIRF4
ADDRLP4 16
INDIRF4
SUBF4
ASGNF4
line 1653
;1653:	axis[2][0] = xz + wy;
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
ADDRLP4 36
INDIRF4
ADDRLP4 12
INDIRF4
ADDF4
ASGNF4
line 1655
;1654:
;1655:	axis[0][1] = xy + wz;
ADDRFP4 4
INDIRP4
CNSTI4 4
ADDP4
ADDRLP4 32
INDIRF4
ADDRLP4 16
INDIRF4
ADDF4
ASGNF4
line 1656
;1656:	axis[1][1] = 1.0 - (xx + zz);
ADDRFP4 4
INDIRP4
CNSTI4 16
ADDP4
CNSTF4 1065353216
ADDRLP4 20
INDIRF4
ADDRLP4 40
INDIRF4
ADDF4
SUBF4
ASGNF4
line 1657
;1657:	axis[2][1] = yz - wx;
ADDRFP4 4
INDIRP4
CNSTI4 28
ADDP4
ADDRLP4 28
INDIRF4
ADDRLP4 8
INDIRF4
SUBF4
ASGNF4
line 1659
;1658:
;1659:	axis[0][2] = xz - wy;
ADDRFP4 4
INDIRP4
CNSTI4 8
ADDP4
ADDRLP4 36
INDIRF4
ADDRLP4 12
INDIRF4
SUBF4
ASGNF4
line 1660
;1660:	axis[1][2] = yz + wx;
ADDRFP4 4
INDIRP4
CNSTI4 20
ADDP4
ADDRLP4 28
INDIRF4
ADDRLP4 8
INDIRF4
ADDF4
ASGNF4
line 1661
;1661:	axis[2][2] = 1.0 - (xx + yy);
ADDRFP4 4
INDIRP4
CNSTI4 32
ADDP4
CNSTF4 1065353216
ADDRLP4 20
INDIRF4
ADDRLP4 24
INDIRF4
ADDF4
SUBF4
ASGNF4
line 1663
;1662:   
;1663:}
CNSTF4 0
RETF4
LABELV $367
endproc QuaternionToAxis 60 0
proc R11 8 4
line 1678
;1664:
;1665:/*
;1666:  quat to euler helpers
;1667:*/
;1668:
;1669:/*
;1670:#define R11(psi, theta, phi) (cos(theta) * cos(phi));
;1671:#define R12(psi, theta, phi) ((sin(psi) * sin(theta) * cos(phi)) - ((cos(psi) * sin(phi))));
;1672:#define R13(psi, theta, phi) (((cos(psi) * sin(theta) * cos(phi)) + ((sin(psi) * sin(phi))));
;1673:#define R22(psi, theta, phi) (((sin(psi) * sin(theta) * sin(phi)) + ((cos(psi) * cos(phi))));
;1674:#define R23(psi, theta, phi) (((cos(psi) * sin(theta) * sin(phi)) - ((sin(psi) * cos(phi))));
;1675:#define R33(psi, theta, phi) (cos(psi) * cos(theta));
;1676:*/
;1677:
;1678:static double R11(float psi, float theta, float phi) {
line 1679
;1679:   return (cos(theta) * cos(phi));
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
RETF4
LABELV $368
endproc R11 8 4
proc R12 20 4
line 1682
;1680:}
;1681:
;1682:static double R12(float psi, float theta, float phi) {
line 1683
;1683:   return ((sin(psi) * sin(theta) * cos(phi)) - ((cos(psi) * sin(phi))));
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 8
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 12
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 16
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
SUBF4
RETF4
LABELV $369
endproc R12 20 4
proc R13 20 4
line 1686
;1684:}
;1685:
;1686:static double R13(float psi, float theta, float phi) {
line 1687
;1687:   return (cos(psi) * sin(theta) * cos(phi)) + ((sin(psi) * sin(phi)));
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 8
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 12
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 16
ADDRGP4 sin
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDF4
RETF4
LABELV $370
endproc R13 20 4
proc R22 20 4
line 1690
;1688:}
;1689:
;1690:static double R22(float psi, float theta, float phi) {
line 1691
;1691:   return (sin(psi) * sin(theta) * sin(phi)) + ((cos(psi) * cos(phi)));
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 8
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 12
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 16
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ADDF4
RETF4
LABELV $371
endproc R22 20 4
proc R23 20 4
line 1694
;1692:}
;1693:
;1694:static double R23(float psi, float theta, float phi) {
line 1695
;1695:   return (cos(psi) * sin(theta) * sin(phi)) - ((sin(psi) * cos(phi)));
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 8
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 12
ADDRGP4 sin
CALLF4
ASGNF4
ADDRFP4 8
INDIRF4
ARGF4
ADDRLP4 16
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ADDRLP4 8
INDIRF4
MULF4
ADDRLP4 12
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
SUBF4
RETF4
LABELV $372
endproc R23 20 4
proc R33 8 4
line 1698
;1696:}
;1697:
;1698:static double R33(float psi, float theta, float phi) {
line 1699
;1699:   return (cos(psi) * cos(theta));
ADDRFP4 0
INDIRF4
ARGF4
ADDRLP4 0
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 4
INDIRF4
ARGF4
ADDRLP4 4
ADDRGP4 cos
CALLF4
ASGNF4
ADDRLP4 0
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
RETF4
LABELV $373
endproc R33 8 4
proc areSimilar 12 4
line 1702
;1700:}
;1701:
;1702:static int areSimilar(double a, double b, double threshHold) {
line 1703
;1703:   double diff = 0;
ADDRLP4 0
CNSTF4 0
ASGNF4
line 1704
;1704:   diff = sqrt( (a - b)*(a - b) );
ADDRLP4 4
ADDRFP4 0
INDIRF4
ADDRFP4 4
INDIRF4
SUBF4
ASGNF4
ADDRLP4 4
INDIRF4
ADDRLP4 4
INDIRF4
MULF4
ARGF4
ADDRLP4 8
ADDRGP4 sqrt
CALLF4
ASGNF4
ADDRLP4 0
ADDRLP4 8
INDIRF4
ASGNF4
line 1706
;1705:   
;1706:   if(diff >= threshHold)
ADDRLP4 0
INDIRF4
ADDRFP4 8
INDIRF4
LTF4 $375
line 1707
;1707:      return 0;
CNSTI4 0
RETI4
ADDRGP4 $374
JUMPV
LABELV $375
line 1709
;1708:   else
;1709:      return 1;
CNSTI4 1
RETI4
LABELV $374
endproc areSimilar 12 4
export MatrixToEuler
proc MatrixToEuler 228 12
line 1712
;1710:}
;1711:
;1712:int MatrixToEuler(vec3_t m[3], vec3_t *angles) {
line 1717
;1713:   // triplets of psi, theta, phi that can describe the current rotation matrix
;1714:   vec3_t triplets[8];
;1715:   
;1716:   int i;
;1717:   int final_triplet_found = 0;
ADDRLP4 100
CNSTI4 0
ASGNI4
line 1722
;1718:
;1719:   // fill the triplets
;1720:
;1721:   // theta:
;1722:   triplets[0][1] = -1 * asin(m[2][0]);
ADDRFP4 0
INDIRP4
CNSTI4 24
ADDP4
INDIRF4
ARGF4
ADDRLP4 104
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0+4
CNSTI4 -1
ADDRLP4 104
INDIRI4
MULI4
CVIF4 4
ASGNF4
line 1723
;1723:   triplets[1][1] = triplets[0][1];
ADDRLP4 0+12+4
ADDRLP4 0+4
INDIRF4
ASGNF4
line 1724
;1724:   triplets[2][1] = triplets[0][1];
ADDRLP4 0+24+4
ADDRLP4 0+4
INDIRF4
ASGNF4
line 1725
;1725:   triplets[3][1] = triplets[0][1];
ADDRLP4 0+36+4
ADDRLP4 0+4
INDIRF4
ASGNF4
line 1726
;1726:   triplets[4][1] = M_PI - triplets[0][1];
ADDRLP4 0+48+4
CNSTF4 1078530011
ADDRLP4 0+4
INDIRF4
SUBF4
ASGNF4
line 1727
;1727:   triplets[5][1] = triplets[4][1];
ADDRLP4 0+60+4
ADDRLP4 0+48+4
INDIRF4
ASGNF4
line 1728
;1728:   triplets[6][1] = triplets[4][1];
ADDRLP4 0+72+4
ADDRLP4 0+48+4
INDIRF4
ASGNF4
line 1729
;1729:   triplets[7][1] = triplets[4][1];
ADDRLP4 0+84+4
ADDRLP4 0+48+4
INDIRF4
ASGNF4
line 1732
;1730:
;1731:   // psi:
;1732:   triplets[0][0] = asin(m[2][1] / cos(triplets[0][1]));
ADDRLP4 0+4
INDIRF4
ARGF4
ADDRLP4 108
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
ADDRLP4 108
INDIRF4
DIVF4
ARGF4
ADDRLP4 112
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0
ADDRLP4 112
INDIRI4
CVIF4 4
ASGNF4
line 1733
;1733:   triplets[1][0] = M_PI - triplets[0][0];
ADDRLP4 0+12
CNSTF4 1078530011
ADDRLP4 0
INDIRF4
SUBF4
ASGNF4
line 1734
;1734:   triplets[2][0] = triplets[0][0];
ADDRLP4 0+24
ADDRLP4 0
INDIRF4
ASGNF4
line 1735
;1735:   triplets[3][0] = triplets[1][0];
ADDRLP4 0+36
ADDRLP4 0+12
INDIRF4
ASGNF4
line 1736
;1736:   triplets[4][0] = asin(m[2][1] / cos(triplets[4][1]));
ADDRLP4 0+48+4
INDIRF4
ARGF4
ADDRLP4 116
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 28
ADDP4
INDIRF4
ADDRLP4 116
INDIRF4
DIVF4
ARGF4
ADDRLP4 120
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0+48
ADDRLP4 120
INDIRI4
CVIF4 4
ASGNF4
line 1737
;1737:   triplets[5][0] = M_PI - triplets[4][0];
ADDRLP4 0+60
CNSTF4 1078530011
ADDRLP4 0+48
INDIRF4
SUBF4
ASGNF4
line 1738
;1738:   triplets[6][0] = triplets[4][0];
ADDRLP4 0+72
ADDRLP4 0+48
INDIRF4
ASGNF4
line 1739
;1739:   triplets[7][0] = triplets[5][0];
ADDRLP4 0+84
ADDRLP4 0+60
INDIRF4
ASGNF4
line 1742
;1740:
;1741:   // phi:
;1742:   triplets[0][2] = asin(m[1][0] / cos(triplets[0][1]));
ADDRLP4 0+4
INDIRF4
ARGF4
ADDRLP4 124
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 124
INDIRF4
DIVF4
ARGF4
ADDRLP4 128
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0+8
ADDRLP4 128
INDIRI4
CVIF4 4
ASGNF4
line 1743
;1743:   triplets[1][2] = triplets[0][2];
ADDRLP4 0+12+8
ADDRLP4 0+8
INDIRF4
ASGNF4
line 1744
;1744:   triplets[2][2] = M_PI - asin(m[1][0] / cos(triplets[0][1]));
ADDRLP4 0+4
INDIRF4
ARGF4
ADDRLP4 132
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 132
INDIRF4
DIVF4
ARGF4
ADDRLP4 136
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0+24+8
CNSTF4 1078530011
ADDRLP4 136
INDIRI4
CVIF4 4
SUBF4
ASGNF4
line 1745
;1745:   triplets[3][2] = triplets[2][2];
ADDRLP4 0+36+8
ADDRLP4 0+24+8
INDIRF4
ASGNF4
line 1746
;1746:   triplets[4][2] = asin(m[1][0] / cos(triplets[4][1]));
ADDRLP4 0+48+4
INDIRF4
ARGF4
ADDRLP4 140
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 140
INDIRF4
DIVF4
ARGF4
ADDRLP4 144
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0+48+8
ADDRLP4 144
INDIRI4
CVIF4 4
ASGNF4
line 1747
;1747:   triplets[5][2] = triplets[4][2];
ADDRLP4 0+60+8
ADDRLP4 0+48+8
INDIRF4
ASGNF4
line 1748
;1748:   triplets[6][2] = M_PI - asin(m[1][0] / cos(triplets[4][1]));
ADDRLP4 0+48+4
INDIRF4
ARGF4
ADDRLP4 148
ADDRGP4 cos
CALLF4
ASGNF4
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 148
INDIRF4
DIVF4
ARGF4
ADDRLP4 152
ADDRGP4 asin
CALLI4
ASGNI4
ADDRLP4 0+72+8
CNSTF4 1078530011
ADDRLP4 152
INDIRI4
CVIF4 4
SUBF4
ASGNF4
line 1749
;1749:   triplets[7][2] = triplets[6][2];
ADDRLP4 0+84+8
ADDRLP4 0+72+8
INDIRF4
ASGNF4
line 1752
;1750:
;1751:   // compare triplet products using macros to m[i][j] values
;1752:   for(i = 0; i < 8; i++) {
ADDRLP4 96
CNSTI4 0
ASGNI4
LABELV $445
line 1806
;1753:      /*
;1754:      float diff = 0;
;1755:      
;1756:      // R[1][1] == m[0][0]
;1757:      diff = R11(triplets[i][0], triplets[i][1], triplets[i][2]) - m[0][0];
;1758:      diff *= diff;
;1759:      diff = sqrt(diff);
;1760:
;1761:      if(diff >= 0.01)
;1762:         continue;
;1763:      
;1764:      // R[1][2] == m[0][1]
;1765:      diff = R12(triplets[i][0], triplets[i][1], triplets[i][2]) - m[0][1];
;1766:      diff *= diff;
;1767:      diff = sqrt(diff);
;1768:
;1769:      if(diff >= 0.01)
;1770:         continue;
;1771:
;1772:      // R[1][3] == m[0][2]
;1773:      diff = R13(triplets[i][0], triplets[i][1], triplets[i][2]) - m[0][2];
;1774:      diff *= diff;
;1775:      diff = sqrt(diff);
;1776:
;1777:      if(diff >= 0.01)
;1778:         continue;
;1779:
;1780:      // R[2][2] == m[1][1]
;1781:      diff = R22(triplets[i][0], triplets[i][1], triplets[i][2]) - m[1][1];
;1782:      diff *= diff;
;1783:      diff = sqrt(diff);
;1784:
;1785:      if(diff >= 0.01)
;1786:         continue;
;1787:
;1788:      // R[2][3] == m[1][2]
;1789:      diff = R23(triplets[i][0], triplets[i][1], triplets[i][2]) - m[1][2];
;1790:      diff *= diff;
;1791:      diff = sqrt(diff);
;1792:
;1793:      if(diff >= 0.01)
;1794:         continue;
;1795:
;1796:      // R[3][3] == m[2][2]
;1797:      diff = R33(triplets[i][0], triplets[i][1], triplets[i][2]) - m[2][2];
;1798:      diff *= diff;
;1799:      diff = sqrt(diff);
;1800:
;1801:      if(diff >= 0.01)
;1802:         continue;
;1803:
;1804:      */
;1805:
;1806:      if( !areSimilar( R11(triplets[i][0], triplets[i][1], triplets[i][2]), m[0][0], 0.01 ) )
ADDRLP4 156
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ASGNI4
ADDRLP4 156
INDIRI4
ADDRLP4 0
ADDP4
INDIRF4
ARGF4
ADDRLP4 156
INDIRI4
ADDRLP4 0+4
ADDP4
INDIRF4
ARGF4
ADDRLP4 156
INDIRI4
ADDRLP4 0+8
ADDP4
INDIRF4
ARGF4
ADDRLP4 160
ADDRGP4 R11
CALLF4
ASGNF4
ADDRLP4 160
INDIRF4
ARGF4
ADDRFP4 0
INDIRP4
INDIRF4
ARGF4
CNSTF4 1008981770
ARGF4
ADDRLP4 164
ADDRGP4 areSimilar
CALLI4
ASGNI4
ADDRLP4 164
INDIRI4
CNSTI4 0
NEI4 $449
line 1807
;1807:         continue;
ADDRGP4 $446
JUMPV
LABELV $449
line 1808
;1808:      if( !areSimilar(R12(triplets[i][0], triplets[i][1], triplets[i][2]), m[0][1], 0.01 ) )
ADDRLP4 168
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ASGNI4
ADDRLP4 168
INDIRI4
ADDRLP4 0
ADDP4
INDIRF4
ARGF4
ADDRLP4 168
INDIRI4
ADDRLP4 0+4
ADDP4
INDIRF4
ARGF4
ADDRLP4 168
INDIRI4
ADDRLP4 0+8
ADDP4
INDIRF4
ARGF4
ADDRLP4 172
ADDRGP4 R12
CALLF4
ASGNF4
ADDRLP4 172
INDIRF4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ARGF4
CNSTF4 1008981770
ARGF4
ADDRLP4 176
ADDRGP4 areSimilar
CALLI4
ASGNI4
ADDRLP4 176
INDIRI4
CNSTI4 0
NEI4 $453
line 1809
;1809:         continue;
ADDRGP4 $446
JUMPV
LABELV $453
line 1810
;1810:      if( !areSimilar(R13(triplets[i][0], triplets[i][1], triplets[i][2]), m[0][2], 0.01 ) )
ADDRLP4 180
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ASGNI4
ADDRLP4 180
INDIRI4
ADDRLP4 0
ADDP4
INDIRF4
ARGF4
ADDRLP4 180
INDIRI4
ADDRLP4 0+4
ADDP4
INDIRF4
ARGF4
ADDRLP4 180
INDIRI4
ADDRLP4 0+8
ADDP4
INDIRF4
ARGF4
ADDRLP4 184
ADDRGP4 R13
CALLF4
ASGNF4
ADDRLP4 184
INDIRF4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ARGF4
CNSTF4 1008981770
ARGF4
ADDRLP4 188
ADDRGP4 areSimilar
CALLI4
ASGNI4
ADDRLP4 188
INDIRI4
CNSTI4 0
NEI4 $457
line 1811
;1811:         continue;
ADDRGP4 $446
JUMPV
LABELV $457
line 1812
;1812:      if( !areSimilar(R22(triplets[i][0], triplets[i][1], triplets[i][2]), m[1][1], 0.01 ) )
ADDRLP4 192
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ASGNI4
ADDRLP4 192
INDIRI4
ADDRLP4 0
ADDP4
INDIRF4
ARGF4
ADDRLP4 192
INDIRI4
ADDRLP4 0+4
ADDP4
INDIRF4
ARGF4
ADDRLP4 192
INDIRI4
ADDRLP4 0+8
ADDP4
INDIRF4
ARGF4
ADDRLP4 196
ADDRGP4 R22
CALLF4
ASGNF4
ADDRLP4 196
INDIRF4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 16
ADDP4
INDIRF4
ARGF4
CNSTF4 1008981770
ARGF4
ADDRLP4 200
ADDRGP4 areSimilar
CALLI4
ASGNI4
ADDRLP4 200
INDIRI4
CNSTI4 0
NEI4 $461
line 1813
;1813:         continue;
ADDRGP4 $446
JUMPV
LABELV $461
line 1814
;1814:      if( !areSimilar(R23(triplets[i][0], triplets[i][1], triplets[i][2]), m[1][2], 0.01 ) )
ADDRLP4 204
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ASGNI4
ADDRLP4 204
INDIRI4
ADDRLP4 0
ADDP4
INDIRF4
ARGF4
ADDRLP4 204
INDIRI4
ADDRLP4 0+4
ADDP4
INDIRF4
ARGF4
ADDRLP4 204
INDIRI4
ADDRLP4 0+8
ADDP4
INDIRF4
ARGF4
ADDRLP4 208
ADDRGP4 R23
CALLF4
ASGNF4
ADDRLP4 208
INDIRF4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 20
ADDP4
INDIRF4
ARGF4
CNSTF4 1008981770
ARGF4
ADDRLP4 212
ADDRGP4 areSimilar
CALLI4
ASGNI4
ADDRLP4 212
INDIRI4
CNSTI4 0
NEI4 $465
line 1815
;1815:         continue;
ADDRGP4 $446
JUMPV
LABELV $465
line 1816
;1816:      if( !areSimilar(R33(triplets[i][0], triplets[i][1], triplets[i][2]), m[2][2], 0.01 ) )
ADDRLP4 216
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ASGNI4
ADDRLP4 216
INDIRI4
ADDRLP4 0
ADDP4
INDIRF4
ARGF4
ADDRLP4 216
INDIRI4
ADDRLP4 0+4
ADDP4
INDIRF4
ARGF4
ADDRLP4 216
INDIRI4
ADDRLP4 0+8
ADDP4
INDIRF4
ARGF4
ADDRLP4 220
ADDRGP4 R33
CALLF4
ASGNF4
ADDRLP4 220
INDIRF4
ARGF4
ADDRFP4 0
INDIRP4
CNSTI4 32
ADDP4
INDIRF4
ARGF4
CNSTF4 1008981770
ARGF4
ADDRLP4 224
ADDRGP4 areSimilar
CALLI4
ASGNI4
ADDRLP4 224
INDIRI4
CNSTI4 0
NEI4 $469
line 1817
;1817:         continue;
ADDRGP4 $446
JUMPV
LABELV $469
line 1820
;1818:
;1819:      // if we got here, we have a match
;1820:      final_triplet_found = 1;
ADDRLP4 100
CNSTI4 1
ASGNI4
line 1823
;1821:
;1822:      // no need to continue
;1823:      break;
ADDRGP4 $447
JUMPV
LABELV $446
line 1752
ADDRLP4 96
ADDRLP4 96
INDIRI4
CNSTI4 1
ADDI4
ASGNI4
ADDRLP4 96
INDIRI4
CNSTI4 8
LTI4 $445
LABELV $447
line 1826
;1824:   }
;1825:
;1826:   if(final_triplet_found) {
ADDRLP4 100
INDIRI4
CNSTI4 0
EQI4 $473
line 1827
;1827:      *angles[0] = triplets[i][0];
ADDRFP4 4
INDIRP4
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ADDRLP4 0
ADDP4
INDIRF4
ASGNF4
line 1828
;1828:      *angles[1] = triplets[i][1];
ADDRLP4 156
CNSTI4 12
ASGNI4
ADDRFP4 4
INDIRP4
ADDRLP4 156
INDIRI4
ADDP4
ADDRLP4 156
INDIRI4
ADDRLP4 96
INDIRI4
MULI4
ADDRLP4 0+4
ADDP4
INDIRF4
ASGNF4
line 1829
;1829:      *angles[2] = triplets[i][2];
ADDRFP4 4
INDIRP4
CNSTI4 24
ADDP4
CNSTI4 12
ADDRLP4 96
INDIRI4
MULI4
ADDRLP4 0+8
ADDP4
INDIRF4
ASGNF4
line 1831
;1830:
;1831:      return 1;
CNSTI4 1
RETI4
ADDRGP4 $377
JUMPV
LABELV $473
line 1832
;1832:   } else {
line 1833
;1833:      return 0;
CNSTI4 0
RETI4
LABELV $377
endproc MatrixToEuler 228 12
export QuaternionToEuler
proc QuaternionToEuler 8 4
line 1837
;1834:   }
;1835:}
;1836:
;1837:void QuaternionToEuler( quat_t q, float *p, float *y, float *r) {
line 1843
;1838:
;1839:   //tan(yaw) = 2(q1q2+q4q3) / (q42 + q12 - q22 - q32) 
;1840:   //*y = atan( 2 * (q.x*q.y + q.w*q.z) / (q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z) );
;1841:   //*y = atan( -2 * (q.x*q.z + q.w*q.y) / (q.w * q.w + q.x * q.x - q.y * q.y - q.z * q.z) );
;1842:   //sin(pitch) = -2(q1q3-q4q2) 
;1843:   *p = -1 * ( acos( -2 * (q.x*q.z - q.w*q.y) ) - (M_PI / 2) );
ADDRLP4 0
ADDRFP4 0
INDIRP4
ASGNP4
CNSTF4 3221225472
ADDRLP4 0
INDIRP4
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ADDRLP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ADDRLP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
MULF4
SUBF4
MULF4
ARGF4
ADDRLP4 4
ADDRGP4 acos
CALLF4
ASGNF4
ADDRFP4 4
INDIRP4
CNSTF4 3212836864
ADDRLP4 4
INDIRF4
CNSTF4 1070141403
SUBF4
MULF4
ASGNF4
line 1871
;1844:   //*p = -1 * ( acos( 2 * (q.x*q.y - q.w*q.z) ) - (M_PI / 2) );
;1845:   //tan(roll)  =  2(q4q1+q2q3) / (q42 - q12 - q22 + q32)  
;1846:   //*r = atan( 2 * (q.w*q.x + q.y*q.z) / (q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z) );
;1847:   //*r = atan( -2 * (q.w*q.x + q.y*q.z) / (q.w * q.w - q.x * q.x + q.y * q.y - q.z * q.z) );
;1848:   
;1849:
;1850:	/*
;1851:   double sint,cost,sinv,cosv,sinf,cosf,ex,ey,ez;
;1852:
;1853:	sint = (2*q.w*q.y)-(2*q.x*q.z);
;1854:	cost = sqrt(1 - (sint * sint));
;1855:	if (cost != 0.0){
;1856:		sinv = ((2*q.y*q.z)+(2*q.w*q.x))/cost;
;1857:		cosv = (1-(2*q.x*q.x)-(2*q.y*q.y))/cost;
;1858:		sinf = (1-(2*q.x*q.x)-(2*q.y*q.y))/cost;
;1859:		cosf = (1-(2*q.y*q.y)-(2*q.z*q.z))/cost;
;1860:	}else {
;1861:		sinv = (2*q.w*q.x)-(2*q.y*q.z);
;1862:		cosv = 1-(2*q.x*q.x)-(2*q.z*q.z);
;1863:		sinf = 0.0;
;1864:		cosf = 1.0;
;1865:	}
;1866:
;1867:	*y = atan2(sinv,cosv);
;1868:	*p = atan2(sint,cost);
;1869:	*r = atan2(sinf,cosf);  //range -pi +pi
;1870:   */
;1871:}
LABELV $477
endproc QuaternionToEuler 8 4
export QuatToAngles
proc QuatToAngles 64 8
line 1874
;1872:
;1873:void QuatToAngles (const quat_t q, vec3_t a)
;1874:{
line 1876
;1875:	quat_t q2;
;1876:	q2.w = q.w*q.w;
ADDRLP4 16
ADDRFP4 0
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0+12
ADDRLP4 16
INDIRF4
ADDRLP4 16
INDIRF4
MULF4
ASGNF4
line 1877
;1877:	q2.x = q.x*q.x;
ADDRLP4 20
ADDRFP4 0
INDIRP4
INDIRF4
ASGNF4
ADDRLP4 0
ADDRLP4 20
INDIRF4
ADDRLP4 20
INDIRF4
MULF4
ASGNF4
line 1878
;1878:	q2.y = q.y*q.y;
ADDRLP4 24
ADDRFP4 0
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0+4
ADDRLP4 24
INDIRF4
ADDRLP4 24
INDIRF4
MULF4
ASGNF4
line 1879
;1879:	q2.z = q.z*q.z;
ADDRLP4 28
ADDRFP4 0
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ASGNF4
ADDRLP4 0+8
ADDRLP4 28
INDIRF4
ADDRLP4 28
INDIRF4
MULF4
ASGNF4
line 1880
;1880:	a[ROLL] = (180.0/M_PI)*atan2 (2*(q.y*q.z + q.x*q.w) , (-q2.x - q2.y + q2.z + q2.w));
ADDRLP4 32
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 36
CNSTI4 8
ASGNI4
CNSTF4 1073741824
ADDRLP4 32
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 32
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 32
INDIRP4
INDIRF4
ADDRLP4 32
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
MULF4
ADDF4
MULF4
ARGF4
ADDRLP4 0
INDIRF4
NEGF4
ADDRLP4 0+4
INDIRF4
SUBF4
ADDRLP4 0+8
INDIRF4
ADDF4
ADDRLP4 0+12
INDIRF4
ADDF4
ARGF4
ADDRLP4 40
ADDRGP4 atan2
CALLF4
ASGNF4
ADDRFP4 4
INDIRP4
ADDRLP4 36
INDIRI4
ADDP4
CNSTF4 1113927393
ADDRLP4 40
INDIRF4
MULF4
ASGNF4
line 1881
;1881:	a[PITCH] = (180.0/M_PI)*asin (-2*(q.x*q.z - q.y*q.w));
ADDRLP4 44
ADDRFP4 0
INDIRP4
ASGNP4
CNSTF4 3221225472
ADDRLP4 44
INDIRP4
INDIRF4
ADDRLP4 44
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
MULF4
ADDRLP4 44
INDIRP4
CNSTI4 4
ADDP4
INDIRF4
ADDRLP4 44
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
MULF4
SUBF4
MULF4
ARGF4
ADDRLP4 48
ADDRGP4 asin
CALLI4
ASGNI4
ADDRFP4 4
INDIRP4
CNSTF4 1113927393
ADDRLP4 48
INDIRI4
CVIF4 4
MULF4
ASGNF4
line 1882
;1882:	a[YAW] = (180.0/M_PI)*atan2 (2*(q.x*q.y + q.z*q.w) , (q2.x - q2.y - q2.z + q2.w));
ADDRLP4 52
ADDRFP4 0
INDIRP4
ASGNP4
ADDRLP4 56
CNSTI4 4
ASGNI4
CNSTF4 1073741824
ADDRLP4 52
INDIRP4
INDIRF4
ADDRLP4 52
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
INDIRF4
MULF4
ADDRLP4 52
INDIRP4
CNSTI4 8
ADDP4
INDIRF4
ADDRLP4 52
INDIRP4
CNSTI4 12
ADDP4
INDIRF4
MULF4
ADDF4
MULF4
ARGF4
ADDRLP4 0
INDIRF4
ADDRLP4 0+4
INDIRF4
SUBF4
ADDRLP4 0+8
INDIRF4
SUBF4
ADDRLP4 0+12
INDIRF4
ADDF4
ARGF4
ADDRLP4 60
ADDRGP4 atan2
CALLF4
ASGNF4
ADDRFP4 4
INDIRP4
ADDRLP4 56
INDIRI4
ADDP4
CNSTF4 1113927393
ADDRLP4 60
INDIRF4
MULF4
ASGNF4
line 1883
;1883:}
LABELV $478
endproc QuatToAngles 64 8
import asin
import GetStringForID
import GetIDForString
import Q_irand
import Com_Printf
import Com_Error
import Info_NextPair
import Info_Validate
import Info_SetValueForKey_Big
import Info_SetValueForKey
import Info_RemoveKey_big
import Info_RemoveKey
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 Com_sprintf
import Parse3DMatrix
import Parse2DMatrix
import Parse1DMatrix
import SkipRestOfLine
import SkipBracedSection
import COM_MatchToken
import COM_ParseVec4
import COM_ParseFloat
import COM_ParseInt
import COM_ParseString
import COM_ParseWarning
import COM_ParseError
import COM_Compress
import COM_ParseExt
import COM_Parse
import SkipWhitespace
import COM_GetCurrentParseLine
import COM_BeginParseSession
import COM_DefaultExtension
import COM_StripExtension
import COM_SkipPath
import Com_Clamp
import AxisToQuaternion
import Q_acos
import colorTable
import Com_Memcpy
import Com_Memset
import Hunk_Alloc
import forceSpeedLevels
import FloatSwap
import LongSwap
import ShortSwap
import acos
import fabs
import abs
import tan
import atan2
import cos
import sin
import sqrt
import floor
import ceil
import memcpy
import memset
import memmove
import sscanf
import vsprintf
import _atoi
import atoi
import _atof
import atof
import toupper
import tolower
import strncpy
import strstr
import strchr
import strcmp
import strcpy
import strcat
import strlen
import rand
import srand
import qsort
lit
align 1
LABELV $352
byte 1 37
byte 1 102
byte 1 44
byte 1 37
byte 1 102
byte 1 44
byte 1 37
byte 1 102
byte 1 44
byte 1 37
byte 1 102
byte 1 0
