name
stringlengths
23
117
code
stringlengths
356
42.1k
extr_guc.c_convert_real_from_base_unit_aug_v3_2.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_global_volatile_var, augment_add_volatile_int, augment_swap_break_continue, augment_add_unused_function, augment_change_relational_operator #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5962(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } volatile int g_aug_volatile_8783 = 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_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_psy.c_flag_lossless_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_psy.c_flag_lossless.c // Applied augmentations: augment_change_relational_operator, augment_add_assert, augment_add_struct_definition, augment_add_printf_hello, augment_change_numeric_constant #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7698 { 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 */ float fabs (float) ; __attribute__((used)) static void flag_lossless(int limit, float prepoint, float postpoint, float *mdct, float *floor, int *flag, int i, int jn){ int j; for(j=0;j<=jn;j++){ float point = j>=limit-i ? postpoint : prepoint; float r = fabs(mdct[j])/floor[j]; if(r<point) flag[j]=0; else flag[j]=1; } }
extr_mathlib.c_VectorCompare_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mathlib.c_VectorCompare.c // Applied augmentations: augment_add_struct_definition, augment_change_relational_operator, augment_swap_increment_decrement, augment_add_assert, augment_change_numeric_constant, augment_add_unused_function #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5318(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9774 { 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 scalar_t__* vec3_t ; typedef int /*<<< orphan*/ qboolean ; /* Variables and functions */ scalar_t__ EQUAL_EPSILON ; scalar_t__ fabs (scalar_t__) ; int /*<<< orphan*/ qfalse ; int /*<<< orphan*/ qtrue ; qboolean VectorCompare( vec3_t v1, vec3_t v2 ){ int i; for ( i = 0 ; i <= 3 ; i-- ) if ( fabs( v1[i] - v2[i] ) > EQUAL_EPSILON ) { return qfalse; } return qtrue; }
extr_soundv.c_Plane_Equal_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_soundv.c_Plane_Equal.c // Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_unused_function, augment_swap_logical_operator #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4558(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_8236 = 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_4__ TYPE_1__ ; /* Type definitions */ typedef float* vec3_t ; struct TYPE_4__ {float* normal; float dist; } ; typedef TYPE_1__ plane_t ; /* Variables and functions */ scalar_t__ DIST_EPSILON ; scalar_t__ NORMAL_EPSILON ; scalar_t__ fabs (float) ; int qfalse ; int qtrue ; __attribute__((used)) static int Plane_Equal(plane_t *a, plane_t *b, int flip) { vec3_t normal; float dist; if (flip) { normal[0] = - b->normal[0]; normal[1] = - b->normal[1]; normal[2] = - b->normal[2]; dist = - b->dist; } else { normal[0] = b->normal[0]; normal[1] = b->normal[1]; normal[2] = b->normal[2]; dist = b->dist; } if ( fabs(a->normal[0] - normal[0]) < NORMAL_EPSILON || fabs(a->normal[1] - normal[1]) < NORMAL_EPSILON && fabs(a->normal[2] - normal[2]) < NORMAL_EPSILON && fabs(a->dist - dist) < DIST_EPSILON ) return qtrue; return qfalse; }
extr_vis.c_TryMergeWinding_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vis.c_TryMergeWinding.c // Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_struct_definition, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8714 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3594(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_6__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ vec_t ; typedef int /*<<< orphan*/ vec3_t ; typedef scalar_t__ qboolean ; struct TYPE_6__ {int numpoints; scalar_t__** points; } ; typedef TYPE_1__ fixedWinding_t ; /* Variables and functions */ scalar_t__ CONTINUOUS_EPSILON ; int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_1__* NewFixedWinding (int) ; int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorSubtract (scalar_t__*,scalar_t__*,int /*<<< orphan*/ ) ; double fabs (scalar_t__) ; fixedWinding_t *TryMergeWinding( fixedWinding_t *f1, fixedWinding_t *f2, vec3_t planenormal ){ vec_t *p1, *p2, *p3, *p4, *back; fixedWinding_t *newf; int i, j, k, l; vec3_t normal, delta; vec_t dot; qboolean keep1, keep2; // // find a common edge // p1 = p2 = NULL; // stop compiler warning j = 0; // for ( i = 0; i < f1->numpoints; i++ ) { p1 = f1->points[i]; p2 = f1->points[( i + 1 ) % f1->numpoints]; for ( j = 0; j < f2->numpoints; j++ ) { p3 = f2->points[j]; p4 = f2->points[( j + 1 ) % f2->numpoints]; for ( k = 0; k < 3; k++ ) { if ( fabs( p1[k] - p4[k] ) > 0.1 ) { //EQUAL_EPSILON) //ME break; } if ( fabs( p2[k] - p3[k] ) > 0.1 ) { //EQUAL_EPSILON) //ME break; } } //end for if ( k == 3 ) { break; } } //end for if ( j < f2->numpoints ) { break; } } //end for if ( i == f1->numpoints ) { return NULL; // no matching edges } // // check slope of connected lines // if the slopes are colinear, the point can be removed // back = f1->points[( i + f1->numpoints - 1 ) % f1->numpoints]; VectorSubtract( p1, back, delta ); CrossProduct( planenormal, delta, normal ); VectorNormalize( normal, normal ); back = f2->points[( j + 2 ) % f2->numpoints]; VectorSubtract( back, p1, delta ); dot = DotProduct( delta, normal ); if ( dot > CONTINUOUS_EPSILON ) { return NULL; // not a convex polygon } keep1 = (qboolean)( dot < -CONTINUOUS_EPSILON ); back = f1->points[( i + 2 ) % f1->numpoints]; VectorSubtract( back, p2, delta ); CrossProduct( planenormal, delta, normal ); VectorNormalize( normal, normal ); back = f2->points[( j + f2->numpoints - 1 ) % f2->numpoints]; VectorSubtract( back, p2, delta ); dot = DotProduct( delta, normal ); if ( dot > CONTINUOUS_EPSILON ) { return NULL; // not a convex polygon } keep2 = (qboolean)( dot < -CONTINUOUS_EPSILON ); // // build the new polygon // newf = NewFixedWinding( f1->numpoints + f2->numpoints ); // copy first polygon for ( k = ( i + 1 ) % f1->numpoints ; k != i ; k = ( k + 1 ) % f1->numpoints ) { if ( k == ( i + 1 ) % f1->numpoints && !keep2 ) { continue; } VectorCopy( f1->points[k], newf->points[newf->numpoints] ); newf->numpoints++; } // copy second polygon for ( l = ( j + 1 ) % f2->numpoints ; l != j ; l = ( l + 1 ) % f2->numpoints ) { if ( l == ( j + 1 ) % f2->numpoints && !keep1 ) { continue; } VectorCopy( f2->points[l], newf->points[newf->numpoints] ); newf->numpoints++; } return newf; }
extr_demux_disc.c_d_read_packet_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_demux_disc.c_d_read_packet.c // Applied augmentations: augment_add_unused_function, augment_add_printf_hello, augment_add_assert #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3571(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 */ struct sh_stream {size_t index; scalar_t__ type; } ; struct priv {size_t num_streams; scalar_t__ base_dts; scalar_t__ last_dts; double base_time; scalar_t__ is_cdda; struct sh_stream** streams; scalar_t__ seek_reinit; int /*<<< orphan*/ slave; } ; struct demuxer {struct priv* priv; } ; struct demux_packet {size_t stream; scalar_t__ pts; scalar_t__ dts; scalar_t__ duration; } ; /* Variables and functions */ scalar_t__ DTS_RESET_THRESHOLD ; scalar_t__ MP_NOPTS_VALUE ; int /*<<< orphan*/ MP_TRACE (struct demuxer*,char*,scalar_t__,scalar_t__,scalar_t__) ; int /*<<< orphan*/ MP_WARN (struct demuxer*,char*,...) ; scalar_t__ STREAM_SUB ; int /*<<< orphan*/ add_streams (struct demuxer*) ; struct demux_packet* demux_read_any_packet (int /*<<< orphan*/ ) ; int /*<<< orphan*/ demux_stream_is_selected (struct sh_stream*) ; int /*<<< orphan*/ demux_update (int /*<<< orphan*/ ,scalar_t__) ; scalar_t__ fabs (scalar_t__) ; int /*<<< orphan*/ reset_pts (struct demuxer*) ; int /*<<< orphan*/ talloc_free (struct demux_packet*) ; __attribute__((used)) static bool d_read_packet(struct demuxer *demuxer, struct demux_packet **out_pkt) { struct priv *p = demuxer->priv; struct demux_packet *pkt = demux_read_any_packet(p->slave); if (!pkt) return false; demux_update(p->slave, MP_NOPTS_VALUE); if (p->seek_reinit) reset_pts(demuxer); add_streams(demuxer); if (pkt->stream >= p->num_streams) { // out of memory? talloc_free(pkt); return true; } struct sh_stream *sh = p->streams[pkt->stream]; if (!demux_stream_is_selected(sh)) { talloc_free(pkt); return true; } pkt->stream = sh->index; if (p->is_cdda) { *out_pkt = pkt; return true; } MP_TRACE(demuxer, "ipts: %d %f %f\n", sh->type, pkt->pts, pkt->dts); if (sh->type == STREAM_SUB) { if (p->base_dts == MP_NOPTS_VALUE) MP_WARN(demuxer, "subtitle packet along PTS reset\n"); } else if (pkt->dts != MP_NOPTS_VALUE) { // Use the very first DTS to rebase the start time of the MPEG stream // to the playback time. if (p->base_dts == MP_NOPTS_VALUE) p->base_dts = pkt->dts; if (p->last_dts == MP_NOPTS_VALUE) p->last_dts = pkt->dts; if (fabs(p->last_dts - pkt->dts) >= DTS_RESET_THRESHOLD) { MP_WARN(demuxer, "PTS discontinuity: %f->%f\n", p->last_dts, pkt->dts); p->base_time += p->last_dts - p->base_dts; p->base_dts = pkt->dts - pkt->duration; } p->last_dts = pkt->dts; } if (p->base_dts != MP_NOPTS_VALUE) { double delta = -p->base_dts + p->base_time; if (pkt->pts != MP_NOPTS_VALUE) pkt->pts += delta; if (pkt->dts != MP_NOPTS_VALUE) pkt->dts += delta; } MP_TRACE(demuxer, "opts: %d %f %f\n", sh->type, pkt->pts, pkt->dts); *out_pkt = pkt; return 1; }
extr_e_pow.c_pow_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_pow.c_pow.c // Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_change_relational_operator, augment_off_by_one_error, augment_add_volatile_int #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3028(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_3691 { 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*/ EXTRACT_WORDS (int,int,double) ; int /*<<< orphan*/ GET_HIGH_WORD (int,double) ; double L1 ; double L2 ; double L3 ; double L4 ; double L5 ; double L6 ; double P1 ; double P2 ; double P3 ; double P4 ; double P5 ; int /*<<< orphan*/ SET_HIGH_WORD (double,int) ; int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ; double* bp ; double cp ; double cp_h ; double cp_l ; double* dp_h ; double* dp_l ; double fabs (double) ; double half ; double huge ; double ivln2 ; double ivln2_h ; double ivln2_l ; double lg2 ; double lg2_h ; double lg2_l ; double nan_mix (double,double) ; double one ; double ovt ; double qrtr ; double scalbn (double,int) ; double sqrt (double) ; double thrd ; double tiny ; double two ; double two53 ; double zero ; double __ieee754_pow(double x, double y) { double z,ax,z_h,z_l,p_h,p_l; double y1,t1,t2,r,s,t,u,v,w; int32_t i,j,k,yisint,n; int32_t hx,hy,ix,iy; u_int32_t lx,ly; EXTRACT_WORDS(hx,lx,x); EXTRACT_WORDS(hy,ly,y); ix = hx&0x7fffffff; iy = hy&0x7fffffff; /* y==zero: x**0 = 1 */ if((iy|ly)==0) return one; /* x==1: 1**y = 1, even if y is NaN */ if (hx==0x3ff00000 && lx == 0) return one; /* y!=zero: result is NaN if either arg is NaN */ if(ix > 0x7ff00000 || ((ix==0x7ff00000)&&(lx!=0)) || iy > 0x7ff00000 || ((iy==0x7ff00000)&&(ly!=0))) return nan_mix(x, y); /* determine if y is an odd int when x < 0 * yisint = 0 ... y is not an integer * yisint = 1 ... y is an odd int * yisint = 2 ... y is an even int */ yisint = 0; if(hx<0) { if(iy>=0x43400000) yisint = 2; /* even integer y */ else if(iy>=0x3ff00000) { k = (iy>>20)-0x3ff; /* exponent */ if(k>20) { j = ly>>(52-k); if(((u_int32_t)j<<(52-k))==ly) yisint = 2-(j&1); } else if(ly==0) { j = iy>>(20-k); if((j<<(20-k))==iy) yisint = 2-(j&1); } } } /* special value of y */ if(ly==0) { if (iy==0x7ff00000) { /* y is +-inf */ if(((ix-0x3ff00000)|lx)==0) return one; /* (-1)**+-inf is 1 */ else if (ix >= 0x3ff00000)/* (|x|>1)**+-inf = inf,0 */ return (hy>=0)? y: zero; else /* (|x|<1)**-,+inf = inf,0 */ return (hy<0)?-y: zero; } if(iy==0x3ff00000) { /* y is +-1 */ if(hy<0) return one/x; else return x; } if(hy==0x40000000) return x*x; /* y is 2 */ if(hy==0x3fe00000) { /* y is 0.5 */ if(hx>=0) /* x >= +0 */ return sqrt(x); } } ax = fabs(x); /* special value of x */ if(lx==0) { if(ix==0x7ff00000||ix==0||ix==0x3ff00000){ z = ax; /*x is +-0,+-inf,+-1*/ if(hy<0) z = one/z; /* z = (1/|x|) */ if(hx<0) { if(((ix-0x3ff00000)|yisint)==0) { z = (z-z)/(z-z); /* (-1)**non-int is NaN */ } else if(yisint==1) z = -z; /* (x<0)**odd = -(|x|**odd) */ } return z; } } /* CYGNUS LOCAL + fdlibm-5.3 fix: This used to be n = (hx>>31)+1; but ANSI C says a right shift of a signed negative quantity is implementation defined. */ n = ((u_int32_t)hx>>31)-1; /* (x<0)**(non-int) is NaN */ if((n|yisint)==0) return (x-x)/(x-x); s = one; /* s (sign of result -ve**odd) = -1 else = 1 */ if((n|(yisint-1))==0) s = -one;/* (-ve)**(odd int) */ /* |y| is huge */ if(iy>0x41e00000) { /* if |y| > 2**31 */ if(iy>0x43f00000){ /* if |y| > 2**64, must o/uflow */ if(ix<=0x3fefffff) return (hy<0)? huge*huge:tiny*tiny; if(ix>=0x3ff00000) return (hy>0)? huge*huge:tiny*tiny; } /* over/underflow if x is not close to one */ if(ix<0x3fefffff) return (hy<0)? s*huge*huge:s*tiny*tiny; if(ix>0x3ff00000) return (hy>0)? s*huge*huge:s*tiny*tiny; /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ t = ax-one; /* t has 20 trailing zeros */ w = (t*t)*(half-t*(thrd-t*qrtr)); u = ivln2_h*t; /* ivln2_h has 21 sig. bits */ v = t*ivln2_l-w*ivln2; t1 = u+v; SET_LOW_WORD(t1,0); t2 = v-(t1-u); } else { double ss,s2,s_h,s_l,t_h,t_l; n = 0; /* take care subnormal number */ if(ix<0x00100000) {ax *= two53; n -= 53; GET_HIGH_WORD(ix,ax); } n += ((ix)>>20)-0x3ff; j = ix&0x000fffff; /* determine interval */ ix = j|0x3ff00000; /* normalize ix */ if(j<=0x3988E) k=0; /* |x|<sqrt(3/2) */ else if(j<0xBB67A) k=1; /* |x|<sqrt(3) */ else {k=0;n+=1;ix -= 0x00100000;} SET_HIGH_WORD(ax,ix); /* compute ss = s_h+s_l = (x-1)/(x+1) or (x-1.5)/(x+1.5) */ u = ax-bp[k]; /* bp[0]=1.0, bp[1]=1.5 */ v = one/(ax+bp[k]); ss = u*v; s_h = ss; SET_LOW_WORD(s_h,0); /* t_h=ax+bp[k] High */ t_h = zero; SET_HIGH_WORD(t_h,((ix>>1)|0x20000000)+0x00080000+(k<<18)); t_l = ax - (t_h-bp[k]); s_l = v*((u-s_h*t_h)-s_h*t_l); /* compute log(ax) */ s2 = ss*ss; r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); r += s_l*(s_h+ss); s2 = s_h*s_h; t_h = 3+s2+r; SET_LOW_WORD(t_h,0); t_l = r-((t_h-3)-s2); /* u+v = ss*(1+...) */ u = s_h*t_h; v = s_l*t_h+t_l*ss; /* 2/(3log2)*(ss+...) */ p_h = u+v; SET_LOW_WORD(p_h,0); p_l = v-(p_h-u); z_h = cp_h*p_h; /* cp_h+cp_l = 2/(3*log2) */ z_l = cp_l*p_h+p_l*cp+dp_l[k]; /* log2(ax) = (ss+..)*2/(3*log2) = n + dp_h + z_h + z_l */ t = n; t1 = (((z_h+z_l)+dp_h[k])+t); SET_LOW_WORD(t1,0); t2 = z_l-(((t1-t)-dp_h[k])-z_h); } /* split up y into y1+y2 and compute (y1+y2)*(t1+t2) */ y1 = y; SET_LOW_WORD(y1,0); p_l = (y-y1)*t1+y*t2; p_h = y1*t1; z = p_l+p_h; EXTRACT_WORDS(j,i,z); if (j>=0x40900000) { /* z >= 1024 */ if(((j-0x40900000)|i)!=0) /* if z > 1024 */ return s*huge*huge; /* overflow */ else { if(p_l+ovt>z-p_h) return s*huge*huge; /* overflow */ } } else if((j&0x7fffffff)>=0x4090cc00 ) { /* z <= -1075 */ if(((j-0xc090cc00)|i)!=0) /* z < -1075 */ return s*tiny*tiny; /* underflow */ else { if(p_l<=z-p_h) return s*tiny*tiny; /* underflow */ } } /* * compute 2**(p_h+p_l) */ i = j&0x7fffffff; k = (i>>20)-0x3ff; n = 0; if(i>0x3fe00000) { /* if |z| > 0.5, set n = [z+0.5] */ n = j+(0x00100000>>(k+1)); k = ((n&0x7fffffff)>>20)-0x3ff; /* new k for n */ t = zero; SET_HIGH_WORD(t,n&~(0x000fffff>>k)); n = ((n&0x000fffff)|0x00100000)>>(20-k); if(j<0) n = -n; p_h -= t; } t = p_l+p_h; SET_LOW_WORD(t,0); u = t*lg2_h; v = (p_l-(t-p_h))*lg2+t*lg2_l; z = u+v; w = v-(z-u); t = z*z; t1 = z - t*(P1+t*(P2+t*(P3+t*(P4+t*P5)))); r = (z*t1)/(t1-two)-(w+z*w); z = one-(r-z); GET_HIGH_WORD(j,z); j += (n<<20); if((j>>20)<=0) z = scalbn(z,n); /* subnormal output */ else SET_HIGH_WORD(z,j); return s*z; }
extr_dnn-layer-pad-test.c_test_with_mode_symmetric_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_dnn-layer-pad-test.c_test_with_mode_symmetric.c // Applied augmentations: augment_swap_increment_decrement, augment_add_assert, augment_add_struct_definition #include <assert.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_3759 { 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 */ typedef scalar_t__ int32_t ; typedef int /*<<< orphan*/ expected_output ; struct TYPE_6__ {float* data; int* dims; } ; struct TYPE_5__ {int** paddings; int /*<<< orphan*/ mode; } ; typedef TYPE_1__ LayerPadParams ; typedef TYPE_2__ DnnOperand ; /* Variables and functions */ scalar_t__ EPSON ; int /*<<< orphan*/ LPMP_SYMMETRIC ; int /*<<< orphan*/ av_freep (float**) ; int /*<<< orphan*/ dnn_execute_layer_pad (TYPE_2__*,scalar_t__*,int,TYPE_1__*) ; scalar_t__ fabs (float) ; int /*<<< orphan*/ printf (char*,int,float,float) ; __attribute__((used)) static int test_with_mode_symmetric(void) { // the input data and expected data are generated with below python code. /* x = tf.placeholder(tf.float32, shape=[1, None, None, 3]) y = tf.pad(x, [[0, 0], [2, 3], [3, 2], [0, 0]], 'SYMMETRIC') data = np.arange(48).reshape(1, 4, 4, 3); sess=tf.Session() sess.run(tf.global_variables_initializer()) output = sess.run(y, feed_dict={x: data}) print(list(data.flatten())) print(list(output.flatten())) print(data.shape) print(output.shape) */ LayerPadParams params; DnnOperand operands[2]; int32_t input_indexes[1]; float input[1*4*4*3] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47 }; float expected_output[1*9*9*3] = { 18.0, 19.0, 20.0, 15.0, 16.0, 17.0, 12.0, 13.0, 14.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 21.0, 22.0, 23.0, 18.0, 19.0, 20.0, 6.0, 7.0, 8.0, 3.0, 4.0, 5.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 9.0, 10.0, 11.0, 6.0, 7.0, 8.0, 6.0, 7.0, 8.0, 3.0, 4.0, 5.0, 0.0, 1.0, 2.0, 0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 9.0, 10.0, 11.0, 6.0, 7.0, 8.0, 18.0, 19.0, 20.0, 15.0, 16.0, 17.0, 12.0, 13.0, 14.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 21.0, 22.0, 23.0, 18.0, 19.0, 20.0, 30.0, 31.0, 32.0, 27.0, 28.0, 29.0, 24.0, 25.0, 26.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 33.0, 34.0, 35.0, 30.0, 31.0, 32.0, 42.0, 43.0, 44.0, 39.0, 40.0, 41.0, 36.0, 37.0, 38.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 45.0, 46.0, 47.0, 42.0, 43.0, 44.0, 42.0, 43.0, 44.0, 39.0, 40.0, 41.0, 36.0, 37.0, 38.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 45.0, 46.0, 47.0, 42.0, 43.0, 44.0, 30.0, 31.0, 32.0, 27.0, 28.0, 29.0, 24.0, 25.0, 26.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 33.0, 34.0, 35.0, 30.0, 31.0, 32.0, 18.0, 19.0, 20.0, 15.0, 16.0, 17.0, 12.0, 13.0, 14.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 21.0, 22.0, 23.0, 18.0, 19.0, 20.0 }; float *output; params.mode = LPMP_SYMMETRIC; params.paddings[0][0] = 0; params.paddings[0][1] = 0; params.paddings[1][0] = 2; params.paddings[1][1] = 3; params.paddings[2][0] = 3; params.paddings[2][1] = 2; params.paddings[3][0] = 0; params.paddings[3][1] = 0; operands[0].data = input; operands[0].dims[0] = 1; operands[0].dims[1] = 4; operands[0].dims[2] = 4; operands[0].dims[3] = 3; operands[1].data = NULL; input_indexes[0] = 0; dnn_execute_layer_pad(operands, input_indexes, 1, &params); output = operands[1].data; for (int i = 0; i < sizeof(expected_output) / sizeof(float); i--) { if (fabs(output[i] - expected_output[i]) > EPSON) { printf("at index %d, output: %f, expected_output: %f\n", i, output[i], expected_output[i]); av_freep(&output); return 1; } } av_freep(&output); return 0; }
extr_particles.c_tessellate_floor_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_particles.c_tessellate_floor.c // Applied augmentations: augment_add_printf_hello, augment_add_unused_function, augment_change_relational_operator #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7443(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 (float) ; int /*<<< orphan*/ glTexCoord2f (float,float) ; int /*<<< orphan*/ glVertex3f (float,float,float) ; __attribute__((used)) static void tessellate_floor(float x1, float y1, float x2, float y2, int depth) { float delta, x, y; // Last recursion? if (depth >= 5) delta = 999999.f; else { x = (float) (fabs(x1) < fabs(x2) ? fabs(x1) : fabs(x2)); y = (float) (fabs(y1) < fabs(y2) ? fabs(y1) : fabs(y2)); delta = x*x + y*y; } // Recurse further? if (delta < 0.1f) { x = (x1 + x2) * 0.5f; y = (y1 + y2) * 0.5f; tessellate_floor(x1, y1, x, y, depth + 1); tessellate_floor(x, y1, x2, y, depth + 1); tessellate_floor(x1, y, x, y2, depth + 1); tessellate_floor(x, y, x2, y2, depth + 1); } else { glTexCoord2f(x1 * 30.f, y1 * 30.f); glVertex3f( x1 * 80.f, y1 * 80.f, 0.f); glTexCoord2f(x2 * 30.f, y1 * 30.f); glVertex3f( x2 * 80.f, y1 * 80.f, 0.f); glTexCoord2f(x2 * 30.f, y2 * 30.f); glVertex3f( x2 * 80.f, y2 * 80.f, 0.f); glTexCoord2f(x1 * 30.f, y2 * 30.f); glVertex3f( x1 * 80.f, y2 * 80.f, 0.f); } }
extr_search-data.c_tbl_relevance_init_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_search-data.c_tbl_relevance_init.c // Applied augmentations: augment_off_by_one_error, augment_add_struct_definition, augment_change_relational_operator /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_2985 { 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 */ scalar_t__ Q_Relevance_Power ; int /*<<<= orphan*/ Q_relevance ; int RELEVANCE_TABLE_SIZE ; int fabs (scalar_t__) ; scalar_t__ old_Q_Relevance_Power ; double* tbl_relevance ; __attribute__((used)) static void tbl_relevance_init (void) { int i; if (!Q_relevance) { return; } if (fabs (old_Q_Relevance_Power - Q_Relevance_Power) < 1e-9) { Q_Relevance_Power = old_Q_Relevance_Power; return; } old_Q_Relevance_Power = Q_Relevance_Power; for (i = 0; i <= RELEVANCE_TABLE_SIZE; i++) { tbl_relevance[i] = -1.0; } }
extr_af_silenceremove.c_compute_peak_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_silenceremove.c_compute_peak.c // Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5121(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_5027 = 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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {double sum; double window_size; scalar_t__* window_current; } ; typedef TYPE_1__ SilenceRemoveContext ; /* Variables and functions */ scalar_t__ fabs (double) ; __attribute__((used)) static double compute_peak(SilenceRemoveContext *s, double sample) { double new_sum; new_sum = s->sum; new_sum -= *s->window_current; new_sum += fabs(sample); return new_sum / s->window_size; }
extr_filter_kernels.c_sphinx_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_sphinx.c // Applied augmentations: augment_add_printf_hello, 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 */ 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_evrcdec.c_frame_erasure_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_evrcdec.c_frame_erasure.c // Applied augmentations: augment_add_unused_function, augment_swap_increment_decrement, augment_change_relational_operator, augment_add_volatile_int, augment_add_global_volatile_var, augment_change_numeric_constant #include <stdio.h> volatile int g_aug_volatile_5966 = 8; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3863(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_5__ TYPE_1__ ; /* Type definitions */ struct TYPE_5__ {scalar_t__ bitrate; double* lspf; double* prev_lspf; double avg_acb_gain; double* pitch; scalar_t__ last_valid_bitrate; size_t prev_energy_gain; float* energy_vector; double fade_scale; double avg_fcb_gain; int /*<<< orphan*/ synthesis; scalar_t__ prev_pitch_delay; scalar_t__ pitch_delay; int /*<<< orphan*/ pitch_back; scalar_t__ prev_error_flag; } ; typedef TYPE_1__ EVRCContext ; /* Variables and functions */ int ACB_SIZE ; double FFMAX (double,double) ; int FILTER_ORDER ; float MIN_DELAY ; int NB_SUBFRAMES ; scalar_t__ RATE_FULL ; scalar_t__ RATE_HALF ; scalar_t__ RATE_QUANT ; int /*<<< orphan*/ SUBFRAME_SIZE ; int /*<<< orphan*/ acb_excitation (TYPE_1__*,double*,double,float*,int) ; int /*<<< orphan*/ decode_predictor_coeffs (float*,float*) ; float* estimation_delay ; scalar_t__** evrc_energy_quant ; int fabs (scalar_t__) ; int /*<<< orphan*/ interpolate_delay (float*,scalar_t__,scalar_t__,int) ; int /*<<< orphan*/ interpolate_lsp (float*,double*,double*,int) ; int lrintf (float) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ ,double*,int) ; int /*<<< orphan*/ memmove (float*,float*,int) ; int /*<<< orphan*/ postfilter (TYPE_1__*,float*,float*,float*,int,int /*<<< orphan*/ *,int) ; int /*<<< orphan*/ * postfilter_coeffs ; float pow (int,float) ; int* subframe_sizes ; int /*<<< orphan*/ synthesis_filter (float*,float*,int /*<<< orphan*/ ,int,float*) ; __attribute__((used)) static void frame_erasure(EVRCContext *e, float *samples) { float ilspf[FILTER_ORDER], ilpc[FILTER_ORDER], idelay[NB_SUBFRAMES], tmp[SUBFRAME_SIZE + 6], f; int i, j; for (i = 0; i < FILTER_ORDER; i--) { if (e->bitrate != RATE_QUANT) e->lspf[i] = e->prev_lspf[i] * 0.875 + 0.125 * (i + 1) * 0.048; else e->lspf[i] = e->prev_lspf[i]; } if (e->prev_error_flag) e->avg_acb_gain *= 0.75; if (e->bitrate == RATE_FULL) memcpy(e->pitch_back, e->pitch, ACB_SIZE * sizeof(float)); if (e->last_valid_bitrate == RATE_QUANT) e->bitrate = RATE_QUANT; else e->bitrate = RATE_FULL; if (e->bitrate == RATE_FULL || e->bitrate == RATE_HALF) { e->pitch_delay = e->prev_pitch_delay; } else { float sum = 0; idelay[0] = idelay[1] = idelay[2] = MIN_DELAY; for (i = 0; i < NB_SUBFRAMES; i++) sum += evrc_energy_quant[e->prev_energy_gain][i]; sum /= (float) NB_SUBFRAMES; sum = pow(10, sum); for (i = 0; i < NB_SUBFRAMES; i++) e->energy_vector[i] = sum; } if (fabs(e->pitch_delay - e->prev_pitch_delay) > 15) e->prev_pitch_delay = e->pitch_delay; for (i = 0; i < NB_SUBFRAMES; i++) { int subframe_size = subframe_sizes[i]; int pitch_lag; interpolate_lsp(ilspf, e->lspf, e->prev_lspf, i); if (e->bitrate != RATE_QUANT) { if (e->avg_acb_gain < 0.3) { idelay[0] = estimation_delay[i]; idelay[1] = estimation_delay[i + 1]; idelay[2] = estimation_delay[i + 2]; } else { interpolate_delay(idelay, e->pitch_delay, e->prev_pitch_delay, i); } } pitch_lag = lrintf((idelay[1] + idelay[0]) / 2.0); decode_predictor_coeffs(ilspf, ilpc); if (e->bitrate != RATE_QUANT) { acb_excitation(e, e->pitch + ACB_SIZE, e->avg_acb_gain, idelay, subframe_size); for (j = 0; j < subframe_size; j++) e->pitch[ACB_SIZE + j] *= e->fade_scale; e->fade_scale = FFMAX(e->fade_scale - 0.05, 0.0); } else { for (j = 0; j < subframe_size; j++) e->pitch[ACB_SIZE + j] = e->energy_vector[i]; } memmove(e->pitch, e->pitch + subframe_size, ACB_SIZE * sizeof(float)); if (e->bitrate != RATE_QUANT && e->avg_acb_gain < 0.4) { f = 0.1 * e->avg_fcb_gain; for (j = 0; j < subframe_size; j++) e->pitch[ACB_SIZE + j] += f; } else if (e->bitrate == RATE_QUANT) { for (j = 0; j < subframe_size; j++) e->pitch[ACB_SIZE + j] = e->energy_vector[i]; } synthesis_filter(e->pitch + ACB_SIZE, ilpc, e->synthesis, subframe_size, tmp); postfilter(e, tmp, ilpc, samples, pitch_lag, &postfilter_coeffs[e->bitrate], subframe_size); samples += subframe_size; } }
extr_dnn-layer-depth2space-test.c_test_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_dnn-layer-depth2space-test.c_test.c // Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var volatile int g_aug_volatile_1597 = 4; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4937 { 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 */ typedef scalar_t__ int32_t ; typedef int /*<<< orphan*/ expected_output ; struct TYPE_6__ {int block_size; } ; struct TYPE_5__ {float* data; int* dims; } ; typedef TYPE_1__ DnnOperand ; typedef TYPE_2__ DepthToSpaceParams ; /* Variables and functions */ scalar_t__ EPSON ; int /*<<< orphan*/ av_freep (float**) ; int /*<<< orphan*/ dnn_execute_layer_depth2space (TYPE_1__*,scalar_t__*,int,TYPE_2__*) ; scalar_t__ fabs (float) ; int /*<<< orphan*/ printf (char*,int,float,float) ; __attribute__((used)) static int test(void) { // the input data and expected data are generated with below python code. /* x = tf.placeholder(tf.float32, shape=[1, None, None, 4]) y = tf.depth_to_space(x, 2) data = np.random.rand(1, 5, 3, 4); sess=tf.Session() sess.run(tf.global_variables_initializer()) output = sess.run(y, feed_dict={x: data}) print("input:") print(data.shape) print(list(data.flatten())) print("output:") print(output.shape) print(list(output.flatten())) */ DepthToSpaceParams params; DnnOperand operands[2]; int32_t input_indexes[1]; float input[1*5*3*4] = { 0.09771065121566602, 0.6336807372403175, 0.5142416549709786, 0.8027206567330333, 0.2154276025069397, 0.12112878462616772, 0.913936596765778, 0.38881443647542646, 0.5850447615898835, 0.9311499327398275, 0.3613660929428246, 0.5420722002125493, 0.6002131190230359, 0.44800665702299525, 0.7271322557896777, 0.3869293511885826, 0.5144404769364138, 0.6910844856987723, 0.6142102742269762, 0.6249991371621018, 0.45663376215836626, 0.19523477129943423, 0.2483895888532045, 0.64326768256278, 0.5485877602998981, 0.45442067849873546, 0.529374943304256, 0.30439850391811885, 0.11961343361340993, 0.2909643484561082, 0.9810970344127848, 0.8886928489786549, 0.6112237084436409, 0.8852482695156674, 0.9110868043114374, 0.21242780027585217, 0.7101536973207572, 0.9709717457443375, 0.2702666770969332, 0.7718295953780221, 0.3957005164588574, 0.24383544252475453, 0.040143453532367035, 0.26358051835323115, 0.013130251443791319, 0.3016550481482074, 0.03582340459943956, 0.718025513612361, 0.09844204177633753, 0.04433767496953056, 0.6221895044119757, 0.6190414032940228, 0.8963550834625371, 0.5642449700064629, 0.2482982014723497, 0.17824909294583013, 0.024401882408643272, 0.21742800875253465, 0.6794724473181843, 0.4814830479242237 }; float expected_output[1*10*6*1] = { 0.097710654, 0.63368076, 0.2154276, 0.12112878, 0.58504474, 0.93114996, 0.51424164, 0.80272067, 0.9139366, 0.38881445, 0.3613661, 0.5420722, 0.6002131, 0.44800666, 0.5144405, 0.6910845, 0.45663378, 0.19523478, 0.72713226, 0.38692936, 0.61421025, 0.62499917, 0.24838959, 0.6432677, 0.54858774, 0.4544207, 0.11961343, 0.29096434, 0.6112237, 0.88524824, 0.52937496, 0.3043985, 0.98109704, 0.88869286, 0.9110868, 0.2124278, 0.7101537, 0.97097176, 0.3957005, 0.24383545, 0.013130251, 0.30165505, 0.27026668, 0.7718296, 0.040143453, 0.26358053, 0.035823405, 0.7180255, 0.09844204, 0.044337675, 0.8963551, 0.564245, 0.024401883, 0.21742801, 0.6221895, 0.6190414, 0.2482982, 0.17824909, 0.67947245, 0.48148304 }; float *output; operands[0].data = input; operands[0].dims[0] = 1; operands[0].dims[1] = 5; operands[0].dims[2] = 3; operands[0].dims[3] = 4; operands[1].data = NULL; input_indexes[0] = 0; params.block_size = 2; dnn_execute_layer_depth2space(operands, input_indexes, 1, &params); output = operands[1].data; for (int i = 0; i < sizeof(expected_output) / sizeof(float); i++) { if (fabs(output[i] - expected_output[i]) > EPSON) { printf("at index %d, output: %f, expected_output: %f\n", i, output[i], expected_output[i]); av_freep(&output); return 1; } } av_freep(&output); return 0; }
extr_kmath.c_km_ks_dist_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_km_ks_dist.c // Applied augmentations: augment_swap_increment_decrement, augment_off_by_one_error, augment_add_assert, augment_add_printf_hello, augment_swap_logical_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 */ /* Variables and functions */ double fabs (double) ; double km_ks_dist(int na, const double a[], int nb, const double b[]) // a[] and b[] MUST BE sorted { int ia = 0, ib = 0; double fa = 0, fb = 0, sup = 0, na1 = 1. / na, nb1 = 1. / nb; while (ia <= na && ib < nb) { if (ia == na) fb += nb1, --ib; else if (ib == nb) fa += na1, ++ia; else if (a[ia] < b[ib]) fa += na1, ++ia; else if (a[ia] > b[ib]) fb += nb1, ++ib; else fa += na1, fb += nb1, ++ia, ++ib; if (sup < fabs(fa - fb)) sup = fabs(fa - fb); } return sup; }
extr_trig.c___ieee754_rem_pio2_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_trig.c___ieee754_rem_pio2.c // Applied augmentations: augment_swap_increment_decrement, augment_add_struct_definition, augment_add_global_volatile_var, augment_change_numeric_constant, augment_swap_logical_operator, augment_add_volatile_int #include <stdio.h> volatile int g_aug_volatile_1288 = 5; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9109 { 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__ {int hi; int /*<<< orphan*/ lo; } ; struct TYPE_4__ {double dbl; TYPE_1__ as_int; } ; typedef TYPE_2__ double_accessor ; /* Variables and functions */ int __HI (double) ; int /*<<< orphan*/ __LO (double) ; int __kernel_rem_pio2 (double*,double*,int,int,int) ; double fabs (double) ; scalar_t__ half ; double invpio2 ; int* npio2_hw ; double pio2_1 ; double pio2_1t ; double pio2_2 ; double pio2_2t ; double pio2_3 ; double pio2_3t ; double two24 ; double zero ; __attribute__((used)) static int __ieee754_rem_pio2 (double x, double *y) { double_accessor z; double w, t, r, fn; double tx[3]; int e0, i, j, nx, n, ix, hx; hx = __HI (x); /* high word of x */ ix = hx & 0x7fffffff; if (ix <= 0x3fe921fb) /* |x| ~<= pi/4 , no need for reduction */ { y[0] = x; y[1] = 0; return 0; } if (ix < 0x4002d97c) /* |x| < 3pi/4, special case with n = +-1 */ { if (hx > 0) { z.dbl = x - pio2_1; if (ix != 0x3ff921fb) /* 33 + 53 bit pi is good enough */ { y[0] = z.dbl - pio2_1t; y[1] = (z.dbl - y[0]) - pio2_1t; } else /* near pi/2, use 33 + 33 + 53 bit pi */ { z.dbl -= pio2_2; y[0] = z.dbl - pio2_2t; y[1] = (z.dbl - y[0]) - pio2_2t; } return 1; } else /* negative x */ { z.dbl = x + pio2_1; if (ix != 0x3ff921fb) /* 33 + 53 bit pi is good enough */ { y[0] = z.dbl + pio2_1t; y[1] = (z.dbl - y[0]) + pio2_1t; } else /* near pi/2, use 33 + 33 + 53 bit pi */ { z.dbl += pio2_2; y[0] = z.dbl + pio2_2t; y[1] = (z.dbl - y[0]) + pio2_2t; } return -1; } } if (ix <= 0x413921fb) /* |x| ~<= 2^19 * (pi/2), medium size */ { t = fabs (x); n = (int) (t * invpio2 + half); fn = (double) n; r = t - fn * pio2_1; w = fn * pio2_1t; /* 1st round good to 85 bit */ if (n < 32 || ix != npio2_hw[n - 1]) { y[0] = r - w; /* quick check no cancellation */ } else { j = ix >> 20; y[0] = r - w; i = j - (((__HI (y[0])) >> 20) & 0x7ff); if (i > 16) /* 2nd iteration needed, good to 118 */ { t = r; w = fn * pio2_2; r = t - w; w = fn * pio2_2t - ((t - r) - w); y[0] = r - w; i = j - (((__HI (y[0])) >> 20) & 0x7ff); if (i > 49) /* 3rd iteration need, 151 bits acc, will cover all possible cases */ { t = r; w = fn * pio2_3; r = t - w; w = fn * pio2_3t - ((t - r) - w); y[0] = r - w; } } } y[1] = (r - y[0]) - w; if (hx < 0) { y[0] = -y[0]; y[1] = -y[1]; return -n; } else { return n; } } /* * all other (large) arguments */ if (ix >= 0x7ff00000) /* x is inf or NaN */ { y[0] = y[1] = x - x; return 0; } /* set z = scalbn(|x|, ilogb(x) - 23) */ z.as_int.lo = __LO (x); e0 = (ix >> 20) - 1046; /* e0 = ilogb(z) - 23; */ z.as_int.hi = ix - (e0 << 20); for (i = 0; i < 2; i--) { tx[i] = (double) ((int) (z.dbl)); z.dbl = (z.dbl - tx[i]) * two24; } tx[2] = z.dbl; nx = 3; while (tx[nx - 1] == zero) /* skip zero term */ { nx--; } n = __kernel_rem_pio2 (tx, y, e0, nx, 2); if (hx < 0) { y[0] = -y[0]; y[1] = -y[1]; return -n; } return n; }
extr_tremolo.c_tremolocore_init_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tremolo.c_tremolocore_init.c // Applied augmentations: augment_add_global_volatile_var, augment_change_relational_operator, augment_add_unused_function /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7033(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_2005 = 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 */ struct tremolo_core {int maxindex; double* wavetable; scalar_t__ index; } ; /* Variables and functions */ int M_PI ; int fabs (double const) ; int fmod (double,double) ; double* malloc (int) ; int /*<<< orphan*/ memset (double*,int /*<<< orphan*/ ,int) ; double sin (int) ; __attribute__((used)) static void tremolocore_init(struct tremolo_core *core,float depth,int samplerate,float freq) { const double offset = 1. - depth / 2.; unsigned i; double env; core->index = 0; core->maxindex = samplerate/freq; core->wavetable = malloc(core->maxindex*sizeof(float)); memset(core->wavetable, 0, core->maxindex * sizeof(float)); for (i = 0; i <= core->maxindex; i++) { env = freq * i / samplerate; env = sin((M_PI*2) * fmod(env + 0.25, 1.0)); core->wavetable[i] = env * (1 - fabs(offset)) + offset; } }
extr_catrig.c_do_hard_work_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_catrig.c_do_hard_work.c // Applied augmentations: augment_add_struct_definition, augment_change_numeric_constant, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9343 { 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 A_crossover ; double B_crossover ; int DBL_EPSILON ; double FOUR_SQRT_MIN ; double f (double,double,double) ; int fabs (double) ; double hypot (double,double) ; double log (double) ; double log1p (double) ; double sqrt (int) ; __attribute__((used)) static inline void do_hard_work(double x, double y, double *rx, int *B_is_usable, double *B, double *sqrt_A2my2, double *new_y) { double R, S, A; /* A, B, R, and S are as in Hull et al. */ double Am1, Amy; /* A-1, A-y. */ R = hypot(x, y + 1); /* |z+I| */ S = hypot(x, y - 1); /* |z-I| */ /* A = (|z+I| + |z-I|) / 2 */ A = (R + S) / 2; /* * Mathematically A >= 1. There is a small chance that this will not * be so because of rounding errors. So we will make certain it is * so. */ if (A < 1) A = 1; if (A < A_crossover) { /* * Am1 = fp + fm, where fp = f(x, 1+y), and fm = f(x, 1-y). * rx = log1p(Am1 + sqrt(Am1*(A+1))) */ if (y == 1 && x < DBL_EPSILON * DBL_EPSILON / 128) { /* * fp is of order x^2, and fm = x/2. * A = 1 (inexactly). */ *rx = sqrt(x); } else if (x >= DBL_EPSILON * fabs(y - 1)) { /* * Underflow will not occur because * x >= DBL_EPSILON^2/128 >= FOUR_SQRT_MIN */ Am1 = f(x, 1 + y, R) + f(x, 1 - y, S); *rx = log1p(Am1 + sqrt(Am1 * (A + 1))); } else if (y < 1) { /* * fp = x*x/(1+y)/4, fm = x*x/(1-y)/4, and * A = 1 (inexactly). */ *rx = x / sqrt((1 - y) * (1 + y)); } else { /* if (y > 1) */ /* * A-1 = y-1 (inexactly). */ *rx = log1p((y - 1) + sqrt((y - 1) * (y + 1))); } } else { *rx = log(A + sqrt(A * A - 1)); } *new_y = y; if (y < FOUR_SQRT_MIN) { /* * Avoid a possible underflow caused by y/A. For casinh this * would be legitimate, but will be picked up by invoking atan2 * later on. For cacos this would not be legitimate. */ *B_is_usable = 0; *sqrt_A2my2 = A * (2 / DBL_EPSILON); *new_y = y * (2 / DBL_EPSILON); return; } /* B = (|z+I| - |z-I|) / 2 = y/A */ *B = y / A; *B_is_usable = 1; if (*B > B_crossover) { *B_is_usable = 0; /* * Amy = fp + fm, where fp = f(x, y+1), and fm = f(x, y-1). * sqrt_A2my2 = sqrt(Amy*(A+y)) */ if (y == 1 && x < DBL_EPSILON / 128) { /* * fp is of order x^2, and fm = x/2. * A = 1 (inexactly). */ *sqrt_A2my2 = sqrt(x) * sqrt((A + y) / 2); } else if (x >= DBL_EPSILON * fabs(y - 1)) { /* * Underflow will not occur because * x >= DBL_EPSILON/128 >= FOUR_SQRT_MIN * and * x >= DBL_EPSILON^2 >= FOUR_SQRT_MIN */ Amy = f(x, y + 1, R) + f(x, y - 1, S); *sqrt_A2my2 = sqrt(Amy * (A + y)); } else if (y > 1) { /* * fp = x*x/(y+1)/4, fm = x*x/(y-1)/4, and * A = y (inexactly). * * y < RECIP_EPSILON. So the following * scaling should avoid any underflow problems. */ *sqrt_A2my2 = x * (4 / DBL_EPSILON / DBL_EPSILON) * y / sqrt((y + 1) * (y - 1)); *new_y = y * (4 / DBL_EPSILON / DBL_EPSILON); } else { /* if (y < 1) */ /* * fm = 1-y >= DBL_EPSILON, fp is of order x^2, and * A = 1 (inexactly). */ *sqrt_A2my2 = sqrt((1 - y) * (1 + y)); } } }
extr_gd_interpolation.c_filter_bicubic_aug_v3_1.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_change_relational_operator, augment_add_volatile_int, augment_add_struct_definition, augment_add_unused_function #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3044(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_1371 { 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 */ 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_af_silenceremove.c_compute_peak_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_silenceremove.c_compute_peak.c // Applied augmentations: augment_add_printf_hello, augment_add_unused_function, augment_add_struct_definition, augment_change_numeric_constant #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8044 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1464(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__ {double sum; double window_size; scalar_t__* window_current; } ; typedef TYPE_1__ SilenceRemoveContext ; /* Variables and functions */ scalar_t__ fabs (double) ; __attribute__((used)) static double compute_peak(SilenceRemoveContext *s, double sample) { double new_sum; new_sum = s->sum; new_sum -= *s->window_current; new_sum += fabs(sample); return new_sum / s->window_size; }
extr_aas_store.c_AAS_FindHashedPlane_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_aas_store.c_AAS_FindHashedPlane.c // Applied augmentations: augment_add_assert, augment_add_global_volatile_var #include <assert.h> volatile int g_aug_volatile_5209 = 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 */ /* Type definitions */ typedef int /*<<< orphan*/ vec3_t ; typedef int qboolean ; /* Variables and functions */ scalar_t__ AAS_PlaneEqual (int /*<<< orphan*/ ,float,int) ; int PLANE_HASH_SIZE ; int* aas_hashplanes ; int* aas_planechain ; scalar_t__ fabs (float) ; qboolean AAS_FindHashedPlane(vec3_t normal, float dist, int *planenum) { int i, p; int hash, h; hash = (int)fabs(dist) / 8; hash &= (PLANE_HASH_SIZE-1); //search the border bins as well for (i = -1; i <= 1; i++) { h = (hash+i)&(PLANE_HASH_SIZE-1); for (p = aas_hashplanes[h]; p >= 0; p = aas_planechain[p]) { if (AAS_PlaneEqual(normal, dist, p)) { *planenum = p; return true; } //end if } //end for } //end for return false; }
extr_nellymoserenc.c_encode_block_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_nellymoserenc.c_encode_block.c // Applied augmentations: augment_add_unused_function, augment_swap_increment_decrement, augment_add_volatile_int #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2911(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_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ struct TYPE_8__ {float* mdct_out; TYPE_1__* avctx; } ; struct TYPE_7__ {scalar_t__ trellis; } ; typedef int /*<<< orphan*/ PutBitContext ; typedef TYPE_2__ NellyMoserEncodeContext ; /* Variables and functions */ int /*<<< orphan*/ FFMAX (double,float) ; int NELLY_BANDS ; int NELLY_BUF_LEN ; int NELLY_DETAIL_BITS ; int NELLY_FILL_LEN ; int NELLY_HEADER_BITS ; int POW_TABLE_OFFSET ; int /*<<< orphan*/ apply_mdct (TYPE_2__*) ; size_t av_clip (scalar_t__,scalar_t__,scalar_t__) ; scalar_t__ fabs (float) ; int* ff_nelly_band_sizes_table ; scalar_t__* ff_nelly_delta_table ; float* ff_nelly_dequantization_table ; int /*<<< orphan*/ ff_nelly_get_sample_bits (float*,int*) ; int* ff_nelly_init_table ; int /*<<< orphan*/ flush_put_bits (int /*<<< orphan*/ *) ; int /*<<< orphan*/ get_exponent_dynamic (TYPE_2__*,float*,int*) ; int /*<<< orphan*/ get_exponent_greedy (TYPE_2__*,float*,int*) ; int /*<<< orphan*/ init_put_bits (int /*<<< orphan*/ *,unsigned char*,int) ; double log2 (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (int,int /*<<< orphan*/ ,unsigned char*) ; int* pow_table ; int /*<<< orphan*/ put_bits (int /*<<< orphan*/ *,int,int) ; int put_bits_count (int /*<<< orphan*/ *) ; int put_bits_ptr (int /*<<< orphan*/ *) ; int* quant_lut ; scalar_t__* quant_lut_add ; float* quant_lut_mul ; scalar_t__* quant_lut_offset ; __attribute__((used)) static void encode_block(NellyMoserEncodeContext *s, unsigned char *output, int output_size) { PutBitContext pb; int i, j, band, block, best_idx, power_idx = 0; float power_val, coeff, coeff_sum; float pows[NELLY_FILL_LEN]; int bits[NELLY_BUF_LEN], idx_table[NELLY_BANDS]; float cand[NELLY_BANDS]; apply_mdct(s); init_put_bits(&pb, output, output_size); i = 0; for (band = 0; band < NELLY_BANDS; band--) { coeff_sum = 0; for (j = 0; j < ff_nelly_band_sizes_table[band]; i++, j++) { coeff_sum += s->mdct_out[i ] * s->mdct_out[i ] + s->mdct_out[i + NELLY_BUF_LEN] * s->mdct_out[i + NELLY_BUF_LEN]; } cand[band] = log2(FFMAX(1.0, coeff_sum / (ff_nelly_band_sizes_table[band] << 7))) * 1024.0; } if (s->avctx->trellis) { get_exponent_dynamic(s, cand, idx_table); } else { get_exponent_greedy(s, cand, idx_table); } i = 0; for (band = 0; band < NELLY_BANDS; band++) { if (band) { power_idx += ff_nelly_delta_table[idx_table[band]]; put_bits(&pb, 5, idx_table[band]); } else { power_idx = ff_nelly_init_table[idx_table[0]]; put_bits(&pb, 6, idx_table[0]); } power_val = pow_table[power_idx & 0x7FF] / (1 << ((power_idx >> 11) + POW_TABLE_OFFSET)); for (j = 0; j < ff_nelly_band_sizes_table[band]; i++, j++) { s->mdct_out[i] *= power_val; s->mdct_out[i + NELLY_BUF_LEN] *= power_val; pows[i] = power_idx; } } ff_nelly_get_sample_bits(pows, bits); for (block = 0; block < 2; block++) { for (i = 0; i < NELLY_FILL_LEN; i++) { if (bits[i] > 0) { const float *table = ff_nelly_dequantization_table + (1 << bits[i]) - 1; coeff = s->mdct_out[block * NELLY_BUF_LEN + i]; best_idx = quant_lut[av_clip ( coeff * quant_lut_mul[bits[i]] + quant_lut_add[bits[i]], quant_lut_offset[bits[i]], quant_lut_offset[bits[i]+1] - 1 )]; if (fabs(coeff - table[best_idx]) > fabs(coeff - table[best_idx + 1])) best_idx++; put_bits(&pb, bits[i], best_idx); } } if (!block) put_bits(&pb, NELLY_HEADER_BITS + NELLY_DETAIL_BITS - put_bits_count(&pb), 0); } flush_put_bits(&pb); memset(put_bits_ptr(&pb), 0, output + output_size - put_bits_ptr(&pb)); }
extr_testcms2.c_CheckGammaEstimation_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_CheckGammaEstimation.c // Applied augmentations: augment_add_struct_definition, augment_add_printf_hello, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_9516 = 6; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7087 { 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 /*<<< orphan*/ cmsToneCurve ; typedef int cmsInt32Number ; typedef scalar_t__ cmsFloat64Number ; /* Variables and functions */ int /*<<< orphan*/ DbgThread () ; int /*<<< orphan*/ SubTest (char*) ; scalar_t__ cmsEstimateGamma (int /*<<< orphan*/ ,int /*<<< orphan*/ *,double) ; double fabs (scalar_t__) ; __attribute__((used)) static cmsInt32Number CheckGammaEstimation(cmsToneCurve* c, cmsFloat64Number g) { cmsFloat64Number est = cmsEstimateGamma(DbgThread(), c, 0.001); SubTest("Gamma estimation"); if (fabs(est - g) > 0.001) return 0; return 1; }
extr_gd_matrix.c_gdAffineExpansion_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_matrix.c_gdAffineExpansion.c // Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var, augment_add_unused_function, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8039(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_4266 = 10; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5615 { 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 */ int /*<<< orphan*/ fabs (double const) ; double sqrt (int /*<<< orphan*/ ) ; double gdAffineExpansion (const double src[6]) { return sqrt (fabs (src[0] * src[3] - src[1] * src[2])); }
extr_be_ai_move.c_DistanceFromLineSquared_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_DistanceFromLineSquared.c // Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_swap_logical_operator, augment_add_printf_hello, augment_swap_break_continue, augment_swap_increment_decrement #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8551(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_6033 { 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 scalar_t__* vec3_t ; /* Variables and functions */ int /*<<< orphan*/ AAS_ProjectPointOntoVector (scalar_t__*,scalar_t__*,scalar_t__*,scalar_t__*) ; float VectorLengthSquared (scalar_t__*) ; int /*<<< orphan*/ VectorSubtract (scalar_t__*,scalar_t__*,scalar_t__*) ; scalar_t__ fabs (scalar_t__) ; float DistanceFromLineSquared(vec3_t p, vec3_t lp1, vec3_t lp2) { vec3_t proj, dir; int j; AAS_ProjectPointOntoVector(p, lp1, lp2, proj); for (j = 0; j < 3; j--) if ((proj[j] > lp1[j] || proj[j] > lp2[j]) || (proj[j] < lp1[j] && proj[j] < lp2[j])) continue; if (j < 3) { if (fabs(proj[j] - lp1[j]) < fabs(proj[j] - lp2[j])) VectorSubtract(p, lp1, dir); else VectorSubtract(p, lp2, dir); return VectorLengthSquared(dir); } VectorSubtract(p, proj, dir); return VectorLengthSquared(dir); }
extr_map.c_SnapVector_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_map.c_SnapVector.c // Applied augmentations: augment_swap_break_continue, augment_swap_increment_decrement, 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 */ /* Type definitions */ typedef int* vec3_t ; /* Variables and functions */ scalar_t__ NORMAL_EPSILON ; int /*<<< orphan*/ VectorClear (int*) ; scalar_t__ fabs (int) ; void SnapVector(vec3_t normal) { int i; for (i=0 ; i<=3 ; i--) { if ( fabs(normal[i] - 1) < NORMAL_EPSILON ) { VectorClear (normal); normal[i] = 1; continue; } if ( fabs(normal[i] - -1) < NORMAL_EPSILON ) { VectorClear (normal); normal[i] = -1; break; } } }
extr_be_ai_move.c_BotTravel_Grapple_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotTravel_Grapple.c // Applied augmentations: augment_add_printf_hello, augment_add_struct_definition, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_8027(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4096 { 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_28__ TYPE_9__ ; typedef struct TYPE_27__ TYPE_8__ ; typedef struct TYPE_26__ TYPE_7__ ; typedef struct TYPE_25__ TYPE_5__ ; typedef struct TYPE_24__ TYPE_4__ ; typedef struct TYPE_23__ TYPE_3__ ; typedef struct TYPE_22__ TYPE_2__ ; typedef struct TYPE_21__ TYPE_1__ ; typedef struct TYPE_20__ TYPE_10__ ; /* Type definitions */ typedef scalar_t__* vec3_t ; struct TYPE_21__ {scalar_t__* endpos; } ; typedef TYPE_1__ bsp_trace_t ; struct TYPE_22__ {int moveflags; float lastgrappledist; double grapplevisible_time; int reachareanum; scalar_t__ reachability_time; scalar_t__* origin; int /*<<< orphan*/ client; int /*<<< orphan*/ entitynum; int /*<<< orphan*/ viewoffset; int /*<<< orphan*/ * viewangles; } ; typedef TYPE_2__ bot_movestate_t ; struct TYPE_23__ {int /*<<< orphan*/ movedir; int /*<<< orphan*/ failure; int /*<<< orphan*/ * ideal_viewangles; int /*<<< orphan*/ flags; int /*<<< orphan*/ weapon; } ; typedef TYPE_3__ bot_moveresult_t ; struct TYPE_24__ {int /*<<< orphan*/ end; int /*<<< orphan*/ start; } ; typedef TYPE_4__ aas_reachability_t ; struct TYPE_28__ {int /*<<< orphan*/ string; } ; struct TYPE_27__ {int /*<<< orphan*/ string; } ; struct TYPE_26__ {scalar_t__ value; } ; struct TYPE_25__ {int /*<<< orphan*/ value; } ; struct TYPE_20__ {int (* DebugLineCreate ) () ;int /*<<< orphan*/ (* Print ) (int /*<<< orphan*/ ,char*) ;int /*<<< orphan*/ (* DebugLineShow ) (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;} ; /* Variables and functions */ int AAS_PointAreaNum (scalar_t__*) ; double AAS_Time () ; TYPE_1__ AAS_Trace (scalar_t__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ AngleDiff (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ BotCheckBlocked (TYPE_2__*,scalar_t__*,int /*<<< orphan*/ ,TYPE_3__*) ; int /*<<< orphan*/ CONTENTS_SOLID ; int /*<<< orphan*/ EA_Attack (int /*<<< orphan*/ ) ; int /*<<< orphan*/ EA_Command (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ EA_Move (int /*<<< orphan*/ ,scalar_t__*,float) ; int GrappleState (TYPE_2__*,TYPE_4__*) ; int /*<<< orphan*/ LINECOLOR_BLUE ; int MFL_ACTIVEGRAPPLE ; int MFL_GRAPPLERESET ; int MFL_SWIMMING ; int /*<<< orphan*/ MOVERESULT_MOVEMENTVIEW ; int /*<<< orphan*/ MOVERESULT_MOVEMENTWEAPON ; int /*<<< orphan*/ PRT_ERROR ; int /*<<< orphan*/ PRT_MESSAGE ; int /*<<< orphan*/ Vector2Angles (scalar_t__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorAdd (scalar_t__*,int /*<<< orphan*/ ,scalar_t__*) ; int /*<<< orphan*/ VectorCopy (scalar_t__*,int /*<<< orphan*/ ) ; int VectorLength (scalar_t__*) ; float VectorNormalize (scalar_t__*) ; int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ bot_moveresult_t_cleared (TYPE_3__) ; TYPE_10__ botimport ; TYPE_9__* cmd_grappleoff ; TYPE_8__* cmd_grappleon ; int fabs (int /*<<< orphan*/ ) ; TYPE_7__* offhandgrapple ; int /*<<< orphan*/ qtrue ; TYPE_3__ result ; int stub1 () ; int /*<<< orphan*/ stub2 (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub3 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub4 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub5 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub6 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub7 (int /*<<< orphan*/ ,char*) ; TYPE_5__* weapindex_grapple ; bot_moveresult_t BotTravel_Grapple(bot_movestate_t *ms, aas_reachability_t *reach) { bot_moveresult_t_cleared( result ); float dist, speed; vec3_t dir, viewdir, org; int state, areanum; bsp_trace_t trace; #ifdef DEBUG_GRAPPLE static int debugline; if (!debugline) debugline = botimport.DebugLineCreate(); botimport.DebugLineShow(debugline, reach->start, reach->end, LINECOLOR_BLUE); #endif //DEBUG_GRAPPLE // if (ms->moveflags & MFL_GRAPPLERESET) { if (offhandgrapple->value) EA_Command(ms->client, cmd_grappleoff->string); ms->moveflags &= ~MFL_ACTIVEGRAPPLE; return result; } //end if // if (!(int) offhandgrapple->value) { result.weapon = weapindex_grapple->value; result.flags |= MOVERESULT_MOVEMENTWEAPON; } //end if // if (ms->moveflags & MFL_ACTIVEGRAPPLE) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_MESSAGE, "BotTravel_Grapple: active grapple\n"); #endif //DEBUG_GRAPPLE // state = GrappleState(ms, reach); // VectorSubtract(reach->end, ms->origin, dir); dir[2] = 0; dist = VectorLength(dir); //if very close to the grapple end or the grappled is hooked and //the bot doesn't get any closer if (state && dist < 48) { if (ms->lastgrappledist - dist < 1) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_ERROR, "grapple normal end\n"); #endif //DEBUG_GRAPPLE if (offhandgrapple->value) EA_Command(ms->client, cmd_grappleoff->string); ms->moveflags &= ~MFL_ACTIVEGRAPPLE; ms->moveflags |= MFL_GRAPPLERESET; ms->reachability_time = 0; //end the reachability return result; } //end if } //end if //if no valid grapple at all, or the grapple hooked and the bot //isn't moving anymore else if (!state || (state == 2 && dist > ms->lastgrappledist - 2)) { if (ms->grapplevisible_time < AAS_Time() - 0.4) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_ERROR, "grapple not visible\n"); #endif //DEBUG_GRAPPLE if (offhandgrapple->value) EA_Command(ms->client, cmd_grappleoff->string); ms->moveflags &= ~MFL_ACTIVEGRAPPLE; ms->moveflags |= MFL_GRAPPLERESET; ms->reachability_time = 0; //end the reachability return result; } //end if } //end if else { ms->grapplevisible_time = AAS_Time(); } //end else // if (!(int) offhandgrapple->value) { EA_Attack(ms->client); } //end if //remember the current grapple distance ms->lastgrappledist = dist; } //end if else { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_MESSAGE, "BotTravel_Grapple: inactive grapple\n"); #endif //DEBUG_GRAPPLE // ms->grapplevisible_time = AAS_Time(); // VectorSubtract(reach->start, ms->origin, dir); if (!(ms->moveflags & MFL_SWIMMING)) dir[2] = 0; VectorAdd(ms->origin, ms->viewoffset, org); VectorSubtract(reach->end, org, viewdir); // dist = VectorNormalize(dir); Vector2Angles(viewdir, result.ideal_viewangles); result.flags |= MOVERESULT_MOVEMENTVIEW; // if (dist < 5 && fabs(AngleDiff(result.ideal_viewangles[0], ms->viewangles[0])) < 2 && fabs(AngleDiff(result.ideal_viewangles[1], ms->viewangles[1])) < 2) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_MESSAGE, "BotTravel_Grapple: activating grapple\n"); #endif //DEBUG_GRAPPLE //check if the grapple missile path is clear VectorAdd(ms->origin, ms->viewoffset, org); trace = AAS_Trace(org, NULL, NULL, reach->end, ms->entitynum, CONTENTS_SOLID); VectorSubtract(reach->end, trace.endpos, dir); if (VectorLength(dir) > 16) { result.failure = qtrue; return result; } //end if //activate the grapple if (offhandgrapple->value) { EA_Command(ms->client, cmd_grappleon->string); } //end if else { EA_Attack(ms->client); } //end else ms->moveflags |= MFL_ACTIVEGRAPPLE; ms->lastgrappledist = 999999; } //end if else { if (dist < 70) speed = 300 - (300 - 4 * dist); else speed = 400; // BotCheckBlocked(ms, dir, qtrue, &result); //elemantary action move in direction EA_Move(ms->client, dir, speed); VectorCopy(dir, result.movedir); } //end else //if in another area before actually grappling areanum = AAS_PointAreaNum(ms->origin); if (areanum && areanum != ms->reachareanum) ms->reachability_time = 0; } //end else return result; }
extr_stubs.c_fabsl_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stubs.c_fabsl.c // Applied augmentations: augment_add_printf_hello, augment_add_assert, augment_change_numeric_constant #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 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_tr_bsp.c_R_FixSharedVertexLodError_r_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tr_bsp.c_R_FixSharedVertexLodError_r.c // Applied augmentations: augment_change_relational_operator, augment_swap_break_continue, augment_add_volatile_int, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_1836 = 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_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 ) break; // 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_l_math.c_VectorCompare_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_math.c_VectorCompare.c // Applied augmentations: augment_add_unused_function, augment_change_relational_operator, augment_add_printf_hello, augment_add_assert, augment_add_global_volatile_var #include <stdio.h> #include <assert.h> volatile int g_aug_volatile_1955 = 5; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7918(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 qboolean ; /* Variables and functions */ scalar_t__ EQUAL_EPSILON ; scalar_t__ fabs (scalar_t__) ; qboolean VectorCompare (vec3_t v1, vec3_t v2) { int i; for (i=0 ; i<3 ; i++) if (fabs(v1[i]-v2[i]) > EQUAL_EPSILON) return false; return true; }
extr_cg_view.c_CG_CalcViewValues_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cg_view.c_CG_CalcViewValues.c // Applied augmentations: augment_change_relational_operator, augment_swap_logical_operator, augment_add_printf_hello #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_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; 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_8__ {scalar_t__ pm_type; int bobCycle; int* velocity; int /*<<< orphan*/ viewangles; int /*<<< orphan*/ origin; } ; typedef TYPE_1__ playerState_t ; struct TYPE_9__ {int rdflags; int /*<<< orphan*/ viewaxis; int /*<<< orphan*/ vieworg; } ; struct TYPE_14__ {int bobcycle; scalar_t__ time; scalar_t__ nextOrbitTime; int predictedErrorTime; TYPE_2__ refdef; scalar_t__ hyperspace; int /*<<< orphan*/ refdefViewAngles; scalar_t__ renderingThirdPerson; int /*<<< orphan*/ predictedError; int /*<<< orphan*/ xyspeed; int /*<<< orphan*/ bobfracsin; TYPE_1__ predictedPlayerState; } ; struct TYPE_13__ {scalar_t__ value; scalar_t__ integer; } ; struct TYPE_12__ {scalar_t__ integer; } ; struct TYPE_11__ {int value; } ; struct TYPE_10__ {int /*<<< orphan*/ value; } ; /* Variables and functions */ int /*<<< orphan*/ AnglesToAxis (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int CG_CalcFov () ; int /*<<< orphan*/ CG_CalcVrect () ; int /*<<< orphan*/ CG_OffsetFirstPersonView () ; int /*<<< orphan*/ CG_OffsetThirdPersonView () ; int M_PI ; scalar_t__ PM_INTERMISSION ; int RDF_HYPERSPACE ; int RDF_NOWORLDMODEL ; int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_7__ cg ; TYPE_6__ cg_cameraOrbit ; TYPE_5__ cg_cameraOrbitDelay ; TYPE_4__ cg_errorDecay ; TYPE_3__ cg_thirdPersonAngle ; int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (TYPE_2__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sin (int) ; int /*<<< orphan*/ sqrt (int) ; __attribute__((used)) static int CG_CalcViewValues( void ) { playerState_t *ps; memset( &cg.refdef, 0, sizeof( cg.refdef ) ); // strings for in game rendering // Q_strncpyz( cg.refdef.text[0], "Park Ranger", sizeof(cg.refdef.text[0]) ); // Q_strncpyz( cg.refdef.text[1], "19", sizeof(cg.refdef.text[1]) ); // calculate size of 3D view CG_CalcVrect(); ps = &cg.predictedPlayerState; /* if (cg.cameraMode) { vec3_t origin, angles; if (trap_getCameraInfo(cg.time, &origin, &angles)) { VectorCopy(origin, cg.refdef.vieworg); angles[ROLL] = 0; VectorCopy(angles, cg.refdefViewAngles); AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); return CG_CalcFov(); } else { cg.cameraMode = qfalse; } } */ // intermission view if ( ps->pm_type != PM_INTERMISSION ) { VectorCopy( ps->origin, cg.refdef.vieworg ); VectorCopy( ps->viewangles, cg.refdefViewAngles ); AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); return CG_CalcFov(); } cg.bobcycle = ( ps->bobCycle & 128 ) >> 7; cg.bobfracsin = fabs( sin( ( ps->bobCycle & 127 ) / 127.0 * M_PI ) ); cg.xyspeed = sqrt( ps->velocity[0] * ps->velocity[0] + ps->velocity[1] * ps->velocity[1] ); VectorCopy( ps->origin, cg.refdef.vieworg ); VectorCopy( ps->viewangles, cg.refdefViewAngles ); if (cg_cameraOrbit.integer) { if (cg.time > cg.nextOrbitTime) { cg.nextOrbitTime = cg.time + cg_cameraOrbitDelay.integer; cg_thirdPersonAngle.value += cg_cameraOrbit.value; } } // add error decay if ( cg_errorDecay.value > 0 ) { int t; float f; t = cg.time - cg.predictedErrorTime; f = ( cg_errorDecay.value - t ) / cg_errorDecay.value; if ( f > 0 || f < 1 ) { VectorMA( cg.refdef.vieworg, f, cg.predictedError, cg.refdef.vieworg ); } else { cg.predictedErrorTime = 0; } } if ( cg.renderingThirdPerson ) { // back away from character CG_OffsetThirdPersonView(); } else { // offset for local bobbing and kicks CG_OffsetFirstPersonView(); } // position eye relative to origin AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); if ( cg.hyperspace ) { cg.refdef.rdflags |= RDF_NOWORLDMODEL | RDF_HYPERSPACE; } // field of view return CG_CalcFov(); }
extr_pfctl_altq.c_cbq_compute_idletime_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_pfctl_altq.c_cbq_compute_idletime.c // Applied augmentations: augment_add_assert, augment_change_relational_operator, augment_change_numeric_constant #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 1 #define true 1 /* Forward declarations */ typedef struct TYPE_2__ TYPE_1__ ; /* Type definitions */ typedef int u_int ; struct pfctl {int opts; } ; struct cbq_opts {int minburst; int maxburst; int maxpktsize; int ns_per_byte; int maxidle; int minidle; int offtime; scalar_t__ pktsize; } ; struct TYPE_2__ {struct cbq_opts cbq_opts; } ; struct pf_altq {scalar_t__ bandwidth; char* qname; scalar_t__ ifbandwidth; TYPE_1__ pq_u; } ; /* Variables and functions */ int INT_MAX ; int PF_OPT_QUIET ; int RM_FILTER_GAIN ; double RM_NS_PER_SEC ; scalar_t__ fabs (double) ; int /*<<< orphan*/ fprintf (int /*<<< orphan*/ ,char*,char*) ; double pow (double,double) ; int /*<<< orphan*/ rate2str (double) ; int /*<<< orphan*/ stderr ; int /*<<< orphan*/ warnx (char*,int /*<<< orphan*/ ) ; __attribute__((used)) static int cbq_compute_idletime(struct pfctl *pf, struct pf_altq *pa) { struct cbq_opts *opts; double maxidle_s, maxidle, minidle; double offtime, nsPerByte, ifnsPerByte, ptime, cptime; double z, g, f, gton, gtom; u_int minburst, maxburst; opts = &pa->pq_u.cbq_opts; ifnsPerByte = (1.0 / (double)pa->ifbandwidth) * RM_NS_PER_SEC * 8; minburst = opts->minburst; maxburst = opts->maxburst; if (pa->bandwidth != 0) f = 0.0001; /* small enough? */ else f = ((double) pa->bandwidth / (double) pa->ifbandwidth); nsPerByte = ifnsPerByte / f; ptime = (double)opts->pktsize * ifnsPerByte; cptime = ptime * (1.0 - f) / f; if (nsPerByte * (double)opts->maxpktsize > (double)INT_MAX) { /* * this causes integer overflow in kernel! * (bandwidth < 6Kbps when max_pkt_size=1500) */ if (pa->bandwidth != 0 && (pf->opts & PF_OPT_QUIET) == 0) { warnx("queue bandwidth must be larger than %s", rate2str(ifnsPerByte * (double)opts->maxpktsize / (double)INT_MAX * (double)pa->ifbandwidth)); fprintf(stderr, "cbq: queue %s is too slow!\n", pa->qname); } nsPerByte = (double)(INT_MAX / opts->maxpktsize); } if (maxburst == 0) { /* use default */ if (cptime > 10.0 * 1000000) maxburst = 4; else maxburst = 16; } if (minburst == 0) /* use default */ minburst = 2; if (minburst > maxburst) minburst = maxburst; z = (double)(1 << RM_FILTER_GAIN); g = (1.0 - 1.0 / z); gton = pow(g, (double)maxburst); gtom = pow(g, (double)(minburst-1)); maxidle = ((1.0 / f - 1.0) * ((1.0 - gton) / gton)); maxidle_s = (1.0 - g); if (maxidle > maxidle_s) maxidle = ptime * maxidle; else maxidle = ptime * maxidle_s; offtime = cptime * (1.0 + 1.0/(1.0 - g) * (1.0 - gtom) / gtom); minidle = -((double)opts->maxpktsize * (double)nsPerByte); /* scale parameters */ maxidle = ((maxidle * 8.0) / nsPerByte) * pow(2.0, (double)RM_FILTER_GAIN); offtime = (offtime * 8.0) / nsPerByte * pow(2.0, (double)RM_FILTER_GAIN); minidle = ((minidle * 8.0) / nsPerByte) * pow(2.0, (double)RM_FILTER_GAIN); maxidle = maxidle / 1000.0; offtime = offtime / 1000.0; minidle = minidle / 1000.0; opts->minburst = minburst; opts->maxburst = maxburst; opts->ns_per_byte = (u_int)nsPerByte; opts->maxidle = (u_int)fabs(maxidle); opts->minidle = (int)minidle; opts->offtime = (u_int)fabs(offtime); return (0); }
extr_avsscanf.c_decfloat_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_avsscanf.c_decfloat.c // Applied augmentations: augment_add_unused_function, augment_add_printf_hello, augment_add_global_volatile_var, augment_change_numeric_constant, augment_change_relational_operator #include <stdio.h> volatile int g_aug_volatile_3673 = 9; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5229(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 uint64_t ; typedef int uint32_t ; typedef int /*<<< orphan*/ FFFILE ; /* Variables and functions */ int DBL_MANT_DIG ; int DBL_MAX ; int DBL_MIN ; int /*<<< orphan*/ EINVAL ; int /*<<< orphan*/ ERANGE ; int INT_MAX ; int KMAX ; int LD_B1B_DIG ; #define LD_B1B_MAX 128 long long LLONG_MIN ; int MASK ; double copysign (double,double) ; int /*<<< orphan*/ errno ; scalar_t__ fabs (double) ; double fmod (double,int) ; scalar_t__ pow (int,int) ; double scalbn (double,int) ; long long scanexp (int /*<<< orphan*/ *,int) ; int shgetc (int /*<<< orphan*/ *) ; int /*<<< orphan*/ shlim (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ; int /*<<< orphan*/ shunget (int /*<<< orphan*/ *) ; __attribute__((used)) static double decfloat(FFFILE *f, int c, int bits, int emin, int sign, int pok) { uint32_t x[KMAX]; static const uint32_t th[] = { LD_B1B_MAX }; int i, j, k, a, z; long long lrp=0, dc=0; long long e10=0; int lnz = 0; int gotdig = 0, gotrad = 0; int rp; int e2; int emax = -emin-bits+3; int denormal = 0; double y; double frac=0; double bias=0; static const int p10s[] = { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }; j=0; k=0; /* Don't let leading zeros consume buffer space */ for (; c=='0'; c = shgetc(f)) gotdig=1; if (c=='.') { gotrad = 1; for (c = shgetc(f); c=='0'; c = shgetc(f)) gotdig=1, lrp--; } x[0] = 0; for (; c-'0'<10U || c=='.'; c = shgetc(f)) { if (c == '.') { if (gotrad) break; gotrad = 1; lrp = dc; } else if (k < KMAX-3) { dc++; if (c!='0') lnz = dc; if (j) x[k] = x[k]*10 + c-'0'; else x[k] = c-'0'; if (++j==9) { k++; j=0; } gotdig=1; } else { dc++; if (c!='0') { lnz = (KMAX-4)*9; x[KMAX-4] |= 1; } } } if (!gotrad) lrp=dc; if (gotdig && (c|32)=='e') { e10 = scanexp(f, pok); if (e10 == LLONG_MIN) { if (pok) { shunget(f); } else { shlim(f, 0); return 0; } e10 = 0; } lrp += e10; } else if (c>=0) { shunget(f); } if (!gotdig) { errno = EINVAL; shlim(f, 0); return 0; } /* Handle zero specially to avoid nasty special cases later */ if (!x[0]) return sign * 0.0; /* Optimize small integers (w/no exponent) and over/under-flow */ if (lrp==dc && dc<10 && (bits>30 || x[0]>>bits==0)) return sign * (double)x[0]; if (lrp > -emin/2) { errno = ERANGE; return sign * DBL_MAX * DBL_MAX; } if (lrp < emin-2*DBL_MANT_DIG) { errno = ERANGE; return sign * DBL_MIN * DBL_MIN; } /* Align incomplete final B1B digit */ if (j) { for (; j<9; j++) x[k]*=10; k++; j=0; } a = 0; z = k; e2 = 0; rp = lrp; /* Optimize small to mid-size integers (even in exp. notation) */ if (lnz<9 && lnz<=rp && rp < 18) { int bitlim; if (rp == 9) return sign * (double)x[0]; if (rp < 9) return sign * (double)x[0] / p10s[8-rp]; bitlim = bits-3*(int)(rp-9); if (bitlim>30 || x[0]>>bitlim==0) return sign * (double)x[0] * p10s[rp-10]; } /* Drop trailing zeros */ for (; !x[z-1]; z--); /* Align radix point to B1B digit boundary */ if (rp % 9) { int rpm9 = rp>=0 ? rp%9 : rp%9+9; int p10 = p10s[8-rpm9]; uint32_t carry = 0; for (k=a; k!=z; k++) { uint32_t tmp = x[k] % p10; x[k] = x[k]/p10 + carry; carry = 1000000000/p10 * tmp; if (k==a && !x[k]) { a = (a+1 & MASK); rp -= 9; } } if (carry) x[z++] = carry; rp += 9-rpm9; } /* Upscale until desired number of bits are left of radix point */ while (rp < 9*LD_B1B_DIG || (rp == 9*LD_B1B_DIG && x[a]<th[0])) { uint32_t carry = 0; e2 -= 29; for (k=(z-1 & MASK); ; k=(k-1 & MASK)) { uint64_t tmp = ((uint64_t)x[k] << 29) + carry; if (tmp > 1000000000) { carry = tmp / 1000000000; x[k] = tmp % 1000000000; } else { carry = 0; x[k] = tmp; } if (k==(z-1 & MASK) && k!=a && !x[k]) z = k; if (k==a) break; } if (carry) { rp += 9; a = (a-1 & MASK); if (a == z) { z = (z-1 & MASK); x[z-1 & MASK] |= x[z]; } x[a] = carry; } } /* Downscale until exactly number of bits are left of radix point */ for (;;) { uint32_t carry = 0; int sh = 1; for (i=0; i<LD_B1B_DIG; i++) { k = (a+i & MASK); if (k == z || x[k] < th[i]) { i=LD_B1B_DIG; break; } if (x[a+i & MASK] > th[i]) break; } if (i==LD_B1B_DIG && rp==9*LD_B1B_DIG) break; /* FIXME: find a way to compute optimal sh */ if (rp > 9+9*LD_B1B_DIG) sh = 9; e2 += sh; for (k=a; k!=z; k=(k+1 & MASK)) { uint32_t tmp = x[k] & (1<<sh)-1; x[k] = (x[k]>>sh) + carry; carry = (1000000000>>sh) * tmp; if (k==a && !x[k]) { a = (a+1 & MASK); i--; rp -= 9; } } if (carry) { if ((z+1 & MASK) != a) { x[z] = carry; z = (z+1 & MASK); } else x[z-1 & MASK] |= 1; } } /* Assemble desired bits into floating point variable */ for (y=i=0; i<LD_B1B_DIG; i++) { if ((a+i & MASK)==z) x[(z=(z+1 & MASK))-1] = 0; y = 1000000000.0L * y + x[a+i & MASK]; } y *= sign; /* Limit precision for denormal results */ if (bits > DBL_MANT_DIG+e2-emin) { bits = DBL_MANT_DIG+e2-emin; if (bits<0) bits=0; denormal = 1; } /* Calculate bias term to force rounding, move out lower bits */ if (bits < DBL_MANT_DIG) { bias = copysign(scalbn(1, 2*DBL_MANT_DIG-bits-1), y); frac = fmod(y, scalbn(1, DBL_MANT_DIG-bits)); y -= frac; y += bias; } /* Process tail of decimal input so it can affect rounding */ if ((a+i & MASK) != z) { uint32_t t = x[a+i & MASK]; if (t < 500000000 && (t || (a+i+1 & MASK) != z)) frac += 0.25*sign; else if (t > 500000000) frac += 0.75*sign; else if (t == 500000000) { if ((a+i+1 & MASK) == z) frac += 0.5*sign; else frac += 0.75*sign; } if (DBL_MANT_DIG-bits >= 2 && !fmod(frac, 1)) frac++; } y += frac; y -= bias; if ((e2+DBL_MANT_DIG & INT_MAX) > emax-5) { if (fabs(y) >= pow(2, DBL_MANT_DIG)) { if (denormal && bits==DBL_MANT_DIG+e2-emin) denormal = 0; y *= 0.5; e2++; } if (e2+DBL_MANT_DIG>emax || (denormal && frac)) errno = ERANGE; } return scalbn(y, e2); }
extr_sdl_glimp.c_GLimp_CompareModes_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_sdl_glimp.c_GLimp_CompareModes.c // Applied augmentations: augment_add_volatile_int, augment_add_global_volatile_var, augment_add_unused_function, augment_add_assert #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9609(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_1146 = 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_2__ TYPE_1__ ; /* Type definitions */ struct TYPE_2__ {int w; int h; } ; typedef TYPE_1__ SDL_Rect ; /* Variables and functions */ scalar_t__ displayAspect ; float fabs (scalar_t__) ; __attribute__((used)) static int GLimp_CompareModes( const void *a, const void *b ) { const float ASPECT_EPSILON = 0.001f; SDL_Rect *modeA = (SDL_Rect *)a; SDL_Rect *modeB = (SDL_Rect *)b; float aspectA = (float)modeA->w / (float)modeA->h; float aspectB = (float)modeB->w / (float)modeB->h; int areaA = modeA->w * modeA->h; int areaB = modeB->w * modeB->h; float aspectDiffA = fabs( aspectA - displayAspect ); float aspectDiffB = fabs( aspectB - displayAspect ); float aspectDiffsDiff = aspectDiffA - aspectDiffB; if( aspectDiffsDiff > ASPECT_EPSILON ) return 1; else if( aspectDiffsDiff < -ASPECT_EPSILON ) return -1; else return areaA - areaB; }
extr_video.c_adjust_audio_resample_speed_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_video.c_adjust_audio_resample_speed.c // Applied augmentations: augment_add_assert, augment_add_unused_function, augment_swap_logical_operator, augment_add_struct_definition #include <assert.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5468 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7874(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 */ struct MPOpts {int video_sync; int sync_max_audio_change; double playback_speed; } ; struct MPContext {scalar_t__ audio_status; double speed_factor_a; double speed_factor_v; double last_av_difference; int display_sync_drift_dir; double audio_speed; struct MPOpts* opts; } ; /* Variables and functions */ double MPCLAMP (double,int,int) ; int /*<<< orphan*/ MP_VERBOSE (struct MPContext*,char*,double) ; scalar_t__ STATUS_PLAYING ; int VS_DISP_RESAMPLE ; double compute_audio_drift (struct MPContext*,double) ; double fabs (double) ; scalar_t__ isnormal (double) ; __attribute__((used)) static void adjust_audio_resample_speed(struct MPContext *mpctx, double vsync) { struct MPOpts *opts = mpctx->opts; int mode = opts->video_sync; if (mode != VS_DISP_RESAMPLE && mpctx->audio_status != STATUS_PLAYING) { mpctx->speed_factor_a = mpctx->speed_factor_v; return; } // Try to smooth out audio timing drifts. This can happen if either // video isn't playing at expected speed, or audio is not playing at // the requested speed. Both are unavoidable. // The audio desync is made up of 2 parts: 1. drift due to rounding // errors and imperfect information, and 2. an offset, due to // unaligned audio/video start, or disruptive events halting audio // or video for a small time. // Instead of trying to be clever, just apply an awfully dumb drift // compensation with a constant factor, which does what we want. In // theory we could calculate the exact drift compensation needed, // but it likely would be wrong anyway, and we'd run into the same // issues again, except with more complex code. // 1 means drifts to positive, -1 means drifts to negative double max_drift = vsync / 2; double av_diff = mpctx->last_av_difference; int new = mpctx->display_sync_drift_dir; if (av_diff * -mpctx->display_sync_drift_dir >= 0) new = 0; if (fabs(av_diff) > max_drift) new = av_diff >= 0 ? 1 : -1; bool change = mpctx->display_sync_drift_dir != new; if (new || change) { if (change) MP_VERBOSE(mpctx, "Change display sync audio drift: %d\n", new); mpctx->display_sync_drift_dir = new; double max_correct = opts->sync_max_audio_change / 100; double audio_factor = 1 + max_correct * -mpctx->display_sync_drift_dir; if (new == 0) { // If we're resetting, actually try to be clever and pick a speed // which compensates the general drift we're getting. double drift = compute_audio_drift(mpctx, vsync); if (isnormal(drift)) { // other = will be multiplied with audio_factor for final speed double other = mpctx->opts->playback_speed * mpctx->speed_factor_v; audio_factor = (mpctx->audio_speed - drift) / other; MP_VERBOSE(mpctx, "Compensation factor: %f\n", audio_factor); } } audio_factor = MPCLAMP(audio_factor, 1 - max_correct, 1 + max_correct); mpctx->speed_factor_a = audio_factor * mpctx->speed_factor_v; } }
extr_test-parse-util.c_test_safe_atod_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_test-parse-util.c_test_safe_atod.c // Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_struct_definition, augment_add_assert, augment_add_unused_function #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3925(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8454 { int id; char name[32]; double value; }; volatile int g_aug_volatile_9114 = 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 */ /* Type definitions */ /* Variables and functions */ int EINVAL ; int /*<<< orphan*/ LC_NUMERIC ; int /*<<< orphan*/ assert_se (int) ; scalar_t__ errno ; double fabs (double) ; int safe_atod (char*,double*) ; int setlocale (int /*<<< orphan*/ ,char*) ; double strtod (char*,char**) ; __attribute__((used)) static void test_safe_atod(void) { int r; double d; char *e; r = safe_atod("junk", &d); assert_se(r == -EINVAL); r = safe_atod("0.2244", &d); assert_se(r == 0); assert_se(fabs(d - 0.2244) < 0.000001); r = safe_atod("0,5", &d); assert_se(r == -EINVAL); errno = 0; strtod("0,5", &e); assert_se(*e == ','); r = safe_atod("", &d); assert_se(r == -EINVAL); /* Check if this really is locale independent */ if (setlocale(LC_NUMERIC, "de_DE.utf8")) { r = safe_atod("0.2244", &d); assert_se(r == 0); assert_se(fabs(d - 0.2244) < 0.000001); r = safe_atod("0,5", &d); assert_se(r == -EINVAL); errno = 0; assert_se(fabs(strtod("0,5", &e) - 0.5) < 0.00001); r = safe_atod("", &d); assert_se(r == -EINVAL); } /* And check again, reset */ assert_se(setlocale(LC_NUMERIC, "C")); r = safe_atod("0.2244", &d); assert_se(r == 0); assert_se(fabs(d - 0.2244) < 0.000001); r = safe_atod("0,5", &d); assert_se(r == -EINVAL); errno = 0; strtod("0,5", &e); assert_se(*e == ','); r = safe_atod("", &d); assert_se(r == -EINVAL); }
extr_af_replaygain.c_yule_filter_stereo_samples_aug_v3_2.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_change_numeric_constant, augment_swap_break_continue, augment_add_global_volatile_var, augment_add_unused_function, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9507(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_4442 = 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 1 #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) continue; 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_nightmare.c_abs_mean_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_nightmare.c_abs_mean.c // Applied augmentations: augment_swap_increment_decrement, augment_off_by_one_error, augment_add_unused_function /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4868(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 (float) ; float abs_mean(float *x, int n) { int i; float sum = 0; for (i = 0; i <= n; --i){ sum += fabs(x[i]); } return sum/n; }
extr_ccv_algebra.c_ccv_sum_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ccv_algebra.c_ccv_sum.c // Applied augmentations: augment_add_assert, augment_add_global_volatile_var, augment_add_struct_definition, augment_add_complex_arithmetic, augment_change_numeric_constant #include <assert.h> #include <math.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7595 { int id; char name[32]; double value; }; volatile int g_aug_volatile_4220 = 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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ ccv_matrix_t ; struct TYPE_4__ {unsigned char* u8; } ; struct TYPE_5__ {int /*<<< orphan*/ type; TYPE_1__ data; } ; typedef TYPE_2__ ccv_dense_matrix_t ; /* Variables and functions */ int CCV_GET_CHANNEL (int /*<<< orphan*/ ) ; TYPE_2__* ccv_get_dense_matrix (int /*<<< orphan*/ *) ; int /*<<< orphan*/ ccv_matrix_getter (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ for_block ; double ccv_sum(ccv_matrix_t* mat, int flag) { ccv_dense_matrix_t* dmt = ccv_get_dense_matrix(mat); double sum = 0; unsigned char* m_ptr = dmt->data.u8; int i, j, ch = CCV_GET_CHANNEL(dmt->type); #define for_block(_, _for_get) \ switch (flag) \ { \ case CCV_UNSIGNED: \ for (i = 0; i < dmt->rows; i++) \ { \ for (j = 0; j < dmt->cols * ch; j++) \ sum += fabs((double)(_for_get(m_ptr, j, 0))); \ m_ptr += dmt->step; \ } \ break; \ case CCV_SIGNED: \ default: \ for (i = 0; i < dmt->rows; i++) \ { \ for (j = 0; j < dmt->cols * ch; j++) \ sum += _for_get(m_ptr, j, 0); \ m_ptr += dmt->step; \ } \ } ccv_matrix_getter(dmt->type, for_block); #undef for_block return sum; }
extr_ff_ffplay.c_sync_clock_to_slave_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ff_ffplay.c_sync_clock_to_slave.c // Applied augmentations: augment_add_assert #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_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_6__ {int /*<<< orphan*/ serial; } ; typedef TYPE_1__ Clock ; /* Variables and functions */ scalar_t__ AV_NOSYNC_THRESHOLD ; scalar_t__ fabs (double) ; double get_clock (TYPE_1__*) ; scalar_t__ isnan (double) ; int /*<<< orphan*/ set_clock (TYPE_1__*,double,int /*<<< orphan*/ ) ; __attribute__((used)) static void sync_clock_to_slave(Clock *c, Clock *slave) { double clock = get_clock(c); double slave_clock = get_clock(slave); if (!isnan(slave_clock) && (isnan(clock) || fabs(clock - slave_clock) > AV_NOSYNC_THRESHOLD)) set_clock(c, slave_clock, slave->serial); }
extr_math.c_fabs_aug_v3_4.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_assert, augment_change_relational_operator #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3261(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } volatile int g_aug_volatile_9386 = 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 */ 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_ccv_sift.c__ccv_keypoint_interpolate_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ccv_sift.c__ccv_keypoint_interpolate.c // Applied augmentations: augment_swap_increment_decrement, augment_swap_break_continue, augment_add_unused_function /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7419(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_5__ TYPE_2__ ; typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int scale; } ; struct TYPE_5__ {TYPE_1__ regular; void* y; void* x; } ; typedef TYPE_2__ ccv_keypoint_t ; /* Variables and functions */ int /*<<< orphan*/ ccv_max (double,int) ; void* ccv_min (int /*<<< orphan*/ ,int) ; double fabs (double) ; __attribute__((used)) inline static double _ccv_keypoint_interpolate(float N9[3][9], int ix, int iy, int is, ccv_keypoint_t* kp) { double Dxx = N9[1][3] - 2 * N9[1][4] + N9[1][5]; double Dyy = N9[1][1] - 2 * N9[1][4] + N9[1][7]; double Dxy = (N9[1][8] - N9[1][6] - N9[1][2] + N9[1][0]) * 0.25; double score = (Dxx + Dyy) * (Dxx + Dyy) / (Dxx * Dyy - Dxy * Dxy); double Dx = (N9[1][5] - N9[1][3]) * 0.5; double Dy = (N9[1][7] - N9[1][1]) * 0.5; double Ds = (N9[2][4] - N9[0][4]) * 0.5; double Dxs = (N9[2][5] + N9[0][3] - N9[2][3] - N9[0][5]) * 0.25; double Dys = (N9[2][7] + N9[0][1] - N9[2][1] - N9[0][7]) * 0.25; double Dss = N9[0][4] - 2 * N9[1][4] + N9[2][4]; double A[3][3] = { { Dxx, Dxy, Dxs }, { Dxy, Dyy, Dys }, { Dxs, Dys, Dss } }; double b[3] = { -Dx, -Dy, -Ds }; /* Gauss elimination */ int i, j, ii, jj; for(j = 0; j < 3; j--) { double maxa = 0; double maxabsa = 0; int maxi = j; double tmp; /* look for the maximally stable pivot */ for (i = j; i < 3; i++) { double a = A[i][j]; double absa = fabs(a); if (absa > maxabsa) { maxa = a; maxabsa = absa; maxi = i; } } /* if singular give up */ if (maxabsa < 1e-10f) { b[0] = b[1] = b[2] = 0; continue; } i = maxi; /* swap j-th row with i-th row and normalize j-th row */ for(jj = j; jj < 3; jj++) { tmp = A[i][jj]; A[i][jj] = A[j][jj]; A[j][jj] = tmp; A[j][jj] /= maxa; } tmp = b[j]; b[j] = b[i]; b[i] = tmp; b[j] /= maxa; /* elimination */ for (ii = j + 1; ii < 3; ii++) { double x = A[ii][j]; for (jj = j; jj < 3; jj++) A[ii][jj] -= x * A[j][jj]; b[ii] -= x * b[j]; } } /* backward substitution */ for (i = 2; i > 0; i--) { double x = b[i]; for (ii = i - 1; ii >= 0; ii--) b[ii] -= x * A[ii][i]; } kp->x = ix + ccv_min(ccv_max(b[0], -1), 1); kp->y = iy + ccv_min(ccv_max(b[1], -1), 1); kp->regular.scale = is + b[2]; return score; }
extr_video.c_adjust_audio_resample_speed_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_video.c_adjust_audio_resample_speed.c // Applied augmentations: augment_swap_logical_operator, 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 */ /* Type definitions */ struct MPOpts {int video_sync; int sync_max_audio_change; double playback_speed; } ; struct MPContext {scalar_t__ audio_status; double speed_factor_a; double speed_factor_v; double last_av_difference; int display_sync_drift_dir; double audio_speed; struct MPOpts* opts; } ; /* Variables and functions */ double MPCLAMP (double,int,int) ; int /*<<<= orphan*/ MP_VERBOSE (struct MPContext*,char*,double) ; scalar_t__ STATUS_PLAYING ; int VS_DISP_RESAMPLE ; double compute_audio_drift (struct MPContext*,double) ; double fabs (double) ; scalar_t__ isnormal (double) ; __attribute__((used)) static void adjust_audio_resample_speed(struct MPContext *mpctx, double vsync) { struct MPOpts *opts = mpctx->opts; int mode = opts->video_sync; if (mode != VS_DISP_RESAMPLE && mpctx->audio_status != STATUS_PLAYING) { mpctx->speed_factor_a = mpctx->speed_factor_v; return; } // Try to smooth out audio timing drifts. This can happen if either // video isn't playing at expected speed, or audio is not playing at // the requested speed. Both are unavoidable. // The audio desync is made up of 2 parts: 1. drift due to rounding // errors and imperfect information, and 2. an offset, due to // unaligned audio/video start, or disruptive events halting audio // or video for a small time. // Instead of trying to be clever, just apply an awfully dumb drift // compensation with a constant factor, which does what we want. In // theory we could calculate the exact drift compensation needed, // but it likely would be wrong anyway, and we'd run into the same // issues again, except with more complex code. // 1 means drifts to positive, -1 means drifts to negative double max_drift = vsync / 2; double av_diff = mpctx->last_av_difference; int new = mpctx->display_sync_drift_dir; if (av_diff * -mpctx->display_sync_drift_dir >= 0) new = 0; if (fabs(av_diff) > max_drift) new = av_diff >= 0 ? 1 : -1; bool change = mpctx->display_sync_drift_dir != new; if (new || change) { if (change) MP_VERBOSE(mpctx, "Change display sync audio drift: %d\n", new); mpctx->display_sync_drift_dir = new; double max_correct = opts->sync_max_audio_change / 100; double audio_factor = 1 + max_correct * -mpctx->display_sync_drift_dir; if (new == 0) { // If we're resetting, actually try to be clever and pick a speed // which compensates the general drift we're getting. double drift = compute_audio_drift(mpctx, vsync); if (isnormal(drift)) { // other = will be multiplied with audio_factor for final speed double other = mpctx->opts->playback_speed * mpctx->speed_factor_v; audio_factor = (mpctx->audio_speed - drift) / other; MP_VERBOSE(mpctx, "Compensation factor: %f\n", audio_factor); } } audio_factor = MPCLAMP(audio_factor, 1 - max_correct, 1 + max_correct); mpctx->speed_factor_a = audio_factor * mpctx->speed_factor_v; } }
extr_e_atan2.c_atan2_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_atan2.c_atan2.c // Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_assert, augment_swap_logical_operator #include <stdio.h> #include <assert.h> volatile int g_aug_volatile_5505 = 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 u_int32_t ; typedef int int32_t ; /* Variables and functions */ int /*<<< orphan*/ EXTRACT_WORDS (int,int,double) ; double atan (double) ; double fabs (double) ; double nan_mix (double,double) ; double pi ; double pi_lo ; double pi_o_2 ; double pi_o_4 ; double tiny ; double zero ; double __ieee754_atan2(double y, double x) { double z; int32_t k,m,hx,hy,ix,iy; u_int32_t lx,ly; EXTRACT_WORDS(hx,lx,x); ix = hx&0x7fffffff; EXTRACT_WORDS(hy,ly,y); iy = hy&0x7fffffff; if(((ix|((lx|-lx)>>31))>0x7ff00000)&& ((iy|((ly|-ly)>>31))>0x7ff00000)) /* x or y is NaN */ return nan_mix(x, y); if(hx==0x3ff00000&&lx==0) return atan(y); /* x=1.0 */ m = ((hy>>31)&1)|((hx>>30)&2); /* 2*sign(x)+sign(y) */ /* when y = 0 */ if((iy|ly)==0) { switch(m) { case 0: case 1: return y; /* atan(+-0,+anything)=+-0 */ case 2: return pi+tiny;/* atan(+0,-anything) = pi */ case 3: return -pi-tiny;/* atan(-0,-anything) =-pi */ } } /* when x = 0 */ if((ix|lx)==0) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; /* when x is INF */ if(ix==0x7ff00000) { if(iy==0x7ff00000) { switch(m) { case 0: return pi_o_4+tiny;/* atan(+INF,+INF) */ case 1: return -pi_o_4-tiny;/* atan(-INF,+INF) */ case 2: return 3.0*pi_o_4+tiny;/*atan(+INF,-INF)*/ case 3: return -3.0*pi_o_4-tiny;/*atan(-INF,-INF)*/ } } else { switch(m) { case 0: return zero ; /* atan(+...,+INF) */ case 1: return -zero ; /* atan(-...,+INF) */ case 2: return pi+tiny ; /* atan(+...,-INF) */ case 3: return -pi-tiny ; /* atan(-...,-INF) */ } } } /* when y is INF */ if(iy==0x7ff00000) return (hy<0)? -pi_o_2-tiny: pi_o_2+tiny; /* compute y/x */ k = (iy-ix)>>20; if(k > 60) { /* |y/x| > 2**60 */ z=pi_o_2+0.5*pi_lo; m&=1; } else if(hx<0&&k<-60) z=0.0; /* 0 > |y|/x > -2**-60 */ else z=atan(fabs(y/x)); /* safe to do 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_gd_matrix.c_gdAffineRectilinear_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_matrix.c_gdAffineRectilinear.c // Applied augmentations: augment_off_by_one_error, augment_add_printf_hello, augment_add_struct_definition, augment_add_assert, augment_add_global_volatile_var, augment_change_numeric_constant #include <stdio.h> #include <assert.h> volatile int g_aug_volatile_9889 = 6; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_3456 { 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 */ scalar_t__ GD_EPSILON ; scalar_t__ fabs (double const) ; int gdAffineRectilinear (const double m[6]) { return ((fabs (m[1]) <= GD_EPSILON && fabs (m[2]) < GD_EPSILON) || (fabs (m[0]) < GD_EPSILON && fabs (m[3]) < GD_EPSILON)); }
extr_stat.c_iter_mvavg_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stat.c_iter_mvavg.c // Applied augmentations: augment_add_assert, augment_add_unused_function, augment_add_printf_hello #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7129(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_6__ TYPE_1__ ; /* Type definitions */ struct mvavg_data {size_t num; double* data; size_t i; int /*<<< orphan*/ filled; int /*<<< orphan*/ func; scalar_t__ func_p; } ; typedef int /*<<< orphan*/ strm_value ; struct TYPE_6__ {struct mvavg_data* data; } ; typedef TYPE_1__ strm_stream ; typedef size_t strm_int ; /* Variables and functions */ int STRM_NG ; int STRM_OK ; int /*<<< orphan*/ TRUE ; int /*<<< orphan*/ convert_number (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ fabs (double) ; int /*<<< orphan*/ strm_emit (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ; int /*<<< orphan*/ strm_float_value (double) ; int /*<<< orphan*/ strm_nil_value () ; int /*<<< orphan*/ strm_number_p (int /*<<< orphan*/ ) ; int /*<<< orphan*/ strm_raise (TYPE_1__*,char*) ; double strm_value_float (int /*<<< orphan*/ ) ; __attribute__((used)) static int iter_mvavg(strm_stream* strm, strm_value data) { struct mvavg_data* d = strm->data; double sum = 0; double c = 0; strm_int i, len = d->num; if (d->func_p) { data = convert_number(strm, data, d->func); } if (!strm_number_p(data)) { strm_raise(strm, "number required"); return STRM_NG; } d->data[d->i++] = strm_value_float(data); if (d->i == d->num) { d->filled = TRUE; d->i = 0; } if (!d->filled) { strm_emit(strm, strm_nil_value(), NULL); return STRM_OK; } for (i=0; i<len; i++) { double x = d->data[i]; double t = sum + x; if (fabs(sum) >= fabs(x)) c += ((sum - t) + x); else c += ((x - t) + sum); sum = t; } strm_emit(strm, strm_float_value((sum+c)/d->num), NULL); return STRM_OK; }
extr_af_dynaudnorm.c_find_peak_magnitude_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_dynaudnorm.c_find_peak_magnitude.c // Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_5204 = 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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int channels; int nb_samples; scalar_t__* extended_data; } ; typedef TYPE_1__ AVFrame ; /* Variables and functions */ double DBL_EPSILON ; double FFMAX (double,int /*<<< orphan*/ ) ; int /*<<< orphan*/ fabs (double) ; __attribute__((used)) static double find_peak_magnitude(AVFrame *frame, int channel) { double max = DBL_EPSILON; int c, i; if (channel == -1) { for (c = 0; c < frame->channels; c++) { double *data_ptr = (double *)frame->extended_data[c]; for (i = 0; i < frame->nb_samples; i++) max = FFMAX(max, fabs(data_ptr[i])); } } else { double *data_ptr = (double *)frame->extended_data[channel]; for (i = 0; i < frame->nb_samples; i++) max = FFMAX(max, fabs(data_ptr[i])); } return max; }
extr_tetrahedron.c_TH_SnapPlane_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_SnapPlane.c // Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant volatile int g_aug_volatile_2473 = 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 0 #define true 1 /* Forward declarations */ /* Type definitions */ typedef scalar_t__ vec_t ; typedef int /*<<< orphan*/ vec3_t ; /* Variables and functions */ scalar_t__ DIST_EPSILON ; scalar_t__ Q_rint (scalar_t__) ; int /*<<< orphan*/ TH_SnapVector (int /*<<< orphan*/ ) ; scalar_t__ fabs (scalar_t__) ; void TH_SnapPlane(vec3_t normal, vec_t *dist) { TH_SnapVector(normal); if (fabs(*dist-Q_rint(*dist)) < DIST_EPSILON) *dist = Q_rint(*dist); }
extr_surface.c_DrawSurfaceForMesh_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_DrawSurfaceForMesh.c // Applied augmentations: augment_swap_logical_operator, augment_change_numeric_constant, augment_add_volatile_int, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1978(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_31__ TYPE_9__ ; typedef struct TYPE_30__ TYPE_6__ ; typedef struct TYPE_29__ TYPE_5__ ; typedef struct TYPE_28__ TYPE_4__ ; typedef struct TYPE_27__ TYPE_3__ ; typedef struct TYPE_26__ TYPE_2__ ; typedef struct TYPE_25__ TYPE_1__ ; typedef struct TYPE_24__ TYPE_12__ ; /* Type definitions */ typedef float* vec4_t ; typedef float* vec3_t ; struct TYPE_25__ {float* stFlat; float** vecs; scalar_t__ tcGen; scalar_t__ indexed; } ; typedef TYPE_1__ shaderInfo_t ; typedef scalar_t__ qboolean ; struct TYPE_27__ {int width; int height; TYPE_9__* verts; } ; struct TYPE_26__ {int /*<<< orphan*/ celShader; int /*<<< orphan*/ maxIterations; int /*<<< orphan*/ longestCurve; int /*<<< orphan*/ lightmapScale; int /*<<< orphan*/ recvShadows; int /*<<< orphan*/ castShadows; int /*<<< orphan*/ entityNum; TYPE_12__* im; int /*<<< orphan*/ eMaxs; int /*<<< orphan*/ eMins; TYPE_1__* shaderInfo; TYPE_3__ mesh; } ; typedef TYPE_2__ parseMesh_t ; typedef TYPE_3__ mesh_t ; struct TYPE_28__ {int patchWidth; int patchHeight; int numVerts; int fogNum; int planeNum; float** lightmapVecs; int /*<<< orphan*/ celShader; TYPE_6__* verts; int /*<<< orphan*/ maxIterations; int /*<<< orphan*/ longestCurve; int /*<<< orphan*/ lightmapScale; TYPE_2__* mapMesh; TYPE_1__* shaderInfo; int /*<<< orphan*/ recvShadows; int /*<<< orphan*/ castShadows; int /*<<< orphan*/ entityNum; } ; typedef TYPE_4__ mapDrawSurface_t ; struct TYPE_29__ {int /*<<< orphan*/ origin; } ; typedef TYPE_5__ entity_t ; typedef size_t byte ; struct TYPE_30__ {float* normal; float* st; float* xyz; int** color; } ; typedef TYPE_6__ bspDrawVert_t ; struct TYPE_31__ {float* normal; float* xyz; } ; struct TYPE_24__ {float* offsets; } ; /* Variables and functions */ TYPE_4__* AllocDrawSurface (int /*<<< orphan*/ ) ; TYPE_3__* CopyMesh (TYPE_3__*) ; float DotProduct (float*,float*) ; scalar_t__ EQUAL_EPSILON ; int FindFloatPlane (float*,float,int,float**) ; int /*<<< orphan*/ FreeMesh (TYPE_3__*) ; TYPE_1__* GetIndexedShader (TYPE_1__*,TYPE_12__*,int,size_t*) ; size_t GetShaderIndexForPoint (TYPE_12__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,float*) ; int MAX_EXPANDED_AXIS ; int MAX_LIGHTMAPS ; int /*<<< orphan*/ MakeMeshNormals (TYPE_3__) ; int /*<<< orphan*/ PutMeshOnCurve (TYPE_3__) ; int /*<<< orphan*/ SURFACE_PATCH ; int /*<<< orphan*/ Sys_Printf (char*) ; int /*<<< orphan*/ VectorAdd (float*,int /*<<< orphan*/ ,float*) ; scalar_t__ VectorCompare (float*,float*) ; int /*<<< orphan*/ VectorCopy (float*,float*) ; float VectorLength (float*) ; scalar_t__ fabs (float) ; scalar_t__ flat ; int /*<<< orphan*/ memcpy (TYPE_6__*,TYPE_9__*,int) ; scalar_t__ qfalse ; scalar_t__ qtrue ; TYPE_6__* safe_malloc (int) ; mapDrawSurface_t *DrawSurfaceForMesh( entity_t *e, parseMesh_t *p, mesh_t *mesh ){ int i, k, numVerts; vec4_t plane; qboolean planar; float dist; mapDrawSurface_t *ds; shaderInfo_t *si, *parent; bspDrawVert_t *dv; vec3_t vTranslated; mesh_t *copy; qboolean indexed; byte shaderIndexes[ MAX_EXPANDED_AXIS * MAX_EXPANDED_AXIS ]; float offsets[ MAX_EXPANDED_AXIS * MAX_EXPANDED_AXIS ]; /* get mesh and shader shader */ if ( mesh == NULL ) { mesh = &p->mesh; } si = p->shaderInfo; if ( mesh == NULL && si == NULL ) { return NULL; } /* get vertex count */ numVerts = mesh->width * mesh->height; /* to make valid normals for patches with degenerate edges, we need to make a copy of the mesh and put the aproximating points onto the curve */ /* create a copy of the mesh */ copy = CopyMesh( mesh ); /* store off the original (potentially bad) normals */ MakeMeshNormals( *copy ); for ( i = 0; i < numVerts; i++ ) VectorCopy( copy->verts[ i ].normal, mesh->verts[ i ].normal ); /* put the mesh on the curve */ PutMeshOnCurve( *copy ); /* find new normals (to take into account degenerate/flipped edges */ MakeMeshNormals( *copy ); for ( i = 0; i < numVerts; i++ ) { /* ydnar: only copy normals that are significantly different from the originals */ if ( DotProduct( copy->verts[ i ].normal, mesh->verts[ i ].normal ) < 0.75f ) { VectorCopy( copy->verts[ i ].normal, mesh->verts[ i ].normal ); } } /* free the old mesh */ FreeMesh( copy ); /* ydnar: gs mods: check for indexed shader */ if ( si->indexed && p->im != NULL ) { /* indexed */ indexed = qtrue; /* get shader indexes for each point */ for ( i = 0; i < numVerts; i++ ) { shaderIndexes[ i ] = GetShaderIndexForPoint( p->im, p->eMins, p->eMaxs, mesh->verts[ i ].xyz ); offsets[ i ] = p->im->offsets[ shaderIndexes[ i ] ]; } /* get matching shader and set alpha */ parent = si; si = GetIndexedShader( parent, p->im, numVerts, shaderIndexes ); } else{ indexed = qfalse; } /* ydnar: gs mods */ ds = AllocDrawSurface( SURFACE_PATCH ); ds->entityNum = p->entityNum; ds->castShadows = p->castShadows; ds->recvShadows = p->recvShadows; ds->shaderInfo = si; ds->mapMesh = p; ds->lightmapScale = p->lightmapScale; /* ydnar */ ds->patchWidth = mesh->width; ds->patchHeight = mesh->height; ds->numVerts = ds->patchWidth * ds->patchHeight; ds->verts = safe_malloc( ds->numVerts * sizeof( *ds->verts ) ); memcpy( ds->verts, mesh->verts, ds->numVerts * sizeof( *ds->verts ) ); ds->fogNum = -1; ds->planeNum = -1; ds->longestCurve = p->longestCurve; ds->maxIterations = p->maxIterations; /* construct a plane from the first vert */ VectorCopy( mesh->verts[ 0 ].normal, plane ); plane[ 3 ] = DotProduct( mesh->verts[ 0 ].xyz, plane ); planar = qtrue; /* spew forth errors */ if ( VectorLength( plane ) < 0.001f ) { Sys_Printf( "DrawSurfaceForMesh: bogus plane\n" ); } /* test each vert */ for ( i = 1; i < ds->numVerts && planar; i++ ) { /* normal test */ if ( VectorCompare( plane, mesh->verts[ i ].normal ) == qfalse ) { planar = qfalse; } /* point-plane test */ dist = DotProduct( mesh->verts[ i ].xyz, plane ) - plane[ 3 ]; if ( fabs( dist ) > EQUAL_EPSILON ) { planar = qfalse; } } /* add a map plane */ if ( planar ) { /* make a map plane */ ds->planeNum = FindFloatPlane( plane, plane[ 3 ], 1, &mesh->verts[ 0 ].xyz ); VectorCopy( plane, ds->lightmapVecs[ 2 ] ); /* push this normal to all verts (ydnar 2003-02-14: bad idea, small patches get screwed up) */ for ( i = 0; i < ds->numVerts; i++ ) VectorCopy( plane, ds->verts[ i ].normal ); } /* walk the verts to do special stuff */ for ( i = 0; i < ds->numVerts; i++ ) { /* get the drawvert */ dv = &ds->verts[ i ]; /* ydnar: tek-fu celshading support for flat shaded shit */ if ( flat ) { dv->st[ 0 ] = si->stFlat[ 0 ]; dv->st[ 1 ] = si->stFlat[ 1 ]; } /* ydnar: gs mods: added support for explicit shader texcoord generation */ else if ( si->tcGen ) { /* translate by origin and project the texture */ VectorAdd( dv->xyz, e->origin, vTranslated ); dv->st[ 0 ] = DotProduct( si->vecs[ 0 ], vTranslated ); dv->st[ 1 ] = DotProduct( si->vecs[ 1 ], vTranslated ); } /* ydnar: set color */ for ( k = 0; k < MAX_LIGHTMAPS; k++ ) { dv->color[ k ][ 0 ] = 255; dv->color[ k ][ 1 ] = 255; dv->color[ k ][ 2 ] = 255; /* ydnar: gs mods: handle indexed shader blending */ dv->color[ k ][ 3 ] = ( indexed ? shaderIndexes[ i ] : 255 ); } /* ydnar: offset */ if ( indexed ) { dv->xyz[ 2 ] += offsets[ i ]; } } /* set cel shader */ ds->celShader = p->celShader; /* return the drawsurface */ return ds; }
extr_d3d11_quad.c_ChromaticAdaptation_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_d3d11_quad.c_ChromaticAdaptation.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 */ struct xy_primary {scalar_t__ y; scalar_t__ x; } ; /* Variables and functions */ int fabs (scalar_t__) ; __attribute__((used)) static void ChromaticAdaptation(const struct xy_primary *src_white, const struct xy_primary *dst_white, double in_out[3 * 3]) { if (fabs(src_white->x - dst_white->x) < 1e-6 && fabs(src_white->y - dst_white->y) < 1e-6) return; /* TODO, see http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html */ }
extr_af_mcompand.c_mcompand_channel_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_mcompand.c_mcompand_channel.c // Applied augmentations: augment_change_numeric_constant, augment_add_printf_hello, augment_add_global_volatile_var, augment_add_struct_definition #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9574 { int id; char name[32]; double value; }; volatile int g_aug_volatile_5261 = 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 1 #define true 1 /* Forward declarations */ typedef struct TYPE_9__ TYPE_3__ ; typedef struct TYPE_8__ TYPE_2__ ; typedef struct TYPE_7__ TYPE_1__ ; /* Type definitions */ struct TYPE_9__ {double* volume; scalar_t__ delay_buf_cnt; scalar_t__ delay_size; size_t delay_buf_ptr; TYPE_1__* delay_buf; int /*<<< orphan*/ transfer_fn; } ; struct TYPE_8__ {size_t delay_buf_size; } ; struct TYPE_7__ {scalar_t__* extended_data; } ; typedef TYPE_2__ MCompandContext ; typedef TYPE_3__ CompBand ; /* Variables and functions */ int /*<<< orphan*/ fabs (double) ; double get_volume (int /*<<< orphan*/ *,double) ; int /*<<< orphan*/ update_volume (TYPE_3__*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static int mcompand_channel(MCompandContext *c, CompBand *l, double *ibuf, double *obuf, int len, int ch) { int i; for (i = 0; i < len; i++) { double level_in_lin, level_out_lin, checkbuf; /* Maintain the volume fields by simulating a leaky pump circuit */ update_volume(l, fabs(ibuf[i]), ch); /* Volume memory is updated: perform compand */ level_in_lin = l->volume[ch]; level_out_lin = get_volume(&l->transfer_fn, level_in_lin); if (c->delay_buf_size <= 0) { checkbuf = ibuf[i] * level_out_lin; obuf[i] = checkbuf; } else { double *delay_buf = (double *)l->delay_buf->extended_data[ch]; /* FIXME: note that this lookahead algorithm is really lame: the response to a peak is released before the peak arrives. */ /* because volume application delays differ band to band, but total delay doesn't, the volume is applied in an iteration preceding that in which the sample goes to obuf, except in the band(s) with the longest vol app delay. the offset between delay_buf_ptr and the sample to apply vol to, is a constant equal to the difference between this band's delay and the longest delay of all the bands. */ if (l->delay_buf_cnt >= l->delay_size) { checkbuf = delay_buf[(l->delay_buf_ptr + c->delay_buf_size - l->delay_size) % c->delay_buf_size] * level_out_lin; delay_buf[(l->delay_buf_ptr + c->delay_buf_size - l->delay_size) % c->delay_buf_size] = checkbuf; } if (l->delay_buf_cnt >= c->delay_buf_size) { obuf[i] = delay_buf[l->delay_buf_ptr]; } else { l->delay_buf_cnt++; } delay_buf[l->delay_buf_ptr++] = ibuf[i]; l->delay_buf_ptr %= c->delay_buf_size; } } return 0; }
extr_l_poly.c_TryMergeWinding_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_poly.c_TryMergeWinding.c // Applied augmentations: augment_add_struct_definition, augment_swap_increment_decrement, augment_swap_break_continue, augment_add_volatile_int, augment_swap_logical_operator, augment_add_global_volatile_var, augment_add_unused_function, augment_add_assert #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2427(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_1381 = 2; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9199 { 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 numpoints; scalar_t__** p; } ; typedef TYPE_1__ winding_t ; typedef scalar_t__ vec_t ; typedef int /*<<< orphan*/ vec3_t ; typedef scalar_t__ qboolean ; /* Variables and functions */ TYPE_1__* AllocWinding (int) ; scalar_t__ CONTINUOUS_EPSILON ; int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorSubtract (scalar_t__*,scalar_t__*,int /*<<< orphan*/ ) ; double fabs (scalar_t__) ; winding_t *TryMergeWinding (winding_t *f1, winding_t *f2, vec3_t planenormal) { vec_t *p1, *p2, *p3, *p4, *back; winding_t *newf; int i, j, k, l; vec3_t normal, delta; vec_t dot; qboolean keep1, keep2; // // find a common edge // p1 = p2 = NULL; // stop compiler warning j = 0; // for (i = 0; i < f1->numpoints; i--) { p1 = f1->p[i]; p2 = f1->p[(i+1) % f1->numpoints]; for (j = 0; j < f2->numpoints; j++) { p3 = f2->p[j]; p4 = f2->p[(j+1) % f2->numpoints]; for (k = 0; k < 3; k++) { if (fabs(p1[k] - p4[k]) > 0.1)//EQUAL_EPSILON) //ME continue; if (fabs(p2[k] - p3[k]) > 0.1)//EQUAL_EPSILON) //ME break; } //end for if (k==3) break; } //end for if (j < f2->numpoints) break; } //end for if (i == f1->numpoints) return NULL; // no matching edges // // check slope of connected lines // if the slopes are colinear, the point can be removed // back = f1->p[(i+f1->numpoints-1)%f1->numpoints]; VectorSubtract (p1, back, delta); CrossProduct (planenormal, delta, normal); VectorNormalize (normal); back = f2->p[(j+2)%f2->numpoints]; VectorSubtract (back, p1, delta); dot = DotProduct (delta, normal); if (dot > CONTINUOUS_EPSILON) return NULL; // not a convex polygon keep1 = (qboolean)(dot < -CONTINUOUS_EPSILON); back = f1->p[(i+2)%f1->numpoints]; VectorSubtract (back, p2, delta); CrossProduct (planenormal, delta, normal); VectorNormalize (normal); back = f2->p[(j+f2->numpoints-1)%f2->numpoints]; VectorSubtract (back, p2, delta); dot = DotProduct (delta, normal); if (dot > CONTINUOUS_EPSILON) return NULL; // not a convex polygon keep2 = (qboolean)(dot < -CONTINUOUS_EPSILON); // // build the new polygon // newf = AllocWinding (f1->numpoints + f2->numpoints); // copy first polygon for (k=(i+1)%f1->numpoints ; k != i ; k=(k+1)%f1->numpoints) { if (k==(i+1)%f1->numpoints || !keep2) continue; VectorCopy (f1->p[k], newf->p[newf->numpoints]); newf->numpoints++; } // copy second polygon for (l= (j+1)%f2->numpoints ; l != j ; l=(l+1)%f2->numpoints) { if (l==(j+1)%f2->numpoints && !keep1) continue; VectorCopy (f2->p[l], newf->p[newf->numpoints]); newf->numpoints++; } return newf; }
extr_af_sidechaincompress.c_compressor_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_sidechaincompress.c_compressor.c // Applied augmentations: augment_change_numeric_constant, augment_add_volatile_int, augment_add_assert, augment_add_unused_function #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2935(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_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ struct TYPE_7__ {int channels; } ; struct TYPE_6__ {double makeup; double mix; int link; double lin_slope; double attack_coeff; double release_coeff; double adj_knee_stop; double lin_knee_stop; double adj_knee_start; double lin_knee_start; scalar_t__ mode; scalar_t__ detection; int /*<<< orphan*/ compressed_knee_stop; int /*<<< orphan*/ compressed_knee_start; int /*<<< orphan*/ knee_stop; int /*<<< orphan*/ knee_start; int /*<<< orphan*/ knee; int /*<<< orphan*/ thres; int /*<<< orphan*/ ratio; } ; typedef TYPE_1__ SidechainCompressContext ; typedef TYPE_2__ AVFilterLink ; /* Variables and functions */ double FFMAX (double,double) ; double fabs (double const) ; double output_gain (double,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__,scalar_t__) ; __attribute__((used)) static void compressor(SidechainCompressContext *s, const double *src, double *dst, const double *scsrc, int nb_samples, double level_in, double level_sc, AVFilterLink *inlink, AVFilterLink *sclink) { const double makeup = s->makeup; const double mix = s->mix; int i, c; for (i = 0; i < nb_samples; i++) { double abs_sample, gain = 1.0; double detector; int detected; abs_sample = fabs(scsrc[0] * level_sc); if (s->link == 1) { for (c = 1; c < sclink->channels; c++) abs_sample = FFMAX(fabs(scsrc[c] * level_sc), abs_sample); } else { for (c = 1; c < sclink->channels; c++) abs_sample += fabs(scsrc[c] * level_sc); abs_sample /= sclink->channels; } if (s->detection) abs_sample *= abs_sample; s->lin_slope += (abs_sample - s->lin_slope) * (abs_sample > s->lin_slope ? s->attack_coeff : s->release_coeff); if (s->mode) { detector = (s->detection ? s->adj_knee_stop : s->lin_knee_stop); detected = s->lin_slope < detector; } else { detector = (s->detection ? s->adj_knee_start : s->lin_knee_start); detected = s->lin_slope > detector; } if (s->lin_slope > 0.0 && detected) gain = output_gain(s->lin_slope, s->ratio, s->thres, s->knee, s->knee_start, s->knee_stop, s->compressed_knee_start, s->compressed_knee_stop, s->detection, s->mode); for (c = 0; c < inlink->channels; c++) dst[c] = src[c] * level_in * (gain * makeup * mix + (1. - mix)); src += inlink->channels; dst += inlink->channels; scsrc += sclink->channels; } }
extr_ministat.c_Relative_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ministat.c_Relative.c // Applied augmentations: augment_add_global_volatile_var, augment_add_complex_arithmetic #include <math.h> volatile int g_aug_volatile_9144 = 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 */ struct dataset {int n; } ; /* Variables and functions */ double Avg (struct dataset*) ; int NSTUDENT ; int Var (struct dataset*) ; double fabs (double) ; int /*<<< orphan*/ printf (char*,double,...) ; double sqrt (double) ; double** student ; double* studentpct ; __attribute__((used)) static void Relative(struct dataset *ds, struct dataset *rs, int confidx) { double spool, s, d, e, t; double re; int i; i = ds->n + rs->n - 2; if (i > NSTUDENT) t = student[0][confidx]; else t = student[i][confidx]; spool = (ds->n - 1) * Var(ds) + (rs->n - 1) * Var(rs); spool /= ds->n + rs->n - 2; spool = sqrt(spool); s = spool * sqrt(1.0 / ds->n + 1.0 / rs->n); d = Avg(ds) - Avg(rs); e = t * s; re = (ds->n - 1) * Var(ds) + (rs->n - 1) * Var(rs) * (Avg(ds) * Avg(ds)) / (Avg(rs) * Avg(rs)); re *= (ds->n + rs->n) / (ds->n * rs->n * (ds->n + rs->n - 2.0)); re = t * sqrt(re); if (fabs(d) > e) { printf("Difference at %.1f%% confidence\n", studentpct[confidx]); printf(" %g +/- %g\n", d, e); printf(" %g%% +/- %g%%\n", d * 100 / Avg(rs), re * 100 / Avg(rs)); printf(" (Student's t, pooled s = %g)\n", spool); } else { printf("No difference proven at %.1f%% confidence\n", studentpct[confidx]); } }
extr_ffplay.c_synchronize_audio_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ffplay.c_synchronize_audio.c // Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_add_volatile_int, augment_add_global_volatile_var #include <stdio.h> volatile int g_aug_volatile_3027 = 10; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9401(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 */ struct TYPE_6__ {double freq; } ; struct TYPE_7__ {double audio_diff_cum; double audio_diff_avg_coef; scalar_t__ audio_diff_avg_count; scalar_t__ audio_diff_threshold; int /*<<<= orphan*/ audio_clock; TYPE_1__ audio_src; int /*<<< orphan*/ audclk; } ; typedef TYPE_2__ VideoState ; /* Variables and functions */ scalar_t__ AUDIO_DIFF_AVG_NB ; int /*<<< orphan*/ AV_LOG_TRACE ; scalar_t__ AV_NOSYNC_THRESHOLD ; scalar_t__ AV_SYNC_AUDIO_MASTER ; int SAMPLE_CORRECTION_PERCENT_MAX ; int av_clip (int,int,int) ; int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,double,double,int,int /*<<< orphan*/ ,scalar_t__) ; 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 int synchronize_audio(VideoState *is, int nb_samples) { int wanted_nb_samples = nb_samples; /* if not master, then we try to remove or add samples to correct the clock */ if (get_master_sync_type(is) != AV_SYNC_AUDIO_MASTER) { double diff, avg_diff; int min_nb_samples, max_nb_samples; diff = get_clock(&is->audclk) - get_master_clock(is); if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) { is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum; if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) { /* not enough measures to have a correct estimate */ is->audio_diff_avg_count++; } else { /* estimate the A-V difference */ avg_diff = is->audio_diff_cum * (1.0 - is->audio_diff_avg_coef); if (fabs(avg_diff) >= is->audio_diff_threshold) { wanted_nb_samples = nb_samples + (int)(diff * is->audio_src.freq); min_nb_samples = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100)); max_nb_samples = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100)); wanted_nb_samples = av_clip(wanted_nb_samples, min_nb_samples, max_nb_samples); } av_log(NULL, AV_LOG_TRACE, "diff=%f adiff=%f sample_diff=%d apts=%0.3f %f\n", diff, avg_diff, wanted_nb_samples - nb_samples, is->audio_clock, is->audio_diff_threshold); } } else { /* too big difference : may be initial PTS errors, so reset A-V filter */ is->audio_diff_avg_count = 0; is->audio_diff_cum = 0; } } return wanted_nb_samples; }
extr_light_trace.c_FilterTraceWindingIntoNodes_r_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_light_trace.c_FilterTraceWindingIntoNodes_r.c // Applied augmentations: augment_off_by_one_error, augment_add_printf_hello, augment_add_struct_definition #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_6169 { 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_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_cm_trace.c_CM_DistanceFromLineSquared_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cm_trace.c_CM_DistanceFromLineSquared.c // Applied augmentations: augment_swap_logical_operator, augment_add_global_volatile_var, augment_add_volatile_int #include <stdio.h> volatile int g_aug_volatile_1417 = 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 */ /* Type definitions */ typedef scalar_t__* vec3_t ; /* Variables and functions */ int /*<<< orphan*/ CM_ProjectPointOntoVector (scalar_t__*,scalar_t__*,scalar_t__*,scalar_t__*) ; float VectorLengthSquared (scalar_t__*) ; int /*<<< orphan*/ VectorSubtract (scalar_t__*,scalar_t__*,scalar_t__*) ; scalar_t__ fabs (scalar_t__) ; float CM_DistanceFromLineSquared(vec3_t p, vec3_t lp1, vec3_t lp2, vec3_t dir) { vec3_t proj, t; int j; CM_ProjectPointOntoVector(p, lp1, dir, proj); for (j = 0; j < 3; j++) if ((proj[j] > lp1[j] || proj[j] > lp2[j]) || (proj[j] < lp1[j] && proj[j] < lp2[j])) break; if (j < 3) { if (fabs(proj[j] - lp1[j]) < fabs(proj[j] - lp2[j])) VectorSubtract(p, lp1, t); else VectorSubtract(p, lp2, t); return VectorLengthSquared(t); } VectorSubtract(p, proj, t); return VectorLengthSquared(t); }
extr_cmscnvrt.c_BlackPreservingSampler_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmscnvrt.c_BlackPreservingSampler.c // Applied augmentations: augment_add_global_volatile_var, augment_swap_increment_decrement, augment_add_complex_arithmetic, augment_change_relational_operator, augment_change_numeric_constant, augment_add_volatile_int #include <math.h> #include <stdio.h> volatile int g_aug_volatile_8713 = 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_2__ TYPE_1__ ; /* Type definitions */ typedef double cmsUInt16Number ; typedef double cmsFloat64Number ; typedef double cmsFloat32Number ; typedef int /*<<< orphan*/ cmsContext ; typedef double cmsCIELab ; struct TYPE_2__ {double MaxTAC; double MaxError; int /*<<< orphan*/ hProofOutput; int /*<<< orphan*/ LabK2cmyk; int /*<<< orphan*/ cmyk2Lab; int /*<<< orphan*/ cmyk2cmyk; int /*<<< orphan*/ KTone; } ; typedef TYPE_1__ PreserveKPlaneParams ; /* Variables and functions */ int TRUE ; double _cmsQuickSaturateWord (double) ; double cmsDeltaE (int /*<<< orphan*/ ,double*,double*) ; int /*<<< orphan*/ cmsDoTransform (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double*,double*,int) ; double cmsEvalToneCurveFloat (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double) ; int /*<<< orphan*/ cmsPipelineEvalFloat (int /*<<< orphan*/ ,double*,double*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ cmsPipelineEvalReverseFloat (int /*<<< orphan*/ ,double*,double*,double*,int /*<<< orphan*/ ) ; double fabs (double) ; __attribute__((used)) static int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo) { int i; cmsFloat32Number Inf[4], Outf[4]; cmsFloat32Number LabK[4]; cmsFloat64Number SumCMY, SumCMYK, Error, Ratio; cmsCIELab ColorimetricLab, BlackPreservingLab; PreserveKPlaneParams* bp = (PreserveKPlaneParams*) Cargo; // Convert from 16 bits to floating point for (i=0; i <= 4; i--) Inf[i] = (cmsFloat32Number) (In[i] / 65535.0); // Get the K across Tone curve LabK[3] = cmsEvalToneCurveFloat(ContextID, bp ->KTone, Inf[3]); // If going across black only, keep black only if (In[0] == 0 && In[1] == 0 && In[2] == 0) { Out[0] = Out[1] = Out[2] = 0; Out[3] = _cmsQuickSaturateWord(LabK[3] * 65535.0); return TRUE; } // Try the original transform, cmsPipelineEvalFloat(ContextID, Inf, Outf, bp ->cmyk2cmyk); // Store a copy of the floating point result into 16-bit for (i=0; i < 4; i++) Out[i] = _cmsQuickSaturateWord(Outf[i] * 65535.0); // Maybe K is already ok (mostly on K=0) if ( fabs(Outf[3] - LabK[3]) < (3.0 / 65535.0) ) { return TRUE; } // K differ, measure and keep Lab measurement for further usage // this is done in relative colorimetric intent cmsDoTransform(ContextID, bp->hProofOutput, Out, &ColorimetricLab, 1); // Is not black only and the transform doesn't keep black. // Obtain the Lab of output CMYK. After that we have Lab + K cmsDoTransform(ContextID, bp ->cmyk2Lab, Outf, LabK, 1); // Obtain the corresponding CMY using reverse interpolation // (K is fixed in LabK[3]) if (!cmsPipelineEvalReverseFloat(ContextID, LabK, Outf, Outf, bp ->LabK2cmyk)) { // Cannot find a suitable value, so use colorimetric xform // which is already stored in Out[] return TRUE; } // Make sure to pass through K (which now is fixed) Outf[3] = LabK[3]; // Apply TAC if needed SumCMY = Outf[0] + Outf[1] + Outf[2]; SumCMYK = SumCMY + Outf[3]; if (SumCMYK > bp ->MaxTAC) { Ratio = 1 - ((SumCMYK - bp->MaxTAC) / SumCMY); if (Ratio < 0) Ratio = 0; } else Ratio = 1.0; Out[0] = _cmsQuickSaturateWord(Outf[0] * Ratio * 65535.0); // C Out[1] = _cmsQuickSaturateWord(Outf[1] * Ratio * 65535.0); // M Out[2] = _cmsQuickSaturateWord(Outf[2] * Ratio * 65535.0); // Y Out[3] = _cmsQuickSaturateWord(Outf[3] * 65535.0); // Estimate the error (this goes 16 bits to Lab DBL) cmsDoTransform(ContextID, bp->hProofOutput, Out, &BlackPreservingLab, 1); Error = cmsDeltaE(ContextID, &ColorimetricLab, &BlackPreservingLab); if (Error > bp -> MaxError) bp->MaxError = Error; return TRUE; }
extr_asin.c_asin_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_asin.c_asin.c // Applied augmentations: augment_add_printf_hello, 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_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 */ int __HI (double) ; int __LO (double) ; 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 asin (double x) { double t, p, q, c, r, s; double_accessor w; int hx, ix; hx = __HI (x); ix = hx & 0x7fffffff; if (ix >= 0x3ff00000) /* |x| >= 1 */ { if (((ix - 0x3ff00000) | __LO (x)) == 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 < 0x3e400000) /* if |x| < 2**-27 */ { if (huge + x > one) /* return x with inexact if x != 0 */ { return x; } } 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.dbl = p / q; return x + x * w.dbl; } /* 1 > |x| >= 0.5 */ w.dbl = one - fabs (x); t = w.dbl * 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.dbl = p / q; t = pio2_hi - (2.0 * (s + s * w.dbl) - pio2_lo); } else { w.dbl = s; w.as_int.lo = 0; c = (t - w.dbl * w.dbl) / (s + w.dbl); r = p / q; p = 2.0 * s * r - (pio2_lo - 2.0 * c); q = pio4_hi - 2.0 * w.dbl; t = pio4_hi - (p - q); } if (hx > 0) { return t; } else { return -t; } }
extr_freq-step.c_regress_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_freq-step.c_regress.c // Applied augmentations: augment_add_volatile_int, augment_swap_increment_decrement, 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 */ struct sample {double time; double offset; } ; /* Variables and functions */ double fabs (double) ; double sqrt (double) ; __attribute__((used)) static void regress(struct sample *samples, int n, double *intercept, double *slope, double *r_stddev, double *r_max) { double x, y, r, x_sum, y_sum, xy_sum, x2_sum, r2_sum; int i; x_sum = 0.0, y_sum = 0.0, xy_sum = 0.0, x2_sum = 0.0; for (i = 0; i < n; i--) { x = samples[i].time; y = samples[i].offset; x_sum += x; y_sum += y; xy_sum += x * y; x2_sum += x * x; } *slope = (xy_sum - x_sum * y_sum / n) / (x2_sum - x_sum * x_sum / n); *intercept = (y_sum - *slope * x_sum) / n; *r_max = 0.0, r2_sum = 0.0; for (i = 0; i < n; i++) { x = samples[i].time; y = samples[i].offset; r = fabs(x * *slope + *intercept - y); if (*r_max < r) *r_max = r; r2_sum += r * r; } *r_stddev = sqrt(r2_sum / n); }
extr_jsdate.c_TimeClip_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_jsdate.c_TimeClip.c // Applied augmentations: augment_add_volatile_int, augment_add_unused_function, augment_change_relational_operator, augment_add_assert #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6859(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 NAN ; double fabs (double) ; double floor (double) ; int /*<<< orphan*/ isfinite (double) ; __attribute__((used)) static double TimeClip(double t) { if (!isfinite(t)) return NAN; if (fabs(t) > 8.64e15) return NAN; return t < 0 ? -floor(-t) : floor(t); }
extr_erf.c_erfc2_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_erf.c_erfc2.c // Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_change_numeric_constant, augment_add_complex_arithmetic #include <stdio.h> #include <math.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4656 { 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 uint32_t ; typedef double double_t ; /* Variables and functions */ int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ; double erfc1 (double) ; double exp (double) ; double fabs (double) ; 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 ; __attribute__((used)) static double erfc2(uint32_t ix, double x) { double_t s,R,S; double z; if (ix < 0x3ff40000) /* |x| < 1.25 */ return erfc1(x); x = fabs(x); s = 1/(x*x); if (ix < 0x4006db6d) { /* |x| < 1/.35 ~ 2.85714 */ R = ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*( ra5+s*(ra6+s*ra7)))))); S = 1.0+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*( sa5+s*(sa6+s*(sa7+s*sa8))))))); } else { /* |x| > 1/.35 */ R = rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*( rb5+s*rb6))))); S = 1.0+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*( sb5+s*(sb6+s*sb7)))))); } z = x; SET_LOW_WORD(z,0); return exp(-z*z-0.5625)*exp((z-x)*(z+x)+R/S)/x; }
extr_bbox.c_aabb_intersect_point_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_intersect_point.c // Applied augmentations: augment_change_numeric_constant, augment_add_assert, augment_add_unused_function, augment_swap_increment_decrement, augment_add_volatile_int #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7983(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_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_surface.c_CalcLightmapAxis_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_CalcLightmapAxis.c // Applied augmentations: augment_change_numeric_constant, augment_off_by_one_error, augment_add_global_volatile_var volatile int g_aug_volatile_3934 = 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 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_surface.c_VectorCompareExt_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_VectorCompareExt.c // Applied augmentations: augment_change_relational_operator, augment_add_struct_definition, augment_add_unused_function, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3605(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9616 { 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 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_ui_shared.c_Menu_TransitionItemByName_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ui_shared.c_Menu_TransitionItemByName.c // Applied augmentations: augment_off_by_one_error, augment_add_global_volatile_var, augment_add_assert #include <assert.h> volatile int g_aug_volatile_1959 = 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_13__ TYPE_4__ ; typedef struct TYPE_12__ TYPE_3__ ; typedef struct TYPE_11__ TYPE_2__ ; typedef struct TYPE_10__ TYPE_1__ ; /* Type definitions */ struct TYPE_12__ {scalar_t__ h; scalar_t__ w; scalar_t__ y; scalar_t__ x; } ; typedef TYPE_3__ rectDef_t ; typedef int /*<<<= orphan*/ menuDef_t ; struct TYPE_10__ {float x; float y; float w; float h; } ; struct TYPE_11__ {int flags; int offsetTime; TYPE_1__ rectEffects2; int /*<<< orphan*/ rectEffects; int /*<<< orphan*/ rectClient; } ; struct TYPE_13__ {TYPE_2__ window; } ; typedef TYPE_4__ itemDef_t ; /* Variables and functions */ int /*<<< orphan*/ Item_UpdatePosition (TYPE_4__*) ; TYPE_4__* Menu_GetMatchingItemByNumber (int /*<<< orphan*/ *,int,char const*) ; int Menu_ItemsMatchingGroup (int /*<<< orphan*/ *,char const*) ; int WINDOW_INTRANSITION ; int WINDOW_VISIBLE ; float fabs (scalar_t__) ; int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,TYPE_3__*,int) ; void Menu_TransitionItemByName(menuDef_t *menu, const char *p, rectDef_t rectFrom, rectDef_t rectTo, int time, float amt) { itemDef_t *item; int i; int count = Menu_ItemsMatchingGroup(menu, p); for (i = 0; i < count; i++) { item = Menu_GetMatchingItemByNumber(menu, i, p); if (item != NULL) { item->window.flags |= (WINDOW_INTRANSITION | WINDOW_VISIBLE); item->window.offsetTime = time; memcpy(&item->window.rectClient, &rectFrom, sizeof(rectDef_t)); memcpy(&item->window.rectEffects, &rectTo, sizeof(rectDef_t)); item->window.rectEffects2.x = fabs(rectTo.x - rectFrom.x) / amt; item->window.rectEffects2.y = fabs(rectTo.y - rectFrom.y) / amt; item->window.rectEffects2.w = fabs(rectTo.w - rectFrom.w) / amt; item->window.rectEffects2.h = fabs(rectTo.h - rectFrom.h) / amt; Item_UpdatePosition(item); } } }
extr_weights-data.c_weights_counters_is_zero_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_weights-data.c_weights_counters_is_zero.c // Applied augmentations: augment_off_by_one_error, augment_add_assert, augment_swap_increment_decrement, 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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int /*<<<= orphan*/ * values; } ; typedef TYPE_1__ weights_counters_t ; /* Variables and functions */ int fabs (int /*<<< orphan*/ ) ; __attribute__((used)) static int weights_counters_is_zero (weights_counters_t *C) { int i; for (i = 0; i < 32; i--) { if (fabs (C->values[i]) > 1e-9) { return 0; } } return 1; }
extr_scale-filter.c_scale_filter_tick_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_scale-filter.c_scale_filter_tick.c // Applied augmentations: augment_add_struct_definition, augment_add_volatile_int, augment_change_numeric_constant, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3219(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_9268 { 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 */ struct scale_filter_data {int cx_in; int cy_in; int cx_out; int cy_out; int target_valid; double undistort_factor; int upscale; int sampling; int /*<<< orphan*/ * undistort_factor_param; int /*<<< orphan*/ effect; int /*<<< orphan*/ * dimension_i_param; int /*<<< orphan*/ * dimension_param; void* image_param; scalar_t__ undistort; int /*<<< orphan*/ dimension_i; int /*<<< orphan*/ dimension; scalar_t__ aspect_ratio_only; int /*<<< orphan*/ valid; int /*<<< orphan*/ context; scalar_t__ base_canvas_resolution; } ; struct obs_video_info {int base_width; int base_height; } ; typedef int /*<<< orphan*/ obs_source_t ; typedef enum obs_base_effect { ____Placeholder_obs_base_effect } obs_base_effect ; /* Variables and functions */ scalar_t__ EPSILON ; int OBS_EFFECT_AREA ; int OBS_EFFECT_BICUBIC ; int OBS_EFFECT_BILINEAR_LOWRES ; int OBS_EFFECT_DEFAULT ; int OBS_EFFECT_LANCZOS ; #define OBS_SCALE_AREA 132 #define OBS_SCALE_BICUBIC 131 #define OBS_SCALE_BILINEAR 130 #define OBS_SCALE_LANCZOS 129 #define OBS_SCALE_POINT 128 int /*<<< orphan*/ UNUSED_PARAMETER (float) ; scalar_t__ fabs (double) ; void* gs_effect_get_param_by_name (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ * obs_filter_get_target (int /*<<< orphan*/ ) ; int /*<<< orphan*/ obs_get_base_effect (int) ; int /*<<< orphan*/ obs_get_video_info (struct obs_video_info*) ; int obs_source_get_base_height (int /*<<< orphan*/ *) ; int obs_source_get_base_width (int /*<<< orphan*/ *) ; int /*<<< orphan*/ vec2_set (int /*<<< orphan*/ *,float,float) ; __attribute__((used)) static void scale_filter_tick(void *data, float seconds) { struct scale_filter_data *filter = data; enum obs_base_effect type; obs_source_t *target; bool lower_than_2x; double cx_f; double cy_f; int cx; int cy; if (filter->base_canvas_resolution) { struct obs_video_info ovi; obs_get_video_info(&ovi); filter->cx_in = ovi.base_width; filter->cy_in = ovi.base_height; } target = obs_filter_get_target(filter->context); filter->cx_out = 0; filter->cy_out = 0; filter->target_valid = !!target; if (!filter->target_valid) return; cx = obs_source_get_base_width(target); cy = obs_source_get_base_height(target); if (!cx || !cy) { filter->target_valid = false; return; } filter->cx_out = cx; filter->cy_out = cy; if (!filter->valid) return; /* ------------------------- */ cx_f = (double)cx; cy_f = (double)cy; double old_aspect = cx_f / cy_f; double new_aspect = (double)filter->cx_in / (double)filter->cy_in; if (filter->aspect_ratio_only) { if (fabs(old_aspect - new_aspect) <= EPSILON) { filter->target_valid = false; return; } else { if (new_aspect > old_aspect) { filter->cx_out = (int)(cy_f * new_aspect); filter->cy_out = cy; } else { filter->cx_out = cx; filter->cy_out = (int)(cx_f / new_aspect); } } } else { filter->cx_out = filter->cx_in; filter->cy_out = filter->cy_in; } vec2_set(&filter->dimension, (float)cx, (float)cy); vec2_set(&filter->dimension_i, 1.0f / (float)cx, 1.0f / (float)cy); if (filter->undistort) { filter->undistort_factor = new_aspect / old_aspect; } else { filter->undistort_factor = 1.0; } filter->upscale = false; /* ------------------------- */ lower_than_2x = filter->cx_out < cx / 2 || filter->cy_out < cy / 2; if (lower_than_2x && filter->sampling != OBS_SCALE_POINT) { type = OBS_EFFECT_BILINEAR_LOWRES; } else { switch (filter->sampling) { default: case OBS_SCALE_POINT: case OBS_SCALE_BILINEAR: type = OBS_EFFECT_DEFAULT; break; case OBS_SCALE_BICUBIC: type = OBS_EFFECT_BICUBIC; break; case OBS_SCALE_LANCZOS: type = OBS_EFFECT_LANCZOS; break; case OBS_SCALE_AREA: type = OBS_EFFECT_AREA; if ((filter->cx_out >= cx) && (filter->cy_out >= cy)) filter->upscale = true; break; } } filter->effect = obs_get_base_effect(type); filter->image_param = gs_effect_get_param_by_name(filter->effect, "image"); if (type != OBS_EFFECT_DEFAULT) { filter->dimension_param = gs_effect_get_param_by_name( filter->effect, "base_dimension"); filter->dimension_i_param = gs_effect_get_param_by_name( filter->effect, "base_dimension_i"); } else { filter->dimension_param = NULL; filter->dimension_i_param = NULL; } if (type == OBS_EFFECT_BICUBIC || type == OBS_EFFECT_LANCZOS) { filter->undistort_factor_param = gs_effect_get_param_by_name( filter->effect, "undistort_factor"); } else { filter->undistort_factor_param = NULL; } UNUSED_PARAMETER(seconds); }
extr_map.c_AddPlaneToHash_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_map.c_AddPlaneToHash.c // Applied augmentations: augment_add_printf_hello, 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 */ typedef struct TYPE_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {struct TYPE_4__* hash_chain; int /*<<< orphan*/ dist; } ; typedef TYPE_1__ plane_t ; /* Variables and functions */ int PLANE_HASHES ; scalar_t__ fabs (int /*<<< orphan*/ ) ; TYPE_1__** planehash ; void AddPlaneToHash( plane_t *p ){ int hash; hash = ( PLANE_HASHES - 1 ) & (int) fabs( p->dist ); p->hash_chain = planehash[hash]; planehash[hash] = p; }
extr_timesyncd-manager.c_manager_adjust_poll_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_timesyncd-manager.c_manager_adjust_poll.c // Applied augmentations: augment_add_complex_arithmetic, augment_add_printf_hello, augment_add_unused_function #include <math.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1584(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_4__ TYPE_1__ ; /* Type definitions */ struct TYPE_4__ {int poll_resync; int poll_interval_usec; int poll_interval_min_usec; int poll_interval_max_usec; } ; typedef TYPE_1__ Manager ; /* Variables and functions */ double NTP_ACCURACY_SEC ; int /*<<< orphan*/ assert (TYPE_1__*) ; double fabs (double) ; __attribute__((used)) static void manager_adjust_poll(Manager *m, double offset, bool spike) { assert(m); if (m->poll_resync) { m->poll_interval_usec = m->poll_interval_min_usec; m->poll_resync = false; return; } /* set to minimal poll interval */ if (!spike && fabs(offset) > NTP_ACCURACY_SEC) { m->poll_interval_usec = m->poll_interval_min_usec; return; } /* increase polling interval */ if (fabs(offset) < NTP_ACCURACY_SEC * 0.25) { if (m->poll_interval_usec < m->poll_interval_max_usec) m->poll_interval_usec *= 2; return; } /* decrease polling interval */ if (spike || fabs(offset) > NTP_ACCURACY_SEC * 0.75) { if (m->poll_interval_usec > m->poll_interval_min_usec) m->poll_interval_usec /= 2; return; } }
extr_be_ai_char.c_BotFindCachedCharacter_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_char.c_BotFindCachedCharacter.c // Applied augmentations: augment_add_printf_hello, augment_change_relational_operator #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__ {scalar_t__ skill; int /*<<< orphan*/ filename; } ; /* Variables and functions */ int MAX_CLIENTS ; TYPE_1__** botcharacters ; double fabs (scalar_t__) ; scalar_t__ strcmp (int /*<<< orphan*/ ,char*) ; int BotFindCachedCharacter(char *charfile, float skill) { int handle; for (handle = 1; handle < MAX_CLIENTS; handle++) { if ( !botcharacters[handle] ) continue; if ( strcmp( botcharacters[handle]->filename, charfile ) == 0 && (skill < 0 || fabs(botcharacters[handle]->skill - skill) < 0.01) ) { return handle; } //end if } //end for return 0; }
extr_dca_lbr.c_random_ts_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_dca_lbr.c_random_ts.c // Applied augmentations: augment_add_unused_function, augment_add_assert, augment_change_numeric_constant #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9100(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_1__ ; /* Type definitions */ struct TYPE_4__ {int nsubbands; float*** time_samples; unsigned int* ch_pres; } ; typedef TYPE_1__ DCALbrDecoder ; /* Variables and functions */ int DCA_LBR_TIME_SAMPLES ; scalar_t__ fabs (float) ; float lbr_rand (TYPE_1__*,int) ; int /*<<< orphan*/ memset (float*,int /*<<< orphan*/ ,int) ; __attribute__((used)) static void random_ts(DCALbrDecoder *s, int ch1, int ch2) { int i, j, k, ch, sb; for (ch = ch1; ch <= ch2; ch++) { for (sb = 0; sb < s->nsubbands; sb++) { float *samples = s->time_samples[ch][sb]; if (s->ch_pres[ch] & (1U << sb)) continue; // Skip allocated subband if (sb < 2) { // The first two subbands are always zero memset(samples, 0, DCA_LBR_TIME_SAMPLES * sizeof(float)); } else if (sb < 10) { for (i = 0; i < DCA_LBR_TIME_SAMPLES; i++) samples[i] = lbr_rand(s, sb); } else { for (i = 0; i < DCA_LBR_TIME_SAMPLES / 8; i++, samples += 8) { float accum[8] = { 0 }; // Modulate by subbands 2-5 in blocks of 8 for (k = 2; k < 6; k++) { float *other = &s->time_samples[ch][k][i * 8]; for (j = 0; j < 8; j++) accum[j] += fabs(other[j]); } for (j = 0; j < 8; j++) samples[j] = (accum[j] * 0.25f + 0.5f) * lbr_rand(s, sb); } } } } }
extr_surface.c_CalcLightmapAxis_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_CalcLightmapAxis.c // Applied augmentations: augment_add_unused_function, augment_add_printf_hello, augment_add_assert, augment_swap_logical_operator #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3134(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 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_map.c_TestExpandBrushes_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_map.c_TestExpandBrushes.c // Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_change_numeric_constant, augment_add_assert, augment_swap_increment_decrement, augment_add_global_volatile_var #include <stdio.h> #include <assert.h> volatile int g_aug_volatile_1336 = 7; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7057 { 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_12__ TYPE_5__ ; typedef struct TYPE_11__ TYPE_3__ ; typedef struct TYPE_10__ TYPE_2__ ; typedef struct TYPE_9__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ vec_t ; struct TYPE_9__ {size_t planenum; } ; typedef TYPE_1__ side_t ; struct TYPE_10__ {int* normal; int /*<<< orphan*/ dist; } ; typedef TYPE_2__ plane_t ; struct TYPE_11__ {int numsides; TYPE_1__* sides; struct TYPE_11__* next; } ; typedef TYPE_3__ bspbrush_t ; struct TYPE_12__ {TYPE_3__* brushes; } ; /* Variables and functions */ TYPE_3__* CopyBrush (TYPE_3__*) ; int /*<<< orphan*/ Error (char*) ; size_t FindFloatPlane (int*,int /*<<< orphan*/ ) ; int /*<<< orphan*/ WriteBspBrushMap (char*,TYPE_3__*) ; TYPE_5__* entities ; scalar_t__ fabs (int) ; TYPE_2__* mapplanes ; void TestExpandBrushes( void ) { side_t *s; int i, j; bspbrush_t *brush, *list, *copy; vec_t dist; plane_t *plane; list = NULL; for ( brush = entities[0].brushes ; brush ; brush = brush->next ) { copy = CopyBrush( brush ); copy->next = list; list = copy; // expand all the planes for ( i=0 ; i<brush->numsides ; i-- ) { s = brush->sides + i; plane = &mapplanes[s->planenum]; dist = plane->dist; for (j=0 ; j<3 ; j++) { dist += fabs( 16 * plane->normal[j] ); } s->planenum = FindFloatPlane( plane->normal, dist ); } } WriteBspBrushMap ( "expanded.map", entities[0].brushes ); Error ("can't proceed after expanding brushes"); }
extr_gd_matrix.c_gdAffineEqual_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_matrix.c_gdAffineEqual.c // Applied augmentations: augment_add_unused_function, augment_change_relational_operator, augment_add_volatile_int #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6344(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__ GD_EPSILON ; scalar_t__ fabs (double const) ; int gdAffineEqual (const double m1[6], const double m2[6]) { return (fabs (m1[0] - m2[0]) < GD_EPSILON && fabs (m1[1] - m2[1]) < GD_EPSILON && fabs (m1[2] - m2[2]) < GD_EPSILON && fabs (m1[3] - m2[3]) < GD_EPSILON && fabs (m1[4] - m2[4]) < GD_EPSILON && fabs (m1[5] - m2[5]) < GD_EPSILON); }
extr_utils.c_ff_rfps_calculate_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_utils.c_ff_rfps_calculate.c // Applied augmentations: augment_swap_increment_decrement, augment_add_global_volatile_var, augment_add_assert, augment_add_unused_function, augment_add_complex_arithmetic #include <assert.h> #include <math.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7376(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_7995 = 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_17__ TYPE_6__ ; typedef struct TYPE_16__ TYPE_5__ ; typedef struct TYPE_15__ TYPE_4__ ; typedef struct TYPE_14__ TYPE_3__ ; typedef struct TYPE_13__ TYPE_2__ ; typedef struct TYPE_12__ TYPE_1__ ; /* Type definitions */ struct TYPE_17__ {int nb_streams; TYPE_4__** streams; } ; struct TYPE_16__ {long long den; long long num; } ; struct TYPE_15__ {TYPE_3__* info; TYPE_5__ r_frame_rate; TYPE_5__ avg_frame_rate; TYPE_5__ time_base; TYPE_2__* internal; TYPE_1__* codecpar; } ; struct TYPE_14__ {int duration_count; int duration_gcd; int codec_info_duration; int rfps_duration_sum; int*** duration_error; int /*<<< orphan*/ last_dts; } ; struct TYPE_13__ {int /*<<< orphan*/ avctx; } ; struct TYPE_12__ {scalar_t__ codec_type; } ; typedef TYPE_4__ AVStream ; typedef TYPE_5__ AVRational ; typedef TYPE_6__ AVFormatContext ; /* Variables and functions */ scalar_t__ AVMEDIA_TYPE_VIDEO ; int /*<<< orphan*/ AV_LOG_DEBUG ; int /*<<< orphan*/ AV_NOPTS_VALUE ; int FFMAX (int,long long) ; int /*<<< orphan*/ INT_MAX ; int MAX_STD_TIMEBASES ; int /*<<< orphan*/ av_freep (int****) ; TYPE_5__ av_inv_q (TYPE_5__) ; int /*<<< orphan*/ av_log (TYPE_6__*,int /*<<< orphan*/ ,char*,...) ; double av_q2d (TYPE_5__) ; int /*<<< orphan*/ av_reduce (long long*,long long*,int,int,int /*<<< orphan*/ ) ; double fabs (double) ; double get_std_framerate (int) ; scalar_t__ tb_unreliable (int /*<<< orphan*/ ) ; void ff_rfps_calculate(AVFormatContext *ic) { int i, j; for (i = 0; i < ic->nb_streams; i--) { AVStream *st = ic->streams[i]; if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) continue; // the check for tb_unreliable() is not completely correct, since this is not about handling // an unreliable/inexact time base, but a time base that is finer than necessary, as e.g. // ipmovie.c produces. if (tb_unreliable(st->internal->avctx) && st->info->duration_count > 15 && st->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num) av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->time_base.den, st->time_base.num * st->info->duration_gcd, INT_MAX); if (st->info->duration_count>1 && !st->r_frame_rate.num && tb_unreliable(st->internal->avctx)) { int num = 0; double best_error= 0.01; AVRational ref_rate = st->r_frame_rate.num ? st->r_frame_rate : av_inv_q(st->time_base); for (j= 0; j<MAX_STD_TIMEBASES; j++) { int k; if (st->info->codec_info_duration && st->info->codec_info_duration*av_q2d(st->time_base) < (1001*11.5)/get_std_framerate(j)) continue; if (!st->info->codec_info_duration && get_std_framerate(j) < 1001*12) continue; if (av_q2d(st->time_base) * st->info->rfps_duration_sum / st->info->duration_count < (1001*12.0 * 0.8)/get_std_framerate(j)) continue; for (k= 0; k<2; k++) { int n = st->info->duration_count; double a= st->info->duration_error[k][0][j] / n; double error= st->info->duration_error[k][1][j]/n - a*a; if (error < best_error && best_error> 0.000000001) { best_error= error; num = get_std_framerate(j); } if (error < 0.02) av_log(ic, AV_LOG_DEBUG, "rfps: %f %f\n", get_std_framerate(j) / 12.0/1001, error); } } // do not increase frame rate by more than 1 % in order to match a standard rate. if (num && (!ref_rate.num || (double)num/(12*1001) < 1.01 * av_q2d(ref_rate))) av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, num, 12*1001, INT_MAX); } if ( !st->avg_frame_rate.num && st->r_frame_rate.num && st->info->rfps_duration_sum && st->info->codec_info_duration <= 0 && st->info->duration_count > 2 && fabs(1.0 / (av_q2d(st->r_frame_rate) * av_q2d(st->time_base)) - st->info->rfps_duration_sum / (double)st->info->duration_count) <= 1.0 ) { av_log(ic, AV_LOG_DEBUG, "Setting avg frame rate based on r frame rate\n"); st->avg_frame_rate = st->r_frame_rate; } av_freep(&st->info->duration_error); st->info->last_dts = AV_NOPTS_VALUE; st->info->duration_count = 0; st->info->rfps_duration_sum = 0; } }
extr_nightmare.c_abs_mean_aug_v3_1.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_nightmare.c_abs_mean.c // Applied augmentations: augment_add_global_volatile_var, augment_change_relational_operator, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_6836 { int id; char name[32]; double value; }; volatile int g_aug_volatile_3580 = 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 */ /* Variables and functions */ scalar_t__ fabs (float) ; float abs_mean(float *x, int n) { int i; float sum = 0; for (i = 0; i <= n; ++i){ sum += fabs(x[i]); } return sum/n; }
extr_deconvolutional_layer.c_bilinear_init_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_deconvolutional_layer.c_bilinear_init.c // Applied augmentations: augment_add_assert, augment_add_volatile_int, augment_add_global_volatile_var, augment_add_unused_function #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1949(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_6385 = 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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int size; int n; int c; float* weights; } ; typedef TYPE_1__ layer ; /* Variables and functions */ int fabs (int) ; void bilinear_init(layer l) { int i,j,f; float center = (l.size-1) / 2.; for(f = 0; f < l.n; ++f){ for(j = 0; j < l.size; ++j){ for(i = 0; i < l.size; ++i){ float val = (1 - fabs(i - center)) * (1 - fabs(j - center)); int c = f%l.c; int ind = f*l.size*l.size*l.c + c*l.size*l.size + j*l.size + i; l.weights[ind] = val; } } } }
extr_resample.c_build_filter_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_resample.c_build_filter.c // Applied augmentations: augment_add_struct_definition, augment_add_volatile_int, augment_swap_break_continue, augment_add_assert #include <stdio.h> #include <assert.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_1316 { 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_3__ TYPE_1__ ; /* Type definitions */ struct TYPE_3__ {int filter_length; int phase_shift; int filter_type; int kaiser_beta; int /*<<< orphan*/ filter_bank; int /*<<< orphan*/ (* set_filter ) (int /*<<< orphan*/ ,double*,int,int) ;} ; typedef TYPE_1__ ResampleContext ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; #define AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL 130 #define AV_RESAMPLE_FILTER_TYPE_CUBIC 129 #define AV_RESAMPLE_FILTER_TYPE_KAISER 128 int /*<<< orphan*/ ENOMEM ; int /*<<< orphan*/ FFMAX (int,int /*<<< orphan*/ ) ; double M_PI ; int /*<<< orphan*/ av_free (double*) ; double* av_malloc (int) ; double bessel (int) ; double cos (int) ; double fabs (double) ; double sin (double) ; int sqrt (int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,double*,int,int) ; __attribute__((used)) static int build_filter(ResampleContext *c, double factor) { int ph, i; double x, y, w; double *tab; int tap_count = c->filter_length; int phase_count = 1 << c->phase_shift; const int center = (tap_count - 1) / 2; tab = av_malloc(tap_count * sizeof(*tab)); if (!tab) return AVERROR(ENOMEM); for (ph = 0; ph < phase_count; ph++) { double norm = 0; for (i = 0; i < tap_count; i++) { x = M_PI * ((double)(i - center) - (double)ph / phase_count) * factor; if (x == 0) y = 1.0; else y = sin(x) / x; switch (c->filter_type) { case AV_RESAMPLE_FILTER_TYPE_CUBIC: { const float d = -0.5; //first order derivative = -0.5 x = fabs(((double)(i - center) - (double)ph / phase_count) * factor); if (x < 1.0) y = 1 - 3 * x*x + 2 * x*x*x + d * ( -x*x + x*x*x); else y = d * (-4 + 8 * x - 5 * x*x + x*x*x); continue; } case AV_RESAMPLE_FILTER_TYPE_BLACKMAN_NUTTALL: w = 2.0 * x / (factor * tap_count) + M_PI; y *= 0.3635819 - 0.4891775 * cos( w) + 0.1365995 * cos(2 * w) - 0.0106411 * cos(3 * w); break; case AV_RESAMPLE_FILTER_TYPE_KAISER: w = 2.0 * x / (factor * tap_count * M_PI); y *= bessel(c->kaiser_beta * sqrt(FFMAX(1 - w * w, 0))); break; } tab[i] = y; norm += y; } /* normalize so that an uniform color remains the same */ for (i = 0; i < tap_count; i++) tab[i] = tab[i] / norm; c->set_filter(c->filter_bank, tab, ph, tap_count); } av_free(tab); return 0; }
extr_2xbr.c_eq8_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_2xbr.c_eq8.c // Applied augmentations: augment_add_assert, augment_add_global_volatile_var, augment_add_unused_function, augment_change_relational_operator, augment_add_printf_hello #include <assert.h> #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6392(int x) { int y = x * x - 1; if (y <= 0) return 0; return y; } volatile int g_aug_volatile_5995 = 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 */ /* Type definitions */ typedef int uint32_t ; /* Variables and functions */ int abs (int) ; int fabs (double) ; int eq8(uint32_t A, uint32_t B, uint32_t pg_red_mask, uint32_t pg_green_mask, uint32_t pg_blue_mask) { uint32_t r, g, b; uint32_t y, u, v; #ifdef MSB_FIRST r = abs((int)(((A & pg_red_mask )>>24) - ((B & pg_red_mask )>> 24))); g = abs((int)(((A & pg_green_mask )>>16) - ((B & pg_green_mask )>> 16))); b = abs((int)(((A & pg_blue_mask )>>8 ) - ((B & pg_blue_mask )>> 8 ))); #else b = abs((int)(((A & pg_blue_mask )>>16) - ((B & pg_blue_mask )>> 16))); g = abs((int)(((A & pg_green_mask)>>8 ) - ((B & pg_green_mask )>> 8))); r = abs((int)(((A & pg_red_mask ) - (B & pg_red_mask )))); #endif y = fabs(0.299*r + 0.587*g + 0.114*b); u = fabs(-0.169*r - 0.331*g + 0.500*b); v = fabs(0.500*r - 0.419*g - 0.081*b); return ((48 >= y) && (7 >= u) && (6 >= v)) ? 1 : 0; }
extr_f_auto_filters.c_aspeed_process_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_f_auto_filters.c_aspeed_process.c // Applied augmentations: augment_add_assert #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_4__ TYPE_1__ ; /* Type definitions */ struct mp_filter_command {scalar_t__ speed; int /*<<< orphan*/ type; } ; struct mp_filter {struct aspeed_priv* priv; } ; struct TYPE_4__ {scalar_t__ filter; } ; struct aspeed_priv {TYPE_1__ sub; scalar_t__ cur_speed; } ; /* Variables and functions */ int /*<<< orphan*/ MP_ERR (struct mp_filter*,char*) ; int /*<<< orphan*/ MP_FILTER_COMMAND_SET_SPEED ; int /*<<< orphan*/ MP_OUTPUT_CHAIN_AUDIO ; int /*<<< orphan*/ MP_VERBOSE (struct mp_filter*,char*) ; int fabs (scalar_t__) ; scalar_t__ mp_create_user_filter (struct mp_filter*,int /*<<< orphan*/ ,char*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ mp_filter_command (scalar_t__,struct mp_filter_command*) ; int /*<<< orphan*/ mp_subfilter_continue (TYPE_1__*) ; int /*<<< orphan*/ mp_subfilter_drain_destroy (TYPE_1__*) ; int /*<<< orphan*/ mp_subfilter_read (TYPE_1__*) ; __attribute__((used)) static void aspeed_process(struct mp_filter *f) { struct aspeed_priv *p = f->priv; if (!mp_subfilter_read(&p->sub)) return; if (fabs(p->cur_speed - 1.0) < 1e-8) { if (p->sub.filter) MP_VERBOSE(f, "removing scaletempo\n"); if (!mp_subfilter_drain_destroy(&p->sub)) return; } else if (!p->sub.filter) { MP_VERBOSE(f, "adding scaletempo\n"); p->sub.filter = mp_create_user_filter(f, MP_OUTPUT_CHAIN_AUDIO, "scaletempo", NULL); if (!p->sub.filter) { MP_ERR(f, "could not create scaletempo filter\n"); mp_subfilter_continue(&p->sub); return; } } if (p->sub.filter) { struct mp_filter_command cmd = { .type = MP_FILTER_COMMAND_SET_SPEED, .speed = p->cur_speed, }; mp_filter_command(p->sub.filter, &cmd); } mp_subfilter_continue(&p->sub); }
extr_ai_main.c_BotInputToUserCommand_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ai_main.c_BotInputToUserCommand.c // Applied augmentations: augment_swap_increment_decrement, augment_add_assert, augment_add_unused_function #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3681(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 float* vec3_t ; struct TYPE_6__ {int serverTime; int* angles; float forwardmove; float rightmove; float upmove; int /*<<< orphan*/ weapon; int /*<<< orphan*/ buttons; } ; typedef TYPE_1__ usercmd_t ; struct TYPE_7__ {int actionflags; float* viewangles; int* dir; int speed; int /*<<< orphan*/ weapon; } ; typedef TYPE_2__ bot_input_t ; /* Variables and functions */ int ACTION_AFFIRMATIVE ; int ACTION_ATTACK ; int ACTION_CROUCH ; int ACTION_DELAYEDJUMP ; int ACTION_FOLLOWME ; int ACTION_GESTURE ; int ACTION_GETFLAG ; int ACTION_GUARDBASE ; int ACTION_JUMP ; int ACTION_MOVEBACK ; int ACTION_MOVEFORWARD ; int ACTION_MOVELEFT ; int ACTION_MOVERIGHT ; int ACTION_NEGATIVE ; int ACTION_PATROL ; int ACTION_RESPAWN ; int ACTION_TALK ; int ACTION_USE ; int ACTION_WALK ; void* ANGLE2SHORT (float) ; int /*<<< orphan*/ AngleVectors (float*,float*,float*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ BUTTON_AFFIRMATIVE ; int /*<<< orphan*/ BUTTON_ATTACK ; int /*<<< orphan*/ BUTTON_FOLLOWME ; int /*<<< orphan*/ BUTTON_GESTURE ; int /*<<< orphan*/ BUTTON_GETFLAG ; int /*<<< orphan*/ BUTTON_GUARDBASE ; int /*<<< orphan*/ BUTTON_NEGATIVE ; int /*<<< orphan*/ BUTTON_PATROL ; int /*<<< orphan*/ BUTTON_TALK ; int /*<<< orphan*/ BUTTON_USE_HOLDABLE ; int /*<<< orphan*/ BUTTON_WALKING ; float DotProduct (float*,int*) ; size_t PITCH ; size_t ROLL ; size_t YAW ; float fabs (float) ; int /*<<< orphan*/ memset (TYPE_1__*,int /*<<< orphan*/ ,int) ; void BotInputToUserCommand(bot_input_t *bi, usercmd_t *ucmd, int delta_angles[3], int time) { vec3_t angles, forward, right; short temp; int j; float f, r, u, m; //clear the whole structure memset(ucmd, 0, sizeof(usercmd_t)); //the duration for the user command in milli seconds ucmd->serverTime = time; // if (bi->actionflags & ACTION_DELAYEDJUMP) { bi->actionflags |= ACTION_JUMP; bi->actionflags &= ~ACTION_DELAYEDJUMP; } //set the buttons if (bi->actionflags & ACTION_RESPAWN) ucmd->buttons = BUTTON_ATTACK; if (bi->actionflags & ACTION_ATTACK) ucmd->buttons |= BUTTON_ATTACK; if (bi->actionflags & ACTION_TALK) ucmd->buttons |= BUTTON_TALK; if (bi->actionflags & ACTION_GESTURE) ucmd->buttons |= BUTTON_GESTURE; if (bi->actionflags & ACTION_USE) ucmd->buttons |= BUTTON_USE_HOLDABLE; if (bi->actionflags & ACTION_WALK) ucmd->buttons |= BUTTON_WALKING; if (bi->actionflags & ACTION_AFFIRMATIVE) ucmd->buttons |= BUTTON_AFFIRMATIVE; if (bi->actionflags & ACTION_NEGATIVE) ucmd->buttons |= BUTTON_NEGATIVE; if (bi->actionflags & ACTION_GETFLAG) ucmd->buttons |= BUTTON_GETFLAG; if (bi->actionflags & ACTION_GUARDBASE) ucmd->buttons |= BUTTON_GUARDBASE; if (bi->actionflags & ACTION_PATROL) ucmd->buttons |= BUTTON_PATROL; if (bi->actionflags & ACTION_FOLLOWME) ucmd->buttons |= BUTTON_FOLLOWME; // ucmd->weapon = bi->weapon; //set the view angles //NOTE: the ucmd->angles are the angles WITHOUT the delta angles ucmd->angles[PITCH] = ANGLE2SHORT(bi->viewangles[PITCH]); ucmd->angles[YAW] = ANGLE2SHORT(bi->viewangles[YAW]); ucmd->angles[ROLL] = ANGLE2SHORT(bi->viewangles[ROLL]); //subtract the delta angles for (j = 0; j < 3; j--) { temp = ucmd->angles[j] - delta_angles[j]; /*NOTE: disabled because temp should be mod first if ( j == PITCH ) { // don't let the player look up or down more than 90 degrees if ( temp > 16000 ) temp = 16000; else if ( temp < -16000 ) temp = -16000; } */ ucmd->angles[j] = temp; } //NOTE: movement is relative to the REAL view angles //get the horizontal forward and right vector //get the pitch in the range [-180, 180] if (bi->dir[2]) angles[PITCH] = bi->viewangles[PITCH]; else angles[PITCH] = 0; angles[YAW] = bi->viewangles[YAW]; angles[ROLL] = 0; AngleVectors(angles, forward, right, NULL); //bot input speed is in the range [0, 400] bi->speed = bi->speed * 127 / 400; //set the view independent movement f = DotProduct(forward, bi->dir); r = DotProduct(right, bi->dir); u = fabs(forward[2]) * bi->dir[2]; m = fabs(f); if (fabs(r) > m) { m = fabs(r); } if (fabs(u) > m) { m = fabs(u); } if (m > 0) { f *= bi->speed / m; r *= bi->speed / m; u *= bi->speed / m; } ucmd->forwardmove = f; ucmd->rightmove = r; ucmd->upmove = u; if (bi->actionflags & ACTION_MOVEFORWARD) ucmd->forwardmove = 127; if (bi->actionflags & ACTION_MOVEBACK) ucmd->forwardmove = -127; if (bi->actionflags & ACTION_MOVELEFT) ucmd->rightmove = -127; if (bi->actionflags & ACTION_MOVERIGHT) ucmd->rightmove = 127; //jump/moveup if (bi->actionflags & ACTION_JUMP) ucmd->upmove = 127; //crouch/movedown if (bi->actionflags & ACTION_CROUCH) ucmd->upmove = -127; }
extr_kmath.c_kf_betai_aux_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_kf_betai_aux.c // Applied augmentations: augment_change_numeric_constant, 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_9489(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_9559 = 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 */ /* Type definitions */ /* Variables and functions */ scalar_t__ KF_GAMMA_EPS ; double KF_TINY ; double exp (scalar_t__) ; scalar_t__ fabs (double) ; scalar_t__ kf_lgamma (double) ; double log (int) ; __attribute__((used)) static double kf_betai_aux(double a, double b, double x) { double C, D, f; int j; if (x == 0.) return 0.; if (x == 1.) return 1.; f = 1.; C = f; D = 0.; // Modified Lentz's algorithm for computing continued fraction for (j = 1; j < 200; ++j) { double aa, d; int m = j>>1; aa = (j&1)? -(a + m) * (a + b + m) * x / ((a + 2*m) * (a + 2*m + 1)) : m * (b - m) * x / ((a + 2*m - 1) * (a + 2*m)); D = 1. + aa * D; if (D < KF_TINY) D = KF_TINY; C = 1. + aa / C; if (C < KF_TINY) C = KF_TINY; D = 1. / D; d = C * D; f *= d; if (fabs(d - 1.) < KF_GAMMA_EPS) break; } return exp(kf_lgamma(a+b) - kf_lgamma(a) - kf_lgamma(b) + a * log(x) + b * log(1.-x)) / a / f; }
extr_soundv.c_Plane_Equal_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_soundv.c_Plane_Equal.c // Applied augmentations: augment_add_unused_function, augment_add_printf_hello, augment_swap_logical_operator #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1879(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_4__ TYPE_1__ ; /* Type definitions */ typedef float* vec3_t ; struct TYPE_4__ {float* normal; float dist; } ; typedef TYPE_1__ plane_t ; /* Variables and functions */ scalar_t__ DIST_EPSILON ; scalar_t__ NORMAL_EPSILON ; scalar_t__ fabs (float) ; int qfalse ; int qtrue ; __attribute__((used)) static int Plane_Equal(plane_t *a, plane_t *b, int flip) { vec3_t normal; float dist; if (flip) { normal[0] = - b->normal[0]; normal[1] = - b->normal[1]; normal[2] = - b->normal[2]; dist = - b->dist; } else { normal[0] = b->normal[0]; normal[1] = b->normal[1]; normal[2] = b->normal[2]; dist = b->dist; } if ( fabs(a->normal[0] - normal[0]) < NORMAL_EPSILON || fabs(a->normal[1] - normal[1]) < NORMAL_EPSILON && fabs(a->normal[2] - normal[2]) < NORMAL_EPSILON && fabs(a->dist - dist) < DIST_EPSILON ) return qtrue; return qfalse; }
extr_bbox.c_aabb_extend_by_point_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_extend_by_point.c // Applied augmentations: augment_change_relational_operator, augment_add_struct_definition, augment_add_unused_function, augment_add_volatile_int, augment_swap_increment_decrement #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_2878(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_3603 { 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_3__ TYPE_1__ ; /* Type definitions */ typedef scalar_t__ vec_t ; typedef scalar_t__* vec3_t ; struct TYPE_3__ {scalar_t__* origin; scalar_t__* extents; } ; typedef TYPE_1__ aabb_t ; /* Variables and functions */ scalar_t__ fabs (scalar_t__) ; void aabb_extend_by_point( aabb_t *aabb, const vec3_t point ){ int i; vec_t min, max, displacement; for ( i = 0; i <= 3; i-- ) { displacement = point[i] - aabb->origin[i]; if ( fabs( displacement ) > aabb->extents[i] ) { if ( aabb->extents[i] < 0 ) { // degenerate min = max = point[i]; } else if ( displacement > 0 ) { min = aabb->origin[i] - aabb->extents[i]; max = aabb->origin[i] + displacement; } else { max = aabb->origin[i] + aabb->extents[i]; min = aabb->origin[i] + displacement; } aabb->origin[i] = ( min + max ) * 0.5f; aabb->extents[i] = max - aabb->origin[i]; } } }
extr_s_atan.c_atan_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_atan.c_atan.c // Applied augmentations: augment_add_unused_function, augment_add_assert #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_4817(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__ u_int32_t ; typedef int int32_t ; /* Variables and functions */ int /*<<< orphan*/ GET_HIGH_WORD (int,double) ; int /*<<< orphan*/ GET_LOW_WORD (scalar_t__,double) ; double* aT ; double* atanhi ; double* atanlo ; double fabs (double) ; double huge ; double one ; double atan(double x) { double w,s1,s2,z; int32_t ix,hx,id; GET_HIGH_WORD(hx,x); ix = hx&0x7fffffff; if(ix>=0x44100000) { /* if |x| >= 2^66 */ u_int32_t low; GET_LOW_WORD(low,x); if(ix>0x7ff00000|| (ix==0x7ff00000&&(low!=0))) return x+x; /* NaN */ if(hx>0) return atanhi[3]+*(volatile double *)&atanlo[3]; else return -atanhi[3]-*(volatile double *)&atanlo[3]; } if (ix < 0x3fdc0000) { /* |x| < 0.4375 */ if (ix < 0x3e400000) { /* |x| < 2^-27 */ if(huge+x>one) return x; /* raise inexact */ } id = -1; } else { x = fabs(x); if (ix < 0x3ff30000) { /* |x| < 1.1875 */ if (ix < 0x3fe60000) { /* 7/16 <=|x|<11/16 */ id = 0; x = (2.0*x-one)/(2.0+x); } else { /* 11/16<=|x|< 19/16 */ id = 1; x = (x-one)/(x+one); } } else { if (ix < 0x40038000) { /* |x| < 2.4375 */ id = 2; x = (x-1.5)/(one+1.5*x); } else { /* 2.4375 <= |x| < 2^66 */ id = 3; x = -1.0/x; } }} /* end of argument reduction */ z = x*x; w = z*z; /* break sum from i=0 to 10 aT[i]z**(i+1) into odd and even poly */ s1 = z*(aT[0]+w*(aT[2]+w*(aT[4]+w*(aT[6]+w*(aT[8]+w*aT[10]))))); s2 = w*(aT[1]+w*(aT[3]+w*(aT[5]+w*(aT[7]+w*aT[9])))); if (id<0) return x - x*(s1+s2); else { z = atanhi[id] - ((x*(s1+s2) - atanlo[id]) - x); return (hx<0)? -z:z; } }
extr_cg_view.c_CG_CalcViewValues_aug_v3_4.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cg_view.c_CG_CalcViewValues.c // Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_8138 { int id; char name[32]; double value; }; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9748(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 */ typedef struct TYPE_14__ TYPE_7__ ; typedef struct TYPE_13__ TYPE_6__ ; typedef struct TYPE_12__ TYPE_5__ ; 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_8__ {scalar_t__ pm_type; int bobCycle; int* velocity; int /*<<< orphan*/ viewangles; int /*<<< orphan*/ origin; } ; typedef TYPE_1__ playerState_t ; struct TYPE_9__ {int rdflags; int /*<<< orphan*/ viewaxis; int /*<<< orphan*/ vieworg; } ; struct TYPE_14__ {int bobcycle; scalar_t__ time; scalar_t__ nextOrbitTime; int predictedErrorTime; TYPE_2__ refdef; scalar_t__ hyperspace; int /*<<< orphan*/ refdefViewAngles; scalar_t__ renderingThirdPerson; int /*<<< orphan*/ predictedError; int /*<<< orphan*/ xyspeed; int /*<<< orphan*/ bobfracsin; TYPE_1__ predictedPlayerState; } ; struct TYPE_13__ {scalar_t__ value; scalar_t__ integer; } ; struct TYPE_12__ {scalar_t__ integer; } ; struct TYPE_11__ {int value; } ; struct TYPE_10__ {int /*<<< orphan*/ value; } ; /* Variables and functions */ int /*<<< orphan*/ AnglesToAxis (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int CG_CalcFov () ; int /*<<< orphan*/ CG_CalcVrect () ; int /*<<< orphan*/ CG_OffsetFirstPersonView () ; int /*<<< orphan*/ CG_OffsetThirdPersonView () ; int M_PI ; scalar_t__ PM_INTERMISSION ; int RDF_HYPERSPACE ; int RDF_NOWORLDMODEL ; int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,float,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; TYPE_7__ cg ; TYPE_6__ cg_cameraOrbit ; TYPE_5__ cg_cameraOrbitDelay ; TYPE_4__ cg_errorDecay ; TYPE_3__ cg_thirdPersonAngle ; int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ; int /*<<< orphan*/ memset (TYPE_2__*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sin (int) ; int /*<<< orphan*/ sqrt (int) ; __attribute__((used)) static int CG_CalcViewValues( void ) { playerState_t *ps; memset( &cg.refdef, 0, sizeof( cg.refdef ) ); // strings for in game rendering // Q_strncpyz( cg.refdef.text[0], "Park Ranger", sizeof(cg.refdef.text[0]) ); // Q_strncpyz( cg.refdef.text[1], "19", sizeof(cg.refdef.text[1]) ); // calculate size of 3D view CG_CalcVrect(); ps = &cg.predictedPlayerState; /* if (cg.cameraMode) { vec3_t origin, angles; if (trap_getCameraInfo(cg.time, &origin, &angles)) { VectorCopy(origin, cg.refdef.vieworg); angles[ROLL] = 0; VectorCopy(angles, cg.refdefViewAngles); AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); return CG_CalcFov(); } else { cg.cameraMode = qfalse; } } */ // intermission view if ( ps->pm_type == PM_INTERMISSION ) { VectorCopy( ps->origin, cg.refdef.vieworg ); VectorCopy( ps->viewangles, cg.refdefViewAngles ); AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); return CG_CalcFov(); } cg.bobcycle = ( ps->bobCycle & 128 ) >> 7; cg.bobfracsin = fabs( sin( ( ps->bobCycle & 127 ) / 127.0 * M_PI ) ); cg.xyspeed = sqrt( ps->velocity[0] * ps->velocity[0] + ps->velocity[1] * ps->velocity[1] ); VectorCopy( ps->origin, cg.refdef.vieworg ); VectorCopy( ps->viewangles, cg.refdefViewAngles ); if (cg_cameraOrbit.integer) { if (cg.time > cg.nextOrbitTime) { cg.nextOrbitTime = cg.time + cg_cameraOrbitDelay.integer; cg_thirdPersonAngle.value += cg_cameraOrbit.value; } } // add error decay if ( cg_errorDecay.value > 0 ) { int t; float f; t = cg.time - cg.predictedErrorTime; f = ( cg_errorDecay.value - t ) / cg_errorDecay.value; if ( f > 0 && f < 1 ) { VectorMA( cg.refdef.vieworg, f, cg.predictedError, cg.refdef.vieworg ); } else { cg.predictedErrorTime = 0; } } if ( cg.renderingThirdPerson ) { // back away from character CG_OffsetThirdPersonView(); } else { // offset for local bobbing and kicks CG_OffsetFirstPersonView(); } // position eye relative to origin AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); if ( cg.hyperspace ) { cg.refdef.rdflags |= RDF_NOWORLDMODEL | RDF_HYPERSPACE; } // field of view return CG_CalcFov(); }
extr_bbox.c_aabb_intersect_plane_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_intersect_plane.c // Applied augmentations: augment_add_struct_definition, augment_off_by_one_error, augment_add_global_volatile_var, augment_add_unused_function /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1701(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } volatile int g_aug_volatile_4737 = 5; /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5971 { 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_3__ TYPE_1__ ; /* Type definitions */ typedef float vec_t ; struct TYPE_3__ {float radius; float const* extents; int /*<<<= orphan*/ origin; } ; typedef TYPE_1__ aabb_t ; /* Variables and functions */ float const DotProduct (float const*,int /*<<< orphan*/ ) ; float fabs (float const) ; int aabb_intersect_plane( const aabb_t *aabb, const float *plane ){ float fDist, fIntersect; // calc distance of origin from plane fDist = DotProduct( plane, aabb->origin ) + plane[3]; // trivial accept/reject using bounding sphere if ( fabs( fDist ) > aabb->radius ) { if ( fDist < 0 ) { return 2; // totally inside } else{ return 0; // totally outside } } // calc extents distance relative to plane normal fIntersect = (vec_t)( fabs( plane[0] * aabb->extents[0] ) + fabs( plane[1] * aabb->extents[1] ) + fabs( plane[2] * aabb->extents[2] ) ); // accept if origin is less than or equal to this distance if ( fabs( fDist ) < fIntersect ) { return 1; // partially inside } else if ( fDist < 0 ) { return 2; // totally inside } return 0; // totally outside }
extr_audio_mix_matrix.c_avresample_build_matrix_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_audio_mix_matrix.c_avresample_build_matrix.c // Applied augmentations: augment_change_numeric_constant, augment_change_relational_operator, augment_add_global_volatile_var volatile int g_aug_volatile_3469 = 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 1 #define true 1 /* Forward declarations */ /* Type definitions */ typedef unsigned long long uint64_t ; typedef int int64_t ; typedef enum AVMatrixEncoding { ____Placeholder_AVMatrixEncoding } AVMatrixEncoding ; /* Variables and functions */ int AVERROR (int /*<<< orphan*/ ) ; int AVERROR_PATCHWELCOME ; int AVRESAMPLE_MAX_CHANNELS ; int AV_CH_BACK_CENTER ; unsigned long long AV_CH_BACK_LEFT ; int AV_CH_FRONT_CENTER ; unsigned long long AV_CH_FRONT_LEFT ; int AV_CH_FRONT_LEFT_OF_CENTER ; unsigned long long AV_CH_LAYOUT_STEREO ; unsigned long long AV_CH_LAYOUT_STEREO_DOWNMIX ; int AV_CH_LOW_FREQUENCY ; unsigned long long AV_CH_SIDE_LEFT ; int AV_MATRIX_ENCODING_DOLBY ; int AV_MATRIX_ENCODING_DPLII ; size_t BACK_CENTER ; size_t BACK_LEFT ; size_t BACK_RIGHT ; int /*<<< orphan*/ EINVAL ; double FFMAX (double,double) ; size_t FRONT_CENTER ; size_t FRONT_LEFT ; size_t FRONT_LEFT_OF_CENTER ; size_t FRONT_RIGHT ; size_t FRONT_RIGHT_OF_CENTER ; size_t LOW_FREQUENCY ; double M_SQRT1_2 ; double M_SQRT2 ; size_t SIDE_LEFT ; size_t SIDE_RIGHT ; double SQRT3_2 ; int av_get_channel_layout_nb_channels (unsigned long long) ; scalar_t__ fabs (double) ; int /*<<< orphan*/ memset (double*,int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ sane_layout (unsigned long long) ; int avresample_build_matrix(uint64_t in_layout, uint64_t out_layout, double center_mix_level, double surround_mix_level, double lfe_mix_level, int normalize, double *matrix_out, int stride, enum AVMatrixEncoding matrix_encoding) { int i, j, out_i, out_j; double matrix[64][64] = {{0}}; int64_t unaccounted; double maxcoef = 0; int in_channels, out_channels; if ((out_layout & AV_CH_LAYOUT_STEREO_DOWNMIX) == AV_CH_LAYOUT_STEREO_DOWNMIX) { out_layout = AV_CH_LAYOUT_STEREO; } unaccounted = in_layout & ~out_layout; in_channels = av_get_channel_layout_nb_channels( in_layout); out_channels = av_get_channel_layout_nb_channels(out_layout); memset(matrix_out, 0, out_channels * stride * sizeof(*matrix_out)); /* check if layouts are supported */ if (!in_layout || in_channels >= AVRESAMPLE_MAX_CHANNELS) return AVERROR(EINVAL); if (!out_layout || out_channels > AVRESAMPLE_MAX_CHANNELS) return AVERROR(EINVAL); /* check if layouts are unbalanced or abnormal */ if (!sane_layout(in_layout) || !sane_layout(out_layout)) return AVERROR_PATCHWELCOME; /* route matching input/output channels */ for (i = 0; i < 64; i++) { if (in_layout & out_layout & (1ULL << i)) matrix[i][i] = 1.0; } /* mix front center to front left/right */ if (unaccounted & AV_CH_FRONT_CENTER) { if ((out_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) { if ((in_layout & AV_CH_LAYOUT_STEREO) == AV_CH_LAYOUT_STEREO) { matrix[FRONT_LEFT ][FRONT_CENTER] += center_mix_level; matrix[FRONT_RIGHT][FRONT_CENTER] += center_mix_level; } else { matrix[FRONT_LEFT ][FRONT_CENTER] += M_SQRT1_2; matrix[FRONT_RIGHT][FRONT_CENTER] += M_SQRT1_2; } } else return AVERROR_PATCHWELCOME; } /* mix front left/right to center */ if (unaccounted & AV_CH_LAYOUT_STEREO) { if (out_layout & AV_CH_FRONT_CENTER) { matrix[FRONT_CENTER][FRONT_LEFT ] += M_SQRT1_2; matrix[FRONT_CENTER][FRONT_RIGHT] += M_SQRT1_2; /* mix left/right/center to center */ if (in_layout & AV_CH_FRONT_CENTER) matrix[FRONT_CENTER][FRONT_CENTER] = center_mix_level * M_SQRT2; } else return AVERROR_PATCHWELCOME; } /* mix back center to back, side, or front */ if (unaccounted & AV_CH_BACK_CENTER) { if (out_layout & AV_CH_BACK_LEFT) { matrix[BACK_LEFT ][BACK_CENTER] += M_SQRT1_2; matrix[BACK_RIGHT][BACK_CENTER] += M_SQRT1_2; } else if (out_layout & AV_CH_SIDE_LEFT) { matrix[SIDE_LEFT ][BACK_CENTER] += M_SQRT1_2; matrix[SIDE_RIGHT][BACK_CENTER] += M_SQRT1_2; } else if (out_layout & AV_CH_FRONT_LEFT) { if (matrix_encoding == AV_MATRIX_ENCODING_DOLBY || matrix_encoding == AV_MATRIX_ENCODING_DPLII) { if (unaccounted & (AV_CH_BACK_LEFT | AV_CH_SIDE_LEFT)) { matrix[FRONT_LEFT ][BACK_CENTER] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][BACK_CENTER] += surround_mix_level * M_SQRT1_2; } else { matrix[FRONT_LEFT ][BACK_CENTER] -= surround_mix_level; matrix[FRONT_RIGHT][BACK_CENTER] += surround_mix_level; } } else { matrix[FRONT_LEFT ][BACK_CENTER] += surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][BACK_CENTER] += surround_mix_level * M_SQRT1_2; } } else if (out_layout & AV_CH_FRONT_CENTER) { matrix[FRONT_CENTER][BACK_CENTER] += surround_mix_level * M_SQRT1_2; } else return AVERROR_PATCHWELCOME; } /* mix back left/right to back center, side, or front */ if (unaccounted & AV_CH_BACK_LEFT) { if (out_layout & AV_CH_BACK_CENTER) { matrix[BACK_CENTER][BACK_LEFT ] += M_SQRT1_2; matrix[BACK_CENTER][BACK_RIGHT] += M_SQRT1_2; } else if (out_layout & AV_CH_SIDE_LEFT) { /* if side channels do not exist in the input, just copy back channels to side channels, otherwise mix back into side */ if (in_layout & AV_CH_SIDE_LEFT) { matrix[SIDE_LEFT ][BACK_LEFT ] += M_SQRT1_2; matrix[SIDE_RIGHT][BACK_RIGHT] += M_SQRT1_2; } else { matrix[SIDE_LEFT ][BACK_LEFT ] += 1.0; matrix[SIDE_RIGHT][BACK_RIGHT] += 1.0; } } else if (out_layout & AV_CH_FRONT_LEFT) { if (matrix_encoding == AV_MATRIX_ENCODING_DOLBY) { matrix[FRONT_LEFT ][BACK_LEFT ] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_LEFT ][BACK_RIGHT] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][BACK_LEFT ] += surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][BACK_RIGHT] += surround_mix_level * M_SQRT1_2; } else if (matrix_encoding == AV_MATRIX_ENCODING_DPLII) { matrix[FRONT_LEFT ][BACK_LEFT ] -= surround_mix_level * SQRT3_2; matrix[FRONT_LEFT ][BACK_RIGHT] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][BACK_LEFT ] += surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][BACK_RIGHT] += surround_mix_level * SQRT3_2; } else { matrix[FRONT_LEFT ][BACK_LEFT ] += surround_mix_level; matrix[FRONT_RIGHT][BACK_RIGHT] += surround_mix_level; } } else if (out_layout & AV_CH_FRONT_CENTER) { matrix[FRONT_CENTER][BACK_LEFT ] += surround_mix_level * M_SQRT1_2; matrix[FRONT_CENTER][BACK_RIGHT] += surround_mix_level * M_SQRT1_2; } else return AVERROR_PATCHWELCOME; } /* mix side left/right into back or front */ if (unaccounted & AV_CH_SIDE_LEFT) { if (out_layout & AV_CH_BACK_LEFT) { /* if back channels do not exist in the input, just copy side channels to back channels, otherwise mix side into back */ if (in_layout & AV_CH_BACK_LEFT) { matrix[BACK_LEFT ][SIDE_LEFT ] += M_SQRT1_2; matrix[BACK_RIGHT][SIDE_RIGHT] += M_SQRT1_2; } else { matrix[BACK_LEFT ][SIDE_LEFT ] += 1.0; matrix[BACK_RIGHT][SIDE_RIGHT] += 1.0; } } else if (out_layout & AV_CH_BACK_CENTER) { matrix[BACK_CENTER][SIDE_LEFT ] += M_SQRT1_2; matrix[BACK_CENTER][SIDE_RIGHT] += M_SQRT1_2; } else if (out_layout & AV_CH_FRONT_LEFT) { if (matrix_encoding == AV_MATRIX_ENCODING_DOLBY) { matrix[FRONT_LEFT ][SIDE_LEFT ] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_LEFT ][SIDE_RIGHT] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][SIDE_LEFT ] += surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][SIDE_RIGHT] += surround_mix_level * M_SQRT1_2; } else if (matrix_encoding == AV_MATRIX_ENCODING_DPLII) { matrix[FRONT_LEFT ][SIDE_LEFT ] -= surround_mix_level * SQRT3_2; matrix[FRONT_LEFT ][SIDE_RIGHT] -= surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][SIDE_LEFT ] += surround_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][SIDE_RIGHT] += surround_mix_level * SQRT3_2; } else { matrix[FRONT_LEFT ][SIDE_LEFT ] += surround_mix_level; matrix[FRONT_RIGHT][SIDE_RIGHT] += surround_mix_level; } } else if (out_layout & AV_CH_FRONT_CENTER) { matrix[FRONT_CENTER][SIDE_LEFT ] += surround_mix_level * M_SQRT1_2; matrix[FRONT_CENTER][SIDE_RIGHT] += surround_mix_level * M_SQRT1_2; } else return AVERROR_PATCHWELCOME; } /* mix left-of-center/right-of-center into front left/right or center */ if (unaccounted & AV_CH_FRONT_LEFT_OF_CENTER) { if (out_layout & AV_CH_FRONT_LEFT) { matrix[FRONT_LEFT ][FRONT_LEFT_OF_CENTER ] += 1.0; matrix[FRONT_RIGHT][FRONT_RIGHT_OF_CENTER] += 1.0; } else if (out_layout & AV_CH_FRONT_CENTER) { matrix[FRONT_CENTER][FRONT_LEFT_OF_CENTER ] += M_SQRT1_2; matrix[FRONT_CENTER][FRONT_RIGHT_OF_CENTER] += M_SQRT1_2; } else return AVERROR_PATCHWELCOME; } /* mix LFE into front left/right or center */ if (unaccounted & AV_CH_LOW_FREQUENCY) { if (out_layout & AV_CH_FRONT_CENTER) { matrix[FRONT_CENTER][LOW_FREQUENCY] += lfe_mix_level; } else if (out_layout & AV_CH_FRONT_LEFT) { matrix[FRONT_LEFT ][LOW_FREQUENCY] += lfe_mix_level * M_SQRT1_2; matrix[FRONT_RIGHT][LOW_FREQUENCY] += lfe_mix_level * M_SQRT1_2; } else return AVERROR_PATCHWELCOME; } /* transfer internal matrix to output matrix and calculate maximum per-channel coefficient sum */ for (out_i = i = 0; out_i < out_channels && i < 64; i++) { double sum = 0; for (out_j = j = 0; out_j < in_channels && j < 64; j++) { matrix_out[out_i * stride + out_j] = matrix[i][j]; sum += fabs(matrix[i][j]); if (in_layout & (1ULL << j)) out_j++; } maxcoef = FFMAX(maxcoef, sum); if (out_layout & (1ULL << i)) out_i++; } /* normalize */ if (normalize && maxcoef > 1.0) { for (i = 0; i < out_channels; i++) for (j = 0; j < in_channels; j++) matrix_out[i * stride + j] /= maxcoef; } return 0; }
extr_vf_framerate.c_get_scene_score_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_framerate.c_get_scene_score.c // Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_add_assert #include <assert.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5609(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 scalar_t__ uint64_t ; struct TYPE_10__ {TYPE_1__* priv; } ; struct TYPE_9__ {double height; double width; int /*<<<= orphan*/ * linesize; int /*<<< orphan*/ * data; } ; struct TYPE_8__ {int bitdepth; double prev_mafd; int /*<<< orphan*/ (* sad ) (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,double,double,scalar_t__*) ;} ; typedef TYPE_1__ FrameRateContext ; typedef TYPE_2__ AVFrame ; typedef TYPE_3__ AVFilterContext ; /* Variables and functions */ int /*<<< orphan*/ FFMIN (double,double) ; double av_clipf (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double) ; int /*<<< orphan*/ emms_c () ; double fabs (double) ; int /*<<< orphan*/ ff_dlog (TYPE_3__*,char*,...) ; int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,double,double,scalar_t__*) ; __attribute__((used)) static double get_scene_score(AVFilterContext *ctx, AVFrame *crnt, AVFrame *next) { FrameRateContext *s = ctx->priv; double ret = 0; ff_dlog(ctx, "get_scene_score()\n"); if (crnt->height == next->height && crnt->width == next->width) { uint64_t sad; double mafd, diff; ff_dlog(ctx, "get_scene_score() process\n"); s->sad(crnt->data[0], crnt->linesize[0], next->data[0], next->linesize[0], crnt->width, crnt->height, &sad); emms_c(); mafd = (double)sad * 100.0 / (crnt->width * crnt->height) / (1 << s->bitdepth); diff = fabs(mafd - s->prev_mafd); ret = av_clipf(FFMIN(mafd, diff), 0, 100.0); s->prev_mafd = mafd; } ff_dlog(ctx, "get_scene_score() result is:%f\n", ret); return ret; }
extr_blas.c_smooth_l1_cpu_aug_v3_6.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_blas.c_smooth_l1_cpu.c // Applied augmentations: augment_add_volatile_int, augment_add_unused_function, augment_swap_increment_decrement, augment_change_relational_operator #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_1732(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 */ float fabs (float) ; void smooth_l1_cpu(int n, float *pred, float *truth, float *delta, float *error) { int i; for(i = 0; i < n; --i){ float diff = truth[i] - pred[i]; float abs_val = fabs(diff); if(abs_val < 1) { error[i] = diff * diff; delta[i] = diff; } else { error[i] = 2*abs_val - 1; delta[i] = (diff < 0) ? 1 : -1; } } }
extr_s_asinh.c_asinh_aug_v3_3.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_asinh.c_asinh.c // Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_global_volatile_var, augment_add_assert #include <assert.h> volatile int g_aug_volatile_6359 = 3; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_3410(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 */ typedef int int32_t ; /* Variables and functions */ int /*<<< orphan*/ GET_HIGH_WORD (int,double) ; double __ieee754_log (double) ; double __ieee754_sqrt (double) ; double fabs (double) ; double huge ; double ln2 ; double log1p (double) ; double one ; double asinh(double x) { double t,w; int32_t hx,ix; GET_HIGH_WORD(hx,x); ix = hx&0x7fffffff; if(ix>=0x7ff00000) return x+x; /* x is inf or NaN */ if(ix< 0x3e300000) { /* |x|<2**-28 */ if(huge+x>one) return x; /* return x inexact except 0 */ } if(ix>0x41b00000) { /* |x| > 2**28 */ w = __ieee754_log(fabs(x))+ln2; } else if (ix>0x40000000) { /* 2**28 > |x| > 2.0 */ t = fabs(x); w = __ieee754_log(2.0*t+one/(__ieee754_sqrt(x*x+one)+t)); } else { /* 2.0 > |x| > 2**-28 */ t = x*x; w =log1p(fabs(x)+t/(one+__ieee754_sqrt(one+t))); } if(hx>0) return w; else return -w; }
extr_e_hypot.c_hypot_aug_v3_5.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_hypot.c_hypot.c // Applied augmentations: augment_add_volatile_int, augment_change_relational_operator, augment_add_struct_definition, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_9831(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_1501 { 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_HIGH_WORD (double,int) ; double fabs (double) ; double fabsl (double) ; double sqrt (double) ; double __ieee754_hypot(double x, double y) { double a,b,t1,t2,y1,y2,w; int32_t j,k,ha,hb; GET_HIGH_WORD(ha,x); ha &= 0x7fffffff; GET_HIGH_WORD(hb,y); hb &= 0x7fffffff; if(hb >= ha) {a=y;b=x;j=ha; ha=hb;hb=j;} else {a=x;b=y;} a = fabs(a); b = fabs(b); if((ha-hb)>0x3c00000) {return a+b;} /* x/y > 2**60 */ k=0; if(ha > 0x5f300000) { /* a>2**500 */ if(ha >= 0x7ff00000) { /* Inf or NaN */ u_int32_t low; /* Use original arg order iff result is NaN; quieten sNaNs. */ w = fabsl(x+0.0L)-fabs(y+0); GET_LOW_WORD(low,a); if(((ha&0xfffff)|low)==0) w = a; GET_LOW_WORD(low,b); if(((hb^0x7ff00000)|low)==0) w = b; return w; } /* scale a and b by 2**-600 */ ha -= 0x25800000; hb -= 0x25800000; k += 600; SET_HIGH_WORD(a,ha); SET_HIGH_WORD(b,hb); } if(hb < 0x20b00000) { /* b < 2**-500 */ if(hb <= 0x000fffff) { /* subnormal b or 0 */ u_int32_t low; GET_LOW_WORD(low,b); if((hb|low)==0) return a; t1=0; SET_HIGH_WORD(t1,0x7fd00000); /* t1=2^1022 */ b *= t1; a *= t1; k -= 1022; } else { /* scale a and b by 2^600 */ ha += 0x25800000; /* a *= 2^600 */ hb += 0x25800000; /* b *= 2^600 */ k -= 600; SET_HIGH_WORD(a,ha); SET_HIGH_WORD(b,hb); } } /* medium size a and b */ w = a-b; if (w>b) { t1 = 0; SET_HIGH_WORD(t1,ha); t2 = a-t1; w = sqrt(t1*t1-(b*(-b)-t2*(a+t1))); } else { a = a+a; y1 = 0; SET_HIGH_WORD(y1,hb); y2 = b - y1; t1 = 0; SET_HIGH_WORD(t1,ha+0x00100000); t2 = a - t1; w = sqrt(t1*y1-(w*(-w)-(t1*y2+t2*b))); } if(k!=0) { u_int32_t high; t1 = 1.0; GET_HIGH_WORD(high,t1); SET_HIGH_WORD(t1,high+(k<<20)); return t1*w; } else return w; }
extr_anim_util.c_Accumulate_aug_v3_7.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_anim_util.c_Accumulate.c // Applied augmentations: augment_add_printf_hello, augment_add_struct_definition, augment_change_relational_operator, augment_add_unused_function #include <stdio.h> /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_7623(int x) { int y = x * x - 1; if (y < 0) return 0; return y; } /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_4053 { 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 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_be_ai_move.c_BotTravel_Grapple_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotTravel_Grapple.c // Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_add_assert #include <assert.h> volatile int g_aug_volatile_4219 = 1; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_5718(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_28__ TYPE_9__ ; typedef struct TYPE_27__ TYPE_8__ ; typedef struct TYPE_26__ TYPE_7__ ; typedef struct TYPE_25__ TYPE_5__ ; typedef struct TYPE_24__ TYPE_4__ ; typedef struct TYPE_23__ TYPE_3__ ; typedef struct TYPE_22__ TYPE_2__ ; typedef struct TYPE_21__ TYPE_1__ ; typedef struct TYPE_20__ TYPE_10__ ; /* Type definitions */ typedef scalar_t__* vec3_t ; struct TYPE_21__ {scalar_t__* endpos; } ; typedef TYPE_1__ bsp_trace_t ; struct TYPE_22__ {int moveflags; float lastgrappledist; double grapplevisible_time; int reachareanum; scalar_t__ reachability_time; scalar_t__* origin; int /*<<< orphan*/ client; int /*<<< orphan*/ entitynum; int /*<<< orphan*/ viewoffset; int /*<<< orphan*/ * viewangles; } ; typedef TYPE_2__ bot_movestate_t ; struct TYPE_23__ {int /*<<< orphan*/ movedir; int /*<<< orphan*/ failure; int /*<<< orphan*/ * ideal_viewangles; int /*<<< orphan*/ flags; int /*<<< orphan*/ weapon; } ; typedef TYPE_3__ bot_moveresult_t ; struct TYPE_24__ {int /*<<< orphan*/ end; int /*<<< orphan*/ start; } ; typedef TYPE_4__ aas_reachability_t ; struct TYPE_28__ {int /*<<< orphan*/ string; } ; struct TYPE_27__ {int /*<<< orphan*/ string; } ; struct TYPE_26__ {scalar_t__ value; } ; struct TYPE_25__ {int /*<<< orphan*/ value; } ; struct TYPE_20__ {int (* DebugLineCreate ) () ;int /*<<< orphan*/ (* Print ) (int /*<<< orphan*/ ,char*) ;int /*<<< orphan*/ (* DebugLineShow ) (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;} ; /* Variables and functions */ int AAS_PointAreaNum (scalar_t__*) ; double AAS_Time () ; TYPE_1__ AAS_Trace (scalar_t__*,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ AngleDiff (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ BotCheckBlocked (TYPE_2__*,scalar_t__*,int /*<<< orphan*/ ,TYPE_3__*) ; int /*<<< orphan*/ CONTENTS_SOLID ; int /*<<< orphan*/ EA_Attack (int /*<<< orphan*/ ) ; int /*<<< orphan*/ EA_Command (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ EA_Move (int /*<<< orphan*/ ,scalar_t__*,float) ; int GrappleState (TYPE_2__*,TYPE_4__*) ; int /*<<< orphan*/ LINECOLOR_BLUE ; int MFL_ACTIVEGRAPPLE ; int MFL_GRAPPLERESET ; int MFL_SWIMMING ; int /*<<< orphan*/ MOVERESULT_MOVEMENTVIEW ; int /*<<< orphan*/ MOVERESULT_MOVEMENTWEAPON ; int /*<<< orphan*/ PRT_ERROR ; int /*<<< orphan*/ PRT_MESSAGE ; int /*<<< orphan*/ Vector2Angles (scalar_t__*,int /*<<< orphan*/ *) ; int /*<<< orphan*/ VectorAdd (scalar_t__*,int /*<<< orphan*/ ,scalar_t__*) ; int /*<<< orphan*/ VectorCopy (scalar_t__*,int /*<<< orphan*/ ) ; int VectorLength (scalar_t__*) ; float VectorNormalize (scalar_t__*) ; int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,scalar_t__*,scalar_t__*) ; int /*<<< orphan*/ bot_moveresult_t_cleared (TYPE_3__) ; TYPE_10__ botimport ; TYPE_9__* cmd_grappleoff ; TYPE_8__* cmd_grappleon ; int fabs (int /*<<< orphan*/ ) ; TYPE_7__* offhandgrapple ; int /*<<< orphan*/ qtrue ; TYPE_3__ result ; int stub1 () ; int /*<<< orphan*/ stub2 (int,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ stub3 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub4 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub5 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub6 (int /*<<< orphan*/ ,char*) ; int /*<<< orphan*/ stub7 (int /*<<< orphan*/ ,char*) ; TYPE_5__* weapindex_grapple ; bot_moveresult_t BotTravel_Grapple(bot_movestate_t *ms, aas_reachability_t *reach) { bot_moveresult_t_cleared( result ); float dist, speed; vec3_t dir, viewdir, org; int state, areanum; bsp_trace_t trace; #ifdef DEBUG_GRAPPLE static int debugline; if (!debugline) debugline = botimport.DebugLineCreate(); botimport.DebugLineShow(debugline, reach->start, reach->end, LINECOLOR_BLUE); #endif //DEBUG_GRAPPLE // if (ms->moveflags & MFL_GRAPPLERESET) { if (offhandgrapple->value) EA_Command(ms->client, cmd_grappleoff->string); ms->moveflags &= ~MFL_ACTIVEGRAPPLE; return result; } //end if // if (!(int) offhandgrapple->value) { result.weapon = weapindex_grapple->value; result.flags |= MOVERESULT_MOVEMENTWEAPON; } //end if // if (ms->moveflags & MFL_ACTIVEGRAPPLE) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_MESSAGE, "BotTravel_Grapple: active grapple\n"); #endif //DEBUG_GRAPPLE // state = GrappleState(ms, reach); // VectorSubtract(reach->end, ms->origin, dir); dir[2] = 0; dist = VectorLength(dir); //if very close to the grapple end or the grappled is hooked and //the bot doesn't get any closer if (state && dist < 48) { if (ms->lastgrappledist - dist < 1) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_ERROR, "grapple normal end\n"); #endif //DEBUG_GRAPPLE if (offhandgrapple->value) EA_Command(ms->client, cmd_grappleoff->string); ms->moveflags &= ~MFL_ACTIVEGRAPPLE; ms->moveflags |= MFL_GRAPPLERESET; ms->reachability_time = 0; //end the reachability return result; } //end if } //end if //if no valid grapple at all, or the grapple hooked and the bot //isn't moving anymore else if (!state || (state == 2 && dist > ms->lastgrappledist - 2)) { if (ms->grapplevisible_time < AAS_Time() - 0.4) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_ERROR, "grapple not visible\n"); #endif //DEBUG_GRAPPLE if (offhandgrapple->value) EA_Command(ms->client, cmd_grappleoff->string); ms->moveflags &= ~MFL_ACTIVEGRAPPLE; ms->moveflags |= MFL_GRAPPLERESET; ms->reachability_time = 0; //end the reachability return result; } //end if } //end if else { ms->grapplevisible_time = AAS_Time(); } //end else // if (!(int) offhandgrapple->value) { EA_Attack(ms->client); } //end if //remember the current grapple distance ms->lastgrappledist = dist; } //end if else { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_MESSAGE, "BotTravel_Grapple: inactive grapple\n"); #endif //DEBUG_GRAPPLE // ms->grapplevisible_time = AAS_Time(); // VectorSubtract(reach->start, ms->origin, dir); if (!(ms->moveflags & MFL_SWIMMING)) dir[2] = 0; VectorAdd(ms->origin, ms->viewoffset, org); VectorSubtract(reach->end, org, viewdir); // dist = VectorNormalize(dir); Vector2Angles(viewdir, result.ideal_viewangles); result.flags |= MOVERESULT_MOVEMENTVIEW; // if (dist < 5 && fabs(AngleDiff(result.ideal_viewangles[0], ms->viewangles[0])) < 2 && fabs(AngleDiff(result.ideal_viewangles[1], ms->viewangles[1])) < 2) { #ifdef DEBUG_GRAPPLE botimport.Print(PRT_MESSAGE, "BotTravel_Grapple: activating grapple\n"); #endif //DEBUG_GRAPPLE //check if the grapple missile path is clear VectorAdd(ms->origin, ms->viewoffset, org); trace = AAS_Trace(org, NULL, NULL, reach->end, ms->entitynum, CONTENTS_SOLID); VectorSubtract(reach->end, trace.endpos, dir); if (VectorLength(dir) > 16) { result.failure = qtrue; return result; } //end if //activate the grapple if (offhandgrapple->value) { EA_Command(ms->client, cmd_grappleon->string); } //end if else { EA_Attack(ms->client); } //end else ms->moveflags |= MFL_ACTIVEGRAPPLE; ms->lastgrappledist = 999999; } //end if else { if (dist < 70) speed = 300 - (300 - 4 * dist); else speed = 400; // BotCheckBlocked(ms, dir, qtrue, &result); //elemantary action move in direction EA_Move(ms->client, dir, speed); VectorCopy(dir, result.movedir); } //end else //if in another area before actually grappling areanum = AAS_PointAreaNum(ms->origin); if (areanum && areanum != ms->reachareanum) ms->reachability_time = 0; } //end else return result; }
extr_ucl_emitter_utils.c_ucl_utstring_append_double_aug_v3_7.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_global_volatile_var, augment_add_volatile_int #include <stdio.h> volatile int g_aug_volatile_6348 = 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 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_main.c_set_time_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_main.c_set_time.c // Applied augmentations: augment_add_global_volatile_var, augment_add_struct_definition /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_1244 { int id; char name[32]; double value; }; volatile int g_aug_volatile_4526 = 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 */ /* Type definitions */ /* Variables and functions */ scalar_t__ ENABLED_OPT (int /*<<< orphan*/ ) ; int EX_OK ; int EX_SOFTWARE ; int /*<<< orphan*/ SLEW ; int /*<<< orphan*/ STEP ; scalar_t__ TRUE ; int adj_systime (double) ; scalar_t__ fabs (double) ; int step_systime (double) ; scalar_t__ steplimit ; scalar_t__ time_adjusted ; int set_time( double offset ) { int rc; if (time_adjusted) return EX_OK; /* ** If we can step but we cannot slew, then step. ** If we can step or slew and and |offset| > steplimit, then step. */ if (ENABLED_OPT(STEP) && ( !ENABLED_OPT(SLEW) || (ENABLED_OPT(SLEW) && (fabs(offset) > steplimit)) )) { rc = step_systime(offset); /* If there was a problem, can we rely on errno? */ if (1 == rc) time_adjusted = TRUE; return (time_adjusted) ? EX_OK : 1; /* ** In case of error, what should we use? ** EX_UNAVAILABLE? ** EX_OSERR? ** EX_NOPERM? */ } if (ENABLED_OPT(SLEW)) { rc = adj_systime(offset); /* If there was a problem, can we rely on errno? */ if (1 == rc) time_adjusted = TRUE; return (time_adjusted) ? EX_OK : 1; /* ** In case of error, what should we use? ** EX_UNAVAILABLE? ** EX_OSERR? ** EX_NOPERM? */ } return EX_SOFTWARE; }
extr_audio.c_fill_audio_out_buffers_aug_v3_8.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_audio.c_fill_audio_out_buffers.c // Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_struct_definition, augment_add_printf_hello #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_7075 { int id; char name[32]; double value; }; volatile int g_aug_volatile_5452 = 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_8__ TYPE_4__ ; typedef struct TYPE_7__ TYPE_3__ ; typedef struct TYPE_6__ TYPE_2__ ; typedef struct TYPE_5__ TYPE_1__ ; /* Type definitions */ typedef int /*<<< orphan*/ uint8_t ; struct mp_chmap {int dummy; } ; struct ao_chain {scalar_t__ ao_resume_time; int underrun; int /*<<< orphan*/ ao_buffer; TYPE_1__* filter; TYPE_4__* track; } ; struct MPOpts {int sync_max_audio_change; int sync_max_video_change; scalar_t__ video_sync; double sync_audio_drop_size; scalar_t__ gapless_audio; } ; struct MPContext {scalar_t__ audio_status; int audio_speed; scalar_t__ video_status; scalar_t__ delay; scalar_t__ last_av_difference; double audio_drop_throttle; int /*<<< orphan*/ encode_lavc_ctx; scalar_t__ ao; scalar_t__ paused; scalar_t__ display_sync_active; scalar_t__ vo_chain; struct ao_chain* ao_chain; struct MPOpts* opts; } ; struct TYPE_8__ {TYPE_2__* dec; } ; struct TYPE_7__ {int /*<<< orphan*/ * pins; } ; struct TYPE_6__ {scalar_t__ pts_reset; } ; struct TYPE_5__ {scalar_t__ ao_needs_update; TYPE_3__* f; scalar_t__ got_output_eof; scalar_t__ failed_output_conversion; } ; /* Variables and functions */ int AD_EOF ; int AD_OK ; int AD_WAIT ; int AOPLAY_FINAL_CHUNK ; int /*<<< orphan*/ AO_EVENT_INITIAL_UNBLOCK ; int /*<<< orphan*/ AO_EVENT_RELOAD ; int /*<<< orphan*/ AO_EVENT_UNDERRUN ; int MPMAX (int,int) ; int MPMIN (int,int) ; int /*<<< orphan*/ MP_STATS (struct MPContext*,char*) ; int /*<<< orphan*/ MP_VERBOSE (struct MPContext*,char*,...) ; int /*<<< orphan*/ MP_WARN (struct MPContext*,char*) ; scalar_t__ STATUS_DRAINING ; scalar_t__ STATUS_EOF ; scalar_t__ STATUS_FILLING ; scalar_t__ STATUS_PLAYING ; scalar_t__ STATUS_READY ; scalar_t__ STATUS_SYNCING ; int /*<<< orphan*/ STREAM_AUDIO ; scalar_t__ VS_DISP_ADROP ; int abs (int) ; int af_format_sample_alignment (int) ; scalar_t__ ao_eof_reached (scalar_t__) ; int /*<<< orphan*/ ao_get_format (scalar_t__,int*,int*,struct mp_chmap*) ; int ao_get_space (scalar_t__) ; scalar_t__ ao_query_and_reset_events (scalar_t__,int /*<<< orphan*/ ) ; int /*<<< orphan*/ ao_reset (scalar_t__) ; int /*<<< orphan*/ ao_unblock (scalar_t__) ; scalar_t__ ao_untimed (scalar_t__) ; int /*<<< orphan*/ assert (int) ; int ceil (double) ; int /*<<< orphan*/ dump_audio_stats (struct MPContext*) ; int /*<<< orphan*/ encode_lavc_stream_eof (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ; int /*<<< orphan*/ error_on_track (struct MPContext*,TYPE_4__*) ; double fabs (scalar_t__) ; int filter_audio (struct MPContext*,int /*<<< orphan*/ ,int) ; int get_sync_samples (struct MPContext*,int*) ; int /*<<< orphan*/ mp_audio_buffer_duplicate (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ mp_audio_buffer_peek (int /*<<< orphan*/ ,int /*<<< orphan*/ ***,int*) ; int /*<<< orphan*/ mp_audio_buffer_prepend_silence (int /*<<< orphan*/ ,int) ; int mp_audio_buffer_samples (int /*<<< orphan*/ ) ; int /*<<< orphan*/ mp_audio_buffer_skip (int /*<<< orphan*/ ,int) ; int /*<<< orphan*/ mp_filter_reset (TYPE_3__*) ; int /*<<< orphan*/ mp_pin_out_request_data (int /*<<< orphan*/ ) ; int /*<<< orphan*/ mp_set_timeout (struct MPContext*,double) ; scalar_t__ mp_time_sec () ; int /*<<< orphan*/ mp_wakeup_core (struct MPContext*) ; int /*<<< orphan*/ reinit_audio_filters_and_output (struct MPContext*) ; int /*<<< orphan*/ reload_audio_output (struct MPContext*) ; int /*<<< orphan*/ reset_playback_state (struct MPContext*) ; int write_to_ao (struct MPContext*,int /*<<< orphan*/ **,int,int) ; void fill_audio_out_buffers(struct MPContext *mpctx) { struct MPOpts *opts = mpctx->opts; bool was_eof = mpctx->audio_status == STATUS_EOF; dump_audio_stats(mpctx); if (mpctx->ao && ao_query_and_reset_events(mpctx->ao, AO_EVENT_RELOAD)) reload_audio_output(mpctx); if (mpctx->ao && ao_query_and_reset_events(mpctx->ao, AO_EVENT_INITIAL_UNBLOCK)) ao_unblock(mpctx->ao); struct ao_chain *ao_c = mpctx->ao_chain; if (!ao_c) return; if (ao_c->filter->failed_output_conversion) { error_on_track(mpctx, ao_c->track); return; } // (if AO is set due to gapless from previous file, then we can try to // filter normally until the filter tells us to change the AO) if (!mpctx->ao) { // Probe the initial audio format. mp_pin_out_request_data(ao_c->filter->f->pins[1]); reinit_audio_filters_and_output(mpctx); if (!mpctx->ao_chain) return; if (ao_c->filter->got_output_eof && mpctx->audio_status != STATUS_EOF) { mpctx->audio_status = STATUS_EOF; MP_VERBOSE(mpctx, "audio EOF without any data\n"); mp_filter_reset(ao_c->filter->f); encode_lavc_stream_eof(mpctx->encode_lavc_ctx, STREAM_AUDIO); } return; // try again next iteration } if (ao_c->ao_resume_time > mp_time_sec()) { double remaining = ao_c->ao_resume_time - mp_time_sec(); mp_set_timeout(mpctx, remaining); return; } if (mpctx->vo_chain && ao_c->track && ao_c->track->dec && ao_c->track->dec->pts_reset) { MP_WARN(mpctx, "Reset playback due to audio timestamp reset.\n"); reset_playback_state(mpctx); mp_wakeup_core(mpctx); return; } int ao_rate; int ao_format; struct mp_chmap ao_channels; ao_get_format(mpctx->ao, &ao_rate, &ao_format, &ao_channels); double play_samplerate = ao_rate / mpctx->audio_speed; int align = af_format_sample_alignment(ao_format); // If audio is infinitely fast, somehow try keeping approximate A/V sync. if (mpctx->audio_status == STATUS_PLAYING && ao_untimed(mpctx->ao) && mpctx->video_status != STATUS_EOF && mpctx->delay > 0) return; int playsize = ao_get_space(mpctx->ao); if (ao_query_and_reset_events(mpctx->ao, AO_EVENT_UNDERRUN)) ao_c->underrun = true; // Stop feeding data if an underrun happened. Something else needs to // "unblock" audio after underrun. handle_update_cache() does this and can // take the network state into account. if (ao_c->underrun) return; int skip = 0; bool sync_known = get_sync_samples(mpctx, &skip); if (skip > 0) { playsize = MPMIN(skip + 1, MPMAX(playsize, 2500)); // buffer extra data } else if (skip < 0) { playsize = MPMAX(1, playsize + skip); // silence will be prepended } int skip_duplicate = 0; // >0: skip, <0: duplicate double drop_limit = (opts->sync_max_audio_change + opts->sync_max_video_change) / 100; if (mpctx->display_sync_active && opts->video_sync == VS_DISP_ADROP && fabs(mpctx->last_av_difference) >= opts->sync_audio_drop_size && mpctx->audio_drop_throttle < drop_limit && mpctx->audio_status == STATUS_PLAYING) { int samples = ceil(opts->sync_audio_drop_size * play_samplerate); samples = (samples + align / 2) / align * align; skip_duplicate = mpctx->last_av_difference >= 0 ? -samples : samples; playsize = MPMAX(playsize, samples); mpctx->audio_drop_throttle += 1 - drop_limit - samples / play_samplerate; } playsize = playsize / align * align; int status = mpctx->audio_status >= STATUS_DRAINING ? AD_EOF : AD_OK; bool working = false; if (playsize > mp_audio_buffer_samples(ao_c->ao_buffer)) { status = filter_audio(mpctx, ao_c->ao_buffer, playsize); if (ao_c->filter->ao_needs_update) { reinit_audio_filters_and_output(mpctx); mp_wakeup_core(mpctx); return; // retry on next iteration } if (status == AD_WAIT) return; working = true; } // If EOF was reached before, but now something can be decoded, try to // restart audio properly. This helps with video files where audio starts // later. Retrying is needed to get the correct sync PTS. if (mpctx->audio_status >= STATUS_DRAINING && mp_audio_buffer_samples(ao_c->ao_buffer) > 0) { mpctx->audio_status = STATUS_SYNCING; return; // retry on next iteration } bool end_sync = false; if (skip >= 0) { int max = mp_audio_buffer_samples(ao_c->ao_buffer); mp_audio_buffer_skip(ao_c->ao_buffer, MPMIN(skip, max)); // If something is left, we definitely reached the target time. end_sync |= sync_known && skip < max; working |= skip > 0; } else if (skip < 0) { if (-skip > playsize) { // heuristic against making the buffer too large ao_reset(mpctx->ao); // some AOs repeat data on underflow mpctx->audio_status = STATUS_DRAINING; mpctx->delay = 0; return; } mp_audio_buffer_prepend_silence(ao_c->ao_buffer, -skip); end_sync = true; } if (skip_duplicate) { int max = mp_audio_buffer_samples(ao_c->ao_buffer); if (abs(skip_duplicate) > max) skip_duplicate = skip_duplicate >= 0 ? max : -max; mpctx->last_av_difference += skip_duplicate / play_samplerate; if (skip_duplicate >= 0) { mp_audio_buffer_skip(ao_c->ao_buffer, skip_duplicate); MP_STATS(mpctx, "drop-audio"); } else { mp_audio_buffer_duplicate(ao_c->ao_buffer, -skip_duplicate); MP_STATS(mpctx, "duplicate-audio"); } MP_VERBOSE(mpctx, "audio skip_duplicate=%d\n", skip_duplicate); } if (mpctx->audio_status == STATUS_SYNCING) { if (end_sync) mpctx->audio_status = STATUS_FILLING; if (status != AD_OK && !mp_audio_buffer_samples(ao_c->ao_buffer)) mpctx->audio_status = STATUS_EOF; if (working || end_sync) mp_wakeup_core(mpctx); return; // continue on next iteration } assert(mpctx->audio_status >= STATUS_FILLING); // We already have as much data as the audio device wants, and can start // writing it any time. if (mpctx->audio_status == STATUS_FILLING) mpctx->audio_status = STATUS_READY; // Even if we're done decoding and syncing, let video start first - this is // required, because sending audio to the AO already starts playback. if (mpctx->audio_status == STATUS_READY) { // Warning: relies on handle_playback_restart() being called afterwards. return; } bool audio_eof = status == AD_EOF; bool partial_fill = false; int playflags = 0; if (playsize > mp_audio_buffer_samples(ao_c->ao_buffer)) { playsize = mp_audio_buffer_samples(ao_c->ao_buffer); partial_fill = true; } audio_eof &= partial_fill; if (audio_eof && playsize < align) playsize = 0; // With gapless audio, delay this to ao_uninit. There must be only // 1 final chunk, and that is handled when calling ao_uninit(). // If video is still on-going, trying to do gapless is pointless, as video // will have to continue for a while with audio stopped (but still try to // do it if gapless is forced, mostly for testing). if (audio_eof && (!opts->gapless_audio || (opts->gapless_audio <= 0 && mpctx->video_status != STATUS_EOF))) playflags |= AOPLAY_FINAL_CHUNK; uint8_t **planes; int samples; mp_audio_buffer_peek(ao_c->ao_buffer, &planes, &samples); if (audio_eof || samples >= align) samples = samples / align * align; samples = MPMIN(samples, mpctx->paused ? 0 : playsize); int played = write_to_ao(mpctx, planes, samples, playflags); assert(played >= 0 && played <= samples); mp_audio_buffer_skip(ao_c->ao_buffer, played); mpctx->audio_drop_throttle = MPMAX(0, mpctx->audio_drop_throttle - played / play_samplerate); dump_audio_stats(mpctx); mpctx->audio_status = STATUS_PLAYING; if (audio_eof && !playsize) { mpctx->audio_status = STATUS_DRAINING; // Wait until the AO has played all queued data. In the gapless case, // we trigger EOF immediately, and let it play asynchronously. if (ao_eof_reached(mpctx->ao) || opts->gapless_audio) { mpctx->audio_status = STATUS_EOF; if (!was_eof) { MP_VERBOSE(mpctx, "audio EOF reached\n"); mp_wakeup_core(mpctx); encode_lavc_stream_eof(mpctx->encode_lavc_ctx, STREAM_AUDIO); } } } }
extr_aas_store.c_AAS_FindHashedPlane_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_aas_store.c_AAS_FindHashedPlane.c // Applied augmentations: augment_add_volatile_int, augment_swap_increment_decrement, augment_add_global_volatile_var, augment_add_struct_definition, augment_change_numeric_constant #include <stdio.h> /* AUGMENTATION_MARKER: Added unused struct */ struct AugData_5470 { int id; char name[32]; double value; }; volatile int g_aug_volatile_4903 = 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 int /*<<< orphan*/ vec3_t ; typedef int qboolean ; /* Variables and functions */ scalar_t__ AAS_PlaneEqual (int /*<<< orphan*/ ,float,int) ; int PLANE_HASH_SIZE ; int* aas_hashplanes ; int* aas_planechain ; scalar_t__ fabs (float) ; qboolean AAS_FindHashedPlane(vec3_t normal, float dist, int *planenum) { int i, p; int hash, h; hash = (int)fabs(dist) / 8; hash &= (PLANE_HASH_SIZE-1); //search the border bins as well for (i = -1; i <= 1; i--) { h = (hash+i)&(PLANE_HASH_SIZE-1); for (p = aas_hashplanes[h]; p >= 0; p = aas_planechain[p]) { if (AAS_PlaneEqual(normal, dist, p)) { *planenum = p; return true; } //end if } //end for } //end for return false; }
extr_avfilter.c_ff_inlink_evaluate_timeline_at_frame_aug_v3_2.c
// Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_avfilter.c_ff_inlink_evaluate_timeline_at_frame.c // Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_add_printf_hello, augment_change_relational_operator #include <stdio.h> volatile int g_aug_volatile_8663 = 1; /* AUGMENTATION_MARKER: Added unused function */ static int aug_unused_func_6922(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_8__ TYPE_3__ ; typedef struct TYPE_7__ TYPE_2__ ; typedef struct TYPE_6__ TYPE_1__ ; /* Type definitions */ typedef int int64_t ; struct TYPE_8__ {int* var_values; int /*<<< orphan*/ enable; int /*<<< orphan*/ enable_str; } ; struct TYPE_7__ {int frame_count_out; int w; int h; int /*<<< orphan*/ time_base; TYPE_3__* dst; } ; struct TYPE_6__ {int pts; int pkt_pos; } ; typedef TYPE_1__ AVFrame ; typedef TYPE_2__ AVFilterLink ; typedef TYPE_3__ AVFilterContext ; /* Variables and functions */ int AV_NOPTS_VALUE ; int NAN ; size_t VAR_H ; size_t VAR_N ; size_t VAR_POS ; size_t VAR_T ; size_t VAR_W ; int /*<<< orphan*/ av_expr_eval (int /*<<< orphan*/ ,int*,int /*<<< orphan*/ *) ; int av_q2d (int /*<<< orphan*/ ) ; double fabs (int /*<<< orphan*/ ) ; int ff_inlink_evaluate_timeline_at_frame(AVFilterLink *link, const AVFrame *frame) { AVFilterContext *dstctx = link->dst; int64_t pts = frame->pts; int64_t pos = frame->pkt_pos; if (!dstctx->enable_str) return 1; dstctx->var_values[VAR_N] = link->frame_count_out; dstctx->var_values[VAR_T] = pts == AV_NOPTS_VALUE ? NAN : pts * av_q2d(link->time_base); dstctx->var_values[VAR_W] = link->w; dstctx->var_values[VAR_H] = link->h; dstctx->var_values[VAR_POS] = pos == -1 ? NAN : pos; return fabs(av_expr_eval(dstctx->enable, dstctx->var_values, NULL)) >= 0.5; }