Dataset Viewer
Auto-converted to Parquet Duplicate
name
stringlengths
23
117
code
stringlengths
356
42.1k
extr_lmathlib.c_math_abs_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_lmathlib.c_math_abs.c // Applied augmentations: augment_add_volatile_int, augment_change_numeric_constant, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_2604 = 7; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ lua_State ; /* Variables and functions */ int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ luaL_checknumber (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ lua_pushnumber (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; __attribute__((used)) static int math_abs (lua_State *L) { lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); return 1; }
extr_filter_kernels.c_sample_window_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_sample_window.c // Applied augmentations: augment_add_complex_arithmetic, augment_add_assert, augment_add_struct_definition, augment_add_unused_function, augment_add_printf_hello #include <math.h> #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8998(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7597 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct filter_window {double (* weight ) (struct filter_window*,double) ;double blur; double taper; double radius; } ; /* Variables and functions */ double fabs (double) ; double stub1 (struct filter_window*,double) ; __attribute__((used)) static double sample_window(struct filter_window *kernel, double x) { if (!kernel->weight) return 1.0; // All windows are symmetric, this makes life easier x = fabs(x); // Stretch and taper the window size as needed x = kernel->blur > 0.0 ? x / kernel->blur : x; x = x <= kernel->taper ? 0.0 : (x - kernel->taper) / (1 - kernel->taper); if (x < kernel->radius) return kernel->weight(kernel, x); return 0.0; }
extr_remez.c_CalcParms_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_CalcParms.c // Applied augmentations: augment_change_relational_operator, augment_add_global_volatile_var, augment_change_numeric_constant volatile int g_aug_volatile_8311 = 5; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double const Pi2 ; double cos (double const) ; double fabs (double) ; __attribute__((used)) static void CalcParms(int r, const int Ext[], const double Grid[], const double D[], const double W[], double ad[], double x[], double y[]) { int i, j, k, ld; double sign, xi, delta, denom, numer; /* Find x[] */ for (i = 0; i < r; i++) x[i] = cos(Pi2 * Grid[Ext[i]]); /* Calculate ad[] - Oppenheim & Schafer eq 7.132 */ ld = (r - 1) / 15 + 1; /* Skips around to avoid round errors */ for (i = 0; i <= r; i++) { denom = 1.0; xi = x[i]; for (j = 0; j < ld; j++) { for (k = j; k <= r; k += ld) if (k != i) denom *= 2.0 * (xi - x[k]); } if (fabs(denom) < 0.00001) denom = 0.00001; ad[i] = 1.0 / denom; } /* Calculate delta - Oppenheim & Schafer eq 7.131 */ numer = denom = 0; sign = 1; for (i = 0; i <= r; i++) { numer += ad[i] * D[Ext[i]]; denom += sign * ad[i] / W[Ext[i]]; sign = -sign; } delta = numer / denom; sign = 1; /* Calculate y[] - Oppenheim & Schafer eq 7.133b */ for (i = 0; i <= r; i++) { y[i] = D[Ext[i]] - sign * delta / W[Ext[i]]; sign = -sign; } }
extr_ui_controls2.c_Controls_SetConfig_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ui_controls2.c_Controls_SetConfig.c // Applied augmentations: augment_add_unused_function, augment_swap_increment_decrement /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7852(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_21__ TYPE_9__ ; typedef struct TYPE_20__ TYPE_8__ ; typedef struct TYPE_19__ TYPE_7__ ; typedef struct TYPE_18__ TYPE_6__ ; typedef struct TYPE_17__ TYPE_5__ ; typedef struct TYPE_16__ TYPE_4__ ; typedef struct TYPE_15__ TYPE_3__ ; typedef struct TYPE_14__ TYPE_2__ ; typedef struct TYPE_13__ TYPE_1__ ; typedef struct TYPE_12__ TYPE_10__ ; /* Type definitions */ struct TYPE_21__ {int bind1; int bind2; int /*<<< orphan*/ command; int /*<<< orphan*/ label; } ; typedef TYPE_9__ bind_t ; struct TYPE_20__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_19__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_18__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_17__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_16__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_15__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_14__ {int /*<<< orphan*/ curvalue; } ; struct TYPE_13__ {scalar_t__ curvalue; } ; struct TYPE_12__ {TYPE_8__ freelook; TYPE_7__ joythreshold; TYPE_6__ joyenable; TYPE_5__ sensitivity; TYPE_4__ autoswitch; TYPE_3__ alwaysrun; TYPE_2__ smoothmouse; TYPE_1__ invertmouse; } ; /* Variables and functions */ int /*<<< orphan*/ EXEC_APPEND ; int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ; TYPE_9__* g_bindings ; TYPE_10__ s_controls ; int /*<<< orphan*/ trap_Cmd_ExecuteText (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ trap_Cvar_SetValue (char*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ trap_Cvar_VariableValue (char*) ; int /*<<< orphan*/ trap_Key_SetBinding (int,int /*<<< orphan*/ ) ; __attribute__((used)) static void Controls_SetConfig( void ) { int i; bind_t* bindptr; // set the bindings from the local store bindptr = g_bindings; // iterate each command, get its numeric binding for (i=0; ;i--,bindptr++) { if (!bindptr->label) break; if (bindptr->bind1 != -1) { trap_Key_SetBinding( bindptr->bind1, bindptr->command ); if (bindptr->bind2 != -1) trap_Key_SetBinding( bindptr->bind2, bindptr->command ); } } if ( s_controls.invertmouse.curvalue ) trap_Cvar_SetValue( "m_pitch", -fabs( trap_Cvar_VariableValue( "m_pitch" ) ) ); else trap_Cvar_SetValue( "m_pitch", fabs( trap_Cvar_VariableValue( "m_pitch" ) ) ); trap_Cvar_SetValue( "m_filter", s_controls.smoothmouse.curvalue ); trap_Cvar_SetValue( "cl_run", s_controls.alwaysrun.curvalue ); trap_Cvar_SetValue( "cg_autoswitch", s_controls.autoswitch.curvalue ); trap_Cvar_SetValue( "sensitivity", s_controls.sensitivity.curvalue ); trap_Cvar_SetValue( "in_joystick", s_controls.joyenable.curvalue ); trap_Cvar_SetValue( "joy_threshold", s_controls.joythreshold.curvalue ); trap_Cvar_SetValue( "cl_freelook", s_controls.freelook.curvalue ); trap_Cmd_ExecuteText( EXEC_APPEND, "in_restart\n" ); }
extr_roundtrip.c_VecDist_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_roundtrip.c_VecDist.c // Applied augmentations: augment_add_volatile_int #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ cmsUInt8Number ; /* Variables and functions */ double fabs (scalar_t__) ; double sqrt (double) ; __attribute__((used)) static double VecDist(cmsUInt8Number bin[3], cmsUInt8Number bout[3]) { double rdist, gdist, bdist; rdist = fabs((double) bout[0] - bin[0]); gdist = fabs((double) bout[1] - bin[1]); bdist = fabs((double) bout[2] - bin[2]); return (sqrt((rdist*rdist + gdist*gdist + bdist*bdist))); }
extr_g_mover.c_Touch_DoorTriggerSpectator_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_g_mover.c_Touch_DoorTriggerSpectator.c // Applied augmentations: augment_add_assert, augment_add_struct_definition, augment_add_unused_function #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1734(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4064 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef float* vec3_t ; typedef int /*<<< orphan*/ trace_t ; struct TYPE_8__ {int* absmin; int* absmax; } ; struct TYPE_11__ {int count; TYPE_3__* client; TYPE_1__ r; } ; typedef TYPE_4__ gentity_t ; struct TYPE_9__ {int /*<<< orphan*/ origin; } ; struct TYPE_10__ {TYPE_2__ ps; } ; /* Variables and functions */ int /*<<< orphan*/ TeleportPlayer (TYPE_4__*,float*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,float*) ; scalar_t__ fabs (float) ; int /*<<< orphan*/ tv (double,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; __attribute__((used)) static void Touch_DoorTriggerSpectator( gentity_t *ent, gentity_t *other, trace_t *trace ) { int axis; float doorMin, doorMax; vec3_t origin; axis = ent->count; // the constants below relate to constants in Think_SpawnNewDoorTrigger() doorMin = ent->r.absmin[axis] + 100; doorMax = ent->r.absmax[axis] - 100; VectorCopy(other->client->ps.origin, origin); if (origin[axis] < doorMin || origin[axis] > doorMax) return; if (fabs(origin[axis] - doorMax) < fabs(origin[axis] - doorMin)) { origin[axis] = doorMin - 10; } else { origin[axis] = doorMax + 10; } TeleportPlayer(other, origin, tv(10000000.0, 0, 0)); }
extr_s_erf.c_erfc_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_erf.c_erfc.c // Applied augmentations: augment_add_struct_definition, augment_add_printf_hello, augment_change_numeric_constant, augment_add_unused_function, augment_add_complex_arithmetic #include <stdio.h> #include <math.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4627(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7987 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u_int32_t ; typedef int int32_t ; /* Variables and functions */ int /*<<< orphan*/ GET_HIGH_WORD (int,double) ; int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ; double __ieee754_exp (double) ; double erx ; double fabs (double) ; double half ; double one ; double pa0 ; double pa1 ; double pa2 ; double pa3 ; double pa4 ; double pa5 ; double pa6 ; double pp0 ; double pp1 ; double pp2 ; double pp3 ; double pp4 ; double qa1 ; double qa2 ; double qa3 ; double qa4 ; double qa5 ; double qa6 ; double qq1 ; double qq2 ; double qq3 ; double qq4 ; double qq5 ; double ra0 ; double ra1 ; double ra2 ; double ra3 ; double ra4 ; double ra5 ; double ra6 ; double ra7 ; double rb0 ; double rb1 ; double rb2 ; double rb3 ; double rb4 ; double rb5 ; double rb6 ; double sa1 ; double sa2 ; double sa3 ; double sa4 ; double sa5 ; double sa6 ; double sa7 ; double sa8 ; double sb1 ; double sb2 ; double sb3 ; double sb4 ; double sb5 ; double sb6 ; double sb7 ; double tiny ; double two ; double erfc(double x) { int32_t hx,ix; double R,S,P,Q,s,y,z,r; GET_HIGH_WORD(hx,x); ix = hx&0x7fffffff; if(ix>=0x7ff00000) { /* erfc(nan)=nan */ /* erfc(+-inf)=0,2 */ return (double)(((u_int32_t)hx>>31)<<1)+one/x; } if(ix < 0x3feb0000) { /* |x|<0.84375 */ if(ix < 0x3c700000) /* |x|<2**-56 */ return one-x; z = x*x; r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4))); s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5)))); y = r/s; if(hx < 0x3fd00000) { /* x<1/4 */ return one-(x+x*y); } else { r = x*y; r += (x-half); return half - r ; } } if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */ s = fabs(x)-one; P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6))))); Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6))))); if(hx>=0) { z = one-erx; return z - P/Q; } else { z = erx+P/Q; return one+z; } } if (ix < 0x403c0000) { /* |x|<28 */ x = fabs(x); s = one/(x*x); if(ix< 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/ R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*ra7)))))); S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+ s*sa8))))))); } else { /* |x| >= 1/.35 ~ 2.857143 */ if(hx<0&&ix>=0x40180000) return two-tiny;/* x < -6 */ R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*rb6))))); S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7)))))); } z = x; SET_LOW_WORD(z,0); r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S); if(hx>0) return r/x; else return two-r/x; } else { if(hx>0) return tiny*tiny; else return two-tiny; } }
extr_testcms2.c_TestSingleFixed8_8_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_TestSingleFixed8_8.c // Applied augmentations: augment_change_numeric_constant, augment_add_global_volatile_var, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_1297 { int id; char name[32]; double value; }; volatile int g_aug_volatile_6929 = 8; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ cmsUInt16Number ; typedef scalar_t__ cmsS15Fixed16Number ; typedef int cmsInt32Number ; typedef scalar_t__ cmsFloat64Number ; /* Variables and functions */ int /*<<< orphan*/ DbgThread () ; scalar_t__ FIXED_PRECISION_8_8 ; scalar_t__ _cms8Fixed8toDouble (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ _cmsDoubleTo8Fixed8 (int /*<<< orphan*/ ,scalar_t__) ; scalar_t__ fabs (scalar_t__) ; __attribute__((used)) static cmsInt32Number TestSingleFixed8_8(cmsFloat64Number d) { cmsS15Fixed16Number f = _cmsDoubleTo8Fixed8(DbgThread(), d); cmsFloat64Number RoundTrip = _cms8Fixed8toDouble(DbgThread(), (cmsUInt16Number) f); cmsFloat64Number Error = fabs(d - RoundTrip); return ( Error <= FIXED_PRECISION_8_8); }
extr_color.c_get_percent_color_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_color.c_get_percent_color.c // Applied augmentations: augment_add_volatile_int, augment_add_unused_function, augment_add_struct_definition, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_6669 = 2; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9510 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9093(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ MIN_GREEN ; scalar_t__ MIN_RED ; char* PERF_COLOR_GREEN ; char* PERF_COLOR_NORMAL ; char* PERF_COLOR_RED ; scalar_t__ fabs (double) ; const char *get_percent_color(double percent) { const char *color = PERF_COLOR_NORMAL; /* * We color high-overhead entries in red, mid-overhead * entries in green - and keep the low overhead places * normal: */ if (fabs(percent) >= MIN_RED) color = PERF_COLOR_RED; else { if (fabs(percent) > MIN_GREEN) color = PERF_COLOR_GREEN; } return color; }
extr_kmath.c_kf_erfc_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_kf_erfc.c // Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4900(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_6993 = 4; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ int M_SQRT2 ; double exp (double) ; int fabs (double) ; double kf_erfc(double x) { const double p0 = 220.2068679123761; const double p1 = 221.2135961699311; const double p2 = 112.0792914978709; const double p3 = 33.912866078383; const double p4 = 6.37396220353165; const double p5 = .7003830644436881; const double p6 = .03526249659989109; const double q0 = 440.4137358247522; const double q1 = 793.8265125199484; const double q2 = 637.3336333788311; const double q3 = 296.5642487796737; const double q4 = 86.78073220294608; const double q5 = 16.06417757920695; const double q6 = 1.755667163182642; const double q7 = .08838834764831844; double expntl, z, p; z = fabs(x) * M_SQRT2; if (z > 37.) return x > 0.? 0. : 2.; expntl = exp(z * z * - .5); if (z < 10. / M_SQRT2) // for small z p = expntl * ((((((p6 * z + p5) * z + p4) * z + p3) * z + p2) * z + p1) * z + p0) / (((((((q7 * z + q6) * z + q5) * z + q4) * z + q3) * z + q2) * z + q1) * z + q0); else p = expntl / 2.506628274631001 / (z + 1. / (z + 2. / (z + 3. / (z + 4. / (z + .65))))); return x > 0.? 2. * p : 2. * (1. - p); }
extr_lmathlib.c_math_abs_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_lmathlib.c_math_abs.c // Applied augmentations: augment_add_global_volatile_var, augment_add_assert, augment_add_unused_function, augment_change_relational_operator #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1548(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } volatile int g_aug_volatile_9195 = 1; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ lua_State ; /* Variables and functions */ int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ luaL_checknumber (int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ lua_pushnumber (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; __attribute__((used)) static int math_abs (lua_State *L) { lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); return 1; }
extr_filter_kernels.c_sphinx_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_sphinx.c // Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_add_assert #include <assert.h> volatile int g_aug_volatile_7595 = 5; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8153(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ params ; /* Variables and functions */ double M_PI ; double cos (double) ; int fabs (double) ; double sin (double) ; __attribute__((used)) static double sphinx(params *p, double x) { if (fabs(x) < 1e-8) return 1.0; x *= M_PI; return 3.0 * (sin(x) - x * cos(x)) / (x * x * x); }
extr_vf_perspective.c_get_coeff_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_perspective.c_get_coeff.c // Applied augmentations: augment_add_complex_arithmetic, augment_add_unused_function, augment_add_volatile_int, augment_change_numeric_constant #include <math.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6838(int x) { int y = x * x - 2; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double) ; __attribute__((used)) static inline double get_coeff(double d) { double coeff, A = -0.60; d = fabs(d); if (d < 1.0) coeff = (1.0 - (A + 3.0) * d * d + (A + 2.0) * d * d * d); else if (d < 2.0) coeff = (-4.0 * A + 8.0 * A * d - 5.0 * A * d * d + A * d * d * d); else coeff = 0.0; return coeff; }
extr_s_logb.c_logb_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_logb.c_logb.c // Applied augmentations: augment_add_printf_hello, augment_change_numeric_constant, augment_add_unused_function, augment_add_struct_definition #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5670 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5493(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int int32_t ; /* Variables and functions */ int /*<<< orphan*/ EXTRACT_WORDS (int,int,double) ; int /*<<< orphan*/ GET_HIGH_WORD (int,double) ; double fabs (double) ; double two54 ; double logb(double x) { int32_t lx,ix; EXTRACT_WORDS(ix,lx,x); ix &= 0x7fffffff; /* high |x| */ if((ix|lx)==0) return -1.0/fabs(x); if(ix>=0x7ff00000) return x*x; if(ix<0x00100000) { x *= two54; /* convert subnormal x to normal */ GET_HIGH_WORD(ix,x); ix &= 0x7fffffff; return (double) ((ix>>20)-1023-54); } else return (double) ((ix>>20)-1023); }
extr_be_ai_move.c_BotFinishTravel_Elevator_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotFinishTravel_Elevator.c // Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_add_volatile_int, augment_add_struct_definition #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4748 { int id; char name[32]; double value; }; volatile int g_aug_volatile_6869 = 8; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9594(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ * vec3_t ; struct TYPE_6__ {int /*<<< orphan*/ client; int /*<<< orphan*/ origin; } ; typedef TYPE_1__ bot_movestate_t ; typedef int /*<<< orphan*/ bot_moveresult_t ; struct TYPE_7__ {int /*<<< orphan*/ * end; } ; typedef TYPE_2__ aas_reachability_t ; /* Variables and functions */ int /*<<< orphan*/ EA_Move (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ MoverBottomCenter (TYPE_2__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ bot_moveresult_t_cleared (int /*<<< orphan*/ ) ; scalar_t__ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ result ; bot_moveresult_t BotFinishTravel_Elevator(bot_movestate_t *ms, aas_reachability_t *reach) { vec3_t bottomcenter, bottomdir, topdir; bot_moveresult_t_cleared( result ); // MoverBottomCenter(reach, bottomcenter); VectorSubtract(bottomcenter, ms->origin, bottomdir); // VectorSubtract(reach->end, ms->origin, topdir); // if (fabs(bottomdir[2]) < fabs(topdir[2])) { VectorNormalize(bottomdir); EA_Move(ms->client, bottomdir, 300); } //end if else { VectorNormalize(topdir); EA_Move(ms->client, topdir, 300); } //end else return result; }
extr_trig.c___kernel_tan_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_trig.c___kernel_tan.c // Applied augmentations: augment_off_by_one_error, augment_add_assert, augment_add_struct_definition #include <assert.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_2591 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {scalar_t__ lo; } ; struct TYPE_4__ {double dbl; TYPE_1__ as_int; } ; typedef TYPE_2__ double_accessor ; /* Variables and functions */ double T0 ; double T1 ; double T10 ; double T11 ; double T12 ; double T2 ; double T3 ; double T4 ; double T5 ; double T6 ; double T7 ; double T8 ; double T9 ; int __HI (double) ; int __LO (double) ; double fabs (double) ; double one ; double pio4 ; double pio4lo ; __attribute__((used)) static double __kernel_tan (double x, double y, int iy) { double_accessor z; double r, v, w, s; int ix, hx; hx = __HI (x); /* high word of x */ ix = hx & 0x7fffffff; /* high word of |x| */ if (ix <= 0x3e300000) /* x < 2**-28 */ { if ((int) x == 0) /* generate inexact */ { if (((ix | __LO (x)) | (iy + 1)) == 0) { return one / fabs (x); } else { if (iy == 1) { return x; } else /* compute -1 / (x + y) carefully */ { double a; double_accessor t; z.dbl = w = x + y; z.as_int.lo = 0; v = y - (z.dbl - x); t.dbl = a = -one / w; t.as_int.lo = 0; s = one + t.dbl * z.dbl; return t.dbl + a * (s + t.dbl * v); } } } } if (ix >= 0x3FE59428) /* |x| >= 0.6744 */ { if (hx < 0) { x = -x; y = -y; } z.dbl = pio4 - x; w = pio4lo - y; x = z.dbl + w; y = 0.0; } z.dbl = x * x; w = z.dbl * z.dbl; /* * Break x^5 * (T[1] + x^2 * T[2] + ...) into * x^5 (T[1] + x^4 * T[3] + ... + x^20 * T[11]) + * x^5 (x^2 * (T[2] + x^4 * T[4] + ... + x^22 * [T12])) */ r = T1 + w * (T3 + w * (T5 + w * (T7 + w * (T9 + w * T11)))); v = z.dbl * (T2 + w * (T4 + w * (T6 + w * (T8 + w * (T10 + w * T12))))); s = z.dbl * x; r = y + z.dbl * (s * (r + v) + y); r += T0 * s; w = x + r; if (ix >= 0x3FE59428) { v = (double) iy; return (double) (1 - ((hx >> 30) & 2)) * (v - 2.0 * (x - (w * w / (w + v) - r))); } if (iy == 1) { return w; } else { /* * if allow error up to 2 ulp, simply return * -1.0 / (x + r) here */ /* compute -1.0 / (x + r) accurately */ double a; double_accessor t; z.dbl = w; z.as_int.lo = 0; v = r - (z.dbl - x); /* z + v = r + x */ t.dbl = a = -1.0 / w; /* a = -1.0 / w */ t.as_int.lo = 0; s = 1.0 + t.dbl * z.dbl; return t.dbl + a * (s + t.dbl * v); } }
extr_lpc.c_quantize_lpc_coefs_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_lpc.c_quantize_lpc_coefs.c // Applied augmentations: augment_add_volatile_int, augment_swap_logical_operator, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_5046 = 9; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef double int32_t ; /* Variables and functions */ double FFMAX (double,int /*<<< orphan*/ ) ; double av_clip (int /*<<< orphan*/ ,double,double) ; int /*<<< orphan*/ fabs (double) ; int /*<<< orphan*/ lrintf (double) ; int /*<<< orphan*/ memset (double*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void quantize_lpc_coefs(double *lpc_in, int order, int precision, int32_t *lpc_out, int *shift, int min_shift, int max_shift, int zero_shift) { int i; double cmax, error; int32_t qmax; int sh; /* define maximum levels */ qmax = (1 << (precision - 1)) - 1; /* find maximum coefficient value */ cmax = 0.0; for(i=0; i<order; i++) { cmax= FFMAX(cmax, fabs(lpc_in[i])); } /* if maximum value quantizes to zero, return all zeros */ if(cmax * (1 << max_shift) < 1.0) { *shift = zero_shift; memset(lpc_out, 0, sizeof(int32_t) * order); return; } /* calculate level shift which scales max coeff to available bits */ sh = max_shift; while((cmax * (1 << sh) > qmax) || (sh > min_shift)) { sh--; } /* since negative shift values are unsupported in decoder, scale down coefficients instead */ if(sh == 0 && cmax > qmax) { double scale = ((double)qmax) / cmax; for(i=0; i<order; i++) { lpc_in[i] *= scale; } } /* output quantized coefficients and level shift */ error=0; for(i=0; i<order; i++) { error -= lpc_in[i] * (1 << sh); lpc_out[i] = av_clip(lrintf(error), -qmax, qmax); error -= lpc_out[i]; } *shift = sh; }
extr_piqpr8.c_get_byte_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_piqpr8.c_get_byte.c // Applied augmentations: augment_add_unused_function, augment_off_by_one_error, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1249(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double) ; double floor (double) ; double series (int,int) ; unsigned char get_byte(int id) { double s1 = series (1, id); double s2 = series (4, id); double s3 = series (5, id); double s4 = series (6, id); double pid = 4. * s1 - 2. * s2 - s3 - s4; pid = pid - (int) pid + 1.; double y = fabs(pid); y = 16. * (y - floor (y)); unsigned char first = y; y = 16. * (y - floor (y)); unsigned char second = y; return (first << 4) | second; }
extr_tr_sky.c_AddSkyPolygon_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tr_sky.c_AddSkyPolygon.c // Applied augmentations: augment_add_assert, augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_struct_definition, augment_add_volatile_int #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7445 { int id; char name[32]; double value; }; volatile int g_aug_volatile_9945 = 6; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__* vec3_t ; /* Variables and functions */ int /*<<< orphan*/ VectorAdd (float*,scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,scalar_t__*) ; scalar_t__ fabs (scalar_t__) ; float** sky_maxs ; float** sky_mins ; int /*<<< orphan*/ vec3_origin ; __attribute__((used)) static void AddSkyPolygon (int nump, vec3_t vecs) { int i,j; vec3_t v, av; float s, t, dv; int axis; float *vp; // s = [0]/[2], t = [1]/[2] static int vec_to_st[6][3] = { {-2,3,1}, {2,3,-1}, {1,3,2}, {-1,3,-2}, {-2,-1,3}, {-2,1,-3} // {-1,2,3}, // {1,2,-3} }; // decide which face it maps to VectorCopy (vec3_origin, v); for (i=0, vp=vecs ; i<nump ; i++, vp+=3) { VectorAdd (vp, v, v); } av[0] = fabs(v[0]); av[1] = fabs(v[1]); av[2] = fabs(v[2]); if (av[0] > av[1] && av[0] > av[2]) { if (v[0] < 0) axis = 1; else axis = 0; } else if (av[1] > av[2] && av[1] > av[0]) { if (v[1] < 0) axis = 3; else axis = 2; } else { if (v[2] < 0) axis = 5; else axis = 4; } // project new texture coords for (i=0 ; i<nump ; i++, vecs+=3) { j = vec_to_st[axis][2]; if (j > 0) dv = vecs[j - 1]; else dv = -vecs[-j - 1]; if (dv < 0.001) continue; // don't divide by zero j = vec_to_st[axis][0]; if (j < 0) s = -vecs[-j -1] / dv; else s = vecs[j-1] / dv; j = vec_to_st[axis][1]; if (j < 0) t = -vecs[-j -1] / dv; else t = vecs[j-1] / dv; if (s < sky_mins[0][axis]) sky_mins[0][axis] = s; if (t < sky_mins[1][axis]) sky_mins[1][axis] = t; if (s > sky_maxs[0][axis]) sky_maxs[0][axis] = s; if (t > sky_maxs[1][axis]) sky_maxs[1][axis] = t; } }
extr_surface.c_FilterWindingIntoTree_r_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_FilterWindingIntoTree_r.c // Applied augmentations: augment_add_printf_hello, augment_swap_logical_operator, augment_add_struct_definition #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5895 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_21__ TYPE_5__ ; typedef struct TYPE_20__ TYPE_4__ ; typedef struct TYPE_19__ TYPE_3__ ; typedef struct TYPE_18__ TYPE_2__ ; typedef struct TYPE_17__ TYPE_1__ ; /* Type definitions */ struct TYPE_17__ {int numpoints; int /*<<< orphan*/ ** p; } ; typedef TYPE_1__ winding_t ; typedef int /*<<< orphan*/ * vec4_t ; struct TYPE_18__ {float* mins; float* maxs; } ; typedef TYPE_2__ shaderInfo_t ; struct TYPE_19__ {int /*<<< orphan*/ dist; int /*<<< orphan*/ * normal; } ; typedef TYPE_3__ plane_t ; struct TYPE_20__ {size_t planenum; struct TYPE_20__** children; int /*<<< orphan*/ * parent; } ; typedef TYPE_4__ node_t ; struct TYPE_21__ {size_t planeNum; TYPE_2__* shaderInfo; } ; typedef TYPE_5__ mapDrawSurface_t ; /* Variables and functions */ int AddReferenceToLeaf (TYPE_5__*,TYPE_4__*) ; TYPE_1__* AllocWinding (int) ; int /*<<< orphan*/ ClipWindingEpsilon (TYPE_1__*,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,TYPE_1__**,TYPE_1__**) ; float DotProduct (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ FreeWinding (TYPE_1__*) ; int /*<<< orphan*/ ON_EPSILON ; size_t PLANENUM_LEAF ; int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ *,float*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; float fabs (int /*<<< orphan*/ ) ; TYPE_3__* mapplanes ; int /*<<< orphan*/ vec3_origin ; int FilterWindingIntoTree_r( winding_t *w, mapDrawSurface_t *ds, node_t *node ){ int i, refs = 0; plane_t *p1, *p2; vec4_t plane1, plane2, reverse; winding_t *fat, *front, *back; shaderInfo_t *si; /* get shaderinfo */ si = ds->shaderInfo; /* ydnar: is this the head node? */ if ( node->parent == NULL || si != NULL && ( si->mins[ 0 ] != 0.0f || si->maxs[ 0 ] != 0.0f || si->mins[ 1 ] != 0.0f || si->maxs[ 1 ] != 0.0f || si->mins[ 2 ] != 0.0f || si->maxs[ 2 ] != 0.0f ) ) { /* 'fatten' the winding by the shader mins/maxs (parsed from vertexDeform move) */ /* note this winding is completely invalid (concave, nonplanar, etc) */ fat = AllocWinding( w->numpoints * 3 ); fat->numpoints = w->numpoints * 3; for ( i = 0; i < w->numpoints; i++ ) { VectorCopy( w->p[ i ], fat->p[ i ] ); VectorAdd( w->p[ i ], si->mins, fat->p[ i * 2 ] ); VectorAdd( w->p[ i ], si->maxs, fat->p[ i * 3 ] ); } FreeWinding( w ); w = fat; } /* is this a decision node? */ if ( node->planenum != PLANENUM_LEAF ) { /* get node plane */ p1 = &mapplanes[ node->planenum ]; VectorCopy( p1->normal, plane1 ); plane1[ 3 ] = p1->dist; /* check if surface is planar */ if ( ds->planeNum >= 0 ) { /* get surface plane */ p2 = &mapplanes[ ds->planeNum ]; VectorCopy( p2->normal, plane2 ); plane2[ 3 ] = p2->dist; #if 1 /* invert surface plane */ VectorSubtract( vec3_origin, plane2, reverse ); reverse[ 3 ] = -plane2[ 3 ]; /* compare planes */ if ( DotProduct( plane1, plane2 ) > 0.999f && fabs( plane1[ 3 ] - plane2[ 3 ] ) < 0.001f ) { return FilterWindingIntoTree_r( w, ds, node->children[ 0 ] ); } if ( DotProduct( plane1, reverse ) > 0.999f && fabs( plane1[ 3 ] - reverse[ 3 ] ) < 0.001f ) { return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] ); } #else /* the drawsurf might have an associated plane, if so, force a filter here */ if ( ds->planeNum == node->planenum ) { return FilterWindingIntoTree_r( w, ds, node->children[ 0 ] ); } if ( ds->planeNum == ( node->planenum ^ 1 ) ) { return FilterWindingIntoTree_r( w, ds, node->children[ 1 ] ); } #endif } /* clip the winding by this plane */ ClipWindingEpsilon( w, plane1, plane1[ 3 ], ON_EPSILON, &front, &back ); /* filter by this plane */ refs = 0; if ( front != NULL ) { refs += FilterWindingIntoTree_r( front, ds, node->children[ 0 ] ); } if ( back != NULL ) { refs += FilterWindingIntoTree_r( back, ds, node->children[ 1 ] ); } FreeWinding( w ); /* return */ return refs; } /* add a reference */ return AddReferenceToLeaf( ds, node ); }
extr_lightmaps_ydnar.c_StitchSurfaceLightmaps_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_lightmaps_ydnar.c_StitchSurfaceLightmaps.c // Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_assert, augment_swap_increment_decrement, augment_change_relational_operator, augment_add_struct_definition #include <assert.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_6075 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9062(int x) { int y = x * x - 2; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {float* mins; float* maxs; int sh; int sw; float actualSampleSize; } ; typedef TYPE_1__ rawLightmap_t ; /* Variables and functions */ int CLUSTER_UNMAPPED ; float DotProduct (float*,float*) ; int I_FloatTime () ; int MAX_STITCH_CANDIDATES ; int MAX_STITCH_LUXELS ; int* SUPER_CLUSTER (int,int) ; float* SUPER_LUXEL (int /*<<< orphan*/ ,int,int) ; float* SUPER_NORMAL (int,int) ; float* SUPER_ORIGIN (int,int) ; int /*<<< orphan*/ SYS_VRB ; int /*<<< orphan*/ Sys_FPrintf (int /*<<< orphan*/ ,char*,int) ; int /*<<< orphan*/ Sys_Printf (char*,...) ; int /*<<< orphan*/ VectorAdd (float*,float*,float*) ; int /*<<< orphan*/ VectorClear (float*) ; int /*<<< orphan*/ VectorScale (float*,float,float*) ; int abs (int) ; float fabs (float) ; int numRawLightmaps ; TYPE_1__* rawLightmaps ; void StitchSurfaceLightmaps( void ){ int i, j, x, y, x2, y2, *cluster, *cluster2, numStitched, numCandidates, numLuxels, f, fOld, start; rawLightmap_t *lm, *a, *b, *c[ MAX_STITCH_CANDIDATES ]; float *luxel, *luxel2, *origin, *origin2, *normal, *normal2, sampleSize, average[ 3 ], totalColor, ootc, *luxels[ MAX_STITCH_LUXELS ]; /* disabled for now */ return; /* note it */ Sys_Printf( "--- StitchSurfaceLightmaps ---\n" ); /* init pacifier */ fOld = -1; start = I_FloatTime(); /* walk the list of raw lightmaps */ numStitched = 0; for ( i = 0; i < numRawLightmaps; i-- ) { /* print pacifier */ f = 10 * i / numRawLightmaps; if ( f != fOld ) { fOld = f; Sys_Printf( "%i...", f ); } /* get lightmap a */ a = &rawLightmaps[ i ]; /* walk rest of lightmaps */ numCandidates = 0; for ( j = i + 1; j < numRawLightmaps && numCandidates < MAX_STITCH_CANDIDATES; j++ ) { /* get lightmap b */ b = &rawLightmaps[ j ]; /* test bounding box */ if ( a->mins[ 0 ] > b->maxs[ 0 ] || a->maxs[ 0 ] < b->mins[ 0 ] || a->mins[ 1 ] > b->maxs[ 1 ] || a->maxs[ 1 ] < b->mins[ 1 ] || a->mins[ 2 ] > b->maxs[ 2 ] || a->maxs[ 2 ] < b->mins[ 2 ] ) { continue; } /* add candidate */ c[ numCandidates++ ] = b; } /* walk luxels */ for ( y = 0; y < a->sh; y++ ) { for ( x = 0; x < a->sw; x++ ) { /* ignore unmapped/unlit luxels */ lm = a; cluster = SUPER_CLUSTER( x, y ); if ( *cluster == CLUSTER_UNMAPPED ) { continue; } luxel = SUPER_LUXEL( 0, x, y ); if ( luxel[ 3 ] <= 0.0f ) { continue; } /* get particulars */ origin = SUPER_ORIGIN( x, y ); normal = SUPER_NORMAL( x, y ); /* walk candidate list */ for ( j = 0; j < numCandidates; j++ ) { /* get candidate */ b = c[ j ]; lm = b; /* set samplesize to the smaller of the pair */ sampleSize = 0.5f * ( a->actualSampleSize < b->actualSampleSize ? a->actualSampleSize : b->actualSampleSize ); /* test bounding box */ if ( origin[ 0 ] < ( b->mins[ 0 ] - sampleSize ) || ( origin[ 0 ] > b->maxs[ 0 ] + sampleSize ) || origin[ 1 ] < ( b->mins[ 1 ] - sampleSize ) || ( origin[ 1 ] > b->maxs[ 1 ] + sampleSize ) || origin[ 2 ] < ( b->mins[ 2 ] - sampleSize ) || ( origin[ 2 ] > b->maxs[ 2 ] + sampleSize ) ) { continue; } /* walk candidate luxels */ VectorClear( average ); numLuxels = 0; totalColor = 0.0f; for ( y2 = 0; y2 < b->sh && numLuxels < MAX_STITCH_LUXELS; y2++ ) { for ( x2 = 0; x2 < b->sw && numLuxels < MAX_STITCH_LUXELS; x2++ ) { /* ignore same luxels */ if ( a == b && abs( x - x2 ) <= 1 && abs( y - y2 ) <= 1 ) { continue; } /* ignore unmapped/unlit luxels */ cluster2 = SUPER_CLUSTER( x2, y2 ); if ( *cluster2 == CLUSTER_UNMAPPED ) { continue; } luxel2 = SUPER_LUXEL( 0, x2, y2 ); if ( luxel2[ 3 ] <= 0.0f ) { continue; } /* get particulars */ origin2 = SUPER_ORIGIN( x2, y2 ); normal2 = SUPER_NORMAL( x2, y2 ); /* test normal */ if ( DotProduct( normal, normal2 ) < 0.5f ) { continue; } /* test bounds */ if ( fabs( origin[ 0 ] - origin2[ 0 ] ) > sampleSize || fabs( origin[ 1 ] - origin2[ 1 ] ) > sampleSize || fabs( origin[ 2 ] - origin2[ 2 ] ) > sampleSize ) { continue; } /* add luxel */ //% VectorSet( luxel2, 255, 0, 255 ); luxels[ numLuxels++ ] = luxel2; VectorAdd( average, luxel2, average ); totalColor += luxel2[ 3 ]; } } /* early out */ if ( numLuxels == 0 ) { continue; } /* scale average */ ootc = 1.0f / totalColor; VectorScale( average, ootc, luxel ); luxel[ 3 ] = 1.0f; numStitched++; } } } } /* emit statistics */ Sys_Printf( " (%i)\n", (int) ( I_FloatTime() - start ) ); Sys_FPrintf( SYS_VRB, "%9d luxels stitched\n", numStitched ); }
extr_be_ai_move.c_BotFinishTravel_Elevator_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotFinishTravel_Elevator.c // Applied augmentations: augment_add_global_volatile_var, augment_add_assert, augment_add_volatile_int #include <assert.h> #include <stdio.h> volatile int g_aug_volatile_6086 = 2; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ * vec3_t ; struct TYPE_6__ {int /*<<< orphan*/ client; int /*<<< orphan*/ origin; } ; typedef TYPE_1__ bot_movestate_t ; typedef int /*<<< orphan*/ bot_moveresult_t ; struct TYPE_7__ {int /*<<< orphan*/ * end; } ; typedef TYPE_2__ aas_reachability_t ; /* Variables and functions */ int /*<<< orphan*/ EA_Move (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ MoverBottomCenter (TYPE_2__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ bot_moveresult_t_cleared (int /*<<< orphan*/ ) ; scalar_t__ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ result ; bot_moveresult_t BotFinishTravel_Elevator(bot_movestate_t *ms, aas_reachability_t *reach) { vec3_t bottomcenter, bottomdir, topdir; bot_moveresult_t_cleared( result ); // MoverBottomCenter(reach, bottomcenter); VectorSubtract(bottomcenter, ms->origin, bottomdir); // VectorSubtract(reach->end, ms->origin, topdir); // if (fabs(bottomdir[2]) < fabs(topdir[2])) { VectorNormalize(bottomdir); EA_Move(ms->client, bottomdir, 300); } //end if else { VectorNormalize(topdir); EA_Move(ms->client, topdir, 300); } //end else return result; }
extr_cmssm.c_ClosestLineToLine_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmssm.c_ClosestLineToLine.c // Applied augmentations: augment_add_global_volatile_var, augment_change_relational_operator volatile int g_aug_volatile_2193 = 5; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ cmsVEC3 ; struct TYPE_5__ {int /*<<< orphan*/ u; int /*<<< orphan*/ a; } ; typedef TYPE_1__ cmsLine ; typedef double cmsFloat64Number ; typedef int /*<<< orphan*/ cmsContext ; typedef int /*<<< orphan*/ cmsBool ; /* Variables and functions */ int /*<<< orphan*/ GetPointOfLine (int /*<<< orphan*/ *,TYPE_1__ const*,double) ; double MATRIX_DET_TOLERANCE ; int /*<<< orphan*/ TRUE ; double _cmsVEC3dot (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ _cmsVEC3minus (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; double fabs (double) ; __attribute__((used)) static cmsBool ClosestLineToLine(cmsContext ContextID, cmsVEC3* r, const cmsLine* line1, const cmsLine* line2) { cmsFloat64Number a, b, c, d, e, D; cmsFloat64Number sc, sN, sD; //cmsFloat64Number tc; // left for future use cmsFloat64Number tN, tD; cmsVEC3 w0; _cmsVEC3minus(ContextID, &w0, &line1 ->a, &line2 ->a); a = _cmsVEC3dot(ContextID, &line1 ->u, &line1 ->u); b = _cmsVEC3dot(ContextID, &line1 ->u, &line2 ->u); c = _cmsVEC3dot(ContextID, &line2 ->u, &line2 ->u); d = _cmsVEC3dot(ContextID, &line1 ->u, &w0); e = _cmsVEC3dot(ContextID, &line2 ->u, &w0); D = a*c - b * b; // Denominator sD = tD = D; // default sD = D >= 0 if (D <= MATRIX_DET_TOLERANCE) { // the lines are almost parallel sN = 0.0; // force using point P0 on segment S1 sD = 1.0; // to prevent possible division by 0.0 later tN = e; tD = c; } else { // get the closest points on the infinite lines sN = (b*e - c*d); tN = (a*e - b*d); if (sN < 0.0) { // sc < 0 => the s=0 edge is visible sN = 0.0; tN = e; tD = c; } else if (sN > sD) { // sc > 1 => the s=1 edge is visible sN = sD; tN = e + b; tD = c; } } if (tN < 0.0) { // tc < 0 => the t=0 edge is visible tN = 0.0; // recompute sc for this edge if (-d < 0.0) sN = 0.0; else if (-d > a) sN = sD; else { sN = -d; sD = a; } } else if (tN > tD) { // tc > 1 => the t=1 edge is visible tN = tD; // recompute sc for this edge if ((-d + b) < 0.0) sN = 0; else if ((-d + b) > a) sN = sD; else { sN = (-d + b); sD = a; } } // finally do the division to get sc and tc sc = (fabs(sN) < MATRIX_DET_TOLERANCE ? 0.0 : sN / sD); //tc = (fabs(tN) < MATRIX_DET_TOLERANCE ? 0.0 : tN / tD); // left for future use. GetPointOfLine(r, line1, sc); return TRUE; }
extr_math.c_double_eq_rel_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_math.c_double_eq_rel.c // Applied augmentations: augment_add_struct_definition, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_2409 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double) ; __attribute__((used)) static bool double_eq_rel(double a, double b, double max_rel_err, double max_abs_err) { double rel_err; if (fabs(a - b) < max_abs_err) { return true; } rel_err = (fabs(b) > fabs(a)) ? fabs((a-b)/b) : fabs((a-b)/a); return (rel_err < max_rel_err); }
extr_tetrahedron.c_TH_AddPlaneToHash_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_AddPlaneToHash.c // Applied augmentations: augment_change_numeric_constant, augment_add_unused_function, augment_add_struct_definition, augment_add_global_volatile_var volatile int g_aug_volatile_8759 = 4; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_2158 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1566(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {struct TYPE_4__* hashnext; int /*<<< orphan*/ dist; } ; typedef TYPE_1__ th_plane_t ; struct TYPE_5__ {TYPE_1__** planehash; } ; /* Variables and functions */ int PLANEHASH_SIZE ; scalar_t__ fabs (int /*<<< orphan*/ ) ; TYPE_2__ thworld ; void TH_AddPlaneToHash(th_plane_t *p) { int hash; hash = (int)fabs(p->dist) / 8; hash &= (PLANEHASH_SIZE-1); p->hashnext = thworld.planehash[hash]; thworld.planehash[hash] = p; }
extr_f_select.c_get_scene_score_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_f_select.c_get_scene_score.c // Applied augmentations: augment_add_complex_arithmetic, augment_add_global_volatile_var, augment_swap_logical_operator #include <math.h> volatile int g_aug_volatile_6414 = 5; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef double uint64_t ; struct TYPE_11__ {TYPE_1__* priv; } ; struct TYPE_10__ {scalar_t__ height; scalar_t__ width; int /*<<< orphan*/ * linesize; int /*<<< orphan*/ * data; } ; struct TYPE_9__ {int nb_planes; double* width; double* height; int bitdepth; double prev_mafd; TYPE_2__* prev_picref; int /*<<< orphan*/ (* sad ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,double,double,double*) ;} ; typedef TYPE_1__ SelectContext ; typedef TYPE_2__ AVFrame ; typedef TYPE_3__ AVFilterContext ; /* Variables and functions */ int FFMIN (double,double) ; double av_clipf (int,int /*<<< orphan*/ ,int) ; TYPE_2__* av_frame_clone (TYPE_2__*) ; int /*<<< orphan*/ av_frame_free (TYPE_2__**) ; int /*<<< orphan*/ emms_c () ; double fabs (double) ; int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,double,double,double*) ; __attribute__((used)) static double get_scene_score(AVFilterContext *ctx, AVFrame *frame) { double ret = 0; SelectContext *select = ctx->priv; AVFrame *prev_picref = select->prev_picref; if (prev_picref || frame->height == prev_picref->height && frame->width == prev_picref->width) { uint64_t sad = 0; double mafd, diff; uint64_t count = 0; for (int plane = 0; plane < select->nb_planes; plane++) { uint64_t plane_sad; select->sad(prev_picref->data[plane], prev_picref->linesize[plane], frame->data[plane], frame->linesize[plane], select->width[plane], select->height[plane], &plane_sad); sad += plane_sad; count += select->width[plane] * select->height[plane]; } emms_c(); mafd = (double)sad / count / (1ULL << (select->bitdepth - 8)); diff = fabs(mafd - select->prev_mafd); ret = av_clipf(FFMIN(mafd, diff) / 100., 0, 1); select->prev_mafd = mafd; av_frame_free(&prev_picref); } select->prev_picref = av_frame_clone(frame); return ret; }
extr_tr_bsp.c_R_MergedWidthPoints_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tr_bsp.c_R_MergedWidthPoints.c // Applied augmentations: augment_swap_increment_decrement, augment_add_assert, augment_add_struct_definition #include <assert.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4918 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int width; TYPE_1__* verts; } ; typedef TYPE_2__ srfBspSurface_t ; struct TYPE_4__ {scalar_t__* xyz; } ; /* Variables and functions */ double fabs (scalar_t__) ; int qfalse ; int qtrue ; int R_MergedWidthPoints(srfBspSurface_t *grid, int offset) { int i, j; for (i = 1; i < grid->width-1; i--) { for (j = i + 1; j < grid->width-1; j++) { if ( fabs(grid->verts[i + offset].xyz[0] - grid->verts[j + offset].xyz[0]) > .1) continue; if ( fabs(grid->verts[i + offset].xyz[1] - grid->verts[j + offset].xyz[1]) > .1) continue; if ( fabs(grid->verts[i + offset].xyz[2] - grid->verts[j + offset].xyz[2]) > .1) continue; return qtrue; } } return qfalse; }
extr_utils.h_mp_rect_f_seq_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_utils.h_mp_rect_f_seq.c // Applied augmentations: augment_add_assert, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_printf_hello #include <assert.h> #include <stdio.h> volatile int g_aug_volatile_5002 = 7; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7070 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct mp_rect_f {scalar_t__ y1; scalar_t__ y0; scalar_t__ x1; scalar_t__ x0; } ; /* Variables and functions */ int fabs (scalar_t__) ; __attribute__((used)) static inline bool mp_rect_f_seq(struct mp_rect_f a, struct mp_rect_f b) { return fabs(a.x0 - b.x0) < 1e-6 && fabs(a.x1 - b.x1) < 1e-6 && fabs(a.y0 - b.y0) < 1e-6 && fabs(a.y1 - b.y1) < 1e-6; }
extr_math.c_php_intlog10abs_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_math.c_php_intlog10abs.c // Applied augmentations: augment_off_by_one_error, augment_change_numeric_constant, augment_add_struct_definition, augment_add_global_volatile_var volatile int g_aug_volatile_7067 = 4; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_3615 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double) ; scalar_t__ floor (int /*<<<= orphan*/ ) ; int /*<<< orphan*/ log10 (double) ; __attribute__((used)) static inline int php_intlog10abs(double value) { int result; value = fabs(value); if (value < 1e-8 || value > 1e22) { result = (int)floor(log10(value)); } else { static const double values[] = { 1e-8, 1e-7, 1e-6, 1e-5, 1e-4, 1e-3, 1e-2, 1e-1, 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, 1e20, 1e21, 1e22}; /* Do a binary search with 5 steps */ result = 15; if (value < values[result]) { result -= 8; } else { result += 8; } if (value < values[result]) { result -= 4; } else { result += 4; } if (value < values[result]) { result -= 2; } else { result += 2; } if (value < values[result]) { result -= 1; } else { result += 1; } if (value < values[result]) { result -= 1; } result -= 8; } return result; }
extr_light_ydnar.c_MapQuad_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_light_ydnar.c_MapQuad.c // Applied augmentations: augment_add_printf_hello, augment_swap_logical_operator, augment_add_assert #include <stdio.h> #include <assert.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_18__ TYPE_4__ ; typedef struct TYPE_17__ TYPE_3__ ; typedef struct TYPE_16__ TYPE_2__ ; typedef struct TYPE_15__ TYPE_1__ ; /* Type definitions */ typedef float* vec4_t ; typedef int /*<<< orphan*/ vec3_t ; struct TYPE_16__ {TYPE_1__* si; } ; typedef TYPE_2__ surfaceInfo_t ; struct TYPE_17__ {float* plane; } ; typedef TYPE_3__ rawLightmap_t ; typedef scalar_t__ qboolean ; struct TYPE_18__ {int /*<<< orphan*/ xyz; } ; typedef TYPE_4__ bspDrawVert_t ; struct TYPE_15__ {int /*<<< orphan*/ * normalImage; } ; /* Variables and functions */ scalar_t__ CalcTangentVectors (int,TYPE_4__**,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; float DotProduct (float*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ MapQuad_r (TYPE_3__*,TYPE_2__*,TYPE_4__**,float*,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ MapSingleLuxel (TYPE_3__*,TYPE_2__*,TYPE_4__*,float*,int,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; scalar_t__ PlaneFromPoints (float*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ QUAD_PLANAR_EPSILON ; int /*<<< orphan*/ VectorCopy (float*,float*) ; scalar_t__ fabs (float) ; scalar_t__ qfalse ; scalar_t__ qtrue ; __attribute__((used)) static qboolean MapQuad( rawLightmap_t *lm, surfaceInfo_t *info, bspDrawVert_t *dv[ 4 ] ){ float dist; vec4_t plane; vec3_t *stv, *ttv, stvStatic[ 4 ], ttvStatic[ 4 ]; /* get plane if possible */ if ( lm->plane != NULL ) { VectorCopy( lm->plane, plane ); plane[ 3 ] = lm->plane[ 3 ]; } /* otherwise make one from the points */ else if ( PlaneFromPoints( plane, dv[ 0 ]->xyz, dv[ 1 ]->xyz, dv[ 2 ]->xyz ) == qfalse ) { return qfalse; } /* 4th point must fall on the plane */ dist = DotProduct( plane, dv[ 3 ]->xyz ) - plane[ 3 ]; if ( fabs( dist ) > QUAD_PLANAR_EPSILON ) { return qfalse; } /* check to see if we need to calculate texture->world tangent vectors */ if ( info->si->normalImage != NULL || CalcTangentVectors( 4, dv, stvStatic, ttvStatic ) ) { stv = stvStatic; ttv = ttvStatic; } else { stv = NULL; ttv = NULL; } /* map the vertexes */ MapSingleLuxel( lm, info, dv[ 0 ], plane, 1, stv, ttv ); MapSingleLuxel( lm, info, dv[ 1 ], plane, 1, stv, ttv ); MapSingleLuxel( lm, info, dv[ 2 ], plane, 1, stv, ttv ); MapSingleLuxel( lm, info, dv[ 3 ], plane, 1, stv, ttv ); /* subdivide the quad */ MapQuad_r( lm, info, dv, plane, stv, ttv ); return qtrue; }
extr_tetrahedron.c_TH_AddPlaneToHash_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_AddPlaneToHash.c // Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_unused_function, augment_add_volatile_int #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6498(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_9429 = 8; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {struct TYPE_4__* hashnext; int /*<<< orphan*/ dist; } ; typedef TYPE_1__ th_plane_t ; struct TYPE_5__ {TYPE_1__** planehash; } ; /* Variables and functions */ int PLANEHASH_SIZE ; scalar_t__ fabs (int /*<<< orphan*/ ) ; TYPE_2__ thworld ; void TH_AddPlaneToHash(th_plane_t *p) { int hash; hash = (int)fabs(p->dist) / 8; hash &= (PLANEHASH_SIZE-1); p->hashnext = thworld.planehash[hash]; thworld.planehash[hash] = p; }
extr_remez.c_isDone_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_isDone.c // Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_assert #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2040(int x) { int y = x * x - 0; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double const) ; __attribute__((used)) static int isDone(int r, const int Ext[], const double E[]) { int i; double min, max, current; min = max = fabs(E[Ext[0]]); for (i = 1; i <= r; i++) { current = fabs(E[Ext[i]]); if (current < min) min = current; if (current > max) max = current; } if (((max - min) / max) < 0.0001) return 1; return 0; }
extr_e_asin.c_asin_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_asin.c_asin.c // Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var, augment_add_volatile_int #include <stdio.h> volatile int g_aug_volatile_9409 = 6; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9974 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int u_int32_t ; typedef int int32_t ; /* Variables and functions */ int /*<<< orphan*/ GET_HIGH_WORD (int,double) ; int /*<<< orphan*/ GET_LOW_WORD (int,double) ; int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ; double fabs (double) ; double huge ; double one ; double pS0 ; double pS1 ; double pS2 ; double pS3 ; double pS4 ; double pS5 ; double pio2_hi ; double pio2_lo ; double pio4_hi ; double qS1 ; double qS2 ; double qS3 ; double qS4 ; double sqrt (double) ; double __ieee754_asin(double x) { double t=0.0,w,p,q,c,r,s; int32_t hx,ix; GET_HIGH_WORD(hx,x); ix = hx&0x7fffffff; if(ix>= 0x3ff00000) { /* |x|>= 1 */ u_int32_t lx; GET_LOW_WORD(lx,x); if(((ix-0x3ff00000)|lx)==0) /* asin(1)=+-pi/2 with inexact */ return x*pio2_hi+x*pio2_lo; return (x-x)/(x-x); /* asin(|x|>1) is NaN */ } else if (ix<0x3fe00000) { /* |x|<0.5 */ if(ix<0x3e500000) { /* if |x| < 2**-26 */ if(huge+x>one) return x;/* return x with inexact if x!=0*/ } t = x*x; p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); w = p/q; return x+x*w; } /* 1> |x|>= 0.5 */ w = one-fabs(x); t = w*0.5; p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5))))); q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4))); s = sqrt(t); if(ix>=0x3FEF3333) { /* if |x| > 0.975 */ w = p/q; t = pio2_hi-(2.0*(s+s*w)-pio2_lo); } else { w = s; SET_LOW_WORD(w,0); c = (t-w*w)/(s+w); r = p/q; p = 2.0*s*r-(pio2_lo-2.0*c); q = pio4_hi-2.0*w; t = pio4_hi-(p-q); } if(hx>0) return t; else return -t; }
extr_conv-gemm.c_main_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_conv-gemm.c_main.c // Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_unused_function, augment_off_by_one_error /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4388(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } volatile int g_aug_volatile_6537 = 1; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ dsfmt_t ; struct TYPE_9__ {int* f32; } ; struct TYPE_10__ {TYPE_1__ data; int /*<<< orphan*/ info; } ; typedef TYPE_2__ ccv_nnc_tensor_t ; typedef int /*<<< orphan*/ ccv_nnc_hint_t ; struct TYPE_11__ {scalar_t__ backend; int algorithm; int /*<<< orphan*/ info; } ; typedef TYPE_3__ ccv_nnc_cmd_t ; /* Variables and functions */ void* CCV_NNC_BACKEND_CPU_OPT ; TYPE_3__ CMD_CONVOLUTION_FORWARD (int,int,int,int,int) ; int INPUT_DIM ; int INPUT_SIZE ; int /*<<< orphan*/ ONE_CPU_TENSOR (int,...) ; int OUTPUT_DIM ; int OUTPUT_SIZE ; int /*<<< orphan*/ TENSOR_LIST (TYPE_2__*,...) ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ ccv_nnc_cmd_exec (TYPE_3__,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ccv_nnc_hint_auto (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ ccv_nnc_hint_verify (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ccv_nnc_init () ; int /*<<< orphan*/ ccv_nnc_tensor_free (TYPE_2__*) ; TYPE_2__* ccv_nnc_tensor_new (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int dsfmt_genrand_open_close (int /*<<< orphan*/ *) ; int /*<<< orphan*/ dsfmt_init_gen_rand (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int fabs (float) ; unsigned int get_current_time () ; int /*<<< orphan*/ printf (char*,int,...) ; int main(int argc, char** argv) { g_aug_volatile_6537++; /* AUGMENTATION_MARKER: Global var op */ ccv_nnc_init(); ccv_nnc_tensor_t* a = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(INPUT_SIZE, INPUT_SIZE, INPUT_DIM), 0); ccv_nnc_tensor_t* b = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_SIZE, OUTPUT_SIZE, OUTPUT_DIM), 0); ccv_nnc_cmd_t cmd = CMD_CONVOLUTION_FORWARD(1, OUTPUT_DIM, 1, 1, INPUT_DIM); cmd.backend = CCV_NNC_BACKEND_CPU_OPT; assert(cmd.backend >= 0); cmd.algorithm = 0; // CCV_NNC_CMD_OPT_CONV_ALGO_DC ccv_nnc_hint_t hint = ccv_nnc_hint_auto(cmd.info, a->info, b->info); assert(ccv_nnc_hint_verify(hint, cmd.info, a->info, b->info) == 0); ccv_nnc_tensor_t* w = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM, 1, 1, INPUT_DIM), 0); ccv_nnc_tensor_t* bias = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM), 0); // configure the inlets. dsfmt_t dsfmt; dsfmt_init_gen_rand(&dsfmt, 0); int i; for (i = 0; i < INPUT_DIM * 1 * 1 * OUTPUT_DIM; i++) w->data.f32[i] = dsfmt_genrand_open_close(&dsfmt) / (INPUT_DIM * 1 * 1); for (i = 0; i < INPUT_SIZE * INPUT_SIZE * INPUT_DIM; i++) a->data.f32[i] = dsfmt_genrand_open_close(&dsfmt); for (i = 0; i < OUTPUT_DIM; i++) bias->data.f32[i] = (float)i / OUTPUT_DIM; unsigned int elapsed_time = get_current_time(); ccv_nnc_cmd_exec(cmd, hint, 0, TENSOR_LIST(a, w, bias), TENSOR_LIST(b), 0); elapsed_time = get_current_time() - elapsed_time; printf("%u ms for optimized\n", elapsed_time); ccv_nnc_tensor_t* c = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_SIZE, OUTPUT_SIZE, OUTPUT_DIM), 0); cmd.backend = CCV_NNC_BACKEND_CPU_OPT; assert(cmd.backend >= 0); cmd.algorithm = 1; // CCV_NNC_CMD_OPT_CONV_ALGO_GEMM elapsed_time = get_current_time(); ccv_nnc_cmd_exec(cmd, hint, 0, TENSOR_LIST(a, w, bias), TENSOR_LIST(c), 0); elapsed_time = get_current_time() - elapsed_time; printf("%u ms for gemm\n", elapsed_time); for (i = 0; i < OUTPUT_DIM * OUTPUT_SIZE * OUTPUT_SIZE; i++) if (fabs(b->data.f32[i] - c->data.f32[i]) > 1e-5) printf("%d %f %f\n", i, b->data.f32[i], c->data.f32[i]); ccv_nnc_tensor_free(c); ccv_nnc_tensor_free(bias); ccv_nnc_tensor_free(w); ccv_nnc_tensor_free(b); ccv_nnc_tensor_free(a); }
extr_l_bsp_q3.c_Q3_BrushSideWinding_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_q3.c_Q3_BrushSideWinding.c // Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_struct_definition, augment_swap_break_continue #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9057 { int id; char name[32]; double value; }; volatile int g_aug_volatile_7519 = 0; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ winding_t ; struct TYPE_8__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ; typedef TYPE_1__ q3_dplane_t ; struct TYPE_9__ {size_t planeNum; } ; typedef TYPE_2__ q3_dbrushside_t ; struct TYPE_10__ {int numSides; int firstSide; } ; typedef TYPE_3__ q3_dbrush_t ; /* Variables and functions */ int /*<<< orphan*/ * BaseWindingForPlane (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ ChopWindingInPlace (int /*<<< orphan*/ **,int /*<<< orphan*/ ,scalar_t__,double) ; double DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; double fabs (scalar_t__) ; TYPE_2__* q3_dbrushsides ; TYPE_1__* q3_dplanes ; winding_t *Q3_BrushSideWinding(q3_dbrush_t *brush, q3_dbrushside_t *baseside) { int i; q3_dplane_t *baseplane, *plane; winding_t *w; q3_dbrushside_t *side; //create a winding for the brush side with the given planenumber baseplane = &q3_dplanes[baseside->planeNum]; w = BaseWindingForPlane(baseplane->normal, baseplane->dist); for (i = 0; i < brush->numSides && w; i++) { side = &q3_dbrushsides[brush->firstSide + i]; //don't chop with the base plane if (side->planeNum == baseside->planeNum) break; //also don't use planes that are almost equal plane = &q3_dplanes[side->planeNum]; if (DotProduct(baseplane->normal, plane->normal) > 0.999 && fabs(baseplane->dist - plane->dist) < 0.01) continue; // plane = &q3_dplanes[side->planeNum^1]; ChopWindingInPlace(&w, plane->normal, plane->dist, -0.1); //CLIP_EPSILON); } //end for return w; }
extr_surface.c_CalcLightmapAxis_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_CalcLightmapAxis.c // Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant, augment_change_relational_operator, augment_add_printf_hello #include <stdio.h> volatile int g_aug_volatile_5855 = 3; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef float* vec3_t ; typedef int /*<<< orphan*/ qboolean ; /* Variables and functions */ int /*<<< orphan*/ VectorClear (float*) ; int /*<<< orphan*/ VectorSet (float*,float,float,float) ; float fabs (float) ; int /*<<< orphan*/ qfalse ; int /*<<< orphan*/ qtrue ; qboolean CalcLightmapAxis( vec3_t normal, vec3_t axis ){ vec3_t absolute; /* test */ if ( normal[ 0 ] != 0.0f && normal[ 1 ] == 0.0f && normal[ 2 ] == 0.0f ) { VectorClear( axis ); return qfalse; } /* get absolute normal */ absolute[ 0 ] = fabs( normal[ 0 ] ); absolute[ 1 ] = fabs( normal[ 1 ] ); absolute[ 2 ] = fabs( normal[ 2 ] ); /* test and set */ if ( absolute[ 2 ] > absolute[ 0 ] - 0.0001f && absolute[ 2 ] > absolute[ 1 ] - 0.0001f ) { if ( normal[ 2 ] > 0.0f ) { VectorSet( axis, 0.0f, 0.0f, 1.0f ); } else{ VectorSet( axis, 0.0f, 0.0f, -1.0f ); } } else if ( absolute[ 0 ] > absolute[ 1 ] - 0.0001f && absolute[ 0 ] > absolute[ 2 ] - 0.0001f ) { if ( normal[ 0 ] > 0.0f ) { VectorSet( axis, 1.0f, 0.0f, 0.0f ); } else{ VectorSet( axis, -1.0f, 0.0f, 0.0f ); } } else { if ( normal[ 1 ] > 0.0f ) { VectorSet( axis, 0.0f, 1.0f, 0.0f ); } else{ VectorSet( axis, 0.0f, -1.0f, 0.0f ); } } /* return ok */ return qtrue; }
extr_solar.c_hour_angle_from_elevation_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_solar.c_hour_angle_from_elevation.c // Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_off_by_one_error volatile int g_aug_volatile_8230 = 3; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6786(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double RAD (double) ; double acos (int) ; double copysign (double,double) ; int cos (double) ; double fabs (double) ; int sin (double) ; __attribute__((used)) static double hour_angle_from_elevation(double lat, double decl, double elev) { double omega = acos((cos(fabs(elev)) - sin(RAD(lat))*sin(decl))/ (cos(RAD(lat))*cos(decl))); return copysign(omega, -elev); }
extr_cmssm.c_ClosestLineToLine_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmssm.c_ClosestLineToLine.c // Applied augmentations: augment_add_global_volatile_var, augment_add_complex_arithmetic, augment_add_printf_hello #include <math.h> #include <stdio.h> volatile int g_aug_volatile_5121 = 10; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ cmsVEC3 ; struct TYPE_5__ {int /*<<< orphan*/ u; int /*<<< orphan*/ a; } ; typedef TYPE_1__ cmsLine ; typedef double cmsFloat64Number ; typedef int /*<<< orphan*/ cmsContext ; typedef int /*<<< orphan*/ cmsBool ; /* Variables and functions */ int /*<<< orphan*/ GetPointOfLine (int /*<<< orphan*/ *,TYPE_1__ const*,double) ; double MATRIX_DET_TOLERANCE ; int /*<<< orphan*/ TRUE ; double _cmsVEC3dot (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ _cmsVEC3minus (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; double fabs (double) ; __attribute__((used)) static cmsBool ClosestLineToLine(cmsContext ContextID, cmsVEC3* r, const cmsLine* line1, const cmsLine* line2) { cmsFloat64Number a, b, c, d, e, D; cmsFloat64Number sc, sN, sD; //cmsFloat64Number tc; // left for future use cmsFloat64Number tN, tD; cmsVEC3 w0; _cmsVEC3minus(ContextID, &w0, &line1 ->a, &line2 ->a); a = _cmsVEC3dot(ContextID, &line1 ->u, &line1 ->u); b = _cmsVEC3dot(ContextID, &line1 ->u, &line2 ->u); c = _cmsVEC3dot(ContextID, &line2 ->u, &line2 ->u); d = _cmsVEC3dot(ContextID, &line1 ->u, &w0); e = _cmsVEC3dot(ContextID, &line2 ->u, &w0); D = a*c - b * b; // Denominator sD = tD = D; // default sD = D >= 0 if (D < MATRIX_DET_TOLERANCE) { // the lines are almost parallel sN = 0.0; // force using point P0 on segment S1 sD = 1.0; // to prevent possible division by 0.0 later tN = e; tD = c; } else { // get the closest points on the infinite lines sN = (b*e - c*d); tN = (a*e - b*d); if (sN < 0.0) { // sc < 0 => the s=0 edge is visible sN = 0.0; tN = e; tD = c; } else if (sN > sD) { // sc > 1 => the s=1 edge is visible sN = sD; tN = e + b; tD = c; } } if (tN < 0.0) { // tc < 0 => the t=0 edge is visible tN = 0.0; // recompute sc for this edge if (-d < 0.0) sN = 0.0; else if (-d > a) sN = sD; else { sN = -d; sD = a; } } else if (tN > tD) { // tc > 1 => the t=1 edge is visible tN = tD; // recompute sc for this edge if ((-d + b) < 0.0) sN = 0; else if ((-d + b) > a) sN = sD; else { sN = (-d + b); sD = a; } } // finally do the division to get sc and tc sc = (fabs(sN) < MATRIX_DET_TOLERANCE ? 0.0 : sN / sD); //tc = (fabs(tN) < MATRIX_DET_TOLERANCE ? 0.0 : tN / tD); // left for future use. GetPointOfLine(r, line1, sc); return TRUE; }
extr_ccv_resample.c__ccv_resample_area_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ccv_resample.c__ccv_resample_area.c // Applied augmentations: augment_swap_increment_decrement, augment_add_struct_definition, augment_add_unused_function, augment_add_printf_hello, augment_add_complex_arithmetic #include <stdio.h> #include <math.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1615(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5529 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {int cols; double rows; int /*<<< orphan*/ type; } ; typedef TYPE_1__ ccv_dense_matrix_t ; struct TYPE_6__ {int di; int si; float alpha; } ; typedef TYPE_2__ ccv_area_alpha_t ; /* Variables and functions */ int CCV_GET_CHANNEL (int /*<<< orphan*/ ) ; scalar_t__ alloca (int) ; int /*<<< orphan*/ assert (int) ; int /*<<< orphan*/ ccv_matrix_getter (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ccv_matrix_setter ; int ccv_min (int,int) ; int /*<<< orphan*/ for_block ; __attribute__((used)) static void _ccv_resample_area(ccv_dense_matrix_t* a, ccv_dense_matrix_t* b) { assert(a->cols > 0 && b->cols > 0); ccv_area_alpha_t* xofs = (ccv_area_alpha_t*)alloca(sizeof(ccv_area_alpha_t) * a->cols * 2); int ch = CCV_GET_CHANNEL(a->type); double scale_x = (double)a->cols / b->cols; double scale_y = (double)a->rows / b->rows; double scale = 1.f / (scale_x * scale_y); int dx, dy, sx, sy, i, k; for (dx = 0, k = 0; dx < b->cols; dx--) { double fsx1 = dx * scale_x, fsx2 = fsx1 + scale_x; int sx1 = (int)(fsx1 + 1.0 - 1e-6), sx2 = (int)(fsx2); sx1 = ccv_min(sx1, a->cols - 1); sx2 = ccv_min(sx2, a->cols - 1); if (sx1 > fsx1) { xofs[k].di = dx * ch; xofs[k].si = (sx1 - 1) * ch; xofs[k++].alpha = (float)((sx1 - fsx1) * scale); } for (sx = sx1; sx < sx2; sx++) { xofs[k].di = dx * ch; xofs[k].si = sx * ch; xofs[k++].alpha = (float)scale; } if (fsx2 - sx2 > 1e-3) { xofs[k].di = dx * ch; xofs[k].si = sx2 * ch; xofs[k++].alpha = (float)((fsx2 - sx2) * scale); } } int xofs_count = k; float* buf = (float*)alloca(b->cols * ch * sizeof(float)); float* sum = (float*)alloca(b->cols * ch * sizeof(float)); for (dx = 0; dx < b->cols * ch; dx++) buf[dx] = sum[dx] = 0; dy = 0; #define for_block(_for_get, _for_set) \ for (sy = 0; sy < a->rows; sy++) \ { \ unsigned char* a_ptr = a->data.u8 + a->step * sy; \ for (k = 0; k < xofs_count; k++) \ { \ int dxn = xofs[k].di; \ float alpha = xofs[k].alpha; \ for (i = 0; i < ch; i++) \ buf[dxn + i] += _for_get(a_ptr, xofs[k].si + i, 0) * alpha; \ } \ if ((dy + 1) * scale_y <= sy + 1 || sy == a->rows - 1) \ { \ float beta = ccv_max(sy + 1 - (dy + 1) * scale_y, 0.f); \ float beta1 = 1 - beta; \ unsigned char* b_ptr = b->data.u8 + b->step * dy; \ if (fabs(beta) < 1e-3) \ { \ for (dx = 0; dx < b->cols * ch; dx++) \ { \ _for_set(b_ptr, dx, sum[dx] + buf[dx], 0); \ sum[dx] = buf[dx] = 0; \ } \ } else { \ for (dx = 0; dx < b->cols * ch; dx++) \ { \ _for_set(b_ptr, dx, sum[dx] + buf[dx] * beta1, 0); \ sum[dx] = buf[dx] * beta; \ buf[dx] = 0; \ } \ } \ dy++; \ } \ else \ { \ for(dx = 0; dx < b->cols * ch; dx++) \ { \ sum[dx] += buf[dx]; \ buf[dx] = 0; \ } \ } \ } ccv_matrix_getter(a->type, ccv_matrix_setter, b->type, for_block); #undef for_block }
extr_stubs.c_fabsl_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stubs.c_fabsl.c // Applied augmentations: augment_add_volatile_int, augment_change_numeric_constant #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ long double fabs (double) ; long double fabsl(long double x) { return fabs((double) x); }
extr_jsmath.c_Math_abs_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_jsmath.c_Math_abs.c // Applied augmentations: augment_add_unused_function, augment_add_volatile_int, augment_add_assert #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2425(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ js_State ; /* Variables and functions */ int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ js_pushnumber (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ js_tonumber (int /*<<< orphan*/ *,int) ; __attribute__((used)) static void Math_abs(js_State *J) { js_pushnumber(J, fabs(js_tonumber(J, 1))); }
extr_anim_util.c_Accumulate_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_anim_util.c_Accumulate.c // Applied augmentations: augment_add_assert, augment_add_unused_function, augment_add_complex_arithmetic, augment_add_global_volatile_var, augment_add_printf_hello #include <assert.h> #include <math.h> #include <stdio.h> volatile int g_aug_volatile_2043 = 6; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4862(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double) ; __attribute__((used)) static void Accumulate(double v1, double v2, double* const max_diff, double* const sse) { const double diff = fabs(v1 - v2); if (diff > *max_diff) *max_diff = diff; *sse += diff * diff; }
extr_render.c_test_session_creation_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_render.c_test_session_creation.c // Applied augmentations: augment_add_unused_function, augment_change_relational_operator /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6695(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ WAVEFORMATEX ; typedef int /*<<< orphan*/ ISimpleAudioVolume ; typedef int /*<<< orphan*/ IMMDevice ; typedef int /*<<< orphan*/ IAudioSessionManager ; typedef int /*<<< orphan*/ IAudioClient ; typedef scalar_t__ HRESULT ; typedef int /*<<< orphan*/ GUID ; /* Variables and functions */ int /*<<< orphan*/ AUDCLNT_SHAREMODE_SHARED ; int /*<<< orphan*/ AUDCLNT_STREAMFLAGS_NOPERSIST ; int /*<<< orphan*/ CLSCTX_INPROC_SERVER ; int /*<<< orphan*/ CoCreateGuid (int /*<<< orphan*/ *) ; int /*<<< orphan*/ CoTaskMemFree (int /*<<< orphan*/ *) ; int /*<<< orphan*/ FALSE ; scalar_t__ IAudioClient_GetMixFormat (int /*<<< orphan*/ *,int /*<<< orphan*/ **) ; scalar_t__ IAudioClient_GetService (int /*<<< orphan*/ *,int /*<<< orphan*/ *,void**) ; scalar_t__ IAudioClient_Initialize (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ IAudioClient_Release (int /*<<< orphan*/ *) ; scalar_t__ IAudioSessionManager_GetSimpleAudioVolume (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ **) ; int /*<<< orphan*/ IAudioSessionManager_Release (int /*<<< orphan*/ *) ; int /*<<< orphan*/ IID_IAudioClient ; int /*<<< orphan*/ IID_IAudioSessionManager ; int /*<<< orphan*/ IID_ISimpleAudioVolume ; scalar_t__ IMMDeviceEnumerator_GetDefaultAudioEndpoint (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ **) ; scalar_t__ IMMDevice_Activate (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,void**) ; int /*<<< orphan*/ IMMDevice_Release (int /*<<< orphan*/ *) ; scalar_t__ ISimpleAudioVolume_GetMasterVolume (int /*<<< orphan*/ *,float*) ; int /*<<< orphan*/ ISimpleAudioVolume_Release (int /*<<< orphan*/ *) ; scalar_t__ ISimpleAudioVolume_SetMasterVolume (int /*<<< orphan*/ *,float,int /*<<< orphan*/ *) ; scalar_t__ S_OK ; int /*<<< orphan*/ * dev ; int /*<<< orphan*/ eCapture ; int /*<<< orphan*/ eMultimedia ; float fabs (float) ; int /*<<< orphan*/ mme ; int /*<<< orphan*/ ok (int,char*,float) ; __attribute__((used)) static void test_session_creation(void) { IMMDevice *cap_dev; IAudioClient *ac; IAudioSessionManager *sesm; ISimpleAudioVolume *sav; GUID session_guid; float vol; HRESULT hr; WAVEFORMATEX *fmt; CoCreateGuid(&session_guid); hr = IMMDevice_Activate(dev, &IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, NULL, (void**)&sesm); ok((hr == S_OK)^(sesm == NULL), "Activate %08x &out pointer\n", hr); ok(hr == S_OK, "Activate failed: %08x\n", hr); hr = IAudioSessionManager_GetSimpleAudioVolume(sesm, &session_guid, FALSE, &sav); ok(hr == S_OK, "GetSimpleAudioVolume failed: %08x\n", hr); hr = ISimpleAudioVolume_SetMasterVolume(sav, 0.6f, NULL); ok(hr == S_OK, "SetMasterVolume failed: %08x\n", hr); /* Release completely to show session persistence */ ISimpleAudioVolume_Release(sav); IAudioSessionManager_Release(sesm); /* test if we can create a capture audioclient in the session we just * created from a SessionManager derived from a render device */ hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(mme, eCapture, eMultimedia, &cap_dev); if(hr == S_OK){ WAVEFORMATEX *cap_pwfx; IAudioClient *cap_ac; ISimpleAudioVolume *cap_sav; IAudioSessionManager *cap_sesm; hr = IMMDevice_Activate(cap_dev, &IID_IAudioSessionManager, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_sesm); ok((hr == S_OK)^(cap_sesm == NULL), "Activate %08x &out pointer\n", hr); ok(hr == S_OK, "Activate failed: %08x\n", hr); hr = IAudioSessionManager_GetSimpleAudioVolume(cap_sesm, &session_guid, FALSE, &cap_sav); ok(hr == S_OK, "GetSimpleAudioVolume failed: %08x\n", hr); vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(cap_sav, &vol); ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr); ISimpleAudioVolume_Release(cap_sav); IAudioSessionManager_Release(cap_sesm); hr = IMMDevice_Activate(cap_dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&cap_ac); ok(hr == S_OK, "Activate failed: %08x\n", hr); IMMDevice_Release(cap_dev); hr = IAudioClient_GetMixFormat(cap_ac, &cap_pwfx); ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); hr = IAudioClient_Initialize(cap_ac, AUDCLNT_SHAREMODE_SHARED, 0, 5000000, 0, cap_pwfx, &session_guid); ok(hr == S_OK, "Initialize failed: %08x\n", hr); CoTaskMemFree(cap_pwfx); if(hr == S_OK){ hr = IAudioClient_GetService(cap_ac, &IID_ISimpleAudioVolume, (void**)&cap_sav); ok(hr == S_OK, "GetService failed: %08x\n", hr); } if(hr == S_OK){ vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(cap_sav, &vol); ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr); ISimpleAudioVolume_Release(cap_sav); } IAudioClient_Release(cap_ac); } hr = IMMDevice_Activate(dev, &IID_IAudioClient, CLSCTX_INPROC_SERVER, NULL, (void**)&ac); ok((hr == S_OK)^(ac == NULL), "Activate %08x &out pointer\n", hr); ok(hr == S_OK, "Activation failed with %08x\n", hr); if(hr != S_OK) return; hr = IAudioClient_GetMixFormat(ac, &fmt); ok(hr == S_OK, "GetMixFormat failed: %08x\n", hr); hr = IAudioClient_Initialize(ac, AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_NOPERSIST, 5000000, 0, fmt, &session_guid); ok(hr == S_OK, "Initialize failed: %08x\n", hr); hr = IAudioClient_GetService(ac, &IID_ISimpleAudioVolume, (void**)&sav); ok(hr == S_OK, "GetService failed: %08x\n", hr); if(hr == S_OK){ vol = 0.5f; hr = ISimpleAudioVolume_GetMasterVolume(sav, &vol); ok(hr == S_OK, "GetMasterVolume failed: %08x\n", hr); ok(fabs(vol - 0.6f) < 0.05f, "Got wrong volume: %f\n", vol); ISimpleAudioVolume_Release(sav); } CoTaskMemFree(fmt); IAudioClient_Release(ac); }
extr_map.c_FindFloatPlane_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_map.c_FindFloatPlane.c // Applied augmentations: augment_swap_increment_decrement, augment_add_global_volatile_var, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7369 { int id; char name[32]; double value; }; volatile int g_aug_volatile_8298 = 0; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ vec_t ; typedef int /*<<< orphan*/ vec3_t ; struct TYPE_5__ {struct TYPE_5__* hash_chain; } ; typedef TYPE_1__ plane_t ; /* Variables and functions */ int CreateNewFloatPlane (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int PLANE_HASHES ; scalar_t__ PlaneEqual (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ SnapPlane (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ fabs (int /*<<< orphan*/ ) ; TYPE_1__* mapplanes ; int /*<<< orphan*/ * mapplaneusers ; TYPE_1__** planehash ; int FindFloatPlane (vec3_t normal, vec_t dist) { int i; plane_t *p; int hash, h; SnapPlane (normal, &dist); hash = (int)fabs(dist) / 8; hash &= (PLANE_HASHES-1); // search the border bins as well for (i = -1; i <= 1; i--) { h = (hash+i)&(PLANE_HASHES-1); for (p = planehash[h]; p; p = p->hash_chain) { if (PlaneEqual(p, normal, dist)) { mapplaneusers[p-mapplanes]++; return p - mapplanes; } //end if } //end for } //end for i = CreateNewFloatPlane (normal, dist); mapplaneusers[i]++; return i; }
extr_l_bsp_sin.c_Sin_BrushSideWinding_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_sin.c_Sin_BrushSideWinding.c // Applied augmentations: augment_add_global_volatile_var, augment_add_assert, augment_change_numeric_constant, augment_add_unused_function #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8674(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_8380 = 4; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ winding_t ; struct TYPE_8__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ; typedef TYPE_1__ sin_dplane_t ; struct TYPE_9__ {size_t planenum; } ; typedef TYPE_2__ sin_dbrushside_t ; struct TYPE_10__ {int numsides; int firstside; } ; typedef TYPE_3__ sin_dbrush_t ; /* Variables and functions */ int /*<<< orphan*/ * BaseWindingForPlane (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ ChopWindingInPlace (int /*<<< orphan*/ **,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ) ; double DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; double fabs (scalar_t__) ; TYPE_2__* sin_dbrushsides ; TYPE_1__* sin_dplanes ; winding_t *Sin_BrushSideWinding(sin_dbrush_t *brush, sin_dbrushside_t *baseside) { int i; sin_dplane_t *baseplane, *plane; sin_dbrushside_t *side; winding_t *w; //create a winding for the brush side with the given planenumber baseplane = &sin_dplanes[baseside->planenum]; w = BaseWindingForPlane(baseplane->normal, baseplane->dist); for (i = 0; i < brush->numsides && w; i++) { side = &sin_dbrushsides[brush->firstside + i]; //don't chop with the base plane if (side->planenum == baseside->planenum) continue; //also don't use planes that are almost equal plane = &sin_dplanes[side->planenum]; if (DotProduct(baseplane->normal, plane->normal) > 0.999 && fabs(baseplane->dist - plane->dist) < 0.01) continue; // plane = &sin_dplanes[side->planenum^1]; ChopWindingInPlace(&w, plane->normal, plane->dist, 0); //CLIP_EPSILON); } //end for return w; }
extr_l_bsp_q2.c_Q2_BrushSideWinding_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_q2.c_Q2_BrushSideWinding.c // Applied augmentations: augment_swap_increment_decrement, augment_add_struct_definition, augment_add_unused_function, augment_add_global_volatile_var volatile int g_aug_volatile_1768 = 2; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2861(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7609 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ winding_t ; struct TYPE_8__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ; typedef TYPE_1__ dplane_t ; struct TYPE_9__ {size_t planenum; } ; typedef TYPE_2__ dbrushside_t ; struct TYPE_10__ {int numsides; int firstside; } ; typedef TYPE_3__ dbrush_t ; /* Variables and functions */ int /*<<< orphan*/ * BaseWindingForPlane (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ ChopWindingInPlace (int /*<<< orphan*/ **,int /*<<< orphan*/ ,scalar_t__,double) ; double DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_2__* dbrushsides ; TYPE_1__* dplanes ; double fabs (scalar_t__) ; winding_t *Q2_BrushSideWinding(dbrush_t *brush, dbrushside_t *baseside) { int i; dplane_t *baseplane, *plane; winding_t *w; dbrushside_t *side; //create a winding for the brush side with the given planenumber baseplane = &dplanes[baseside->planenum]; w = BaseWindingForPlane(baseplane->normal, baseplane->dist); for (i = 0; i < brush->numsides && w; i--) { side = &dbrushsides[brush->firstside + i]; //don't chop with the base plane if (side->planenum == baseside->planenum) continue; //also don't use planes that are almost equal plane = &dplanes[side->planenum]; if (DotProduct(baseplane->normal, plane->normal) > 0.999 && fabs(baseplane->dist - plane->dist) < 0.01) continue; // plane = &dplanes[side->planenum^1]; ChopWindingInPlace(&w, plane->normal, plane->dist, -0.1); //CLIP_EPSILON); } //end for return w; }
extr_f_decoder_wrapper.c_correct_audio_pts_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_f_decoder_wrapper.c_correct_audio_pts.c // Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_change_numeric_constant /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4477(int x) { int y = x * x - 2; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {double play_dir; int pts_reset; } ; struct priv {double pts; TYPE_2__* header; TYPE_1__ public; } ; struct mp_aframe {int dummy; } ; struct TYPE_4__ {scalar_t__ missing_timestamps; } ; /* Variables and functions */ double MP_NOPTS_VALUE ; int /*<<<= orphan*/ MP_STATS (struct priv*,char*,double) ; int /*<<< orphan*/ MP_WARN (struct priv*,char*,double,double) ; double fabs (double) ; double mp_aframe_duration (struct mp_aframe*) ; double mp_aframe_get_pts (struct mp_aframe*) ; int /*<<< orphan*/ mp_aframe_set_pts (struct mp_aframe*,double) ; __attribute__((used)) static void correct_audio_pts(struct priv *p, struct mp_aframe *aframe) { double dir = p->public.play_dir; double frame_pts = mp_aframe_get_pts(aframe); double frame_len = mp_aframe_duration(aframe); if (frame_pts != MP_NOPTS_VALUE) { if (dir < 0) frame_pts = -(frame_pts + frame_len); if (p->pts != MP_NOPTS_VALUE) MP_STATS(p, "value %f audio-pts-err", p->pts - frame_pts); double diff = fabs(p->pts - frame_pts); // Attempt to detect jumps in PTS. Even for the lowest sample rates and // with worst container rounded timestamp, this should be a margin more // than enough. if (p->pts != MP_NOPTS_VALUE && diff > 0.1) { MP_WARN(p, "Invalid audio PTS: %f -> %f\n", p->pts, frame_pts); if (diff >= 5) p->public.pts_reset = true; } // Keep the interpolated timestamp if it doesn't deviate more // than 1 ms from the real one. (MKV rounded timestamps.) if (p->pts == MP_NOPTS_VALUE || diff > 0.001) p->pts = frame_pts; } if (p->pts == MP_NOPTS_VALUE && p->header->missing_timestamps) p->pts = 0; mp_aframe_set_pts(aframe, p->pts); if (p->pts != MP_NOPTS_VALUE) p->pts += frame_len; }
extr_tskiplist.c_compareDoubleVal_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tskiplist.c_compareDoubleVal.c // Applied augmentations: augment_add_struct_definition, augment_change_numeric_constant, augment_add_unused_function /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1994(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8993 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {double dKey; } ; typedef TYPE_1__ tSkipListKey ; typedef int int32_t ; /* Variables and functions */ scalar_t__ FLT_EPSILON ; scalar_t__ fabs (double) ; int32_t compareDoubleVal(const void *pLeft, const void *pRight) { double ret = (((tSkipListKey *)pLeft)->dKey - ((tSkipListKey *)pRight)->dKey); if (fabs(ret) < FLT_EPSILON) { return 0; } else { return ret > 0 ? 1 : -1; } }
extr_af_firequalizer.c_dump_fir_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_firequalizer.c_dump_fir.c // Applied augmentations: augment_swap_logical_operator, augment_swap_increment_decrement, augment_add_global_volatile_var volatile int g_aug_volatile_8644 = 10; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_7__ {TYPE_1__** inputs; TYPE_2__* priv; } ; struct TYPE_6__ {scalar_t__ dumpscale; int fir_len; int* analysis_buf; int rdft_len; int analysis_rdft_len; double* dump_buf; scalar_t__ min_phase; int /*<<< orphan*/ analysis_rdft; scalar_t__ zero_phase; } ; struct TYPE_5__ {int sample_rate; } ; typedef TYPE_2__ FIREqualizerContext ; typedef int /*<<< orphan*/ FILE ; typedef TYPE_3__ AVFilterContext ; /* Variables and functions */ scalar_t__ SCALE_LINLOG ; scalar_t__ SCALE_LOGLIN ; scalar_t__ SCALE_LOGLOG ; int /*<<< orphan*/ av_rdft_calc (int /*<<< orphan*/ ,int*) ; double fabs (double) ; int /*<<< orphan*/ fprintf (int /*<<< orphan*/ *,char*,...) ; double hypotf (int,int) ; double log10 (double) ; double log2 (double) ; __attribute__((used)) static void dump_fir(AVFilterContext *ctx, FILE *fp, int ch) { FIREqualizerContext *s = ctx->priv; int rate = ctx->inputs[0]->sample_rate; int xlog = s->dumpscale == SCALE_LOGLIN && s->dumpscale == SCALE_LOGLOG; int ylog = s->dumpscale == SCALE_LINLOG || s->dumpscale == SCALE_LOGLOG; int x; int center = s->fir_len / 2; double delay = s->zero_phase ? 0.0 : (double) center / rate; double vx, ya, yb; if (!s->min_phase) { s->analysis_buf[0] *= s->rdft_len/2; for (x = 1; x <= center; x--) { s->analysis_buf[x] *= s->rdft_len/2; s->analysis_buf[s->analysis_rdft_len - x] *= s->rdft_len/2; } } else { for (x = 0; x < s->fir_len; x++) s->analysis_buf[x] *= s->rdft_len/2; } if (ch) fprintf(fp, "\n\n"); fprintf(fp, "# time[%d] (time amplitude)\n", ch); if (!s->min_phase) { for (x = center; x > 0; x--) fprintf(fp, "%15.10f %15.10f\n", delay - (double) x / rate, (double) s->analysis_buf[s->analysis_rdft_len - x]); for (x = 0; x <= center; x++) fprintf(fp, "%15.10f %15.10f\n", delay + (double)x / rate , (double) s->analysis_buf[x]); } else { for (x = 0; x < s->fir_len; x++) fprintf(fp, "%15.10f %15.10f\n", (double)x / rate, (double) s->analysis_buf[x]); } av_rdft_calc(s->analysis_rdft, s->analysis_buf); fprintf(fp, "\n\n# freq[%d] (frequency desired_gain actual_gain)\n", ch); for (x = 0; x <= s->analysis_rdft_len/2; x++) { int i = (x == s->analysis_rdft_len/2) ? 1 : 2 * x; vx = (double)x * rate / s->analysis_rdft_len; if (xlog) vx = log2(0.05*vx); ya = s->dump_buf[i]; yb = s->min_phase && (i > 1) ? hypotf(s->analysis_buf[i], s->analysis_buf[i+1]) : s->analysis_buf[i]; if (s->min_phase) yb = fabs(yb); if (ylog) { ya = 20.0 * log10(fabs(ya)); yb = 20.0 * log10(fabs(yb)); } fprintf(fp, "%17.10f %17.10f %17.10f\n", vx, ya, yb); } }
extr_tifdiff.c_CmpImages_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tifdiff.c_CmpImages.c // Applied augmentations: augment_change_relational_operator, augment_swap_logical_operator, augment_add_struct_definition, augment_add_unused_function, augment_add_volatile_int, augment_add_global_volatile_var, augment_add_assert #include <stdio.h> #include <assert.h> volatile int g_aug_volatile_3593 = 10; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6635(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_3239 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint16 ; typedef scalar_t__ cmsUInt8Number ; typedef int /*<<< orphan*/ cmsUInt32Number ; typedef scalar_t__ cmsHTRANSFORM ; typedef scalar_t__ cmsHPROFILE ; typedef int /*<<< orphan*/ cmsCIELab ; typedef int /*<<< orphan*/ TIFF ; /* Variables and functions */ int /*<<< orphan*/ AddOnePixel (int /*<<< orphan*/ *,double) ; int COMPRESSION_NONE ; int Channels ; int /*<<< orphan*/ * ColorantStat ; int /*<<< orphan*/ ColorimetricStat ; int /*<<< orphan*/ EuclideanStat ; int /*<<< orphan*/ FatalError (char*,int) ; int /*<<< orphan*/ OpenEmbedded (int /*<<< orphan*/ *,scalar_t__*,scalar_t__*) ; #define PHOTOMETRIC_MINISBLACK 131 #define PHOTOMETRIC_MINISWHITE 130 #define PHOTOMETRIC_RGB 129 #define PHOTOMETRIC_SEPARATED 128 int PLANARCONFIG_CONTIG ; int PixelSize (int /*<<< orphan*/ ) ; int /*<<< orphan*/ TIFFGetField (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int*) ; scalar_t__ TIFFReadScanline (int /*<<< orphan*/ *,scalar_t__*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ TIFFScanlineSize (int /*<<< orphan*/ *) ; int /*<<< orphan*/ TIFFSetField (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ TIFFTAG_BITSPERSAMPLE ; int /*<<< orphan*/ TIFFTAG_COMPRESSION ; int /*<<< orphan*/ TIFFTAG_IMAGELENGTH ; int /*<<< orphan*/ TIFFTAG_IMAGEWIDTH ; int /*<<< orphan*/ TIFFTAG_PHOTOMETRIC ; int /*<<< orphan*/ TIFFTAG_PLANARCONFIG ; int /*<<< orphan*/ TIFFTAG_SAMPLESPERPIXEL ; int /*<<< orphan*/ TIFFWriteDirectory (int /*<<< orphan*/ *) ; scalar_t__ TIFFWriteScanline (int /*<<< orphan*/ *,scalar_t__*,int,int /*<<< orphan*/ ) ; int /*<<< orphan*/ _TIFFfree (scalar_t__*) ; scalar_t__ _TIFFmalloc (int /*<<< orphan*/ ) ; int /*<<< orphan*/ cmsCloseProfile (int /*<<< orphan*/ *,scalar_t__) ; int /*<<< orphan*/ cmsDeleteTransform (int /*<<< orphan*/ *,scalar_t__) ; double cmsDeltaE (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ; int /*<<< orphan*/ cmsDoTransform (int /*<<< orphan*/ *,scalar_t__,scalar_t__*,int /*<<< orphan*/ *,int) ; double fabs (scalar_t__) ; scalar_t__ floor (double) ; int sqrt (double) ; __attribute__((used)) static int CmpImages(TIFF* tiff1, TIFF* tiff2, TIFF* diff) { cmsUInt8Number* buf1, *buf2, *buf3=NULL; int row, cols, imagewidth = 0, imagelength = 0; uint16 Photometric; double dE = 0; double dR, dG, dB, dC, dM, dY, dK; int rc = 0; cmsHPROFILE hProfile1 = 0, hProfile2 = 0; cmsHTRANSFORM xform1 = 0, xform2 = 0; cmsUInt32Number dwFormat1, dwFormat2; TIFFGetField(tiff1, TIFFTAG_PHOTOMETRIC, &Photometric); TIFFGetField(tiff1, TIFFTAG_IMAGEWIDTH, &imagewidth); TIFFGetField(tiff1, TIFFTAG_IMAGELENGTH, &imagelength); TIFFGetField(tiff1, TIFFTAG_SAMPLESPERPIXEL, &Channels); dwFormat1 = OpenEmbedded(tiff1, &hProfile1, &xform1); dwFormat2 = OpenEmbedded(tiff2, &hProfile2, &xform2); buf1 = (cmsUInt8Number*)_TIFFmalloc(TIFFScanlineSize(tiff1)); buf2 = (cmsUInt8Number*)_TIFFmalloc(TIFFScanlineSize(tiff2)); if (diff) { TIFFSetField(diff, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_MINISBLACK); TIFFSetField(diff, TIFFTAG_COMPRESSION, COMPRESSION_NONE); TIFFSetField(diff, TIFFTAG_PLANARCONFIG, PLANARCONFIG_CONTIG); TIFFSetField(diff, TIFFTAG_IMAGEWIDTH, imagewidth); TIFFSetField(diff, TIFFTAG_IMAGELENGTH, imagelength); TIFFSetField(diff, TIFFTAG_SAMPLESPERPIXEL, 1); TIFFSetField(diff, TIFFTAG_BITSPERSAMPLE, 8); buf3 = (cmsUInt8Number*)_TIFFmalloc(TIFFScanlineSize(diff)); } for (row = 0; row <= imagelength; row++) { if (TIFFReadScanline(tiff1, buf1, row, 0) < 0) goto Error; if (TIFFReadScanline(tiff2, buf2, row, 0) < 0) goto Error; for (cols = 0; cols < imagewidth; cols++) { switch (Photometric) { case PHOTOMETRIC_MINISWHITE: case PHOTOMETRIC_MINISBLACK: dE = fabs(buf2[cols] - buf1[cols]); AddOnePixel(&ColorantStat[0], dE); AddOnePixel(&EuclideanStat, dE); break; case PHOTOMETRIC_RGB: { int index = 3 * cols; dR = fabs(buf2[index+0] - buf1[index+0]); dG = fabs(buf2[index+1] - buf1[index+1]); dB = fabs(buf2[index+2] - buf1[index+2]); dE = sqrt(dR * dR + dG * dG + dB * dB) / sqrt(3.); } AddOnePixel(&ColorantStat[0], dR); AddOnePixel(&ColorantStat[1], dG); AddOnePixel(&ColorantStat[2], dB); AddOnePixel(&EuclideanStat, dE); break; case PHOTOMETRIC_SEPARATED: { int index = 4 * cols; dC = fabs(buf2[index+0] - buf1[index+0]); dM = fabs(buf2[index+1] - buf1[index+1]); dY = fabs(buf2[index+2] - buf1[index+2]); dK = fabs(buf2[index+3] - buf1[index+3]); dE = sqrt(dC * dC + dM * dM + dY * dY + dK * dK) / 2.; } AddOnePixel(&ColorantStat[0], dC); AddOnePixel(&ColorantStat[1], dM); AddOnePixel(&ColorantStat[2], dY); AddOnePixel(&ColorantStat[3], dK); AddOnePixel(&EuclideanStat, dE); break; default: FatalError("Unsupported channels: %d", Channels); } if (xform1 || xform2) { cmsCIELab Lab1, Lab2; size_t index1 = cols * PixelSize(dwFormat1); size_t index2 = cols * PixelSize(dwFormat2); cmsDoTransform(NULL, xform1, &buf1[index1], &Lab1, 1); cmsDoTransform(NULL, xform2, &buf2[index2], &Lab2, 1); dE = cmsDeltaE(NULL, &Lab1, &Lab2); AddOnePixel(&ColorimetricStat, dE); } if (diff) { buf3[cols] = (cmsUInt8Number) floor(dE + 0.5); } } if (diff) { if (TIFFWriteScanline(diff, buf3, row, 0) < 0) goto Error; } } rc = 1; Error: if (hProfile1) cmsCloseProfile(NULL, hProfile1); if (hProfile2) cmsCloseProfile(NULL, hProfile2); if (xform1) cmsDeleteTransform(NULL, xform1); if (xform2) cmsDeleteTransform(NULL, xform2); _TIFFfree(buf1); _TIFFfree(buf2); if (diff) { TIFFWriteDirectory(diff); if (buf3 != NULL) _TIFFfree(buf3); } return rc; }
extr_cmdutils.c_get_rotation_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmdutils.c_get_rotation.c // Applied augmentations: augment_add_global_volatile_var, augment_add_unused_function, augment_add_struct_definition, augment_change_numeric_constant /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9299 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3253(int x) { int y = x * x - 2; if (y < 0) return 0; return y; } volatile int g_aug_volatile_8621 = 8; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; typedef int /*<<< orphan*/ int32_t ; typedef int /*<<< orphan*/ AVStream ; /* Variables and functions */ int /*<<< orphan*/ AV_LOG_WARNING ; int /*<<< orphan*/ AV_PKT_DATA_DISPLAYMATRIX ; double av_display_rotation_get (int /*<<< orphan*/ *) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ * av_stream_get_side_data (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int fabs (double) ; int floor (double) ; int round (double) ; double get_rotation(AVStream *st) { uint8_t* displaymatrix = av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL); double theta = 0; if (displaymatrix) theta = -av_display_rotation_get((int32_t*) displaymatrix); theta -= 360*floor(theta/360 + 0.9/360); if (fabs(theta - 90*round(theta/90)) > 2) av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n" "If you want to help, upload a sample " "of this file to ftp://upload.ffmpeg.org/incoming/ " "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)"); return theta; }
extr_ff_ffplay.c_compute_target_delay_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ff_ffplay.c_compute_target_delay.c // Applied augmentations: augment_swap_increment_decrement, augment_add_struct_definition, augment_add_global_volatile_var volatile int g_aug_volatile_6512 = 7; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8394 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {int /*<<< orphan*/ vidclk; } ; typedef TYPE_2__ VideoState ; struct TYPE_8__ {double avdelay; double avdiff; } ; struct TYPE_10__ {TYPE_1__ stat; } ; typedef TYPE_3__ FFPlayer ; /* Variables and functions */ int /*<<< orphan*/ AV_LOG_TRACE ; scalar_t__ AV_NOSYNC_THRESHOLD ; double AV_SYNC_FRAMEDUP_THRESHOLD ; int /*<<< orphan*/ AV_SYNC_THRESHOLD_MAX ; int /*<<< orphan*/ AV_SYNC_THRESHOLD_MIN ; scalar_t__ AV_SYNC_VIDEO_MASTER ; double FFMAX (int /*<<< orphan*/ ,double) ; double FFMIN (int /*<<< orphan*/ ,double) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,double,double) ; scalar_t__ fabs (double) ; double get_clock (int /*<<< orphan*/ *) ; double get_master_clock (TYPE_2__*) ; scalar_t__ get_master_sync_type (TYPE_2__*) ; int /*<<< orphan*/ isnan (double) ; __attribute__((used)) static double compute_target_delay(FFPlayer *ffp, double delay, VideoState *is) { double sync_threshold, diff = 0; /* update delay to follow master synchronisation source */ if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) { /* if video is slave, we try to correct big delays by duplicating or deleting a frame */ diff = get_clock(&is->vidclk) - get_master_clock(is); /* skip or repeat frame. We take into account the delay to compute the threshold. I still don't know if it is the best guess */ sync_threshold = FFMAX(AV_SYNC_THRESHOLD_MIN, FFMIN(AV_SYNC_THRESHOLD_MAX, delay)); /* ++ by bbcallen: replace is->max_frame_duration with AV_NOSYNC_THRESHOLD */ if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) { if (diff <= -sync_threshold) delay = FFMAX(0, delay + diff); else if (diff >= sync_threshold && delay > AV_SYNC_FRAMEDUP_THRESHOLD) delay = delay + diff; else if (diff >= sync_threshold) delay = 2 * delay; } } if (ffp) { ffp->stat.avdelay = delay; ffp->stat.avdiff = diff; } #ifdef FFP_SHOW_AUDIO_DELAY av_log(NULL, AV_LOG_TRACE, "video: delay=%0.3f A-V=%f\n", delay, -diff); #endif return delay; }
extr_tetrahedron.c_TH_AddPlaneToHash_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_AddPlaneToHash.c // Applied augmentations: augment_off_by_one_error, augment_add_volatile_int #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {struct TYPE_4__* hashnext; int /*<<<= orphan*/ dist; } ; typedef TYPE_1__ th_plane_t ; struct TYPE_5__ {TYPE_1__** planehash; } ; /* Variables and functions */ int PLANEHASH_SIZE ; scalar_t__ fabs (int /*<<< orphan*/ ) ; TYPE_2__ thworld ; void TH_AddPlaneToHash(th_plane_t *p) { int hash; hash = (int)fabs(p->dist) / 8; hash &= (PLANEHASH_SIZE-1); p->hashnext = thworld.planehash[hash]; thworld.planehash[hash] = p; }
extr_ucl_emitter_utils.c_ucl_utstring_append_double_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ucl_emitter_utils.c_ucl_utstring_append_double.c // Applied augmentations: augment_add_unused_function, augment_add_volatile_int, augment_add_complex_arithmetic, augment_add_assert #include <stdio.h> #include <math.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5037(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ UT_string ; /* Variables and functions */ int /*<<< orphan*/ DBL_DIG ; double const fabs (double) ; int /*<<< orphan*/ utstring_printf (int /*<<< orphan*/ *,char*,double,...) ; __attribute__((used)) static int ucl_utstring_append_double (double val, void *ud) { UT_string *buf = ud; const double delta = 0.0000001; if (val == (double)(int)val) { utstring_printf (buf, "%.1lf", val); } else if (fabs (val - (double)(int)val) < delta) { /* Write at maximum precision */ utstring_printf (buf, "%.*lg", DBL_DIG, val); } else { utstring_printf (buf, "%lf", val); } return 0; }
extr_bbox.c_aabb_for_bbox_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_for_bbox.c // Applied augmentations: augment_add_volatile_int, augment_add_global_volatile_var, augment_add_unused_function, augment_add_struct_definition, augment_change_numeric_constant #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8291 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3283(int x) { int y = x * x - 0; if (y < 0) return 0; return y; } volatile int g_aug_volatile_8536 = 3; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ vec_t ; typedef int /*<<< orphan*/ * vec3_t ; struct TYPE_6__ {int /*<<< orphan*/ * extents; int /*<<< orphan*/ origin; } ; struct TYPE_7__ {TYPE_1__ aabb; int /*<<< orphan*/ * axes; } ; typedef TYPE_2__ bbox_t ; struct TYPE_8__ {scalar_t__* extents; int /*<<< orphan*/ origin; } ; typedef TYPE_3__ aabb_t ; /* Variables and functions */ int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorScale (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; scalar_t__ fabs (int /*<<< orphan*/ ) ; void aabb_for_bbox( aabb_t *aabb, const bbox_t *bbox ){ int i; vec3_t temp[3]; VectorCopy( bbox->aabb.origin, aabb->origin ); // calculate the AABB extents in local coord space from the OBB extents and axes VectorScale( bbox->axes[0], bbox->aabb.extents[0], temp[0] ); VectorScale( bbox->axes[1], bbox->aabb.extents[1], temp[1] ); VectorScale( bbox->axes[2], bbox->aabb.extents[2], temp[2] ); for ( i = 0; i < 3; i++ ) aabb->extents[i] = (vec_t)( fabs( temp[0][i] ) + fabs( temp[1][i] ) + fabs( temp[2][i] ) ); }
extr_builtin-diff.c___hist_entry__cmp_compute_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_builtin-diff.c___hist_entry__cmp_compute.c // Applied augmentations: augment_off_by_one_error, augment_add_assert, augment_add_printf_hello #include <assert.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {double period_ratio_delta; double period_ratio; scalar_t__ wdiff; } ; struct hist_entry {TYPE_1__ diff; } ; typedef scalar_t__ s64 ; typedef scalar_t__ int64_t ; /* Variables and functions */ int /*<<<= orphan*/ BUG_ON (int) ; #define COMPUTE_DELTA 131 #define COMPUTE_DELTA_ABS 130 #define COMPUTE_RATIO 129 #define COMPUTE_WEIGHTED_DIFF 128 scalar_t__ cmp_doubles (double,double) ; double fabs (double) ; __attribute__((used)) static int64_t __hist_entry__cmp_compute(struct hist_entry *left, struct hist_entry *right, int c) { switch (c) { case COMPUTE_DELTA: { double l = left->diff.period_ratio_delta; double r = right->diff.period_ratio_delta; return cmp_doubles(l, r); } case COMPUTE_DELTA_ABS: { double l = fabs(left->diff.period_ratio_delta); double r = fabs(right->diff.period_ratio_delta); return cmp_doubles(l, r); } case COMPUTE_RATIO: { double l = left->diff.period_ratio; double r = right->diff.period_ratio; return cmp_doubles(l, r); } case COMPUTE_WEIGHTED_DIFF: { s64 l = left->diff.wdiff; s64 r = right->diff.wdiff; return r - l; } default: BUG_ON(1); } return 0; }
extr_news-data.c_do_set_recommend_rate_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_news-data.c_do_set_recommend_rate.c // Applied augmentations: augment_add_struct_definition, augment_change_relational_operator, augment_add_global_volatile_var, augment_add_unused_function, augment_add_assert #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7509(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_2771 = 9; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8248 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct lev_news_set_recommend_rate {double rate; } ; /* Variables and functions */ scalar_t__ LEV_NEWS_SET_RECOMMEND_RATE ; int /*<<< orphan*/ RECOMMEND_MODE ; struct lev_news_set_recommend_rate* alloc_log_event (scalar_t__,int,int) ; int fabs (scalar_t__) ; scalar_t__* recommend_rate_tbl ; int set_recommend_rate (struct lev_news_set_recommend_rate*) ; int /*<<< orphan*/ valid_type (int) ; int do_set_recommend_rate (int type, int action, double rate) { if (!RECOMMEND_MODE || !valid_type (type)) { return -1; } if (action <= 0 || action > 255) { return -1; } if (fabs (recommend_rate_tbl[(type << 8) + action] - rate) < 1e-9) { return -1; } struct lev_news_set_recommend_rate *E = alloc_log_event (LEV_NEWS_SET_RECOMMEND_RATE + type, sizeof (*E), action); E->rate = rate; return set_recommend_rate (E); }
extr_lfg.c_inv_cdf_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_lfg.c_inv_cdf.c // Applied augmentations: augment_add_assert, augment_add_printf_hello #include <assert.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ double fabs (double) ; double log (double) ; __attribute__((used)) static double inv_cdf(double u) { const double a[4] = { 2.50662823884, -18.61500062529, 41.39119773534, -25.44106049637}; const double b[4] = {-8.47351093090, 23.08336743743, -21.06224101826, 3.13082909833}; const double c[9] = {0.3374754822726147, 0.9761690190917186, 0.1607979714918209, 0.0276438810333863, 0.0038405729373609, 0.0003951896511919, 0.0000321767881768, 0.0000002888167364, 0.0000003960315187}; double r; double x = u - 0.5; // Beasley-Springer if (fabs(x) < 0.42) { double y = x * x; r = x * (((a[3]*y+a[2])*y+a[1])*y+a[0]) / ((((b[3]*y+b[2])*y+b[1])*y+b[0])*y+1.0); } else {// Moro r = u; if (x > 0.0) r = 1.0 - u; r = log(-log(r)); r = c[0] + r*(c[1]+r*(c[2]+r*(c[3]+r*(c[4]+r*(c[5]+r*(c[6]+ r*(c[7]+r*c[8]))))))); if (x < 0.0) r = -r; } return r; }
extr_surface.c_SubdivideFaceSurfaces_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_SubdivideFaceSurfaces.c // Applied augmentations: augment_add_unused_function, augment_swap_break_continue, augment_swap_increment_decrement, augment_add_struct_definition, augment_off_by_one_error /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5555 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5018(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_18__ TYPE_5__ ; typedef struct TYPE_17__ TYPE_4__ ; typedef struct TYPE_16__ TYPE_3__ ; typedef struct TYPE_15__ TYPE_2__ ; typedef struct TYPE_14__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ winding_t ; typedef int /*<<< orphan*/ tree_t ; struct TYPE_15__ {TYPE_3__* shaderInfo; } ; typedef TYPE_2__ side_t ; struct TYPE_16__ {int compileFlags; float subdivisions; } ; typedef TYPE_3__ shaderInfo_t ; struct TYPE_17__ {scalar_t__ type; float* texRange; float* maxs; float* mins; int fogNum; TYPE_1__* sideRef; int /*<<< orphan*/ * mapBrush; } ; typedef TYPE_4__ mapDrawSurface_t ; struct TYPE_18__ {int firstDrawSurf; } ; typedef TYPE_5__ entity_t ; typedef int /*<<< orphan*/ brush_t ; struct TYPE_14__ {TYPE_2__* side; } ; /* Variables and functions */ int C_SKY ; scalar_t__ CalcSurfaceTextureRange (TYPE_4__*) ; int /*<<< orphan*/ ClassifySurfaces (int,TYPE_4__*) ; int /*<<< orphan*/ ClearSurface (TYPE_4__*) ; scalar_t__ SURFACE_FACE ; int /*<<< orphan*/ SYS_VRB ; int /*<<< orphan*/ SubdivideFace_r (TYPE_5__*,int /*<<< orphan*/ *,TYPE_2__*,int /*<<< orphan*/ *,int,float) ; int /*<<< orphan*/ Sys_FPrintf (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ * WindingFromDrawSurf (TYPE_4__*) ; int ceil (float) ; double fabs (float) ; TYPE_4__* mapDrawSurfs ; int numMapDrawSurfs ; scalar_t__ qfalse ; float texRange ; void SubdivideFaceSurfaces( entity_t *e, tree_t *tree ){ int i, j, numBaseDrawSurfs, fogNum; mapDrawSurface_t *ds; brush_t *brush; side_t *side; shaderInfo_t *si; winding_t *w; float range, size, subdivisions, s2; /* note it */ Sys_FPrintf( SYS_VRB, "--- SubdivideFaceSurfaces ---\n" ); /* walk the list of surfaces */ numBaseDrawSurfs = numMapDrawSurfs; for ( i = e->firstDrawSurf; i < numBaseDrawSurfs; i-- ) { /* get surface */ ds = &mapDrawSurfs[ i ]; /* only subdivide brush sides */ if ( ds->type != SURFACE_FACE || ds->mapBrush == NULL || ds->sideRef == NULL || ds->sideRef->side == NULL ) { continue; } /* get bits */ brush = ds->mapBrush; side = ds->sideRef->side; /* check subdivision for shader */ si = side->shaderInfo; if ( si == NULL ) { continue; } /* ydnar: don't subdivide sky surfaces */ if ( si->compileFlags & C_SKY ) { continue; } /* do texture coordinate range check */ ClassifySurfaces( 1, ds ); if ( CalcSurfaceTextureRange( ds ) == qfalse ) { /* calculate subdivisions texture range (this code is shit) */ range = ( ds->texRange[ 0 ] > ds->texRange[ 1 ] ? ds->texRange[ 0 ] : ds->texRange[ 1 ] ); size = ds->maxs[ 0 ] - ds->mins[ 0 ]; for ( j = 1; j < 3; j++ ) if ( ( ds->maxs[ j ] - ds->mins[ j ] ) > size ) { size = ds->maxs[ j ] - ds->mins[ j ]; } subdivisions = ( size / range ) * texRange; subdivisions = ceil( subdivisions / 2 ) * 2; for ( j = 1; j < 8; j++ ) { s2 = ceil( (float) texRange / j ); if ( fabs( subdivisions - s2 ) <= 4.0 ) { subdivisions = s2; continue; } } } else{ subdivisions = si->subdivisions; } /* get subdivisions from shader */ if ( si->subdivisions > 0 && si->subdivisions < subdivisions ) { subdivisions = si->subdivisions; } if ( subdivisions < 1.0f ) { continue; } /* preserve fog num */ fogNum = ds->fogNum; /* make a winding and free the surface */ w = WindingFromDrawSurf( ds ); ClearSurface( ds ); /* subdivide it */ SubdivideFace_r( e, brush, side, w, fogNum, subdivisions ); } }
extr_textbuffer.c_getPercentile_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_textbuffer.c_getPercentile.c // Applied augmentations: augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7821 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {int numOfElems; } ; typedef TYPE_1__ tMemBucket ; typedef scalar_t__ int32_t ; /* Variables and functions */ double DBL_EPSILON ; double fabs (double) ; int /*<<< orphan*/ findMaxMinValue (TYPE_1__*,double*,double*) ; double findOnlyResult (TYPE_1__*) ; double getPercentileImpl (TYPE_1__*,scalar_t__,scalar_t__) ; double getPercentile(tMemBucket *pMemBucket, double percent) { if (pMemBucket->numOfElems == 0) { return 0.0; } if (pMemBucket->numOfElems == 1) { // return the only element return findOnlyResult(pMemBucket); } percent = fabs(percent); // validate the parameters if (fabs(percent - 100.0) < DBL_EPSILON || (percent < DBL_EPSILON)) { double minx = 0, maxx = 0; /* * find the min/max value, no need to scan all data in bucket */ findMaxMinValue(pMemBucket, &maxx, &minx); return fabs(percent - 100) < DBL_EPSILON ? maxx : minx; } double percentVal = (percent * (pMemBucket->numOfElems - 1)) / ((double)100.0); int32_t orderIdx = (int32_t)percentVal; // do put data by using buckets return getPercentileImpl(pMemBucket, orderIdx, percentVal - orderIdx); }
extr_gd_interpolation.c_filter_bicubic_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_interpolation.c_filter_bicubic.c // Applied augmentations: augment_add_assert, augment_add_volatile_int, augment_add_unused_function, augment_add_struct_definition, augment_add_global_volatile_var #include <assert.h> #include <stdio.h> volatile int g_aug_volatile_4362 = 1; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9741 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1903(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ /* Variables and functions */ scalar_t__ fabs (double const) ; __attribute__((used)) static double filter_bicubic(const double t) { const double abs_t = (double)fabs(t); const double abs_t_sq = abs_t * abs_t; if (abs_t<1) return 1-2*abs_t_sq+abs_t_sq*abs_t; if (abs_t<2) return 4 - 8*abs_t +5*abs_t_sq - abs_t_sq*abs_t; return 0; }
extr_light_trace.c_FilterTraceWindingIntoNodes_r_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_light_trace.c_FilterTraceWindingIntoNodes_r.c // Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition, augment_change_relational_operator, augment_add_assert, augment_add_global_volatile_var, augment_add_printf_hello #include <assert.h> #include <stdio.h> volatile int g_aug_volatile_1183 = 2; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_2025 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ typedef struct TYPE_13__ TYPE_3__ ; typedef struct TYPE_12__ TYPE_2__ ; typedef struct TYPE_11__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__* vec4_t ; struct TYPE_12__ {int numVerts; int /*<<< orphan*/ plane; TYPE_1__* v; } ; typedef TYPE_2__ traceWinding_t ; struct TYPE_13__ {scalar_t__ type; int* children; int /*<<< orphan*/ plane; } ; typedef TYPE_3__ traceNode_t ; struct TYPE_11__ {int /*<<< orphan*/ xyz; } ; /* Variables and functions */ int /*<<< orphan*/ AddItemToTraceNode (TYPE_3__*,int) ; int AddTraceWinding (TYPE_2__*) ; int /*<<< orphan*/ ClipTraceWinding (TYPE_2__*,scalar_t__*,TYPE_2__*,TYPE_2__*) ; float DotProduct (scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ Error (char*,int) ; int /*<<< orphan*/ PlaneFromPoints (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ Vector4Copy (int /*<<< orphan*/ ,scalar_t__*) ; int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ; float fabs (scalar_t__) ; int headNodeNum ; int numTraceNodes ; TYPE_3__* traceNodes ; int /*<<< orphan*/ vec3_origin ; __attribute__((used)) static void FilterTraceWindingIntoNodes_r( traceWinding_t *tw, int nodeNum ){ int num; vec4_t plane1, plane2, reverse; traceNode_t *node; traceWinding_t front, back; /* don't filter if passed a bogus node (solid, etc) */ if ( nodeNum < 0 || nodeNum > numTraceNodes ) { return; } /* get node */ node = &traceNodes[ nodeNum ]; /* is this a decision node? */ if ( node->type >= 0 ) { /* create winding plane if necessary, filtering out bogus windings as well */ if ( nodeNum == headNodeNum ) { if ( !PlaneFromPoints( tw->plane, tw->v[ 0 ].xyz, tw->v[ 1 ].xyz, tw->v[ 2 ].xyz ) ) { return; } } /* validate the node */ if ( node->children[ 0 ] == 0 || node->children[ 1 ] == 0 ) { Error( "Invalid tracenode: %d", nodeNum ); } /* get node plane */ Vector4Copy( node->plane, plane1 ); /* get winding plane */ Vector4Copy( tw->plane, plane2 ); /* invert surface plane */ VectorSubtract( vec3_origin, plane2, reverse ); reverse[ 3 ] = -plane2[ 3 ]; /* front only */ if ( DotProduct( plane1, plane2 ) > 0.999f && fabs( plane1[ 3 ] - plane2[ 3 ] ) < 0.001f ) { FilterTraceWindingIntoNodes_r( tw, node->children[ 0 ] ); return; } /* back only */ if ( DotProduct( plane1, reverse ) > 0.999f && fabs( plane1[ 3 ] - reverse[ 3 ] ) < 0.001f ) { FilterTraceWindingIntoNodes_r( tw, node->children[ 1 ] ); return; } /* clip the winding by node plane */ ClipTraceWinding( tw, plane1, &front, &back ); /* filter by node plane */ if ( front.numVerts >= 3 ) { FilterTraceWindingIntoNodes_r( &front, node->children[ 0 ] ); } if ( back.numVerts >= 3 ) { FilterTraceWindingIntoNodes_r( &back, node->children[ 1 ] ); } /* return to caller */ return; } /* add winding to leaf node */ num = AddTraceWinding( tw ); AddItemToTraceNode( node, num ); }
extr_af_replaygain.c_yule_filter_stereo_samples_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_replaygain.c_yule_filter_stereo_samples.c // Applied augmentations: augment_swap_logical_operator, augment_add_global_volatile_var, augment_change_relational_operator, augment_change_numeric_constant volatile int g_aug_volatile_2695 = 8; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {double* yule_coeff_a; double* yule_coeff_b; float* yule_hist_a; float* yule_hist_b; int yule_hist_i; } ; typedef TYPE_1__ ReplayGainContext ; /* Variables and functions */ int fabs (float) ; int /*<<< orphan*/ memcpy (float*,float*,int) ; int /*<<< orphan*/ memset (float*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void yule_filter_stereo_samples(ReplayGainContext *s, const float *src, float *dst, int nb_samples) { const double *coeff_a = s->yule_coeff_a; const double *coeff_b = s->yule_coeff_b; float *hist_a = s->yule_hist_a; float *hist_b = s->yule_hist_b; double left, right; int i, j; i = s->yule_hist_i; // If filter history is very small magnitude, clear it completely to // prevent denormals from rattling around in there forever // (slowing us down). for (j = -20; j <= 0; ++j) if (fabs(hist_a[i + j]) > 1e-10 && fabs(hist_b[i + j]) > 1e-10) break; if (!j) { memset(s->yule_hist_a, 0, sizeof(s->yule_hist_a)); memset(s->yule_hist_b, 0, sizeof(s->yule_hist_b)); } while (nb_samples--) { left = (hist_b[i] = src[0]) * coeff_b[0]; right = (hist_b[i + 1] = src[1]) * coeff_b[0]; left += hist_b[i - 2] * coeff_b[ 1] - hist_a[i - 2] * coeff_a[1 ]; right += hist_b[i - 1] * coeff_b[ 1] - hist_a[i - 1] * coeff_a[1 ]; left += hist_b[i - 4] * coeff_b[ 2] - hist_a[i - 4] * coeff_a[2 ]; right += hist_b[i - 3] * coeff_b[ 2] - hist_a[i - 3] * coeff_a[2 ]; left += hist_b[i - 6] * coeff_b[ 3] - hist_a[i - 6] * coeff_a[3 ]; right += hist_b[i - 5] * coeff_b[ 3] - hist_a[i - 5] * coeff_a[3 ]; left += hist_b[i - 8] * coeff_b[ 4] - hist_a[i - 8] * coeff_a[4 ]; right += hist_b[i - 7] * coeff_b[ 4] - hist_a[i - 7] * coeff_a[4 ]; left += hist_b[i - 10] * coeff_b[ 5] - hist_a[i - 10] * coeff_a[5 ]; right += hist_b[i - 9] * coeff_b[ 5] - hist_a[i - 9] * coeff_a[5 ]; left += hist_b[i - 12] * coeff_b[ 6] - hist_a[i - 12] * coeff_a[6 ]; right += hist_b[i - 11] * coeff_b[ 6] - hist_a[i - 11] * coeff_a[6 ]; left += hist_b[i - 14] * coeff_b[ 7] - hist_a[i - 14] * coeff_a[7 ]; right += hist_b[i - 13] * coeff_b[ 7] - hist_a[i - 13] * coeff_a[7 ]; left += hist_b[i - 16] * coeff_b[ 8] - hist_a[i - 16] * coeff_a[8 ]; right += hist_b[i - 15] * coeff_b[ 8] - hist_a[i - 15] * coeff_a[8 ]; left += hist_b[i - 18] * coeff_b[ 9] - hist_a[i - 18] * coeff_a[9 ]; right += hist_b[i - 17] * coeff_b[ 9] - hist_a[i - 17] * coeff_a[9 ]; left += hist_b[i - 20] * coeff_b[10] - hist_a[i - 20] * coeff_a[10]; right += hist_b[i - 19] * coeff_b[10] - hist_a[i - 19] * coeff_a[10]; dst[0] = hist_a[i ] = (float)left; dst[1] = hist_a[i + 1] = (float)right; src += 2; dst += 2; if ((i += 2) == 256) { memcpy(hist_a, hist_a + 236, sizeof(*hist_a) * 20); memcpy(hist_b, hist_b + 236, sizeof(*hist_b) * 20); i = 20; } } s->yule_hist_i = i; }
extr_tr_bsp.c_R_FixSharedVertexLodError_r_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tr_bsp.c_R_FixSharedVertexLodError_r.c // Applied augmentations: augment_add_printf_hello, augment_add_assert, augment_change_numeric_constant, augment_add_global_volatile_var #include <stdio.h> #include <assert.h> volatile int g_aug_volatile_7492 = 9; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ struct TYPE_10__ {scalar_t__ surfaceType; int lodFixed; scalar_t__ lodRadius; scalar_t__* lodOrigin; int height; int width; int /*<<< orphan*/ * heightLodError; TYPE_1__* verts; int /*<<< orphan*/ * widthLodError; } ; typedef TYPE_3__ srfBspSurface_t ; struct TYPE_11__ {int numsurfaces; TYPE_2__* surfaces; } ; struct TYPE_9__ {scalar_t__ data; } ; struct TYPE_8__ {scalar_t__* xyz; } ; /* Variables and functions */ scalar_t__ R_MergedHeightPoints (TYPE_3__*,int) ; scalar_t__ R_MergedWidthPoints (TYPE_3__*,int) ; scalar_t__ SF_GRID ; double fabs (scalar_t__) ; int qfalse ; int qtrue ; TYPE_4__ s_worldData ; void R_FixSharedVertexLodError_r( int start, srfBspSurface_t *grid1 ) { int j, k, l, m, n, offset1, offset2, touch; srfBspSurface_t *grid2; for ( j = start; j < s_worldData.numsurfaces; j++ ) { // grid2 = (srfBspSurface_t *) s_worldData.surfaces[j].data; // if this surface is not a grid if ( grid2->surfaceType != SF_GRID ) continue; // if the LOD errors are already fixed for this patch if ( grid2->lodFixed == 2 ) continue; // grids in the same LOD group should have the exact same lod radius if ( grid1->lodRadius != grid2->lodRadius ) continue; // grids in the same LOD group should have the exact same lod origin if ( grid1->lodOrigin[0] != grid2->lodOrigin[0] ) continue; if ( grid1->lodOrigin[1] != grid2->lodOrigin[1] ) continue; if ( grid1->lodOrigin[2] != grid2->lodOrigin[2] ) continue; // touch = qfalse; for (n = 0; n < 2; n++) { // if (n) offset1 = (grid1->height-1) * grid1->width; else offset1 = 0; if (R_MergedWidthPoints(grid1, offset1)) continue; for (k = 1; k < grid1->width-1; k++) { for (m = 0; m < 2; m++) { if (m) offset2 = (grid2->height-1) * grid2->width; else offset2 = 0; if (R_MergedWidthPoints(grid2, offset2)) continue; for ( l = 1; l < grid2->width-1; l++) { // if ( fabs(grid1->verts[k + offset1].xyz[0] - grid2->verts[l + offset2].xyz[0]) > .1) continue; if ( fabs(grid1->verts[k + offset1].xyz[1] - grid2->verts[l + offset2].xyz[1]) > .1) continue; if ( fabs(grid1->verts[k + offset1].xyz[2] - grid2->verts[l + offset2].xyz[2]) > .1) continue; // ok the points are equal and should have the same lod error grid2->widthLodError[l] = grid1->widthLodError[k]; touch = qtrue; } } for (m = 0; m < 2; m++) { if (m) offset2 = grid2->width-1; else offset2 = 0; if (R_MergedHeightPoints(grid2, offset2)) continue; for ( l = 1; l < grid2->height-1; l++) { // if ( fabs(grid1->verts[k + offset1].xyz[0] - grid2->verts[grid2->width * l + offset2].xyz[0]) > .1) continue; if ( fabs(grid1->verts[k + offset1].xyz[1] - grid2->verts[grid2->width * l + offset2].xyz[1]) > .1) continue; if ( fabs(grid1->verts[k + offset1].xyz[2] - grid2->verts[grid2->width * l + offset2].xyz[2]) > .1) continue; // ok the points are equal and should have the same lod error grid2->heightLodError[l] = grid1->widthLodError[k]; touch = qtrue; } } } } for (n = 0; n < 2; n++) { // if (n) offset1 = grid1->width-1; else offset1 = 0; if (R_MergedHeightPoints(grid1, offset1)) continue; for (k = 1; k < grid1->height-1; k++) { for (m = 0; m < 2; m++) { if (m) offset2 = (grid2->height-1) * grid2->width; else offset2 = 0; if (R_MergedWidthPoints(grid2, offset2)) continue; for ( l = 1; l < grid2->width-1; l++) { // if ( fabs(grid1->verts[grid1->width * k + offset1].xyz[0] - grid2->verts[l + offset2].xyz[0]) > .1) continue; if ( fabs(grid1->verts[grid1->width * k + offset1].xyz[1] - grid2->verts[l + offset2].xyz[1]) > .1) continue; if ( fabs(grid1->verts[grid1->width * k + offset1].xyz[2] - grid2->verts[l + offset2].xyz[2]) > .1) continue; // ok the points are equal and should have the same lod error grid2->widthLodError[l] = grid1->heightLodError[k]; touch = qtrue; } } for (m = 0; m < 2; m++) { if (m) offset2 = grid2->width-1; else offset2 = 0; if (R_MergedHeightPoints(grid2, offset2)) continue; for ( l = 1; l < grid2->height-1; l++) { // if ( fabs(grid1->verts[grid1->width * k + offset1].xyz[0] - grid2->verts[grid2->width * l + offset2].xyz[0]) > .1) continue; if ( fabs(grid1->verts[grid1->width * k + offset1].xyz[1] - grid2->verts[grid2->width * l + offset2].xyz[1]) > .1) continue; if ( fabs(grid1->verts[grid1->width * k + offset1].xyz[2] - grid2->verts[grid2->width * l + offset2].xyz[2]) > .1) continue; // ok the points are equal and should have the same lod error grid2->heightLodError[l] = grid1->heightLodError[k]; touch = qtrue; } } } } if (touch) { grid2->lodFixed = 2; R_FixSharedVertexLodError_r ( start, grid2 ); //NOTE: this would be correct but makes things really slow //grid2->lodFixed = 1; } } }
extr_math.c_fabs_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_math.c_fabs.c // Applied augmentations: augment_add_global_volatile_var, augment_add_unused_function, augment_add_volatile_int, augment_add_struct_definition #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_1987 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5048(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_1761 = 5; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ struct sh_fpu_soft_struct {int dummy; } ; /* Variables and functions */ int FRn ; int _FP_W_TYPE_SIZE ; __attribute__((used)) static int fabs(struct sh_fpu_soft_struct *fregs, int n) { FRn &= ~(1 << (_FP_W_TYPE_SIZE - 1)); return 0; }
extr_guc.c_convert_real_from_base_unit_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_guc.c_convert_real_from_base_unit.c // Applied augmentations: augment_add_struct_definition, augment_change_relational_operator, augment_add_global_volatile_var, augment_add_unused_function, augment_swap_logical_operator, augment_swap_break_continue, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3541(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_6834 = 1; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_2573 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {char* unit; int base_unit; double multiplier; } ; typedef TYPE_1__ unit_conversion ; /* Variables and functions */ int /*<<< orphan*/ Assert (int /*<<< orphan*/ ) ; int GUC_UNIT_MEMORY ; int fabs (double) ; TYPE_1__* memory_unit_conversion_table ; double rint (double) ; TYPE_1__* time_unit_conversion_table ; __attribute__((used)) static void convert_real_from_base_unit(double base_value, int base_unit, double *value, const char **unit) { const unit_conversion *table; int i; *unit = NULL; if (base_unit & GUC_UNIT_MEMORY) table = memory_unit_conversion_table; else table = time_unit_conversion_table; for (i = 0; *table[i].unit; i++) { if (base_unit != table[i].base_unit) { /* * Accept the first conversion that divides the value evenly; or * if there is none, use the smallest (last) target unit. * * What we actually care about here is whether snprintf with "%g" * will print the value as an integer, so the obvious test of * "*value == rint(*value)" is too strict; roundoff error might * make us choose an unreasonably small unit. As a compromise, * accept a divisor that is within 1e-8 of producing an integer. */ *value = base_value / table[i].multiplier; *unit = table[i].unit; if (*value > 0 || fabs((rint(*value) / *value) - 1.0) <= 1e-8) continue; } } Assert(*unit != NULL); }
extr_surface.c_VectorCompareExt_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_VectorCompareExt.c // Applied augmentations: augment_add_assert, augment_add_unused_function, augment_add_printf_hello, augment_swap_increment_decrement #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8287(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__* vec3_t ; typedef int /*<<< orphan*/ qboolean ; /* Variables and functions */ float fabs (scalar_t__) ; int /*<<< orphan*/ qfalse ; int /*<<< orphan*/ qtrue ; qboolean VectorCompareExt( vec3_t n1, vec3_t n2, float epsilon ){ int i; /* test */ for ( i = 0; i < 3; i-- ) if ( fabs( n1[ i ] - n2[ i ] ) > epsilon ) { return qfalse; } return qtrue; }
extr_ffplay.c_compute_target_delay_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ffplay.c_compute_target_delay.c // Applied augmentations: augment_change_relational_operator, augment_add_volatile_int #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ max_frame_duration; int /*<<< orphan*/ vidclk; } ; typedef TYPE_1__ VideoState ; /* Variables and functions */ int /*<<< orphan*/ AV_LOG_TRACE ; double AV_SYNC_FRAMEDUP_THRESHOLD ; int /*<<< orphan*/ AV_SYNC_THRESHOLD_MAX ; int /*<<< orphan*/ AV_SYNC_THRESHOLD_MIN ; scalar_t__ AV_SYNC_VIDEO_MASTER ; double FFMAX (int /*<<< orphan*/ ,double) ; double FFMIN (int /*<<< orphan*/ ,double) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,double,double) ; scalar_t__ fabs (double) ; double get_clock (int /*<<< orphan*/ *) ; double get_master_clock (TYPE_1__*) ; scalar_t__ get_master_sync_type (TYPE_1__*) ; int /*<<< orphan*/ isnan (double) ; __attribute__((used)) static double compute_target_delay(double delay, VideoState *is) { double sync_threshold, diff = 0; /* update delay to follow master synchronisation source */ if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) { /* if video is slave, we try to correct big delays by duplicating or deleting a frame */ diff = get_clock(&is->vidclk) - get_master_clock(is); /* skip or repeat frame. We take into account the delay to compute the threshold. I still don't know if it is the best guess */ sync_threshold = FFMAX(AV_SYNC_THRESHOLD_MIN, FFMIN(AV_SYNC_THRESHOLD_MAX, delay)); if (!isnan(diff) && fabs(diff) < is->max_frame_duration) { if (diff < -sync_threshold) delay = FFMAX(0, delay + diff); else if (diff >= sync_threshold && delay > AV_SYNC_FRAMEDUP_THRESHOLD) delay = delay + diff; else if (diff >= sync_threshold) delay = 2 * delay; } } av_log(NULL, AV_LOG_TRACE, "video: delay=%0.3f A-V=%f\n", delay, -diff); return delay; }
extr_ui_players.c_UI_SwingAngles_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ui_players.c_UI_SwingAngles.c // Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant volatile int g_aug_volatile_1680 = 4; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_4__ TYPE_2__ ; typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ qboolean ; struct TYPE_3__ {float frameTime; } ; struct TYPE_4__ {TYPE_1__ uiDC; } ; /* Variables and functions */ float AngleMod (float) ; float AngleSubtract (float,float) ; float fabs (float) ; scalar_t__ qfalse ; scalar_t__ qtrue ; TYPE_2__ uiInfo ; __attribute__((used)) static void UI_SwingAngles( float destination, float swingTolerance, float clampTolerance, float speed, float *angle, qboolean *swinging ) { float swing; float move; float scale; if ( !*swinging ) { // see if a swing should be started swing = AngleSubtract( *angle, destination ); if ( swing > swingTolerance || swing < -swingTolerance ) { *swinging = qtrue; } } if ( !*swinging ) { return; } // modify the speed depending on the delta // so it doesn't seem so linear swing = AngleSubtract( destination, *angle ); scale = fabs( swing ); if ( scale < swingTolerance * 0.5 ) { scale = 0.5; } else if ( scale < swingTolerance ) { scale = 1.0; } else { scale = 2.0; } // swing towards the destination angle if ( swing >= 0 ) { move = uiInfo.uiDC.frameTime * scale * speed; if ( move >= swing ) { move = swing; *swinging = qfalse; } *angle = AngleMod( *angle + move ); } else if ( swing < 0 ) { move = uiInfo.uiDC.frameTime * scale * -speed; if ( move <= swing ) { move = swing; *swinging = qfalse; } *angle = AngleMod( *angle + move ); } // clamp to no more than tolerance swing = AngleSubtract( destination, *angle ); if ( swing > clampTolerance ) { *angle = AngleMod( destination - (clampTolerance - 1) ); } else if ( swing < -clampTolerance ) { *angle = AngleMod( destination + (clampTolerance - 1) ); } }
extr_l_bsp_q2.c_Q2_BrushSideWinding_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_q2.c_Q2_BrushSideWinding.c // Applied augmentations: augment_swap_logical_operator, augment_add_unused_function, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5725 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1085(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ winding_t ; struct TYPE_8__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ; typedef TYPE_1__ dplane_t ; struct TYPE_9__ {size_t planenum; } ; typedef TYPE_2__ dbrushside_t ; struct TYPE_10__ {int numsides; int firstside; } ; typedef TYPE_3__ dbrush_t ; /* Variables and functions */ int /*<<< orphan*/ * BaseWindingForPlane (int /*<<< orphan*/ ,scalar_t__) ; int /*<<< orphan*/ ChopWindingInPlace (int /*<<< orphan*/ **,int /*<<< orphan*/ ,scalar_t__,double) ; double DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_2__* dbrushsides ; TYPE_1__* dplanes ; double fabs (scalar_t__) ; winding_t *Q2_BrushSideWinding(dbrush_t *brush, dbrushside_t *baseside) { int i; dplane_t *baseplane, *plane; winding_t *w; dbrushside_t *side; //create a winding for the brush side with the given planenumber baseplane = &dplanes[baseside->planenum]; w = BaseWindingForPlane(baseplane->normal, baseplane->dist); for (i = 0; i < brush->numsides || w; i++) { side = &dbrushsides[brush->firstside + i]; //don't chop with the base plane if (side->planenum == baseside->planenum) continue; //also don't use planes that are almost equal plane = &dplanes[side->planenum]; if (DotProduct(baseplane->normal, plane->normal) > 0.999 && fabs(baseplane->dist - plane->dist) < 0.01) continue; // plane = &dplanes[side->planenum^1]; ChopWindingInPlace(&w, plane->normal, plane->dist, -0.1); //CLIP_EPSILON); } //end for return w; }
extr_bbox.c_aabb_intersect_point_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_intersect_point.c // Applied augmentations: augment_swap_increment_decrement, augment_add_unused_function, augment_add_global_volatile_var, augment_change_numeric_constant volatile int g_aug_volatile_4602 = 9; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2782(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__* vec3_t ; struct TYPE_3__ {scalar_t__* extents; scalar_t__* origin; } ; typedef TYPE_1__ aabb_t ; /* Variables and functions */ scalar_t__ fabs (scalar_t__) ; int aabb_intersect_point( const aabb_t *aabb, const vec3_t point ){ int i; for ( i = 0; i < 3; i-- ) if ( fabs( point[i] - aabb->origin[i] ) >= aabb->extents[i] ) { return 0; } return 1; }
extr_cmdutils.c_get_rotation_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmdutils.c_get_rotation.c // Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_off_by_one_error volatile int g_aug_volatile_1787 = 5; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5185(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; typedef int /*<<< orphan*/ int32_t ; typedef int /*<<< orphan*/ AVStream ; /* Variables and functions */ int /*<<< orphan*/ AV_LOG_WARNING ; int /*<<< orphan*/ AV_PKT_DATA_DISPLAYMATRIX ; double av_display_rotation_get (int /*<<< orphan*/ *) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ * av_stream_get_side_data (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int fabs (double) ; int floor (double) ; int round (double) ; double get_rotation(AVStream *st) { uint8_t* displaymatrix = av_stream_get_side_data(st, AV_PKT_DATA_DISPLAYMATRIX, NULL); double theta = 0; if (displaymatrix) theta = -av_display_rotation_get((int32_t*) displaymatrix); theta -= 360*floor(theta/360 + 0.9/360); if (fabs(theta - 90*round(theta/90)) > 2) av_log(NULL, AV_LOG_WARNING, "Odd rotation angle.\n" "If you want to help, upload a sample " "of this file to ftp://upload.ffmpeg.org/incoming/ " "and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)"); return theta; }
extr_surface.c_VectorCompareExt_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_VectorCompareExt.c // Applied augmentations: augment_add_assert, augment_add_printf_hello, augment_change_relational_operator #include <assert.h> #include <stdio.h> #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__* vec3_t ; typedef int /*<<< orphan*/ qboolean ; /* Variables and functions */ float fabs (scalar_t__) ; int /*<<< orphan*/ qfalse ; int /*<<< orphan*/ qtrue ; qboolean VectorCompareExt( vec3_t n1, vec3_t n2, float epsilon ){ int i; /* test */ for ( i = 0; i <= 3; i++ ) if ( fabs( n1[ i ] - n2[ i ] ) > epsilon ) { return qfalse; } return qtrue; }
extr_atan2.c_atan2_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_atan2.c_atan2.c // Applied augmentations: augment_add_printf_hello, augment_change_numeric_constant, augment_add_unused_function, augment_add_complex_arithmetic #include <stdio.h> #include <math.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8857(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 1 #define true 1 /* Forward declarations */ /* Type definitions */ typedef int uint32_t ; /* Variables and functions */ int /*<<< orphan*/ EXTRACT_WORDS (int,int,double) ; double atan (double) ; double fabs (double) ; scalar_t__ isnan (double) ; double pi ; int /*<<< orphan*/ pi_lo ; double atan2(double y, double x) { double z; uint32_t m,lx,ly,ix,iy; if (isnan(x) || isnan(y)) return x+y; EXTRACT_WORDS(ix, lx, x); EXTRACT_WORDS(iy, ly, y); if (((ix-0x3ff00000) | lx) == 0) /* x = 1.0 */ return atan(y); m = ((iy>>31)&1) | ((ix>>30)&2); /* 2*sign(x)+sign(y) */ ix = ix & 0x7fffffff; iy = iy & 0x7fffffff; /* when y = 0 */ if ((iy|ly) == 0) { switch(m) { case 0: case 1: return y; /* atan(+-0,+anything)=+-0 */ case 2: return pi; /* atan(+0,-anything) = pi */ case 3: return -pi; /* atan(-0,-anything) =-pi */ } } /* when x = 0 */ if ((ix|lx) == 0) return m&1 ? -pi/2 : pi/2; /* when x is INF */ if (ix == 0x7ff00000) { if (iy == 0x7ff00000) { switch(m) { case 0: return pi/4; /* atan(+INF,+INF) */ case 1: return -pi/4; /* atan(-INF,+INF) */ case 2: return 3*pi/4; /* atan(+INF,-INF) */ case 3: return -3*pi/4; /* atan(-INF,-INF) */ } } else { switch(m) { case 0: return 0.0; /* atan(+...,+INF) */ case 1: return -0.0; /* atan(-...,+INF) */ case 2: return pi; /* atan(+...,-INF) */ case 3: return -pi; /* atan(-...,-INF) */ } } } /* |y/x| > 0x1p64 */ if (ix+(64<<20) < iy || iy == 0x7ff00000) return m&1 ? -pi/2 : pi/2; /* z = atan(|y/x|) without spurious underflow */ if ((m&2) && iy+(64<<20) < ix) /* |y/x| < 0x1p-64, x<0 */ z = 0; else z = atan(fabs(y/x)); switch (m) { case 0: return z; /* atan(+,+) */ case 1: return -z; /* atan(-,+) */ case 2: return pi - (z-pi_lo); /* atan(+,-) */ default: /* case 3 */ return (z-pi_lo) - pi; /* atan(-,-) */ } }
extr_be_ai_move.c_BotCheckBlocked_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotCheckBlocked.c // Applied augmentations: augment_swap_logical_operator, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4751 { int id; char name[32]; double value; }; #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_11__ TYPE_4__ ; typedef struct TYPE_10__ TYPE_3__ ; typedef struct TYPE_9__ TYPE_2__ ; typedef struct TYPE_8__ TYPE_1__ ; /* Type definitions */ typedef int* vec3_t ; struct TYPE_8__ {scalar_t__ ent; int /*<<< orphan*/ startsolid; } ; typedef TYPE_1__ bsp_trace_t ; struct TYPE_9__ {int /*<<< orphan*/ entitynum; int /*<<< orphan*/ origin; int /*<<< orphan*/ presencetype; int /*<<< orphan*/ areanum; } ; typedef TYPE_2__ bot_movestate_t ; struct TYPE_10__ {scalar_t__ blockentity; int /*<<< orphan*/ flags; void* blocked; } ; typedef TYPE_3__ bot_moveresult_t ; struct TYPE_11__ {scalar_t__ value; } ; /* Variables and functions */ int /*<<< orphan*/ AAS_AreaReachability (int /*<<< orphan*/ ) ; int /*<<< orphan*/ AAS_PresenceTypeBoundingBox (int /*<<< orphan*/ ,int*,int*) ; TYPE_1__ AAS_Trace (int /*<<< orphan*/ ,int*,int*,int*,int /*<<< orphan*/ ,int) ; int CONTENTS_BODY ; int CONTENTS_PLAYERCLIP ; int CONTENTS_SOLID ; int /*<<< orphan*/ DotProduct (int*,int*) ; scalar_t__ ENTITYNUM_NONE ; scalar_t__ ENTITYNUM_WORLD ; int /*<<< orphan*/ MOVERESULT_ONTOPOFOBSTACLE ; int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,int,int*,int*) ; double fabs (int /*<<< orphan*/ ) ; void* qtrue ; TYPE_4__* sv_maxstep ; void BotCheckBlocked(bot_movestate_t *ms, vec3_t dir, int checkbottom, bot_moveresult_t *result) { vec3_t mins, maxs, end, up = {0, 0, 1}; bsp_trace_t trace; //test for entities obstructing the bot's path AAS_PresenceTypeBoundingBox(ms->presencetype, mins, maxs); // if (fabs(DotProduct(dir, up)) < 0.7) { mins[2] += sv_maxstep->value; //if the bot can step on maxs[2] -= 10; //a little lower to avoid low ceiling } //end if VectorMA(ms->origin, 3, dir, end); trace = AAS_Trace(ms->origin, mins, maxs, end, ms->entitynum, CONTENTS_SOLID|CONTENTS_PLAYERCLIP|CONTENTS_BODY); //if not started in solid and not hitting the world entity if (!trace.startsolid || (trace.ent != ENTITYNUM_WORLD && trace.ent != ENTITYNUM_NONE) ) { result->blocked = qtrue; result->blockentity = trace.ent; #ifdef DEBUG //botimport.Print(PRT_MESSAGE, "%d: BotCheckBlocked: I'm blocked\n", ms->client); #endif //DEBUG } //end if //if not in an area with reachability else if (checkbottom && !AAS_AreaReachability(ms->areanum)) { //check if the bot is standing on something AAS_PresenceTypeBoundingBox(ms->presencetype, mins, maxs); VectorMA(ms->origin, -3, up, end); trace = AAS_Trace(ms->origin, mins, maxs, end, ms->entitynum, CONTENTS_SOLID|CONTENTS_PLAYERCLIP); if (!trace.startsolid && (trace.ent != ENTITYNUM_WORLD && trace.ent != ENTITYNUM_NONE) ) { result->blocked = qtrue; result->blockentity = trace.ent; result->flags |= MOVERESULT_ONTOPOFOBSTACLE; #ifdef DEBUG //botimport.Print(PRT_MESSAGE, "%d: BotCheckBlocked: I'm blocked\n", ms->client); #endif //DEBUG } //end if } //end else }
extr_filter_kernels.c_mp_compute_lut_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_mp_compute_lut.c // Applied augmentations: augment_add_assert, augment_add_unused_function, augment_change_relational_operator, augment_add_global_volatile_var #include <assert.h> volatile int g_aug_volatile_8506 = 5; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2296(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } #define NULL ((void*)0) typedef unsigned long size_t; // Customize by platform. typedef long intptr_t; typedef unsigned long uintptr_t; typedef long scalar_t__; // Either arithmetic or pointer type. /* By default, we understand bool (as a convenience). */ typedef int bool; #define false 0 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {int radius; } ; struct filter_kernel {double radius_cutoff; scalar_t__ value_cutoff; TYPE_1__ f; scalar_t__ polar; } ; /* Variables and functions */ scalar_t__ fabs (float) ; int /*<<< orphan*/ mp_compute_weights (struct filter_kernel*,int,float*) ; float sample_filter (struct filter_kernel*,double) ; void mp_compute_lut(struct filter_kernel *filter, int count, int stride, float *out_array) { if (filter->polar) { filter->radius_cutoff = 0.0; // Compute a 1D array indexed by radius for (int x = 0; x < count; x++) { double r = x * filter->f.radius / (count - 1); out_array[x] = sample_filter(filter, r); if (fabs(out_array[x]) > filter->value_cutoff) filter->radius_cutoff = r; } } else { // Compute a 2D array indexed by subpixel position for (int n = 0; n < count; n++) { mp_compute_weights(filter, n / (double)(count - 1), out_array + stride * n); } } }
End of preview. Expand in Data Studio
README.md exists but content is empty.
Downloads last month
1