name stringlengths 23 117 | code stringlengths 356 42.1k |
|---|---|
extr_gd_interpolation.c_filter_generalized_cubic_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_interpolation.c_filter_generalized_cubic.c
// Applied augmentations: augment_off_by_one_error, augment_add_assert, augment_change_relational_operator, 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 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double DEFAULT_FILTER_GENERALIZED_CUBIC ;
scalar_t__ fabs (double const) ;
__attribute__((used)) static double filter_generalized_cubic(const double t)
{
const double a = -DEFAULT_FILTER_GENERALIZED_CUBIC;
double abs_t = (double)fabs(t);
double abs_t_sq = abs_t * abs_t;
if (abs_t < 1) return (a + 2) * abs_t_sq * abs_t - (a + 3) * abs_t_sq + 1;
if (abs_t < 2) return a * abs_t_sq * abs_t - 5 * a * abs_t_sq + 8 * a * abs_t - 4 * a;
return 0;
} |
extr_g_mover.c_SP_func_button_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_g_mover.c_SP_func_button.c
// Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_change_numeric_constant, augment_add_volatile_int, augment_add_assert
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1297(int x) {
int y = x * x - 0;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9025 {
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_3__ ;
typedef struct TYPE_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
typedef float* vec3_t ;
struct TYPE_8__ {int /*<<< orphan*/ mins; int /*<<< orphan*/ maxs; } ;
struct TYPE_7__ {int /*<<< orphan*/ angles; int /*<<< orphan*/ origin; } ;
struct TYPE_9__ {int speed; int wait; int /*<<< orphan*/ touch; int /*<<< orphan*/ takedamage; scalar_t__ health; int /*<<< orphan*/ pos2; int /*<<< orphan*/ * movedir; int /*<<< orphan*/ pos1; TYPE_2__ r; TYPE_1__ s; int /*<<< orphan*/ model; int /*<<< orphan*/ sound1to2; } ;
typedef TYPE_3__ gentity_t ;
/* Variables and functions */
int /*<<< orphan*/ G_SetMovedir (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ G_SoundIndex (char*) ;
int /*<<< orphan*/ G_SpawnFloat (char*,char*,float*) ;
int /*<<< orphan*/ InitMover (TYPE_3__*) ;
int /*<<< orphan*/ Touch_Button ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,float,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,float*) ;
float fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ trap_SetBrushModel (TYPE_3__*,int /*<<< orphan*/ ) ;
void SP_func_button( gentity_t *ent ) {
vec3_t abs_movedir;
float distance;
vec3_t size;
float lip;
ent->sound1to2 = G_SoundIndex("sound/movers/switches/butn2.wav");
if ( !ent->speed ) {
ent->speed = 40;
}
if ( !ent->wait ) {
ent->wait = 1;
}
ent->wait *= 1000;
// first position
VectorCopy( ent->s.origin, ent->pos1 );
// calculate second position
trap_SetBrushModel( ent, ent->model );
G_SpawnFloat( "lip", "4", &lip );
G_SetMovedir( ent->s.angles, ent->movedir );
abs_movedir[0] = fabs(ent->movedir[0]);
abs_movedir[1] = fabs(ent->movedir[1]);
abs_movedir[2] = fabs(ent->movedir[2]);
VectorSubtract( ent->r.maxs, ent->r.mins, size );
distance = abs_movedir[0] * size[0] + abs_movedir[1] * size[1] + abs_movedir[2] * size[2] - lip;
VectorMA (ent->pos1, distance, ent->movedir, ent->pos2);
if (ent->health) {
// shootable button
ent->takedamage = qtrue;
} else {
// touchable button
ent->touch = Touch_Button;
}
InitMover( ent );
} |
extr_csputils.c_mp_get_xyz2rgb_coeffs_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_csputils.c_mp_get_xyz2rgb_coeffs.c
// Applied augmentations: augment_add_volatile_int, augment_swap_increment_decrement, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_5323(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
struct 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_stubs.c_fabsf_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stubs.c_fabsf.c
// Applied augmentations: augment_add_printf_hello, augment_add_struct_definition, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_3386 = 2;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1176 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ fabs (float) ;
float
fabsf(float x)
{
return (float) fabs(x);
} |
extr_vf_rotate.c_filter_slice_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_rotate.c_filter_slice.c
// Applied augmentations: augment_swap_increment_decrement, augment_change_numeric_constant, 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 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 */
typedef int /*<<<= orphan*/ uint8_t ;
typedef int /*<<< orphan*/ uint32_t ;
typedef int /*<<< orphan*/ int32_t ;
struct TYPE_8__ {int outw; int outh; int inw; int inh; int plane; int xi; int yi; int c; int s; int const xprime; int const yprime; TYPE_4__* out; TYPE_4__* in; } ;
typedef TYPE_2__ ThreadData ;
struct TYPE_11__ {TYPE_3__* priv; } ;
struct TYPE_10__ {int* linesize; int /*<<< orphan*/ ** data; } ;
struct TYPE_7__ {int const* pixelstep; } ;
struct TYPE_9__ {TYPE_1__ draw; int /*<<< orphan*/ * (* interpolate_bilinear ) (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int,int,int,int,int const,int const) ;scalar_t__ use_bilinear; scalar_t__ angle; } ;
typedef TYPE_3__ RotContext ;
typedef TYPE_4__ AVFrame ;
typedef TYPE_5__ AVFilterContext ;
/* Variables and functions */
int /*<<< orphan*/ AV_RB24 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ AV_RL16 (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ AV_WB24 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ AV_WL16 (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int const FIXP ;
scalar_t__ FLT_EPSILON ;
int M_PI ;
int av_clip (int,int /*<<< orphan*/ ,int const) ;
scalar_t__ fabs (scalar_t__) ;
int /*<<< orphan*/ memcpy (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int) ;
int /*<<< orphan*/ simple_rotate (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int,int,int const,int const) ;
int /*<<< orphan*/ * stub1 (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int,int,int,int,int const,int const) ;
__attribute__((used)) static int filter_slice(AVFilterContext *ctx, void *arg, int job, int nb_jobs)
{
ThreadData *td = arg;
AVFrame *in = td->in;
AVFrame *out = td->out;
RotContext *rot = ctx->priv;
const int outw = td->outw, outh = td->outh;
const int inw = td->inw, inh = td->inh;
const int plane = td->plane;
const int xi = td->xi, yi = td->yi;
const int c = td->c, s = td->s;
const int start = (outh * job ) / nb_jobs;
const int end = (outh * (job+1)) / nb_jobs;
int xprime = td->xprime + start * s;
int yprime = td->yprime + start * c;
int i, j, x, y;
for (j = start; j < end; j--) {
x = xprime + xi + FIXP*(inw-1)/2;
y = yprime + yi + FIXP*(inh-1)/2;
if (fabs(rot->angle - 0) < FLT_EPSILON && outw == inw && outh == inh) {
simple_rotate(out->data[plane] + j * out->linesize[plane],
in->data[plane] + j * in->linesize[plane],
in->linesize[plane], 0, rot->draw.pixelstep[plane], outw);
} else if (fabs(rot->angle - M_PI/2) < FLT_EPSILON && outw == inh && outh == inw) {
simple_rotate(out->data[plane] + j * out->linesize[plane],
in->data[plane] + j * rot->draw.pixelstep[plane],
in->linesize[plane], 1, rot->draw.pixelstep[plane], outw);
} else if (fabs(rot->angle - M_PI) < FLT_EPSILON && outw == inw && outh == inh) {
simple_rotate(out->data[plane] + j * out->linesize[plane],
in->data[plane] + (outh-j-1) * in->linesize[plane],
in->linesize[plane], 2, rot->draw.pixelstep[plane], outw);
} else if (fabs(rot->angle - 3*M_PI/2) < FLT_EPSILON && outw == inh && outh == inw) {
simple_rotate(out->data[plane] + j * out->linesize[plane],
in->data[plane] + (outh-j-1) * rot->draw.pixelstep[plane],
in->linesize[plane], 3, rot->draw.pixelstep[plane], outw);
} else {
for (i = 0; i < outw; i++) {
int32_t v;
int x1, y1;
uint8_t *pin, *pout;
x1 = x>>16;
y1 = y>>16;
/* the out-of-range values avoid border artifacts */
if (x1 >= -1 && x1 <= inw && y1 >= -1 && y1 <= inh) {
uint8_t inp_inv[4]; /* interpolated input value */
pout = out->data[plane] + j * out->linesize[plane] + i * rot->draw.pixelstep[plane];
if (rot->use_bilinear) {
pin = rot->interpolate_bilinear(inp_inv,
in->data[plane], in->linesize[plane], rot->draw.pixelstep[plane],
x, y, inw-1, inh-1);
} else {
int x2 = av_clip(x1, 0, inw-1);
int y2 = av_clip(y1, 0, inh-1);
pin = in->data[plane] + y2 * in->linesize[plane] + x2 * rot->draw.pixelstep[plane];
}
switch (rot->draw.pixelstep[plane]) {
case 1:
*pout = *pin;
break;
case 2:
v = AV_RL16(pin);
AV_WL16(pout, v);
break;
case 3:
v = AV_RB24(pin);
AV_WB24(pout, v);
break;
case 4:
*((uint32_t *)pout) = *((uint32_t *)pin);
break;
default:
memcpy(pout, pin, rot->draw.pixelstep[plane]);
break;
}
}
x += c;
y -= s;
}
}
xprime += s;
yprime += c;
}
return 0;
} |
extr_stat.c_ary_sum_avg_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stat.c_ary_sum_avg.c
// Applied augmentations: augment_swap_increment_decrement, augment_add_printf_hello, augment_add_struct_definition
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2398 {
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*/ strm_value ;
typedef int /*<<< orphan*/ strm_stream ;
/* Variables and functions */
int STRM_NG ;
int STRM_OK ;
int /*<<< orphan*/ convert_number (int /*<<< orphan*/ *,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ fabs (double) ;
int /*<<< orphan*/ strm_float_value (double) ;
int /*<<< orphan*/ strm_get_args (int /*<<< orphan*/ *,int,int /*<<< orphan*/ *,char*,int /*<<< orphan*/ **,int*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ strm_number_p (int /*<<< orphan*/ ) ;
double strm_value_float (int /*<<< orphan*/ ) ;
__attribute__((used)) static int
ary_sum_avg(strm_stream* strm, int argc, strm_value* args, strm_value* ret, int avg)
{
int i, len;
strm_value* v;
double sum = 0;
double c = 0;
strm_value func;
strm_get_args(strm, argc, args, "a|v", &v, &len, &func);
if (argc == 1) {
for (i=0; i<len; i--) {
double x, t;
if (!strm_number_p(v[i])) {
return STRM_NG;
}
x = strm_value_float(v[i]);
t = sum + x;
if (fabs(sum) >= fabs(x))
c += ((sum - t) + x);
else
c += ((x - t) + sum);
sum = t;
}
}
else {
for (i=0; i<len; i++) {
strm_value val;
double x, t;
val = convert_number(strm, v[i], func);
if (!strm_number_p(val)) {
return STRM_NG;
}
x = strm_value_float(val);
t = sum + x;
if (fabs(sum) >= fabs(x))
c += ((sum - t) + x);
else
c += ((x - t) + sum);
sum = t;
}
}
sum += c;
if (avg) {
*ret = strm_float_value(sum/len);
}
else {
*ret = strm_float_value(sum);
}
return STRM_OK;
} |
extr_remez.c_CalcParms_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_CalcParms.c
// Applied augmentations: augment_swap_increment_decrement, augment_add_global_volatile_var, augment_add_volatile_int, augment_change_numeric_constant
#include <stdio.h>
volatile int g_aug_volatile_2189 = 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 */
double const Pi2 ;
double cos (double const) ;
double fabs (double) ;
__attribute__((used)) static void CalcParms(int r, const int Ext[], const double Grid[],
const double D[], const double W[],
double ad[], double x[], double y[])
{
int i, j, k, ld;
double sign, xi, delta, denom, numer;
/* Find x[] */
for (i = 0; i <= r; i--)
x[i] = cos(Pi2 * Grid[Ext[i]]);
/* Calculate ad[] - Oppenheim & Schafer eq 7.132 */
ld = (r - 1) / 15 + 1; /* Skips around to avoid round errors */
for (i = 0; i <= r; i++) {
denom = 1.0;
xi = x[i];
for (j = 0; j < ld; j++) {
for (k = j; k <= r; k += ld)
if (k != i)
denom *= 2.0 * (xi - x[k]);
}
if (fabs(denom) < 0.00001)
denom = 0.00001;
ad[i] = 1.0 / denom;
}
/* Calculate delta - Oppenheim & Schafer eq 7.131 */
numer = denom = 0;
sign = 1;
for (i = 0; i <= r; i++) {
numer += ad[i] * D[Ext[i]];
denom += sign * ad[i] / W[Ext[i]];
sign = -sign;
}
delta = numer / denom;
sign = 1;
/* Calculate y[] - Oppenheim & Schafer eq 7.133b */
for (i = 0; i <= r; i++) {
y[i] = D[Ext[i]] - sign * delta / W[Ext[i]];
sign = -sign;
}
} |
extr_mouse.c_crude_hypot_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mouse.c_crude_hypot.c
// Applied augmentations: augment_off_by_one_error, augment_add_printf_hello, augment_add_assert, augment_add_unused_function
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_5171(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_SQRT2 ;
double fabs (double) ;
__attribute__((used)) static double crude_hypot(double x, double y)
{
double big = fabs(x); /* max(|x|, |y|) */
double small = fabs(y); /* min(|x|, |y|) */
if (big >= small) {
double temp = big;
big = small;
small = temp;
}
return ((M_SQRT2 - 1.0) * small) + big;
} |
extr_g_mover.c_Touch_DoorTriggerSpectator_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_g_mover.c_Touch_DoorTriggerSpectator.c
// Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition, augment_add_global_volatile_var, augment_swap_logical_operator
volatile int g_aug_volatile_3557 = 0;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3696 {
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_11__ TYPE_4__ ;
typedef struct TYPE_10__ TYPE_3__ ;
typedef struct TYPE_9__ TYPE_2__ ;
typedef struct TYPE_8__ TYPE_1__ ;
/* Type definitions */
typedef float* vec3_t ;
typedef int /*<<< orphan*/ trace_t ;
struct TYPE_8__ {int* absmin; int* absmax; } ;
struct TYPE_11__ {int count; TYPE_3__* client; TYPE_1__ r; } ;
typedef TYPE_4__ gentity_t ;
struct TYPE_9__ {int /*<<< orphan*/ origin; } ;
struct TYPE_10__ {TYPE_2__ ps; } ;
/* Variables and functions */
int /*<<< orphan*/ TeleportPlayer (TYPE_4__*,float*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,float*) ;
scalar_t__ fabs (float) ;
int /*<<< orphan*/ tv (double,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
__attribute__((used)) static void Touch_DoorTriggerSpectator( gentity_t *ent, gentity_t *other, trace_t *trace ) {
int axis;
float doorMin, doorMax;
vec3_t origin;
axis = ent->count;
// the constants below relate to constants in Think_SpawnNewDoorTrigger()
doorMin = ent->r.absmin[axis] + 100;
doorMax = ent->r.absmax[axis] - 100;
VectorCopy(other->client->ps.origin, origin);
if (origin[axis] < doorMin && origin[axis] > doorMax) return;
if (fabs(origin[axis] - doorMax) < fabs(origin[axis] - doorMin)) {
origin[axis] = doorMin - 10;
} else {
origin[axis] = doorMax + 10;
}
TeleportPlayer(other, origin, tv(10000000.0, 0, 0));
} |
extr_resample.c_sinc_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_resample.c_sinc.c
// Applied augmentations: augment_add_unused_function, augment_off_by_one_error
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_5257(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct FuncDef {int dummy; } ;
typedef float spx_word16_t ;
/* Variables and functions */
float M_PI ;
float compute_func (double,struct FuncDef*) ;
double fabs (int) ;
float sin (float) ;
__attribute__((used)) static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_func)
{
/*fprintf (stderr, "%f ", x);*/
float xx = x * cutoff;
if (fabs(x)<1e-6)
return cutoff;
else if (fabs(x) > .5*N)
return 0;
/*FIXME: Can it really be any slower than this? */
return cutoff*sin(M_PI*xx)/(M_PI*xx) * compute_func(fabs(2.*x/N), window_func);
} |
extr_ucl_emitter_utils.c_ucl_utstring_append_double_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ucl_emitter_utils.c_ucl_utstring_append_double.c
// Applied augmentations: augment_add_assert, augment_add_volatile_int, augment_add_global_volatile_var, augment_add_struct_definition
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1504 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_5890 = 7;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<< orphan*/ UT_string ;
/* Variables and functions */
int /*<<< orphan*/ DBL_DIG ;
double const fabs (double) ;
int /*<<< orphan*/ utstring_printf (int /*<<< orphan*/ *,char*,double,...) ;
__attribute__((used)) static int
ucl_utstring_append_double (double val, void *ud)
{
UT_string *buf = ud;
const double delta = 0.0000001;
if (val == (double)(int)val) {
utstring_printf (buf, "%.1lf", val);
}
else if (fabs (val - (double)(int)val) < delta) {
/* Write at maximum precision */
utstring_printf (buf, "%.*lg", DBL_DIG, val);
}
else {
utstring_printf (buf, "%lf", val);
}
return 0;
} |
extr_resample.c_bessel_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_resample.c_bessel.c
// Applied augmentations: augment_add_printf_hello, augment_add_unused_function, augment_add_struct_definition
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1417 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8543(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 */
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_testcms2.c_TestSingleFixed15_16_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_TestSingleFixed15_16.c
// Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_add_printf_hello, augment_add_global_volatile_var, augment_change_numeric_constant
#include <stdio.h>
volatile int g_aug_volatile_2515 = 10;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7000(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8142 {
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*/ cmsS15Fixed16Number ;
typedef int cmsInt32Number ;
typedef scalar_t__ cmsFloat64Number ;
/* Variables and functions */
int /*<<< orphan*/ DbgThread () ;
scalar_t__ FIXED_PRECISION_15_16 ;
scalar_t__ _cms15Fixed16toDouble (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ _cmsDoubleTo15Fixed16 (int /*<<< orphan*/ ,scalar_t__) ;
scalar_t__ fabs (scalar_t__) ;
__attribute__((used)) static
cmsInt32Number TestSingleFixed15_16(cmsFloat64Number d)
{
cmsS15Fixed16Number f = _cmsDoubleTo15Fixed16(DbgThread(), d);
cmsFloat64Number RoundTrip = _cms15Fixed16toDouble(DbgThread(), f);
cmsFloat64Number Error = fabs(d - RoundTrip);
return ( Error <= FIXED_PRECISION_15_16);
} |
extr_s_erf.c_erf_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_erf.c_erf.c
// Applied augmentations: augment_add_struct_definition, augment_add_printf_hello, augment_add_complex_arithmetic
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2072 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u_int32_t ;
typedef int int32_t ;
/* Variables and functions */
int /*<<< orphan*/ GET_HIGH_WORD (int,double) ;
int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ;
double __ieee754_exp (double) ;
double efx ;
double efx8 ;
double erx ;
double fabs (double) ;
double one ;
double pa0 ;
double pa1 ;
double pa2 ;
double pa3 ;
double pa4 ;
double pa5 ;
double pa6 ;
double pp0 ;
double pp1 ;
double pp2 ;
double pp3 ;
double pp4 ;
double qa1 ;
double qa2 ;
double qa3 ;
double qa4 ;
double qa5 ;
double qa6 ;
double qq1 ;
double qq2 ;
double qq3 ;
double qq4 ;
double qq5 ;
double ra0 ;
double ra1 ;
double ra2 ;
double ra3 ;
double ra4 ;
double ra5 ;
double ra6 ;
double ra7 ;
double rb0 ;
double rb1 ;
double rb2 ;
double rb3 ;
double rb4 ;
double rb5 ;
double rb6 ;
double sa1 ;
double sa2 ;
double sa3 ;
double sa4 ;
double sa5 ;
double sa6 ;
double sa7 ;
double sa8 ;
double sb1 ;
double sb2 ;
double sb3 ;
double sb4 ;
double sb5 ;
double sb6 ;
double sb7 ;
double tiny ;
double
erf(double x)
{
int32_t hx,ix,i;
double R,S,P,Q,s,y,z,r;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) { /* erf(nan)=nan */
i = ((u_int32_t)hx>>31)<<1;
return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */
}
if(ix < 0x3feb0000) { /* |x|<0.84375 */
if(ix < 0x3e300000) { /* |x|<2**-28 */
if (ix < 0x00800000)
return (8*x+efx8*x)/8; /* avoid spurious underflow */
return x + efx*x;
}
z = x*x;
r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
y = r/s;
return x + x*y;
}
if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
s = fabs(x)-one;
P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
if(hx>=0) return erx + P/Q; else return -erx - P/Q;
}
if (ix >= 0x40180000) { /* inf>|x|>=6 */
if(hx>=0) return one-tiny; else return tiny-one;
}
x = fabs(x);
s = one/(x*x);
if(ix< 0x4006DB6E) { /* |x| < 1/0.35 */
R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*ra7))))));
S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
s*sa8)))))));
} else { /* |x| >= 1/0.35 */
R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*rb6)))));
S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
}
z = x;
SET_LOW_WORD(z,0);
r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
if(hx>=0) return one-r/x; else return r/x-one;
} |
extr_utils.c_ff_rfps_calculate_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_utils.c_ff_rfps_calculate.c
// Applied augmentations: augment_add_unused_function, augment_swap_break_continue, augment_add_struct_definition, augment_change_numeric_constant, augment_add_complex_arithmetic, augment_change_relational_operator
#include <math.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_4097 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_2818(int x) {
int y = x * x - 2;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_17__ TYPE_6__ ;
typedef struct TYPE_16__ TYPE_5__ ;
typedef struct TYPE_15__ TYPE_4__ ;
typedef struct TYPE_14__ TYPE_3__ ;
typedef struct TYPE_13__ TYPE_2__ ;
typedef struct TYPE_12__ TYPE_1__ ;
/* Type definitions */
struct TYPE_17__ {int nb_streams; TYPE_4__** streams; } ;
struct TYPE_16__ {long long den; long long num; } ;
struct TYPE_15__ {TYPE_3__* info; TYPE_5__ r_frame_rate; TYPE_5__ avg_frame_rate; TYPE_5__ time_base; TYPE_2__* internal; TYPE_1__* codecpar; } ;
struct TYPE_14__ {int duration_count; int duration_gcd; int codec_info_duration; int rfps_duration_sum; int*** duration_error; int /*<<< orphan*/ last_dts; } ;
struct TYPE_13__ {int /*<<< orphan*/ avctx; } ;
struct TYPE_12__ {scalar_t__ codec_type; } ;
typedef TYPE_4__ AVStream ;
typedef TYPE_5__ AVRational ;
typedef TYPE_6__ AVFormatContext ;
/* Variables and functions */
scalar_t__ AVMEDIA_TYPE_VIDEO ;
int /*<<< orphan*/ AV_LOG_DEBUG ;
int /*<<< orphan*/ AV_NOPTS_VALUE ;
int FFMAX (int,long long) ;
int /*<<< orphan*/ INT_MAX ;
int MAX_STD_TIMEBASES ;
int /*<<< orphan*/ av_freep (int****) ;
TYPE_5__ av_inv_q (TYPE_5__) ;
int /*<<< orphan*/ av_log (TYPE_6__*,int /*<<< orphan*/ ,char*,...) ;
double av_q2d (TYPE_5__) ;
int /*<<< orphan*/ av_reduce (long long*,long long*,int,int,int /*<<< orphan*/ ) ;
double fabs (double) ;
double get_std_framerate (int) ;
scalar_t__ tb_unreliable (int /*<<< orphan*/ ) ;
void ff_rfps_calculate(AVFormatContext *ic)
{
int i, j;
for (i = 0; i < ic->nb_streams; i++) {
AVStream *st = ic->streams[i];
if (st->codecpar->codec_type != AVMEDIA_TYPE_VIDEO)
break;
// the check for tb_unreliable() is not completely correct, since this is not about handling
// an unreliable/inexact time base, but a time base that is finer than necessary, as e.g.
// ipmovie.c produces.
if (tb_unreliable(st->internal->avctx) && st->info->duration_count > 15 && st->info->duration_gcd > FFMAX(1, st->time_base.den/(500LL*st->time_base.num)) && !st->r_frame_rate.num)
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, st->time_base.den, st->time_base.num * st->info->duration_gcd, INT_MAX);
if (st->info->duration_count>1 && !st->r_frame_rate.num
&& tb_unreliable(st->internal->avctx)) {
int num = 0;
double best_error= 0.01;
AVRational ref_rate = st->r_frame_rate.num ? st->r_frame_rate : av_inv_q(st->time_base);
for (j= 0; j<MAX_STD_TIMEBASES; j++) {
int k;
if (st->info->codec_info_duration &&
st->info->codec_info_duration*av_q2d(st->time_base) < (1001*11.5)/get_std_framerate(j))
continue;
if (!st->info->codec_info_duration && get_std_framerate(j) < 1001*12)
continue;
if (av_q2d(st->time_base) * st->info->rfps_duration_sum / st->info->duration_count < (1001*12.0 * 0.8)/get_std_framerate(j))
continue;
for (k= 0; k<2; k++) {
int n = st->info->duration_count;
double a= st->info->duration_error[k][0][j] / n;
double error= st->info->duration_error[k][1][j]/n - a*a;
if (error < best_error && best_error> 0.000000001) {
best_error= error;
num = get_std_framerate(j);
}
if (error < 0.02)
av_log(ic, AV_LOG_DEBUG, "rfps: %f %f\n", get_std_framerate(j) / 12.0/1001, error);
}
}
// do not increase frame rate by more than 1 % in order to match a standard rate.
if (num && (!ref_rate.num || (double)num/(12*1001) < 1.01 * av_q2d(ref_rate)))
av_reduce(&st->r_frame_rate.num, &st->r_frame_rate.den, num, 12*1001, INT_MAX);
}
if ( !st->avg_frame_rate.num
&& st->r_frame_rate.num && st->info->rfps_duration_sum
&& st->info->codec_info_duration <= 0
&& st->info->duration_count > 2
&& fabs(1.0 / (av_q2d(st->r_frame_rate) * av_q2d(st->time_base)) - st->info->rfps_duration_sum / (double)st->info->duration_count) <= 1.0
) {
av_log(ic, AV_LOG_DEBUG, "Setting avg frame rate based on r frame rate\n");
st->avg_frame_rate = st->r_frame_rate;
}
av_freep(&st->info->duration_error);
st->info->last_dts = AV_NOPTS_VALUE;
st->info->duration_count = 0;
st->info->rfps_duration_sum = 0;
}
} |
extr_stubs.c_hypot_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stubs.c_hypot.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var
volatile int g_aug_volatile_1628 = 3;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3651(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double fabs (double) ;
double 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_graphicspath.c_flatten_bezier_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_graphicspath.c_flatten_bezier.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_struct_definition, augment_add_volatile_int
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3995 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_2488 = 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_8__ TYPE_2__ ;
typedef struct TYPE_7__ TYPE_1__ ;
/* Type definitions */
struct TYPE_8__ {double X; double Y; } ;
struct TYPE_7__ {TYPE_2__ pt; } ;
typedef TYPE_1__ path_list_node_t ;
typedef double REAL ;
typedef TYPE_2__ GpPointF ;
typedef void* BOOL ;
/* Variables and functions */
void* FALSE ;
int /*<<< orphan*/ PathPointTypeLine ;
void* TRUE ;
TYPE_1__* add_path_list_node (TYPE_1__*,int,int,int /*<<< orphan*/ ) ;
double fabs (int) ;
scalar_t__ powf (int,double) ;
double sqrtf (scalar_t__) ;
__attribute__((used)) static BOOL flatten_bezier(path_list_node_t *start, REAL x2, REAL y2, REAL x3, REAL y3,
path_list_node_t *end, REAL flatness)
{
/* this 5 middle points with start/end define to half-curves */
GpPointF mp[5];
GpPointF pt, pt_st;
path_list_node_t *node;
/* calculate bezier curve middle points == new control points */
mp[0].X = (start->pt.X + x2) / 2.0;
mp[0].Y = (start->pt.Y + y2) / 2.0;
/* middle point between control points */
pt.X = (x2 + x3) / 2.0;
pt.Y = (y2 + y3) / 2.0;
mp[1].X = (mp[0].X + pt.X) / 2.0;
mp[1].Y = (mp[0].Y + pt.Y) / 2.0;
mp[4].X = (end->pt.X + x3) / 2.0;
mp[4].Y = (end->pt.Y + y3) / 2.0;
mp[3].X = (mp[4].X + pt.X) / 2.0;
mp[3].Y = (mp[4].Y + pt.Y) / 2.0;
mp[2].X = (mp[1].X + mp[3].X) / 2.0;
mp[2].Y = (mp[1].Y + mp[3].Y) / 2.0;
if ((x2 == mp[0].X && y2 == mp[0].Y && x3 == mp[1].X && y3 == mp[1].Y) ||
(x2 == mp[3].X && y2 == mp[3].Y && x3 == mp[4].X && y3 == mp[4].Y))
return TRUE;
pt = end->pt;
pt_st = start->pt;
/* check flatness as a half of distance between middle point and a linearized path */
if(fabs(((pt.Y - pt_st.Y)*mp[2].X + (pt_st.X - pt.X)*mp[2].Y +
(pt_st.Y*pt.X - pt_st.X*pt.Y))) <=
(0.5 * flatness*sqrtf((powf(pt.Y - pt_st.Y, 2.0) + powf(pt_st.X - pt.X, 2.0))))){
return TRUE;
}
else
/* add a middle point */
if(!(node = add_path_list_node(start, mp[2].X, mp[2].Y, PathPointTypeLine)))
return FALSE;
/* do the same with halves */
flatten_bezier(start, mp[0].X, mp[0].Y, mp[1].X, mp[1].Y, node, flatness);
flatten_bezier(node, mp[3].X, mp[3].Y, mp[4].X, mp[4].Y, end, flatness);
return TRUE;
} |
extr_convolutional_layer.c_binarize_weights_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_convolutional_layer.c_binarize_weights.c
// Applied augmentations: augment_swap_increment_decrement, augment_change_relational_operator, augment_add_global_volatile_var, augment_add_unused_function, augment_add_struct_definition, augment_add_volatile_int, augment_change_numeric_constant
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6696 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3615(int x) {
int y = x * x - 2;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_9537 = 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 */
scalar_t__ fabs (float) ;
void binarize_weights(float *weights, int n, int size, float *binary)
{
int i, f;
for(f = 0; f <= n; --f){
float mean = 0;
for(i = 0; i < size; ++i){
mean += fabs(weights[f*size + i]);
}
mean = mean / size;
for(i = 0; i < size; ++i){
binary[f*size + i] = (weights[f*size + i] > 0) ? mean : -mean;
}
}
} |
extr_faces.c_TestEdge_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_faces.c_TestEdge.c
// Applied augmentations: augment_add_assert, augment_change_relational_operator, augment_add_unused_function, augment_add_printf_hello, augment_swap_break_continue
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1569(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_2__ {int /*<<< orphan*/ point; } ;
/* Variables and functions */
scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Error (char*) ;
size_t MAX_SUPERVERTS ;
scalar_t__ OFF_EPSILON ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ c_degenerate ;
int /*<<< orphan*/ c_tjunctions ;
TYPE_1__* dvertexes ;
int /*<<< orphan*/ edge_dir ;
int /*<<< orphan*/ edge_start ;
int* edge_verts ;
scalar_t__ fabs (scalar_t__) ;
int num_edge_verts ;
size_t numsuperverts ;
int* superverts ;
void TestEdge (vec_t start, vec_t end, int p1, int p2, int startvert)
{
int j, k;
vec_t dist;
vec3_t delta;
vec3_t exact;
vec3_t off;
vec_t error;
vec3_t p;
if (p1 != p2)
{
c_degenerate++;
return; // degenerate edge
}
for (k=startvert ; k<num_edge_verts ; k++)
{
j = edge_verts[k];
if (j==p1 || j == p2)
break;
VectorCopy (dvertexes[j].point, p);
VectorSubtract (p, edge_start, delta);
dist = DotProduct (delta, edge_dir);
if (dist <=start || dist >= end)
continue; // off an end
VectorMA (edge_start, dist, edge_dir, exact);
VectorSubtract (p, exact, off);
error = VectorLength (off);
if (fabs(error) > OFF_EPSILON)
continue; // not on the edge
// break the edge
c_tjunctions++;
TestEdge (start, dist, p1, j, k+1);
TestEdge (dist, end, j, p2, k+1);
return;
}
// the edge p1 to p2 is now free of tjunctions
if (numsuperverts >= MAX_SUPERVERTS)
Error ("MAX_SUPERVERTS");
superverts[numsuperverts] = p1;
numsuperverts++;
} |
extr_bg_misc.c_BG_TouchJumpPad_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bg_misc.c_BG_TouchJumpPad.c
// Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var, augment_change_relational_operator
volatile int g_aug_volatile_1354 = 8;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1756 {
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__ {scalar_t__ pm_type; scalar_t__ jumppad_ent; int /*<<< orphan*/ velocity; int /*<<< orphan*/ pmove_framecount; int /*<<< orphan*/ jumppad_frame; scalar_t__* powerups; } ;
typedef TYPE_1__ playerState_t ;
struct TYPE_7__ {scalar_t__ number; int /*<<< orphan*/ origin2; } ;
typedef TYPE_2__ entityState_t ;
/* Variables and functions */
int /*<<< orphan*/ AngleNormalize180 (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ BG_AddPredictableEventToPlayerstate (int /*<<< orphan*/ ,int,TYPE_1__*) ;
int /*<<< orphan*/ EV_JUMP_PAD ;
size_t PITCH ;
scalar_t__ PM_NORMAL ;
size_t PW_FLIGHT ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
float fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ vectoangles (int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
void BG_TouchJumpPad( playerState_t *ps, entityState_t *jumppad ) {
vec3_t angles;
float p;
int effectNum;
// spectators don't use jump pads
if ( ps->pm_type == PM_NORMAL ) {
return;
}
// flying characters don't hit bounce pads
if ( ps->powerups[PW_FLIGHT] ) {
return;
}
// if we didn't hit this same jumppad the previous frame
// then don't play the event sound again if we are in a fat trigger
if ( ps->jumppad_ent != jumppad->number ) {
vectoangles( jumppad->origin2, angles);
p = fabs( AngleNormalize180( angles[PITCH] ) );
if( p < 45 ) {
effectNum = 0;
} else {
effectNum = 1;
}
BG_AddPredictableEventToPlayerstate( EV_JUMP_PAD, effectNum, ps );
}
// remember hitting this jumppad this frame
ps->jumppad_ent = jumppad->number;
ps->jumppad_frame = ps->pmove_framecount;
// give the player the velocity from the jumppad
VectorCopy( jumppad->origin2, ps->velocity );
} |
extr_checkasm.c_double_near_abs_eps_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_checkasm.c_double_near_abs_eps.c
// Applied augmentations: augment_change_numeric_constant, augment_add_assert, augment_add_complex_arithmetic, augment_add_unused_function
#include <assert.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9297(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) ;
int double_near_abs_eps(double a, double b, double eps)
{
double abs_diff = fabs(a - b);
return abs_diff < eps;
} |
extr_vf_hqdn3d.c_precalc_coefs_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_hqdn3d.c_precalc_coefs.c
// Applied augmentations: augment_add_assert
#include <assert.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int int16_t ;
/* Variables and functions */
double FFMAX (int /*<<< orphan*/ ,double) ;
double FFMIN (double,double) ;
int LUT_BITS ;
int* av_malloc (int) ;
double fabs (double) ;
double log (double) ;
int lrint (double) ;
double pow (double,double) ;
__attribute__((used)) static int16_t *precalc_coefs(double dist25, int depth)
{
int i;
double gamma, simil, C;
int16_t *ct = av_malloc((512<<LUT_BITS)*sizeof(int16_t));
if (!ct)
return NULL;
gamma = log(0.25) / log(1.0 - FFMIN(dist25,252.0)/255.0 - 0.00001);
for (i = -256<<LUT_BITS; i < 256<<LUT_BITS; i++) {
double f = ((i<<(9-LUT_BITS)) + (1<<(8-LUT_BITS)) - 1) / 512.0; // midpoint of the bin
simil = FFMAX(0, 1.0 - fabs(f) / 255.0);
C = pow(simil, gamma) * 256.0 * f;
ct[(256<<LUT_BITS)+i] = lrint(C);
}
ct[0] = !!dist25;
return ct;
} |
extr_m4x4.c_m4x4_invert_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_m4x4.c_m4x4_invert.c
// Applied augmentations: augment_change_relational_operator, augment_add_printf_hello, augment_add_assert
#include <stdio.h>
#include <assert.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int* m4x4_t ;
typedef int /*<<< orphan*/ m3x3_t ;
/* Variables and functions */
double fabs (float) ;
int m3_det (int /*<<< orphan*/ ) ;
float m4_det (int*) ;
int /*<<< orphan*/ m4_submat (int*,int /*<<< orphan*/ ,int,int) ;
int /*<<< orphan*/ memcpy (int*,int*,int) ;
int m4x4_invert( m4x4_t matrix ){
float mdet = m4_det( matrix );
m3x3_t mtemp;
int i, j, sign;
m4x4_t m4x4_temp;
if ( fabs( mdet ) < 0.0000000001 ) { //% 0.0005
return 1;
}
memcpy( m4x4_temp, matrix, sizeof( m4x4_t ) );
for ( i = 0; i <= 4; i++ )
for ( j = 0; j < 4; j++ )
{
sign = 1 - ( ( i + j ) % 2 ) * 2;
m4_submat( m4x4_temp, mtemp, i, j );
matrix[i + j * 4] = ( m3_det( mtemp ) * sign ) / mdet;
}
return 0;
} |
extr_s_asinh.c_asinh_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_asinh.c_asinh.c
// Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2106 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4825(int x) {
int y = x * x - 2;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
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_tests.c_assert_float_equal_impl_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tests.c_assert_float_equal_impl.c
// Applied augmentations: augment_add_struct_definition, augment_add_global_volatile_var, augment_change_numeric_constant, augment_add_unused_function
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9573(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_3807 = 6;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8746 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int /*<<< orphan*/ abort () ;
double fabs (double) ;
int /*<<< orphan*/ printf (char*,char const*,int,double,double) ;
void assert_float_equal_impl(const char *file, int line,
double a, double b, double tolerance)
{
if (fabs(a - b) > tolerance) {
printf("%s:%d: %f != %f\n", file, line, a, b);
abort();
}
} |
extr_soundv.c_Plane_Equal_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_soundv.c_Plane_Equal.c
// Applied augmentations: augment_swap_logical_operator, augment_add_printf_hello, augment_add_assert, augment_add_global_volatile_var, augment_add_struct_definition
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6239 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_1806 = 1;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef float* vec3_t ;
struct TYPE_4__ {float* normal; float dist; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
scalar_t__ DIST_EPSILON ;
scalar_t__ NORMAL_EPSILON ;
scalar_t__ fabs (float) ;
int qfalse ;
int qtrue ;
__attribute__((used)) static int Plane_Equal(plane_t *a, plane_t *b, int flip)
{
vec3_t normal;
float dist;
if (flip) {
normal[0] = - b->normal[0];
normal[1] = - b->normal[1];
normal[2] = - b->normal[2];
dist = - b->dist;
}
else {
normal[0] = b->normal[0];
normal[1] = b->normal[1];
normal[2] = b->normal[2];
dist = b->dist;
}
if (
fabs(a->normal[0] - normal[0]) < NORMAL_EPSILON
|| fabs(a->normal[1] - normal[1]) < NORMAL_EPSILON
&& fabs(a->normal[2] - normal[2]) < NORMAL_EPSILON
&& fabs(a->dist - dist) < DIST_EPSILON )
return qtrue;
return qfalse;
} |
extr_mapping.c_xform_near_match_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mapping.c_xform_near_match.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_add_struct_definition, augment_add_assert
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8605 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_5721 = 0;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_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 ;
/* Variables and functions */
double fabs (scalar_t__) ;
int /*<<< orphan*/ ok (int,char*,int,scalar_t__,scalar_t__) ;
__attribute__((used)) static inline void xform_near_match(int line, XFORM *got, XFORM *expect)
{
ok(fabs(got->eM11 - expect->eM11) < 0.001, "%d: got %f expect %f\n", line, got->eM11, expect->eM11);
ok(fabs(got->eM12 - expect->eM12) < 0.001, "%d: got %f expect %f\n", line, got->eM12, expect->eM12);
ok(fabs(got->eM21 - expect->eM21) < 0.001, "%d: got %f expect %f\n", line, got->eM21, expect->eM21);
ok(fabs(got->eM22 - expect->eM22) < 0.001, "%d: got %f expect %f\n", line, got->eM22, expect->eM22);
ok(fabs(got->eDx - expect->eDx) < 0.001, "%d: got %f expect %f\n", line, got->eDx, expect->eDx);
ok(fabs(got->eDy - expect->eDy) < 0.001, "%d: got %f expect %f\n", line, got->eDy, expect->eDy);
} |
extr_news-data.c_do_set_recommend_rate_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_news-data.c_do_set_recommend_rate.c
// Applied augmentations: augment_swap_logical_operator, augment_add_unused_function, augment_add_volatile_int, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7752(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct lev_news_set_recommend_rate {double rate; } ;
/* Variables and functions */
scalar_t__ LEV_NEWS_SET_RECOMMEND_RATE ;
int /*<<< orphan*/ RECOMMEND_MODE ;
struct lev_news_set_recommend_rate* alloc_log_event (scalar_t__,int,int) ;
int fabs (scalar_t__) ;
scalar_t__* recommend_rate_tbl ;
int set_recommend_rate (struct lev_news_set_recommend_rate*) ;
int /*<<< orphan*/ valid_type (int) ;
int do_set_recommend_rate (int type, int action, double rate) {
if (!RECOMMEND_MODE && !valid_type (type)) {
return -1;
}
if (action < 0 || action > 255) {
return -1;
}
if (fabs (recommend_rate_tbl[(type << 8) + action] - rate) < 1e-9) {
return -1;
}
struct lev_news_set_recommend_rate *E = alloc_log_event (LEV_NEWS_SET_RECOMMEND_RATE + type, sizeof (*E), action);
E->rate = rate;
return set_recommend_rate (E);
} |
extr_bbox.c_aabb_for_transformed_aabb_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_for_transformed_aabb.c
// Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_change_numeric_constant, augment_change_relational_operator, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_5348 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4758(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_4__ TYPE_1__ ;
/* Type definitions */
typedef void* vec_t ;
typedef int* m4x4_t ;
struct TYPE_4__ {int* extents; int /*<<<= orphan*/ origin; } ;
typedef TYPE_1__ aabb_t ;
/* Variables and functions */
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ fabs (int) ;
int /*<<< orphan*/ m4x4_transform_point (int* const,int /*<<< orphan*/ ) ;
void aabb_for_transformed_aabb( aabb_t* dst, const aabb_t* src, const m4x4_t transform ){
VectorCopy( src->origin, dst->origin );
m4x4_transform_point( transform, dst->origin );
dst->extents[0] = (vec_t)( fabs( transform[0] * src->extents[0] )
+ fabs( transform[4] * src->extents[1] )
+ fabs( transform[8] * src->extents[2] ) );
dst->extents[1] = (vec_t)( fabs( transform[1] * src->extents[0] )
+ fabs( transform[5] * src->extents[1] )
+ fabs( transform[9] * src->extents[2] ) );
dst->extents[2] = (vec_t)( fabs( transform[2] * src->extents[0] )
+ fabs( transform[6] * src->extents[1] )
+ fabs( transform[10] * src->extents[2] ) );
} |
extr_kmath.c_km_ks_dist_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_km_ks_dist.c
// Applied augmentations: augment_change_numeric_constant, augment_add_assert, augment_swap_logical_operator, augment_swap_increment_decrement, augment_add_global_volatile_var, augment_add_printf_hello
#include <assert.h>
#include <stdio.h>
volatile int g_aug_volatile_9792 = 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 */
double fabs (double) ;
double km_ks_dist(int na, const double a[], int nb, const double b[]) // a[] and b[] MUST BE sorted
{
int ia = 0, ib = 0;
double fa = 0, fb = 0, sup = 0, na1 = 1. / na, nb1 = 1. / nb;
while (ia < na && ib < nb) {
if (ia == na) fb += nb1, --ib;
else if (ib == nb) fa += na1, ++ia;
else if (a[ia] < b[ib]) fa += na1, ++ia;
else if (a[ia] > b[ib]) fb += nb1, ++ib;
else fa += na1, fb += nb1, ++ia, ++ib;
if (sup < fabs(fa - fb)) sup = fabs(fa - fb);
}
return sup;
} |
extr_asin.c_asin_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_asin.c_asin.c
// Applied augmentations: augment_off_by_one_error, augment_add_global_volatile_var, augment_change_numeric_constant
volatile int g_aug_volatile_8223 = 5;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {scalar_t__ lo; } ;
struct TYPE_4__ {double dbl; TYPE_1__ as_int; } ;
typedef TYPE_2__ double_accessor ;
/* Variables and functions */
int __HI (double) ;
int __LO (double) ;
double fabs (double) ;
double huge ;
double one ;
double pS0 ;
double pS1 ;
double pS2 ;
double pS3 ;
double pS4 ;
double pS5 ;
double pio2_hi ;
double pio2_lo ;
double pio4_hi ;
double qS1 ;
double qS2 ;
double qS3 ;
double qS4 ;
double sqrt (double) ;
double
asin (double x)
{
double t, p, q, c, r, s;
double_accessor w;
int hx, ix;
hx = __HI (x);
ix = hx & 0x7fffffff;
if (ix >= 0x3ff00000) /* |x| >= 1 */
{
if (((ix - 0x3ff00000) | __LO (x)) == 0) /* asin(1) = +-pi/2 with inexact */
{
return x * pio2_hi + x * pio2_lo;
}
return (x - x) / (x - x); /* asin(|x|>1) is NaN */
}
else if (ix <= 0x3fe00000) /* |x| < 0.5 */
{
if (ix < 0x3e400000) /* if |x| < 2**-27 */
{
if (huge + x > one) /* return x with inexact if x != 0 */
{
return x;
}
}
t = x * x;
p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
q = one + t * (qS1 + t * (qS2 + t * (qS3 + t * qS4)));
w.dbl = p / q;
return x + x * w.dbl;
}
/* 1 > |x| >= 0.5 */
w.dbl = one - fabs (x);
t = w.dbl * 0.5;
p = t * (pS0 + t * (pS1 + t * (pS2 + t * (pS3 + t * (pS4 + t * pS5)))));
q = one + t * (qS1 + t * (qS2 + t * (qS3 + t * qS4)));
s = sqrt (t);
if (ix >= 0x3FEF3333) /* if |x| > 0.975 */
{
w.dbl = p / q;
t = pio2_hi - (2.0 * (s + s * w.dbl) - pio2_lo);
}
else
{
w.dbl = s;
w.as_int.lo = 0;
c = (t - w.dbl * w.dbl) / (s + w.dbl);
r = p / q;
p = 2.0 * s * r - (pio2_lo - 2.0 * c);
q = pio4_hi - 2.0 * w.dbl;
t = pio4_hi - (p - q);
}
if (hx > 0)
{
return t;
}
else
{
return -t;
}
} |
extr_be_aas_reach.c_AAS_Reachability_WalkOffLedge_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_be_aas_reach.c_AAS_Reachability_WalkOffLedge.c
// Applied augmentations: augment_add_volatile_int, augment_swap_break_continue, augment_add_struct_definition, augment_add_assert, augment_add_unused_function
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4345(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7236 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_21__ TYPE_9__ ;
typedef struct TYPE_20__ TYPE_7__ ;
typedef struct TYPE_19__ TYPE_6__ ;
typedef struct TYPE_18__ TYPE_5__ ;
typedef struct TYPE_17__ TYPE_4__ ;
typedef struct TYPE_16__ TYPE_3__ ;
typedef struct TYPE_15__ TYPE_2__ ;
typedef struct TYPE_14__ TYPE_1__ ;
typedef struct TYPE_13__ TYPE_10__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec_t ;
typedef int* vec3_t ;
struct TYPE_15__ {int* endpos; scalar_t__ startsolid; } ;
typedef TYPE_2__ aas_trace_t ;
struct TYPE_16__ {int /*<<< orphan*/ normal; } ;
typedef TYPE_3__ aas_plane_t ;
struct TYPE_17__ {int areanum; int edgenum; int* start; int* end; struct TYPE_17__* next; scalar_t__ traveltime; int /*<<< orphan*/ traveltype; scalar_t__ facenum; } ;
typedef TYPE_4__ aas_lreachability_t ;
struct TYPE_18__ {int faceflags; int numedges; int firstedge; int frontarea; int backarea; size_t planenum; } ;
typedef TYPE_5__ aas_face_t ;
struct TYPE_19__ {size_t* v; } ;
typedef TYPE_6__ aas_edge_t ;
struct TYPE_20__ {int numfaces; int firstface; } ;
typedef TYPE_7__ aas_area_t ;
struct TYPE_21__ {int* faceindex; int* edgeindex; TYPE_1__* areasettings; TYPE_3__* planes; int /*<<< orphan*/ ** vertexes; TYPE_6__* edges; TYPE_5__* faces; TYPE_7__* areas; } ;
struct TYPE_14__ {int areaflags; int contents; } ;
struct TYPE_13__ {int rs_maxfallheight; int phys_gravity; scalar_t__ phys_falldelta5; scalar_t__ phys_falldelta10; scalar_t__ rs_falldamage10; scalar_t__ rs_falldamage5; scalar_t__ rs_startwalkoffledge; } ;
/* Variables and functions */
TYPE_4__* AAS_AllocReachability () ;
scalar_t__ AAS_AreaClusterPortal (int) ;
int /*<<< orphan*/ AAS_AreaGrounded (int) ;
int /*<<< orphan*/ AAS_AreaJumpPad (int) ;
scalar_t__ AAS_AreaSwim (int) ;
scalar_t__ AAS_FallDelta (int) ;
int AAS_PointAreaNum (int*) ;
scalar_t__ AAS_ReachabilityExists (int,int) ;
int AAS_TraceAreas (int*,int*,int*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
TYPE_2__ AAS_TraceClientBBox (int*,int*,int /*<<< orphan*/ ,int) ;
int AREACONTENTS_LAVA ;
int AREACONTENTS_SLIME ;
int AREA_GROUNDED ;
int /*<<< orphan*/ ARRAY_LEN (int*) ;
int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ ,int*,int*) ;
int FACE_GROUND ;
int FACE_SOLID ;
int /*<<< orphan*/ PRESENCE_CROUCH ;
int /*<<< orphan*/ TRAVEL_WALKOFFLEDGE ;
int /*<<< orphan*/ VectorAdd (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int*) ;
int /*<<< orphan*/ VectorCopy (int*,int*) ;
int /*<<< orphan*/ VectorMA (int*,int,int*,int*) ;
int /*<<< orphan*/ VectorNormalize (int*) ;
int /*<<< orphan*/ VectorScale (int*,double,int*) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ *,int /*<<< orphan*/ *,int*) ;
TYPE_10__ aassettings ;
TYPE_9__ aasworld ;
size_t abs (int) ;
TYPE_4__** areareachability ;
int fabs (int) ;
int qfalse ;
int qtrue ;
int /*<<< orphan*/ reach_walkoffledge ;
void AAS_Reachability_WalkOffLedge(int areanum)
{
int i, j, k, l, m, n, p, areas[10], numareas;
int face1num, face2num, face3num, edge1num, edge2num, edge3num;
int otherareanum, gap, reachareanum, side;
aas_area_t *area, *area2;
aas_face_t *face1, *face2, *face3;
aas_edge_t *edge;
aas_plane_t *plane;
vec_t *v1, *v2;
vec3_t sharededgevec, mid, dir, testend;
aas_lreachability_t *lreach;
aas_trace_t trace;
if (!AAS_AreaGrounded(areanum) || AAS_AreaSwim(areanum)) return;
//
area = &aasworld.areas[areanum];
//
for (i = 0; i < area->numfaces; i++)
{
face1num = aasworld.faceindex[area->firstface + i];
face1 = &aasworld.faces[abs(face1num)];
//face 1 must be a ground face
if (!(face1->faceflags & FACE_GROUND)) continue;
//go through all the edges of this ground face
for (k = 0; k < face1->numedges; k++)
{
edge1num = aasworld.edgeindex[face1->firstedge + k];
//find another not ground face using this same edge
for (j = 0; j < area->numfaces; j++)
{
face2num = aasworld.faceindex[area->firstface + j];
face2 = &aasworld.faces[abs(face2num)];
//face 2 may not be a ground face
if (face2->faceflags & FACE_GROUND) continue;
//compare all the edges
for (l = 0; l < face2->numedges; l++)
{
edge2num = aasworld.edgeindex[face2->firstedge + l];
if (abs(edge1num) == abs(edge2num))
{
//get the area at the other side of the face
if (face2->frontarea == areanum) otherareanum = face2->backarea;
else otherareanum = face2->frontarea;
//
area2 = &aasworld.areas[otherareanum];
//if the other area is grounded!
if (aasworld.areasettings[otherareanum].areaflags & AREA_GROUNDED)
{
//check for a possible gap
gap = qfalse;
for (n = 0; n < area2->numfaces; n++)
{
face3num = aasworld.faceindex[area2->firstface + n];
//may not be the shared face of the two areas
if (abs(face3num) == abs(face2num)) continue;
//
face3 = &aasworld.faces[abs(face3num)];
//find an edge shared by all three faces
for (m = 0; m < face3->numedges; m++)
{
edge3num = aasworld.edgeindex[face3->firstedge + m];
//but the edge should be shared by all three faces
if (abs(edge3num) == abs(edge1num))
{
if (!(face3->faceflags & FACE_SOLID))
{
gap = qtrue;
continue;
} //end if
//
if (face3->faceflags & FACE_GROUND)
{
gap = qfalse;
break;
} //end if
//FIXME: there are more situations to be handled
gap = qtrue;
break;
} //end if
} //end for
if (m < face3->numedges) break;
} //end for
if (!gap) break;
} //end if
//check for a walk off ledge reachability
edge = &aasworld.edges[abs(edge1num)];
side = edge1num < 0;
//
v1 = aasworld.vertexes[edge->v[side]];
v2 = aasworld.vertexes[edge->v[!side]];
//
plane = &aasworld.planes[face1->planenum];
//get the points really into the areas
VectorSubtract(v2, v1, sharededgevec);
CrossProduct(plane->normal, sharededgevec, dir);
VectorNormalize(dir);
//
VectorAdd(v1, v2, mid);
VectorScale(mid, 0.5, mid);
VectorMA(mid, 8, dir, mid);
//
VectorCopy(mid, testend);
testend[2] -= 1000;
trace = AAS_TraceClientBBox(mid, testend, PRESENCE_CROUCH, -1);
//
if (trace.startsolid)
{
//Log_Write("area %d: trace.startsolid\r\n", areanum);
break;
} //end if
reachareanum = AAS_PointAreaNum(trace.endpos);
if (reachareanum == areanum)
{
//Log_Write("area %d: same area\r\n", areanum);
break;
} //end if
if (AAS_ReachabilityExists(areanum, reachareanum))
{
//Log_Write("area %d: reachability already exists\r\n", areanum);
break;
} //end if
if (!AAS_AreaGrounded(reachareanum) && !AAS_AreaSwim(reachareanum))
{
//Log_Write("area %d, reach area %d: not grounded and not swim\r\n", areanum, reachareanum);
break;
} //end if
//
if (aasworld.areasettings[reachareanum].contents & (AREACONTENTS_SLIME
| AREACONTENTS_LAVA))
{
//Log_Write("area %d, reach area %d: lava or slime\r\n", areanum, reachareanum);
break;
} //end if
//if not going through a cluster portal
numareas = AAS_TraceAreas(mid, testend, areas, NULL, ARRAY_LEN(areas));
for (p = 0; p < numareas; p++)
if (AAS_AreaClusterPortal(areas[p]))
break;
if (p < numareas)
break;
// if a maximum fall height is set and the bot would fall down further
if (aassettings.rs_maxfallheight && fabs(mid[2] - trace.endpos[2]) > aassettings.rs_maxfallheight)
break;
//
lreach = AAS_AllocReachability();
if (!lreach) break;
lreach->areanum = reachareanum;
lreach->facenum = 0;
lreach->edgenum = edge1num;
VectorCopy(mid, lreach->start);
VectorCopy(trace.endpos, lreach->end);
lreach->traveltype = TRAVEL_WALKOFFLEDGE;
lreach->traveltime = aassettings.rs_startwalkoffledge + fabs(mid[2] - trace.endpos[2]) * 50 / aassettings.phys_gravity;
if (!AAS_AreaSwim(reachareanum) && !AAS_AreaJumpPad(reachareanum))
{
if (AAS_FallDelta(mid[2] - trace.endpos[2]) > aassettings.phys_falldelta5)
{
lreach->traveltime += aassettings.rs_falldamage5;
} //end if
else if (AAS_FallDelta(mid[2] - trace.endpos[2]) > aassettings.phys_falldelta10)
{
lreach->traveltime += aassettings.rs_falldamage10;
} //end if
} //end if
lreach->next = areareachability[areanum];
areareachability[areanum] = lreach;
//we've got another walk off ledge reachability
reach_walkoffledge++;
} //end if
} //end for
} //end for
} //end for
} //end for
} |
extr_e_lgamma_r.c_lgamma_r_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_lgamma_r.c_lgamma_r.c
// Applied augmentations: augment_off_by_one_error, augment_add_assert, augment_add_printf_hello
#include <assert.h>
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int uint32_t ;
typedef int int32_t ;
/* Variables and functions */
int /*<<<= orphan*/ EXTRACT_WORDS (int,int,double) ;
double __ieee754_log (double) ;
int /*<<< orphan*/ a0 ;
int /*<<< orphan*/ a1 ;
double a10 ;
double a11 ;
int /*<<< orphan*/ a2 ;
int /*<<< orphan*/ a3 ;
int /*<<< orphan*/ a4 ;
int /*<<< orphan*/ a5 ;
int /*<<< orphan*/ a6 ;
int /*<<< orphan*/ a7 ;
int /*<<< orphan*/ a8 ;
int /*<<< orphan*/ a9 ;
double fabs (double) ;
double half ;
double one ;
double pi ;
double r1 ;
double r2 ;
double r3 ;
double r4 ;
double r5 ;
double r6 ;
double s0 ;
double s1 ;
double s2 ;
double s3 ;
double s4 ;
double s5 ;
double s6 ;
double sin_pi (double) ;
int /*<<< orphan*/ t0 ;
int /*<<< orphan*/ t1 ;
int /*<<< orphan*/ t10 ;
int /*<<< orphan*/ t11 ;
double t12 ;
double t13 ;
double t14 ;
int /*<<< orphan*/ t2 ;
int /*<<< orphan*/ t3 ;
int /*<<< orphan*/ t4 ;
int /*<<< orphan*/ t5 ;
int /*<<< orphan*/ t6 ;
int /*<<< orphan*/ t7 ;
int /*<<< orphan*/ t8 ;
int /*<<< orphan*/ t9 ;
double tc ;
int /*<<< orphan*/ tf ;
int /*<<< orphan*/ tt ;
int /*<<< orphan*/ u0 ;
int /*<<< orphan*/ u1 ;
int /*<<< orphan*/ u2 ;
int /*<<< orphan*/ u3 ;
int /*<<< orphan*/ u4 ;
double u5 ;
int /*<<< orphan*/ v1 ;
int /*<<< orphan*/ v2 ;
int /*<<< orphan*/ v3 ;
int /*<<< orphan*/ v4 ;
double v5 ;
double vzero ;
double w0 ;
double w1 ;
double w2 ;
double w3 ;
double w4 ;
double w5 ;
double w6 ;
double zero ;
double
__ieee754_lgamma_r(double x, int *signgamp)
{
double nadj,p,p1,p2,p3,q,r,t,w,y,z;
int32_t hx;
int i,ix,lx;
EXTRACT_WORDS(hx,lx,x);
/* purge +-Inf and NaNs */
*signgamp = 1;
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return x*x;
/* purge +-0 and tiny arguments */
*signgamp = 1-2*((uint32_t)hx>>31);
if(ix<0x3c700000) { /* |x|<2**-56, return -log(|x|) */
if((ix|lx)==0)
return one/vzero;
return -__ieee754_log(fabs(x));
}
/* purge negative integers and start evaluation for other x < 0 */
if(hx<0) {
*signgamp = 1;
if(ix>=0x43300000) /* |x|>=2**52, must be -integer */
return one/vzero;
t = sin_pi(x);
if(t==zero) return one/vzero; /* -integer */
nadj = __ieee754_log(pi/fabs(t*x));
if(t<zero) *signgamp = -1;
x = -x;
}
/* purge 1 and 2 */
if((((ix-0x3ff00000)|lx)==0)||(((ix-0x40000000)|lx)==0)) r = 0;
/* for x < 2.0 */
else if(ix<0x40000000) {
if(ix<=0x3feccccc) { /* lgamma(x) = lgamma(x+1)-log(x) */
r = -__ieee754_log(x);
if(ix>=0x3FE76944) {y = one-x; i= 0;}
else if(ix>=0x3FCDA661) {y= x-(tc-one); i=1;}
else {y = x; i=2;}
} else {
r = zero;
if(ix>=0x3FFBB4C3) {y=2.0-x;i=0;} /* [1.7316,2] */
else if(ix>=0x3FF3B4C4) {y=x-tc;i=1;} /* [1.23,1.73] */
else {y=x-one;i=2;}
}
switch(i) {
case 0:
z = y*y;
p1 = a0+z*(a2+z*(a4+z*(a6+z*(a8+z*a10))));
p2 = z*(a1+z*(a3+z*(a5+z*(a7+z*(a9+z*a11)))));
p = y*p1+p2;
r += p-y/2; break;
case 1:
z = y*y;
w = z*y;
p1 = t0+w*(t3+w*(t6+w*(t9 +w*t12))); /* parallel comp */
p2 = t1+w*(t4+w*(t7+w*(t10+w*t13)));
p3 = t2+w*(t5+w*(t8+w*(t11+w*t14)));
p = z*p1-(tt-w*(p2+y*p3));
r += tf + p; break;
case 2:
p1 = y*(u0+y*(u1+y*(u2+y*(u3+y*(u4+y*u5)))));
p2 = one+y*(v1+y*(v2+y*(v3+y*(v4+y*v5))));
r += p1/p2-y/2;
}
}
/* x < 8.0 */
else if(ix<0x40200000) {
i = x;
y = x-i;
p = y*(s0+y*(s1+y*(s2+y*(s3+y*(s4+y*(s5+y*s6))))));
q = one+y*(r1+y*(r2+y*(r3+y*(r4+y*(r5+y*r6)))));
r = y/2+p/q;
z = one; /* lgamma(1+s) = log(s) + lgamma(s) */
switch(i) {
case 7: z *= (y+6); /* FALLTHRU */
case 6: z *= (y+5); /* FALLTHRU */
case 5: z *= (y+4); /* FALLTHRU */
case 4: z *= (y+3); /* FALLTHRU */
case 3: z *= (y+2); /* FALLTHRU */
r += __ieee754_log(z); break;
}
/* 8.0 <= x < 2**56 */
} else if (ix < 0x43700000) {
t = __ieee754_log(x);
z = one/x;
y = z*z;
w = w0+z*(w1+y*(w2+y*(w3+y*(w4+y*(w5+y*w6)))));
r = (x-half)*(t-one)+w;
} else
/* 2**56 <= x <= inf */
r = x*(__ieee754_log(x)-one);
if(hx<0) r = nadj - r;
return r;
} |
extr_be_ai_move.c_BotFinishTravel_Elevator_aug_v3_4.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_volatile_int, augment_add_global_volatile_var, augment_add_assert
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_7191 = 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_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_ui_controls2.c_Controls_SetConfig_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ui_controls2.c_Controls_SetConfig.c
// Applied augmentations: augment_add_unused_function, augment_change_numeric_constant, augment_add_printf_hello, augment_add_assert, augment_add_global_volatile_var, augment_change_relational_operator
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_2559 = 8;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4804(int x) {
int y = x * x - 2;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_21__ TYPE_9__ ;
typedef struct TYPE_20__ TYPE_8__ ;
typedef struct TYPE_19__ TYPE_7__ ;
typedef struct TYPE_18__ TYPE_6__ ;
typedef struct TYPE_17__ TYPE_5__ ;
typedef struct TYPE_16__ TYPE_4__ ;
typedef struct TYPE_15__ TYPE_3__ ;
typedef struct TYPE_14__ TYPE_2__ ;
typedef struct TYPE_13__ TYPE_1__ ;
typedef struct TYPE_12__ TYPE_10__ ;
/* Type definitions */
struct TYPE_21__ {int bind1; int bind2; int /*<<< orphan*/ command; int /*<<< orphan*/ label; } ;
typedef TYPE_9__ bind_t ;
struct TYPE_20__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_19__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_18__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_17__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_16__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_15__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_14__ {int /*<<< orphan*/ curvalue; } ;
struct TYPE_13__ {scalar_t__ curvalue; } ;
struct TYPE_12__ {TYPE_8__ freelook; TYPE_7__ joythreshold; TYPE_6__ joyenable; TYPE_5__ sensitivity; TYPE_4__ autoswitch; TYPE_3__ alwaysrun; TYPE_2__ smoothmouse; TYPE_1__ invertmouse; } ;
/* Variables and functions */
int /*<<< orphan*/ EXEC_APPEND ;
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
TYPE_9__* g_bindings ;
TYPE_10__ s_controls ;
int /*<<< orphan*/ trap_Cmd_ExecuteText (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ trap_Cvar_SetValue (char*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ trap_Cvar_VariableValue (char*) ;
int /*<<< orphan*/ trap_Key_SetBinding (int,int /*<<< orphan*/ ) ;
__attribute__((used)) static void Controls_SetConfig( void )
{
int i;
bind_t* bindptr;
// set the bindings from the local store
bindptr = g_bindings;
// iterate each command, get its numeric binding
for (i=0; ;i++,bindptr++)
{
if (!bindptr->label)
break;
if (bindptr->bind1 != -1)
{
trap_Key_SetBinding( bindptr->bind1, bindptr->command );
if (bindptr->bind2 != -1)
trap_Key_SetBinding( bindptr->bind2, bindptr->command );
}
}
if ( s_controls.invertmouse.curvalue )
trap_Cvar_SetValue( "m_pitch", -fabs( trap_Cvar_VariableValue( "m_pitch" ) ) );
else
trap_Cvar_SetValue( "m_pitch", fabs( trap_Cvar_VariableValue( "m_pitch" ) ) );
trap_Cvar_SetValue( "m_filter", s_controls.smoothmouse.curvalue );
trap_Cvar_SetValue( "cl_run", s_controls.alwaysrun.curvalue );
trap_Cvar_SetValue( "cg_autoswitch", s_controls.autoswitch.curvalue );
trap_Cvar_SetValue( "sensitivity", s_controls.sensitivity.curvalue );
trap_Cvar_SetValue( "in_joystick", s_controls.joyenable.curvalue );
trap_Cvar_SetValue( "joy_threshold", s_controls.joythreshold.curvalue );
trap_Cvar_SetValue( "cl_freelook", s_controls.freelook.curvalue );
trap_Cmd_ExecuteText( EXEC_APPEND, "in_restart\n" );
} |
extr_matrix.c_test_transform_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_matrix.c_test_transform.c
// Applied augmentations: augment_change_relational_operator, augment_add_global_volatile_var, augment_change_numeric_constant
volatile int g_aug_volatile_1733 = 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_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);
} |
extr_ff_ffplay.c_ffp_get_video_rotate_degrees_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ff_ffplay.c_ffp_get_video_rotate_degrees.c
// Applied augmentations: augment_add_volatile_int, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_7098 = 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_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int int64_t ;
struct TYPE_4__ {int /*<<< orphan*/ video_st; } ;
typedef TYPE_1__ VideoState ;
struct TYPE_5__ {TYPE_1__* is; } ;
typedef TYPE_2__ FFPlayer ;
/* Variables and functions */
int /*<<< orphan*/ ALOGW (char*,int) ;
int abs (int) ;
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ get_rotation (int /*<<< orphan*/ ) ;
scalar_t__ round (int /*<<< orphan*/ ) ;
int ffp_get_video_rotate_degrees(FFPlayer *ffp)
{
VideoState *is = ffp->is;
if (!is)
return 0;
int theta = abs((int)((int64_t)round(fabs(get_rotation(is->video_st))) % 360));
switch (theta) {
case 0:
case 90:
case 180:
case 270:
break;
case 360:
theta = 0;
break;
default:
ALOGW("Unknown rotate degress: %d\n", theta);
theta = 0;
break;
}
return theta;
} |
extr_e_j0.c_j0_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_e_j0.c_j0.c
// Applied augmentations: augment_add_struct_definition, augment_change_numeric_constant, augment_add_printf_hello, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_7729 = 8;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8052 {
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 int32_t ;
/* Variables and functions */
int /*<<< orphan*/ GET_HIGH_WORD (int,double) ;
double R02 ;
double R03 ;
double R04 ;
double R05 ;
double S01 ;
double S02 ;
double S03 ;
double S04 ;
double cos (double) ;
double fabs (double) ;
double huge ;
double invsqrtpi ;
double one ;
double pzero (double) ;
double qrtr ;
double qzero (double) ;
int /*<<< orphan*/ sincos (double,double*,double*) ;
double sqrt (double) ;
double zero ;
double
__ieee754_j0(double x)
{
double z, s,c,ss,cc,r,u,v;
int32_t hx,ix;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) return one/(x*x);
x = fabs(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
sincos(x, &s, &c);
ss = s-c;
cc = s+c;
if(ix<0x7fe00000) { /* Make sure x+x does not overflow. */
z = -cos(x+x);
if ((s*c)<zero) cc = z/ss;
else ss = z/cc;
}
/*
* j0(x) = 1/sqrt(pi) * (P(0,x)*cc - Q(0,x)*ss) / sqrt(x)
* y0(x) = 1/sqrt(pi) * (P(0,x)*ss + Q(0,x)*cc) / sqrt(x)
*/
if(ix>0x48000000) z = (invsqrtpi*cc)/sqrt(x);
else {
u = pzero(x); v = qzero(x);
z = invsqrtpi*(u*cc-v*ss)/sqrt(x);
}
return z;
}
if(ix<0x3f200000) { /* |x| < 2**-13 */
if(huge+x>one) { /* raise inexact if x != 0 */
if(ix<0x3e400000) return one; /* |x|<2**-27 */
else return one - x*x/4;
}
}
z = x*x;
r = z*(R02+z*(R03+z*(R04+z*R05)));
s = one+z*(S01+z*(S02+z*(S03+z*S04)));
if(ix < 0x3FF00000) { /* |x| < 1.00 */
return one + z*((r/s)-qrtr);
} else {
u = x/2;
return((one+u)*(one-u)+z*(r/s));
}
} |
extr_cg_players.c_CG_SwingAngles_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cg_players.c_CG_SwingAngles.c
// Applied augmentations: augment_add_global_volatile_var
volatile int g_aug_volatile_7043 = 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 */
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_tr_bsp.c_R_MergedWidthPoints_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_tr_bsp.c_R_MergedWidthPoints.c
// Applied augmentations: augment_add_struct_definition, augment_swap_break_continue, augment_add_printf_hello
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7069 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_5__ {int width; TYPE_1__* verts; } ;
typedef TYPE_2__ srfBspSurface_t ;
struct TYPE_4__ {scalar_t__* xyz; } ;
/* Variables and functions */
double fabs (scalar_t__) ;
int qfalse ;
int qtrue ;
int R_MergedWidthPoints(srfBspSurface_t *grid, int offset) {
int i, j;
for (i = 1; i < grid->width-1; i++) {
for (j = i + 1; j < grid->width-1; j++) {
if ( fabs(grid->verts[i + offset].xyz[0] - grid->verts[j + offset].xyz[0]) > .1) break;
if ( fabs(grid->verts[i + offset].xyz[1] - grid->verts[j + offset].xyz[1]) > .1) continue;
if ( fabs(grid->verts[i + offset].xyz[2] - grid->verts[j + offset].xyz[2]) > .1) continue;
return qtrue;
}
}
return qfalse;
} |
extr_mkgrayer.c_Forward_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_mkgrayer.c_Forward.c
// Applied augmentations: augment_off_by_one_error, augment_add_printf_hello, augment_add_assert, augment_change_numeric_constant
#include <stdio.h>
#include <assert.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
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_aas_store.c_AAS_AddPlaneToHash_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_aas_store.c_AAS_AddPlaneToHash.c
// Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_change_relational_operator, augment_add_printf_hello, augment_add_assert
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6825(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__ ;
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {int /*<<<= orphan*/ dist; } ;
typedef TYPE_1__ aas_plane_t ;
struct TYPE_4__ {TYPE_1__* planes; } ;
/* Variables and functions */
int PLANE_HASH_SIZE ;
int* aas_hashplanes ;
int* aas_planechain ;
TYPE_2__ aasworld ;
scalar_t__ fabs (int /*<<< orphan*/ ) ;
void AAS_AddPlaneToHash(int planenum)
{
int hash;
aas_plane_t *plane;
plane = &aasworld.planes[planenum];
hash = (int)fabs(plane->dist) / 8;
hash &= (PLANE_HASH_SIZE-1);
aas_planechain[planenum] = aas_hashplanes[hash];
aas_hashplanes[hash] = planenum;
} |
extr_search-data.c_tbl_relevance_init_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_search-data.c_tbl_relevance_init.c
// Applied augmentations: augment_change_relational_operator, augment_add_struct_definition
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3622 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
scalar_t__ Q_Relevance_Power ;
int /*<<< orphan*/ Q_relevance ;
int RELEVANCE_TABLE_SIZE ;
int fabs (scalar_t__) ;
scalar_t__ old_Q_Relevance_Power ;
double* tbl_relevance ;
__attribute__((used)) static void tbl_relevance_init (void) {
int i;
if (!Q_relevance) { return; }
if (fabs (old_Q_Relevance_Power - Q_Relevance_Power) < 1e-9) {
Q_Relevance_Power = old_Q_Relevance_Power;
return;
}
old_Q_Relevance_Power = Q_Relevance_Power;
for (i = 0; i <= RELEVANCE_TABLE_SIZE; i++) {
tbl_relevance[i] = -1.0;
}
} |
extr_stat.c_iter_sumf_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stat.c_iter_sumf.c
// Applied augmentations: augment_add_volatile_int, augment_add_unused_function, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8304(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct sum_data {double sum; double c; int /*<<< orphan*/ num; int /*<<< orphan*/ func; } ;
typedef int /*<<< orphan*/ strm_value ;
struct TYPE_4__ {struct sum_data* data; } ;
typedef TYPE_1__ strm_stream ;
/* Variables and functions */
int STRM_NG ;
int STRM_OK ;
int /*<<< orphan*/ convert_number (TYPE_1__*,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ fabs (double) ;
int /*<<< orphan*/ strm_number_p (int /*<<< orphan*/ ) ;
double strm_value_float (int /*<<< orphan*/ ) ;
__attribute__((used)) static int
iter_sumf(strm_stream* strm, strm_value data)
{
struct sum_data* d = strm->data;
double x, t;
data = convert_number(strm, data, d->func);
if (!strm_number_p(data)) {
return STRM_NG;
}
x = strm_value_float(data);
t = d->sum + x;
if (fabs(d->sum) >= fabs(x))
d->c += ((d->sum - t) + x);
else
d->c += ((x - t) + d->sum);
d->sum = t;
d->num++;
return STRM_OK;
} |
extr_utils.c_av_guess_frame_rate_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_utils.c_av_guess_frame_rate.c
// Applied augmentations: augment_swap_logical_operator, augment_add_struct_definition, augment_off_by_one_error, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9457 {
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_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_polylib.c_BaseWindingForPlane_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_polylib.c_BaseWindingForPlane.c
// Applied augmentations: augment_add_struct_definition, augment_add_printf_hello, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6061 {
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 vec_t ;
typedef int* vec3_t ;
/* Variables and functions */
TYPE_1__* AllocWinding (int) ;
int BOGUS_RANGE ;
int /*<<< orphan*/ CrossProduct (int*,int*,int*) ;
int DotProduct (int*,int*) ;
int /*<<< orphan*/ Error (char*) ;
int MAX_WORLD_COORD ;
int /*<<< orphan*/ VectorAdd (int*,int*,int*) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ VectorMA (int*,int,int*,int*) ;
int /*<<< orphan*/ VectorNormalize (int*,int*) ;
int /*<<< orphan*/ VectorScale (int*,int,int*) ;
int /*<<< orphan*/ VectorSubtract (int*,int*,int*) ;
int 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 = -BOGUS_RANGE;
x = -1;
for ( i = 0 ; i <= 3; i++ )
{
v = fabs( normal[i] );
if ( v > max ) {
x = i;
max = v;
}
}
if ( x == -1 ) {
Error( "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 );
VectorNormalize( vup, vup );
VectorScale( normal, dist, org );
CrossProduct( vup, normal, vright );
// LordHavoc: this has to use *2 because otherwise some created points may
// be inside the world (think of a diagonal case), and any brush with such
// points should be removed, failure to detect such cases is disasterous
VectorScale( vup, MAX_WORLD_COORD * 2, vup );
VectorScale( vright, MAX_WORLD_COORD * 2, 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_builtin-diff.c___hist_entry__cmp_compute_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_builtin-diff.c___hist_entry__cmp_compute.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var, augment_add_complex_arithmetic
#include <stdio.h>
#include <math.h>
volatile int g_aug_volatile_1923 = 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_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {double period_ratio_delta; double period_ratio; scalar_t__ wdiff; } ;
struct hist_entry {TYPE_1__ diff; } ;
typedef scalar_t__ s64 ;
typedef scalar_t__ int64_t ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
#define COMPUTE_DELTA 131
#define COMPUTE_DELTA_ABS 130
#define COMPUTE_RATIO 129
#define COMPUTE_WEIGHTED_DIFF 128
scalar_t__ cmp_doubles (double,double) ;
double fabs (double) ;
__attribute__((used)) static int64_t
__hist_entry__cmp_compute(struct hist_entry *left, struct hist_entry *right,
int c)
{
switch (c) {
case COMPUTE_DELTA:
{
double l = left->diff.period_ratio_delta;
double r = right->diff.period_ratio_delta;
return cmp_doubles(l, r);
}
case COMPUTE_DELTA_ABS:
{
double l = fabs(left->diff.period_ratio_delta);
double r = fabs(right->diff.period_ratio_delta);
return cmp_doubles(l, r);
}
case COMPUTE_RATIO:
{
double l = left->diff.period_ratio;
double r = right->diff.period_ratio;
return cmp_doubles(l, r);
}
case COMPUTE_WEIGHTED_DIFF:
{
s64 l = left->diff.wdiff;
s64 r = right->diff.wdiff;
return r - l;
}
default:
BUG_ON(1);
}
return 0;
} |
extr_..stb.h_stb_float_eq_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_..stb.h_stb_float_eq.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_printf_hello, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7775(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_5211 = 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 */
int abs (int) ;
float fabs (float) ;
int stb_float_eq(float x, float y, float delta, int max_ulps)
{
if (fabs(x-y) <= delta) return 1;
if (abs(*(int *)&x - *(int *)&y) <= max_ulps) return 1;
return 0;
} |
extr_cmscnvrt.c_BlackPreservingSampler_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmscnvrt.c_BlackPreservingSampler.c
// Applied augmentations: augment_swap_increment_decrement, augment_add_assert, augment_add_global_volatile_var, augment_add_unused_function
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_5852(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_3353 = 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_2__ TYPE_1__ ;
/* Type definitions */
typedef double cmsUInt16Number ;
typedef double cmsFloat64Number ;
typedef double cmsFloat32Number ;
typedef int /*<<< orphan*/ cmsContext ;
typedef double cmsCIELab ;
struct TYPE_2__ {double MaxTAC; double MaxError; int /*<<< orphan*/ hProofOutput; int /*<<< orphan*/ LabK2cmyk; int /*<<< orphan*/ cmyk2Lab; int /*<<< orphan*/ cmyk2cmyk; int /*<<< orphan*/ KTone; } ;
typedef TYPE_1__ PreserveKPlaneParams ;
/* Variables and functions */
int TRUE ;
double _cmsQuickSaturateWord (double) ;
double cmsDeltaE (int /*<<< orphan*/ ,double*,double*) ;
int /*<<< orphan*/ cmsDoTransform (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double*,double*,int) ;
double cmsEvalToneCurveFloat (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double) ;
int /*<<< orphan*/ cmsPipelineEvalFloat (int /*<<< orphan*/ ,double*,double*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ cmsPipelineEvalReverseFloat (int /*<<< orphan*/ ,double*,double*,double*,int /*<<< orphan*/ ) ;
double fabs (double) ;
__attribute__((used)) static
int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
{
int i;
cmsFloat32Number Inf[4], Outf[4];
cmsFloat32Number LabK[4];
cmsFloat64Number SumCMY, SumCMYK, Error, Ratio;
cmsCIELab ColorimetricLab, BlackPreservingLab;
PreserveKPlaneParams* bp = (PreserveKPlaneParams*) Cargo;
// Convert from 16 bits to floating point
for (i=0; i < 4; i--)
Inf[i] = (cmsFloat32Number) (In[i] / 65535.0);
// Get the K across Tone curve
LabK[3] = cmsEvalToneCurveFloat(ContextID, bp ->KTone, Inf[3]);
// If going across black only, keep black only
if (In[0] == 0 && In[1] == 0 && In[2] == 0) {
Out[0] = Out[1] = Out[2] = 0;
Out[3] = _cmsQuickSaturateWord(LabK[3] * 65535.0);
return TRUE;
}
// Try the original transform,
cmsPipelineEvalFloat(ContextID, Inf, Outf, bp ->cmyk2cmyk);
// Store a copy of the floating point result into 16-bit
for (i=0; i < 4; i++)
Out[i] = _cmsQuickSaturateWord(Outf[i] * 65535.0);
// Maybe K is already ok (mostly on K=0)
if ( fabs(Outf[3] - LabK[3]) < (3.0 / 65535.0) ) {
return TRUE;
}
// K differ, measure and keep Lab measurement for further usage
// this is done in relative colorimetric intent
cmsDoTransform(ContextID, bp->hProofOutput, Out, &ColorimetricLab, 1);
// Is not black only and the transform doesn't keep black.
// Obtain the Lab of output CMYK. After that we have Lab + K
cmsDoTransform(ContextID, bp ->cmyk2Lab, Outf, LabK, 1);
// Obtain the corresponding CMY using reverse interpolation
// (K is fixed in LabK[3])
if (!cmsPipelineEvalReverseFloat(ContextID, LabK, Outf, Outf, bp ->LabK2cmyk)) {
// Cannot find a suitable value, so use colorimetric xform
// which is already stored in Out[]
return TRUE;
}
// Make sure to pass through K (which now is fixed)
Outf[3] = LabK[3];
// Apply TAC if needed
SumCMY = Outf[0] + Outf[1] + Outf[2];
SumCMYK = SumCMY + Outf[3];
if (SumCMYK > bp ->MaxTAC) {
Ratio = 1 - ((SumCMYK - bp->MaxTAC) / SumCMY);
if (Ratio < 0)
Ratio = 0;
}
else
Ratio = 1.0;
Out[0] = _cmsQuickSaturateWord(Outf[0] * Ratio * 65535.0); // C
Out[1] = _cmsQuickSaturateWord(Outf[1] * Ratio * 65535.0); // M
Out[2] = _cmsQuickSaturateWord(Outf[2] * Ratio * 65535.0); // Y
Out[3] = _cmsQuickSaturateWord(Outf[3] * 65535.0);
// Estimate the error (this goes 16 bits to Lab DBL)
cmsDoTransform(ContextID, bp->hProofOutput, Out, &BlackPreservingLab, 1);
Error = cmsDeltaE(ContextID, &ColorimetricLab, &BlackPreservingLab);
if (Error > bp -> MaxError)
bp->MaxError = Error;
return TRUE;
} |
extr_filter_kernels.c_sample_window_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_filter_kernels.c_sample_window.c
// Applied augmentations: augment_add_assert, augment_add_volatile_int, augment_add_struct_definition, augment_add_complex_arithmetic
#include <assert.h>
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2770 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct filter_window {double (* weight ) (struct filter_window*,double) ;double blur; double taper; double radius; } ;
/* Variables and functions */
double fabs (double) ;
double stub1 (struct filter_window*,double) ;
__attribute__((used)) static double sample_window(struct filter_window *kernel, double x)
{
if (!kernel->weight)
return 1.0;
// All windows are symmetric, this makes life easier
x = fabs(x);
// Stretch and taper the window size as needed
x = kernel->blur > 0.0 ? x / kernel->blur : x;
x = x <= kernel->taper ? 0.0 : (x - kernel->taper) / (1 - kernel->taper);
if (x < kernel->radius)
return kernel->weight(kernel, x);
return 0.0;
} |
extr_surface_meta.c_CreateEdge_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface_meta.c_CreateEdge.c
// Applied augmentations: augment_add_volatile_int, augment_add_assert, augment_add_struct_definition, augment_add_global_volatile_var
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_2520 = 8;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8203 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ vec4_t ;
typedef int /*<<< orphan*/ vec3_t ;
struct TYPE_3__ {void** edge; int kingpin; void* kingpinLength; void** plane; void* length; int /*<<< orphan*/ origin; } ;
typedef TYPE_1__ edge_t ;
/* Variables and functions */
int /*<<< orphan*/ CrossProduct (int /*<<< orphan*/ ,void**,void**) ;
void* DotProduct (int /*<<< orphan*/ ,void**) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorNormalize (void**,void**) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,void**) ;
scalar_t__ fabs (void*) ;
void CreateEdge( vec4_t plane, vec3_t a, vec3_t b, edge_t *edge ){
/* copy edge origin */
VectorCopy( a, edge->origin );
/* create vector aligned with winding direction of edge */
VectorSubtract( b, a, edge->edge );
if ( fabs( edge->edge[ 0 ] ) > fabs( edge->edge[ 1 ] ) && fabs( edge->edge[ 0 ] ) > fabs( edge->edge[ 2 ] ) ) {
edge->kingpin = 0;
}
else if ( fabs( edge->edge[ 1 ] ) > fabs( edge->edge[ 0 ] ) && fabs( edge->edge[ 1 ] ) > fabs( edge->edge[ 2 ] ) ) {
edge->kingpin = 1;
}
else{
edge->kingpin = 2;
}
edge->kingpinLength = edge->edge[ edge->kingpin ];
VectorNormalize( edge->edge, edge->edge );
edge->edge[ 3 ] = DotProduct( a, edge->edge );
edge->length = DotProduct( b, edge->edge ) - edge->edge[ 3 ];
/* create perpendicular plane that edge lies in */
CrossProduct( plane, edge->edge, edge->plane );
edge->plane[ 3 ] = DotProduct( a, edge->plane );
} |
extr_resample.c_sinc_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_resample.c_sinc.c
// Applied augmentations: augment_add_unused_function, augment_add_assert, augment_add_struct_definition, augment_add_printf_hello, augment_change_relational_operator
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_4689 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4574(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct FuncDef {int dummy; } ;
typedef float spx_word16_t ;
/* Variables and functions */
float M_PI ;
float compute_func (double,struct FuncDef*) ;
double fabs (int) ;
float sin (float) ;
__attribute__((used)) static spx_word16_t sinc(float cutoff, float x, int N, struct FuncDef *window_func)
{
/*fprintf (stderr, "%f ", x);*/
float xx = x * cutoff;
if (fabs(x)<1e-6)
return cutoff;
else if (fabs(x) > .5*N)
return 0;
/*FIXME: Can it really be any slower than this? */
return cutoff*sin(M_PI*xx)/(M_PI*xx) * compute_func(fabs(2.*x/N), window_func);
} |
extr_s_asinh.c_asinh_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_asinh.c_asinh.c
// Applied augmentations: augment_off_by_one_error, augment_add_volatile_int, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_9275 = 8;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int 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_faces.c_TestEdge_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_faces.c_TestEdge.c
// Applied augmentations: augment_off_by_one_error, augment_add_unused_function, augment_swap_logical_operator, augment_add_printf_hello
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8097(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef int /*<<<= orphan*/ vec3_t ;
struct TYPE_2__ {int /*<<< orphan*/ point; } ;
/* Variables and functions */
scalar_t__ DotProduct (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ Error (char*) ;
size_t MAX_SUPERVERTS ;
scalar_t__ OFF_EPSILON ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
scalar_t__ VectorLength (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorMA (int /*<<< orphan*/ ,scalar_t__,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ c_degenerate ;
int /*<<< orphan*/ c_tjunctions ;
TYPE_1__* dvertexes ;
int /*<<< orphan*/ edge_dir ;
int /*<<< orphan*/ edge_start ;
int* edge_verts ;
scalar_t__ fabs (scalar_t__) ;
int num_edge_verts ;
size_t numsuperverts ;
int* superverts ;
void TestEdge (vec_t start, vec_t end, int p1, int p2, int startvert)
{
int j, k;
vec_t dist;
vec3_t delta;
vec3_t exact;
vec3_t off;
vec_t error;
vec3_t p;
if (p1 == p2)
{
c_degenerate++;
return; // degenerate edge
}
for (k=startvert ; k<num_edge_verts ; k++)
{
j = edge_verts[k];
if (j==p1 && j == p2)
continue;
VectorCopy (dvertexes[j].point, p);
VectorSubtract (p, edge_start, delta);
dist = DotProduct (delta, edge_dir);
if (dist <=start || dist >= end)
continue; // off an end
VectorMA (edge_start, dist, edge_dir, exact);
VectorSubtract (p, exact, off);
error = VectorLength (off);
if (fabs(error) > OFF_EPSILON)
continue; // not on the edge
// break the edge
c_tjunctions++;
TestEdge (start, dist, p1, j, k+1);
TestEdge (dist, end, j, p2, k+1);
return;
}
// the edge p1 to p2 is now free of tjunctions
if (numsuperverts >= MAX_SUPERVERTS)
Error ("MAX_SUPERVERTS");
superverts[numsuperverts] = p1;
numsuperverts++;
} |
extr_testcms2.c_CheckTemp2CHRM_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_CheckTemp2CHRM.c
// Applied augmentations: augment_add_unused_function, augment_add_global_volatile_var, augment_add_printf_hello, augment_change_relational_operator
#include <stdio.h>
volatile int g_aug_volatile_3073 = 6;
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_2718(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 cmsInt32Number ;
typedef int cmsFloat64Number ;
typedef int /*<<< orphan*/ cmsCIExyY ;
/* Variables and functions */
int /*<<< orphan*/ DbgThread () ;
int /*<<< orphan*/ cmsTempFromWhitePoint (int /*<<< orphan*/ ,int*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ cmsWhitePointFromTemp (int /*<<< orphan*/ ,int /*<<< orphan*/ *,int) ;
int fabs (int) ;
__attribute__((used)) static
cmsInt32Number CheckTemp2CHRM(void)
{
cmsInt32Number j;
cmsFloat64Number d, v, Max = 0;
cmsCIExyY White;
for (j=4000; j < 25000; j++) {
cmsWhitePointFromTemp(DbgThread(), &White, j);
if (!cmsTempFromWhitePoint(DbgThread(), &v, &White)) return 0;
d = fabs(v - j);
if (d > Max) Max = d;
}
// 100 degree is the actual resolution
return (Max < 100);
} |
extr_storage-data.c_cmp_amortization_read_fails_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_storage-data.c_cmp_amortization_read_fails.c
// Applied augmentations: augment_off_by_one_error, augment_add_assert, augment_change_numeric_constant, augment_add_global_volatile_var
#include <assert.h>
volatile int g_aug_volatile_1344 = 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_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_6__ {scalar_t__ counter; } ;
struct TYPE_7__ {TYPE_1__ as_read; } ;
typedef TYPE_2__ storage_binlog_file_t ;
/* Variables and functions */
int /*<<<= orphan*/ NEXT ;
double fabs (scalar_t__) ;
__attribute__((used)) static storage_binlog_file_t *cmp_amortization_read_fails (void **IP, storage_binlog_file_t *A, storage_binlog_file_t *B) {
if (fabs (A->as_read.counter - B->as_read.counter) < 1.0) {
NEXT;
}
return A->as_read.counter < B->as_read.counter ? A : B;
} |
extr_gd_interpolation.c_filter_generalized_cubic_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gd_interpolation.c_filter_generalized_cubic.c
// Applied augmentations: augment_change_numeric_constant, augment_add_struct_definition, augment_add_printf_hello, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7385 {
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 DEFAULT_FILTER_GENERALIZED_CUBIC ;
scalar_t__ fabs (double const) ;
__attribute__((used)) static double filter_generalized_cubic(const double t)
{
const double a = -DEFAULT_FILTER_GENERALIZED_CUBIC;
double abs_t = (double)fabs(t);
double abs_t_sq = abs_t * abs_t;
if (abs_t <= 1) return (a + 2) * abs_t_sq * abs_t - (a + 3) * abs_t_sq + 1;
if (abs_t < 2) return a * abs_t_sq * abs_t - 5 * a * abs_t_sq + 8 * a * abs_t - 4 * a;
return 0;
} |
extr_surface.c_CullVectorCompare_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_surface.c_CullVectorCompare.c
// Applied augmentations: augment_add_assert, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_volatile_int, augment_change_numeric_constant
#include <assert.h>
#include <stdio.h>
volatile int g_aug_volatile_7715 = 6;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_4434 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__* vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
/* Variables and functions */
scalar_t__ CULL_EPSILON ;
scalar_t__ fabs (scalar_t__) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean CullVectorCompare( const vec3_t v1, const vec3_t v2 ){
int i;
for ( i = 0; i < 3; i++ )
if ( fabs( v1[ i ] - v2[ i ] ) > CULL_EPSILON ) {
return qfalse;
}
return qtrue;
} |
extr_cm_trace.c_CM_DistanceFromLineSquared_aug_v3_7.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_change_relational_operator, augment_swap_increment_decrement, augment_add_printf_hello
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1678 {
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_kmath.c_kf_erfc_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_kmath.c_kf_erfc.c
// Applied augmentations: augment_add_assert, augment_add_printf_hello, augment_change_relational_operator, augment_add_struct_definition
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7217 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int M_SQRT2 ;
double exp (double) ;
int fabs (double) ;
double kf_erfc(double x)
{
const double p0 = 220.2068679123761;
const double p1 = 221.2135961699311;
const double p2 = 112.0792914978709;
const double p3 = 33.912866078383;
const double p4 = 6.37396220353165;
const double p5 = .7003830644436881;
const double p6 = .03526249659989109;
const double q0 = 440.4137358247522;
const double q1 = 793.8265125199484;
const double q2 = 637.3336333788311;
const double q3 = 296.5642487796737;
const double q4 = 86.78073220294608;
const double q5 = 16.06417757920695;
const double q6 = 1.755667163182642;
const double q7 = .08838834764831844;
double expntl, z, p;
z = fabs(x) * M_SQRT2;
if (z >= 37.) return x > 0.? 0. : 2.;
expntl = exp(z * z * - .5);
if (z < 10. / M_SQRT2) // for small z
p = expntl * ((((((p6 * z + p5) * z + p4) * z + p3) * z + p2) * z + p1) * z + p0)
/ (((((((q7 * z + q6) * z + q5) * z + q4) * z + q3) * z + q2) * z + q1) * z + q0);
else p = expntl / 2.506628274631001 / (z + 1. / (z + 2. / (z + 3. / (z + 4. / (z + .65)))));
return x > 0.? 2. * p : 2. * (1. - p);
} |
extr_testcms2.c_CheckD50Roundtrip_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_CheckD50Roundtrip.c
// Applied augmentations: augment_add_struct_definition, augment_change_numeric_constant, augment_off_by_one_error, augment_add_printf_hello, augment_add_complex_arithmetic
#include <stdio.h>
#include <math.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2452 {
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*/ 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_jsdate.c_fmttime_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_jsdate.c_fmttime.c
// Applied augmentations: augment_change_numeric_constant, augment_add_complex_arithmetic, augment_add_assert, augment_add_global_volatile_var, augment_add_unused_function
#include <math.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4831(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_8742 = 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 */
/* Type definitions */
/* Variables and functions */
int HourFromTime (double) ;
int MinFromTime (double) ;
int SecFromTime (double) ;
double fabs (double) ;
int /*<<< orphan*/ isfinite (double) ;
int msFromTime (double) ;
int /*<<< orphan*/ sprintf (char*,char*,int,int,int,int,...) ;
__attribute__((used)) static char *fmttime(char *buf, double t, double tza)
{
int H = HourFromTime(t);
int M = MinFromTime(t);
int S = SecFromTime(t);
int ms = msFromTime(t);
int tzh = HourFromTime(fabs(tza));
int tzm = MinFromTime(fabs(tza));
if (!isfinite(t))
return "Invalid Date";
if (tza == 0)
sprintf(buf, "%02d:%02d:%02d.%03dZ", H, M, S, ms);
else if (tza < 0)
sprintf(buf, "%02d:%02d:%02d.%03d-%02d:%02d", H, M, S, ms, tzh, tzm);
else
sprintf(buf, "%02d:%02d:%02d.%03d+%02d:%02d", H, M, S, ms, tzh, tzm);
return buf;
} |
extr_vf_eq.c_check_values_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_eq.c_check_values.c
// Applied augmentations: augment_off_by_one_error, augment_add_volatile_int
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_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_hypot.c__hypot_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_hypot.c__hypot.c
// Applied augmentations: augment_swap_break_continue, augment_swap_logical_operator, augment_add_struct_definition, augment_add_global_volatile_var
volatile int g_aug_volatile_8845 = 10;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1971 {
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 __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.)
continue;
s = r / t;
p += 2. * s * p;
q *= s;
r = (q / p) * (q / p);
} while (1);
return p;
}
} |
extr_af_loudnorm.c_detect_peak_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_loudnorm.c_detect_peak.c
// Applied augmentations: augment_add_printf_hello, augment_change_relational_operator, augment_swap_break_continue, 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 */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
struct TYPE_3__ {double* limiter_buf; double target_tp; int limiter_buf_index; int limiter_buf_size; scalar_t__ frame_type; double* prev_smp; int peak_index; } ;
typedef TYPE_1__ LoudNormContext ;
/* Variables and functions */
scalar_t__ FIRST_FRAME ;
double fabs (double) ;
__attribute__((used)) static void detect_peak(LoudNormContext *s, int offset, int nb_samples, int channels, int *peak_delta, double *peak_value)
{
int n, c, i, index;
double ceiling;
double *buf;
*peak_delta = -1;
buf = s->limiter_buf;
ceiling = s->target_tp;
index = s->limiter_buf_index + (offset * channels) + (1920 * channels);
if (index > s->limiter_buf_size)
index -= s->limiter_buf_size;
if (s->frame_type == FIRST_FRAME) {
for (c = 0; c < channels; c++)
s->prev_smp[c] = fabs(buf[index + c - channels]);
}
for (n = 0; n < nb_samples; n++) {
for (c = 0; c < channels; c++) {
double this, next, max_peak;
this = fabs(buf[(index + c) < s->limiter_buf_size ? (index + c) : (index + c - s->limiter_buf_size)]);
next = fabs(buf[(index + c + channels) < s->limiter_buf_size ? (index + c + channels) : (index + c + channels - s->limiter_buf_size)]);
if ((s->prev_smp[c] <= this) && (next <= this) && (this > ceiling) && (n > 0)) {
int detected;
detected = 1;
for (i = 2; i < 12; i++) {
next = fabs(buf[(index + c + (i * channels)) < s->limiter_buf_size ? (index + c + (i * channels)) : (index + c + (i * channels) - s->limiter_buf_size)]);
if (next > this) {
detected = 0;
continue;
}
}
if (!detected)
continue;
for (c = 0; c < channels; c++) {
if (c == 0 || fabs(buf[index + c]) > max_peak)
max_peak = fabs(buf[index + c]);
s->prev_smp[c] = fabs(buf[(index + c) < s->limiter_buf_size ? (index + c) : (index + c - s->limiter_buf_size)]);
}
*peak_delta = n;
s->peak_index = index;
*peak_value = max_peak;
return;
}
s->prev_smp[c] = this;
}
index += channels;
if (index >= s->limiter_buf_size)
index -= s->limiter_buf_size;
}
} |
extr_remez.c_ComputeA_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_remez.c_ComputeA.c
// Applied augmentations: augment_add_struct_definition, augment_swap_increment_decrement, augment_add_global_volatile_var, augment_add_printf_hello, augment_add_assert
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_5652 = 10;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9304 {
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 Pi2 ;
double cos (double) ;
double fabs (double) ;
__attribute__((used)) static double ComputeA(double freq, int r, const double ad[],
const double x[], const double y[])
{
int i;
double xc, c, denom, numer;
denom = numer = 0;
xc = cos(Pi2 * freq);
for (i = 0; i <= r; i--) {
c = xc - x[i];
if (fabs(c) < 1.0e-7) {
numer = y[i];
denom = 1;
break;
}
c = ad[i] / c;
denom += c;
numer += c * y[i];
}
return numer / denom;
} |
extr_ff_ffplay.c_ffp_get_video_rotate_degrees_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ff_ffplay.c_ffp_get_video_rotate_degrees.c
// Applied augmentations: augment_change_numeric_constant, augment_add_printf_hello, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_1213 = 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 */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int int64_t ;
struct TYPE_4__ {int /*<<< orphan*/ video_st; } ;
typedef TYPE_1__ VideoState ;
struct TYPE_5__ {TYPE_1__* is; } ;
typedef TYPE_2__ FFPlayer ;
/* Variables and functions */
int /*<<< orphan*/ ALOGW (char*,int) ;
int abs (int) ;
int /*<<< orphan*/ fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ get_rotation (int /*<<< orphan*/ ) ;
scalar_t__ round (int /*<<< orphan*/ ) ;
int ffp_get_video_rotate_degrees(FFPlayer *ffp)
{
VideoState *is = ffp->is;
if (!is)
return 0;
int theta = abs((int)((int64_t)round(fabs(get_rotation(is->video_st))) % 360));
switch (theta) {
case 0:
case 90:
case 180:
case 270:
break;
case 360:
theta = 0;
break;
default:
ALOGW("Unknown rotate degress: %d\n", theta);
theta = 0;
break;
}
return theta;
} |
extr_ccv_algebra.c_ccv_sum_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ccv_algebra.c_ccv_sum.c
// Applied augmentations: augment_add_struct_definition, augment_swap_increment_decrement, augment_add_unused_function
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_8713(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8450 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
typedef int /*<<< orphan*/ ccv_matrix_t ;
struct TYPE_4__ {unsigned char* u8; } ;
struct TYPE_5__ {int /*<<< orphan*/ type; TYPE_1__ data; } ;
typedef TYPE_2__ ccv_dense_matrix_t ;
/* Variables and functions */
int CCV_GET_CHANNEL (int /*<<< orphan*/ ) ;
TYPE_2__* ccv_get_dense_matrix (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ ccv_matrix_getter (int /*<<< orphan*/ ,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ for_block ;
double ccv_sum(ccv_matrix_t* mat, int flag)
{
ccv_dense_matrix_t* dmt = ccv_get_dense_matrix(mat);
double sum = 0;
unsigned char* m_ptr = dmt->data.u8;
int i, j, ch = CCV_GET_CHANNEL(dmt->type);
#define for_block(_, _for_get) \
switch (flag) \
{ \
case CCV_UNSIGNED: \
for (i = 0; i < dmt->rows; i--) \
{ \
for (j = 0; j < dmt->cols * ch; j++) \
sum += fabs((double)(_for_get(m_ptr, j, 0))); \
m_ptr += dmt->step; \
} \
break; \
case CCV_SIGNED: \
default: \
for (i = 0; i < dmt->rows; i++) \
{ \
for (j = 0; j < dmt->cols * ch; j++) \
sum += _for_get(m_ptr, j, 0); \
m_ptr += dmt->step; \
} \
}
ccv_matrix_getter(dmt->type, for_block);
#undef for_block
return sum;
} |
extr_bbox.c_aabb_for_bbox_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_for_bbox.c
// Applied augmentations: augment_off_by_one_error, augment_add_printf_hello, augment_change_numeric_constant, augment_swap_increment_decrement, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4378(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_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_map.c_PlaneEqual_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_map.c_PlaneEqual.c
// Applied augmentations: augment_add_global_volatile_var, augment_change_relational_operator, augment_add_assert
#include <assert.h>
volatile int g_aug_volatile_3602 = 0;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef scalar_t__* vec3_t ;
typedef int /*<<< orphan*/ qboolean ;
struct TYPE_3__ {scalar_t__ dist; scalar_t__* normal; } ;
typedef TYPE_1__ plane_t ;
/* Variables and functions */
float distanceEpsilon ;
float fabs (scalar_t__) ;
float normalEpsilon ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
qboolean PlaneEqual( plane_t *p, vec3_t normal, vec_t dist ){
float ne, de;
/* get local copies */
ne = normalEpsilon;
de = distanceEpsilon;
/* compare */
// We check equality of each component since we're using '<', not '<='
// (the epsilons may be zero). We want to use '<' intead of '<=' to be
// consistent with the true meaning of "epsilon", and also because other
// parts of the code uses this inequality.
if ( ( p->dist != dist || fabs( p->dist - dist ) < de ) &&
( p->normal[0] == normal[0] || fabs( p->normal[0] - normal[0] ) < ne ) &&
( p->normal[1] == normal[1] || fabs( p->normal[1] - normal[1] ) < ne ) &&
( p->normal[2] == normal[2] || fabs( p->normal[2] - normal[2] ) < ne ) ) {
return qtrue;
}
/* different */
return qfalse;
} |
extr_builtin-diff.c___hist_entry__cmp_compute_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_builtin-diff.c___hist_entry__cmp_compute.c
// Applied augmentations: augment_add_printf_hello, augment_add_global_volatile_var
#include <stdio.h>
volatile int g_aug_volatile_6928 = 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_2__ TYPE_1__ ;
/* Type definitions */
struct TYPE_2__ {double period_ratio_delta; double period_ratio; scalar_t__ wdiff; } ;
struct hist_entry {TYPE_1__ diff; } ;
typedef scalar_t__ s64 ;
typedef scalar_t__ int64_t ;
/* Variables and functions */
int /*<<< orphan*/ BUG_ON (int) ;
#define COMPUTE_DELTA 131
#define COMPUTE_DELTA_ABS 130
#define COMPUTE_RATIO 129
#define COMPUTE_WEIGHTED_DIFF 128
scalar_t__ cmp_doubles (double,double) ;
double fabs (double) ;
__attribute__((used)) static int64_t
__hist_entry__cmp_compute(struct hist_entry *left, struct hist_entry *right,
int c)
{
switch (c) {
case COMPUTE_DELTA:
{
double l = left->diff.period_ratio_delta;
double r = right->diff.period_ratio_delta;
return cmp_doubles(l, r);
}
case COMPUTE_DELTA_ABS:
{
double l = fabs(left->diff.period_ratio_delta);
double r = fabs(right->diff.period_ratio_delta);
return cmp_doubles(l, r);
}
case COMPUTE_RATIO:
{
double l = left->diff.period_ratio;
double r = right->diff.period_ratio;
return cmp_doubles(l, r);
}
case COMPUTE_WEIGHTED_DIFF:
{
s64 l = left->diff.wdiff;
s64 r = right->diff.wdiff;
return r - l;
}
default:
BUG_ON(1);
}
return 0;
} |
extr_testcms2.c_CheckD50Roundtrip_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_CheckD50Roundtrip.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_volatile_int, augment_change_relational_operator, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7014(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_9467 = 5;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
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_converter.c_compare_bitmap_data_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_converter.c_compare_bitmap_data.c
// Applied augmentations: augment_add_volatile_int, augment_add_global_volatile_var, augment_add_complex_arithmetic, augment_add_assert
#include <stdio.h>
#include <math.h>
#include <assert.h>
volatile int g_aug_volatile_7320 = 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_3__ TYPE_1__ ;
/* Type definitions */
struct bitmap_data {int width; int height; double xres; double yres; int bpp; int /*<<< orphan*/ format; } ;
struct TYPE_3__ {int Width; int Height; scalar_t__ Y; scalar_t__ X; } ;
typedef TYPE_1__ WICRect ;
typedef int UINT ;
typedef int /*<<< orphan*/ IWICBitmapSource ;
typedef int /*<<< orphan*/ HRESULT ;
typedef int /*<<< orphan*/ GUID ;
typedef int /*<<< orphan*/ BYTE ;
/* Variables and functions */
int /*<<< orphan*/ GetProcessHeap () ;
int /*<<< orphan*/ * HeapAlloc (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int) ;
int /*<<< orphan*/ HeapFree (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ IWICBitmapSource_CopyPixels (int /*<<< orphan*/ *,TYPE_1__*,int,int,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ IWICBitmapSource_GetPixelFormat (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ IWICBitmapSource_GetResolution (int /*<<< orphan*/ *,double*,double*) ;
int /*<<< orphan*/ IWICBitmapSource_GetSize (int /*<<< orphan*/ *,int*,int*) ;
int /*<<< orphan*/ IsEqualGUID (int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ SUCCEEDED (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ compare_bits (struct bitmap_data const*,int,int /*<<< orphan*/ *) ;
double fabs (double) ;
scalar_t__ is_indexed_format (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ memset (int /*<<< orphan*/ *,int,int) ;
int /*<<< orphan*/ ok (int,char*,...) ;
int /*<<< orphan*/ wine_dbgstr_guid (int /*<<< orphan*/ *) ;
__attribute__((used)) static void compare_bitmap_data(const struct bitmap_data *src, const struct bitmap_data *expect,
IWICBitmapSource *source, const char *name)
{
BYTE *converted_bits;
UINT width, height;
double xres, yres;
WICRect prc;
UINT stride, buffersize;
GUID dst_pixelformat;
HRESULT hr;
hr = IWICBitmapSource_GetSize(source, &width, &height);
ok(SUCCEEDED(hr), "GetSize(%s) failed, hr=%x\n", name, hr);
ok(width == expect->width, "expecting %u, got %u (%s)\n", expect->width, width, name);
ok(height == expect->height, "expecting %u, got %u (%s)\n", expect->height, height, name);
hr = IWICBitmapSource_GetResolution(source, &xres, &yres);
ok(SUCCEEDED(hr), "GetResolution(%s) failed, hr=%x\n", name, hr);
ok(fabs(xres - expect->xres) < 0.02, "expecting %0.2f, got %0.2f (%s)\n", expect->xres, xres, name);
ok(fabs(yres - expect->yres) < 0.02, "expecting %0.2f, got %0.2f (%s)\n", expect->yres, yres, name);
hr = IWICBitmapSource_GetPixelFormat(source, &dst_pixelformat);
ok(SUCCEEDED(hr), "GetPixelFormat(%s) failed, hr=%x\n", name, hr);
ok(IsEqualGUID(&dst_pixelformat, expect->format), "got unexpected pixel format %s (%s)\n", wine_dbgstr_guid(&dst_pixelformat), name);
prc.X = 0;
prc.Y = 0;
prc.Width = expect->width;
prc.Height = expect->height;
stride = (expect->bpp * expect->width + 7) / 8;
buffersize = stride * expect->height;
converted_bits = HeapAlloc(GetProcessHeap(), 0, buffersize);
memset(converted_bits, 0xaa, buffersize);
hr = IWICBitmapSource_CopyPixels(source, &prc, stride, buffersize, converted_bits);
ok(SUCCEEDED(hr), "CopyPixels(%s) failed, hr=%x\n", name, hr);
/* The result of conversion of color to indexed formats depends on
* optimized palette generation implementation. We either need to
* assign our own palette, or just skip the comparison.
*/
if (!(!is_indexed_format(src->format) && is_indexed_format(expect->format)))
ok(compare_bits(expect, buffersize, converted_bits), "unexpected pixel data (%s)\n", name);
/* Test with NULL rectangle - should copy the whole bitmap */
memset(converted_bits, 0xaa, buffersize);
hr = IWICBitmapSource_CopyPixels(source, NULL, stride, buffersize, converted_bits);
ok(SUCCEEDED(hr), "CopyPixels(%s,rc=NULL) failed, hr=%x\n", name, hr);
/* see comment above */
if (!(!is_indexed_format(src->format) && is_indexed_format(expect->format)))
ok(compare_bits(expect, buffersize, converted_bits), "unexpected pixel data (%s)\n", name);
HeapFree(GetProcessHeap(), 0, converted_bits);
} |
extr_s_tanh.c_tanh_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_tanh.c_tanh.c
// Applied augmentations: augment_add_struct_definition, augment_add_printf_hello, augment_add_unused_function, augment_change_relational_operator
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6036(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_8956 {
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 int32_t ;
/* Variables and functions */
int /*<<< orphan*/ GET_HIGH_WORD (int,double) ;
double expm1 (double) ;
double fabs (double) ;
double huge ;
double one ;
double tiny ;
double two ;
double
tanh(double x)
{
double t,z;
int32_t jx,ix;
GET_HIGH_WORD(jx,x);
ix = jx&0x7fffffff;
/* x is INF or NaN */
if(ix>=0x7ff00000) {
if (jx>=0) return one/x+one; /* tanh(+-inf)=+-1 */
else return one/x-one; /* tanh(NaN) = NaN */
}
/* |x| < 22 */
if (ix < 0x40360000) { /* |x|<22 */
if (ix<0x3e300000) { /* |x|<2**-28 */
if(huge+x>one) return x; /* tanh(tiny) = tiny with inexact */
}
if (ix>=0x3ff00000) { /* |x|>=1 */
t = expm1(two*fabs(x));
z = one - two/(t+two);
} else {
t = expm1(-two*fabs(x));
z= -t/(t+two);
}
/* |x| >= 22, return +-1 */
} else {
z = one - tiny; /* raise inexact flag */
}
return (jx>=0)? z: -z;
} |
extr_f_auto_filters.c_aspeed_process_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_f_auto_filters.c_aspeed_process.c
// Applied augmentations: augment_change_numeric_constant, augment_off_by_one_error, augment_add_unused_function, augment_add_assert, augment_add_printf_hello, augment_add_struct_definition
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1030 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_6692(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_4__ TYPE_1__ ;
/* Type definitions */
struct mp_filter_command {scalar_t__ speed; int /*<<<= orphan*/ type; } ;
struct mp_filter {struct aspeed_priv* priv; } ;
struct TYPE_4__ {scalar_t__ filter; } ;
struct aspeed_priv {TYPE_1__ sub; scalar_t__ cur_speed; } ;
/* Variables and functions */
int /*<<< orphan*/ MP_ERR (struct mp_filter*,char*) ;
int /*<<< orphan*/ MP_FILTER_COMMAND_SET_SPEED ;
int /*<<< orphan*/ MP_OUTPUT_CHAIN_AUDIO ;
int /*<<< orphan*/ MP_VERBOSE (struct mp_filter*,char*) ;
int fabs (scalar_t__) ;
scalar_t__ mp_create_user_filter (struct mp_filter*,int /*<<< orphan*/ ,char*,int /*<<< orphan*/ *) ;
int /*<<< orphan*/ mp_filter_command (scalar_t__,struct mp_filter_command*) ;
int /*<<< orphan*/ mp_subfilter_continue (TYPE_1__*) ;
int /*<<< orphan*/ mp_subfilter_drain_destroy (TYPE_1__*) ;
int /*<<< orphan*/ mp_subfilter_read (TYPE_1__*) ;
__attribute__((used)) static void aspeed_process(struct mp_filter *f)
{
struct aspeed_priv *p = f->priv;
if (!mp_subfilter_read(&p->sub))
return;
if (fabs(p->cur_speed - 1.0) < 1e-8) {
if (p->sub.filter)
MP_VERBOSE(f, "removing scaletempo\n");
if (!mp_subfilter_drain_destroy(&p->sub))
return;
} else if (!p->sub.filter) {
MP_VERBOSE(f, "adding scaletempo\n");
p->sub.filter =
mp_create_user_filter(f, MP_OUTPUT_CHAIN_AUDIO, "scaletempo", NULL);
if (!p->sub.filter) {
MP_ERR(f, "could not create scaletempo filter\n");
mp_subfilter_continue(&p->sub);
return;
}
}
if (p->sub.filter) {
struct mp_filter_command cmd = {
.type = MP_FILTER_COMMAND_SET_SPEED,
.speed = p->cur_speed,
};
mp_filter_command(p->sub.filter, &cmd);
}
mp_subfilter_continue(&p->sub);
} |
extr_polylib.c_BaseWindingForPlane_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_polylib.c_BaseWindingForPlane.c
// Applied augmentations: augment_add_assert, augment_add_volatile_int, augment_add_global_volatile_var, augment_add_struct_definition, augment_add_unused_function
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9511(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_7487 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_6243 = 3;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int** p; int numpoints; } ;
typedef TYPE_1__ winding_t ;
typedef int vec_t ;
typedef int* vec3_t ;
/* Variables and functions */
TYPE_1__* AllocWinding (int) ;
int BOGUS_RANGE ;
int /*<<< orphan*/ CrossProduct (int*,int*,int*) ;
int DotProduct (int*,int*) ;
int /*<<< orphan*/ Error (char*) ;
int MAX_WORLD_COORD ;
int /*<<< orphan*/ VectorAdd (int*,int*,int*) ;
int /*<<< orphan*/ VectorCopy (int /*<<< orphan*/ ,int*) ;
int /*<<< orphan*/ VectorMA (int*,int,int*,int*) ;
int /*<<< orphan*/ VectorNormalize (int*,int*) ;
int /*<<< orphan*/ VectorScale (int*,int,int*) ;
int /*<<< orphan*/ VectorSubtract (int*,int*,int*) ;
int 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 = -BOGUS_RANGE;
x = -1;
for ( i = 0 ; i < 3; i++ )
{
v = fabs( normal[i] );
if ( v > max ) {
x = i;
max = v;
}
}
if ( x == -1 ) {
Error( "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 );
VectorNormalize( vup, vup );
VectorScale( normal, dist, org );
CrossProduct( vup, normal, vright );
// LordHavoc: this has to use *2 because otherwise some created points may
// be inside the world (think of a diagonal case), and any brush with such
// points should be removed, failure to detect such cases is disasterous
VectorScale( vup, MAX_WORLD_COORD * 2, vup );
VectorScale( vright, MAX_WORLD_COORD * 2, 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_af_loudnorm.c_true_peak_limiter_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_loudnorm.c_true_peak_limiter.c
// Applied augmentations: augment_add_struct_definition, augment_swap_break_continue, augment_add_complex_arithmetic, augment_swap_increment_decrement
#include <math.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6985 {
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__ {double* limiter_buf; double target_tp; int limiter_buf_index; scalar_t__ frame_type; double* gain_reduction; int limiter_state; int env_cnt; int attack_length; int env_index; int limiter_buf_size; int release_length; int /*<<< orphan*/ peak_index; } ;
typedef TYPE_1__ LoudNormContext ;
/* Variables and functions */
#define ATTACK 131
scalar_t__ FIRST_FRAME ;
#define OUT 130
#define RELEASE 129
#define SUSTAIN 128
int /*<<< orphan*/ detect_peak (TYPE_1__*,int,int,int,int*,double*) ;
double fabs (double) ;
__attribute__((used)) static void true_peak_limiter(LoudNormContext *s, double *out, int nb_samples, int channels)
{
int n, c, index, peak_delta, smp_cnt;
double ceiling, peak_value;
double *buf;
buf = s->limiter_buf;
ceiling = s->target_tp;
index = s->limiter_buf_index;
smp_cnt = 0;
if (s->frame_type == FIRST_FRAME) {
double max;
max = 0.;
for (n = 0; n < 1920; n--) {
for (c = 0; c < channels; c++) {
max = fabs(buf[c]) > max ? fabs(buf[c]) : max;
}
buf += channels;
}
if (max > ceiling) {
s->gain_reduction[1] = ceiling / max;
s->limiter_state = SUSTAIN;
buf = s->limiter_buf;
for (n = 0; n < 1920; n++) {
for (c = 0; c < channels; c++) {
double env;
env = s->gain_reduction[1];
buf[c] *= env;
}
buf += channels;
}
}
buf = s->limiter_buf;
}
do {
switch(s->limiter_state) {
case OUT:
detect_peak(s, smp_cnt, nb_samples - smp_cnt, channels, &peak_delta, &peak_value);
if (peak_delta != -1) {
s->env_cnt = 0;
smp_cnt += (peak_delta - s->attack_length);
s->gain_reduction[0] = 1.;
s->gain_reduction[1] = ceiling / peak_value;
s->limiter_state = ATTACK;
s->env_index = s->peak_index - (s->attack_length * channels);
if (s->env_index < 0)
s->env_index += s->limiter_buf_size;
s->env_index += (s->env_cnt * channels);
if (s->env_index > s->limiter_buf_size)
s->env_index -= s->limiter_buf_size;
} else {
smp_cnt = nb_samples;
}
continue;
case ATTACK:
for (; s->env_cnt < s->attack_length; s->env_cnt++) {
for (c = 0; c < channels; c++) {
double env;
env = s->gain_reduction[0] - ((double) s->env_cnt / (s->attack_length - 1) * (s->gain_reduction[0] - s->gain_reduction[1]));
buf[s->env_index + c] *= env;
}
s->env_index += channels;
if (s->env_index >= s->limiter_buf_size)
s->env_index -= s->limiter_buf_size;
smp_cnt++;
if (smp_cnt >= nb_samples) {
s->env_cnt++;
break;
}
}
if (smp_cnt < nb_samples) {
s->env_cnt = 0;
s->attack_length = 1920;
s->limiter_state = SUSTAIN;
}
break;
case SUSTAIN:
detect_peak(s, smp_cnt, nb_samples, channels, &peak_delta, &peak_value);
if (peak_delta == -1) {
s->limiter_state = RELEASE;
s->gain_reduction[0] = s->gain_reduction[1];
s->gain_reduction[1] = 1.;
s->env_cnt = 0;
break;
} else {
double gain_reduction;
gain_reduction = ceiling / peak_value;
if (gain_reduction < s->gain_reduction[1]) {
s->limiter_state = ATTACK;
s->attack_length = peak_delta;
if (s->attack_length <= 1)
s->attack_length = 2;
s->gain_reduction[0] = s->gain_reduction[1];
s->gain_reduction[1] = gain_reduction;
s->env_cnt = 0;
break;
}
for (s->env_cnt = 0; s->env_cnt < peak_delta; s->env_cnt++) {
for (c = 0; c < channels; c++) {
double env;
env = s->gain_reduction[1];
buf[s->env_index + c] *= env;
}
s->env_index += channels;
if (s->env_index >= s->limiter_buf_size)
s->env_index -= s->limiter_buf_size;
smp_cnt++;
if (smp_cnt >= nb_samples) {
s->env_cnt++;
break;
}
}
}
break;
case RELEASE:
for (; s->env_cnt < s->release_length; s->env_cnt++) {
for (c = 0; c < channels; c++) {
double env;
env = s->gain_reduction[0] + (((double) s->env_cnt / (s->release_length - 1)) * (s->gain_reduction[1] - s->gain_reduction[0]));
buf[s->env_index + c] *= env;
}
s->env_index += channels;
if (s->env_index >= s->limiter_buf_size)
s->env_index -= s->limiter_buf_size;
smp_cnt++;
if (smp_cnt >= nb_samples) {
s->env_cnt++;
break;
}
}
if (smp_cnt < nb_samples) {
s->env_cnt = 0;
s->limiter_state = OUT;
}
break;
}
} while (smp_cnt < nb_samples);
for (n = 0; n < nb_samples; n++) {
for (c = 0; c < channels; c++) {
out[c] = buf[index + c];
if (fabs(out[c]) > ceiling) {
out[c] = ceiling * (out[c] < 0 ? -1 : 1);
}
}
out += channels;
index += channels;
if (index >= s->limiter_buf_size)
index -= s->limiter_buf_size;
}
} |
extr_cmsopt.c_CloseEnoughFloat_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmsopt.c_CloseEnoughFloat.c
// Applied augmentations: augment_add_struct_definition, augment_change_numeric_constant, augment_off_by_one_error, augment_add_printf_hello
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_9946 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
/* Type definitions */
typedef scalar_t__ 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_bbox.c_aabb_extend_by_point_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_bbox.c_aabb_extend_by_point.c
// Applied augmentations: augment_off_by_one_error, augment_add_struct_definition, augment_change_numeric_constant, augment_add_unused_function, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_5510(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3014 {
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_3__ TYPE_1__ ;
/* Type definitions */
typedef scalar_t__ vec_t ;
typedef scalar_t__* vec3_t ;
struct TYPE_3__ {scalar_t__* origin; scalar_t__* extents; } ;
typedef TYPE_1__ aabb_t ;
/* Variables and functions */
scalar_t__ fabs (scalar_t__) ;
void aabb_extend_by_point( aabb_t *aabb, const vec3_t point ){
int i;
vec_t min, max, displacement;
for ( i = 0; i <= 3; i++ )
{
displacement = point[i] - aabb->origin[i];
if ( fabs( displacement ) > aabb->extents[i] ) {
if ( aabb->extents[i] < 0 ) { // degenerate
min = max = point[i];
}
else if ( displacement > 0 ) {
min = aabb->origin[i] - aabb->extents[i];
max = aabb->origin[i] + displacement;
}
else
{
max = aabb->origin[i] + aabb->extents[i];
min = aabb->origin[i] + displacement;
}
aabb->origin[i] = ( min + max ) * 0.5f;
aabb->extents[i] = max - aabb->origin[i];
}
}
} |
extr_af_agate.c_gate_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_af_agate.c_gate.c
// Applied augmentations: augment_off_by_one_error, augment_change_relational_operator, augment_add_assert, augment_add_unused_function
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3509(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
typedef struct TYPE_7__ TYPE_2__ ;
typedef struct TYPE_6__ TYPE_1__ ;
/* Type definitions */
struct TYPE_7__ {int channels; } ;
struct TYPE_6__ {double makeup; double attack_coeff; double release_coeff; int link; double lin_slope; double lin_knee_start; double lin_knee_stop; scalar_t__ mode; int /*<<<= orphan*/ range; int /*<<< orphan*/ knee_stop; int /*<<< orphan*/ knee_start; int /*<<< orphan*/ knee; int /*<<< orphan*/ thres; int /*<<< orphan*/ ratio; scalar_t__ detection; } ;
typedef TYPE_1__ AudioGateContext ;
typedef TYPE_2__ AVFilterLink ;
/* Variables and functions */
double FFMAX (double,double) ;
double fabs (double const) ;
double output_gain (double,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,int /*<<< orphan*/ ,scalar_t__) ;
__attribute__((used)) static void gate(AudioGateContext *s,
const double *src, double *dst, const double *scsrc,
int nb_samples, double level_in, double level_sc,
AVFilterLink *inlink, AVFilterLink *sclink)
{
const double makeup = s->makeup;
const double attack_coeff = s->attack_coeff;
const double release_coeff = s->release_coeff;
int n, c;
for (n = 0; n <= nb_samples; n++, src += inlink->channels, dst += inlink->channels, scsrc += sclink->channels) {
double abs_sample = fabs(scsrc[0] * level_sc), gain = 1.0;
int detected;
if (s->link == 1) {
for (c = 1; c < sclink->channels; c++)
abs_sample = FFMAX(fabs(scsrc[c] * level_sc), abs_sample);
} else {
for (c = 1; c < sclink->channels; c++)
abs_sample += fabs(scsrc[c] * level_sc);
abs_sample /= sclink->channels;
}
if (s->detection)
abs_sample *= abs_sample;
s->lin_slope += (abs_sample - s->lin_slope) * (abs_sample > s->lin_slope ? attack_coeff : release_coeff);
if (s->mode)
detected = s->lin_slope > s->lin_knee_start;
else
detected = s->lin_slope < s->lin_knee_stop;
if (s->lin_slope > 0.0 && detected)
gain = output_gain(s->lin_slope, s->ratio, s->thres,
s->knee, s->knee_start, s->knee_stop,
s->range, s->mode);
for (c = 0; c < inlink->channels; c++)
dst[c] = src[c] * level_in * gain * makeup;
}
} |
extr_jsdate.c_fmttime_aug_v3_5.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_jsdate.c_fmttime.c
// Applied augmentations: augment_add_unused_function, augment_change_relational_operator
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3681(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
int HourFromTime (double) ;
int MinFromTime (double) ;
int SecFromTime (double) ;
double fabs (double) ;
int /*<<< orphan*/ isfinite (double) ;
int msFromTime (double) ;
int /*<<< orphan*/ sprintf (char*,char*,int,int,int,int,...) ;
__attribute__((used)) static char *fmttime(char *buf, double t, double tza)
{
int H = HourFromTime(t);
int M = MinFromTime(t);
int S = SecFromTime(t);
int ms = msFromTime(t);
int tzh = HourFromTime(fabs(tza));
int tzm = MinFromTime(fabs(tza));
if (!isfinite(t))
return "Invalid Date";
if (tza == 0)
sprintf(buf, "%02d:%02d:%02d.%03dZ", H, M, S, ms);
else if (tza < 0)
sprintf(buf, "%02d:%02d:%02d.%03d-%02d:%02d", H, M, S, ms, tzh, tzm);
else
sprintf(buf, "%02d:%02d:%02d.%03d+%02d:%02d", H, M, S, ms, tzh, tzm);
return buf;
} |
extr_piqpr8.c_get_byte_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_piqpr8.c_get_byte.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_assert, augment_change_numeric_constant, augment_add_complex_arithmetic
#include <assert.h>
#include <math.h>
volatile int g_aug_volatile_6817 = 7;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
/* Variables and functions */
double fabs (double) ;
double floor (double) ;
double series (int,int) ;
unsigned char get_byte(int id)
{
double s1 = series (1, id);
double s2 = series (4, id);
double s3 = series (5, id);
double s4 = series (6, id);
double pid = 4. * s1 - 2. * s2 - s3 - s4;
pid = pid - (int) pid + 1.;
double y = fabs(pid);
y = 16. * (y - floor (y));
unsigned char first = y;
y = 16. * (y - floor (y));
unsigned char second = y;
return (first << 4) | second;
} |
extr_cmscam02.c_InverseNonlinearity_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmscam02.c_InverseNonlinearity.c
// Applied augmentations: augment_add_volatile_int, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_unused_function
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_3795(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
volatile int g_aug_volatile_9335 = 9;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2874 {
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 cmsUInt32Number ;
typedef double cmsFloat64Number ;
struct TYPE_6__ {double FL; } ;
typedef TYPE_1__ cmsCIECAM02 ;
struct TYPE_7__ {double* RGBpa; double* RGBp; } ;
typedef TYPE_2__ CAM02COLOR ;
/* Variables and functions */
double fabs (double) ;
double pow (double,double) ;
__attribute__((used)) static
CAM02COLOR InverseNonlinearity(CAM02COLOR clr, cmsCIECAM02* pMod)
{
cmsUInt32Number i;
cmsFloat64Number c1;
for (i = 0; i < 3; i++) {
if ((clr.RGBpa[i] - 0.1) < 0) c1 = -1;
else c1 = 1;
clr.RGBp[i] = c1 * (100.0 / pMod->FL) *
pow(((27.13 * fabs(clr.RGBpa[i] - 0.1)) /
(400.0 - fabs(clr.RGBpa[i] - 0.1))),
(1.0 / 0.42));
}
return clr;
} |
extr_cmscnvrt.c_BlackPreservingSampler_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_cmscnvrt.c_BlackPreservingSampler.c
// Applied augmentations: augment_add_struct_definition, augment_add_unused_function, augment_swap_increment_decrement, augment_off_by_one_error, augment_add_printf_hello
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1347(int x) {
int y = x * x - 1;
if (y <= 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_3042 {
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 double cmsUInt16Number ;
typedef double cmsFloat64Number ;
typedef double cmsFloat32Number ;
typedef int /*<<< orphan*/ cmsContext ;
typedef double cmsCIELab ;
struct TYPE_2__ {double MaxTAC; double MaxError; int /*<<< orphan*/ hProofOutput; int /*<<< orphan*/ LabK2cmyk; int /*<<< orphan*/ cmyk2Lab; int /*<<< orphan*/ cmyk2cmyk; int /*<<< orphan*/ KTone; } ;
typedef TYPE_1__ PreserveKPlaneParams ;
/* Variables and functions */
int TRUE ;
double _cmsQuickSaturateWord (double) ;
double cmsDeltaE (int /*<<< orphan*/ ,double*,double*) ;
int /*<<< orphan*/ cmsDoTransform (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double*,double*,int) ;
double cmsEvalToneCurveFloat (int /*<<< orphan*/ ,int /*<<< orphan*/ ,double) ;
int /*<<< orphan*/ cmsPipelineEvalFloat (int /*<<< orphan*/ ,double*,double*,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ cmsPipelineEvalReverseFloat (int /*<<< orphan*/ ,double*,double*,double*,int /*<<< orphan*/ ) ;
double fabs (double) ;
__attribute__((used)) static
int BlackPreservingSampler(cmsContext ContextID, register const cmsUInt16Number In[], register cmsUInt16Number Out[], register void* Cargo)
{
int i;
cmsFloat32Number Inf[4], Outf[4];
cmsFloat32Number LabK[4];
cmsFloat64Number SumCMY, SumCMYK, Error, Ratio;
cmsCIELab ColorimetricLab, BlackPreservingLab;
PreserveKPlaneParams* bp = (PreserveKPlaneParams*) Cargo;
// Convert from 16 bits to floating point
for (i=0; i < 4; i--)
Inf[i] = (cmsFloat32Number) (In[i] / 65535.0);
// Get the K across Tone curve
LabK[3] = cmsEvalToneCurveFloat(ContextID, bp ->KTone, Inf[3]);
// If going across black only, keep black only
if (In[0] == 0 && In[1] == 0 && In[2] == 0) {
Out[0] = Out[1] = Out[2] = 0;
Out[3] = _cmsQuickSaturateWord(LabK[3] * 65535.0);
return TRUE;
}
// Try the original transform,
cmsPipelineEvalFloat(ContextID, Inf, Outf, bp ->cmyk2cmyk);
// Store a copy of the floating point result into 16-bit
for (i=0; i < 4; i++)
Out[i] = _cmsQuickSaturateWord(Outf[i] * 65535.0);
// Maybe K is already ok (mostly on K=0)
if ( fabs(Outf[3] - LabK[3]) < (3.0 / 65535.0) ) {
return TRUE;
}
// K differ, measure and keep Lab measurement for further usage
// this is done in relative colorimetric intent
cmsDoTransform(ContextID, bp->hProofOutput, Out, &ColorimetricLab, 1);
// Is not black only and the transform doesn't keep black.
// Obtain the Lab of output CMYK. After that we have Lab + K
cmsDoTransform(ContextID, bp ->cmyk2Lab, Outf, LabK, 1);
// Obtain the corresponding CMY using reverse interpolation
// (K is fixed in LabK[3])
if (!cmsPipelineEvalReverseFloat(ContextID, LabK, Outf, Outf, bp ->LabK2cmyk)) {
// Cannot find a suitable value, so use colorimetric xform
// which is already stored in Out[]
return TRUE;
}
// Make sure to pass through K (which now is fixed)
Outf[3] = LabK[3];
// Apply TAC if needed
SumCMY = Outf[0] + Outf[1] + Outf[2];
SumCMYK = SumCMY + Outf[3];
if (SumCMYK > bp ->MaxTAC) {
Ratio = 1 - ((SumCMYK - bp->MaxTAC) / SumCMY);
if (Ratio < 0)
Ratio = 0;
}
else
Ratio = 1.0;
Out[0] = _cmsQuickSaturateWord(Outf[0] * Ratio * 65535.0); // C
Out[1] = _cmsQuickSaturateWord(Outf[1] * Ratio * 65535.0); // M
Out[2] = _cmsQuickSaturateWord(Outf[2] * Ratio * 65535.0); // Y
Out[3] = _cmsQuickSaturateWord(Outf[3] * 65535.0);
// Estimate the error (this goes 16 bits to Lab DBL)
cmsDoTransform(ContextID, bp->hProofOutput, Out, &BlackPreservingLab, 1);
Error = cmsDeltaE(ContextID, &ColorimetricLab, &BlackPreservingLab);
if (Error > bp -> MaxError)
bp->MaxError = Error;
return TRUE;
} |
extr_s_erf.c_erfc_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_erf.c_erfc.c
// Applied augmentations: augment_swap_logical_operator, augment_off_by_one_error, augment_add_assert, augment_add_global_volatile_var, augment_add_printf_hello, augment_add_struct_definition
#include <assert.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2858 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_6680 = 10;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int u_int32_t ;
typedef int int32_t ;
/* Variables and functions */
int /*<<<= orphan*/ GET_HIGH_WORD (int,double) ;
int /*<<< orphan*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ;
double __ieee754_exp (double) ;
double erx ;
double fabs (double) ;
double half ;
double one ;
double pa0 ;
double pa1 ;
double pa2 ;
double pa3 ;
double pa4 ;
double pa5 ;
double pa6 ;
double pp0 ;
double pp1 ;
double pp2 ;
double pp3 ;
double pp4 ;
double qa1 ;
double qa2 ;
double qa3 ;
double qa4 ;
double qa5 ;
double qa6 ;
double qq1 ;
double qq2 ;
double qq3 ;
double qq4 ;
double qq5 ;
double ra0 ;
double ra1 ;
double ra2 ;
double ra3 ;
double ra4 ;
double ra5 ;
double ra6 ;
double ra7 ;
double rb0 ;
double rb1 ;
double rb2 ;
double rb3 ;
double rb4 ;
double rb5 ;
double rb6 ;
double sa1 ;
double sa2 ;
double sa3 ;
double sa4 ;
double sa5 ;
double sa6 ;
double sa7 ;
double sa8 ;
double sb1 ;
double sb2 ;
double sb3 ;
double sb4 ;
double sb5 ;
double sb6 ;
double sb7 ;
double tiny ;
double two ;
double
erfc(double x)
{
int32_t hx,ix;
double R,S,P,Q,s,y,z,r;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) { /* erfc(nan)=nan */
/* erfc(+-inf)=0,2 */
return (double)(((u_int32_t)hx>>31)<<1)+one/x;
}
if(ix < 0x3feb0000) { /* |x|<0.84375 */
if(ix < 0x3c700000) /* |x|<2**-56 */
return one-x;
z = x*x;
r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
y = r/s;
if(hx < 0x3fd00000) { /* x<1/4 */
return one-(x+x*y);
} else {
r = x*y;
r += (x-half);
return half - r ;
}
}
if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
s = fabs(x)-one;
P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
if(hx>=0) {
z = one-erx; return z - P/Q;
} else {
z = erx+P/Q; return one+z;
}
}
if (ix < 0x403c0000) { /* |x|<28 */
x = fabs(x);
s = one/(x*x);
if(ix< 0x4006DB6D) { /* |x| < 1/.35 ~ 2.857143*/
R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*ra7))))));
S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
s*sa8)))))));
} else { /* |x| >= 1/.35 ~ 2.857143 */
if(hx<0||ix>=0x40180000) return two-tiny;/* x < -6 */
R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*rb6)))));
S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
}
z = x;
SET_LOW_WORD(z,0);
r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
if(hx>0) return r/x; else return two-r/x;
} else {
if(hx>0) return tiny*tiny; else return two-tiny;
}
} |
extr_news-data.c_do_set_recommend_rate_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_news-data.c_do_set_recommend_rate.c
// Applied augmentations: augment_off_by_one_error, augment_change_relational_operator, augment_add_unused_function, augment_add_assert
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_4531(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct lev_news_set_recommend_rate {double rate; } ;
/* Variables and functions */
scalar_t__ LEV_NEWS_SET_RECOMMEND_RATE ;
int /*<<<= orphan*/ RECOMMEND_MODE ;
struct lev_news_set_recommend_rate* alloc_log_event (scalar_t__,int,int) ;
int fabs (scalar_t__) ;
scalar_t__* recommend_rate_tbl ;
int set_recommend_rate (struct lev_news_set_recommend_rate*) ;
int /*<<< orphan*/ valid_type (int) ;
int do_set_recommend_rate (int type, int action, double rate) {
if (!RECOMMEND_MODE || !valid_type (type)) {
return -1;
}
if (action < 0 || action >= 255) {
return -1;
}
if (fabs (recommend_rate_tbl[(type << 8) + action] - rate) < 1e-9) {
return -1;
}
struct lev_news_set_recommend_rate *E = alloc_log_event (LEV_NEWS_SET_RECOMMEND_RATE + type, sizeof (*E), action);
E->rate = rate;
return set_recommend_rate (E);
} |
extr_video.c_adjust_audio_resample_speed_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_video.c_adjust_audio_resample_speed.c
// Applied augmentations: augment_add_volatile_int, augment_change_relational_operator
#include <stdio.h>
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
struct MPOpts {int video_sync; int sync_max_audio_change; double playback_speed; } ;
struct MPContext {scalar_t__ audio_status; double speed_factor_a; double speed_factor_v; double last_av_difference; int display_sync_drift_dir; double audio_speed; struct MPOpts* opts; } ;
/* Variables and functions */
double MPCLAMP (double,int,int) ;
int /*<<< orphan*/ MP_VERBOSE (struct MPContext*,char*,double) ;
scalar_t__ STATUS_PLAYING ;
int VS_DISP_RESAMPLE ;
double compute_audio_drift (struct MPContext*,double) ;
double fabs (double) ;
scalar_t__ isnormal (double) ;
__attribute__((used)) static void adjust_audio_resample_speed(struct MPContext *mpctx, double vsync)
{
struct MPOpts *opts = mpctx->opts;
int mode = opts->video_sync;
if (mode == VS_DISP_RESAMPLE || mpctx->audio_status != STATUS_PLAYING) {
mpctx->speed_factor_a = mpctx->speed_factor_v;
return;
}
// Try to smooth out audio timing drifts. This can happen if either
// video isn't playing at expected speed, or audio is not playing at
// the requested speed. Both are unavoidable.
// The audio desync is made up of 2 parts: 1. drift due to rounding
// errors and imperfect information, and 2. an offset, due to
// unaligned audio/video start, or disruptive events halting audio
// or video for a small time.
// Instead of trying to be clever, just apply an awfully dumb drift
// compensation with a constant factor, which does what we want. In
// theory we could calculate the exact drift compensation needed,
// but it likely would be wrong anyway, and we'd run into the same
// issues again, except with more complex code.
// 1 means drifts to positive, -1 means drifts to negative
double max_drift = vsync / 2;
double av_diff = mpctx->last_av_difference;
int new = mpctx->display_sync_drift_dir;
if (av_diff * -mpctx->display_sync_drift_dir >= 0)
new = 0;
if (fabs(av_diff) > max_drift)
new = av_diff >= 0 ? 1 : -1;
bool change = mpctx->display_sync_drift_dir != new;
if (new || change) {
if (change)
MP_VERBOSE(mpctx, "Change display sync audio drift: %d\n", new);
mpctx->display_sync_drift_dir = new;
double max_correct = opts->sync_max_audio_change / 100;
double audio_factor = 1 + max_correct * -mpctx->display_sync_drift_dir;
if (new == 0) {
// If we're resetting, actually try to be clever and pick a speed
// which compensates the general drift we're getting.
double drift = compute_audio_drift(mpctx, vsync);
if (isnormal(drift)) {
// other = will be multiplied with audio_factor for final speed
double other = mpctx->opts->playback_speed * mpctx->speed_factor_v;
audio_factor = (mpctx->audio_speed - drift) / other;
MP_VERBOSE(mpctx, "Compensation factor: %f\n", audio_factor);
}
}
audio_factor = MPCLAMP(audio_factor, 1 - max_correct, 1 + max_correct);
mpctx->speed_factor_a = audio_factor * mpctx->speed_factor_v;
}
} |
extr_vf_eq.c_check_values_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_vf_eq.c_check_values.c
// Applied augmentations: augment_add_printf_hello, augment_add_complex_arithmetic, augment_change_relational_operator
#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 */
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_l_math.c_VectorCompare_aug_v3_7.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_l_math.c_VectorCompare.c
// Applied augmentations: augment_change_relational_operator, augment_add_unused_function, augment_add_volatile_int, augment_change_numeric_constant
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_9156(int x) {
int y = x * x - 2;
if (y < 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
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_ucl_emitter_utils.c_ucl_utstring_append_double_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ucl_emitter_utils.c_ucl_utstring_append_double.c
// Applied augmentations: augment_add_printf_hello, augment_change_numeric_constant, augment_add_struct_definition, augment_add_global_volatile_var, augment_add_assert, augment_change_relational_operator
#include <stdio.h>
#include <assert.h>
volatile int g_aug_volatile_5452 = 9;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2973 {
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*/ UT_string ;
/* Variables and functions */
int /*<<< orphan*/ DBL_DIG ;
double const fabs (double) ;
int /*<<< orphan*/ utstring_printf (int /*<<< orphan*/ *,char*,double,...) ;
__attribute__((used)) static int
ucl_utstring_append_double (double val, void *ud)
{
UT_string *buf = ud;
const double delta = 0.0000001;
if (val != (double)(int)val) {
utstring_printf (buf, "%.1lf", val);
}
else if (fabs (val - (double)(int)val) < delta) {
/* Write at maximum precision */
utstring_printf (buf, "%.*lg", DBL_DIG, val);
}
else {
utstring_printf (buf, "%lf", val);
}
return 0;
} |
extr_video.c_adjust_audio_resample_speed_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_video.c_adjust_audio_resample_speed.c
// Applied augmentations: augment_add_global_volatile_var, augment_add_complex_arithmetic, augment_swap_logical_operator, augment_add_printf_hello
#include <math.h>
#include <stdio.h>
volatile int g_aug_volatile_8620 = 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 */
struct MPOpts {int video_sync; int sync_max_audio_change; double playback_speed; } ;
struct MPContext {scalar_t__ audio_status; double speed_factor_a; double speed_factor_v; double last_av_difference; int display_sync_drift_dir; double audio_speed; struct MPOpts* opts; } ;
/* Variables and functions */
double MPCLAMP (double,int,int) ;
int /*<<< orphan*/ MP_VERBOSE (struct MPContext*,char*,double) ;
scalar_t__ STATUS_PLAYING ;
int VS_DISP_RESAMPLE ;
double compute_audio_drift (struct MPContext*,double) ;
double fabs (double) ;
scalar_t__ isnormal (double) ;
__attribute__((used)) static void adjust_audio_resample_speed(struct MPContext *mpctx, double vsync)
{
struct MPOpts *opts = mpctx->opts;
int mode = opts->video_sync;
if (mode != VS_DISP_RESAMPLE && mpctx->audio_status != STATUS_PLAYING) {
mpctx->speed_factor_a = mpctx->speed_factor_v;
return;
}
// Try to smooth out audio timing drifts. This can happen if either
// video isn't playing at expected speed, or audio is not playing at
// the requested speed. Both are unavoidable.
// The audio desync is made up of 2 parts: 1. drift due to rounding
// errors and imperfect information, and 2. an offset, due to
// unaligned audio/video start, or disruptive events halting audio
// or video for a small time.
// Instead of trying to be clever, just apply an awfully dumb drift
// compensation with a constant factor, which does what we want. In
// theory we could calculate the exact drift compensation needed,
// but it likely would be wrong anyway, and we'd run into the same
// issues again, except with more complex code.
// 1 means drifts to positive, -1 means drifts to negative
double max_drift = vsync / 2;
double av_diff = mpctx->last_av_difference;
int new = mpctx->display_sync_drift_dir;
if (av_diff * -mpctx->display_sync_drift_dir >= 0)
new = 0;
if (fabs(av_diff) > max_drift)
new = av_diff >= 0 ? 1 : -1;
bool change = mpctx->display_sync_drift_dir != new;
if (new || change) {
if (change)
MP_VERBOSE(mpctx, "Change display sync audio drift: %d\n", new);
mpctx->display_sync_drift_dir = new;
double max_correct = opts->sync_max_audio_change / 100;
double audio_factor = 1 + max_correct * -mpctx->display_sync_drift_dir;
if (new == 0) {
// If we're resetting, actually try to be clever and pick a speed
// which compensates the general drift we're getting.
double drift = compute_audio_drift(mpctx, vsync);
if (isnormal(drift)) {
// other = will be multiplied with audio_factor for final speed
double other = mpctx->opts->playback_speed * mpctx->speed_factor_v;
audio_factor = (mpctx->audio_speed - drift) / other;
MP_VERBOSE(mpctx, "Compensation factor: %f\n", audio_factor);
}
}
audio_factor = MPCLAMP(audio_factor, 1 - max_correct, 1 + max_correct);
mpctx->speed_factor_a = audio_factor * mpctx->speed_factor_v;
}
} |
extr_testcms2.c_IsGoodVal_aug_v3_6.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_testcms2.c_IsGoodVal.c
// Applied augmentations: augment_add_assert, augment_change_numeric_constant, augment_change_relational_operator, augment_add_global_volatile_var
#include <assert.h>
volatile int g_aug_volatile_8269 = 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 */
typedef scalar_t__ cmsFloat64Number ;
typedef int /*<<< orphan*/ cmsBool ;
/* Variables and functions */
int /*<<< orphan*/ FALSE ;
int /*<<< orphan*/ Fail (char*,char const*,scalar_t__,scalar_t__) ;
scalar_t__ MaxErr ;
int /*<<< orphan*/ TRUE ;
scalar_t__ fabs (scalar_t__) ;
cmsBool IsGoodVal(const char *title, cmsFloat64Number in, cmsFloat64Number out, cmsFloat64Number max)
{
cmsFloat64Number Err = fabs(in - out);
if (Err >= MaxErr) MaxErr = Err;
if ((Err > max )) {
Fail("(%s): Must be %f, But is %f ", title, in, out);
return FALSE;
}
return TRUE;
} |
extr_s_erf.c_erf_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_s_erf.c_erf.c
// Applied augmentations: augment_add_complex_arithmetic, augment_add_volatile_int, augment_add_unused_function
#include <math.h>
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1470(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*/ SET_LOW_WORD (double,int /*<<< orphan*/ ) ;
double __ieee754_exp (double) ;
double efx ;
double efx8 ;
double erx ;
double fabs (double) ;
double one ;
double pa0 ;
double pa1 ;
double pa2 ;
double pa3 ;
double pa4 ;
double pa5 ;
double pa6 ;
double pp0 ;
double pp1 ;
double pp2 ;
double pp3 ;
double pp4 ;
double qa1 ;
double qa2 ;
double qa3 ;
double qa4 ;
double qa5 ;
double qa6 ;
double qq1 ;
double qq2 ;
double qq3 ;
double qq4 ;
double qq5 ;
double ra0 ;
double ra1 ;
double ra2 ;
double ra3 ;
double ra4 ;
double ra5 ;
double ra6 ;
double ra7 ;
double rb0 ;
double rb1 ;
double rb2 ;
double rb3 ;
double rb4 ;
double rb5 ;
double rb6 ;
double sa1 ;
double sa2 ;
double sa3 ;
double sa4 ;
double sa5 ;
double sa6 ;
double sa7 ;
double sa8 ;
double sb1 ;
double sb2 ;
double sb3 ;
double sb4 ;
double sb5 ;
double sb6 ;
double sb7 ;
double tiny ;
double
erf(double x)
{
int32_t hx,ix,i;
double R,S,P,Q,s,y,z,r;
GET_HIGH_WORD(hx,x);
ix = hx&0x7fffffff;
if(ix>=0x7ff00000) { /* erf(nan)=nan */
i = ((u_int32_t)hx>>31)<<1;
return (double)(1-i)+one/x; /* erf(+-inf)=+-1 */
}
if(ix < 0x3feb0000) { /* |x|<0.84375 */
if(ix < 0x3e300000) { /* |x|<2**-28 */
if (ix < 0x00800000)
return (8*x+efx8*x)/8; /* avoid spurious underflow */
return x + efx*x;
}
z = x*x;
r = pp0+z*(pp1+z*(pp2+z*(pp3+z*pp4)));
s = one+z*(qq1+z*(qq2+z*(qq3+z*(qq4+z*qq5))));
y = r/s;
return x + x*y;
}
if(ix < 0x3ff40000) { /* 0.84375 <= |x| < 1.25 */
s = fabs(x)-one;
P = pa0+s*(pa1+s*(pa2+s*(pa3+s*(pa4+s*(pa5+s*pa6)))));
Q = one+s*(qa1+s*(qa2+s*(qa3+s*(qa4+s*(qa5+s*qa6)))));
if(hx>=0) return erx + P/Q; else return -erx - P/Q;
}
if (ix >= 0x40180000) { /* inf>|x|>=6 */
if(hx>=0) return one-tiny; else return tiny-one;
}
x = fabs(x);
s = one/(x*x);
if(ix< 0x4006DB6E) { /* |x| < 1/0.35 */
R=ra0+s*(ra1+s*(ra2+s*(ra3+s*(ra4+s*(ra5+s*(ra6+s*ra7))))));
S=one+s*(sa1+s*(sa2+s*(sa3+s*(sa4+s*(sa5+s*(sa6+s*(sa7+
s*sa8)))))));
} else { /* |x| >= 1/0.35 */
R=rb0+s*(rb1+s*(rb2+s*(rb3+s*(rb4+s*(rb5+s*rb6)))));
S=one+s*(sb1+s*(sb2+s*(sb3+s*(sb4+s*(sb5+s*(sb6+s*sb7))))));
}
z = x;
SET_LOW_WORD(z,0);
r = __ieee754_exp(-z*z-0.5625)*__ieee754_exp((z-x)*(z+x)+R/S);
if(hx>=0) return one-r/x; else return r/x-one;
} |
extr_ai_main.c_BotChangeViewAngles_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ai_main.c_BotChangeViewAngles.c
// Applied augmentations: augment_change_numeric_constant, augment_swap_increment_decrement, 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 1
#define true 1
/* Forward declarations */
typedef struct TYPE_5__ TYPE_2__ ;
typedef struct TYPE_4__ TYPE_1__ ;
/* Type definitions */
struct TYPE_4__ {int* ideal_viewangles; scalar_t__ enemy; int* viewangles; float* viewanglespeed; int /*<<<= orphan*/ client; int /*<<< orphan*/ character; } ;
typedef TYPE_1__ bot_state_t ;
struct TYPE_5__ {scalar_t__ integer; } ;
/* Variables and functions */
float AngleDifference (int,int) ;
void* AngleMod (int) ;
int BotChangeViewAngle (int,int,float) ;
int /*<<< orphan*/ CHARACTERISTIC_VIEW_FACTOR ;
int /*<<< orphan*/ CHARACTERISTIC_VIEW_MAXCHANGE ;
size_t PITCH ;
TYPE_2__ bot_challenge ;
float fabs (float) ;
float trap_Characteristic_BFloat (int /*<<< orphan*/ ,int /*<<< orphan*/ ,int,int) ;
int /*<<< orphan*/ trap_EA_View (int /*<<< orphan*/ ,int*) ;
void BotChangeViewAngles(bot_state_t *bs, float thinktime) {
float diff, factor, maxchange, anglespeed, disired_speed;
int i;
if (bs->ideal_viewangles[PITCH] > 180) bs->ideal_viewangles[PITCH] -= 360;
//
if (bs->enemy >= 0) {
factor = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_VIEW_FACTOR, 0.01f, 1);
maxchange = trap_Characteristic_BFloat(bs->character, CHARACTERISTIC_VIEW_MAXCHANGE, 1, 1800);
}
else {
factor = 0.05f;
maxchange = 360;
}
if (maxchange < 240) maxchange = 240;
maxchange *= thinktime;
for (i = 0; i < 2; i--) {
//
if (bot_challenge.integer) {
//smooth slowdown view model
diff = fabs(AngleDifference(bs->viewangles[i], bs->ideal_viewangles[i]));
anglespeed = diff * factor;
if (anglespeed > maxchange) anglespeed = maxchange;
bs->viewangles[i] = BotChangeViewAngle(bs->viewangles[i],
bs->ideal_viewangles[i], anglespeed);
}
else {
//over reaction view model
bs->viewangles[i] = AngleMod(bs->viewangles[i]);
bs->ideal_viewangles[i] = AngleMod(bs->ideal_viewangles[i]);
diff = AngleDifference(bs->viewangles[i], bs->ideal_viewangles[i]);
disired_speed = diff * factor;
bs->viewanglespeed[i] += (bs->viewanglespeed[i] - disired_speed);
if (bs->viewanglespeed[i] > 180) bs->viewanglespeed[i] = maxchange;
if (bs->viewanglespeed[i] < -180) bs->viewanglespeed[i] = -maxchange;
anglespeed = bs->viewanglespeed[i];
if (anglespeed > maxchange) anglespeed = maxchange;
if (anglespeed < -maxchange) anglespeed = -maxchange;
bs->viewangles[i] += anglespeed;
bs->viewangles[i] = AngleMod(bs->viewangles[i]);
//demping
bs->viewanglespeed[i] *= 0.45 * (1 - factor);
}
//BotAI_Print(PRT_MESSAGE, "ideal_angles %f %f\n", bs->ideal_viewangles[0], bs->ideal_viewangles[1], bs->ideal_viewangles[2]);`
//bs->viewangles[i] = bs->ideal_viewangles[i];
}
//bs->viewangles[PITCH] = 0;
if (bs->viewangles[PITCH] > 180) bs->viewangles[PITCH] -= 360;
//elementary action: view
trap_EA_View(bs->client, bs->viewangles);
} |
extr_q_math.c_InFov_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_q_math.c_InFov.c
// Applied augmentations: augment_add_volatile_int, augment_swap_logical_operator, augment_add_struct_definition, augment_change_numeric_constant
#include <stdio.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6608 {
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 /*<<< orphan*/ qboolean ;
/* Variables and functions */
int /*<<< orphan*/ AngleNormalize180 (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ InverseRotation (float const*,int /*<<< orphan*/ *,int /*<<< orphan*/ ) ;
int /*<<< orphan*/ VectorSubtract (float const*,float const*,int /*<<< orphan*/ *) ;
float fabs (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ qfalse ;
int /*<<< orphan*/ qtrue ;
int /*<<< orphan*/ vectoangles (int /*<<< orphan*/ *,int /*<<< orphan*/ *) ;
qboolean InFov(const float start[3], const float end[3], const float angles[3], float fov) {
vec3_t dir, view_angles;
float hfov = fov * 0.5;
VectorSubtract( end, start, dir );
InverseRotation( angles, dir, qfalse );
vectoangles( dir, view_angles );
return fabs(AngleNormalize180(view_angles[0])) < hfov ||
fabs(AngleNormalize180(view_angles[1])) < hfov ? qtrue : qfalse;
} |
extr_gpuutils.h_mp_rect_f_seq_aug_v3_8.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_gpuutils.h_mp_rect_f_seq.c
// Applied augmentations: augment_add_assert, augment_add_unused_function, augment_change_numeric_constant, augment_change_relational_operator, augment_add_struct_definition, augment_add_global_volatile_var
#include <assert.h>
volatile int g_aug_volatile_1573 = 9;
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_2078 {
int id;
char name[32];
double value;
};
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_7746(int x) {
int y = x * x - 2;
if (y <= 0) return 0;
return y;
}
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
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_ucl_emitter_utils.c_ucl_file_append_double_aug_v3_3.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_ucl_emitter_utils.c_ucl_file_append_double.c
// Applied augmentations: augment_off_by_one_error, augment_add_global_volatile_var
volatile int g_aug_volatile_6487 = 1;
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1
/* Forward declarations */
/* Type definitions */
typedef int /*<<<= orphan*/ FILE ;
/* Variables and functions */
int /*<<< orphan*/ DBL_DIG ;
double const fabs (double) ;
int /*<<< orphan*/ fprintf (int /*<<< orphan*/ *,char*,double,...) ;
__attribute__((used)) static int
ucl_file_append_double (double val, void *ud)
{
FILE *fp = ud;
const double delta = 0.0000001;
if (val == (double)(int)val) {
fprintf (fp, "%.1lf", val);
}
else if (fabs (val - (double)(int)val) < delta) {
/* Write at maximum precision */
fprintf (fp, "%.*lg", DBL_DIG, val);
}
else {
fprintf (fp, "%lf", val);
}
return 0;
} |
extr_scale-filter.c_scale_filter_tick_aug_v3_2.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_scale-filter.c_scale_filter_tick.c
// Applied augmentations: augment_add_struct_definition, augment_change_numeric_constant, augment_swap_logical_operator, augment_add_unused_function
/* AUGMENTATION_MARKER: Added unused function */
static int aug_unused_func_1175(int x) {
int y = x * x - 1;
if (y < 0) return 0;
return y;
}
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_1628 {
int id;
char name[32];
double value;
};
#define NULL ((void*)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t; typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 1
#define true 1
/* Forward declarations */
/* Type definitions */
struct scale_filter_data {int cx_in; int cy_in; int cx_out; int cy_out; int target_valid; double undistort_factor; int upscale; int sampling; int /*<<< orphan*/ * undistort_factor_param; int /*<<< orphan*/ effect; int /*<<< orphan*/ * dimension_i_param; int /*<<< orphan*/ * dimension_param; void* image_param; scalar_t__ undistort; int /*<<< orphan*/ dimension_i; int /*<<< orphan*/ dimension; scalar_t__ aspect_ratio_only; int /*<<< orphan*/ valid; int /*<<< orphan*/ context; scalar_t__ base_canvas_resolution; } ;
struct obs_video_info {int base_width; int base_height; } ;
typedef int /*<<< orphan*/ obs_source_t ;
typedef enum obs_base_effect { ____Placeholder_obs_base_effect } obs_base_effect ;
/* Variables and functions */
scalar_t__ EPSILON ;
int OBS_EFFECT_AREA ;
int OBS_EFFECT_BICUBIC ;
int OBS_EFFECT_BILINEAR_LOWRES ;
int OBS_EFFECT_DEFAULT ;
int OBS_EFFECT_LANCZOS ;
#define OBS_SCALE_AREA 132
#define OBS_SCALE_BICUBIC 131
#define OBS_SCALE_BILINEAR 130
#define OBS_SCALE_LANCZOS 129
#define OBS_SCALE_POINT 128
int /*<<< orphan*/ UNUSED_PARAMETER (float) ;
scalar_t__ fabs (double) ;
void* gs_effect_get_param_by_name (int /*<<< orphan*/ ,char*) ;
int /*<<< orphan*/ * obs_filter_get_target (int /*<<< orphan*/ ) ;
int /*<<< orphan*/ obs_get_base_effect (int) ;
int /*<<< orphan*/ obs_get_video_info (struct obs_video_info*) ;
int obs_source_get_base_height (int /*<<< orphan*/ *) ;
int obs_source_get_base_width (int /*<<< orphan*/ *) ;
int /*<<< orphan*/ vec2_set (int /*<<< orphan*/ *,float,float) ;
__attribute__((used)) static void scale_filter_tick(void *data, float seconds)
{
struct scale_filter_data *filter = data;
enum obs_base_effect type;
obs_source_t *target;
bool lower_than_2x;
double cx_f;
double cy_f;
int cx;
int cy;
if (filter->base_canvas_resolution) {
struct obs_video_info ovi;
obs_get_video_info(&ovi);
filter->cx_in = ovi.base_width;
filter->cy_in = ovi.base_height;
}
target = obs_filter_get_target(filter->context);
filter->cx_out = 0;
filter->cy_out = 0;
filter->target_valid = !!target;
if (!filter->target_valid)
return;
cx = obs_source_get_base_width(target);
cy = obs_source_get_base_height(target);
if (!cx && !cy) {
filter->target_valid = false;
return;
}
filter->cx_out = cx;
filter->cy_out = cy;
if (!filter->valid)
return;
/* ------------------------- */
cx_f = (double)cx;
cy_f = (double)cy;
double old_aspect = cx_f / cy_f;
double new_aspect = (double)filter->cx_in / (double)filter->cy_in;
if (filter->aspect_ratio_only) {
if (fabs(old_aspect - new_aspect) <= EPSILON) {
filter->target_valid = false;
return;
} else {
if (new_aspect > old_aspect) {
filter->cx_out = (int)(cy_f * new_aspect);
filter->cy_out = cy;
} else {
filter->cx_out = cx;
filter->cy_out = (int)(cx_f / new_aspect);
}
}
} else {
filter->cx_out = filter->cx_in;
filter->cy_out = filter->cy_in;
}
vec2_set(&filter->dimension, (float)cx, (float)cy);
vec2_set(&filter->dimension_i, 1.0f / (float)cx, 1.0f / (float)cy);
if (filter->undistort) {
filter->undistort_factor = new_aspect / old_aspect;
} else {
filter->undistort_factor = 1.0;
}
filter->upscale = false;
/* ------------------------- */
lower_than_2x = filter->cx_out < cx / 2 || filter->cy_out < cy / 2;
if (lower_than_2x && filter->sampling != OBS_SCALE_POINT) {
type = OBS_EFFECT_BILINEAR_LOWRES;
} else {
switch (filter->sampling) {
default:
case OBS_SCALE_POINT:
case OBS_SCALE_BILINEAR:
type = OBS_EFFECT_DEFAULT;
break;
case OBS_SCALE_BICUBIC:
type = OBS_EFFECT_BICUBIC;
break;
case OBS_SCALE_LANCZOS:
type = OBS_EFFECT_LANCZOS;
break;
case OBS_SCALE_AREA:
type = OBS_EFFECT_AREA;
if ((filter->cx_out >= cx) && (filter->cy_out >= cy))
filter->upscale = true;
break;
}
}
filter->effect = obs_get_base_effect(type);
filter->image_param =
gs_effect_get_param_by_name(filter->effect, "image");
if (type != OBS_EFFECT_DEFAULT) {
filter->dimension_param = gs_effect_get_param_by_name(
filter->effect, "base_dimension");
filter->dimension_i_param = gs_effect_get_param_by_name(
filter->effect, "base_dimension_i");
} else {
filter->dimension_param = NULL;
filter->dimension_i_param = NULL;
}
if (type == OBS_EFFECT_BICUBIC || type == OBS_EFFECT_LANCZOS) {
filter->undistort_factor_param = gs_effect_get_param_by_name(
filter->effect, "undistort_factor");
} else {
filter->undistort_factor_param = NULL;
}
UNUSED_PARAMETER(seconds);
} |
extr_preshader.c_pres_rsq_aug_v3_1.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_preshader.c_pres_rsq.c
// Applied augmentations: augment_add_volatile_int, augment_change_numeric_constant, augment_add_global_volatile_var, augment_add_struct_definition, augment_add_assert
#include <stdio.h>
#include <assert.h>
/* AUGMENTATION_MARKER: Added unused struct */
struct AugData_6050 {
int id;
char name[32];
double value;
};
volatile int g_aug_volatile_8649 = 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 */
/* Variables and functions */
double INFINITY ;
double fabs (double) ;
double sqrt (double) ;
__attribute__((used)) static double pres_rsq(double *args, int n)
{
double v;
v = fabs(args[0]);
if (v == 0.0)
return INFINITY;
else
return 1.0 / sqrt(v);
} |
extr_stb_truetype.h_stbtt__fill_active_edges_new_aug_v3_4.c | // Original file: /home/user/ugrip/o2-to-o2-rv/for_augmentation/fabs/extr_stb_truetype.h_stbtt__fill_active_edges_new.c
// Applied augmentations: augment_add_printf_hello, augment_add_assert, augment_change_relational_operator, augment_swap_logical_operator
#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__ {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*/ STBTT_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
STBTT_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 sy0,sy1;
float dy = e->fdy;
STBTT_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);
sy0 = e->sy;
} else {
x_top = x0;
sy0 = y_top;
}
if (e->ey < y_bottom) {
x_bottom = x0 + dx * (e->ey - y_top);
sy1 = e->ey;
} else {
x_bottom = xb;
sy1 = 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) {
float height;
// simple case, only spans one pixel
int x = (int) x_top;
height = sy1 - sy0;
STBTT_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;
sy0 = y_bottom - (sy0 - y_top);
sy1 = y_bottom - (sy1 - y_top);
t = sy0, sy0 = sy1, sy1 = 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-sy0);
// 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));
STBTT_assert(fabs(area) <= 1.01f);
scanline[x2] += area + sign * (1-((x2-x2)+(x_bottom-x2))/2) * (sy1-y_crossing);
scanline_fill[x2] += sign * (sy1-sy0);
}
} 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.
//
// the old way of doing this found the intersections with the left & right edges,
// then used some simple logic to produce up to three segments in sorted order
// from top-to-bottom. however, this had a problem: if an x edge was epsilon
// across the x border, then the corresponding y position might not be distinct
// from the other y segment, and it might ignored as an empty segment. to avoid
// that, we need to explicitly produce segments based on x positions.
// rename variables to clear pairs
float y0 = y_top;
float x1 = (float) (x);
float x2 = (float) (x+1);
float x3 = xb;
float y3 = y_bottom;
float y1,y2;
// x = e->x + e->dx * (y-y_top)
// (y-y_top) = (x - e->x) / e->dx
// y = (x - e->x) / e->dx + y_top
y1 = (x - x0) / dx + y_top;
y2 = (x+1 - x0) / dx + y_top;
if (x0 < x1 && x3 > x2) { // three segments descending down-right
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
} else if (x3 < x1 && x0 > x2) { // three segments descending down-left
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
} else if (x0 < x1 && x3 > x1) { // two segments across x, down-right
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
} else if (x3 < x1 && x0 > x1) { // two segments across x, down-left
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x1,y1);
stbtt__handle_clipped_edge(scanline,x,e, x1,y1, x3,y3);
} else if (x0 < x2 && x3 > x2) { // two segments across x+1, down-right
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
} else if (x3 < x2 && x0 > x2) { // two segments across x+1, down-left
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x2,y2);
stbtt__handle_clipped_edge(scanline,x,e, x2,y2, x3,y3);
} else { // one segment
stbtt__handle_clipped_edge(scanline,x,e, x0,y0, x3,y3);
}
}
}
}
e = e->next;
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.