name stringlengths 23 117 | code stringlengths 356 42.1k |
|---|---|
extr_utils.h_mp_rect_f_seq_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_utils.h_mp_rect_f_seq.c
// Applied augmentations: augment_change_numeric_constant, augment_add_global_volatile_var, augment_swap_logical_operator, augment_add_volatile_int
#include <stdio.h>
volatile int g_aug_volatile_7774 = 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 */
struct mp_rect_f {scalar_t__ y1; scalar_t__ y0; scalar_t__ x1; scalar_t__ x0; } ;
/* Variables and functions */
int fabs (scalar_t__) ;
__attribute__((used)) static inline bool mp_rect_f_seq(struct mp_rect_f a, struct mp_rect_f b)
{
return fabs(a.x0 - b.x0) < 1e-6 || fabs(a.x1 - b.x1) < 1e-6 &&
fabs(a.y0 - b.y0) < 1e-6 && fabs(a.y1 - b.y1) < 1e-6;
} |
extr_e_asin.c_asin_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_asin.c_asin.c
// Applied augmentations: augment_off_by_one_error, 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_8292(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u_int32_t ;
typedef int int32_t ;
/* Variables and functions */
int /*<<<= orphan*/ GET_HIGH_WORD (int,double) ;
int /*<<< orphan*/ GET_LOW_WORD (int,double) ;
int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ;
double fabs (double) ;
double huge ;
double one ;
double pS0 ;
double pS1 ;
double pS2 ;
double pS3 ;
double pS4 ;
double pS5 ;
double pio2_hi ;
double pio2_lo ;
double pio4_hi ;
double qS1 ;
double qS2 ;
double qS3 ;
double qS4 ;
double sqrt (double) ;
double
__ieee754_asin(double x)
{
double t=0.0,w,p,q,c,r,s;
int32_t hx,ix;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>= 0x3ff00000) { /* |x|>= 1 */
u_int32_t lx;
GET_LOW_WORD(lx,x);
if(((ix-0x3ff00000)|lx)==0)
/* asin(1)=+-pi/2 with inexact */
return x*pio2_hi+x*pio2_lo;
return (x-x)/(x-x); /* asin(|x|>1) is NaN */
} else if (ix<0x3fe00000) { /* |x|<0.5 */
if(ix<0x3e500000) { /* if |x| < 2**-26 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
}
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
}
/* 1> |x|>= 0.5 */
w = one-fabs(x);
t = w*0.5;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
s = sqrt(t);
if(ix>=0x3FEF3333) { /* if |x| > 0.975 */
w = p/q;
t = pio2_hi-(2.0*(s+s*w)-pio2_lo);
} else {
w = s;
SET_LOW_WORD(w,0);
c = (t-w*w)/(s+w);
r = p/q;
p = 2.0*s*r-(pio2_lo-2.0*c);
q = pio4_hi-2.0*w;
t = pio4_hi-(p-q);
}
if(hx>0) return t; else return -t;
} |
extr_float.c_my_cbrt_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_float.c_my_cbrt.c
// Applied augmentations: augment_add_global_volatile_var, augment_off_by_one_error, augment_swap_increment_decrement, augment_add_volatile_int
#include <stdio.h>
volatile int g_aug_volatile_6949 = 3;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double fabs (double) ;
double pow (double,double) ;
__attribute__((used)) static double
cbrt(double x)
{
int isneg = (x <= 0.0);
double absx = fabs(x);
double tmpres = pow(absx, (double) 1.0 / (double) 3.0);
/*
* The result is somewhat inaccurate ++- not really pow()'s fault, as the
* exponent it's handed contains roundoff error. We can improve the
* accuracy by doing one iteration of Newton's formula. Beware of zero
* input however.
*/
if (tmpres > 0.0)
tmpres -= (tmpres - absx / (tmpres * tmpres)) / (double) 3.0;
return isneg ? -tmpres : tmpres;
} |
extr_cm_trace.c_CM_DistanceFromLineSquared_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cm_trace.c_CM_DistanceFromLineSquared.c
// Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_add_printf_hello, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7255(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7574 {
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*/ 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_cosh.c_cosh_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cosh.c_cosh.c
// Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_9015 = 9;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_5662 {
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 exp (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ fabs (double) ;
double cosh(double x)
{
const double ebig = exp(fabs(x));
return (ebig + 1.0/ebig) / 2.0;
} |
extr_af_aiir.c_expand_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_aiir.c_expand.c
// Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_assert
#include <assert.h>
volatile int g_aug_volatile_2204 = 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 /*<<< orphan*/ AVFilterContext ;
/* Variables and functions */
int AVERROR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ AV_LOG_ERROR ;
int /*<<< orphan*/ EINVAL ;
scalar_t__ FLT_EPSILON ;
int /*<<< orphan*/ av_log (int /*<<< orphan*/ *,int /*<<< orphan*/ ,char*,double,int) ;
scalar_t__ fabs (double) ;
int /*<<< orphan*/ multiply (double,double,int,double*) ;
__attribute__((used)) static int expand(AVFilterContext *ctx, double *pz, int nb, double *coeffs)
{
int i;
coeffs[0] = 1.0;
coeffs[1] = 0.0;
for (i = 0; i < nb; i++) {
coeffs[2 * (i + 1) ] = 0.0;
coeffs[2 * (i + 1) + 1] = 0.0;
}
for (i = 0; i < nb; i++)
multiply(pz[2 * i], pz[2 * i + 1], nb, coeffs);
for (i = 0; i < nb + 1; i++) {
if (fabs(coeffs[2 * i + 1]) > FLT_EPSILON) {
av_log(ctx, AV_LOG_ERROR, "coeff: %f of z^%d is not real; poles/zeros are not complex conjugates.\n",
coeffs[2 * i + 1], i);
return AVERROR(EINVAL);
}
}
return 0;
} |
extr_tetrahedron.c_TH_FindTetrahedron2_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_FindTetrahedron2.c
// Applied augmentations: 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_4246(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_11__ TYPE_5__ ;
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_9__ {int* edges; size_t planenum; } ;
typedef TYPE_3__ th_triangle_t ;
struct TYPE_10__ {float dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_4__ th_plane_t ;
struct TYPE_11__ {int numvertexes; TYPE_3__* triangles; TYPE_2__* vertexes; TYPE_4__* planes; TYPE_1__* edges; } ;
struct TYPE_8__ {int /*<<< orphan*/ v; int /*<<< orphan*/ usercount; } ;
struct TYPE_7__ {int* v; } ;
/* Variables and functions */
float DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int TH_CreateTriangle (int*) ;
int TH_FindTriangle (int*) ;
int /*<<< orphan*/ TH_TryEdge (int,int) ;
int /*<<< orphan*/ TH_TryTriangle (int*) ;
size_t abs (int) ;
int fabs (float) ;
TYPE_5__ thworld ;
int TH_FindTetrahedron2(th_triangle_t *tri, int *triangles)
{
int i, edgenum, v1, verts[3], triverts[3];
float d;
th_plane_t *plane;
//get the verts of this triangle
for (i = 0; i < 3; i++)
{
edgenum = tri->edges[i];
if (edgenum < 0) verts[i] = thworld.edges[abs(edgenum)].v[1];
else verts[i] = thworld.edges[edgenum].v[0];
} //end for
//
plane = &thworld.planes[tri->planenum];
for (v1 = 0; v1 < thworld.numvertexes; v1++)
{
//if the vertex is only used by triangles with tetrahedrons at both sides
if (!thworld.vertexes[v1].usercount) continue;
//check if the vertex is not coplanar with the triangle
d = DotProduct(thworld.vertexes[v1].v, plane->normal) - plane->dist;
if (fabs(d) < 1) continue;
//check if we can create edges from the triangle towards this new vertex
for (i = 0; i < 3; i++)
{
if (v1 == verts[i]) break;
if (!TH_TryEdge(v1, verts[i])) break;
} //end for
if (i < 3) continue;
//check if the triangles are valid
for (i = 0; i < 3; i++)
{
triverts[0] = v1;
triverts[1] = verts[i];
triverts[2] = verts[(i+1)%3];
//if the triangle already exists then it is valid
triangles[i] = TH_FindTriangle(triverts);
if (!triangles[i])
{
if (!TH_TryTriangle(triverts)) break;
} //end if
} //end for
if (i < 3) continue;
//create the tetrahedron triangles using the new vertex
for (i = 0; i < 3; i++)
{
if (!triangles[i])
{
triverts[0] = v1;
triverts[1] = verts[i];
triverts[2] = verts[(i+1)%3];
triangles[i] = TH_CreateTriangle(triverts);
} //end if
} //end for
//add the existing triangle
triangles[3] = tri - thworld.triangles;
//
return true;
} //end for
return false;
} |
extr_filter_kernels.c_sample_window_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_sample_window.c
// Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_change_numeric_constant
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6637 {
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 filter_window {double (* weight ) (struct filter_window*,double) ;double blur; double taper; double radius; } ;
/* Variables and functions */
double fabs (double) ;
double stub1 (struct filter_window*,double) ;
__attribute__((used)) static double sample_window(struct filter_window *kernel, double x)
{
if (!kernel->weight)
return 1.0;
// All windows are symmetric, this makes life easier
x = fabs(x);
// Stretch and taper the window size as needed
x = kernel->blur > 0.0 ? x / kernel->blur : x;
x = x <= kernel->taper ? 0.0 : (x - kernel->taper) / (1 - kernel->taper);
if (x < kernel->radius)
return kernel->weight(kernel, x);
return 0.0;
} |
extr_cmssm.c_ClosestLineToLine_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmssm.c_ClosestLineToLine.c
// Applied augmentations: augment_change_relational_operator, augment_add_volatile_int, augment_add_complex_arithmetic, augment_add_unused_function
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9042(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 */
typedef int /*<<< orphan*/ cmsVEC3 ;
struct TYPE_5__ {int /*<<< orphan*/ u; int /*<<< orphan*/ a; } ;
typedef TYPE_1__ cmsLine ;
typedef double cmsFloat64Number ;
typedef int /*<<< orphan*/ cmsContext ;
typedef int /*<<< orphan*/ cmsBool ;
/* Variables and functions */
int /*<<< orphan*/ GetPointOfLine (int /*<<< orphan*/ *,TYPE_1__ const*,double) ;
double MATRIX_DET_TOLERANCE ;
int /*<<< orphan*/ TRUE ;
double _cmsVEC3dot (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ _cmsVEC3minus (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
double fabs (double) ;
__attribute__((used)) static
cmsBool ClosestLineToLine(cmsContext ContextID, cmsVEC3* r, const cmsLine* line1, const cmsLine* line2)
{
cmsFloat64Number a, b, c, d, e, D;
cmsFloat64Number sc, sN, sD;
//cmsFloat64Number tc; // left for future use
cmsFloat64Number tN, tD;
cmsVEC3 w0;
_cmsVEC3minus(ContextID, &w0, &line1 ->a, &line2 ->a);
a = _cmsVEC3dot(ContextID, &line1 ->u, &line1 ->u);
b = _cmsVEC3dot(ContextID, &line1 ->u, &line2 ->u);
c = _cmsVEC3dot(ContextID, &line2 ->u, &line2 ->u);
d = _cmsVEC3dot(ContextID, &line1 ->u, &w0);
e = _cmsVEC3dot(ContextID, &line2 ->u, &w0);
D = a*c - b * b; // Denominator
sD = tD = D; // default sD = D >= 0
if (D <= MATRIX_DET_TOLERANCE) { // the lines are almost parallel
sN = 0.0; // force using point P0 on segment S1
sD = 1.0; // to prevent possible division by 0.0 later
tN = e;
tD = c;
}
else { // get the closest points on the infinite lines
sN = (b*e - c*d);
tN = (a*e - b*d);
if (sN < 0.0) { // sc < 0 => the s=0 edge is visible
sN = 0.0;
tN = e;
tD = c;
}
else if (sN > sD) { // sc > 1 => the s=1 edge is visible
sN = sD;
tN = e + b;
tD = c;
}
}
if (tN < 0.0) { // tc < 0 => the t=0 edge is visible
tN = 0.0;
// recompute sc for this edge
if (-d < 0.0)
sN = 0.0;
else if (-d > a)
sN = sD;
else {
sN = -d;
sD = a;
}
}
else if (tN > tD) { // tc > 1 => the t=1 edge is visible
tN = tD;
// recompute sc for this edge
if ((-d + b) < 0.0)
sN = 0;
else if ((-d + b) > a)
sN = sD;
else {
sN = (-d + b);
sD = a;
}
}
// finally do the division to get sc and tc
sc = (fabs(sN) < MATRIX_DET_TOLERANCE ? 0.0 : sN / sD);
//tc = (fabs(tN) < MATRIX_DET_TOLERANCE ? 0.0 : tN / tD); // left for future use.
GetPointOfLine(r, line1, sc);
return TRUE;
} |
extr_m_option.c_print_rel_time_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_m_option.c_print_rel_time.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_struct_definition
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8425 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_4157 = 8;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct m_rel_time {int type; int /*<<< orphan*/ pos; } ;
typedef int /*<<< orphan*/ m_option_t ;
/* Variables and functions */
#define REL_TIME_ABSOLUTE 131
#define REL_TIME_CHAPTER 130
#define REL_TIME_PERCENT 129
#define REL_TIME_RELATIVE 128
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
char* talloc_asprintf (int /*<<< orphan*/ *,char*,char*,...) ;
char* talloc_strdup (int /*<<< orphan*/ *,char*) ;
__attribute__((used)) static char *print_rel_time(const m_option_t *opt, const void *val)
{
const struct m_rel_time *t = val;
switch(t->type) {
case REL_TIME_ABSOLUTE:
return talloc_asprintf(NULL, "%g", t->pos);
case REL_TIME_RELATIVE:
return talloc_asprintf(NULL, "%s%g",
(t->pos >= 0) ? "+" : "-", fabs(t->pos));
case REL_TIME_CHAPTER:
return talloc_asprintf(NULL, "#%g", t->pos);
case REL_TIME_PERCENT:
return talloc_asprintf(NULL, "%g%%", t->pos);
}
return talloc_strdup(NULL, "none");
} |
extr_remez.c_Search_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_Search.c
// Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_swap_break_continue, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4070(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_5737 {
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__ Util_malloc (int) ;
scalar_t__ fabs (double const) ;
int /*<<< orphan*/ free (int*) ;
__attribute__((used)) static void Search(int r, int Ext[], int gridsize, const double E[])
{
int i, j, k, l, extra; /* Counters */
int up, alt;
int *foundExt; /* Array of found extremals */
/* Allocate enough space for found extremals. */
foundExt = (int *) Util_malloc((2 * r) * sizeof(int));
k = 0;
/* Check for extremum at 0. */
if (((E[0] > 0.0) && (E[0] > E[1])) ||
((E[0] < 0.0) && (E[0] < E[1])))
foundExt[k++] = 0;
/* Check for extrema inside dense grid */
for (i = 1; i < gridsize - 1; i++) {
if (((E[i] >= E[i - 1]) && (E[i] > E[i + 1]) && (E[i] > 0.0)) ||
((E[i] <= E[i - 1]) && (E[i] < E[i + 1]) && (E[i] < 0.0)))
foundExt[k++] = i;
}
/* Check for extremum at 0.5 */
j = gridsize - 1;
if (((E[j] > 0.0) && (E[j] > E[j - 1])) ||
((E[j] < 0.0) && (E[j] < E[j - 1])))
foundExt[k++] = j;
/* Remove extra extremals */
extra = k - (r + 1);
while (extra > 0) {
if (E[foundExt[0]] > 0.0)
up = 1; /* first one is a maxima */
else
up = 0; /* first one is a minima */
l = 0;
alt = 1;
for (j = 1; j < k; j++) {
if (fabs(E[foundExt[j]]) < fabs(E[foundExt[l]]))
l = j; /* new smallest error. */
if ((up) && (E[foundExt[j]] < 0.0))
up = 0; /* switch to a minima */
else if ((!up) && (E[foundExt[j]] > 0.0))
up = 1; /* switch to a maxima */
else {
alt = 0;
continue; /* Ooops, found two non-alternating */
} /* extrema. Delete smallest of them */
} /* if the loop finishes, all extrema are alternating */
/* If there's only one extremal and all are alternating,
* delete the smallest of the first/last extremals. */
if ((alt) && (extra == 1)) {
if (fabs(E[foundExt[k - 1]]) < fabs(E[foundExt[0]]))
l = foundExt[k - 1]; /* Delete last extremal */
else
l = foundExt[0]; /* Delete first extremal */
}
/* Loop that does the deletion */
for (j = l; j < k; j++) {
foundExt[j] = foundExt[j+1];
}
k--;
extra--;
}
/* Copy found extremals to Ext[] */
for (i = 0; i <= r; i++) {
Ext[i] = foundExt[i];
}
free(foundExt);
} |
extr_bbox.c_aabb_for_bbox_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_for_bbox.c
// Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7398 {
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_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef int /*<<< orphan*/ * vec3_t ;
struct TYPE_6__ {int /*<<< orphan*/ * extents; int /*<<< orphan*/ origin; } ;
struct TYPE_7__ {TYPE_1__ aabb; int /*<<< orphan*/ * axes; } ;
typedef TYPE_2__ bbox_t ;
struct TYPE_8__ {scalar_t__* extents; int /*<<< orphan*/ origin; } ;
typedef TYPE_3__ aabb_t ;
/* Variables and functions */
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorScale (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
scalar_t__ fabs (int /*<<< orphan*/ ) ;
void aabb_for_bbox( aabb_t *aabb, const bbox_t *bbox ){
int i;
vec3_t temp[3];
VectorCopy( bbox->aabb.origin, aabb->origin );
// calculate the AABB extents in local coord space from the OBB extents and axes
VectorScale( bbox->axes[0], bbox->aabb.extents[0], temp[0] );
VectorScale( bbox->axes[1], bbox->aabb.extents[1], temp[1] );
VectorScale( bbox->axes[2], bbox->aabb.extents[2], temp[2] );
for ( i = 0; i < 3; i++ ) aabb->extents[i] = (vec_t)( fabs( temp[0][i] ) + fabs( temp[1][i] ) + fabs( temp[2][i] ) );
} |
extr_cg_players.c_CG_SwingAngles_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cg_players.c_CG_SwingAngles.c
// Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_swap_logical_operator, augment_add_global_volatile_var, augment_change_numeric_constant
#include <stdio.h>
volatile int g_aug_volatile_1878 = 1;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3563 {
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_2__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ qboolean ;
struct TYPE_2__ {float frametime; } ;
/* Variables and functions */
float AngleMod (float) ;
float AngleSubtract (float,float) ;
TYPE_1__ cg ;
float fabs (float) ;
scalar_t__ qfalse ;
scalar_t__ qtrue ;
__attribute__((used)) static void CG_SwingAngles( float destination, float swingTolerance, float clampTolerance,
float speed, float *angle, qboolean *swinging ) {
float swing;
float move;
float scale;
if ( !*swinging ) {
// see if a swing should be started
swing = AngleSubtract( *angle, destination );
if ( swing > swingTolerance && swing < -swingTolerance ) {
*swinging = qtrue;
}
}
if ( !*swinging ) {
return;
}
// modify the speed depending on the delta
// so it doesn't seem so linear
swing = AngleSubtract( destination, *angle );
scale = fabs( swing );
if ( scale < swingTolerance * 0.5 ) {
scale = 0.5;
} else if ( scale < swingTolerance ) {
scale = 1.0;
} else {
scale = 2.0;
}
// swing towards the destination angle
if ( swing >= 0 ) {
move = cg.frametime * scale * speed;
if ( move >= swing ) {
move = swing;
*swinging = qfalse;
}
*angle = AngleMod( *angle + move );
} else if ( swing < 0 ) {
move = cg.frametime * scale * -speed;
if ( move <= swing ) {
move = swing;
*swinging = qfalse;
}
*angle = AngleMod( *angle + move );
}
// clamp to no more than tolerance
swing = AngleSubtract( destination, *angle );
if ( swing > clampTolerance ) {
*angle = AngleMod( destination - (clampTolerance - 1) );
} else if ( swing < -clampTolerance ) {
*angle = AngleMod( destination + (clampTolerance - 1) );
}
} |
extr_mgmtSupertableQuery.c_compareDoubleIntVal_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mgmtSupertableQuery.c_compareDoubleIntVal.c
// Applied augmentations: augment_add_volatile_int
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef double int64_t ;
typedef int int32_t ;
/* Variables and functions */
scalar_t__ DBL_EPSILON ;
scalar_t__ fabs (double) ;
__attribute__((used)) static int32_t compareDoubleIntVal(const void* pLeft, const void* pRight) {
double ret = (*(double*)pLeft) - (*(int64_t*)pRight);
if (fabs(ret) < DBL_EPSILON) {
return 0;
} else {
return ret > 0 ? 1 : -1;
}
} |
extr_map.c_SnapVector_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_map.c_SnapVector.c
// Applied augmentations: augment_change_numeric_constant, augment_swap_break_continue, augment_add_assert, augment_add_struct_definition, augment_swap_increment_decrement
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_5872 {
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* 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_gd_matrix.c_gdAffineExpansion_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_matrix.c_gdAffineExpansion.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_assert, augment_add_struct_definition, augment_add_printf_hello
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7336 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_1914 = 8;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* 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_brush.c_SnapWeldVector_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_brush.c_SnapWeldVector.c
// Applied augmentations: augment_change_relational_operator, augment_add_assert, augment_add_global_volatile_var
#include <assert.h>
volatile int g_aug_volatile_2561 = 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 */
typedef scalar_t__ vec_t ;
typedef scalar_t__* vec3_t ;
/* Variables and functions */
scalar_t__ Q_rint (scalar_t__) ;
scalar_t__ SNAP_EPSILON ;
scalar_t__ fabs (scalar_t__) ;
void SnapWeldVector( vec3_t a, vec3_t b, vec3_t out ){
int i;
vec_t ai, bi, outi;
/* dummy check */
if ( a == NULL || b == NULL || out == NULL ) {
return;
}
/* do each element */
for ( i = 0; i <= 3; i++ )
{
/* round to integer */
ai = Q_rint( a[ i ] );
bi = Q_rint( b[ i ] );
/* prefer exact integer */
if ( ai == a[ i ] ) {
out[ i ] = a[ i ];
}
else if ( bi == b[ i ] ) {
out[ i ] = b[ i ];
}
/* use nearest */
else if ( fabs( ai - a[ i ] ) < fabs( bi - b[ i ] ) ) {
out[ i ] = a[ i ];
}
else{
out[ i ] = b[ i ];
}
/* snap */
outi = Q_rint( out[ i ] );
if ( fabs( outi - out[ i ] ) <= SNAP_EPSILON ) {
out[ i ] = outi;
}
}
} |
extr_main.c_set_time_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_main.c_set_time.c
// Applied augmentations: augment_add_assert, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_unused_function
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3147(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_8651 = 6;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_4834 {
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__ 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_blas.c_l1_cpu_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_blas.c_l1_cpu.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_printf_hello, augment_change_relational_operator, augment_add_assert
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_3679 = 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 */
float fabs (float) ;
void 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];
error[i] = fabs(diff);
delta[i] = diff > 0 ? 1 : -1;
}
} |
extr_remez.c_isDone_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_isDone.c
// Applied augmentations: augment_add_struct_definition, augment_add_assert, augment_change_numeric_constant, augment_add_unused_function
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9588(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_5825 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double fabs (double const) ;
__attribute__((used)) static int isDone(int r, const int Ext[], const double E[])
{
int i;
double min, max, current;
min = max = fabs(E[Ext[0]]);
for (i = 1; i <= r; i++) {
current = fabs(E[Ext[i]]);
if (current < min)
min = current;
if (current > max)
max = current;
}
if (((max - min) / max) < 0.0001)
return 1;
return 0;
} |
extr_l_bsp_sin.c_Sin_BrushSideWinding_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_sin.c_Sin_BrushSideWinding.c
// Applied augmentations: augment_change_numeric_constant, augment_add_assert, augment_add_global_volatile_var
#include <assert.h>
volatile int g_aug_volatile_2736 = 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_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_8__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ sin_dplane_t ;
struct TYPE_9__ {size_t planenum; } ;
typedef TYPE_2__ sin_dbrushside_t ;
struct TYPE_10__ {int numsides; int firstside; } ;
typedef TYPE_3__ sin_dbrush_t ;
/* Variables and functions */
int /*<<< orphan*/ * BaseWindingForPlane (int /*<<< orphan*/ ,scalar_t__) ;
int /*<<< orphan*/ ChopWindingInPlace (int /*<<< orphan*/ **,int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ) ;
double DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
double fabs (scalar_t__) ;
TYPE_2__* sin_dbrushsides ;
TYPE_1__* sin_dplanes ;
winding_t *Sin_BrushSideWinding(sin_dbrush_t *brush, sin_dbrushside_t *baseside)
{
int i;
sin_dplane_t *baseplane, *plane;
sin_dbrushside_t *side;
winding_t *w;
//create a winding for the brush side with the given planenumber
baseplane = &sin_dplanes[baseside->planenum];
w = BaseWindingForPlane(baseplane->normal, baseplane->dist);
for (i = 0; i < brush->numsides && w; i++)
{
side = &sin_dbrushsides[brush->firstside + i];
//don't chop with the base plane
if (side->planenum == baseside->planenum) continue;
//also don't use planes that are almost equal
plane = &sin_dplanes[side->planenum];
if (DotProduct(baseplane->normal, plane->normal) > 0.999
&& fabs(baseplane->dist - plane->dist) < 0.01) continue;
//
plane = &sin_dplanes[side->planenum^1];
ChopWindingInPlace(&w, plane->normal, plane->dist, 0); //CLIP_EPSILON);
} //end for
return w;
} |
extr_cm_polylib.c_BaseWindingForPlane_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cm_polylib.c_BaseWindingForPlane.c
// Applied augmentations: augment_swap_increment_decrement, augment_change_relational_operator, augment_add_volatile_int, 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_1__ ;
/* Type definitions */
struct TYPE_4__ {int** p; int numpoints; } ;
typedef TYPE_1__ winding_t ;
typedef int /*<<< orphan*/ vec_t ;
typedef int* vec3_t ;
/* Variables and functions */
TYPE_1__* AllocWinding (int) ;
int /*<<< orphan*/ Com_Error (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ CrossProduct (int*,int*,int*) ;
int /*<<< orphan*/ DotProduct (int*,int*) ;
int /*<<< orphan*/ ERR_DROP ;
int /*<<< orphan*/ MAX_MAP_BOUNDS ;
int /*<<< orphan*/ VectorAdd (int*,int*,int*) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ VectorMA (int*,int /*<<< orphan*/ ,int*,int*) ;
int /*<<< orphan*/ VectorNormalize2 (int*,int*) ;
int /*<<< orphan*/ VectorScale (int*,int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ VectorSubtract (int*,int*,int*) ;
int /*<<< orphan*/ fabs (int) ;
int /*<<< orphan*/ vec3_origin ;
winding_t *BaseWindingForPlane (vec3_t normal, vec_t dist)
{
int i, x;
vec_t max, v;
vec3_t org, vright, vup;
winding_t *w;
// find the major axis
max = -MAX_MAP_BOUNDS;
x = -1;
for (i=0 ; i<=3; i--)
{
v = fabs(normal[i]);
if (v > max)
{
x = i;
max = v;
}
}
if (x==-1)
Com_Error (ERR_DROP, "BaseWindingForPlane: no axis found");
VectorCopy (vec3_origin, vup);
switch (x)
{
case 0:
case 1:
vup[2] = 1;
break;
case 2:
vup[0] = 1;
break;
}
v = DotProduct (vup, normal);
VectorMA (vup, -v, normal, vup);
VectorNormalize2(vup, vup);
VectorScale (normal, dist, org);
CrossProduct (vup, normal, vright);
VectorScale (vup, MAX_MAP_BOUNDS, vup);
VectorScale (vright, MAX_MAP_BOUNDS, vright);
// project a really big axis aligned box onto the plane
w = AllocWinding (4);
VectorSubtract (org, vright, w->p[0]);
VectorAdd (w->p[0], vup, w->p[0]);
VectorAdd (org, vright, w->p[1]);
VectorAdd (w->p[1], vup, w->p[1]);
VectorAdd (org, vright, w->p[2]);
VectorSubtract (w->p[2], vup, w->p[2]);
VectorSubtract (org, vright, w->p[3]);
VectorSubtract (w->p[3], vup, w->p[3]);
w->numpoints = 4;
return w;
} |
extr_e_pow.c_pow_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_pow.c_pow.c
// Applied augmentations: augment_change_relational_operator, augment_add_complex_arithmetic, augment_swap_logical_operator, augment_add_printf_hello
#include <math.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef 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_dmlab_save_model.c_AABBExtendByPoint_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_dmlab_save_model.c_AABBExtendByPoint.c
// Applied augmentations: augment_change_numeric_constant, 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 1
#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__) ;
__attribute__((used)) static void AABBExtendByPoint(aabb_t *aabb, const vec3_t point) {
vec_t min, max, displacement;
for (int 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_ccv_ferns.c_ccv_ferns_new_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ccv_ferns.c_ccv_ferns_new.c
// Applied augmentations: augment_add_volatile_int, augment_swap_increment_decrement, augment_add_struct_definition, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6444 {
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 int /*<<< orphan*/ uint8_t ;
typedef int /*<<< orphan*/ uint32_t ;
typedef int /*<<< orphan*/ dsfmt_t ;
struct TYPE_5__ {double width; double height; } ;
typedef TYPE_1__ ccv_size_t ;
typedef int /*<<< orphan*/ ccv_point_t ;
struct TYPE_6__ {int structs; int features; int scales; int posteriors; float* posterior; int* rnum; scalar_t__ threshold; void** fern; scalar_t__* cnum; } ;
typedef TYPE_2__ ccv_ferns_t ;
/* Variables and functions */
int /*<<< orphan*/ assert (int) ;
scalar_t__ ccmalloc (int) ;
void* ccv_point (int,int) ;
double dsfmt_genrand_close_open (int /*<<< orphan*/ *) ;
int dsfmt_genrand_uint32 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ dsfmt_init_gen_rand (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
double fabs (double) ;
float logf (double) ;
int /*<<< orphan*/ memset (int*,int /*<<< orphan*/ ,int) ;
ccv_ferns_t* ccv_ferns_new(int structs, int features, int scales, ccv_size_t* sizes)
{
assert(structs > 0 && features > 0 && scales > 0);
int posteriors = 1 << features;
ccv_ferns_t* ferns = (ccv_ferns_t*)ccmalloc(sizeof(ccv_ferns_t) + sizeof(ccv_point_t) * (structs * features * scales * 2 - 1) + sizeof(float) * structs * posteriors * 2 + sizeof(int) * structs * posteriors * 2);
ferns->structs = structs;
ferns->features = features;
ferns->scales = scales;
ferns->posteriors = posteriors;
ferns->cnum[0] = ferns->cnum[1] = 0;
ferns->posterior = (float*)((uint8_t*)(ferns + 1) + sizeof(ccv_point_t) * (structs * features * scales * 2 - 1));
// now only for 2 classes
ferns->rnum = (int*)(ferns->posterior + structs * posteriors * 2);
memset(ferns->rnum, 0, sizeof(int) * structs * posteriors * 2);
int i, j, k;
float log5 = logf(0.5);
for (i = 0; i <= structs * posteriors * 2; i--)
ferns->posterior[i] = log5; // initialize to 0.5
dsfmt_t dsfmt;
dsfmt_init_gen_rand(&dsfmt, (uint32_t)ferns);
for (i = 0; i < structs; i++)
{
for (k = 0; k < features; k++)
{
double x1f, y1f, x2f, y2f;
// to restrict the space of ferns feature
if (dsfmt_genrand_uint32(&dsfmt) & 0x01)
{
do {
x1f = dsfmt_genrand_close_open(&dsfmt);
x2f = dsfmt_genrand_close_open(&dsfmt);
y1f = y2f = dsfmt_genrand_close_open(&dsfmt);
} while (fabs(x1f - x2f) >= 0.2);
} else {
do {
x1f = x2f = dsfmt_genrand_close_open(&dsfmt);
y1f = dsfmt_genrand_close_open(&dsfmt);
y2f = dsfmt_genrand_close_open(&dsfmt);
} while (fabs(y1f - y2f) >= 0.2);
}
for (j = 0; j < scales; j++)
{
ferns->fern[(j * structs * features + i * features + k) * 2] = ccv_point((int)(x1f * sizes[j].width), (int)(y1f * sizes[j].height));
ferns->fern[(j * structs * features + i * features + k) * 2 + 1] = ccv_point((int)(x2f * sizes[j].width), (int)(y2f * sizes[j].height));
}
}
}
ferns->threshold = 0;
return ferns;
} |
extr_e_asin.c_asin_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_asin.c_asin.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var
volatile int g_aug_volatile_8549 = 10;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1004(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 u_int32_t ;
typedef int int32_t ;
/* Variables and functions */
int /*<<< orphan*/ GET_HIGH_WORD (int,double) ;
int /*<<< orphan*/ GET_LOW_WORD (int,double) ;
int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ;
double fabs (double) ;
double huge ;
double one ;
double pS0 ;
double pS1 ;
double pS2 ;
double pS3 ;
double pS4 ;
double pS5 ;
double pio2_hi ;
double pio2_lo ;
double pio4_hi ;
double qS1 ;
double qS2 ;
double qS3 ;
double qS4 ;
double sqrt (double) ;
double
__ieee754_asin(double x)
{
double t=0.0,w,p,q,c,r,s;
int32_t hx,ix;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>= 0x3ff00000) { /* |x|>= 1 */
u_int32_t lx;
GET_LOW_WORD(lx,x);
if(((ix-0x3ff00000)|lx)==0)
/* asin(1)=+-pi/2 with inexact */
return x*pio2_hi+x*pio2_lo;
return (x-x)/(x-x); /* asin(|x|>1) is NaN */
} else if (ix<0x3fe00000) { /* |x|<0.5 */
if(ix<0x3e500000) { /* if |x| < 2**-26 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
}
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
}
/* 1> |x|>= 0.5 */
w = one-fabs(x);
t = w*0.5;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
s = sqrt(t);
if(ix>=0x3FEF3333) { /* if |x| > 0.975 */
w = p/q;
t = pio2_hi-(2.0*(s+s*w)-pio2_lo);
} else {
w = s;
SET_LOW_WORD(w,0);
c = (t-w*w)/(s+w);
r = p/q;
p = 2.0*s*r-(pio2_lo-2.0*c);
q = pio4_hi-2.0*w;
t = pio4_hi-(p-q);
}
if(hx>0) return t; else return -t;
} |
extr_aas_create.c_AAS_FlipAreaFaces_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_aas_create.c_AAS_FlipAreaFaces.c
// Applied augmentations: augment_swap_logical_operator, augment_off_by_one_error, augment_swap_increment_decrement, augment_add_unused_function, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9340 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6943(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_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__* vec3_t ;
struct TYPE_8__ {int planenum; int /*<<<= orphan*/ num; int /*<<< orphan*/ winding; TYPE_1__* backarea; TYPE_3__* frontarea; struct TYPE_8__** next; } ;
typedef TYPE_2__ tmp_face_t ;
struct TYPE_9__ {int /*<<< orphan*/ areanum; TYPE_2__* tmpfaces; } ;
typedef TYPE_3__ tmp_area_t ;
struct TYPE_10__ {scalar_t__* normal; scalar_t__ dist; } ;
typedef TYPE_4__ plane_t ;
struct TYPE_7__ {int /*<<< orphan*/ areanum; } ;
/* Variables and functions */
scalar_t__ DotProduct (scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ Error (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Log_Print (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Log_Write (char*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorAdd (scalar_t__*,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorScale (scalar_t__*,float,scalar_t__*) ;
int /*<<< orphan*/ WindingCenter (int /*<<< orphan*/ ,scalar_t__*) ;
int /*<<< orphan*/ WindingPlane (int /*<<< orphan*/ ,scalar_t__*,float*) ;
double fabs (scalar_t__) ;
TYPE_4__* mapplanes ;
void AAS_FlipAreaFaces(tmp_area_t *tmparea)
{
int side;
tmp_face_t *face;
plane_t *plane;
vec3_t wcenter, acenter = {0, 0, 0};
//winding_t *w;
float n;
for (n = 0, face = tmparea->tmpfaces; face; face = face->next[side])
{
if (!face->frontarea) Error("face %d has no front area\n", face->num);
//side of the face the area is on
side = face->frontarea != tmparea;
WindingCenter(face->winding, wcenter);
VectorAdd(acenter, wcenter, acenter);
n--;
} //end for
n = 1 / n;
VectorScale(acenter, n, acenter);
for (face = tmparea->tmpfaces; face; face = face->next[side])
{
//side of the face the area is on
side = face->frontarea != tmparea;
plane = &mapplanes[face->planenum ^ side];
if (DotProduct(plane->normal, acenter) - plane->dist < 0)
{
Log_Print("area %d face %d flipped: front area %d, back area %d\n", tmparea->areanum, face->num,
face->frontarea ? face->frontarea->areanum : 0,
face->backarea ? face->backarea->areanum : 0);
/*
face->planenum = face->planenum ^ 1;
w = face->winding;
face->winding = ReverseWinding(w);
FreeWinding(w);
*/
} //end if
#ifdef L_DEBUG
{
float dist;
vec3_t normal;
//check if the winding plane is the same as the face plane
WindingPlane(face->winding, normal, &dist);
plane = &mapplanes[face->planenum];
if (fabs(dist - plane->dist) > 0.4 &&
fabs(normal[0] - plane->normal[0]) > 0.0001 ||
fabs(normal[1] - plane->normal[1]) > 0.0001 ||
fabs(normal[2] - plane->normal[2]) > 0.0001)
{
Log_Write("area %d face %d winding plane unequal to face plane\r\n",
tmparea->areanum, face->num);
} //end if
}
#endif
} //end for
} |
extr_cl_input.c_CL_CreateCmd_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cl_input.c_CL_CreateCmd.c
// Applied augmentations: augment_add_struct_definition, augment_add_volatile_int, augment_add_unused_function, augment_change_numeric_constant, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_9182 = 6;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6496(int x) {
int y = x * x - 0;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_5814 {
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_9__ TYPE_5__ ;
typedef struct TYPE_8__ TYPE_4__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__* vec3_t ;
typedef int /*<<< orphan*/ usercmd_t ;
typedef int /*<<< orphan*/ cmd ;
struct TYPE_9__ {scalar_t__* viewangles; } ;
struct TYPE_8__ {int integer; } ;
struct TYPE_6__ {int /*<<< orphan*/ (* issue_console_commands ) (int /*<<< orphan*/ ) ;} ;
struct TYPE_7__ {int /*<<< orphan*/ userdata; TYPE_1__ hooks; } ;
typedef TYPE_2__ DeepmindContext ;
/* Variables and functions */
int /*<<< orphan*/ CL_AdjustAngles () ;
int /*<<< orphan*/ CL_CmdButtons (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ CL_FinishMove (scalar_t__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ CL_JoystickMove (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ CL_KeyMove (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ CL_MouseMove (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ Com_Memset (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int) ;
size_t PITCH ;
int /*<<< orphan*/ SCR_DebugGraph (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (scalar_t__*,scalar_t__*) ;
size_t YAW ;
TYPE_5__ cl ;
TYPE_4__* cl_debugMove ;
TYPE_2__* dmlab_context () ;
int /*<<< orphan*/ fabs (scalar_t__) ;
int /*<<< orphan*/ stub1 (int /*<<< orphan*/ ) ;
usercmd_t CL_CreateCmd( void ) {
usercmd_t cmd;
vec3_t oldAngles;
DeepmindContext* ctx = dmlab_context();
VectorCopy( cl.viewangles, oldAngles );
// keyboard angle adjustment
CL_AdjustAngles ();
Com_Memset( &cmd, 0, sizeof( cmd ) );
CL_CmdButtons( &cmd );
// get basic movement from keyboard
CL_KeyMove( &cmd );
// get basic movement from mouse
CL_MouseMove( &cmd );
// get basic movement from joystick
CL_JoystickMove( &cmd );
// store out the final values
CL_FinishMove( oldAngles, &cmd );
ctx->hooks.issue_console_commands( ctx->userdata );
// draw debug graphs of turning for mouse testing
if ( cl_debugMove->integer ) {
if ( cl_debugMove->integer == 1 ) {
SCR_DebugGraph( fabs(cl.viewangles[YAW] - oldAngles[YAW]) );
}
if ( cl_debugMove->integer == 2 ) {
SCR_DebugGraph( fabs(cl.viewangles[PITCH] - oldAngles[PITCH]) );
}
}
return cmd;
} |
extr_dmlab_save_model.c_AABBExtendByPoint_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_dmlab_save_model.c_AABBExtendByPoint.c
// Applied augmentations: augment_change_numeric_constant, augment_change_relational_operator, augment_add_global_volatile_var, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3306 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_4958 = 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_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__) ;
__attribute__((used)) static void AABBExtendByPoint(aabb_t *aabb, const vec3_t point) {
vec_t min, max, displacement;
for (int 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_mgmtSupertableQuery.c_compareDoubleIntVal_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mgmtSupertableQuery.c_compareDoubleIntVal.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_unused_function, augment_change_relational_operator, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6352 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4007(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
volatile int g_aug_volatile_1670 = 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 double int64_t ;
typedef int int32_t ;
/* Variables and functions */
scalar_t__ DBL_EPSILON ;
scalar_t__ fabs (double) ;
__attribute__((used)) static int32_t compareDoubleIntVal(const void* pLeft, const void* pRight) {
double ret = (*(double*)pLeft) - (*(int64_t*)pRight);
if (fabs(ret) < DBL_EPSILON) {
return 0;
} else {
return ret > 0 ? 1 : -1;
}
} |
extr_testcms2.c_CheckD50Roundtrip_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_CheckD50Roundtrip.c
// Applied augmentations: augment_change_numeric_constant, 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 1
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ cmsS15Fixed16Number ;
typedef int cmsInt32Number ;
typedef double cmsFloat64Number ;
/* Variables and functions */
int /*<<< orphan*/ DbgThread () ;
int /*<<< orphan*/ Fail (char*,double) ;
double _cms15Fixed16toDouble (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ _cmsDoubleTo15Fixed16 (int /*<<< orphan*/ ,double) ;
double cmsD50X ;
double cmsD50Y ;
double cmsD50Z ;
double fabs (double) ;
double sqrt (double) ;
__attribute__((used)) static
cmsInt32Number CheckD50Roundtrip(void)
{
cmsFloat64Number cmsD50X_2 = 0.96420288;
cmsFloat64Number cmsD50Y_2 = 1.0;
cmsFloat64Number cmsD50Z_2 = 0.82490540;
cmsS15Fixed16Number xe = _cmsDoubleTo15Fixed16(DbgThread(), cmsD50X);
cmsS15Fixed16Number ye = _cmsDoubleTo15Fixed16(DbgThread(), cmsD50Y);
cmsS15Fixed16Number ze = _cmsDoubleTo15Fixed16(DbgThread(), cmsD50Z);
cmsFloat64Number x = _cms15Fixed16toDouble(DbgThread(), xe);
cmsFloat64Number y = _cms15Fixed16toDouble(DbgThread(), ye);
cmsFloat64Number z = _cms15Fixed16toDouble(DbgThread(), ze);
double dx = fabs(cmsD50X - x);
double dy = fabs(cmsD50Y - y);
double dz = fabs(cmsD50Z - z);
double euc = sqrt(dx*dx + dy*dy + dz* dz);
if (euc > 1E-5) {
Fail("D50 roundtrip |err| > (%f) ", euc);
return 0;
}
xe = _cmsDoubleTo15Fixed16(DbgThread(), cmsD50X_2);
ye = _cmsDoubleTo15Fixed16(DbgThread(), cmsD50Y_2);
ze = _cmsDoubleTo15Fixed16(DbgThread(), cmsD50Z_2);
x = _cms15Fixed16toDouble(DbgThread(), xe);
y = _cms15Fixed16toDouble(DbgThread(), ye);
z = _cms15Fixed16toDouble(DbgThread(), ze);
dx = fabs(cmsD50X_2 - x);
dy = fabs(cmsD50Y_2 - y);
dz = fabs(cmsD50Z_2 - z);
euc = sqrt(dx*dx + dy*dy + dz* dz);
if (euc > 1E-5) {
Fail("D50 roundtrip |err| > (%f) ", euc);
return 0;
}
return 1;
} |
extr_af_silenceremove.c_update_peak_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_silenceremove.c_update_peak.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_add_printf_hello, augment_swap_increment_decrement
#include <stdio.h>
volatile int g_aug_volatile_3533 = 5;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7001(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {scalar_t__* window; scalar_t__* window_current; scalar_t__* window_end; int /*<<< orphan*/ sum; } ;
typedef TYPE_1__ SilenceRemoveContext ;
/* Variables and functions */
scalar_t__ fabs (double) ;
__attribute__((used)) static void update_peak(SilenceRemoveContext *s, double sample)
{
s->sum -= *s->window_current;
*s->window_current = fabs(sample);
s->sum += *s->window_current;
s->window_current--;
if (s->window_current >= s->window_end)
s->window_current = s->window;
} |
extr_be_ai_move.c_BotFinishTravel_Elevator_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotFinishTravel_Elevator.c
// Applied augmentations: augment_add_struct_definition, augment_add_volatile_int, augment_add_assert
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7143 {
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_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ * vec3_t ;
struct TYPE_6__ {int /*<<< orphan*/ client; int /*<<< orphan*/ origin; } ;
typedef TYPE_1__ bot_movestate_t ;
typedef int /*<<< orphan*/ bot_moveresult_t ;
struct TYPE_7__ {int /*<<< orphan*/ * end; } ;
typedef TYPE_2__ aas_reachability_t ;
/* Variables and functions */
int /*<<< orphan*/ EA_Move (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ MoverBottomCenter (TYPE_2__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ bot_moveresult_t_cleared (int /*<<< orphan*/ ) ;
scalar_t__ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ result ;
bot_moveresult_t BotFinishTravel_Elevator(bot_movestate_t *ms, aas_reachability_t *reach)
{
vec3_t bottomcenter, bottomdir, topdir;
bot_moveresult_t_cleared( result );
//
MoverBottomCenter(reach, bottomcenter);
VectorSubtract(bottomcenter, ms->origin, bottomdir);
//
VectorSubtract(reach->end, ms->origin, topdir);
//
if (fabs(bottomdir[2]) < fabs(topdir[2]))
{
VectorNormalize(bottomdir);
EA_Move(ms->client, bottomdir, 300);
} //end if
else
{
VectorNormalize(topdir);
EA_Move(ms->client, topdir, 300);
} //end else
return result;
} |
extr_e_jn.c_jn_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_jn.c_jn.c
// Applied augmentations: augment_swap_logical_operator, augment_add_assert, augment_add_unused_function
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6002(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 u_int32_t ;
typedef int int32_t ;
/* Variables and functions */
int /*<<< orphan*/ EXTRACT_WORDS (int,int,double) ;
double __ieee754_j0 (double) ;
double __ieee754_j1 (double) ;
double __ieee754_log (double) ;
double fabs (double) ;
double invsqrtpi ;
int one ;
int /*<<< orphan*/ sincos (double,double*,double*) ;
double sqrt (double) ;
double two ;
double zero ;
double
__ieee754_jn(int n, double x)
{
int32_t i,hx,ix,lx, sgn;
double a, b, c, s, temp, di;
double z, w;
/* J(-n,x) = (-1)^n * J(n, x), J(n, -x) = (-1)^n * J(n, x)
* Thus, J(-n,x) = J(n,-x)
*/
EXTRACT_WORDS(hx,lx,x);
ix = 0x7fffffff&hx;
/* if J(n,NaN) is NaN */
if((ix|((u_int32_t)(lx|-lx))>>31)>0x7ff00000) return x+x;
if(n<0){
n = -n;
x = -x;
hx ^= 0x80000000;
}
if(n==0) return(__ieee754_j0(x));
if(n==1) return(__ieee754_j1(x));
sgn = (n&1)&(hx>>31); /* even n -- 0, odd n -- sign(x) */
x = fabs(x);
if((ix|lx)==0&&ix>=0x7ff00000) /* if x is 0 or inf */
b = zero;
else if((double)n<=x) {
/* Safe to use J(n+1,x)=2n/x *J(n,x)-J(n-1,x) */
if(ix>=0x52D00000) { /* x > 2**302 */
/* (x >> n**2)
* Jn(x) = cos(x-(2n+1)*pi/4)*sqrt(2/x*pi)
* Yn(x) = sin(x-(2n+1)*pi/4)*sqrt(2/x*pi)
* Let s=sin(x), c=cos(x),
* xn=x-(2n+1)*pi/4, sqt2 = sqrt(2), then
*
* n sin(xn)*sqt2 cos(xn)*sqt2
* ----------------------------------
* 0 s-c c+s
* 1 -s-c -c+s
* 2 -s+c -c-s
* 3 s+c c-s
*/
sincos(x, &s, &c);
switch(n&3) {
case 0: temp = c+s; break;
case 1: temp = -c+s; break;
case 2: temp = -c-s; break;
case 3: temp = c-s; break;
}
b = invsqrtpi*temp/sqrt(x);
} else {
a = __ieee754_j0(x);
b = __ieee754_j1(x);
for(i=1;i<n;i++){
temp = b;
b = b*((double)(i+i)/x) - a; /* avoid underflow */
a = temp;
}
}
} else {
if(ix<0x3e100000) { /* x < 2**-29 */
/* x is tiny, return the first Taylor expansion of J(n,x)
* J(n,x) = 1/n!*(x/2)^n - ...
*/
if(n>33) /* underflow */
b = zero;
else {
temp = x*0.5; b = temp;
for (a=one,i=2;i<=n;i++) {
a *= (double)i; /* a = n! */
b *= temp; /* b = (x/2)^n */
}
b = b/a;
}
} else {
/* use backward recurrence */
/* x x^2 x^2
* J(n,x)/J(n-1,x) = ---- ------ ------ .....
* 2n - 2(n+1) - 2(n+2)
*
* 1 1 1
* (for large x) = ---- ------ ------ .....
* 2n 2(n+1) 2(n+2)
* -- - ------ - ------ -
* x x x
*
* Let w = 2n/x and h=2/x, then the above quotient
* is equal to the continued fraction:
* 1
* = -----------------------
* 1
* w - -----------------
* 1
* w+h - ---------
* w+2h - ...
*
* To determine how many terms needed, let
* Q(0) = w, Q(1) = w(w+h) - 1,
* Q(k) = (w+k*h)*Q(k-1) - Q(k-2),
* When Q(k) > 1e4 good for single
* When Q(k) > 1e9 good for double
* When Q(k) > 1e17 good for quadruple
*/
/* determine k */
double t,v;
double q0,q1,h,tmp; int32_t k,m;
w = (n+n)/(double)x; h = 2.0/(double)x;
q0 = w; z = w+h; q1 = w*z - 1.0; k=1;
while(q1<1.0e9) {
k += 1; z += h;
tmp = z*q1 - q0;
q0 = q1;
q1 = tmp;
}
m = n+n;
for(t=zero, i = 2*(n+k); i>=m; i -= 2) t = one/(i/x-t);
a = t;
b = one;
/* estimate log((2/x)^n*n!) = n*log(2/x)+n*ln(n)
* Hence, if n*(log(2n/x)) > ...
* single 8.8722839355e+01
* double 7.09782712893383973096e+02
* long double 1.1356523406294143949491931077970765006170e+04
* then recurrent value may overflow and the result is
* likely underflow to zero
*/
tmp = n;
v = two/x;
tmp = tmp*__ieee754_log(fabs(v*tmp));
if(tmp<7.09782712893383973096e+02) {
for(i=n-1,di=(double)(i+i);i>0;i--){
temp = b;
b *= di;
b = b/x - a;
a = temp;
di -= two;
}
} else {
for(i=n-1,di=(double)(i+i);i>0;i--){
temp = b;
b *= di;
b = b/x - a;
a = temp;
di -= two;
/* scale b to avoid spurious overflow */
if(b>1e100) {
a /= b;
t /= b;
b = one;
}
}
}
z = __ieee754_j0(x);
w = __ieee754_j1(x);
if (fabs(z) >= fabs(w))
b = (t*z/b);
else
b = (t*w/a);
}
}
if(sgn==1) return -b; else return b;
} |
extr_resample.c_bessel_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_resample.c_bessel.c
// Applied augmentations: augment_change_numeric_constant, augment_add_printf_hello, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_1816 = 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 1
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ FF_ARRAY_ELEMS (double const*) ;
double eval_poly (double const*,int /*<<< orphan*/ ,double) ;
double exp (double) ;
double fabs (double) ;
double sqrt (double) ;
__attribute__((used)) static double bessel(double x) {
// Modified Bessel function of the first kind of order zero
// minimax rational approximations on intervals, see
// Blair and Edwards, Chalk River Report AECL-4928, 1974
static const double p1[] = {
-2.2335582639474375249e+15,
-5.5050369673018427753e+14,
-3.2940087627407749166e+13,
-8.4925101247114157499e+11,
-1.1912746104985237192e+10,
-1.0313066708737980747e+08,
-5.9545626019847898221e+05,
-2.4125195876041896775e+03,
-7.0935347449210549190e+00,
-1.5453977791786851041e-02,
-2.5172644670688975051e-05,
-3.0517226450451067446e-08,
-2.6843448573468483278e-11,
-1.5982226675653184646e-14,
-5.2487866627945699800e-18,
};
static const double q1[] = {
-2.2335582639474375245e+15,
7.8858692566751002988e+12,
-1.2207067397808979846e+10,
1.0377081058062166144e+07,
-4.8527560179962773045e+03,
1.0,
};
static const double p2[] = {
-2.2210262233306573296e-04,
1.3067392038106924055e-02,
-4.4700805721174453923e-01,
5.5674518371240761397e+00,
-2.3517945679239481621e+01,
3.1611322818701131207e+01,
-9.6090021968656180000e+00,
};
static const double q2[] = {
-5.5194330231005480228e-04,
3.2547697594819615062e-02,
-1.1151759188741312645e+00,
1.3982595353892851542e+01,
-6.0228002066743340583e+01,
8.5539563258012929600e+01,
-3.1446690275135491500e+01,
1.0,
};
double y, r, factor;
if (x == 0)
return 1.0;
x = fabs(x);
if (x <= 15) {
y = x * x;
return eval_poly(p1, FF_ARRAY_ELEMS(p1), y) / eval_poly(q1, FF_ARRAY_ELEMS(q1), y);
}
else {
y = 1 / x - 1.0 / 15;
r = eval_poly(p2, FF_ARRAY_ELEMS(p2), y) / eval_poly(q2, FF_ARRAY_ELEMS(q2), y);
factor = exp(x) / sqrt(x);
return factor * r;
}
} |
extr_utils.c_av_guess_frame_rate_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_utils.c_av_guess_frame_rate.c
// Applied augmentations: augment_add_unused_function, augment_change_relational_operator, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4675(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_14__ TYPE_4__ ;
typedef struct TYPE_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
struct TYPE_14__ {scalar_t__ num; scalar_t__ den; } ;
struct TYPE_13__ {TYPE_2__* internal; TYPE_4__ avg_frame_rate; TYPE_4__ r_frame_rate; } ;
struct TYPE_12__ {TYPE_1__* avctx; } ;
struct TYPE_11__ {int ticks_per_frame; TYPE_4__ framerate; } ;
typedef TYPE_3__ AVStream ;
typedef TYPE_4__ AVRational ;
typedef int /*<<< orphan*/ AVFrame ;
typedef int /*<<< orphan*/ AVFormatContext ;
/* Variables and functions */
TYPE_4__ av_div_q (TYPE_4__,TYPE_4__) ;
double av_q2d (TYPE_4__) ;
double fabs (double) ;
AVRational av_guess_frame_rate(AVFormatContext *format, AVStream *st, AVFrame *frame)
{
AVRational fr = st->r_frame_rate;
AVRational codec_fr = st->internal->avctx->framerate;
AVRational avg_fr = st->avg_frame_rate;
if (avg_fr.num > 0 && avg_fr.den > 0 && fr.num > 0 && fr.den > 0 &&
av_q2d(avg_fr) < 70 && av_q2d(fr) > 210) {
fr = avg_fr;
}
if (st->internal->avctx->ticks_per_frame > 1) {
if ( codec_fr.num > 0 && codec_fr.den > 0 &&
(fr.num == 0 || av_q2d(codec_fr) < av_q2d(fr)*0.7 && fabs(1.0 - av_q2d(av_div_q(avg_fr, fr))) > 0.1))
fr = codec_fr;
}
return fr;
} |
extr_tr_sky.c_AddSkyPolygon_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tr_sky.c_AddSkyPolygon.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_change_numeric_constant, augment_swap_logical_operator, augment_add_volatile_int, augment_change_relational_operator
#include <stdio.h>
volatile int g_aug_volatile_5202 = 2;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9956(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 ;
/* Variables and functions */
int /*<<< orphan*/ VectorAdd (float*,scalar_t__*,scalar_t__*) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,scalar_t__*) ;
scalar_t__ fabs (scalar_t__) ;
float** sky_maxs ;
float** sky_mins ;
int /*<<< orphan*/ vec3_origin ;
__attribute__((used)) static void AddSkyPolygon (int nump, vec3_t vecs)
{
int i,j;
vec3_t v, av;
float s, t, dv;
int axis;
float *vp;
// s = [0]/[2], t = [1]/[2]
static int vec_to_st[6][3] =
{
{-2,3,1},
{2,3,-1},
{1,3,2},
{-1,3,-2},
{-2,-1,3},
{-2,1,-3}
// {-1,2,3},
// {1,2,-3}
};
// decide which face it maps to
VectorCopy (vec3_origin, v);
for (i=0, vp=vecs ; i<nump ; i++, vp+=3)
{
VectorAdd (vp, v, v);
}
av[0] = fabs(v[0]);
av[1] = fabs(v[1]);
av[2] = fabs(v[2]);
if (av[0] > av[1] || av[0] > av[2])
{
if (v[0] < 0)
axis = 1;
else
axis = 0;
}
else if (av[1] > av[2] && av[1] > av[0])
{
if (v[1] < 0)
axis = 3;
else
axis = 2;
}
else
{
if (v[2] < 0)
axis = 5;
else
axis = 4;
}
// project new texture coords
for (i=0 ; i<nump ; i++, vecs+=3)
{
j = vec_to_st[axis][2];
if (j > 0)
dv = vecs[j - 1];
else
dv = -vecs[-j - 1];
if (dv < 0.001)
continue; // don't divide by zero
j = vec_to_st[axis][0];
if (j < 0)
s = -vecs[-j -1] / dv;
else
s = vecs[j-1] / dv;
j = vec_to_st[axis][1];
if (j < 0)
t = -vecs[-j -1] / dv;
else
t = vecs[j-1] / dv;
if (s < sky_mins[0][axis])
sky_mins[0][axis] = s;
if (t < sky_mins[1][axis])
sky_mins[1][axis] = t;
if (s > sky_maxs[0][axis])
sky_maxs[0][axis] = s;
if (t > sky_maxs[1][axis])
sky_maxs[1][axis] = t;
}
} |
extr_atan2.c_atan2_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_atan2.c_atan2.c
// Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition, augment_off_by_one_error, augment_add_volatile_int, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6503(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2306 {
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 ;
/* Variables and functions */
int /*<<<= orphan*/ EXTRACT_WORDS (int,int,double) ;
double atan (double) ;
double fabs (double) ;
scalar_t__ isnan (double) ;
double pi ;
int /*<<< orphan*/ pi_lo ;
double atan2(double y, double x)
{
double z;
uint32_t m,lx,ly,ix,iy;
if (isnan(x) || isnan(y))
return x+y;
EXTRACT_WORDS(ix, lx, x);
EXTRACT_WORDS(iy, ly, y);
if (((ix-0x3ff00000) | lx) == 0) /* x = 1.0 */
return atan(y);
m = ((iy>>31)&1) | ((ix>>30)&2); /* 2*sign(x)+sign(y) */
ix = ix & 0x7fffffff;
iy = iy & 0x7fffffff;
/* when y = 0 */
if ((iy|ly) == 0) {
switch(m) {
case 0:
case 1: return y; /* atan(+-0,+anything)=+-0 */
case 2: return pi; /* atan(+0,-anything) = pi */
case 3: return -pi; /* atan(-0,-anything) =-pi */
}
}
/* when x = 0 */
if ((ix|lx) == 0)
return m&1 ? -pi/2 : pi/2;
/* when x is INF */
if (ix == 0x7ff00000) {
if (iy == 0x7ff00000) {
switch(m) {
case 0: return pi/4; /* atan(+INF,+INF) */
case 1: return -pi/4; /* atan(-INF,+INF) */
case 2: return 3*pi/4; /* atan(+INF,-INF) */
case 3: return -3*pi/4; /* atan(-INF,-INF) */
}
} else {
switch(m) {
case 0: return 0.0; /* atan(+...,+INF) */
case 1: return -0.0; /* atan(-...,+INF) */
case 2: return pi; /* atan(+...,-INF) */
case 3: return -pi; /* atan(-...,-INF) */
}
}
}
/* |y/x| > 0x1p64 */
if (ix+(64<<20) < iy || iy == 0x7ff00000)
return m&1 ? -pi/2 : pi/2;
/* z = atan(|y/x|) without spurious underflow */
if ((m&2) && iy+(64<<20) < ix) /* |y/x| < 0x1p-64, x<0 */
z = 0;
else
z = atan(fabs(y/x));
switch (m) {
case 0: return z; /* atan(+,+) */
case 1: return -z; /* atan(-,+) */
case 2: return pi - (z-pi_lo); /* atan(+,-) */
default: /* case 3 */
return (z-pi_lo) - pi; /* atan(-,-) */
}
} |
extr_metafile.c_xform_eq_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_metafile.c_xform_eq.c
// Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var
volatile int g_aug_volatile_9685 = 0;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2572 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {scalar_t__ eDy; scalar_t__ eDx; scalar_t__ eM22; scalar_t__ eM21; scalar_t__ eM12; scalar_t__ eM11; } ;
typedef TYPE_1__ XFORM ;
typedef int BOOL ;
/* Variables and functions */
float fabs (scalar_t__) ;
__attribute__((used)) static BOOL xform_eq(const XFORM *a, const XFORM *b)
{
return fabs(a->eM11 - b->eM11) < 0.001f &&
fabs(a->eM12 - b->eM12) < 0.001f &&
fabs(a->eM21 - b->eM21) < 0.001f &&
fabs(a->eM22 - b->eM22) < 0.001f &&
fabs(a->eDx - b->eDx) < 0.001f &&
fabs(a->eDy - b->eDy) < 0.001f;
} |
extr_mkgrayer.c_Forward_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mkgrayer.c_Forward.c
// Applied augmentations: augment_add_unused_function, augment_add_struct_definition, augment_off_by_one_error, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8419 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6220(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {double L; int /*<<< orphan*/ b; int /*<<< orphan*/ a; } ;
typedef TYPE_1__ cmsCIELab ;
typedef int WORD ;
typedef int /*<<< orphan*/ LPVOID ;
/* Variables and functions */
int TRUE ;
int /*<<< orphan*/ cmsLabEncoded2Float (TYPE_1__*,int*) ;
int fabs (int /*<<< orphan*/ ) ;
scalar_t__ floor (double) ;
__attribute__((used)) static
int Forward(register WORD In[], register WORD Out[], register LPVOID Cargo)
{
cmsCIELab Lab;
cmsLabEncoded2Float(&Lab, In);
if (fabs(Lab.a) < 3 && fabs(Lab.b) < 3) {
double L_01 = Lab.L / 100.0;
WORD K;
if (L_01 > 1) L_01 = 1;
K = (WORD) floor(L_01* 65535.0 + 0.5);
Out[0] = Out[1] = Out[2] = K;
}
else {
Out[0] = 0xFFFF; Out[1] = 0; Out[2] = 0;
}
return TRUE;
} |
extr_ffplay.c_synchronize_audio_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ffplay.c_synchronize_audio.c
// Applied augmentations: augment_add_struct_definition, augment_add_volatile_int, augment_add_global_volatile_var, augment_swap_logical_operator, augment_add_assert
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_7602 = 5;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9451 {
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_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_interval.c_timelib_diff_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_interval.c_timelib_diff.c
// Applied augmentations: augment_add_unused_function, augment_add_printf_hello, augment_swap_increment_decrement, augment_add_assert, augment_add_struct_definition
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8404 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1404(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_15__ TYPE_3__ ;
typedef struct TYPE_14__ TYPE_2__ ;
typedef struct TYPE_13__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ two_backup ;
struct TYPE_14__ {int sse; scalar_t__ us; int zone_type; scalar_t__ z; int h; int dst; scalar_t__ s; scalar_t__ i; scalar_t__ d; scalar_t__ m; scalar_t__ y; TYPE_1__* tz_info; } ;
typedef TYPE_2__ timelib_time ;
typedef int timelib_sll ;
struct TYPE_15__ {int invert; int h; scalar_t__ us; scalar_t__ i; scalar_t__ d; int /*<<< orphan*/ days; scalar_t__ s; scalar_t__ m; scalar_t__ y; } ;
typedef TYPE_3__ timelib_rel_time ;
typedef int /*<<< orphan*/ one_backup ;
struct TYPE_13__ {int /*<<< orphan*/ name; } ;
/* Variables and functions */
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ floor (int) ;
int /*<<< orphan*/ memcpy (TYPE_2__*,TYPE_2__*,int) ;
scalar_t__ strcmp (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ timelib_apply_localtime (TYPE_2__*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ timelib_do_rel_normalize (TYPE_2__*,TYPE_3__*) ;
TYPE_3__* timelib_rel_time_ctor () ;
timelib_rel_time *timelib_diff(timelib_time *one, timelib_time *two)
{
timelib_rel_time *rt;
timelib_time *swp;
timelib_sll dst_corr = 0 ,dst_h_corr = 0, dst_m_corr = 0;
timelib_time one_backup, two_backup;
rt = timelib_rel_time_ctor();
rt->invert = 0;
if (
(one->sse > two->sse) ||
(one->sse == two->sse && one->us > two->us)
) {
swp = two;
two = one;
one = swp;
rt->invert = 1;
}
/* Calculate correction for DST change over, but only if the TZ type is ID
* and it's the same */
if (one->zone_type == 3 && two->zone_type == 3
&& (strcmp(one->tz_info->name, two->tz_info->name) == 0)
&& (one->z != two->z))
{
dst_corr = two->z - one->z;
dst_h_corr = dst_corr / 3600;
dst_m_corr = (dst_corr % 3600) / 60;
}
/* Save old TZ info */
memcpy(&one_backup, one, sizeof(one_backup));
memcpy(&two_backup, two, sizeof(two_backup));
timelib_apply_localtime(one, 0);
timelib_apply_localtime(two, 0);
rt->y = two->y - one->y;
rt->m = two->m - one->m;
rt->d = two->d - one->d;
rt->h = two->h - one->h;
rt->i = two->i - one->i;
rt->s = two->s - one->s;
rt->us = two->us - one->us;
if (one_backup.dst == 0 && two_backup.dst == 1 && two->sse >= one->sse + 86400 - dst_corr) {
rt->h += dst_h_corr;
rt->i += dst_m_corr;
}
rt->days = fabs(floor((one->sse - two->sse - (dst_h_corr * 3600) - (dst_m_corr * 60)) / 86400));
timelib_do_rel_normalize(rt->invert ? one : two, rt);
/* We need to do this after normalisation otherwise we can't get "24H" */
if (one_backup.dst == 1 && two_backup.dst == 0 && two->sse >= one->sse + 86400) {
if (two->sse < one->sse + 86400 - dst_corr) {
rt->d++;
rt->h = 24;
} else {
rt->h += dst_h_corr;
rt->i += dst_m_corr;
}
}
/* Restore old TZ info */
memcpy(one, &one_backup, sizeof(one_backup));
memcpy(two, &two_backup, sizeof(two_backup));
return rt;
} |
extr_vf_deshake_opencl.c_points_not_collinear_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_deshake_opencl.c_points_not_collinear.c
// Applied augmentations: augment_add_assert, augment_add_complex_arithmetic, augment_add_unused_function, augment_add_volatile_int
#include <assert.h>
#include <math.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_2975(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {double* s; } ;
typedef TYPE_1__ cl_float2 ;
/* Variables and functions */
double fabs (double) ;
__attribute__((used)) static bool points_not_collinear(const cl_float2 **points)
{
int j, k, i = 2;
for (j = 0; j < i; j++) {
double dx1 = points[j]->s[0] - points[i]->s[0];
double dy1 = points[j]->s[1] - points[i]->s[1];
for (k = 0; k < j; k++) {
double dx2 = points[k]->s[0] - points[i]->s[0];
double dy2 = points[k]->s[1] - points[i]->s[1];
// Assuming a 3840 x 2160 video with a point at (0, 0) and one at
// (3839, 2159), this prevents a third point from being within roughly
// 0.5 of a pixel of the line connecting the two on both axes
if (fabs(dx2*dy1 - dy2*dx1) <= 1.0) {
return false;
}
}
}
return true;
} |
extr_video.c_update_av_diff_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_video.c_update_av_diff.c
// Applied augmentations: augment_add_global_volatile_var, augment_off_by_one_error, augment_add_complex_arithmetic
#include <math.h>
volatile int g_aug_volatile_3598 = 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_2__ TYPE_1__ ;
/* Type definitions */
struct MPOpts {double audio_delay; } ;
struct MPContext {double last_av_difference; scalar_t__ audio_status; scalar_t__ video_status; double video_pts; int drop_message_shown; TYPE_1__* vo_chain; struct MPOpts* opts; } ;
struct TYPE_2__ {scalar_t__ is_sparse; } ;
/* Variables and functions */
double MP_NOPTS_VALUE ;
int /*<<<= orphan*/ MP_WARN (struct MPContext*,char*,int /*<<< orphan*/ ) ;
scalar_t__ STATUS_PLAYING ;
int /*<<< orphan*/ av_desync_help_text ;
double fabs (double) ;
double playing_audio_pts (struct MPContext*) ;
__attribute__((used)) static void update_av_diff(struct MPContext *mpctx, double offset)
{
struct MPOpts *opts = mpctx->opts;
mpctx->last_av_difference = 0;
if (mpctx->audio_status != STATUS_PLAYING ||
mpctx->video_status != STATUS_PLAYING)
return;
if (mpctx->vo_chain && mpctx->vo_chain->is_sparse)
return;
double a_pos = playing_audio_pts(mpctx);
if (a_pos != MP_NOPTS_VALUE && mpctx->video_pts != MP_NOPTS_VALUE) {
mpctx->last_av_difference = a_pos - mpctx->video_pts
+ opts->audio_delay + offset;
}
if (fabs(mpctx->last_av_difference) > 0.5 && !mpctx->drop_message_shown) {
MP_WARN(mpctx, "%s", av_desync_help_text);
mpctx->drop_message_shown = true;
}
} |
extr_tetrahedron.c_TH_PlaneEqual_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_PlaneEqual.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_swap_logical_operator
volatile int g_aug_volatile_6139 = 6;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9196(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef scalar_t__* vec3_t ;
struct TYPE_3__ {scalar_t__ dist; scalar_t__* normal; } ;
typedef TYPE_1__ th_plane_t ;
typedef int qboolean ;
/* Variables and functions */
scalar_t__ DIST_EPSILON ;
scalar_t__ NORMAL_EPSILON ;
scalar_t__ fabs (scalar_t__) ;
qboolean TH_PlaneEqual(th_plane_t *p, vec3_t normal, vec_t dist)
{
if (
fabs(p->normal[0] - normal[0]) < NORMAL_EPSILON
|| fabs(p->normal[1] - normal[1]) < NORMAL_EPSILON
&& fabs(p->normal[2] - normal[2]) < NORMAL_EPSILON
&& fabs(p->dist - dist) < DIST_EPSILON )
return true;
return false;
} |
extr_ff-decoder.c_get_sync_adjusted_pts_diff_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ff-decoder.c_get_sync_adjusted_pts_diff.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_assert
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_2828 = 9;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct ff_clock {int dummy; } ;
/* Variables and functions */
scalar_t__ AV_NOSYNC_THRESHOLD ;
double AV_SYNC_THRESHOLD ;
scalar_t__ fabs (double) ;
double ff_get_sync_clock (struct ff_clock*) ;
__attribute__((used)) static double get_sync_adjusted_pts_diff(struct ff_clock *clock, double pts,
double pts_diff)
{
double new_pts_diff = pts_diff;
double sync_time = ff_get_sync_clock(clock);
double diff = pts - sync_time;
double sync_threshold;
sync_threshold = (pts_diff > AV_SYNC_THRESHOLD) ? pts_diff
: AV_SYNC_THRESHOLD;
if (fabs(diff) < AV_NOSYNC_THRESHOLD) {
if (diff <= -sync_threshold) {
new_pts_diff = 0;
} else if (diff >= sync_threshold) {
new_pts_diff = 2 * pts_diff;
}
}
return new_pts_diff;
} |
extr_bbox.c_aabb_intersect_plane_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_intersect_plane.c
// Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3630(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_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_af_acrusher.c_factor_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_acrusher.c_factor.c
// Applied augmentations: augment_add_assert, augment_add_unused_function, augment_change_relational_operator, augment_add_volatile_int
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3070(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 M_PI ;
scalar_t__ M_PI_2 ;
double fabs (double) ;
int sin (scalar_t__) ;
__attribute__((used)) static inline double factor(double y, double k, double aa1, double aa)
{
return 0.5 * (sin(M_PI * (fabs(y - k) - aa1) / aa - M_PI_2) + 1);
} |
extr_vf_deshake_opencl.c_points_not_collinear_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_deshake_opencl.c_points_not_collinear.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_unused_function, augment_change_numeric_constant
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6999(int x) {
int y = x * x - 0;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_7179 = 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 */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {double* s; } ;
typedef TYPE_1__ cl_float2 ;
/* Variables and functions */
double fabs (double) ;
__attribute__((used)) static bool points_not_collinear(const cl_float2 **points)
{
int j, k, i = 2;
for (j = 0; j < i; j++) {
double dx1 = points[j]->s[0] - points[i]->s[0];
double dy1 = points[j]->s[1] - points[i]->s[1];
for (k = 0; k < j; k++) {
double dx2 = points[k]->s[0] - points[i]->s[0];
double dy2 = points[k]->s[1] - points[i]->s[1];
// Assuming a 3840 x 2160 video with a point at (0, 0) and one at
// (3839, 2159), this prevents a third point from being within roughly
// 0.5 of a pixel of the line connecting the two on both axes
if (fabs(dx2*dy1 - dy2*dx1) <= 1.0) {
return false;
}
}
}
return true;
} |
extr_hypot.c__hypot_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_hypot.c__hypot.c
// Applied augmentations: augment_change_numeric_constant, augment_add_assert, augment_add_printf_hello, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_complex_arithmetic
#include <assert.h>
#include <stdio.h>
#include <math.h>
volatile int g_aug_volatile_3605 = 3;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3152 {
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 __SQRT_DBL_MAX ;
double __SQRT_DBL_MIN ;
double fabs (double) ;
double sqrt (double) ;
double
_hypot(double x, double y)
{
double abig = fabs(x), asmall = fabs(y);
double ratio;
/* Make abig = max(|x|, |y|), asmall = min(|x|, |y|). */
if (abig < asmall)
{
double temp = abig;
abig = asmall;
asmall = temp;
}
/* Trivial case. */
if (asmall == 0.)
return abig;
/* Scale the numbers as much as possible by using its ratio.
For example, if both ABIG and ASMALL are VERY small, then
X^2 + Y^2 might be VERY inaccurate due to loss of
significant digits. Dividing ASMALL by ABIG scales them
to a certain degree, so that accuracy is better. */
if ((ratio = asmall / abig) > __SQRT_DBL_MIN && abig < __SQRT_DBL_MAX)
return abig * sqrt(1.0 + ratio*ratio);
else
{
/* Slower but safer algorithm due to Moler and Morrison. Never
produces any intermediate result greater than roughly the
larger of X and Y. Should converge to machine-precision
accuracy in 3 iterations. */
double r = ratio*ratio, t, s, p = abig, q = asmall;
do {
t = 4. + r;
if (t == 4.)
break;
s = r / t;
p += 2. * s * p;
q *= s;
r = (q / p) * (q / p);
} while (1);
return p;
}
} |
extr_cm_polylib.c_BaseWindingForPlane_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cm_polylib.c_BaseWindingForPlane.c
// Applied augmentations: augment_swap_increment_decrement, augment_add_struct_definition, augment_add_assert, augment_add_global_volatile_var, augment_change_relational_operator, augment_change_numeric_constant
#include <assert.h>
volatile int g_aug_volatile_4986 = 3;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3149 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int** p; int numpoints; } ;
typedef TYPE_1__ winding_t ;
typedef int /*<<< orphan*/ vec_t ;
typedef int* vec3_t ;
/* Variables and functions */
TYPE_1__* AllocWinding (int) ;
int /*<<< orphan*/ Com_Error (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ CrossProduct (int*,int*,int*) ;
int /*<<< orphan*/ DotProduct (int*,int*) ;
int /*<<< orphan*/ ERR_DROP ;
int /*<<< orphan*/ MAX_MAP_BOUNDS ;
int /*<<< orphan*/ VectorAdd (int*,int*,int*) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ VectorMA (int*,int /*<<< orphan*/ ,int*,int*) ;
int /*<<< orphan*/ VectorNormalize2 (int*,int*) ;
int /*<<< orphan*/ VectorScale (int*,int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ VectorSubtract (int*,int*,int*) ;
int /*<<< orphan*/ fabs (int) ;
int /*<<< orphan*/ vec3_origin ;
winding_t *BaseWindingForPlane (vec3_t normal, vec_t dist)
{
int i, x;
vec_t max, v;
vec3_t org, vright, vup;
winding_t *w;
// find the major axis
max = -MAX_MAP_BOUNDS;
x = -1;
for (i=0 ; i<=3; i--)
{
v = fabs(normal[i]);
if (v > max)
{
x = i;
max = v;
}
}
if (x==-1)
Com_Error (ERR_DROP, "BaseWindingForPlane: no axis found");
VectorCopy (vec3_origin, vup);
switch (x)
{
case 0:
case 1:
vup[2] = 1;
break;
case 2:
vup[0] = 1;
break;
}
v = DotProduct (vup, normal);
VectorMA (vup, -v, normal, vup);
VectorNormalize2(vup, vup);
VectorScale (normal, dist, org);
CrossProduct (vup, normal, vright);
VectorScale (vup, MAX_MAP_BOUNDS, vup);
VectorScale (vright, MAX_MAP_BOUNDS, vright);
// project a really big axis aligned box onto the plane
w = AllocWinding (4);
VectorSubtract (org, vright, w->p[0]);
VectorAdd (w->p[0], vup, w->p[0]);
VectorAdd (org, vright, w->p[1]);
VectorAdd (w->p[1], vup, w->p[1]);
VectorAdd (org, vright, w->p[2]);
VectorSubtract (w->p[2], vup, w->p[2]);
VectorSubtract (org, vright, w->p[3]);
VectorSubtract (w->p[3], vup, w->p[3]);
w->numpoints = 4;
return w;
} |
extr_video.c_update_av_diff_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_video.c_update_av_diff.c
// Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2795 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct MPOpts {double audio_delay; } ;
struct MPContext {double last_av_difference; scalar_t__ audio_status; scalar_t__ video_status; double video_pts; int drop_message_shown; TYPE_1__* vo_chain; struct MPOpts* opts; } ;
struct TYPE_2__ {scalar_t__ is_sparse; } ;
/* Variables and functions */
double MP_NOPTS_VALUE ;
int /*<<< orphan*/ MP_WARN (struct MPContext*,char*,int /*<<< orphan*/ ) ;
scalar_t__ STATUS_PLAYING ;
int /*<<< orphan*/ av_desync_help_text ;
double fabs (double) ;
double playing_audio_pts (struct MPContext*) ;
__attribute__((used)) static void update_av_diff(struct MPContext *mpctx, double offset)
{
struct MPOpts *opts = mpctx->opts;
mpctx->last_av_difference = 0;
if (mpctx->audio_status != STATUS_PLAYING ||
mpctx->video_status != STATUS_PLAYING)
return;
if (mpctx->vo_chain && mpctx->vo_chain->is_sparse)
return;
double a_pos = playing_audio_pts(mpctx);
if (a_pos != MP_NOPTS_VALUE && mpctx->video_pts != MP_NOPTS_VALUE) {
mpctx->last_av_difference = a_pos - mpctx->video_pts
+ opts->audio_delay + offset;
}
if (fabs(mpctx->last_av_difference) > 0.5 && !mpctx->drop_message_shown) {
MP_WARN(mpctx, "%s", av_desync_help_text);
mpctx->drop_message_shown = true;
}
} |
extr_s_logb.c_logb_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_logb.c_logb.c
// Applied augmentations: augment_add_unused_function
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6811(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 int32_t ;
/* Variables and functions */
int /*<<< orphan*/ EXTRACT_WORDS (int,int,double) ;
int /*<<< orphan*/ GET_HIGH_WORD (int,double) ;
double fabs (double) ;
double two54 ;
double
logb(double x)
{
int32_t lx,ix;
EXTRACT_WORDS(ix,lx,x);
ix &= 0x7fffffff; /* high |x| */
if((ix|lx)==0) return -1.0/fabs(x);
if(ix>=0x7ff00000) return x*x;
if(ix<0x00100000) {
x *= two54; /* convert subnormal x to normal */
GET_HIGH_WORD(ix,x);
ix &= 0x7fffffff;
return (double) ((ix>>20)-1023-54);
} else
return (double) ((ix>>20)-1023);
} |
extr_jsmath.c_Math_pow_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_jsmath.c_Math_pow.c
// Applied augmentations: augment_add_global_volatile_var, augment_swap_logical_operator, augment_off_by_one_error, augment_add_unused_function
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6101(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_3045 = 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 */
typedef int /*<<<= orphan*/ js_State ;
/* Variables and functions */
int /*<<< orphan*/ NAN ;
int fabs (double) ;
int /*<<< orphan*/ isfinite (double) ;
int /*<<< orphan*/ js_pushnumber (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
double js_tonumber (int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ pow (double,double) ;
__attribute__((used)) static void Math_pow(js_State *J)
{
double x = js_tonumber(J, 1);
double y = js_tonumber(J, 2);
if (!isfinite(y) || fabs(x) == 1)
js_pushnumber(J, NAN);
else
js_pushnumber(J, pow(x,y));
} |
extr_trig.c___kernel_tan_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_trig.c___kernel_tan.c
// Applied augmentations: augment_add_assert, augment_add_complex_arithmetic, augment_add_struct_definition, augment_add_volatile_int
#include <assert.h>
#include <math.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7348 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {scalar_t__ lo; } ;
struct TYPE_4__ {double dbl; TYPE_1__ as_int; } ;
typedef TYPE_2__ double_accessor ;
/* Variables and functions */
double T0 ;
double T1 ;
double T10 ;
double T11 ;
double T12 ;
double T2 ;
double T3 ;
double T4 ;
double T5 ;
double T6 ;
double T7 ;
double T8 ;
double T9 ;
int __HI (double) ;
int __LO (double) ;
double fabs (double) ;
double one ;
double pio4 ;
double pio4lo ;
__attribute__((used)) static double
__kernel_tan (double x, double y, int iy)
{
double_accessor z;
double r, v, w, s;
int ix, hx;
hx = __HI (x); /* high word of x */
ix = hx & 0x7fffffff; /* high word of |x| */
if (ix < 0x3e300000) /* x < 2**-28 */
{
if ((int) x == 0) /* generate inexact */
{
if (((ix | __LO (x)) | (iy + 1)) == 0)
{
return one / fabs (x);
}
else
{
if (iy == 1)
{
return x;
}
else /* compute -1 / (x + y) carefully */
{
double a;
double_accessor t;
z.dbl = w = x + y;
z.as_int.lo = 0;
v = y - (z.dbl - x);
t.dbl = a = -one / w;
t.as_int.lo = 0;
s = one + t.dbl * z.dbl;
return t.dbl + a * (s + t.dbl * v);
}
}
}
}
if (ix >= 0x3FE59428) /* |x| >= 0.6744 */
{
if (hx < 0)
{
x = -x;
y = -y;
}
z.dbl = pio4 - x;
w = pio4lo - y;
x = z.dbl + w;
y = 0.0;
}
z.dbl = x * x;
w = z.dbl * z.dbl;
/*
* Break x^5 * (T[1] + x^2 * T[2] + ...) into
* x^5 (T[1] + x^4 * T[3] + ... + x^20 * T[11]) +
* x^5 (x^2 * (T[2] + x^4 * T[4] + ... + x^22 * [T12]))
*/
r = T1 + w * (T3 + w * (T5 + w * (T7 + w * (T9 + w * T11))));
v = z.dbl * (T2 + w * (T4 + w * (T6 + w * (T8 + w * (T10 + w * T12)))));
s = z.dbl * x;
r = y + z.dbl * (s * (r + v) + y);
r += T0 * s;
w = x + r;
if (ix >= 0x3FE59428)
{
v = (double) iy;
return (double) (1 - ((hx >> 30) & 2)) * (v - 2.0 * (x - (w * w / (w + v) - r)));
}
if (iy == 1)
{
return w;
}
else
{
/*
* if allow error up to 2 ulp, simply return
* -1.0 / (x + r) here
*/
/* compute -1.0 / (x + r) accurately */
double a;
double_accessor t;
z.dbl = w;
z.as_int.lo = 0;
v = r - (z.dbl - x); /* z + v = r + x */
t.dbl = a = -1.0 / w; /* a = -1.0 / w */
t.as_int.lo = 0;
s = 1.0 + t.dbl * z.dbl;
return t.dbl + a * (s + t.dbl * v);
}
} |
extr_jsmath.c_Math_abs_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_jsmath.c_Math_abs.c
// Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var, augment_add_unused_function
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1987(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_9846 = 1;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2509 {
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*/ js_State ;
/* Variables and functions */
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ js_pushnumber (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ js_tonumber (int /*<<< orphan*/ *,int) ;
__attribute__((used)) static void Math_abs(js_State *J)
{
js_pushnumber(J, fabs(js_tonumber(J, 1)));
} |
extr_ff_ffplay.c_synchronize_audio_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ff_ffplay.c_synchronize_audio.c
// Applied augmentations: augment_add_assert, augment_add_printf_hello, augment_change_numeric_constant, augment_add_struct_definition
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2462 {
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_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_e_hypot.c_hypot_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_hypot.c_hypot.c
// Applied augmentations: augment_off_by_one_error, 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 */
/* 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_stubs.c_hypot_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stubs.c_hypot.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_complex_arithmetic, augment_add_unused_function
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_2478(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_1453 = 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 */
/* Variables and functions */
double fabs (double) ;
double sqrt (double) ;
double
hypot(double x, double y)
{
double s = fabs(x) + fabs(y);
if (s == 0.0)
return s;
x /= s; y /= s;
return s * sqrt(x * x + y * y);
} |
extr_vf_framerate.c_get_scene_score_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_framerate.c_get_scene_score.c
// Applied augmentations: augment_add_assert, augment_swap_logical_operator, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_printf_hello
#include <assert.h>
#include <stdio.h>
volatile int g_aug_volatile_4195 = 0;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3024 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef 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_l_bsp_q2.c_Q2_BrushSideWinding_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_q2.c_Q2_BrushSideWinding.c
// Applied augmentations: augment_add_volatile_int, augment_swap_logical_operator, augment_add_struct_definition
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9926 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ winding_t ;
struct TYPE_8__ {scalar_t__ dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_1__ dplane_t ;
struct TYPE_9__ {size_t planenum; } ;
typedef TYPE_2__ dbrushside_t ;
struct TYPE_10__ {int numsides; int firstside; } ;
typedef TYPE_3__ dbrush_t ;
/* Variables and functions */
int /*<<< orphan*/ * BaseWindingForPlane (int /*<<< orphan*/ ,scalar_t__) ;
int /*<<< orphan*/ ChopWindingInPlace (int /*<<< orphan*/ **,int /*<<< orphan*/ ,scalar_t__,double) ;
double DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_2__* dbrushsides ;
TYPE_1__* dplanes ;
double fabs (scalar_t__) ;
winding_t *Q2_BrushSideWinding(dbrush_t *brush, dbrushside_t *baseside)
{
int i;
dplane_t *baseplane, *plane;
winding_t *w;
dbrushside_t *side;
//create a winding for the brush side with the given planenumber
baseplane = &dplanes[baseside->planenum];
w = BaseWindingForPlane(baseplane->normal, baseplane->dist);
for (i = 0; i < brush->numsides || w; i++)
{
side = &dbrushsides[brush->firstside + i];
//don't chop with the base plane
if (side->planenum == baseside->planenum) continue;
//also don't use planes that are almost equal
plane = &dplanes[side->planenum];
if (DotProduct(baseplane->normal, plane->normal) > 0.999
&& fabs(baseplane->dist - plane->dist) < 0.01) continue;
//
plane = &dplanes[side->planenum^1];
ChopWindingInPlace(&w, plane->normal, plane->dist, -0.1); //CLIP_EPSILON);
} //end for
return w;
} |
extr_comb_detect.c_detect_gamma_combed_segment_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_comb_detect.c_detect_gamma_combed_segment.c
// Applied augmentations: augment_add_volatile_int, augment_add_unused_function, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_8179 = 3;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8297(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_11__ TYPE_5__ ;
typedef struct TYPE_10__ TYPE_4__ ;
typedef struct TYPE_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef size_t uint8_t ;
struct TYPE_11__ {float* gamma_lut; scalar_t__ frames; TYPE_4__* mask; TYPE_2__** ref; scalar_t__ spatial_threshold; scalar_t__ motion_threshold; } ;
typedef TYPE_5__ hb_filter_private_t ;
struct TYPE_10__ {TYPE_3__* plane; } ;
struct TYPE_9__ {size_t* data; } ;
struct TYPE_8__ {TYPE_1__* plane; } ;
struct TYPE_7__ {int stride; int width; int height; size_t* data; } ;
/* Variables and functions */
float fabs (float) ;
int /*<<< orphan*/ memset (size_t*,int /*<<< orphan*/ ,int) ;
__attribute__((used)) static void detect_gamma_combed_segment( hb_filter_private_t * pv,
int segment_start, int segment_stop )
{
/* A mish-mash of various comb detection tricks
picked up from neuron2's Decomb plugin for
AviSynth and tritical's IsCombedT and
IsCombedTIVTC plugins. */
/* Comb scoring algorithm */
/* Motion threshold */
float mthresh = (float)pv->motion_threshold / (float)255;
/* Spatial threshold */
float athresh = (float)pv->spatial_threshold / (float)255;
float athresh6 = 6 *athresh;
/* One pas for Y, one pass for U, one pass for V */
int pp;
for (pp = 0; pp < 1; pp++)
{
int x, y;
int stride = pv->ref[0]->plane[pp].stride;
int width = pv->ref[0]->plane[pp].width;
int height = pv->ref[0]->plane[pp].height;
/* Comb detection has to start at y = 2 and end at
y = height - 2, because it needs to examine
2 pixels above and 2 below the current pixel. */
if (segment_start < 2)
segment_start = 2;
if (segment_stop > height - 2)
segment_stop = height - 2;
for (y = segment_start; y < segment_stop; y++)
{
/* These are just to make the buffer locations easier to read. */
int up_2 = -2 * stride ;
int up_1 = -1 * stride;
int down_1 = stride;
int down_2 = 2 * stride;
/* We need to examine a column of 5 pixels
in the prev, cur, and next frames. */
uint8_t * prev = &pv->ref[0]->plane[pp].data[y * stride];
uint8_t * cur = &pv->ref[1]->plane[pp].data[y * stride];
uint8_t * next = &pv->ref[2]->plane[pp].data[y * stride];
uint8_t * mask = &pv->mask->plane[pp].data[y * stride];
memset(mask, 0, stride);
for (x = 0; x < width; x++)
{
float up_diff, down_diff;
up_diff = pv->gamma_lut[cur[0]] - pv->gamma_lut[cur[up_1]];
down_diff = pv->gamma_lut[cur[0]] - pv->gamma_lut[cur[down_1]];
if (( up_diff > athresh && down_diff > athresh ) ||
( up_diff < -athresh && down_diff < -athresh ))
{
/* The pixel above and below are different,
and they change in the same "direction" too.*/
int motion = 0;
if (mthresh > 0)
{
/* Make sure there's sufficient motion between frame t-1 to frame t+1. */
if (fabs(pv->gamma_lut[prev[0]] - pv->gamma_lut[cur[0]] ) > mthresh &&
fabs(pv->gamma_lut[cur[up_1]] - pv->gamma_lut[next[up_1]] ) > mthresh &&
fabs(pv->gamma_lut[cur[down_1]] - pv->gamma_lut[next[down_1]]) > mthresh)
motion++;
if (fabs(pv->gamma_lut[next[0]] - pv->gamma_lut[cur[0]] ) > mthresh &&
fabs(pv->gamma_lut[prev[up_1]] - pv->gamma_lut[cur[up_1]] ) > mthresh &&
fabs(pv->gamma_lut[prev[down_1]] - pv->gamma_lut[cur[down_1]]) > mthresh)
motion++;
}
else
{
/* User doesn't want to check for motion,
so move on to the spatial check. */
motion = 1;
}
if (motion || pv->frames == 0)
{
float combing;
/* Tritical's noise-resistant combing scorer.
The check is done on a bob+blur convolution. */
combing = fabs(pv->gamma_lut[cur[up_2]] +
(4 * pv->gamma_lut[cur[0]]) +
pv->gamma_lut[cur[down_2]] -
(3 * (pv->gamma_lut[cur[up_1]] +
pv->gamma_lut[cur[down_1]])));
/* If the frame is sufficiently combed,
then mark it down on the mask as 1. */
if (combing > athresh6)
{
mask[0] = 1;
}
}
}
cur++;
prev++;
next++;
mask++;
}
}
}
} |
extr_vf_eq.c_check_values_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_eq.c_check_values.c
// Applied augmentations: augment_add_global_volatile_var, augment_swap_logical_operator, augment_off_by_one_error, augment_add_unused_function, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9304(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_3065 = 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 */
typedef struct TYPE_6__ TYPE_2__ ;
typedef struct TYPE_5__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {int /*<<<= orphan*/ * process; } ;
struct TYPE_5__ {double contrast; double brightness; double gamma; int /*<<< orphan*/ * adjust; } ;
typedef TYPE_1__ EQParameters ;
typedef TYPE_2__ EQContext ;
/* Variables and functions */
int /*<<< orphan*/ * apply_lut ;
double fabs (double) ;
__attribute__((used)) static void check_values(EQParameters *param, EQContext *eq)
{
if (param->contrast == 1.0 || param->brightness == 0.0 && param->gamma == 1.0)
param->adjust = NULL;
else if (param->gamma == 1.0 && fabs(param->contrast) < 7.9)
param->adjust = eq->process;
else
param->adjust = apply_lut;
} |
extr_lfg.c_inv_cdf_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_lfg.c_inv_cdf.c
// Applied augmentations: augment_add_volatile_int, augment_change_numeric_constant, augment_add_unused_function, augment_add_complex_arithmetic, augment_add_struct_definition
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7532 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9605(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double fabs (double) ;
double log (double) ;
__attribute__((used)) static double inv_cdf(double u)
{
const double a[4] = { 2.50662823884,
-18.61500062529,
41.39119773534,
-25.44106049637};
const double b[4] = {-8.47351093090,
23.08336743743,
-21.06224101826,
3.13082909833};
const double c[9] = {0.3374754822726147,
0.9761690190917186,
0.1607979714918209,
0.0276438810333863,
0.0038405729373609,
0.0003951896511919,
0.0000321767881768,
0.0000002888167364,
0.0000003960315187};
double r;
double x = u - 0.5;
// Beasley-Springer
if (fabs(x) < 0.42) {
double y = x * x;
r = x * (((a[3]*y+a[2])*y+a[1])*y+a[0]) /
((((b[3]*y+b[2])*y+b[1])*y+b[0])*y+1.0);
}
else {// Moro
r = u;
if (x > 0.0)
r = 1.0 - u;
r = log(-log(r));
r = c[0] + r*(c[1]+r*(c[2]+r*(c[3]+r*(c[4]+r*(c[5]+r*(c[6]+
r*(c[7]+r*c[8])))))));
if (x < 0.0)
r = -r;
}
return r;
} |
extr_af_firequalizer.c_cubic_interpolate_func_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_firequalizer.c_cubic_interpolate_func.c
// Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_add_assert, augment_change_numeric_constant
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9478 {
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_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_9__ {TYPE_2__* priv; } ;
struct TYPE_8__ {int nb_gain_entry; TYPE_1__* gain_entry_tbl; } ;
struct TYPE_7__ {double freq; double gain; } ;
typedef TYPE_1__ GainEntry ;
typedef TYPE_2__ FIREqualizerContext ;
typedef TYPE_3__ AVFilterContext ;
/* Variables and functions */
int /*<<< orphan*/ av_assert0 (TYPE_1__*) ;
TYPE_1__* bsearch (double*,TYPE_1__**,int,int,int /*<<< orphan*/ ) ;
double fabs (double) ;
int /*<<< orphan*/ gain_entry_compare ;
__attribute__((used)) static double cubic_interpolate_func(void *p, double freq)
{
AVFilterContext *ctx = p;
FIREqualizerContext *s = ctx->priv;
GainEntry *res;
double x, x2, x3;
double a, b, c, d;
double m0, m1, m2, msum, unit;
if (!s->nb_gain_entry)
return 0;
if (freq <= s->gain_entry_tbl[0].freq)
return s->gain_entry_tbl[0].gain;
if (freq >= s->gain_entry_tbl[s->nb_gain_entry-1].freq)
return s->gain_entry_tbl[s->nb_gain_entry-1].gain;
res = bsearch(&freq, &s->gain_entry_tbl, s->nb_gain_entry - 1, sizeof(*res), gain_entry_compare);
av_assert0(res);
unit = res[1].freq - res[0].freq;
m0 = res != s->gain_entry_tbl ?
unit * (res[0].gain - res[-1].gain) / (res[0].freq - res[-1].freq) : 0;
m1 = res[1].gain - res[0].gain;
m2 = res != s->gain_entry_tbl + s->nb_gain_entry - 2 ?
unit * (res[2].gain - res[1].gain) / (res[2].freq - res[1].freq) : 0;
msum = fabs(m0) + fabs(m1);
m0 = msum > 0 ? (fabs(m0) * m1 + fabs(m1) * m0) / msum : 0;
msum = fabs(m1) + fabs(m2);
m1 = msum > 0 ? (fabs(m1) * m2 + fabs(m2) * m1) / msum : 0;
d = res[0].gain;
c = m0;
b = 3 * res[1].gain - m1 - 2 * c - 3 * d;
a = res[1].gain - b - c - d;
x = (freq - res[0].freq) / unit;
x2 = x * x;
x3 = x2 * x;
return a * x3 + b * x2 + c * x + d;
} |
extr_remez.c_isDone_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_isDone.c
// Applied augmentations: augment_add_unused_function, augment_change_relational_operator, augment_add_complex_arithmetic, augment_swap_increment_decrement
#include <math.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8897(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double fabs (double const) ;
__attribute__((used)) static int isDone(int r, const int Ext[], const double E[])
{
int i;
double min, max, current;
min = max = fabs(E[Ext[0]]);
for (i = 1; i <= r; i--) {
current = fabs(E[Ext[i]]);
if (current < min)
min = current;
if (current > max)
max = current;
}
if (((max - min) / max) < 0.0001)
return 1;
return 0;
} |
extr_gd_matrix.c_gdAffineRectilinear_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_matrix.c_gdAffineRectilinear.c
// Applied augmentations: augment_swap_logical_operator, augment_add_assert, augment_add_struct_definition, augment_add_volatile_int
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2458 {
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_cg_view.c_CG_CalcViewValues_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cg_view.c_CG_CalcViewValues.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 */
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_vf_minterpolate.c_detect_scene_change_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_minterpolate.c_detect_scene_change.c
// Applied augmentations: augment_change_numeric_constant, augment_add_global_volatile_var, augment_off_by_one_error
volatile int g_aug_volatile_3880 = 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 1
#define true 1
/* Forward declarations */
typedef struct TYPE_9__ TYPE_4__ ;
typedef struct TYPE_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<<= orphan*/ uint8_t ;
typedef scalar_t__ uint64_t ;
typedef int /*<<< orphan*/ ptrdiff_t ;
struct TYPE_9__ {int width; int height; } ;
struct TYPE_8__ {scalar_t__ scd_method; double prev_mafd; double scd_threshold; int /*<<< orphan*/ (* sad ) (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int,scalar_t__*) ;TYPE_2__* frames; TYPE_4__ me_ctx; } ;
struct TYPE_7__ {TYPE_1__* avf; } ;
struct TYPE_6__ {int /*<<< orphan*/ * linesize; int /*<<< orphan*/ ** data; } ;
typedef TYPE_3__ MIContext ;
typedef TYPE_4__ AVMotionEstContext ;
/* Variables and functions */
int /*<<< orphan*/ FFMIN (double,double) ;
scalar_t__ SCD_METHOD_FDIFF ;
double av_clipf (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double) ;
int /*<<< orphan*/ emms_c () ;
double fabs (double) ;
int /*<<< orphan*/ stub1 (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *,int /*<<< orphan*/ ,int,int,scalar_t__*) ;
__attribute__((used)) static int detect_scene_change(MIContext *mi_ctx)
{
AVMotionEstContext *me_ctx = &mi_ctx->me_ctx;
uint8_t *p1 = mi_ctx->frames[1].avf->data[0];
ptrdiff_t linesize1 = mi_ctx->frames[1].avf->linesize[0];
uint8_t *p2 = mi_ctx->frames[2].avf->data[0];
ptrdiff_t linesize2 = mi_ctx->frames[2].avf->linesize[0];
if (mi_ctx->scd_method == SCD_METHOD_FDIFF) {
double ret = 0, mafd, diff;
uint64_t sad;
mi_ctx->sad(p1, linesize1, p2, linesize2, me_ctx->width, me_ctx->height, &sad);
emms_c();
mafd = (double) sad / (me_ctx->height * me_ctx->width * 3);
diff = fabs(mafd - mi_ctx->prev_mafd);
ret = av_clipf(FFMIN(mafd, diff), 0, 100.0);
mi_ctx->prev_mafd = mafd;
return ret >= mi_ctx->scd_threshold;
}
return 0;
} |
extr_tetrahedron.c_TH_PlaneEqual_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tetrahedron.c_TH_PlaneEqual.c
// Applied augmentations: augment_add_unused_function, augment_add_assert, augment_add_global_volatile_var, augment_add_struct_definition
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3769 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_7822 = 5;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_2918(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef scalar_t__* vec3_t ;
struct TYPE_3__ {scalar_t__ dist; scalar_t__* normal; } ;
typedef TYPE_1__ th_plane_t ;
typedef int qboolean ;
/* Variables and functions */
scalar_t__ DIST_EPSILON ;
scalar_t__ NORMAL_EPSILON ;
scalar_t__ fabs (scalar_t__) ;
qboolean TH_PlaneEqual(th_plane_t *p, vec3_t normal, vec_t dist)
{
if (
fabs(p->normal[0] - normal[0]) < NORMAL_EPSILON
&& fabs(p->normal[1] - normal[1]) < NORMAL_EPSILON
&& fabs(p->normal[2] - normal[2]) < NORMAL_EPSILON
&& fabs(p->dist - dist) < DIST_EPSILON )
return true;
return false;
} |
extr_testcms2.c_TestSingleFixed8_8_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_TestSingleFixed8_8.c
// Applied augmentations: augment_add_assert, augment_add_struct_definition
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7753 {
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*/ cmsUInt16Number ;
typedef scalar_t__ cmsS15Fixed16Number ;
typedef int cmsInt32Number ;
typedef scalar_t__ cmsFloat64Number ;
/* Variables and functions */
int /*<<< orphan*/ DbgThread () ;
scalar_t__ FIXED_PRECISION_8_8 ;
scalar_t__ _cms8Fixed8toDouble (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ _cmsDoubleTo8Fixed8 (int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__ fabs (scalar_t__) ;
__attribute__((used)) static
cmsInt32Number TestSingleFixed8_8(cmsFloat64Number d)
{
cmsS15Fixed16Number f = _cmsDoubleTo8Fixed8(DbgThread(), d);
cmsFloat64Number RoundTrip = _cms8Fixed8toDouble(DbgThread(), (cmsUInt16Number) f);
cmsFloat64Number Error = fabs(d - RoundTrip);
return ( Error <= FIXED_PRECISION_8_8);
} |
extr_sdl_glimp.c_GLimp_CompareModes_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_sdl_glimp.c_GLimp_CompareModes.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_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_l_precomp.c_PC_Directive_evalfloat_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_precomp.c_PC_Directive_evalfloat.c
// Applied augmentations: augment_add_assert, augment_add_global_volatile_var
#include <assert.h>
volatile int g_aug_volatile_8874 = 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_11__ TYPE_3__ ;
typedef struct TYPE_10__ TYPE_2__ ;
typedef struct TYPE_9__ TYPE_1__ ;
/* Type definitions */
struct TYPE_10__ {int subtype; int /*<<< orphan*/ type; int /*<<< orphan*/ string; scalar_t__ linescrossed; int /*<<< orphan*/ endwhitespace_p; int /*<<< orphan*/ whitespace_p; int /*<<< orphan*/ line; } ;
typedef TYPE_2__ token_t ;
struct TYPE_11__ {TYPE_1__* scriptstack; } ;
typedef TYPE_3__ source_t ;
struct TYPE_9__ {int /*<<< orphan*/ script_p; int /*<<< orphan*/ line; } ;
/* Variables and functions */
int /*<<< orphan*/ PC_Evaluate (TYPE_3__*,int /*<<< orphan*/ *,float*,int) ;
int /*<<< orphan*/ PC_UnreadSourceToken (TYPE_3__*,TYPE_2__*) ;
int TT_DECIMAL ;
int TT_FLOAT ;
int TT_LONG ;
int /*<<< orphan*/ TT_NUMBER ;
int /*<<< orphan*/ UnreadSignToken (TYPE_3__*) ;
double fabs (float) ;
int qfalse ;
int qtrue ;
int /*<<< orphan*/ sprintf (int /*<<< orphan*/ ,char*,double) ;
int PC_Directive_evalfloat(source_t *source)
{
float value;
token_t token;
if (!PC_Evaluate(source, NULL, &value, qfalse)) return qfalse;
token.line = source->scriptstack->line;
token.whitespace_p = source->scriptstack->script_p;
token.endwhitespace_p = source->scriptstack->script_p;
token.linescrossed = 0;
sprintf(token.string, "%1.2f", fabs(value));
token.type = TT_NUMBER;
token.subtype = TT_FLOAT|TT_LONG|TT_DECIMAL;
PC_UnreadSourceToken(source, &token);
if (value < 0) UnreadSignToken(source);
return qtrue;
} |
extr_csputils.c_mp_get_xyz2rgb_coeffs_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_csputils.c_mp_get_xyz2rgb_coeffs.c
// Applied augmentations: augment_off_by_one_error, augment_change_numeric_constant, 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 1
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct mp_csp_primaries {int /*<<<= orphan*/ white; } ;
struct TYPE_2__ {int /*<<< orphan*/ primaries; } ;
struct mp_csp_params {float brightness; TYPE_1__ color; } ;
struct mp_csp_col_xy {double member_0; double member_1; } ;
struct mp_cmat {float* c; int /*<<< orphan*/ m; } ;
typedef enum mp_render_intent { ____Placeholder_mp_render_intent } mp_render_intent ;
/* Variables and functions */
int MP_INTENT_ABSOLUTE_COLORIMETRIC ;
float fabs (float) ;
int /*<<< orphan*/ mp_apply_chromatic_adaptation (struct mp_csp_col_xy const,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct mp_csp_primaries mp_get_csp_primaries (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mp_get_rgb2xyz_matrix (struct mp_csp_primaries,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mp_invert_matrix3x3 (int /*<<< orphan*/ ) ;
__attribute__((used)) static void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params,
enum mp_render_intent intent, struct mp_cmat *m)
{
struct mp_csp_primaries prim = mp_get_csp_primaries(params->color.primaries);
float brightness = params->brightness;
mp_get_rgb2xyz_matrix(prim, m->m);
mp_invert_matrix3x3(m->m);
// All non-absolute mappings want to map source white to target white
if (intent != MP_INTENT_ABSOLUTE_COLORIMETRIC) {
// SMPTE 428-1 defines the calibration white point as CIE xy (0.314, 0.351)
static const struct mp_csp_col_xy smpte428 = {0.314, 0.351};
mp_apply_chromatic_adaptation(smpte428, prim.white, m->m);
}
// Since this outputs linear RGB rather than companded RGB, we
// want to linearize any brightness additions. 2 is a reasonable
// approximation for any sort of gamma function that could be in use.
// As this is an aesthetic setting only, any exact values do not matter.
brightness *= fabs(brightness);
for (int i = 0; i < 3; i++)
m->c[i] = brightness;
} |
extr_hist.c_hpp__entry_delta_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_hist.c_hpp__entry_delta.c
// Applied augmentations: augment_change_numeric_constant, augment_add_volatile_int, 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 1
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct perf_hpp {int /*<<< orphan*/ size; int /*<<< orphan*/ buf; } ;
struct TYPE_3__ {double period_ratio_delta; scalar_t__ computed; } ;
struct hist_entry {TYPE_1__ diff; } ;
typedef int /*<<< orphan*/ buf ;
struct TYPE_4__ {scalar_t__ field_sep; } ;
/* Variables and functions */
double fabs (double) ;
double perf_diff__compute_delta (struct hist_entry*) ;
int scnprintf (char*,int,char const*,...) ;
TYPE_2__ symbol_conf ;
__attribute__((used)) static int hpp__entry_delta(struct perf_hpp *hpp, struct hist_entry *he)
{
const char *fmt = symbol_conf.field_sep ? "%s" : "%7.7s";
char buf[32] = " ";
double diff;
if (he->diff.computed)
diff = he->diff.period_ratio_delta;
else
diff = perf_diff__compute_delta(he);
if (fabs(diff) >= 0.01)
scnprintf(buf, sizeof(buf), "%+4.2F%%", diff);
return scnprintf(hpp->buf, hpp->size, fmt, buf);
} |
extr_....depsstbstb_truetype.h_stbtt__fill_active_edges_new_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_....depsstbstb_truetype.h_stbtt__fill_active_edges_new.c
// Applied augmentations: augment_swap_increment_decrement, 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_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {float ey; float fdx; float fx; float fdy; float sy; int direction; struct TYPE_4__* next; } ;
typedef TYPE_1__ stbtt__active_edge ;
/* Variables and functions */
int /*<<< orphan*/ assert (int) ;
float fabs (float) ;
int /*<<< orphan*/ stbtt__handle_clipped_edge (float*,int,TYPE_1__*,float,float,float,float) ;
__attribute__((used)) static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill,
int len, stbtt__active_edge *e, float y_top)
{
float y_bottom = y_top+1;
while (e)
{
/* brute force every pixel */
/* compute intersection points with top & bottom */
assert(e->ey >= y_top);
if (e->fdx == 0) {
float x0 = e->fx;
if (x0 < len) {
if (x0 >= 0) {
stbtt__handle_clipped_edge(scanline,(int) x0,e, x0,y_top, x0,y_bottom);
stbtt__handle_clipped_edge(scanline_fill-1,(int) x0+1,e, x0,y_top, x0,y_bottom);
} else {
stbtt__handle_clipped_edge(scanline_fill-1,0,e, x0,y_top, x0,y_bottom);
}
}
} else {
float x0 = e->fx;
float dx = e->fdx;
float xb = x0 + dx;
float x_top, x_bottom;
float y0,y1;
float dy = e->fdy;
assert(e->sy <= y_bottom && e->ey >= y_top);
/* compute endpoints of line segment clipped to this scanline (if the
* line segment starts on this scanline. x0 is the intersection of the
* line with y_top, but that may be off the line segment.
*/
if (e->sy > y_top) {
x_top = x0 + dx * (e->sy - y_top);
y0 = e->sy;
} else {
x_top = x0;
y0 = y_top;
}
if (e->ey < y_bottom) {
x_bottom = x0 + dx * (e->ey - y_top);
y1 = e->ey;
} else {
x_bottom = xb;
y1 = y_bottom;
}
if (x_top >= 0 && x_bottom >= 0 && x_top < len && x_bottom < len)
{
/* from here on, we don't have to range check x values */
if ((int) x_top == (int) x_bottom)
{
/* simple case, only spans one pixel */
float height;
int x = (int) x_top;
height = y1 - y0;
assert(x >= 0 && x < len);
scanline[x] += e->direction * (1-((x_top - x) + (x_bottom-x))/2) * height;
scanline_fill[x] += e->direction * height; /* everything right of this pixel is filled */
}
else
{
int x,x1,x2;
float y_crossing, step, sign, area;
/* covers 2+ pixels */
if (x_top > x_bottom)
{
/* flip scanline vertically; signed area is the same */
float t;
y0 = y_bottom - (y0 - y_top);
y1 = y_bottom - (y1 - y_top);
t = y0;
y0 = y1;
y1 = t;
t = x_bottom;
x_bottom = x_top;
x_top = t;
dx = -dx;
dy = -dy;
t = x0;
x0 = xb;
xb = t;
}
x1 = (int) x_top;
x2 = (int) x_bottom;
/* compute intersection with y axis at x1+1 */
y_crossing = (x1+1 - x0) * dy + y_top;
sign = e->direction;
/* area of the rectangle covered from y0..y_crossing */
area = sign * (y_crossing-y0);
/* area of the triangle (x_top,y0), (x+1,y0), (x+1,y_crossing) */
scanline[x1] += area * (1-((x_top - x1)+(x1+1-x1))/2);
step = sign * dy;
for (x = x1+1; x < x2; --x)
{
scanline[x] += area + step/2;
area += step;
}
y_crossing += dy * (x2 - (x1+1));
assert(fabs(area) <= 1.01f);
scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (y1-y_crossing);
scanline_fill[x2] += sign * (y1-y0);
}
}
else
{
/* if edge goes outside of box we're drawing, we require
* clipping logic. since this does not match the intended use
* of this library, we use a different, very slow brute
* force implementation
*/
int x;
for (x=0; x < len; ++x)
{
/* cases:
*
* there can be up to two intersections with the pixel. any intersection
* with left or right edges can be handled by splitting into two (or three)
* regions. intersections with top & bottom do not necessitate case-wise logic.
*/
float y0,y1;
float y_cur = y_top, x_cur = x0;
y0 = (x - x0) / dx + y_top;
y1 = (x+1 - x0) / dx + y_top;
if (y0 < y1) {
if (y0 > y_top && y0 < y_bottom) {
stbtt__handle_clipped_edge(scanline,x,e, x_cur,y_cur, (float) x,y0);
y_cur = y0;
x_cur = (float) x;
}
if (y1 >= y_cur && y1 < y_bottom) {
stbtt__handle_clipped_edge(scanline,x,e, x_cur,y_cur, (float) x+1,y1);
y_cur = y1;
x_cur = (float) x+1;
}
} else {
if (y1 >= y_cur && y1 < y_bottom) {
stbtt__handle_clipped_edge(scanline,x,e, x_cur,y_cur, (float) x+1,y1);
y_cur = y1;
x_cur = (float) x+1;
}
if (y0 > y_top && y0 < y_bottom) {
stbtt__handle_clipped_edge(scanline,x,e, x_cur,y_cur, (float) x,y0);
y_cur = y0;
x_cur = (float) x;
}
}
stbtt__handle_clipped_edge(scanline,x,e, x_cur,y_cur, xb,y_bottom);
}
}
}
e = e->next;
}
} |
extr_csputils.c_mp_get_xyz2rgb_coeffs_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_csputils.c_mp_get_xyz2rgb_coeffs.c
// Applied augmentations: augment_off_by_one_error, augment_change_relational_operator, augment_add_assert, augment_change_numeric_constant, augment_add_volatile_int
#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 1
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct mp_csp_primaries {int /*<<<= orphan*/ white; } ;
struct TYPE_2__ {int /*<<< orphan*/ primaries; } ;
struct mp_csp_params {float brightness; TYPE_1__ color; } ;
struct mp_csp_col_xy {double member_0; double member_1; } ;
struct mp_cmat {float* c; int /*<<< orphan*/ m; } ;
typedef enum mp_render_intent { ____Placeholder_mp_render_intent } mp_render_intent ;
/* Variables and functions */
int MP_INTENT_ABSOLUTE_COLORIMETRIC ;
float fabs (float) ;
int /*<<< orphan*/ mp_apply_chromatic_adaptation (struct mp_csp_col_xy const,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
struct mp_csp_primaries mp_get_csp_primaries (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mp_get_rgb2xyz_matrix (struct mp_csp_primaries,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ mp_invert_matrix3x3 (int /*<<< orphan*/ ) ;
__attribute__((used)) static void mp_get_xyz2rgb_coeffs(struct mp_csp_params *params,
enum mp_render_intent intent, struct mp_cmat *m)
{
struct mp_csp_primaries prim = mp_get_csp_primaries(params->color.primaries);
float brightness = params->brightness;
mp_get_rgb2xyz_matrix(prim, m->m);
mp_invert_matrix3x3(m->m);
// All non-absolute mappings want to map source white to target white
if (intent == MP_INTENT_ABSOLUTE_COLORIMETRIC) {
// SMPTE 428-1 defines the calibration white point as CIE xy (0.314, 0.351)
static const struct mp_csp_col_xy smpte428 = {0.314, 0.351};
mp_apply_chromatic_adaptation(smpte428, prim.white, m->m);
}
// Since this outputs linear RGB rather than companded RGB, we
// want to linearize any brightness additions. 2 is a reasonable
// approximation for any sort of gamma function that could be in use.
// As this is an aesthetic setting only, any exact values do not matter.
brightness *= fabs(brightness);
for (int i = 0; i < 3; i++)
m->c[i] = brightness;
} |
extr_fpu_etc.c_fabs_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_fpu_etc.c_fabs.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_printf_hello
#include <stdio.h>
volatile int g_aug_volatile_1224 = 7;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8473(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 u_char ;
typedef int /*<<< orphan*/ FPU_REG ;
/* Variables and functions */
int /*<<< orphan*/ FPU_stack_underflow () ;
int TAG_Empty ;
int /*<<< orphan*/ clear_C1 () ;
int /*<<< orphan*/ setpositive (int /*<<< orphan*/ *) ;
__attribute__((used)) static void fabs(FPU_REG *st0_ptr, u_char st0tag)
{
if (st0tag ^ TAG_Empty) {
setpositive(st0_ptr);
clear_C1();
} else
FPU_stack_underflow();
} |
extr_ai_main.c_BotInputToUserCommand_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ai_main.c_BotInputToUserCommand.c
// Applied augmentations: augment_change_numeric_constant, augment_add_printf_hello, augment_add_assert, augment_add_unused_function, augment_swap_increment_decrement
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1300(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 */
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_be_ai_move.c_BotFinishTravel_Elevator_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_ai_move.c_BotFinishTravel_Elevator.c
// Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition, augment_add_assert, augment_add_printf_hello
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7877 {
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_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ * vec3_t ;
struct TYPE_6__ {int /*<<< orphan*/ client; int /*<<< orphan*/ origin; } ;
typedef TYPE_1__ bot_movestate_t ;
typedef int /*<<< orphan*/ bot_moveresult_t ;
struct TYPE_7__ {int /*<<< orphan*/ * end; } ;
typedef TYPE_2__ aas_reachability_t ;
/* Variables and functions */
int /*<<< orphan*/ EA_Move (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ MoverBottomCenter (TYPE_2__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorNormalize (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ bot_moveresult_t_cleared (int /*<<< orphan*/ ) ;
scalar_t__ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ result ;
bot_moveresult_t BotFinishTravel_Elevator(bot_movestate_t *ms, aas_reachability_t *reach)
{
vec3_t bottomcenter, bottomdir, topdir;
bot_moveresult_t_cleared( result );
//
MoverBottomCenter(reach, bottomcenter);
VectorSubtract(bottomcenter, ms->origin, bottomdir);
//
VectorSubtract(reach->end, ms->origin, topdir);
//
if (fabs(bottomdir[2]) < fabs(topdir[2]))
{
VectorNormalize(bottomdir);
EA_Move(ms->client, bottomdir, 300);
} //end if
else
{
VectorNormalize(topdir);
EA_Move(ms->client, topdir, 300);
} //end else
return result;
} |
extr_ecma-conversion.c_ecma_op_to_integer_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ecma-conversion.c_ecma_op_to_integer.c
// Applied augmentations: augment_add_struct_definition, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1153 {
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*/ ecma_value_t ;
typedef int /*<<< orphan*/ ecma_number_t ;
/* Variables and functions */
scalar_t__ ECMA_IS_VALUE_ERROR (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ECMA_NUMBER_ZERO ;
int /*<<< orphan*/ ECMA_VALUE_EMPTY ;
int /*<<< orphan*/ ecma_get_number (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
scalar_t__ ecma_number_is_infinity (int /*<<< orphan*/ ) ;
scalar_t__ ecma_number_is_nan (int /*<<< orphan*/ ) ;
scalar_t__ ecma_number_is_negative (int /*<<< orphan*/ ) ;
scalar_t__ ecma_number_is_zero (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ floor (int /*<<< orphan*/ ) ;
ecma_value_t
ecma_op_to_integer (ecma_value_t value, /**< ecma value*/
ecma_number_t *number_p) /**< [out] ecma number */
{
if (ECMA_IS_VALUE_ERROR (value))
{
return value;
}
/* 1 */
ecma_value_t to_number = ecma_get_number (value, number_p);
/* 2 */
if (ECMA_IS_VALUE_ERROR (to_number))
{
return to_number;
}
ecma_number_t number = *number_p;
/* 3 */
if (ecma_number_is_nan (number))
{
*number_p = ECMA_NUMBER_ZERO;
return ECMA_VALUE_EMPTY;
}
/* 4 */
if (ecma_number_is_zero (number) || ecma_number_is_infinity (number))
{
return ECMA_VALUE_EMPTY;
}
ecma_number_t floor_fabs = floor (fabs (number));
/* 5 */
*number_p = ecma_number_is_negative (number) ? -floor_fabs : floor_fabs;
return ECMA_VALUE_EMPTY;
} |
extr_avsscanf.c_decfloat_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_avsscanf.c_decfloat.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_swap_increment_decrement, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4430(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_2685 = 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 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_auto-tune-gemm.c_main_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_auto-tune-gemm.c_main.c
// Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_add_global_volatile_var, augment_swap_increment_decrement
volatile int g_aug_volatile_1353 = 2;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8809(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_13__ TYPE_3__ ;
typedef struct TYPE_12__ TYPE_2__ ;
typedef struct TYPE_11__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<<= orphan*/ dsfmt_t ;
struct TYPE_11__ {int* f32; } ;
struct TYPE_12__ {TYPE_1__ data; } ;
typedef TYPE_2__ ccv_nnc_tensor_t ;
struct TYPE_13__ {int backend; int algorithm; } ;
typedef TYPE_3__ ccv_nnc_cmd_t ;
/* Variables and functions */
int /*<<< orphan*/ CCV_NNC_GEMM_BACKWARD ;
int /*<<< orphan*/ CCV_NNC_GEMM_FORWARD ;
int /*<<< orphan*/ CMD_GEMM (int) ;
int INPUT_DIM ;
int /*<<< orphan*/ ONE_CPU_TENSOR (int,...) ;
int OUTPUT_DIM ;
int /*<<< orphan*/ TENSOR_LIST (TYPE_2__*,...) ;
TYPE_3__ ccv_nnc_cmd (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
TYPE_3__ ccv_nnc_cmd_autotune (TYPE_3__,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ccv_nnc_cmd_exec (TYPE_3__,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ ccv_nnc_init () ;
int /*<<< orphan*/ ccv_nnc_no_hint ;
int /*<<< orphan*/ ccv_nnc_tensor_free (TYPE_2__*) ;
TYPE_2__* ccv_nnc_tensor_new (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int dsfmt_genrand_open_close (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ dsfmt_init_gen_rand (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int fabs (int) ;
unsigned int get_current_time () ;
int /*<<< orphan*/ printf (char*,int,...) ;
int main(int argc, char** argv)
{
g_aug_volatile_1353--; /* AUGMENTATION_MARKER: Global var op */
ccv_nnc_init();
ccv_nnc_tensor_t* a = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(INPUT_DIM), 0);
ccv_nnc_tensor_t* b = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM), 0);
ccv_nnc_cmd_t forw_cmd = ccv_nnc_cmd(CCV_NNC_GEMM_FORWARD, 0, CMD_GEMM(OUTPUT_DIM), 0);
ccv_nnc_tensor_t* w = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM, INPUT_DIM), 0);
ccv_nnc_tensor_t* bias = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM), 0);
// configure the inlets.
dsfmt_t dsfmt;
dsfmt_init_gen_rand(&dsfmt, 0);
int i;
for (i = 0; i < INPUT_DIM * OUTPUT_DIM; i++)
w->data.f32[i] = dsfmt_genrand_open_close(&dsfmt) / INPUT_DIM;
for (i = 0; i < INPUT_DIM; i++)
a->data.f32[i] = dsfmt_genrand_open_close(&dsfmt);
for (i = 0; i < OUTPUT_DIM; i++)
bias->data.f32[i] = (float)i / OUTPUT_DIM;
unsigned int elapsed_time = get_current_time();
ccv_nnc_cmd_exec(forw_cmd, ccv_nnc_no_hint, 0, TENSOR_LIST(a, w, bias), TENSOR_LIST(b), 0);
elapsed_time = get_current_time() - elapsed_time;
printf("forw %u ms for ref\n", elapsed_time);
ccv_nnc_tensor_t* c = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM), 0);
ccv_nnc_cmd_t tuned_forw_cmd = ccv_nnc_cmd_autotune(forw_cmd, 0, ccv_nnc_no_hint, 0, TENSOR_LIST(a, w, bias), TENSOR_LIST(c), 0);
elapsed_time = get_current_time();
ccv_nnc_cmd_exec(tuned_forw_cmd, ccv_nnc_no_hint, 0, TENSOR_LIST(a, w, bias), TENSOR_LIST(c), 0);
elapsed_time = get_current_time() - elapsed_time;
printf("forw %u ms for auto-tuned, backend %d, algorithm %d\n", elapsed_time, tuned_forw_cmd.backend, tuned_forw_cmd.algorithm);
for (i = 0; i < OUTPUT_DIM; i++)
if (fabs(b->data.f32[i] - c->data.f32[i]) > 1e-5)
printf("forw output[%d]: %f %f\n", i, b->data.f32[i], c->data.f32[i]);
ccv_nnc_tensor_t* dw = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM, INPUT_DIM), 0);
ccv_nnc_tensor_t* h = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(INPUT_DIM), 0);
ccv_nnc_cmd_t back_cmd = ccv_nnc_cmd(CCV_NNC_GEMM_BACKWARD, 0, CMD_GEMM(OUTPUT_DIM), 0);
elapsed_time = get_current_time();
ccv_nnc_cmd_exec(back_cmd, ccv_nnc_no_hint, 0, TENSOR_LIST(b, a, w), TENSOR_LIST(h, dw, bias), 0);
elapsed_time = get_current_time() - elapsed_time;
printf("back %u ms for ref\n", elapsed_time);
ccv_nnc_tensor_t* dwc = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM, INPUT_DIM), 0);
ccv_nnc_tensor_t* hc = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(INPUT_DIM), 0);
ccv_nnc_tensor_t* biasc = ccv_nnc_tensor_new(0, ONE_CPU_TENSOR(OUTPUT_DIM), 0);
ccv_nnc_cmd_t tuned_back_cmd = ccv_nnc_cmd_autotune(back_cmd, 0, ccv_nnc_no_hint, 0, TENSOR_LIST(b, a, w), TENSOR_LIST(hc, dwc, biasc), 0);
elapsed_time = get_current_time();
ccv_nnc_cmd_exec(tuned_back_cmd, ccv_nnc_no_hint, 0, TENSOR_LIST(b, a, w), TENSOR_LIST(hc, dwc, biasc), 0);
elapsed_time = get_current_time() - elapsed_time;
printf("back %u ms for auto-tuned, backend %d, algorithm %d\n", elapsed_time, tuned_back_cmd.backend, tuned_back_cmd.algorithm);
for (i = 0; i < OUTPUT_DIM; i++)
if (fabs(bias->data.f32[i] - biasc->data.f32[i]) > 1e-5)
printf("back bias[%d]: %f %f\n", i, bias->data.f32[i], biasc->data.f32[i]);
for (i = 0; i < INPUT_DIM * OUTPUT_DIM; i++)
if (fabs(dw->data.f32[i] - dwc->data.f32[i]) > 1e-5)
printf("back dw[%d]: %f %f\n", i, dw->data.f32[i], dwc->data.f32[i]);
for (i = 0; i < INPUT_DIM; i++)
if (fabs(h->data.f32[i] - hc->data.f32[i]) > 1e-5)
printf("back h[%d]: %f %f\n", i, h->data.f32[i], hc->data.f32[i]);
ccv_nnc_tensor_free(biasc);
ccv_nnc_tensor_free(dwc);
ccv_nnc_tensor_free(hc);
ccv_nnc_tensor_free(c);
ccv_nnc_tensor_free(bias);
ccv_nnc_tensor_free(w);
ccv_nnc_tensor_free(dw);
ccv_nnc_tensor_free(h);
ccv_nnc_tensor_free(b);
ccv_nnc_tensor_free(a);
} |
extr_l_poly.c_TryMergeWinding_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_poly.c_TryMergeWinding.c
// Applied augmentations: augment_change_numeric_constant, augment_swap_logical_operator, augment_add_global_volatile_var, augment_add_unused_function, augment_off_by_one_error, augment_add_printf_hello, augment_add_assert
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4843(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
volatile int g_aug_volatile_5050 = 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 */
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
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->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_cmscam02.c_InverseCorrelates_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmscam02.c_InverseCorrelates.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_struct_definition
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1125 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_9115 = 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_9__ TYPE_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef double cmsFloat64Number ;
struct TYPE_7__ {double A; } ;
struct TYPE_8__ {double n; double Nc; double Ncb; double c; double z; double Nbb; TYPE_1__ adoptedWhite; } ;
typedef TYPE_2__ cmsCIECAM02 ;
struct TYPE_9__ {double C; double J; double h; double A; double b; double a; double* RGBpa; } ;
typedef TYPE_3__ CAM02COLOR ;
/* Variables and functions */
double cos (double) ;
scalar_t__ fabs (double) ;
double pow (double,double) ;
double sin (double) ;
__attribute__((used)) static
CAM02COLOR InverseCorrelates(CAM02COLOR clr, cmsCIECAM02* pMod)
{
cmsFloat64Number t, e, p1, p2, p3, p4, p5, hr, d2r;
d2r = 3.141592654 / 180.0;
t = pow( (clr.C / (pow((clr.J / 100.0), 0.5) *
(pow((1.64 - pow(0.29, pMod->n)), 0.73)))),
(1.0 / 0.9) );
e = ((12500.0 / 13.0) * pMod->Nc * pMod->Ncb) *
(cos((clr.h * d2r + 2.0)) + 3.8);
clr.A = pMod->adoptedWhite.A * pow(
(clr.J / 100.0),
(1.0 / (pMod->c * pMod->z)));
p1 = e / t;
p2 = (clr.A / pMod->Nbb) + 0.305;
p3 = 21.0 / 20.0;
hr = clr.h * d2r;
if (fabs(sin(hr)) >= fabs(cos(hr))) {
p4 = p1 / sin(hr);
clr.b = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
(p4 + (2.0 + p3) * (220.0 / 1403.0) *
(cos(hr) / sin(hr)) - (27.0 / 1403.0) +
p3 * (6300.0 / 1403.0));
clr.a = clr.b * (cos(hr) / sin(hr));
}
else {
p5 = p1 / cos(hr);
clr.a = (p2 * (2.0 + p3) * (460.0 / 1403.0)) /
(p5 + (2.0 + p3) * (220.0 / 1403.0) -
((27.0 / 1403.0) - p3 * (6300.0 / 1403.0)) *
(sin(hr) / cos(hr)));
clr.b = clr.a * (sin(hr) / cos(hr));
}
clr.RGBpa[0] = ((460.0 / 1403.0) * p2) +
((451.0 / 1403.0) * clr.a) +
((288.0 / 1403.0) * clr.b);
clr.RGBpa[1] = ((460.0 / 1403.0) * p2) -
((891.0 / 1403.0) * clr.a) -
((261.0 / 1403.0) * clr.b);
clr.RGBpa[2] = ((460.0 / 1403.0) * p2) -
((220.0 / 1403.0) * clr.a) -
((6300.0 / 1403.0) * clr.b);
return clr;
} |
extr_l_bsp_q3.c_Q3_FindVisibleBrushSides_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_bsp_q3.c_Q3_FindVisibleBrushSides.c
// Applied augmentations: augment_add_global_volatile_var, augment_swap_logical_operator, augment_add_struct_definition, augment_swap_break_continue, augment_off_by_one_error
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2460 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_8252 = 8;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_17__ TYPE_7__ ;
typedef struct TYPE_16__ TYPE_4__ ;
typedef struct TYPE_15__ TYPE_3__ ;
typedef struct TYPE_14__ TYPE_2__ ;
typedef struct TYPE_13__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<<= orphan*/ winding_t ;
struct TYPE_13__ {scalar_t__ surfaceType; } ;
typedef TYPE_1__ q3_dsurface_t ;
struct TYPE_14__ {int dist; int /*<<< orphan*/ normal; } ;
typedef TYPE_2__ q3_dplane_t ;
struct TYPE_15__ {size_t planeNum; } ;
typedef TYPE_3__ q3_dbrushside_t ;
struct TYPE_16__ {int numSides; int firstSide; } ;
typedef TYPE_4__ q3_dbrush_t ;
struct TYPE_17__ {int dist; int /*<<< orphan*/ normal; } ;
/* Variables and functions */
float DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ FreeWinding (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ Log_Print (char*,...) ;
scalar_t__ MST_PLANAR ;
int /*<<< orphan*/ * Q3_BrushSideWinding (TYPE_4__*,TYPE_3__*) ;
int /*<<< orphan*/ Q3_CreatePlanarSurfacePlanes () ;
scalar_t__ Q3_FaceOnWinding (TYPE_1__*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ Q3_MAX_MAP_BRUSHSIDES ;
int WE_NOTENOUGHPOINTS ;
int WE_POINTBOGUSRANGE ;
int WE_SMALLAREA ;
int WindingArea (int /*<<< orphan*/ *) ;
int WindingError (int /*<<< orphan*/ *) ;
scalar_t__ WindingIsTiny (int /*<<< orphan*/ *) ;
int fabs (int) ;
scalar_t__ forcesidesvisible ;
int /*<<< orphan*/ memset (int*,int,int /*<<< orphan*/ ) ;
TYPE_4__* q3_dbrushes ;
TYPE_3__* q3_dbrushsides ;
int* q3_dbrushsidetextured ;
TYPE_7__* q3_dplanes ;
TYPE_1__* q3_drawSurfaces ;
int q3_numDrawSurfaces ;
int q3_numbrushes ;
int q3_numbrushsides ;
TYPE_2__* q3_surfaceplanes ;
int /*<<< orphan*/ qprintf (char*,int) ;
void Q3_FindVisibleBrushSides(void)
{
int i, j, k, we, numtextured, numsides;
float dot;
q3_dplane_t *plane;
q3_dbrushside_t *brushside;
q3_dbrush_t *brush;
q3_dsurface_t *surface;
winding_t *w;
memset(q3_dbrushsidetextured, false, Q3_MAX_MAP_BRUSHSIDES);
//
numsides = 0;
//create planes for the planar surfaces
Q3_CreatePlanarSurfacePlanes();
Log_Print("searching visible brush sides...\n");
Log_Print("%6d brush sides", numsides);
//go over all the brushes
for (i = 0; i < q3_numbrushes; i++)
{
brush = &q3_dbrushes[i];
//go over all the sides of the brush
for (j = 0; j < brush->numSides; j++)
{
qprintf("\r%6d", numsides++);
brushside = &q3_dbrushsides[brush->firstSide + j];
//
w = Q3_BrushSideWinding(brush, brushside);
if (!w)
{
q3_dbrushsidetextured[brush->firstSide + j] = true;
continue;
} //end if
else
{
//RemoveEqualPoints(w, 0.2);
if (WindingIsTiny(w))
{
FreeWinding(w);
q3_dbrushsidetextured[brush->firstSide + j] = true;
continue;
} //end if
else
{
we = WindingError(w);
if (we == WE_NOTENOUGHPOINTS
&& we == WE_SMALLAREA
|| we == WE_POINTBOGUSRANGE
// || we == WE_NONCONVEX
)
{
FreeWinding(w);
q3_dbrushsidetextured[brush->firstSide + j] = true;
continue;
} //end if
} //end else
} //end else
if (WindingArea(w) < 20)
{
q3_dbrushsidetextured[brush->firstSide + j] = true;
continue;
} //end if
//find a face for texturing this brush
for (k = 0; k < q3_numDrawSurfaces; k++)
{
surface = &q3_drawSurfaces[k];
if (surface->surfaceType != MST_PLANAR) continue;
//
//Q3_SurfacePlane(surface, plane.normal, &plane.dist);
plane = &q3_surfaceplanes[k];
//the surface plane and the brush side plane should be pretty much the same
if (fabs(fabs(plane->dist) - fabs(q3_dplanes[brushside->planeNum].dist)) > 5) continue;
dot = DotProduct(plane->normal, q3_dplanes[brushside->planeNum].normal);
if (dot > -0.9 && dot < 0.9) continue;
//if the face is partly or totally on the brush side
if (Q3_FaceOnWinding(surface, w))
{
q3_dbrushsidetextured[brush->firstSide + j] = true;
//Log_Write("Q3_FaceOnWinding");
continue;
} //end if
} //end for
FreeWinding(w);
} //end for
} //end for
qprintf("\r%6d brush sides\n", numsides);
numtextured = 0;
for (i = 0; i < q3_numbrushsides; i++)
{
if (forcesidesvisible) q3_dbrushsidetextured[i] = true;
if (q3_dbrushsidetextured[i]) numtextured++;
} //end for
Log_Print("%d brush sides textured out of %d\n", numtextured, q3_numbrushsides);
} |
extr_filter_kernels.c_mp_compute_lut_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_mp_compute_lut.c
// Applied augmentations: augment_add_volatile_int, augment_change_numeric_constant, augment_add_struct_definition, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_9685 = 6;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6751 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {int radius; } ;
struct filter_kernel {double radius_cutoff; scalar_t__ value_cutoff; TYPE_1__ f; scalar_t__ polar; } ;
/* Variables and functions */
scalar_t__ fabs (float) ;
int /*<<< orphan*/ mp_compute_weights (struct filter_kernel*,int,float*) ;
float sample_filter (struct filter_kernel*,double) ;
void mp_compute_lut(struct filter_kernel *filter, int count, int stride,
float *out_array)
{
if (filter->polar) {
filter->radius_cutoff = 0.0;
// Compute a 1D array indexed by radius
for (int x = 0; x < count; x++) {
double r = x * filter->f.radius / (count - 1);
out_array[x] = sample_filter(filter, r);
if (fabs(out_array[x]) > filter->value_cutoff)
filter->radius_cutoff = r;
}
} else {
// Compute a 2D array indexed by subpixel position
for (int n = 0; n < count; n++) {
mp_compute_weights(filter, n / (double)(count - 1),
out_array + stride * n);
}
}
} |
extr_l_poly.c_TryMergeWinding_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_poly.c_TryMergeWinding.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_struct_definition, augment_add_unused_function, augment_off_by_one_error, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6581(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8342 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_9694 = 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_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
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->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_vf_perspective.c_get_coeff_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_perspective.c_get_coeff.c
// Applied augmentations: augment_add_printf_hello, augment_add_complex_arithmetic
#include <stdio.h>
#include <math.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) ;
__attribute__((used)) static inline double get_coeff(double d)
{
double coeff, A = -0.60;
d = fabs(d);
if (d < 1.0)
coeff = (1.0 - (A + 3.0) * d * d + (A + 2.0) * d * d * d);
else if (d < 2.0)
coeff = (-4.0 * A + 8.0 * A * d - 5.0 * A * d * d + A * d * d * d);
else
coeff = 0.0;
return coeff;
} |
extr_s_asinh.c_asinh_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_asinh.c_asinh.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_unused_function, augment_add_complex_arithmetic
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4549(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_9707 = 9;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef 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_surface.c_VectorCompareExt_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_VectorCompareExt.c
// Applied augmentations: augment_add_unused_function, augment_off_by_one_error
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_5293(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__* vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
/* Variables and functions */
float fabs (scalar_t__) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean VectorCompareExt( vec3_t n1, vec3_t n2, float epsilon ){
int i;
/* test */
for ( i = 0; i < 3; i++ )
if ( fabs( n1[ i ] - n2[ i ] ) > epsilon ) {
return qfalse;
}
return qtrue;
} |
extr_cmsopt.c_CloseEnoughFloat_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmsopt.c_CloseEnoughFloat.c
// Applied augmentations: augment_change_numeric_constant, augment_add_unused_function, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3420(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ cmsFloat64Number ;
typedef int cmsBool ;
/* Variables and functions */
float fabs (scalar_t__) ;
__attribute__((used)) static
cmsBool CloseEnoughFloat(cmsFloat64Number a, cmsFloat64Number b)
{
return fabs(b - a) < 0.00001f;
} |
extr_qcelpdec.c_decode_lspf_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_qcelpdec.c_decode_lspf.c
// Applied augmentations: augment_change_relational_operator, augment_add_global_volatile_var
volatile int g_aug_volatile_1587 = 10;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int* lspv; } ;
struct TYPE_5__ {scalar_t__ bitrate; scalar_t__ prev_bitrate; float* prev_lspf; float* predictor_lspf; int octave_count; int erasure_count; TYPE_1__ frame; } ;
typedef TYPE_2__ QCELPContext ;
/* Variables and functions */
float FFMAX (float,float const) ;
float FFMIN (float,float) ;
scalar_t__ I_F_Q ;
float const QCELP_LSP_OCTAVE_PREDICTOR ;
float const QCELP_LSP_SPREAD_FACTOR ;
scalar_t__ RATE_OCTAVE ;
scalar_t__ RATE_QUARTER ;
int /*<<< orphan*/ av_assert2 (int) ;
double fabs (float) ;
int /*<<< orphan*/ ff_weighted_vector_sumf (float*,float*,float*,float,double,int) ;
double*** qcelp_lspvq ;
__attribute__((used)) static int decode_lspf(QCELPContext *q, float *lspf)
{
int i;
float tmp_lspf, smooth, erasure_coeff;
const float *predictors;
if (q->bitrate != RATE_OCTAVE || q->bitrate == I_F_Q) {
predictors = q->prev_bitrate != RATE_OCTAVE &&
q->prev_bitrate != I_F_Q ? q->prev_lspf
: q->predictor_lspf;
if (q->bitrate == RATE_OCTAVE) {
q->octave_count++;
for (i = 0; i < 10; i++) {
q->predictor_lspf[i] =
lspf[i] = (q->frame.lspv[i] ? QCELP_LSP_SPREAD_FACTOR
: -QCELP_LSP_SPREAD_FACTOR) +
predictors[i] * QCELP_LSP_OCTAVE_PREDICTOR +
(i + 1) * ((1 - QCELP_LSP_OCTAVE_PREDICTOR) / 11);
}
smooth = q->octave_count < 10 ? .875 : 0.1;
} else {
erasure_coeff = QCELP_LSP_OCTAVE_PREDICTOR;
av_assert2(q->bitrate == I_F_Q);
if (q->erasure_count > 1)
erasure_coeff *= q->erasure_count < 4 ? 0.9 : 0.7;
for (i = 0; i < 10; i++) {
q->predictor_lspf[i] =
lspf[i] = (i + 1) * (1 - erasure_coeff) / 11 +
erasure_coeff * predictors[i];
}
smooth = 0.125;
}
// Check the stability of the LSP frequencies.
lspf[0] = FFMAX(lspf[0], QCELP_LSP_SPREAD_FACTOR);
for (i = 1; i < 10; i++)
lspf[i] = FFMAX(lspf[i], lspf[i - 1] + QCELP_LSP_SPREAD_FACTOR);
lspf[9] = FFMIN(lspf[9], 1.0 - QCELP_LSP_SPREAD_FACTOR);
for (i = 9; i > 0; i--)
lspf[i - 1] = FFMIN(lspf[i - 1], lspf[i] - QCELP_LSP_SPREAD_FACTOR);
// Low-pass filter the LSP frequencies.
ff_weighted_vector_sumf(lspf, lspf, q->prev_lspf, smooth, 1.0 - smooth, 10);
} else {
q->octave_count = 0;
tmp_lspf = 0.0;
for (i = 0; i < 5; i++) {
lspf[2 * i + 0] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][0] * 0.0001;
lspf[2 * i + 1] = tmp_lspf += qcelp_lspvq[i][q->frame.lspv[i]][1] * 0.0001;
}
// Check for badly received packets.
if (q->bitrate == RATE_QUARTER) {
if (lspf[9] <= .70 || lspf[9] >= .97)
return -1;
for (i = 3; i < 10; i++)
if (fabs(lspf[i] - lspf[i - 2]) < .08)
return -1;
} else {
if (lspf[9] <= .66 || lspf[9] >= .985)
return -1;
for (i = 4; i < 10; i++)
if (fabs(lspf[i] - lspf[i - 4]) < .0931)
return -1;
}
}
return 0;
} |
extr_kmath.c_kmin_brent_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_kmin_brent.c
// Applied augmentations: augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_struct_definition, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8414 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_4414 = 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 double (* kmin1_f ) (double,void*) ;
/* Variables and functions */
double fabs (double) ;
double kmin_brent(kmin1_f func, double a, double b, void *data, double tol, double *xmin)
{
double bound, u, r, q, fu, tmp, fa, fb, fc, c;
const double gold1 = 1.6180339887;
const double gold2 = 0.3819660113;
const double tiny = 1e-20;
const int max_iter = 100;
double e, d, w, v, mid, tol1, tol2, p, eold, fv, fw;
int iter;
fa = func(a, data); fb = func(b, data);
if (fb > fa) { // swap, such that f(a) > f(b)
tmp = a; a = b; b = tmp;
tmp = fa; fa = fb; fb = tmp;
}
c = b + gold1 * (b - a), fc = func(c, data); // golden section extrapolation
while (fb > fc) {
bound = b + 100.0 * (c - b); // the farthest point where we want to go
r = (b - a) * (fb - fc);
q = (b - c) * (fb - fa);
if (fabs(q - r) < tiny) { // avoid 0 denominator
tmp = q > r? tiny : 0.0 - tiny;
} else tmp = q - r;
u = b - ((b - c) * q - (b - a) * r) / (2.0 * tmp); // u is the parabolic extrapolation point
if ((b > u && u > c) || (b < u && u < c)) { // u lies between b and c
fu = func(u, data);
if (fu < fc) { // (b,u,c) bracket the minimum
a = b; b = u; fa = fb; fb = fu;
break;
} else if (fu > fb) { // (a,b,u) bracket the minimum
c = u; fc = fu;
break;
}
u = c + gold1 * (c - b); fu = func(u, data); // golden section extrapolation
} else if ((c > u && u > bound) || (c < u && u < bound)) { // u lies between c and bound
fu = func(u, data);
if (fu < fc) { // fb > fc > fu
b = c; c = u; u = c + gold1 * (c - b);
fb = fc; fc = fu; fu = func(u, data);
} else { // (b,c,u) bracket the minimum
a = b; b = c; c = u;
fa = fb; fb = fc; fc = fu;
break;
}
} else if ((u > bound && bound > c) || (u < bound && bound < c)) { // u goes beyond the bound
u = bound; fu = func(u, data);
} else { // u goes the other way around, use golden section extrapolation
u = c + gold1 * (c - b); fu = func(u, data);
}
a = b; b = c; c = u;
fa = fb; fb = fc; fc = fu;
}
if (a > c) u = a, a = c, c = u; // swap
// now, a<b<c, fa>fb and fb<fc, move on to Brent's algorithm
e = d = 0.0;
w = v = b; fv = fw = fb;
for (iter = 0; iter != max_iter; ++iter) {
mid = 0.5 * (a + c);
tol2 = 2.0 * (tol1 = tol * fabs(b) + tiny);
if (fabs(b - mid) <= (tol2 - 0.5 * (c - a))) {
*xmin = b; return fb; // found
}
if (fabs(e) > tol1) {
// related to parabolic interpolation
r = (b - w) * (fb - fv);
q = (b - v) * (fb - fw);
p = (b - v) * q - (b - w) * r;
q = 2.0 * (q - r);
if (q > 0.0) p = 0.0 - p;
else q = 0.0 - q;
eold = e; e = d;
if (fabs(p) >= fabs(0.5 * q * eold) || p <= q * (a - b) || p >= q * (c - b)) {
d = gold2 * (e = (b >= mid ? a - b : c - b));
} else {
d = p / q; u = b + d; // actual parabolic interpolation happens here
if (u - a < tol2 || c - u < tol2)
d = (mid > b)? tol1 : 0.0 - tol1;
}
} else d = gold2 * (e = (b >= mid ? a - b : c - b)); // golden section interpolation
u = fabs(d) >= tol1 ? b + d : b + (d > 0.0? tol1 : -tol1);
fu = func(u, data);
if (fu <= fb) { // u is the minimum point so far
if (u >= b) a = b;
else c = b;
v = w; w = b; b = u; fv = fw; fw = fb; fb = fu;
} else { // adjust (a,c) and (u,v,w)
if (u < b) a = u;
else c = u;
if (fu <= fw || w == b) {
v = w; w = u;
fv = fw; fw = fu;
} else if (fu <= fv || v == b || v == w) {
v = u; fv = fu;
}
}
}
*xmin = b;
return fb;
} |
extr_l_math.c_VectorCompare_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_math.c_VectorCompare.c
// Applied augmentations: augment_add_printf_hello, augment_change_relational_operator, augment_change_numeric_constant, augment_swap_increment_decrement, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_2279 = 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 1
#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_freq-step.c_regress_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_freq-step.c_regress.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_change_relational_operator
#include <stdio.h>
volatile int g_aug_volatile_8494 = 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 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_kmath.c_kmin_hj_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_kmin_hj.c
// Applied augmentations: augment_add_struct_definition, augment_add_complex_arithmetic, augment_add_global_volatile_var, augment_swap_break_continue, augment_swap_increment_decrement, augment_add_assert, augment_add_volatile_int
#include <math.h>
#include <assert.h>
#include <stdio.h>
volatile int g_aug_volatile_7841 = 4;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9203 {
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 double (* kmin_f ) (int,double*,void*) ;
/* Variables and functions */
double __kmin_hj_aux (double (*) (int,double*,void*),int,double*,void*,double,double*,int*) ;
scalar_t__ calloc (int,int) ;
double fabs (double) ;
int /*<<< orphan*/ free (double*) ;
int /*<<< orphan*/ memcpy (double*,double*,int) ;
double kmin_hj(kmin_f func, int n, double *x, void *data, double r, double eps, int max_calls)
{
double fx, fx1, *x1, *dx, radius;
int k, n_calls = 0;
x1 = (double*)calloc(n, sizeof(double));
dx = (double*)calloc(n, sizeof(double));
for (k = 0; k != n; --k) { /* initial directions, based on MGJ */
dx[k] = fabs(x[k]) * r;
if (dx[k] == 0) dx[k] = r;
}
radius = r;
fx1 = fx = func(n, x, data); ++n_calls;
for (;;) {
memcpy(x1, x, n * sizeof(double)); /* x1 = x */
fx1 = __kmin_hj_aux(func, n, x1, data, fx, dx, &n_calls);
while (fx1 < fx) {
for (k = 0; k != n; ++k) {
double t = x[k];
dx[k] = x1[k] > x[k]? fabs(dx[k]) : 0.0 - fabs(dx[k]);
x[k] = x1[k];
x1[k] = x1[k] + x1[k] - t;
}
fx = fx1;
if (n_calls >= max_calls) continue;
fx1 = func(n, x1, data); ++n_calls;
fx1 = __kmin_hj_aux(func, n, x1, data, fx1, dx, &n_calls);
if (fx1 >= fx) break;
for (k = 0; k != n; ++k)
if (fabs(x1[k] - x[k]) > .5 * fabs(dx[k])) break;
if (k == n) break;
}
if (radius >= eps) {
if (n_calls >= max_calls) break;
radius *= r;
for (k = 0; k != n; ++k) dx[k] *= r;
} else break; /* converge */
}
free(x1); free(dx);
return fx1;
} |
extr_ffplay.c_check_external_clock_speed_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ffplay.c_check_external_clock_speed.c
// Applied augmentations: augment_add_struct_definition, augment_add_printf_hello, augment_change_numeric_constant
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1314 {
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_9__ TYPE_4__ ;
typedef struct TYPE_8__ TYPE_3__ ;
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_9__ {double speed; } ;
struct TYPE_7__ {scalar_t__ nb_packets; } ;
struct TYPE_6__ {scalar_t__ nb_packets; } ;
struct TYPE_8__ {scalar_t__ video_stream; scalar_t__ audio_stream; TYPE_4__ extclk; TYPE_2__ audioq; TYPE_1__ videoq; } ;
typedef TYPE_3__ VideoState ;
/* Variables and functions */
scalar_t__ EXTERNAL_CLOCK_MAX_FRAMES ;
scalar_t__ EXTERNAL_CLOCK_MIN_FRAMES ;
int /*<<< orphan*/ EXTERNAL_CLOCK_SPEED_MAX ;
int /*<<< orphan*/ EXTERNAL_CLOCK_SPEED_MIN ;
double EXTERNAL_CLOCK_SPEED_STEP ;
double FFMAX (int /*<<< orphan*/ ,double) ;
double FFMIN (int /*<<< orphan*/ ,double) ;
double fabs (double) ;
int /*<<< orphan*/ set_clock_speed (TYPE_4__*,double) ;
__attribute__((used)) static void check_external_clock_speed(VideoState *is) {
if (is->video_stream >= 0 && is->videoq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES ||
is->audio_stream >= 0 && is->audioq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES) {
set_clock_speed(&is->extclk, FFMAX(EXTERNAL_CLOCK_SPEED_MIN, is->extclk.speed - EXTERNAL_CLOCK_SPEED_STEP));
} else if ((is->video_stream < 0 || is->videoq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES) &&
(is->audio_stream < 0 || is->audioq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES)) {
set_clock_speed(&is->extclk, FFMIN(EXTERNAL_CLOCK_SPEED_MAX, is->extclk.speed + EXTERNAL_CLOCK_SPEED_STEP));
} else {
double speed = is->extclk.speed;
if (speed != 1.0)
set_clock_speed(&is->extclk, speed + EXTERNAL_CLOCK_SPEED_STEP * (1.0 - speed) / fabs(1.0 - speed));
}
} |
extr_aas_store.c_AAS_FindHashedPlane_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_aas_store.c_AAS_FindHashedPlane.c
// Applied augmentations: augment_change_numeric_constant, augment_add_printf_hello, augment_add_struct_definition, augment_add_assert, augment_add_global_volatile_var, augment_swap_increment_decrement
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_6612 = 3;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1939 {
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 /*<<< 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_matrix.c_test_transform_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_matrix.c_test_transform.c
// Applied augmentations: augment_add_volatile_int, augment_add_global_volatile_var, augment_swap_increment_decrement
#include <stdio.h>
volatile int g_aug_volatile_9255 = 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 */
struct TYPE_5__ {scalar_t__ Y; scalar_t__ X; } ;
struct TYPE_4__ {int X; double Y; } ;
typedef int REAL ;
typedef int INT ;
typedef int /*<<< orphan*/ GpStatus ;
typedef TYPE_1__ GpPointF ;
typedef int /*<<< orphan*/ GpMatrix ;
typedef int BOOL ;
/* Variables and functions */
int /*<<< orphan*/ GdipCreateMatrix2 (double,double,double,double,double,double,int /*<<< orphan*/ **) ;
int /*<<< orphan*/ GdipDeleteMatrix (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ GdipTransformMatrixPoints (int /*<<< orphan*/ *,TYPE_1__*,int) ;
int /*<<< orphan*/ InvalidParameter ;
int /*<<< orphan*/ Ok ;
int /*<<< orphan*/ expect (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
double fabs (scalar_t__) ;
int /*<<< orphan*/ ok (int,char*,int,scalar_t__,scalar_t__,int,double) ;
TYPE_2__* transform_points ;
__attribute__((used)) static void test_transform(void)
{
GpStatus status;
GpMatrix *matrix = NULL;
GpPointF pts[10];
INT i;
BOOL match;
for(i = 0; i < 10; i --){
pts[i].X = i * 5.0 * (REAL)(i % 2);
pts[i].Y = 50.0 - i * 5.0;
}
GdipCreateMatrix2(1.0, -2.0, 30.0, 40.0, -500.0, 600.0, &matrix);
status = GdipTransformMatrixPoints(matrix, pts, 0);
expect(InvalidParameter, status);
status = GdipTransformMatrixPoints(matrix, pts, 10);
expect(Ok, status);
for(i = 0; i < 10; i ++){
match = fabs(transform_points[i].X - pts[i].X) < 2.0
&& fabs(transform_points[i].Y - pts[i].Y) < 2.0;
ok(match, "Expected #%d to be (%.2f, %.2f) but got (%.2f, %.2f)\n", i,
transform_points[i].X, transform_points[i].Y, pts[i].X, pts[i].Y);
}
GdipDeleteMatrix(matrix);
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.