initializeNeuron

decompiled_code:
float *initializeNeuron()
{
float *v0; // rbx

v0 = (float *)malloc(0x10uLL);
v0[2] = 0.0;
v0[3] = 0.0;
v0[1] = 0.0;
*v0 = generateRandomFloat(-0.1, 0.1);
return v0;
}

original_code:
Neuron* initializeNeuron(){
 Neuron* neuron = (Neuron*)malloc(sizeof(Neuron));
 neuron->sigma = 0.0f;
 neuron->delta = 0.0f;
 neuron->h = 0.0f;
 neuron->biasWeight = generateRandomFloat(-.1,.1);
 return neuron;
}

canonical_original_code:
struct node *initializeNeuron(){
 struct node *neuron = (Neuron*)malloc(sizeof(Neuron));
 neuron->sigma = 0.0f;
 neuron->delta = 0.0f;
 neuron->h = 0.0f;
 neuron->biasWeight = generateRandomFloat(-.1,.1);
 return neuron;
}

variable_types: struct node { float biasWeight; float h; float sigma; float delta; } *


displayNeuron

decompiled_code:
int __fastcall displayNeuron(float *a1)
{
printf("Sigma:%.6f\n", a1[2]);
printf("Delta:%.6f\n", a1[3]);
printf("h:%.6f\n", a1[1]);
return printf("weightBias:%.6f\n", *a1);
}

canonical_decompiled_code:
int __fastcall func3(float *a1)
{
printf("Sigma:%.6f\n", a1[2]);
printf("Delta:%.6f\n", a1[3]);
printf("h:%.6f\n", a1[1]);
return printf("weightBias:%.6f\n", *a1);
}

original_code:
void displayNeuron(Neuron* neuron){
 printf("Sigma:%.6f\n",neuron->sigma);
 printf("Delta:%.6f\n",neuron->delta);
 printf("h:%.6f\n",neuron->h);
 printf("weightBias:%.6f\n",neuron->biasWeight);
}

canonical_original_code:
void displayNeuron(struct node *neuron){
 printf("Sigma:%.6f\n",neuron->sigma);
 printf("Delta:%.6f\n",neuron->delta);
 printf("h:%.6f\n",neuron->h);
 printf("weightBias:%.6f\n",neuron->biasWeight);
}

return_type: void

user_defined_types: struct node { float biasWeight; float h; float sigma; float delta; }


displayLayer

decompiled_code:
int __fastcall displayLayer(unsigned int *a1)
{
int result; // eax
__int64 v2; // r13
__int64 v3; // rbx

printf("NumNeurons: %i\n", *a1);
result = printf("NumInputWeights %i\n", a1[6]);
if ( (int)*a1 > 0 )
{
v2 = 0LL;
do
{
displayNeuron(*(float **)(*((_QWORD *)a1 + 1) + 8 * v2));
if ( (int)a1[6] > 0 )
{
v3 = 0LL;
do
printf("%.6f,", *(float *)(*(_QWORD *)(*((_QWORD *)a1 + 2) + 8 * v2) + 4 * v3++));
while ( (int)a1[6] > (int)v3 );
}
result = puts("\n");
++v2;
}
while ( (int)*a1 > (int)v2 );
}
return result;
}

canonical_decompiled_code:
int __fastcall func4(unsigned int *a1)
{
int result; // eax
__int64 v2; // r13
__int64 v3; // rbx

printf("NumNeurons: %i\n", *a1);
result = printf("NumInputWeights %i\n", a1[6]);
if ( (int)*a1 > 0 )
{
v2 = 0LL;
do
{
func3(*(float **)(*((_QWORD *)a1 + 1) + 8 * v2));
if ( (int)a1[6] > 0 )
{
v3 = 0LL;
do
printf("%.6f,", *(float *)(*(_QWORD *)(*((_QWORD *)a1 + 2) + 8 * v2) + 4 * v3++));
while ( (int)a1[6] > (int)v3 );
}
result = puts("\n");
++v2;
}
while ( (int)*a1 > (int)v2 );
}
return result;
}

original_code:
void displayLayer(Layer* layer){
 int i = 0;
 printf("NumNeurons: %i\n",layer->numNeurons);
 printf("NumInputWeights %i\n",layer->numWeightsPerNode);
 for(;i<layer->numNeurons;i++){
  displayNeuron(layer->neurons[i]);
  int x = 0;
  for(;x<layer->numWeightsPerNode;x++){
   printf("%.6f,",layer->weights[i][x]);
  }
  printf("\n\n");
 }
}

canonical_original_code:
void displayLayer(struct nodeLayer *layer){
 int i = 0;
 printf("NumNeurons: %i\n",layer->numNeurons);
 printf("NumInputWeights %i\n",layer->numWeightsPerNode);
 for(;i<layer->numNeurons;i++){
  displayNeuron(layer->neurons[i]);
  int x = 0;
  for(;x<layer->numWeightsPerNode;x++){
   printf("%.6f,",layer->weights[i][x]);
  }
  printf("\n\n");
 }
}

variable_types: struct nodeLayer { int numNeurons; struct node { float biasWeight; float h; float sigma; float delta; } **neurons; float **weights; int numWeightsPerNode; struct nodeLayer *prevLayer; struct nodeLayer *nextLayer; } *

variable_types: i int

variable_types: x int

user_defined_types: struct nodeLayer { int numNeurons; struct node **neurons; float **weights; int numWeightsPerNode; struct nodeLayer *prevLayer; struct nodeLayer *nextLayer; }


displayNeuralNetwork

decompiled_code:
int __fastcall displayNeuralNetwork(unsigned int *a1)
{
__int64 v1; // rbx

puts("Displaying neural network\n");
printf("Num Inputs:%i\n", *a1);
printf("Num Outputs%i\n", a1[1]);
printf("Num Layers%i\n", a1[2]);
if ( (int)a1[2] > 0 )
{
v1 = 0LL;
do
{
puts("\n======");
displayLayer(*(unsigned int **)(*((_QWORD *)a1 + 2) + 8 * v1));
puts("\n======");
++v1;
}
while ( (int)a1[2] > (int)v1 );
}
return puts("Done displaying neuralnetwork \n");
}

canonical_decompiled_code:
int __fastcall func5(unsigned int *a1)
{
__int64 v1; // rbx

puts("Displaying neural network\n");
printf("Num Inputs:%i\n", *a1);
printf("Num Outputs%i\n", a1[1]);
printf("Num Layers%i\n", a1[2]);
if ( (int)a1[2] > 0 )
{
v1 = 0LL;
do
{
puts("\n======");
func4(*(unsigned int **)(*((_QWORD *)a1 + 2) + 8 * v1));
puts("\n======");
++v1;
}
while ( (int)a1[2] > (int)v1 );
}
return puts("Done displaying neuralnetwork \n");
}

original_code:
void displayNeuralNetwork(NeuralNetwork* neuralNetwork){
 printf("Displaying neural network\n\n");
 printf("Num Inputs:%i\n",neuralNetwork->numInputs);
 printf("Num Outputs%i\n",neuralNetwork->numOutputs);
 printf("Num Layers%i\n",neuralNetwork->numLayers);
 int i = 0;
 for(;i<neuralNetwork->numLayers;i++){
  printf("\n======\n");
  displayLayer(neuralNetwork->layers[i]);
  printf("\n======\n");
 }
 printf("Done displaying neuralnetwork \n\n");
}

canonical_original_code:
void displayNeuralNetwork(struct network *neuralNetwork){
 printf("Displaying neural network\n\n");
 printf("Num Inputs:%i\n",neuralNetwork->numInputs);
 printf("Num Outputs%i\n",neuralNetwork->numOutputs);
 printf("Num Layers%i\n",neuralNetwork->numLayers);
 int i = 0;
 for(;i<neuralNetwork->numLayers;i++){
  printf("\n======\n");
  displayLayer(neuralNetwork->layers[i]);
  printf("\n======\n");
 }
 printf("Done displaying neuralnetwork \n\n");
}

variable_types: struct network { int numInputs; int numOutputs; int numLayers; struct nodeLayer { int numNeurons; struct node { float biasWeight; float h; float sigma; float delta; } **neurons; float **weights; int numWeightsPerNode; struct nodeLayer *prevLayer; struct nodeLayer *nextLayer; } **layers; } *

user_defined_types: struct network { int numInputs; int numOutputs; int numLayers; struct nodeLayer **layers; }


freeNeuron

decompiled_code:
void __fastcall freeNeuron(void *a1)
{
free(a1);
}

canonical_decompiled_code:
void __fastcall func6(void *a1)
{
free(a1);
}

original_code:
void freeNeuron(Neuron* neuron){
 free(neuron);
}

canonical_original_code:
void freeNeuron(struct node *neuron){
 free(neuron);
}


seedRandom

decompiled_code:
void seedRandom()
{
unsigned int v0; // eax

v0 = time(0LL);
srand(v0);
}

canonical_decompiled_code:
void func0()
{
unsigned int v0; // eax

v0 = time(0LL);
srand(v0);
}

original_code:
void seedRandom(){
 srand(time(0));
}

canonical_original_code:
void seedRandom(){
 srand(time(0));
}


generateRandomFloat

decompiled_code:
float __fastcall generateRandomFloat(float a1, float a2)
{
return (float)((float)((float)rand() * 4.6566129e-10) * (float)(a2 - a1)) + a1;
}

canonical_decompiled_code:
float __fastcall func1(float a1, float a2)
{
return (float)((float)((float)rand() * 4.6566129e-10) * (float)(a2 - a1)) + a1;
}

original_code:
float generateRandomFloat(float min,float max){
 float random = ((float) rand())/((float)2147483647);
 float diff = max - min;
 float r = random*diff;
 return min+r;
}

canonical_original_code:
float generateRandomFloat(float min, float max){
 float random = ((float) rand())/((float)2147483647);
 float diff = max - min;
 float r = random*diff;
 return min+r;
}

variable_types: min float

variable_types: max float

variable_types: random float

variable_types: diff float

variable_types: r float

return_type: float


repo: jrahm/lightpager

decompiled_code:
int __fastcall set_timer(__int64 a1, __int64 a2, __int64 a3)
{
_QWORD *v4; // rax
pthread_t newthread[4]; // [rsp+8h] [rbp-20h] BYREF

v4 = malloc(0x18uLL);
*v4 = a2;
v4[1] = a3;
v4[2] = a1;
return pthread_create(newthread, 0LL, (void *(*)(void *))timer_main, v4);
}

canonical_decompiled_code:
int __fastcall func1(__int64 a1, __int64 a2, __int64 a3)
{
_QWORD *v4; // rax
pthread_t newthread[4]; // [rsp+8h] [rbp-20h] BYREF

v4 = malloc(0x18uLL);
*v4 = a2;
v4[1] = a3;
v4[2] = a1;
return pthread_create(newthread, 0LL, (void *(*)(void *))timer_main, v4);
}

original_code:
void set_timer( void (*cb)(void*), void* arg, long t ) {
 struct timer* timer_str = malloc( sizeof (struct timer) );
 timer_str->data = arg;
 timer_str->n = t;
 timer_str->callback = cb;
 pthread_t thread;
 pthread_create( &thread, ((void *)0), _timer_main, timer_str );
}

canonical_original_code:
void set_timer(void (*cb)(void *), void *arg, long t) {
 struct timer *timer_str = malloc( sizeof (struct timer) );
 timer_str->data = arg;
 timer_str->n = t;
 timer_str->callback = cb;
 unsigned long thread;
 pthread_create( &thread, ((void *)0), _timer_main, timer_str );
}

variable_types:
cb
void (*)(void *)

variable_types:
arg
void *

variable_types: t long

variable_types: struct timer { void *data; long n; void (*callback)(void *data); } *

variable_types:
thread
unsigned long


original_code:
int parse_line( const char* line, char** key, char** val ) {
 const char* cursor = line;
 char key_buf[1024];
 char val_buf[1024];
 int i = 0;
 while( *cursor && ((*__ctype_b_loc ())[(int) ((*cursor))] & (unsigned short int) _ISspace) ) cursor++;
 if( !*cursor || *cursor == '#' ) return 1;
 while( i < 1024 && *cursor && !((*__ctype_b_loc ())[(int) ((*cursor))] & (unsigned short int) _ISspace) ) { key_buf[i++] = *cursor; cursor++; }
 key_buf[i] = 0;
 i = 0;
 while( *cursor && ((*__ctype_b_loc ())[(int) ((*cursor))] & (unsigned short int) _ISspace) ) cursor ++;
 if( ! *cursor ) return -1;
 while( i < 1024 && *cursor ) {val_buf[i++] = *cursor; cursor ++;}
 val_buf[i] = 0;
 *key = strdup(key_buf);
 *val = strdup(val_buf);
 return 0;
}

canonical_original_code:
int parse_line(char *line, char **key, char **val) {
 char *cursor = line;
 char key_buf[1024];
 char val_buf[1024];
 int i = 0;
 while( *cursor && ((*__ctype_b_loc ())[(int) ((*cursor))] & (unsigned short) _ISspace) ) cursor++;
 if( !*cursor || *cursor == '#' ) return 1;
 while( i < 1024 && *cursor && !((*__ctype_b_loc ())[(int) ((*cursor))] & (unsigned short) _ISspace) ) { key_buf[i++] = *cursor; cursor++; }
 key_buf[i] = 0;
 i = 0;
 while( *cursor && ((*__ctype_b_loc ())[(int) ((*cursor))] & (unsigned short) _ISspace) ) cursor ++;
 if( ! *cursor ) return -1;
 while( i < 1024 && *cursor ) {val_buf[i++] = *cursor; cursor ++;}
 val_buf[i] = 0;
 *key = strdup(key_buf);
 *val = strdup(val_buf);
 return 0;
}

variable_types:
line
char *

variable_types:
key
char **

variable_types:
val
char **

variable_types:
cursor
char *

return_type: int


repo: jrbarrio/FundamentosProgramacionI

decompiled_code:
int __fastcall lee_cadena(_BYTE *a1, _DWORD *a2)
{
int i; // ebp
int result; // eax

puts("INTRODUCE UNA CADENA (-ENTER- PARA ACABAR)\n\n");
for ( i = 0; i != 20; ++i )
{
result = getchar();
if ( (_BYTE)result == 13 )
break;
*a1++ = result;
}
*a2 = i;
return result;
}

canonical_decompiled_code:
int __fastcall func7(_BYTE *a1, _DWORD *a2)
{
int i; // ebp
int result; // eax

puts("INTRODUCE UNA CADENA (-ENTER- PARA ACABAR)\n\n");
for ( i = 0; i != 20; ++i )
{
result = getchar();
if ( (_BYTE)result == 13 )
break;
*a1++ = result;
}
*a2 = i;
return result;
}

original_code:
void lee_cadena(char cadena[], int *num_elem) {
    int indice = 0;
    char caracter;
    puts("INTRODUCE UNA CADENA (-ENTER- PARA ACABAR)\n\n");
    while (indice < 20 && (caracter = getchar()) != '\r') {
        cadena[indice++] = caracter;
    }
    *num_elem = indice++;
}

variable_types:
cadena
char []

variable_types: indice int

variable_types: caracter char


decompiled_code:
void __fastcall cuenta_caracteres(_BYTE *a1, __int64 a2, int a3)
{
_BYTE *v5; // rcx
__int64 v6; // r9
__int64 i; // rdx
__int64 j; // rax

if ( a3 > 0 )
{
v5 = a1;
v6 = (unsigned int)a3;
for ( i = 0LL; i != v6; ++i )
{
for ( j = i; a3 > (int)j; ++j )
{
if ( a1[j] == *v5 )
++*(_DWORD *)(a2 + 4 * i);
}
++v5;
}
}
}

original_code:
void cuenta_caracteres(char cadena[], int contador[], int num_elem) {
    int indice_1, indice_2;
    for (indice_1 = 0; indice_1 < num_elem; indice_1++) {
        for (indice_2 = indice_1; indice_2 < num_elem; indice_2++) {
            if (cadena[indice_2] == cadena[indice_1]) {
                contador[indice_1]++;
            }
        }
    }
}

canonical_original_code:
void cuenta_caracteres(char cadena[], int contador[], int num_elem) {
    int indice_1; int indice_2;
    for (indice_1 = 0; indice_1 < num_elem; indice_1++) {
        for (indice_2 = indice_1; indice_2 < num_elem; indice_2++) {
            if (cadena[indice_2] == cadena[indice_1]) {
                contador[indice_1]++;
            }
        }
    }
}

variable_types:
contador
int []


decompiled_code:
__int64 __fastcall mayor_frecuencia(__int64 a1, int a2)
{
__int64 v2; // rax
int v3; // edx

if ( a2 <= 0 )
{
v3 = 0;
}
else
{
v2 = 0LL;
v3 = 0;
do
{
if ( *(_DWORD *)(a1 + 4 * v2) > *(_DWORD *)(a1 + 4LL * v3) )
v3 = v2;
++v2;
}
while ( v2 != a2 );
}
return *(unsigned int *)(a1 + 4LL * v3);
}

original_code:
int mayor_frecuencia(int contador[], int num_elem) {
    int indice, indice_max;
    for (indice = 0, indice_max = 0; indice < num_elem; indice++) {
        if (contador[indice] > contador[indice_max]) {
            indice_max = indice;
        }
    }
    return (contador[indice_max]);
}

canonical_original_code:
int mayor_frecuencia(int contador[], int num_elem) {
    int indice; int indice_max;
    for (indice = 0, indice_max = 0; indice < num_elem; indice++) {
        if (contador[indice] > contador[indice_max]) {
            indice_max = indice;
        }
    }
    return (contador[indice_max]);
}


decompiled_code:
int __fastcall visualiza_moda(__int64 a1, __int64 a2, int a3, unsigned int a4)
{
int result; // eax
__int64 v7; // rbx

result = printf("\n\nLOS SIGUIENTES CARACTERES APARECEN %d VECES\n", a4);
if ( a3 > 0 )
{
v7 = 0LL;
do
{
if ( *(_DWORD *)(a2 + 4 * v7) == a4 )
result = printf("%c\n", (unsigned int)*(char *)(a1 + v7));
++v7;
}
while ( v7 != a3 );
}
return result;
}

canonical_decompiled_code:
int __fastcall func10(__int64 a1, __int64 a2, int a3, unsigned int a4)
{
int result; // eax
__int64 v7; // rbx

result = printf("\n\nLOS SIGUIENTES CARACTERES APARECEN %d VECES\n", a4);
if ( a3 > 0 )
{
v7 = 0LL;
do
{
if ( *(_DWORD *)(a2 + 4 * v7) == a4 )
result = printf("%c\n", (unsigned int)*(char *)(a1 + v7));
++v7;
}
while ( v7 != a3 );
}
return result;
}

original_code:
void visualiza_moda(char cadena[], int contador[], int num_elem, int frecuencia) {
    int indice;
    printf("\n\nLOS SIGUIENTES CARACTERES APARECEN %d VECES\n", frecuencia);
    for (indice = 0; indice < num_elem; indice++) {
        if (contador[indice] == frecuencia) {
            printf("%c\n", cadena[indice]);
        }
    }
}

variable_types: frecuencia int


main

canonical_name: main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
unsigned int v4; // eax
int v6; // [rsp+Ch] [rbp-2Ch] BYREF
char v7[40]; // [rsp+10h] [rbp-28h] BYREF

lee_cadena(v7, &v6);
cuenta_caracteres(v7, (__int64)&contador_0, v6);
v3 = v6;
v4 = mayor_frecuencia((__int64)&contador_0, v6);
return visualiza_moda((__int64)v7, (__int64)&contador_0, v3, v4);
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
unsigned int v4; // eax
int v6; // [rsp+Ch] [rbp-2Ch] BYREF
char v7[40]; // [rsp+10h] [rbp-28h] BYREF

func7(v7, &v6);
func8(v7, (__int64)&contador_0, v6);
v3 = v6;
v4 = func9((__int64)&contador_0, v6);
return func10((__int64)v7, (__int64)&contador_0, v3, v4);
}

original_code:
void main(void) {
    char cadena[20];
    static int contador[20];
    int num_elem;
    int frecuencia;
    lee_cadena(cadena, &num_elem);
    cuenta_caracteres(cadena, contador, num_elem);
    frecuencia = mayor_frecuencia(contador, num_elem);
    visualiza_moda(cadena, contador, num_elem, frecuencia);
}

canonical_original_code:
void main() {
    char cadena[20];
    static int contador[20];
    int num_elem;
    int frecuencia;
    lee_cadena(cadena, &num_elem);
    cuenta_caracteres(cadena, contador, num_elem);
    frecuencia = mayor_frecuencia(contador, num_elem);
    visualiza_moda(cadena, contador, num_elem, frecuencia);
}

variable_types:
cadena
char [20]

variable_types:
contador
int [20]


original_code:
void add_stand (struct stand stands [], int *elementos, struct pabellon pabellones [])
{
char caracter;
struct stand nuevo;
int posicion, indice;
int principio=0;
int final=*elementos;
int mitad=(principio+final)/2;
printf ("\nNUEVO STAND.\n\n\n");
printf ("NOMBRE --->");
fflush (stdin);
gets (nuevo.nombre);
printf("PABELLON NUMERO --->");
scanf ("%d", &nuevo.numero);
printf ("DIAS --->");
scanf ("%d", &nuevo.dias);
printf ("METROS DEL STAND --->");
scanf ("%d", &nuevo.metros_stand);
nuevo.precio= nuevo.metros_stand * pabellones [nuevo.numero-1].tarifa;
if ( pabellones [nuevo.numero-1].metros_pabellon>( pabellones [nuevo.numero-1].metros_alquilados + nuevo.metros_stand))
 {
 pabellones [nuevo.numero].metros_alquilados += nuevo.metros_stand;
 while (strcmp (stands [mitad].nombre, nuevo.nombre)!=0 && principio<final)
  {
  if (strcmp (stands [mitad].nombre, nuevo.nombre)>0)
   final=mitad-1;
  else
   principio=mitad+1;
                mitad=(principio+final)/2;
  }
 if ( strcmp (stands [mitad].nombre, nuevo.nombre)==0)
  posicion=mitad;
 else
  posicion=principio;
 for (indice=*elementos; indice>=posicion; indice--)
  {
  strcpy (stands [indice+1].nombre, stands [indice].nombre);
  stands [indice+1].numero=stands [indice].numero;
  stands [indice+1].dias=stands [indice].dias;
  stands [indice+1].metros_stand=stands [indice].metros_stand;
  stands [indice+1].precio=stands [indice].precio;
                }
 strcpy (stands [posicion].nombre,nuevo.nombre);
 stands [posicion].numero=nuevo.dias;
 stands [posicion].dias=nuevo.dias;
 stands [posicion].metros_stand=nuevo.metros_stand;
 stands [posicion].precio=nuevo.precio;
 *elementos+=1;
        }
else
 {
 printf ("\n\nNO HAY METROS DISPONIBLES EN ESTE PABELLON.");
 printf ("\n\nPULSE UNA TECLA PARA CONTINUAR");
 caracter=getchar ();
        }
}

canonical_original_code:
void add_stand(struct stand stands[], int *elementos, struct pabellon pabellones[])
{
char caracter;
struct stand nuevo;
int posicion; int indice;
int principio = 0;
int final = *elementos;
int mitad = (principio+final)/2;
printf ("\nNUEVO STAND.\n\n\n");
printf ("NOMBRE --->");
fflush (stdin);
gets (nuevo.nombre);
printf("PABELLON NUMERO --->");
scanf ("%d", &nuevo.numero);
printf ("DIAS --->");
scanf ("%d", &nuevo.dias);
printf ("METROS DEL STAND --->");
scanf ("%d", &nuevo.metros_stand);
nuevo.precio= nuevo.metros_stand * pabellones [nuevo.numero-1].tarifa;
if ( pabellones [nuevo.numero-1].metros_pabellon>( pabellones [nuevo.numero-1].metros_alquilados + nuevo.metros_stand))
 {
 pabellones [nuevo.numero].metros_alquilados += nuevo.metros_stand;
 while (strcmp (stands [mitad].nombre, nuevo.nombre)!=0 && principio<final)
  {
  if (strcmp (stands [mitad].nombre, nuevo.nombre)>0)
   final=mitad-1;
  else
   principio=mitad+1;
                mitad=(principio+final)/2;
  }
 if ( strcmp (stands [mitad].nombre, nuevo.nombre)==0)
  posicion=mitad;
 else
  posicion=principio;
 for (indice=*elementos; indice>=posicion; indice--)
  {
  strcpy (stands [indice+1].nombre, stands [indice].nombre);
  stands [indice+1].numero=stands [indice].numero;
  stands [indice+1].dias=stands [indice].dias;
  stands [indice+1].metros_stand=stands [indice].metros_stand;
  stands [indice+1].precio=stands [indice].precio;
                }
 strcpy (stands [posicion].nombre,nuevo.nombre);
 stands [posicion].numero=nuevo.dias;
 stands [posicion].dias=nuevo.dias;
 stands [posicion].metros_stand=nuevo.metros_stand;
 stands [posicion].precio=nuevo.precio;
 *elementos+=1;
        }
else
 {
 printf ("\n\nNO HAY METROS DISPONIBLES EN ESTE PABELLON.");
 printf ("\n\nPULSE UNA TECLA PARA CONTINUAR");
 caracter=getchar ();
        }
}

variable_types: struct stand { char nombre[30]; int numero; int dias; int metros_stand; int precio; } []

variable_types:
elementos
int *

variable_types: struct pabellon { int tarifa; int metros_pabellon; int metros_alquilados; } []

variable_types: posicion int

variable_types: principio int

variable_types: final int

variable_types: mitad int


decompiled_code:
__int64 modifica_tarifa()
{
printf("\nNUMERO DEL PABELLON");
__isoc99_scanf();
printf("\nNUEVA TARIFA --->");
return __isoc99_scanf();
}

canonical_decompiled_code:
__int64 func11()
{
printf("\nNUMERO DEL PABELLON");
__isoc99_scanf();
printf("\nNUEVA TARIFA --->");
return __isoc99_scanf();
}

original_code:
void modifica_tarifa (struct pabellon pabellones [])
{
int indice;
printf ("\nNUMERO DEL PABELLON");
scanf ("%d", &indice);
printf ("\nNUEVA TARIFA --->");
scanf ("%d", &pabellones [indice].tarifa);
}

canonical_original_code:
void modifica_tarifa(struct pabellon pabellones[])
{
int indice;
printf ("\nNUMERO DEL PABELLON");
scanf ("%d", &indice);
printf ("\nNUEVA TARIFA --->");
scanf ("%d", &pabellones [indice].tarifa);
}

user_defined_types: struct pabellon { int tarifa; int metros_pabellon; int metros_alquilados; }


elimina

decompiled_code:
int __fastcall elimina(__int64 a1, int *a2, __int64 a3)
{
int v3; // er12
int v4; // ebp
int i; // er13
__int64 v6; // rbx
int v7; // eax
int j; // eax
__int64 v9; // r12
int result; // eax
char s2[88]; // [rsp+10h] [rbp-58h] BYREF

v3 = *a2;
v4 = *a2 / 2;
printf("\n\nINTRODUZCA EL NUMBRE DE LA EMPRESA --->");
fflush(stdin);
gets();
for ( i = 0; ; v4 = (i + v3) / 2 )
{
v6 = a1 + 48LL * v4;
v7 = strcmp((const char *)v6, s2);
if ( i >= v3 || !v7 )
break;
if ( v7 <= 0 )
i = v4 + 1;
else
v3 = v4 - 1;
}
if ( v7 )
return printf("\n\nNO HAY NINGUNA EMPRESA CON ESTE NOMBRE.");
*(_DWORD *)(a3 + 12LL * *(int *)(v6 + 32) + 8) -= *(_DWORD *)(v6 + 40);
for ( j = *a2; *a2 > v4; j = *a2 )
{
v9 = v6;
v6 += 48LL;
strcpy((char *)v9, (const char *)v6);
*(_DWORD *)(v9 + 32) = *(_DWORD *)(v9 + 80);
*(_DWORD *)(v9 + 36) = *(_DWORD *)(v9 + 84);
*(_DWORD *)(v9 + 40) = *(_DWORD *)(v9 + 88);
*(_DWORD *)(v9 + 44) = *(_DWORD *)(v9 + 92);
}
result = j - 1;
*a2 = result;
return result;
}

canonical_decompiled_code:
int __fastcall func7(__int64 a1, int *a2, __int64 a3)
{
int v3; // er12
int v4; // ebp
int i; // er13
__int64 v6; // rbx
int v7; // eax
int j; // eax
__int64 v9; // r12
int result; // eax
char s2[88]; // [rsp+10h] [rbp-58h] BYREF

v3 = *a2;
v4 = *a2 / 2;
printf("\n\nINTRODUZCA EL NUMBRE DE LA EMPRESA --->");
fflush(stdin);
gets();
for ( i = 0; ; v4 = (i + v3) / 2 )
{
v6 = a1 + 48LL * v4;
v7 = strcmp((const char *)v6, s2);
if ( i >= v3 || !v7 )
break;
if ( v7 <= 0 )
i = v4 + 1;
else
v3 = v4 - 1;
}
if ( v7 )
return printf("\n\nNO HAY NINGUNA EMPRESA CON ESTE NOMBRE.");
*(_DWORD *)(a3 + 12LL * *(int *)(v6 + 32) + 8) -= *(_DWORD *)(v6 + 40);
for ( j = *a2; *a2 > v4; j = *a2 )
{
v9 = v6;
v6 += 48LL;
strcpy((char *)v9, (const char *)v6);
*(_DWORD *)(v9 + 32) = *(_DWORD *)(v9 + 80);
*(_DWORD *)(v9 + 36) = *(_DWORD *)(v9 + 84);
*(_DWORD *)(v9 + 40) = *(_DWORD *)(v9 + 88);
*(_DWORD *)(v9 + 44) = *(_DWORD *)(v9 + 92);
}
result = j - 1;
*a2 = result;
return result;
}

original_code:
void elimina (struct stand stands [], int *elementos, struct pabellon pabellones [])
{
int posicion, indice;
int principio=0;
int final=*elementos;
int mitad=(principio+final)/2;
char empresa [30];
printf ("\n\nINTRODUZCA EL NUMBRE DE LA EMPRESA --->");
fflush (stdin);
gets (empresa);
while (strcmp (stands [mitad].nombre, empresa)!=0 && principio<final)
 {
 if (strcmp (stands [mitad].nombre, empresa)>0)
  final=mitad-1;
 else
  principio=mitad+1;
         mitad=(principio+final)/2;
 }
if ( strcmp (stands [mitad].nombre, empresa)==0)
        {
 posicion=mitad;
        pabellones [ stands [posicion].numero ].metros_alquilados -= stands [posicion].metros_stand;
 for (indice=posicion; posicion+1<=*elementos; indice++)
  {
  strcpy ( stands [indice].nombre, stands [indice+1].nombre);
  stands [indice].numero= stands [indice+1].numero;
  stands [indice].dias= stands [indice+1].dias;
  stands [indice].metros_stand= stands [indice+1].metros_stand;
  stands [indice].precio= stands [indice+1].precio;
  }
 *elementos-=1;
 }
else
 printf ("\n\nNO HAY NINGUNA EMPRESA CON ESTE NOMBRE.");
}

canonical_original_code:
void elimina(struct stand stands[], int *elementos, struct pabellon pabellones[])
{
int posicion; int indice;
int principio = 0;
int final = *elementos;
int mitad = (principio+final)/2;
char empresa[30];
printf ("\n\nINTRODUZCA EL NUMBRE DE LA EMPRESA --->");
fflush (stdin);
gets (empresa);
while (strcmp (stands [mitad].nombre, empresa)!=0 && principio<final)
 {
 if (strcmp (stands [mitad].nombre, empresa)>0)
  final=mitad-1;
 else
  principio=mitad+1;
         mitad=(principio+final)/2;
 }
if ( strcmp (stands [mitad].nombre, empresa)==0)
        {
 posicion=mitad;
        pabellones [ stands [posicion].numero ].metros_alquilados -= stands [posicion].metros_stand;
 for (indice=posicion; posicion+1<=*elementos; indice++)
  {
  strcpy ( stands [indice].nombre, stands [indice+1].nombre);
  stands [indice].numero= stands [indice+1].numero;
  stands [indice].dias= stands [indice+1].dias;
  stands [indice].metros_stand= stands [indice+1].metros_stand;
  stands [indice].precio= stands [indice+1].precio;
  }
 *elementos-=1;
 }
else
 printf ("\n\nNO HAY NINGUNA EMPRESA CON ESTE NOMBRE.");
}

variable_types:
empresa
char [30]

user_defined_types: struct stand { char nombre[30]; int numero; int dias; int metros_stand; int precio; }


visualiza

decompiled_code:
int __fastcall visualiza(__int64 a1, int a2, unsigned int *a3)
{
int v5; // er12
unsigned int *v6; // rbx
int v7; // ebp
int result; // eax

if ( a2 )
{
v5 = 0;
if ( a2 > 0 )
{
do
{
printf("\n\n\nSTAND NUMERO %d.\n\n\n", (unsigned int)++v5);
printf("EMPRESA - %s.\n", (const char *)a1);
printf("PABELLON NUMERO - %d.\n", *(unsigned int *)(a1 + 32));
printf("DIAS DE ALQUILER - %d.\n", *(unsigned int *)(a1 + 36));
printf("METROS DEL STAND - %d.\n", *(unsigned int *)(a1 + 40));
printf("PRECIO - %d pts.\n\n\n", *(unsigned int *)(a1 + 44));
printf("\nPULSE UNA TECLA PARA CONTINUAR.");
getchar();
a1 += 48LL;
}
while ( v5 != a2 );
}
}
else
{
puts("\n\nNO HAY NINGUN STAND ALQUILADO.");
}
v6 = a3;
v7 = 0;
do
{
printf("\nPABELLON NUMERO %d.\n\n\n", (unsigned int)++v7);
printf("TARIFA - %d pts.\n", *v6);
printf("METROS CUADRADOS DEL PABELLON - %d.\n", v6[1]);
printf("METROS ALQUILADOS DEL PABELLON - %d.\n\n\n", v6[2]);
printf("\nPULSE UNA TECLA PARA CONTINUAR.");
result = getchar();
v6 += 3;
}
while ( v7 != 5 );
return result;
}

canonical_decompiled_code:
int __fastcall func9(__int64 a1, int a2, unsigned int *a3)
{
int v5; // er12
unsigned int *v6; // rbx
int v7; // ebp
int result; // eax

if ( a2 )
{
v5 = 0;
if ( a2 > 0 )
{
do
{
printf("\n\n\nSTAND NUMERO %d.\n\n\n", (unsigned int)++v5);
printf("EMPRESA - %s.\n", (const char *)a1);
printf("PABELLON NUMERO - %d.\n", *(unsigned int *)(a1 + 32));
printf("DIAS DE ALQUILER - %d.\n", *(unsigned int *)(a1 + 36));
printf("METROS DEL STAND - %d.\n", *(unsigned int *)(a1 + 40));
printf("PRECIO - %d pts.\n\n\n", *(unsigned int *)(a1 + 44));
printf("\nPULSE UNA TECLA PARA CONTINUAR.");
getchar();
a1 += 48LL;
}
while ( v5 != a2 );
}
}
else
{
puts("\n\nNO HAY NINGUN STAND ALQUILADO.");
}
v6 = a3;
v7 = 0;
do
{
printf("\nPABELLON NUMERO %d.\n\n\n", (unsigned int)++v7);
printf("TARIFA - %d pts.\n", *v6);
printf("METROS CUADRADOS DEL PABELLON - %d.\n", v6[1]);
printf("METROS ALQUILADOS DEL PABELLON - %d.\n\n\n", v6[2]);
printf("\nPULSE UNA TECLA PARA CONTINUAR.");
result = getchar();
v6 += 3;
}
while ( v7 != 5 );
return result;
}

original_code:
void visualiza (struct stand stands [], int elementos, struct pabellon pabellones [])
{
char caracter;
int indice;
if (elementos==0)
 printf ("\n\nNO HAY NINGUN STAND ALQUILADO.\n");
else
        {
 for (indice=0; indice<elementos; indice++)
  {
  printf ("\n\n\nSTAND NUMERO %d.\n\n\n",indice+1);
  printf ("EMPRESA - %s.\n", stands [indice].nombre);
  printf ("PABELLON NUMERO - %d.\n", stands [indice].numero);
  printf ("DIAS DE ALQUILER - %d.\n", stands [indice].dias);
  printf ("METROS DEL STAND - %d.\n", stands [indice].metros_stand);
                printf ("PRECIO - %d pts.\n\n\n", stands [indice].precio);
  printf ("\nPULSE UNA TECLA PARA CONTINUAR.");
  caracter=getchar ();
                }
 }
for (indice=0; indice<5; indice++)
 {
 printf ("\nPABELLON NUMERO %d.\n\n\n", indice+1);
 printf ("TARIFA - %d pts.\n", pabellones [indice].tarifa);
 printf ("METROS CUADRADOS DEL PABELLON - %d.\n", pabellones [indice].metros_pabellon);
 printf ("METROS ALQUILADOS DEL PABELLON - %d.\n\n\n", pabellones [indice].metros_alquilados);
 printf ("\nPULSE UNA TECLA PARA CONTINUAR.");
 caracter=getchar ();
        }
}

canonical_original_code:
void visualiza(struct stand stands[], int elementos, struct pabellon pabellones[])
{
char caracter;
int indice;
if (elementos==0)
 printf ("\n\nNO HAY NINGUN STAND ALQUILADO.\n");
else
        {
 for (indice=0; indice<elementos; indice++)
  {
  printf ("\n\n\nSTAND NUMERO %d.\n\n\n",indice+1);
  printf ("EMPRESA - %s.\n", stands [indice].nombre);
  printf ("PABELLON NUMERO - %d.\n", stands [indice].numero);
  printf ("DIAS DE ALQUILER - %d.\n", stands [indice].dias);
  printf ("METROS DEL STAND - %d.\n", stands [indice].metros_stand);
                printf ("PRECIO - %d pts.\n\n\n", stands [indice].precio);
  printf ("\nPULSE UNA TECLA PARA CONTINUAR.");
  caracter=getchar ();
                }
 }
for (indice=0; indice<5; indice++)
 {
 printf ("\nPABELLON NUMERO %d.\n\n\n", indice+1);
 printf ("TARIFA - %d pts.\n", pabellones [indice].tarifa);
 printf ("METROS CUADRADOS DEL PABELLON - %d.\n", pabellones [indice].metros_pabellon);
 printf ("METROS ALQUILADOS DEL PABELLON - %d.\n\n\n", pabellones [indice].metros_alquilados);
 printf ("\nPULSE UNA TECLA PARA CONTINUAR.");
 caracter=getchar ();
        }
}

variable_types: elementos int


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
char *v3; // rbx
unsigned int *v4; // rsi
unsigned int v6; // [rsp+8h] [rbp-60h] BYREF
int v7; // [rsp+Ch] [rbp-5Ch] BYREF
unsigned int v8[15]; // [rsp+10h] [rbp-58h] BYREF
char v9; // [rsp+4Ch] [rbp-1Ch] BYREF

v6 = 0;
v3 = (char *)v8;
do
{
printf("TARIFA DEL PABELLON (EN PTAS/M2) --->");
__isoc99_scanf();
printf("METROS CUADRADOS DEL PABELLON --->");
__isoc99_scanf();
printf("METROS ALQUILADOS --->");
v4 = (unsigned int *)(v3 + 8);
__isoc99_scanf();
v3 += 12;
}
while ( v3 != &v9 );
do
{
while ( 1 )
{
opciones(&v7);
if ( v7 == 3 )
{
modifica_tarifa(v8, v4);
goto LABEL_7;
}
if ( v7 > 3 )
break;
if ( v7 == 1 )
{
v4 = &v6;
add_stand((__int64)&stands_0, (int *)&v6, (__int64)v8);
goto LABEL_7;
}
if ( v7 == 2 )
{
v4 = &v6;
elimina((__int64)&stands_0, (int *)&v6, (__int64)v8);
goto LABEL_7;
}
}
if ( v7 == 4 )
{
v4 = (unsigned int *)v6;
visualiza((__int64)&stands_0, v6, v8);
}
LABEL_7:
;
}
while ( v7 != 5 );
return printf("FIN DEL PROGRAMA");
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
char *v3; // rbx
unsigned int *v4; // rsi
unsigned int v6; // [rsp+8h] [rbp-60h] BYREF
int v7; // [rsp+Ch] [rbp-5Ch] BYREF
unsigned int v8[15]; // [rsp+10h] [rbp-58h] BYREF
char v9; // [rsp+4Ch] [rbp-1Ch] BYREF

v6 = 0;
v3 = (char *)v8;
do
{
printf("TARIFA DEL PABELLON (EN PTAS/M2) --->");
__isoc99_scanf();
printf("METROS CUADRADOS DEL PABELLON --->");
__isoc99_scanf();
printf("METROS ALQUILADOS --->");
v4 = (unsigned int *)(v3 + 8);
__isoc99_scanf();
v3 += 12;
}
while ( v3 != &v9 );
do
{
while ( 1 )
{
func10(&v7);
if ( v7 == 3 )
{
func11(v8, v4);
goto LABEL_7;
}
if ( v7 > 3 )
break;
if ( v7 == 1 )
{
v4 = &v6;
func8((__int64)&stands_0, (int *)&v6, (__int64)v8);
goto LABEL_7;
}
if ( v7 == 2 )
{
v4 = &v6;
func7((__int64)&stands_0, (int *)&v6, (__int64)v8);
goto LABEL_7;
}
}
if ( v7 == 4 )
{
v4 = (unsigned int *)v6;
func9((__int64)&stands_0, v6, v8);
}
LABEL_7:
;
}
while ( v7 != 5 );
return printf("FIN DEL PROGRAMA");
}

original_code:
void main (void)
{
static struct stand stands [100];
struct pabellon pabellones [5];
int indice, opcion, elementos=0;
for (indice=0; indice<5; indice++)
 {
 printf ("TARIFA DEL PABELLON (EN PTAS/M2) --->");
 scanf ("%d", &pabellones [indice].tarifa);
 printf ("METROS CUADRADOS DEL PABELLON --->");
 scanf ("%d", &pabellones [indice].metros_pabellon);
 printf ("METROS ALQUILADOS --->");
 scanf ("%d", &pabellones [indice].metros_alquilados);
 }
do
 {
 opciones (&opcion);
 switch (opcion)
  {
  case 1:
   add_stand (stands, &elementos, pabellones);
   break;
  case 2:
   elimina (stands, &elementos, pabellones);
                        break;
  case 3:
   modifica_tarifa (pabellones);
                        break;
  case 4:
   visualiza (stands, elementos, pabellones);
                        break;
  }
 }
while (opcion!=5);
printf ("FIN DEL PROGRAMA");
}

canonical_original_code:
void main()
{
static struct stand stands[100];
struct pabellon pabellones[5];
int indice; int opcion; int elementos = 0;
for (indice=0; indice<5; indice++)
 {
 printf ("TARIFA DEL PABELLON (EN PTAS/M2) --->");
 scanf ("%d", &pabellones [indice].tarifa);
 printf ("METROS CUADRADOS DEL PABELLON --->");
 scanf ("%d", &pabellones [indice].metros_pabellon);
 printf ("METROS ALQUILADOS --->");
 scanf ("%d", &pabellones [indice].metros_alquilados);
 }
do
 {
 opciones (&opcion);
 switch (opcion)
  {
  case 1:
   add_stand (stands, &elementos, pabellones);
   break;
  case 2:
   elimina (stands, &elementos, pabellones);
                        break;
  case 3:
   modifica_tarifa (pabellones);
                        break;
  case 4:
   visualiza (stands, elementos, pabellones);
                        break;
  }
 }
while (opcion!=5);
printf ("FIN DEL PROGRAMA");
}

variable_types: struct stand { char nombre[30]; int numero; int dias; int metros_stand; int precio; } [100]

variable_types: struct pabellon { int tarifa; int metros_pabellon; int metros_alquilados; } [5]

variable_types: opcion int


imprimir

decompiled_code:
int __fastcall imprimir(unsigned int *a1)
{
unsigned int *v1; // rbx

v1 = a1;
do
printf("%3d", *v1++);
while ( v1 != a1 + 20 );
return putchar(10);
}

canonical_decompiled_code:
int __fastcall func7(unsigned int *a1)
{
unsigned int *v1; // rbx

v1 = a1;
do
printf("%3d", *v1++);
while ( v1 != a1 + 20 );
return putchar(10);
}

original_code:
void imprimir(int* elemento) {
  int i;
  for (i = 0; i < 20; i++) {
    printf("%3d", elemento[i]);
  }
  printf("\n");
}

canonical_original_code:
void imprimir(int *elemento) {
  int i;
  for (i = 0; i < 20; i++) {
    printf("%3d", elemento[i]);
  }
  printf("\n");
}

variable_types:
elemento
int *

variable_types: i int


quicksort

original_code:
int quicksort(int* elemento, int principio, int final) {
  int auxiliar, banderin, medio;
  banderin = 1;
  medio = principio;
  while (principio < final) {
    if (banderin) {
      while (elemento[medio] <= elemento[final]
        && medio < final) {
        final = final - 1;
      }
      if (medio < final) {
        auxiliar = elemento[medio];
        elemento[medio] = elemento[final];
        elemento[final] = auxiliar;
        medio = final;
      }
      banderin = 0;
    } else {
      while (elemento[principio] <= elemento[medio]
        && principio < medio) {
        principio = principio + 1;
      }
      if (principio < medio) {
        auxiliar = elemento[medio];
        elemento[medio] = elemento[principio];
        elemento[principio] = auxiliar;
        medio = principio;
      }
      banderin = 1;
    }
  }
  return medio;
}

canonical_original_code:
int quicksort(int *elemento, int principio, int final) {
  int auxiliar; int banderin; int medio;
  banderin = 1;
  medio = principio;
  while (principio < final) {
    if (banderin) {
      while (elemento[medio] <= elemento[final]
        && medio < final) {
        final = final - 1;
      }
      if (medio < final) {
        auxiliar = elemento[medio];
        elemento[medio] = elemento[final];
        elemento[final] = auxiliar;
        medio = final;
      }
      banderin = 0;
    } else {
      while (elemento[principio] <= elemento[medio]
        && principio < medio) {
        principio = principio + 1;
      }
      if (principio < medio) {
        auxiliar = elemento[medio];
        elemento[medio] = elemento[principio];
        elemento[principio] = auxiliar;
        medio = principio;
      }
      banderin = 1;
    }
  }
  return medio;
}

variable_types: auxiliar int

variable_types: banderin int

variable_types: medio int


burbuja

original_code:
void burbuja(int* elemento, int principio, int final) {
  int contador, indice;
  int auxiliar;
  int sinCambio;
  for (contador = principio; contador < final; contador++) {
    sinCambio = 1;
    for (indice = principio; indice < final - contador; indice++) {
      if (elemento[indice] > elemento[indice + 1]) {
        auxiliar = elemento[indice];
        elemento[indice] = elemento[indice + 1];
        elemento[indice + 1] = auxiliar;
        sinCambio = 0;
      }
    }
    if (sinCambio) {
      break;
    }
  }
}

canonical_original_code:
void burbuja(int *elemento, int principio, int final) {
  int contador; int indice;
  int auxiliar;
  int sinCambio;
  for (contador = principio; contador < final; contador++) {
    sinCambio = 1;
    for (indice = principio; indice < final - contador; indice++) {
      if (elemento[indice] > elemento[indice + 1]) {
        auxiliar = elemento[indice];
        elemento[indice] = elemento[indice + 1];
        elemento[indice + 1] = auxiliar;
        sinCambio = 0;
      }
    }
    if (sinCambio) {
      break;
    }
  }
}

variable_types: contador int

variable_types: indice int

variable_types: sinCambio int


inic

decompiled_code:
char *__fastcall inic(char *a1)
{
char *v1; // rax
const char *v2; // rsi

if ( *a1 == 32 )
{
v1 = a1 + 1;
do
v2 = v1++;
while ( *(v1 - 1) == 32 );
}
else
{
v2 = a1;
}
return strcpy(a1, v2);
}

canonical_decompiled_code:
char *__fastcall func8(char *a1)
{
char *v1; // rax
const char *v2; // rsi

if ( *a1 == 32 )
{
v1 = a1 + 1;
do
v2 = v1++;
while ( *(v1 - 1) == 32 );
}
else
{
v2 = a1;
}
return strcpy(a1, v2);
}

original_code:
void inic(char cadena[]) {
  int indice = 0;
  while (cadena[indice] == ' ') {
    indice++;
  }
  strcpy(&cadena[0], &cadena[indice]);
}

variable_types:
cadena
char []


fin

decompiled_code:
size_t __fastcall fin(const char *a1)
{
size_t result; // rax
size_t v2; // rdx

result = strlen(a1);
v2 = (int)result;
if ( a1[(int)result - 1] == 32 )
{
result = (int)result - 1;
do
v2 = result--;
while ( a1[result] == 32 );
}
a1[v2] = 0;
return result;
}

canonical_decompiled_code:
size_t __fastcall func9(const char *a1)
{
size_t result; // rax
size_t v2; // rdx

result = strlen(a1);
v2 = (int)result;
if ( a1[(int)result - 1] == 32 )
{
result = (int)result - 1;
do
v2 = result--;
while ( a1[result] == 32 );
}
a1[v2] = 0;
return result;
}

original_code:
void fin(char cadena[]) {
  int indice ;
  indice = strlen(cadena);
  while(cadena[indice - 1] == ' ') {
    indice--;
  }
  cadena[indice] = '\0';
}

canonical_original_code:
void fin(char cadena[]) {
  int indice;
  indice = strlen(cadena);
  while(cadena[indice - 1] == ' ') {
    indice--;
  }
  cadena[indice] = '\0';
}


inter

original_code:
void inter(char cadena[]) {
  int indice_1, indice_2;
  for (indice_1 = 0; cadena[indice_1] != '\0'; indice_1++) {
   for (indice_2 = indice_1; cadena[indice_2] == ' '; indice_2++) {
      ;
    }
   if (indice_2 != indice_1) {
    strcpy(&cadena [indice_1], &cadena [indice_2 - 1]);
   }
  }
}

canonical_original_code:
void inter(char cadena[]) {
  int indice_1; int indice_2;
  for (indice_1 = 0; cadena[indice_1] != '\0'; indice_1++) {
   for (indice_2 = indice_1; cadena[indice_2] == ' '; indice_2++) {
      ;
    }
   if (indice_2 != indice_1) {
    strcpy(&cadena [indice_1], &cadena [indice_2 - 1]);
   }
  }
}


contar

decompiled_code:
__int64 __fastcall contar(char *a1)
{
char v1; // al
char *v2; // rdi
int v3; // edx

v1 = *a1;
if ( *a1 )
{
v2 = a1 + 1;
v3 = 0;
do
{
v3 += v1 == 32;
v1 = *v2++;
}
while ( v1 );
}
else
{
v3 = 0;
}
return (unsigned int)(v3 + 1);
}

canonical_decompiled_code:
__int64 __fastcall func11(char *a1)
{
char v1; // al
char *v2; // rdi
int v3; // edx

v1 = *a1;
if ( *a1 )
{
v2 = a1 + 1;
v3 = 0;
do
{
v3 += v1 == 32;
v1 = *v2++;
}
while ( v1 );
}
else
{
v3 = 0;
}
return (unsigned int)(v3 + 1);
}

original_code:
int contar(char cadena []) {
  int palabras = 0, indice;
  for (indice = 0; cadena[indice] != '\0'; indice++) {
   if (cadena [indice] == ' ') {
      palabras ++;
    }
  }
  return (palabras+1);
}

canonical_original_code:
int contar(char cadena[]) {
  int palabras = 0; int indice;
  for (indice = 0; cadena[indice] != '\0'; indice++) {
   if (cadena [indice] == ' ') {
      palabras ++;
    }
  }
  return (palabras+1);
}

variable_types: palabras int


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int v3; // eax
char v5[120]; // [rsp+0h] [rbp-78h] BYREF

introduce(v5);
inic(v5);
fin(v5);
inter(v5);
puts(v5);
v3 = contar(v5);
return printf("\nLA CADENA TIENE %d PALABRAS", v3);
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int v3; // eax
char v5[120]; // [rsp+0h] [rbp-78h] BYREF

func7(v5);
func8(v5);
func9(v5);
func10(v5);
puts(v5);
v3 = func11(v5);
return printf("\nLA CADENA TIENE %d PALABRAS", v3);
}

original_code:
void main(void) {
  char cadena[100];
  introduce(cadena);
  inic(cadena);
  fin(cadena);
  inter(cadena);
  puts(cadena);
  printf("\nLA CADENA TIENE %d PALABRAS", contar(cadena));
}

canonical_original_code:
void main() {
  char cadena[100];
  introduce(cadena);
  inic(cadena);
  fin(cadena);
  inter(cadena);
  puts(cadena);
  printf("\nLA CADENA TIENE %d PALABRAS", contar(cadena));
}

variable_types:
cadena
char [100]


media

decompiled_code:
float __fastcall media(int *a1, int a2)
{
int *v2; // rax
float v3; // xmm0_4

if ( a2 <= 0 )
{
v3 = 0.0;
}
else
{
v2 = a1;
v3 = 0.0;
do
v3 = v3 + (float)*v2++;
while ( v2 != &a1[a2 - 1 + 1] );
}
printf("\nLA MEDIA ES %.3f", (float)(v3 / (float)a2));
return v3 / (float)a2;
}

canonical_decompiled_code:
float __fastcall func0(int *a1, int a2)
{
int *v2; // rax
float v3; // xmm0_4

if ( a2 <= 0 )
{
v3 = 0.0;
}
else
{
v2 = a1;
v3 = 0.0;
do
v3 = v3 + (float)*v2++;
while ( v2 != &a1[a2 - 1 + 1] );
}
printf("\nLA MEDIA ES %.3f", (float)(v3 / (float)a2));
return v3 / (float)a2;
}

original_code:
float media (int array [50],int elementos)
{
float media=0;
int ind;
for (ind=0; ind<elementos; ind++)
 media=array [ind] + media;
media=media/elementos;
printf ("\nLA MEDIA ES %.3f",media);
return (media);
}

canonical_original_code:
float media(int array[50], int elementos)
{
float media = 0;
int ind;
for (ind=0; ind<elementos; ind++)
 media=array [ind] + media;
media=media/elementos;
printf ("\nLA MEDIA ES %.3f",media);
return (media);
}

variable_types:
array
int [50]

variable_types: media float

variable_types: ind int


moda

decompiled_code:
int __fastcall moda(_DWORD *a1, int a2)
{
_DWORD *v2; // rbp
__int64 v3; // rdx
__int64 v4; // rbx
__int64 i; // rsi
_DWORD *v6; // rax
int v7; // ecx
__int64 v8; // rax
int v9; // er13
int result; // eax
__int64 j; // r12

if ( a2 <= 0 )
return puts("\n\nEL/LOS NUMERO/S QUE MAS SE REPITE/N ES/SON:");
v2 = a1;
v3 = (__int64)&a1[a2 - 1 + 1];
v4 = (unsigned int)a2;
for ( i = 0LL; i != v4; ++i )
{
v7 = *a1;
v6 = a1;
do
{
if ( v7 == *v6 )
++contador_0[i];
++v6;
}
while ( v6 != (_DWORD *)v3 );
++a1;
v3 += 4LL;
}
v8 = 0LL;
v9 = 0;
do
{
if ( v9 < contador_0[v8] )
v9 = contador_0[v8];
++v8;
}
while ( v8 != v4 );
result = puts("\n\nEL/LOS NUMERO/S QUE MAS SE REPITE/N ES/SON:");
for ( j = 0LL; j != v4; ++j )
{
if ( contador_0[j] == v9 )
result = printf(" %d ", (unsigned int)v2[j]);
}
return result;
}

canonical_decompiled_code:
int __fastcall func1(_DWORD *a1, int a2)
{
_DWORD *v2; // rbp
__int64 v3; // rdx
__int64 v4; // rbx
__int64 i; // rsi
_DWORD *v6; // rax
int v7; // ecx
__int64 v8; // rax
int v9; // er13
int result; // eax
__int64 j; // r12

if ( a2 <= 0 )
return puts("\n\nEL/LOS NUMERO/S QUE MAS SE REPITE/N ES/SON:");
v2 = a1;
v3 = (__int64)&a1[a2 - 1 + 1];
v4 = (unsigned int)a2;
for ( i = 0LL; i != v4; ++i )
{
v7 = *a1;
v6 = a1;
do
{
if ( v7 == *v6 )
++contador_0[i];
++v6;
}
while ( v6 != (_DWORD *)v3 );
++a1;
v3 += 4LL;
}
v8 = 0LL;
v9 = 0;
do
{
if ( v9 < contador_0[v8] )
v9 = contador_0[v8];
++v8;
}
while ( v8 != v4 );
result = puts("\n\nEL/LOS NUMERO/S QUE MAS SE REPITE/N ES/SON:");
for ( j = 0LL; j != v4; ++j )
{
if ( contador_0[j] == v9 )
result = printf(" %d ", (unsigned int)v2[j]);
}
return result;
}

original_code:
void moda (int array [], int elementos)
{
static int contador [50];
int indi, cuenta, maximo;
for (indi=0; indi<elementos; indi++)
 {
 for (cuenta=0; cuenta<elementos; cuenta++)
  {
  if (array [indi]==array [indi+cuenta])
   contador [indi]++;
  }
 }
for (indi=0, maximo=0;indi<elementos; indi++)
 {
 if (contador [indi]>maximo)
  maximo=contador [indi];
 }
printf ("\n\nEL/LOS NUMERO/S QUE MAS SE REPITE/N ES/SON:\n");
for (indi=0; indi<elementos; indi++)
 {
 if (contador [indi]== maximo)
  printf (" %d ", array [indi]);
 }
}

canonical_original_code:
void moda(int array[], int elementos)
{
static int contador[50];
int indi; int cuenta; int maximo;
for (indi=0; indi<elementos; indi++)
 {
 for (cuenta=0; cuenta<elementos; cuenta++)
  {
  if (array [indi]==array [indi+cuenta])
   contador [indi]++;
  }
 }
for (indi=0, maximo=0;indi<elementos; indi++)
 {
 if (contador [indi]>maximo)
  maximo=contador [indi];
 }
printf ("\n\nEL/LOS NUMERO/S QUE MAS SE REPITE/N ES/SON:\n");
for (indi=0; indi<elementos; indi++)
 {
 if (contador [indi]== maximo)
  printf (" %d ", array [indi]);
 }
}

variable_types:
array
int []

variable_types: elementos int

variable_types:
contador
int [50]

variable_types: indi int

variable_types: cuenta int

variable_types: maximo int


desviacion

decompiled_code:
int __fastcall desviacion(_DWORD *a1, int a2, int a3)
{
_DWORD *v4; // rax
float v5; // xmm1_4
double v6; // xmm1_8
float v7; // xmm1_4

if ( a3 <= 0 )
{
v6 = 0.0;
}
else
{
v4 = a1;
v5 = 0.0;
do
{
v5 = v5 + (float)((float)(a2 - *v4) * (float)(a2 - *v4));
++v4;
}
while ( v4 != &a1[a3 - 1 + 1] );
v6 = v5;
if ( v6 < 0.0 )
{
sqrt(v6);
goto LABEL_6;
}
}
v6 = sqrt(v6);
LABEL_6:
v7 = v6 / (double)a3;
return printf("\n\nLA DESVIACION TIPICA ES : %.3f", v7);
}

canonical_decompiled_code:
int __fastcall func2(_DWORD *a1, int a2, int a3)
{
_DWORD *v4; // rax
float v5; // xmm1_4
double v6; // xmm1_8
float v7; // xmm1_4

if ( a3 <= 0 )
{
v6 = 0.0;
}
else
{
v4 = a1;
v5 = 0.0;
do
{
v5 = v5 + (float)((float)(a2 - *v4) * (float)(a2 - *v4));
++v4;
}
while ( v4 != &a1[a3 - 1 + 1] );
v6 = v5;
if ( v6 < 0.0 )
{
sqrt(v6);
goto LABEL_6;
}
}
v6 = sqrt(v6);
LABEL_6:
v7 = v6 / (double)a3;
return printf("\n\nLA DESVIACION TIPICA ES : %.3f", v7);
}

original_code:
void desviacion (int array [],int num1, int elementos)
{
float potencia, suma, desviacion;
int indi;
for (indi=0, suma=0; indi<elementos; indi++)
    {
 potencia= num1 - array [indi];
 potencia=potencia*potencia;
 suma=suma+potencia;
 }
desviacion= sqrt (suma)/elementos;
printf ("\n\nLA DESVIACION TIPICA ES : %.3f",desviacion);
}

canonical_original_code:
void desviacion(int array[], int num1, int elementos)
{
float potencia; float suma; float desviacion;
int indi;
for (indi=0, suma=0; indi<elementos; indi++)
    {
 potencia= num1 - array [indi];
 potencia=potencia*potencia;
 suma=suma+potencia;
 }
desviacion= sqrt (suma)/elementos;
printf ("\n\nLA DESVIACION TIPICA ES : %.3f",desviacion);
}

variable_types: potencia float

variable_types: suma float

variable_types: desviacion float


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // esi
int *v4; // rbp
int i; // ebx
float v7; // [rsp+Ch] [rbp-FCh]
int v8; // [rsp+1Ch] [rbp-ECh] BYREF
int v9[58]; // [rsp+20h] [rbp-E8h] BYREF

do
{
printf("NUMERO DE ELEMENTOS (MAXIMO %d) --->", 50LL);
_isoc99_scanf("%d", &v8);
}
while ( v8 > 50 );
puts("\nINTRODUZCA LOS ELEMENTOS.");
v3 = v8;
if ( v8 > 0 )
{
v4 = v9;
for ( i = 0; i < v8; ++i )
{
_isoc99_scanf("%d", v4);
v3 = v8;
++v4;
}
}
v7 = media(v9, v3);
moda(v9, v8);
return desviacion(v9, (int)v7, v8);
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // esi
int *v4; // rbp
int i; // ebx
float v7; // [rsp+Ch] [rbp-FCh]
int v8; // [rsp+1Ch] [rbp-ECh] BYREF
int v9[58]; // [rsp+20h] [rbp-E8h] BYREF

do
{
printf("NUMERO DE ELEMENTOS (MAXIMO %d) --->", 50LL);
_isoc99_scanf("%d", &v8);
}
while ( v8 > 50 );
puts("\nINTRODUZCA LOS ELEMENTOS.");
v3 = v8;
if ( v8 > 0 )
{
v4 = v9;
for ( i = 0; i < v8; ++i )
{
_isoc99_scanf("%d", v4);
v3 = v8;
++v4;
}
}
v7 = func0(v9, v3);
func1(v9, v8);
return func2(v9, (int)v7, v8);
}

original_code:
void main (void)
{
int array [50];
int elementos;
float num1;
int indice;
do
 {
 printf ("NUMERO DE ELEMENTOS (MAXIMO %d) --->",50);
 scanf ("%d",&elementos);
        }
while (elementos>50);
printf ("\nINTRODUZCA LOS ELEMENTOS.\n");
for (indice=0; indice<elementos; indice++)
 scanf ("%d",&array [indice]);
num1= media (array,elementos);
moda (array, elementos);
desviacion (array, num1, elementos);
}

canonical_original_code:
void main()
{
int array[50];
int elementos;
float num1;
int indice;
do
 {
 printf ("NUMERO DE ELEMENTOS (MAXIMO %d) --->",50);
 scanf ("%d",&elementos);
        }
while (elementos>50);
printf ("\nINTRODUZCA LOS ELEMENTOS.\n");
for (indice=0; indice<elementos; indice++)
 scanf ("%d",&array [indice]);
num1= media (array,elementos);
moda (array, elementos);
desviacion (array, num1, elementos);
}

variable_types: indice int


mostrar

decompiled_code:
int mostrar()
{
return printf("Mostrar valor: %d", (unsigned int)valor);
}

canonical_decompiled_code:
int func7()
{
return printf("Mostrar valor: %d", (unsigned int)valor);
}

original_code:
void mostrar() {
  extern int valor;
  printf("Mostrar valor: %d", valor);
}

variable_types: valor int


decompiled_code:
int incrementar_valor()
{
return printf("\nEl numero es: %d", (unsigned int)++numero);
}

canonical_decompiled_code:
int func8()
{
return printf("\nEl numero es: %d", (unsigned int)++numero);
}

original_code:
void incrementar_valor() {
  extern int numero;
  printf("\nEl numero es: %d", ++numero);
}

variable_types: numero int


decompiled_code:
int doblar_valor()
{
numero *= 2;
return printf("\nEl numero es: %d", (unsigned int)numero);
}

canonical_decompiled_code:
int func9()
{
numero *= 2;
return printf("\nEl numero es: %d", (unsigned int)numero);
}

original_code:
void doblar_valor() {
  extern int numero;
  numero *= 2;
  printf("\nEl numero es: %d", numero);
}


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
int result; // eax

valor = 1;
mostrar();
v3 = 10;
do
{
incrementar_valor();
result = doblar_valor();
--v3;
}
while ( v3 );
return result;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
int result; // eax

valor = 1;
func7();
v3 = 10;
do
{
func8();
result = func9();
--v3;
}
while ( v3 );
return result;
}

original_code:
void main(void) {
  int i;
  extern int valor;
  valor = 1;
  mostrar();
  for (i = 0; i < 10; i++) {
    incrementar_valor();
    doblar_valor();
  }
}

canonical_original_code:
void main() {
  int i;
  extern int valor;
  valor = 1;
  mostrar();
  for (i = 0; i < 10; i++) {
    incrementar_valor();
    doblar_valor();
  }
}

variable_types: i int


minimofil

decompiled_code:
__int64 __fastcall minimofil(__int64 a1, int a2)
{
__int64 result; // rax
int v3; // edx

result = *(unsigned int *)(a1 + 4LL * a2);
v3 = *(_DWORD *)(a1 + 4LL * a2);
if ( *(_DWORD *)(a1 + 4LL * a2 + 12) <= (int)result )
v3 = *(_DWORD *)(a1 + 4LL * a2 + 12);
if ( (int)result > v3 )
result = (unsigned int)v3;
if ( *(_DWORD *)(a1 + 4LL * a2 + 24) <= (int)result )
result = *(unsigned int *)(a1 + 4LL * a2 + 24);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, int a2)
{
__int64 result; // rax
int v3; // edx

result = *(unsigned int *)(a1 + 4LL * a2);
v3 = *(_DWORD *)(a1 + 4LL * a2);
if ( *(_DWORD *)(a1 + 4LL * a2 + 12) <= (int)result )
v3 = *(_DWORD *)(a1 + 4LL * a2 + 12);
if ( (int)result > v3 )
result = (unsigned int)v3;
if ( *(_DWORD *)(a1 + 4LL * a2 + 24) <= (int)result )
result = *(unsigned int *)(a1 + 4LL * a2 + 24);
return result;
}

original_code:
int minimofil (int array [] [3], int columnas)
{
int filas=0;
int minimo=array [filas] [columnas];
for (; filas<3; filas++)
 {
 if (minimo>array [filas] [columnas])
  minimo=array [filas] [columnas];
 }
return (minimo);
}

canonical_original_code:
int minimofil(int array[][3], int columnas)
{
int filas = 0;
int minimo = array [filas] [columnas];
for (; filas<3; filas++)
 {
 if (minimo>array [filas] [columnas])
  minimo=array [filas] [columnas];
 }
return (minimo);
}

variable_types:
array
int [][3]

variable_types: columnas int

variable_types: filas int

variable_types: minimo int


minimocol

decompiled_code:
__int64 __fastcall minimocol(__int64 a1, int a2)
{
unsigned int *v2; // rdx
__int64 result; // rax

v2 = (unsigned int *)(a1 + 12LL * a2);
result = *v2;
if ( (int)v2[1] <= (int)result )
result = v2[1];
if ( (int)v2[2] <= (int)result )
result = v2[2];
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1, int a2)
{
unsigned int *v2; // rdx
__int64 result; // rax

v2 = (unsigned int *)(a1 + 12LL * a2);
result = *v2;
if ( (int)v2[1] <= (int)result )
result = v2[1];
if ( (int)v2[2] <= (int)result )
result = v2[2];
return result;
}

original_code:
int minimocol (int array [] [3], int filas)
{
int columnas=0;
int minimo=array [filas] [columnas];
for (; columnas<3; columnas++)
 {
 if (minimo>array [filas] [columnas])
  minimo=array [filas] [columnas];
 }
return (minimo);
}

canonical_original_code:
int minimocol(int array[][3], int filas)
{
int columnas = 0;
int minimo = array [filas] [columnas];
for (; columnas<3; columnas++)
 {
 if (minimo>array [filas] [columnas])
  minimo=array [filas] [columnas];
 }
return (minimo);
}


maximofil

decompiled_code:
__int64 __fastcall maximofil(__int64 a1, int a2)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 4LL * a2 + 12);
if ( *(_DWORD *)(a1 + 4LL * a2) >= (int)result )
result = *(unsigned int *)(a1 + 4LL * a2);
if ( (int)result < 0 )
result = 0LL;
if ( *(_DWORD *)(a1 + 4LL * a2 + 24) >= (int)result )
result = *(unsigned int *)(a1 + 4LL * a2 + 24);
return result;
}

canonical_decompiled_code:
__int64 __fastcall func10(__int64 a1, int a2)
{
__int64 result; // rax

result = *(unsigned int *)(a1 + 4LL * a2 + 12);
if ( *(_DWORD *)(a1 + 4LL * a2) >= (int)result )
result = *(unsigned int *)(a1 + 4LL * a2);
if ( (int)result < 0 )
result = 0LL;
if ( *(_DWORD *)(a1 + 4LL * a2 + 24) >= (int)result )
result = *(unsigned int *)(a1 + 4LL * a2 + 24);
return result;
}

original_code:
int maximofil (int array [] [3], int columnas)
{
int filas=0;
int maximo;
for (maximo=0; filas<3; filas++)
 {
 if (maximo<array [filas] [columnas])
  maximo=array [filas] [columnas];
 }
return (maximo);
}

canonical_original_code:
int maximofil(int array[][3], int columnas)
{
int filas = 0;
int maximo;
for (maximo=0; filas<3; filas++)
 {
 if (maximo<array [filas] [columnas])
  maximo=array [filas] [columnas];
 }
return (maximo);
}


maximocol

decompiled_code:
__int64 __fastcall maximocol(__int64 a1, int a2)
{
int *v2; // rdx
__int64 result; // rax

v2 = (int *)(a1 + 12LL * a2);
result = (unsigned int)v2[1];
if ( *v2 >= (int)result )
result = (unsigned int)*v2;
if ( (int)result < 0 )
result = 0LL;
if ( v2[2] >= (int)result )
result = (unsigned int)v2[2];
return result;
}

canonical_decompiled_code:
__int64 __fastcall func11(__int64 a1, int a2)
{
int *v2; // rdx
__int64 result; // rax

v2 = (int *)(a1 + 12LL * a2);
result = (unsigned int)v2[1];
if ( *v2 >= (int)result )
result = (unsigned int)*v2;
if ( (int)result < 0 )
result = 0LL;
if ( v2[2] >= (int)result )
result = (unsigned int)v2[2];
return result;
}

original_code:
int maximocol (int array [] [3], int filas)
{
int columnas=0;
int maximo;
for (maximo=0; columnas<3; columnas++)
 {
 if (maximo<array [filas] [columnas])
  maximo=array [filas] [columnas];
 }
return (maximo);
}

canonical_original_code:
int maximocol(int array[][3], int filas)
{
int columnas = 0;
int maximo;
for (maximo=0; columnas<3; columnas++)
 {
 if (maximo<array [filas] [columnas])
  maximo=array [filas] [columnas];
 }
return (maximo);
}


decompiled_code:
int __fastcall introduce_array(unsigned int *a1)
{
unsigned int *v1; // rbp
unsigned int *v2; // r12
unsigned int *v3; // rbx
unsigned int *v4; // rbx
int result; // eax

v1 = a1;
v2 = a1 + 9;
v3 = a1;
do
{
__isoc99_scanf();
__isoc99_scanf();
__isoc99_scanf();
v3 += 3;
}
while ( v3 != v2 );
do
{
putchar(10);
v4 = v1;
v1 += 3;
do
result = printf("%4d", *v4++);
while ( v4 != v1 );
}
while ( v1 != v2 );
return result;
}

canonical_decompiled_code:
int __fastcall func7(unsigned int *a1)
{
unsigned int *v1; // rbp
unsigned int *v2; // r12
unsigned int *v3; // rbx
unsigned int *v4; // rbx
int result; // eax

v1 = a1;
v2 = a1 + 9;
v3 = a1;
do
{
__isoc99_scanf();
__isoc99_scanf();
__isoc99_scanf();
v3 += 3;
}
while ( v3 != v2 );
do
{
putchar(10);
v4 = v1;
v1 += 3;
do
result = printf("%4d", *v4++);
while ( v4 != v1 );
}
while ( v1 != v2 );
return result;
}

original_code:
void introduce_array (int array [] [3])
{
int filas, columnas;
for (filas=0;filas<3;filas++)
 {
 for (columnas=0;columnas<3;columnas++)
  scanf ("%d",*(array+filas)+columnas);
        }
for (filas=0;filas<3;filas++)
 {
        printf ("\n");
 for (columnas=0;columnas<3;columnas++)
  printf ("%4d",*(*(array+filas)+columnas));
        }
}

canonical_original_code:
void introduce_array(int array[][3])
{
int filas; int columnas;
for (filas=0;filas<3;filas++)
 {
 for (columnas=0;columnas<3;columnas++)
  scanf ("%d",*(array+filas)+columnas);
        }
for (filas=0;filas<3;filas++)
 {
        printf ("\n");
 for (columnas=0;columnas<3;columnas++)
  printf ("%4d",*(*(array+filas)+columnas));
        }
}


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int *v3; // r14
unsigned int i; // er12
unsigned int v5; // er13
int result; // eax
unsigned int j; // ebx
unsigned int *v8; // rbp
unsigned int v9; // er13
unsigned int v10[26]; // [rsp+0h] [rbp-68h] BYREF

introduce_array(v10);
puts("\n\n");
v3 = v10;
for ( i = 0; i != 3; ++i )
{
v8 = v3;
for ( j = 0; j != 3; ++j )
{
v9 = *v8;
if ( v9 == (unsigned int)maximocol((__int64)v10, i) && v9 == (unsigned int)minimofil((__int64)v10, j) )
printf("\nFILA %d COLUMNA %d ES PUNTO DE SILLA", i, j);
v5 = *v8;
result = maximofil((__int64)v10, j);
if ( v5 == result )
{
result = minimocol((__int64)v10, i);
if ( v5 == result )
result = printf("\nFILA %d COLUMNA %d ES PUNTO DE SILLA", i, j);
}
++v8;
}
v3 += 3;
}
return result;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int *v3; // r14
unsigned int i; // er12
unsigned int v5; // er13
int result; // eax
unsigned int j; // ebx
unsigned int *v8; // rbp
unsigned int v9; // er13
unsigned int v10[26]; // [rsp+0h] [rbp-68h] BYREF

func7(v10);
puts("\n\n");
v3 = v10;
for ( i = 0; i != 3; ++i )
{
v8 = v3;
for ( j = 0; j != 3; ++j )
{
v9 = *v8;
if ( v9 == (unsigned int)func11((__int64)v10, i) && v9 == (unsigned int)func8((__int64)v10, j) )
printf("\nFILA %d COLUMNA %d ES PUNTO DE SILLA", i, j);
v5 = *v8;
result = func10((__int64)v10, j);
if ( v5 == result )
{
result = func9((__int64)v10, i);
if ( v5 == result )
result = printf("\nFILA %d COLUMNA %d ES PUNTO DE SILLA", i, j);
}
++v8;
}
v3 += 3;
}
return result;
}

original_code:
void main (void)
{
int filas, columnas;
int array [3] [3];
introduce_array (array);
printf ("\n\n\n");
for (filas=0; filas<3; filas++)
 for (columnas=0; columnas<3; columnas++)
                {
  if (array [filas] [columnas]==maximocol (array, filas) &&
   array [filas] [columnas]==minimofil (array,columnas))
   printf ("\nFILA %d  COLUMNA %d  ES PUNTO DE SILLA",filas,columnas);
  if (array [filas] [columnas]==maximofil (array, columnas) &&
   array [filas] [columnas]==minimocol (array,filas))
   printf ("\nFILA %d  COLUMNA %d  ES PUNTO DE SILLA",filas,columnas);
                }
}

canonical_original_code:
void main()
{
int filas; int columnas;
int array[3][3];
introduce_array (array);
printf ("\n\n\n");
for (filas=0; filas<3; filas++)
 for (columnas=0; columnas<3; columnas++)
                {
  if (array [filas] [columnas]==maximocol (array, filas) &&
   array [filas] [columnas]==minimofil (array,columnas))
   printf ("\nFILA %d  COLUMNA %d  ES PUNTO DE SILLA",filas,columnas);
  if (array [filas] [columnas]==maximofil (array, columnas) &&
   array [filas] [columnas]==minimocol (array,filas))
   printf ("\nFILA %d  COLUMNA %d  ES PUNTO DE SILLA",filas,columnas);
                }
}

variable_types:
array
int [3][3]


decompiled_code:
void *nuevo_elemento()
{
void *v0; // rbx

v0 = malloc(0x48uLL);
printf("\nMARCA --->");
__isoc99_scanf();
__isoc99_scanf();
printf("\nMODELO --->");
__isoc99_scanf();
__isoc99_scanf();
printf("\nPRECIO --->");
__isoc99_scanf();
__isoc99_scanf();
return v0;
}

canonical_decompiled_code:
void *func7()
{
void *v0; // rbx

v0 = malloc(0x48uLL);
printf("\nMARCA --->");
__isoc99_scanf();
__isoc99_scanf();
printf("\nMODELO --->");
__isoc99_scanf();
__isoc99_scanf();
printf("\nPRECIO --->");
__isoc99_scanf();
__isoc99_scanf();
return v0;
}

original_code:
struct nodo *nuevo_elemento(void) {
  char tmp;
  struct nodo *nuevo;
  nuevo = (struct nodo *) malloc(sizeof(struct nodo));
  printf("\nMARCA --->");
  scanf("%s", nuevo->info.marca);
  scanf("%c", &tmp);
  printf("\nMODELO --->");
  scanf("%s", nuevo->info.modelo);
  scanf("%c", &tmp);
  printf("\nPRECIO --->");
  scanf("%f", &(nuevo->info.precio));
  scanf("%c", &tmp);
  return(nuevo);
}

canonical_original_code:
struct nodo *nuevo_elemento() {
  char tmp;
  struct nodo *nuevo;
  nuevo = (struct nodo *) malloc(sizeof(struct nodo));
  printf("\nMARCA --->");
  scanf("%s", nuevo->info.marca);
  scanf("%c", &tmp);
  printf("\nMODELO --->");
  scanf("%s", nuevo->info.modelo);
  scanf("%c", &tmp);
  printf("\nPRECIO --->");
  scanf("%f", &(nuevo->info.precio));
  scanf("%c", &tmp);
  return(nuevo);
}

variable_types: tmp char

variable_types: struct nodo { struct informacion { char marca[30]; char modelo[30]; float precio; } info; struct nodo *enlace; } *

user_defined_types: struct nodo { struct informacion info; struct nodo *enlace; }


compara

decompiled_code:
float __fastcall compara(__int64 a1, __int64 a2)
{
__int64 v2; // rax
float v3; // xmm1_4
float result; // xmm0_4

v2 = a2;
if ( a2 )
{
v3 = *(float *)(a1 + 60);
if ( v3 <= *(float *)(a2 + 60) )
{
while ( 1 )
{
result = *(float *)(v2 + 60);
if ( result <= v3 || !*(_QWORD *)(v2 + 64) )
break;
v2 = *(_QWORD *)(v2 + 64);
}
}
}
return result;
}

canonical_decompiled_code:
float __fastcall func8(__int64 a1, __int64 a2)
{
__int64 v2; // rax
float v3; // xmm1_4
float result; // xmm0_4

v2 = a2;
if ( a2 )
{
v3 = *(float *)(a1 + 60);
if ( v3 <= *(float *)(a2 + 60) )
{
while ( 1 )
{
result = *(float *)(v2 + 60);
if ( result <= v3 || !*(_QWORD *)(v2 + 64) )
break;
v2 = *(_QWORD *)(v2 + 64);
}
}
}
return result;
}

original_code:
struct nodo *compara(struct nodo *nuevo, struct nodo *cabeza) {
  struct nodo *anterior, *recorre;
  if (cabeza == (struct nodo *) ((void *)0)) {
    anterior = cabeza;
  } else {
   if (cabeza->info.precio < nuevo->info.precio) {
    anterior = cabeza;
   } else {
    recorre = cabeza;
      while (recorre != (struct nodo *)((void *)0)
          && (recorre->info.precio > nuevo->info.precio)) {
        anterior = recorre;
     recorre = recorre->enlace;
      }
      if (recorre != (struct nodo *)((void *)0)) {
     anterior = recorre;
    }
    }
  }
  return (anterior);
}

canonical_original_code:
struct nodo *compara(struct nodo *nuevo, struct nodo *cabeza) {
  struct nodo *anterior; struct nodo *recorre;
  if (cabeza == (struct nodo *) ((void *)0)) {
    anterior = cabeza;
  } else {
   if (cabeza->info.precio < nuevo->info.precio) {
    anterior = cabeza;
   } else {
    recorre = cabeza;
      while (recorre != (struct nodo *)((void *)0)
          && (recorre->info.precio > nuevo->info.precio)) {
        anterior = recorre;
     recorre = recorre->enlace;
      }
      if (recorre != (struct nodo *)((void *)0)) {
     anterior = recorre;
    }
    }
  }
  return (anterior);
}

variable_types:
nuevo
struct nodo *

variable_types:
cabeza
struct nodo *

return_type: struct nodo { struct informacion { char marca[30]; char modelo[30]; float precio; } info; struct nodo *enlace; } *


ainade

decompiled_code:
__int64 __fastcall ainade(__int64 *a1)
{
void *v1; // rbx
__int64 v2; // rax

v1 = nuevo_elemento();
compara((__int64)v1, *a1);
return inserta((__int64)v1, v2, a1);
}

original_code:
void ainade(struct nodo **cabeza) {
  struct nodo *nuevo, *anterior;
  nuevo = nuevo_elemento();
  anterior = compara(nuevo, *cabeza);
  inserta(nuevo, anterior, cabeza);
}

canonical_original_code:
void ainade(struct nodo **cabeza) {
  struct nodo *nuevo; struct nodo *anterior;
  nuevo = nuevo_elemento();
  anterior = compara(nuevo, *cabeza);
  inserta(nuevo, anterior, cabeza);
}

variable_types: struct nodo { struct informacion { char marca[30]; char modelo[30]; float precio; } info; struct nodo *enlace; } **


listar

decompiled_code:
int __fastcall listar(__int64 *a1)
{
__int64 v1; // rbx

v1 = *a1;
if ( *a1 )
{
do
{
puts("\n\n");
printf("MARCA --->");
puts((const char *)v1);
printf("\nMODELO --->");
puts((const char *)(v1 + 30));
printf("\nPRECIO ---> %.0f", *(float *)(v1 + 60));
v1 = *(_QWORD *)(v1 + 64);
printf("\nPULSE UNA TECLA PARA CONTINUAR");
getchar();
__isoc99_scanf();
}
while ( v1 );
}
else
{
printf("\nLISTA VACIA");
}
printf("\nFIN DE LA LISTA.PULSE UNA TECLA.");
return getchar();
}

canonical_decompiled_code:
int __fastcall func11(__int64 *a1)
{
__int64 v1; // rbx

v1 = *a1;
if ( *a1 )
{
do
{
puts("\n\n");
printf("MARCA --->");
puts((const char *)v1);
printf("\nMODELO --->");
puts((const char *)(v1 + 30));
printf("\nPRECIO ---> %.0f", *(float *)(v1 + 60));
v1 = *(_QWORD *)(v1 + 64);
printf("\nPULSE UNA TECLA PARA CONTINUAR");
getchar();
__isoc99_scanf();
}
while ( v1 );
}
else
{
printf("\nLISTA VACIA");
}
printf("\nFIN DE LA LISTA.PULSE UNA TECLA.");
return getchar();
}

original_code:
void listar (struct nodo **cabeza) {
  struct nodo *recorre;
  char siguiente, tmp;
  if (*cabeza == (struct nodo *)((void *)0)) {
   printf ("\nLISTA VACIA");
  } else {
   recorre = *cabeza;
   while (recorre != (struct nodo *)((void *)0)) {
    printf ("\n\n\n");
    printf ("MARCA --->");
    puts (recorre->info.marca);
    printf ("\nMODELO --->");
    puts (recorre->info.modelo);
    printf ("\nPRECIO ---> %.0f",recorre->info.precio);
      recorre = recorre->enlace;
    printf ("\nPULSE UNA TECLA PARA CONTINUAR");
    siguiente = getchar();
    scanf("%c",&tmp);
    }
   }
  printf ("\nFIN DE LA LISTA.PULSE UNA TECLA.");
  siguiente = getchar();
}

canonical_original_code:
void listar(struct nodo **cabeza) {
  struct nodo *recorre;
  char siguiente; char tmp;
  if (*cabeza == (struct nodo *)((void *)0)) {
   printf ("\nLISTA VACIA");
  } else {
   recorre = *cabeza;
   while (recorre != (struct nodo *)((void *)0)) {
    printf ("\n\n\n");
    printf ("MARCA --->");
    puts (recorre->info.marca);
    printf ("\nMODELO --->");
    puts (recorre->info.modelo);
    printf ("\nPRECIO ---> %.0f",recorre->info.precio);
      recorre = recorre->enlace;
    printf ("\nPULSE UNA TECLA PARA CONTINUAR");
    siguiente = getchar();
    scanf("%c",&tmp);
    }
   }
  printf ("\nFIN DE LA LISTA.PULSE UNA TECLA.");
  siguiente = getchar();
}

variable_types: siguiente char

user_defined_types: struct informacion { char marca[30]; char modelo[30]; float precio; }


main

decompiled_code:
// local variable allocation has failed, the output may be wrong!
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax
__int64 v5[2]; // [rsp+8h] [rbp-10h] BYREF

v5[0] = 0LL;
do
{
while ( 1 )
{
while ( 1 )
{
v3 = opciones(*(_QWORD *)&argc, argv, envp);
if ( v3 != 1 )
break;
*(_QWORD *)&argc = v5;
ainade(v5);
}
if ( v3 != 2 )
break;
*(_QWORD *)&argc = v5;
listar(v5);
}
}
while ( v3 );
return printf("\n\n\nFIN DEL PROGRAMA");
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // eax
__int64 v5[2]; // [rsp+8h] [rbp-10h] BYREF

v5[0] = 0LL;
do
{
while ( 1 )
{
while ( 1 )
{
v3 = func12(*(_QWORD *)&argc, argv, envp);
if ( v3 != 1 )
break;
*(_QWORD *)&argc = v5;
func10(v5);
}
if ( v3 != 2 )
break;
*(_QWORD *)&argc = v5;
func11(v5);
}
}
while ( v3 );
return printf("\n\n\nFIN DEL PROGRAMA");
}

original_code:
void main(void) {
  int opcion;
  struct nodo *cabeza;
  cabeza = (struct nodo *) ((void *)0);
  do {
   opcion = opciones();
   switch (opcion) {
    case 1:
     ainade(&cabeza);
     break;
    case 2:
     listar(&cabeza);
     break;
   }
  }
  while (opcion != 0);
  printf ("\n\n\nFIN DEL PROGRAMA");
}

canonical_original_code:
void main() {
  int opcion;
  struct nodo *cabeza;
  cabeza = (struct nodo *) ((void *)0);
  do {
   opcion = opciones();
   switch (opcion) {
    case 1:
     ainade(&cabeza);
     break;
    case 2:
     listar(&cabeza);
     break;
   }
  }
  while (opcion != 0);
  printf ("\n\n\nFIN DEL PROGRAMA");
}

variable_types: opcion int


decompiled_code:
__int64 __fastcall coge_elemento(__int64 *a1, __int64 *a2)
{
__int64 v2; // rax
__int64 result; // rax

v2 = *a1;
*a2 = *a1;
*a1 = *(_QWORD *)(v2 + 16);
result = *a2;
*(_QWORD *)(*a2 + 16) = 0LL;
return result;
}

original_code:
void coge_elemento(PUNT_NODO *entrada, PUNT_NODO *elemento) {
    *elemento = *entrada;
    *entrada = (*entrada)->enlace;
    (*elemento)->enlace = (PUNT_NODO) ((void *)0);
}

canonical_original_code:
void coge_elemento(struct nodo **entrada, struct nodo **elemento) {
    *elemento = *entrada;
    *entrada = (*entrada)->enlace;
    (*elemento)->enlace = (PUNT_NODO) ((void *)0);
}

variable_types: struct nodo { char info[13]; struct nodo *enlace; } **

variable_types:
elemento
struct nodo **


decompiled_code:
__int64 __fastcall calcula_salida(__int64 a1, char *a2, _BYTE *a3)
{
__int64 result; // rax
__int16 v5; // bp
char *v6; // rbx
__int16 v7; // dx
char s2[5]; // [rsp+6h] [rbp-32h] BYREF
char s1[45]; // [rsp+Bh] [rbp-2Dh] BYREF

LODWORD(result) = 0;
do
{
s1[4] = 0;
v5 = MEMORY[0];
if ( MEMORY[0] )
{
v5 = 0;
goto LABEL_6;
}
v6 = a2;
do
{
s2[0] = *v6;
s2[1] = v6[1];
s2[2] = v6[2];
s2[3] = v6[3];
s2[4] = 0;
if ( !strcmp(s1, s2) )
{
MEMORY[0] = 1;
++v5;
LODWORD(result) = 4;
goto LABEL_6;
}
++v5;
result = MEMORY[0];
v6 += 6;
}
while ( v5 <= 5 && !MEMORY[0] );
if ( !MEMORY[0] )
break;
LODWORD(result) = 4;
LABEL_6:
*a3 = a2[6 * v5 - 2];
v7 = result + 1;
result = (unsigned int)(result + 1);
}
while ( v7 <= 3 );
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1, char *a2, _BYTE *a3)
{
__int64 result; // rax
__int16 v5; // bp
char *v6; // rbx
__int16 v7; // dx
char s2[5]; // [rsp+6h] [rbp-32h] BYREF
char s1[45]; // [rsp+Bh] [rbp-2Dh] BYREF

LODWORD(result) = 0;
do
{
s1[4] = 0;
v5 = MEMORY[0];
if ( MEMORY[0] )
{
v5 = 0;
goto LABEL_6;
}
v6 = a2;
do
{
s2[0] = *v6;
s2[1] = v6[1];
s2[2] = v6[2];
s2[3] = v6[3];
s2[4] = 0;
if ( !strcmp(s1, s2) )
{
MEMORY[0] = 1;
++v5;
LODWORD(result) = 4;
goto LABEL_6;
}
++v5;
result = MEMORY[0];
v6 += 6;
}
while ( v5 <= 5 && !MEMORY[0] );
if ( !MEMORY[0] )
break;
LODWORD(result) = 4;
LABEL_6:
*a3 = a2[6 * v5 - 2];
v7 = result + 1;
result = (unsigned int)(result + 1);
}
while ( v7 <= 3 );
return result;
}

original_code:
void calcula_salida(PUNT_NODO elemento, CADENA_5 vector_rutado[],
        char *puerta, char *prioridad, short *encontrado) {
    char direccion[5];
    char dir_destino[5];
    short caracter, indice;
    for (caracter = 0; caracter < 4; caracter++) {
        direccion[4] = '\0';
        encontrado = 0;
        indice = 0;
        while (!*encontrado && indice < 6) {
            for (caracter = 0; caracter < 4; caracter++) {
                dir_destino[caracter] = vector_rutado[indice][caracter];
            }
            dir_destino[4] = '\0';
            if (strcmp(direccion, dir_destino) == 0) {
                *encontrado = 1;
            }
            indice++;
        }
        if (*encontrado) {
            *puerta = vector_rutado[indice - 1][4];
        }
        prioridad = elemento->info[8];
    }
}

canonical_original_code:
void calcula_salida(struct nodo *elemento, char vector_rutado[][6], char *puerta, char *prioridad, short *encontrado) {
    char direccion[5];
    char dir_destino[5];
    short caracter; short indice;
    for (caracter = 0; caracter < 4; caracter++) {
        direccion[4] = '\0';
        encontrado = 0;
        indice = 0;
        while (!*encontrado && indice < 6) {
            for (caracter = 0; caracter < 4; caracter++) {
                dir_destino[caracter] = vector_rutado[indice][caracter];
            }
            dir_destino[4] = '\0';
            if (strcmp(direccion, dir_destino) == 0) {
                *encontrado = 1;
            }
            indice++;
        }
        if (*encontrado) {
            *puerta = vector_rutado[indice - 1][4];
        }
        prioridad = elemento->info[8];
    }
}

variable_types: struct nodo { char info[13]; struct nodo *enlace; } *

variable_types:
puerta
char *

variable_types:
prioridad
char *

variable_types:
encontrado
short *

variable_types:
direccion
char [5]

variable_types: caracter short

variable_types: indice short


decompiled_code:
__int64 __fastcall inserta_en_cabeza(__int64 a1, __int64 a2)
{
__int64 result; // rax

result = a2;
*(_QWORD *)(a2 + 16) = a1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1, __int64 a2)
{
__int64 result; // rax

result = a2;
*(_QWORD *)(a2 + 16) = a1;
return result;
}

original_code:
PUNT_NODO inserta_en_cabeza(PUNT_NODO cabeza, PUNT_NODO elemento) {
    elemento->enlace = cabeza;
    cabeza = elemento;
    return (cabeza);
}

canonical_original_code:
struct nodo *inserta_en_cabeza(struct nodo *cabeza, struct nodo *elemento) {
    elemento->enlace = cabeza;
    cabeza = elemento;
    return (cabeza);
}

variable_types:
elemento
struct nodo *

return_type: struct nodo { char info[13]; struct nodo *enlace; } *


decompiled_code:
int pulsa_enter()
{
int result; // eax

printf("Pulsa la tecla ENTER para continuar");
do
result = getchar();
while ( result != 13 );
return result;
}

canonical_decompiled_code:
int func16()
{
int result; // eax

printf("Pulsa la tecla ENTER para continuar");
do
result = getchar();
while ( result != 13 );
return result;
}

original_code:
void pulsa_enter(void) {
    printf("Pulsa la tecla ENTER para continuar");
    while (getchar() != '\r');
}

canonical_original_code:
void pulsa_enter() {
    printf("Pulsa la tecla ENTER para continuar");
    while (getchar() != '\r');
}


decompiled_code:
int __fastcall visualiza_lista(char *s)
{
char *i; // rbx

for ( i = s; i; i = (char *)*((_QWORD *)i + 2) )
puts(i);
return pulsa_enter();
}

canonical_decompiled_code:
int __fastcall func17(char *s)
{
char *i; // rbx

for ( i = s; i; i = (char *)*((_QWORD *)i + 2) )
puts(i);
return func16();
}

original_code:
void visualiza_lista(PUNT_NODO cabeza) {
    PUNT_NODO recorre;
    recorre = cabeza;
    while (recorre != (PUNT_NODO) ((void *)0)) {
        puts (recorre->info);
        recorre = recorre->enlace;
    }
    pulsa_enter();
}

canonical_original_code:
void visualiza_lista(struct nodo *cabeza) {
    struct nodo *recorre;
    recorre = cabeza;
    while (recorre != (PUNT_NODO) ((void *)0)) {
        puts (recorre->info);
        recorre = recorre->enlace;
    }
    pulsa_enter();
}

user_defined_types: struct nodo { char info[13]; struct nodo *enlace; }


decompiled_code:
int __fastcall visualiza_listas(char *s, char *a2, char *a3, char *a4)
{
puts("LISTA DE ENTRADA\n");
visualiza_lista(s);
puts("LISTA DE SALIDA_!\n");
visualiza_lista(a2);
puts("LISTA DE SALIDA_2\n");
visualiza_lista(a3);
puts("LISTA DE ERROR\n");
return visualiza_lista(a4);
}

canonical_decompiled_code:
int __fastcall func18(char *s, char *a2, char *a3, char *a4)
{
puts("LISTA DE ENTRADA\n");
func17(s);
puts("LISTA DE SALIDA_!\n");
func17(a2);
puts("LISTA DE SALIDA_2\n");
func17(a3);
puts("LISTA DE ERROR\n");
return func17(a4);
}

original_code:
void visualiza_listas(PUNT_NODO entrada, PUNT_NODO salida_1,
        PUNT_NODO salida_2, PUNT_NODO error) {
    printf("LISTA DE ENTRADA\n\n");
    visualiza_lista(entrada);
    printf("LISTA DE SALIDA_!\n\n");
    visualiza_lista(salida_1);
    printf("LISTA DE SALIDA_2\n\n");
    visualiza_lista(salida_2);
    printf("LISTA DE ERROR\n\n");
    visualiza_lista(error);
}

canonical_original_code:
void visualiza_listas(struct nodo *entrada, struct nodo *salida_1, struct nodo *salida_2, struct nodo *error) {
    printf("LISTA DE ENTRADA\n\n");
    visualiza_lista(entrada);
    printf("LISTA DE SALIDA_!\n\n");
    visualiza_lista(salida_1);
    printf("LISTA DE SALIDA_2\n\n");
    visualiza_lista(salida_2);
    printf("LISTA DE ERROR\n\n");
    visualiza_lista(error);
}

variable_types:
error
struct nodo *


decompiled_code:
__int64 __fastcall inserta_en_cola(_QWORD *a1, __int64 *a2, __int64 a3)
{
__int64 result; // rax

if ( *a1 )
{
result = *a2;
*(_QWORD *)(*a2 + 16) = a3;
}
else
{
*a1 = a3;
}
*a2 = a3;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func10(_QWORD *a1, __int64 *a2, __int64 a3)
{
__int64 result; // rax

if ( *a1 )
{
result = *a2;
*(_QWORD *)(*a2 + 16) = a3;
}
else
{
*a1 = a3;
}
*a2 = a3;
return result;
}

original_code:
void inserta_en_cola(PUNT_NODO *cabeza, PUNT_NODO *ultimo,
        PUNT_NODO nuevo) {
    if (*cabeza == (PUNT_NODO) ((void *)0)) {
        *cabeza = nuevo;
    } else {
        (*ultimo)->enlace = nuevo;
    }
    *ultimo = nuevo;
}

canonical_original_code:
void inserta_en_cola(struct nodo **cabeza, struct nodo **ultimo, struct nodo *nuevo) {
    if (*cabeza == (PUNT_NODO) ((void *)0)) {
        *cabeza = nuevo;
    } else {
        (*ultimo)->enlace = nuevo;
    }
    *ultimo = nuevo;
}

variable_types:
ultimo
struct nodo **


decompiled_code:
void __fastcall inserta_nodo(__int64 *a1, __int64 *a2, __int64 a3, char a4)
{
if ( a4 == 48 )
{
inserta_en_cola(a1, a2, a3);
}
else if ( a4 == 49 )
{
*a1 = inserta_en_cabeza(*a1, a3);
}
}

original_code:
void inserta_nodo(PUNT_NODO *cabeza, PUNT_NODO *ultimo, PUNT_NODO elemento,
        char prioridad) {
    switch (prioridad) {
        case '0':
          inserta_en_cola(cabeza, ultimo, elemento);
          break;
        case '1':
            *cabeza = inserta_en_cabeza(*cabeza, elemento);
    }
}

canonical_original_code:
void inserta_nodo(struct nodo **cabeza, struct nodo **ultimo, struct nodo *elemento, char prioridad) {
    switch (prioridad) {
        case '0':
          inserta_en_cola(cabeza, ultimo, elemento);
          break;
        case '1':
            *cabeza = inserta_en_cabeza(*cabeza, elemento);
    }
}

variable_types: prioridad char


decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
__int16 v5; // [rsp+Ch] [rbp-7Ch]
char v6; // [rsp+Eh] [rbp-7Ah]
char v7; // [rsp+Fh] [rbp-79h] BYREF
char v8[48]; // [rsp+10h] [rbp-78h] BYREF
__int64 v9; // [rsp+40h] [rbp-48h] BYREF
__int64 v10; // [rsp+48h] [rbp-40h] BYREF
void *ptr; // [rsp+50h] [rbp-38h] BYREF
__int64 v12; // [rsp+58h] [rbp-30h] BYREF
char *v13; // [rsp+60h] [rbp-28h] BYREF
__int64 v14; // [rsp+68h] [rbp-20h] BYREF
char *v15; // [rsp+70h] [rbp-18h] BYREF
char *s[2]; // [rsp+78h] [rbp-10h] BYREF

inicializa_listas("ENTRADA.DAT", (__int64 *)s, &v15, &v14, &v13, &v12, &ptr, &v10);
vuelca_fichero_rutado_a_array("RUTADO.DAT", v8);
v3 = 0;
do
{
coge_elemento((__int64 *)s, &v9);
calcula_salida(v9, v8, &v7);
if ( v5 )
{
if ( v7 == 49 )
{
inserta_nodo((__int64 *)&v15, &v14, v9, v6);
}
else if ( v7 == 50 )
{
inserta_nodo((__int64 *)&v13, &v12, v9, v6);
}
}
else
{
inserta_nodo((__int64 *)&ptr, &v10, v9, v6);
++v3;
}
}
while ( v3 <= 3 );
visualiza_listas(s[0], v15, v13, (char *)ptr);
vuelca_lista_a_fichero_errores(ptr, "ERRORES.DAT");
return visualiza_fichero_errores("ERRORES.DAT");
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
__int16 v5; // [rsp+Ch] [rbp-7Ch]
char v6; // [rsp+Eh] [rbp-7Ah]
char v7; // [rsp+Fh] [rbp-79h] BYREF
char v8[48]; // [rsp+10h] [rbp-78h] BYREF
__int64 v9; // [rsp+40h] [rbp-48h] BYREF
__int64 v10; // [rsp+48h] [rbp-40h] BYREF
void *ptr; // [rsp+50h] [rbp-38h] BYREF
__int64 v12; // [rsp+58h] [rbp-30h] BYREF
char *v13; // [rsp+60h] [rbp-28h] BYREF
__int64 v14; // [rsp+68h] [rbp-20h] BYREF
char *v15; // [rsp+70h] [rbp-18h] BYREF
char *s[2]; // [rsp+78h] [rbp-10h] BYREF

inicializa_listas("ENTRADA.DAT", (__int64 *)s, &v15, &v14, &v13, &v12, &ptr, &v10);
func7("RUTADO.DAT", v8);
v3 = 0;
do
{
func8((__int64 *)s, &v9);
func9(v9, v8, &v7);
if ( v5 )
{
if ( v7 == 49 )
{
func13((__int64 *)&v15, &v14, v9, v6);
}
else if ( v7 == 50 )
{
func13((__int64 *)&v13, &v12, v9, v6);
}
}
else
{
func13((__int64 *)&ptr, &v10, v9, v6);
++v3;
}
}
while ( v3 <= 3 );
func18(s[0], v15, v13, (char *)ptr);
func14(ptr, "ERRORES.DAT");
return func15("ERRORES.DAT");
}

original_code:
void main(void) {
    CADENA nomf_entrada = "ENTRADA.DAT";
    CADENA nomf_rutado = "RUTADO.DAT";
    CADENA nomf_errores = "ERRORES.DAT";
    PUNT_NODO entrada, salida_1, ultimo_1, salida_2, ultimo_2, error, ultimo_e,
            elemento;
    CADENA_5 vector_rutado[6];
    int num_errores = 0;
    char puerta, prioridad;
    short encontrado;
    inicializa_listas(nomf_entrada, &entrada, &salida_1, &ultimo_1, &salida_2,
            &ultimo_2, &error, &ultimo_e);
    vuelca_fichero_rutado_a_array(nomf_rutado, vector_rutado);
    while (num_errores <= 3) {
        coge_elemento(&entrada, &elemento);
        calcula_salida(elemento, vector_rutado, &puerta, &prioridad,
                &encontrado);
        if (encontrado) {
            switch (puerta) {
                case '1':
                    inserta_nodo(&salida_1, &ultimo_1, elemento, prioridad);
                    break;
                case '2':
                    inserta_nodo(&salida_2, &ultimo_2, elemento, prioridad);
            }
        } else {
            inserta_nodo(&error, &ultimo_e, elemento, prioridad);
            num_errores++;
        }
    }
    visualiza_listas(entrada, salida_1, salida_2, error);
    vuelca_lista_a_fichero_errores(error, nomf_errores);
    visualiza_fichero_errores(nomf_errores);
}

canonical_original_code:
void main() {
    char *nomf_entrada = "ENTRADA.DAT";
    char *nomf_rutado = "RUTADO.DAT";
    char *nomf_errores = "ERRORES.DAT";
    struct nodo *entrada; struct nodo *salida_1; struct nodo *ultimo_1; struct nodo *salida_2; struct nodo *ultimo_2; struct nodo *error; struct nodo *ultimo_e; struct nodo *elemento;
    char vector_rutado[6][6];
    int num_errores = 0;
    char puerta; char prioridad;
    short encontrado;
    inicializa_listas(nomf_entrada, &entrada, &salida_1, &ultimo_1, &salida_2,
            &ultimo_2, &error, &ultimo_e);
    vuelca_fichero_rutado_a_array(nomf_rutado, vector_rutado);
    while (num_errores <= 3) {
        coge_elemento(&entrada, &elemento);
        calcula_salida(elemento, vector_rutado, &puerta, &prioridad,
                &encontrado);
        if (encontrado) {
            switch (puerta) {
                case '1':
                    inserta_nodo(&salida_1, &ultimo_1, elemento, prioridad);
                    break;
                case '2':
                    inserta_nodo(&salida_2, &ultimo_2, elemento, prioridad);
            }
        } else {
            inserta_nodo(&error, &ultimo_e, elemento, prioridad);
            num_errores++;
        }
    }
    visualiza_listas(entrada, salida_1, salida_2, error);
    vuelca_lista_a_fichero_errores(error, nomf_errores);
    visualiza_fichero_errores(nomf_errores);
}

variable_types: puerta char

variable_types: encontrado short


intercambia

decompiled_code:
__int64 __fastcall intercambia(_DWORD *a1, _DWORD *a2)
{
__int64 result; // rax

result = (unsigned int)*a1;
*a1 = *a2;
*a2 = result;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func9(_DWORD *a1, _DWORD *a2)
{
__int64 result; // rax

result = (unsigned int)*a1;
*a1 = *a2;
*a2 = result;
return result;
}

original_code:
void intercambia(int *dato_1, int *dato_2) {
  int temporal;
  temporal = *dato_1;
  *dato_1 = *dato_2;
  *dato_2 = temporal;
}

variable_types: temporal int


decompiled_code:
int __fastcall intercambia_datos(unsigned int *a1, unsigned int *a2)
{
intercambia(a1, a2);
return visualiza(*a1, *a2);
}

canonical_decompiled_code:
int __fastcall func10(unsigned int *a1, unsigned int *a2)
{
func9(a1, a2);
return func8(*a1, *a2);
}

original_code:
void intercambia_datos(int *dato_1, int *dato_2) {
  intercambia(dato_1, dato_2);
  visualiza(*dato_1, *dato_2);
}


decompiled_code:
__int64 pide_datos()
{
printf("Introduce dato 1: ");
__isoc99_scanf();
printf("Introduce dato 2: ");
return __isoc99_scanf();
}

canonical_decompiled_code:
__int64 func7()
{
printf("Introduce dato 1: ");
__isoc99_scanf();
printf("Introduce dato 2: ");
return __isoc99_scanf();
}

original_code:
void pide_datos(int *dato_1, int *dato_2) {
  printf("Introduce dato 1: ");
  scanf("%d", dato_1);
  printf("Introduce dato 2: ");
  scanf("%d", dato_2);
}


visualiza

decompiled_code:
int __fastcall visualiza(unsigned int a1, unsigned int a2)
{
return printf("\ndato 1: %d\ndato 2: %d\n", a1, a2);
}

canonical_decompiled_code:
int __fastcall func8(unsigned int a1, unsigned int a2)
{
return printf("\ndato 1: %d\ndato 2: %d\n", a1, a2);
}

original_code:
void visualiza(int dato_1, int dato_2) {
  printf("\ndato 1: %d\ndato 2: %d\n", dato_1, dato_2);
}


main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int v4; // [rsp+8h] [rbp-10h] BYREF
unsigned int v5[3]; // [rsp+Ch] [rbp-Ch] BYREF

pide_datos(v5, &v4, envp);
visualiza(v5[0], v4);
intercambia(v5, &v4);
return visualiza(v5[0], v4);
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
unsigned int v4; // [rsp+8h] [rbp-10h] BYREF
unsigned int v5[3]; // [rsp+Ch] [rbp-Ch] BYREF

func7(v5, &v4, envp);
func8(v5[0], v4);
func9(v5, &v4);
return func8(v5[0], v4);
}

original_code:
void main(void) {
  int dato_1, dato_2;
  pide_datos(&dato_1, &dato_2);
  visualiza(dato_1, dato_2);
  intercambia(&dato_1, &dato_2);
  visualiza(dato_1, dato_2);
}

canonical_original_code:
void main() {
  int dato_1; int dato_2;
  pide_datos(&dato_1, &dato_2);
  visualiza(dato_1, dato_2);
  intercambia(&dato_1, &dato_2);
  visualiza(dato_1, dato_2);
}


decompiled_code:
__int64 lee_operacion()
{
unsigned int v1; // [rsp+Ch] [rbp-Ch]

puts("1. SUMA");
puts("2. RESTA");
puts("3. PRODUCTO");
printf("\n\nElige operacion ---> ");
__isoc99_scanf();
return v1;
}

canonical_decompiled_code:
__int64 func7()
{
unsigned int v1; // [rsp+Ch] [rbp-Ch]

puts("1. SUMA");
puts("2. RESTA");
puts("3. PRODUCTO");
printf("\n\nElige operacion ---> ");
__isoc99_scanf();
return v1;
}

original_code:
int lee_operacion(void) {
    int operacion;
    printf("1. SUMA\n");
    printf("2. RESTA\n");
    printf("3. PRODUCTO\n");
    printf("\n\nElige operacion ---> ");
    scanf("%d", &operacion);
    return (operacion);
}

canonical_original_code:
int lee_operacion() {
    int operacion;
    printf("1. SUMA\n");
    printf("2. RESTA\n");
    printf("3. PRODUCTO\n");
    printf("\n\nElige operacion ---> ");
    scanf("%d", &operacion);
    return (operacion);
}

variable_types: operacion int


decompiled_code:
__int64 __fastcall digito_suma(_DWORD *a1)
{
_DWORD *v1; // rdx
int v2; // eax

v1 = a1 + 8;
v2 = 0;
do
v2 += *a1++;
while ( a1 != v1 );
return (unsigned int)(v2 % 10);
}

canonical_decompiled_code:
__int64 __fastcall func9(_DWORD *a1)
{
_DWORD *v1; // rdx
int v2; // eax

v1 = a1 + 8;
v2 = 0;
do
v2 += *a1++;
while ( a1 != v1 );
return (unsigned int)(v2 % 10);
}

original_code:
int digito_suma(int vector[]) {
    int indice, suma;
    for (indice = 0, suma = 0; indice < 9 - 1; indice++) {
        suma += vector[indice];
    }
    return (suma % 10);
}

canonical_original_code:
int digito_suma(int vector[]) {
    int indice; int suma;
    for (indice = 0, suma = 0; indice < 9 - 1; indice++) {
        suma += vector[indice];
    }
    return (suma % 10);
}

variable_types:
vector
int []

variable_types: indice int

variable_types: suma int


decompiled_code:
__int64 __fastcall digito_resta(int *a1)
{
int v1; // edx
_DWORD *v2; // rax
_DWORD *v3; // rdi

v1 = *a1;
v2 = a1 + 1;
v3 = a1 + 8;
do
v1 -= *v2++;
while ( v2 != v3 );
return (unsigned int)(v1 % 10);
}

canonical_decompiled_code:
__int64 __fastcall func10(int *a1)
{
int v1; // edx
_DWORD *v2; // rax
_DWORD *v3; // rdi

v1 = *a1;
v2 = a1 + 1;
v3 = a1 + 8;
do
v1 -= *v2++;
while ( v2 != v3 );
return (unsigned int)(v1 % 10);
}

original_code:
int digito_resta(int vector[]) {
    int indice, resta;
    for (indice = 1, resta = vector[0]; indice < 9 - 1; indice++) {
        resta -= vector[indice];
    }
    return (resta % 10);
}

canonical_original_code:
int digito_resta(int vector[]) {
    int indice; int resta;
    for (indice = 1, resta = vector[0]; indice < 9 - 1; indice++) {
        resta -= vector[indice];
    }
    return (resta % 10);
}

variable_types: resta int


decompiled_code:
__int64 __fastcall digito_producto(int *a1)
{
int *v1; // rdx
__int64 v2; // rcx

v1 = a1 + 9;
v2 = 1LL;
do
v2 *= *a1++;
while ( a1 != v1 );
return v2 % 10;
}

original_code:
int digito_producto(int vector[]) {
    int indice;
    long producto;
    for (indice = 0, producto = 1; indice < 9; indice++) {
        producto *= vector[indice];
    }
    return ((int) (producto % 10));
}

variable_types: producto long


decompiled_code:
_BOOL8 __fastcall comprueba_validez(int *a1, int a2)
{
int v2; // eax

switch ( a2 )
{
case 2:
v2 = digito_resta(a1);
break;
case 3:
v2 = digito_producto(a1);
break;
case 1:
v2 = digito_suma(a1);
break;
}
return a1[8] == v2;
}

canonical_decompiled_code:
_BOOL8 __fastcall func12(int *a1, int a2)
{
int v2; // eax

switch ( a2 )
{
case 2:
v2 = func10(a1);
break;
case 3:
v2 = func11(a1);
break;
case 1:
v2 = func9(a1);
break;
}
return a1[8] == v2;
}

original_code:
int comprueba_validez(int vector[], int operacion) {
    int digito, validez = 0;
    switch (operacion) {
        case 1:
            digito = digito_suma(vector);
            break;
        case 2:
            digito = digito_resta(vector);
            break;
        case 3:
            digito = digito_producto(vector);
            break;
    }
    if (digito == vector[8]) {
        validez = 1;
    }
    return (validez);
}

canonical_original_code:
int comprueba_validez(int vector[], int operacion) {
    int digito; int validez = 0;
    switch (operacion) {
        case 1:
            digito = digito_suma(vector);
            break;
        case 2:
            digito = digito_resta(vector);
            break;
        case 3:
            digito = digito_producto(vector);
            break;
    }
    if (digito == vector[8]) {
        validez = 1;
    }
    return (validez);
}

variable_types: digito int

variable_types: validez int


decompiled_code:
__int64 __fastcall lee_vector(__int64 a1)
{
__int64 v1; // rbx
__int64 result; // rax

puts("INTRODUCE UNO A UNO LOS 9 DIGITOS DEL NUMERO DE CUENTA");
v1 = a1;
do
{
result = __isoc99_scanf();
v1 += 4LL;
}
while ( v1 != a1 + 36 );
return result;
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
__int64 v1; // rbx
__int64 result; // rax

puts("INTRODUCE UNO A UNO LOS 9 DIGITOS DEL NUMERO DE CUENTA");
v1 = a1;
do
{
result = __isoc99_scanf();
v1 += 4LL;
}
while ( v1 != a1 + 36 );
return result;
}

original_code:
void lee_vector(int vector[]) {
    int indice;
    printf("INTRODUCE UNO A UNO LOS 9 DIGITOS DEL NUMERO DE CUENTA\n");
    for (indice = 0; indice < 9; indice++) {
        scanf("%d", &vector[indice]);
    }
}


decompiled_code:
int __fastcall visualiza_vector(unsigned int *a1)
{
unsigned int *v1; // rbx

v1 = a1;
do
printf("%d", *v1++);
while ( v1 != a1 + 9 );
return puts("\n");
}

canonical_decompiled_code:
int __fastcall func13(unsigned int *a1)
{
unsigned int *v1; // rbx

v1 = a1;
do
printf("%d", *v1++);
while ( v1 != a1 + 9 );
return puts("\n");
}

original_code:
void visualiza_vector(int vector[]) {
    int indice;
    for (indice = 0; indice < 9; indice++) {
        printf("%d", vector[indice]);
    }
    printf("\n\n");
}


decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
int v5[14]; // [rsp+0h] [rbp-38h] BYREF

v3 = lee_operacion(argc, argv, envp);
lee_vector((__int64)v5);
visualiza_vector((unsigned int *)v5);
if ( (unsigned int)(v3 - 1) > 2 )
return printf("EL CODIGO DE OPERACION ES INCORRECTO");
if ( comprueba_validez(v5, v3) )
return printf("EL NUMERO DE LA CUENTA ES VALIDO");
return printf("EL NUMERO DE LA CUENTA NO ES VALIDO");
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // ebx
int v5[14]; // [rsp+0h] [rbp-38h] BYREF

v3 = func7(argc, argv, envp);
func8((__int64)v5);
func13((unsigned int *)v5);
if ( (unsigned int)(v3 - 1) > 2 )
return printf("EL CODIGO DE OPERACION ES INCORRECTO");
if ( func12(v5, v3) )
return printf("EL NUMERO DE LA CUENTA ES VALIDO");
return printf("EL NUMERO DE LA CUENTA NO ES VALIDO");
}

original_code:
void main(void) {
    int operacion;
    int vector[9];
    operacion = lee_operacion();
    lee_vector(vector);
    visualiza_vector(vector);
    if (operacion >= 1 && operacion <= 3) {
        if (comprueba_validez(vector, operacion)) {
            printf("EL NUMERO DE LA CUENTA ES VALIDO");
        } else {
            printf("EL NUMERO DE LA CUENTA NO ES VALIDO");
        }
    } else {
        printf("EL CODIGO DE OPERACION ES INCORRECTO");
    }
}

canonical_original_code:
void main() {
    int operacion;
    int vector[9];
    operacion = lee_operacion();
    lee_vector(vector);
    visualiza_vector(vector);
    if (operacion >= 1 && operacion <= 3) {
        if (comprueba_validez(vector, operacion)) {
            printf("EL NUMERO DE LA CUENTA ES VALIDO");
        } else {
            printf("EL NUMERO DE LA CUENTA NO ES VALIDO");
        }
    } else {
        printf("EL CODIGO DE OPERACION ES INCORRECTO");
    }
}

variable_types:
vector
int [9]


decompiled_code:
__int64 __fastcall lee_vectores(__int64 a1, __int64 a2)
{
printf("INTRODUCE LOS %d ELEMENTOS DEL ARRAY X\n", 10LL);
lee_vector(a1);
printf("INTRODUCE LOS %d ELEMENTOS DEL ARRAY Y\n", 10LL);
return lee_vector(a2);
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1, __int64 a2)
{
printf("INTRODUCE LOS %d ELEMENTOS DEL ARRAY X\n", 10LL);
func7(a1);
printf("INTRODUCE LOS %d ELEMENTOS DEL ARRAY Y\n", 10LL);
return func7(a2);
}

original_code:
void lee_vectores(int vector_x[], int vector_y[]) {
    printf("INTRODUCE LOS %d ELEMENTOS DEL ARRAY X\n", 10);
    lee_vector(vector_x);
    printf("INTRODUCE LOS %d ELEMENTOS DEL ARRAY Y\n", 10);
    lee_vector(vector_y);
}


decompiled_code:
int __fastcall cuenta_elementos(unsigned int *a1)
{
unsigned int *v1; // rbx
unsigned int v2; // er12
unsigned int v3; // er13

printf("ELEMENTOS DEL ARRAY Z");
v1 = a1;
v2 = 0;
v3 = 0;
do
{
printf("%5d", *v1);
if ( *v1 == 1 )
++v3;
else
v2 += *v1 == -1;
++v1;
}
while ( v1 != a1 + 10 );
printf("\n\n%d ELEMENTOS DE X QUE SON MAYORES QUE LOS CORRESPONDIENTES DE Y", v3);
return printf("\n\n%d ELEMENTOS DE X QUE SON MENORES QUE LOS CORRESPONDIENTES DE Y", v2);
}

canonical_decompiled_code:
int __fastcall func11(unsigned int *a1)
{
unsigned int *v1; // rbx
unsigned int v2; // er12
unsigned int v3; // er13

printf("ELEMENTOS DEL ARRAY Z");
v1 = a1;
v2 = 0;
v3 = 0;
do
{
printf("%5d", *v1);
if ( *v1 == 1 )
++v3;
else
v2 += *v1 == -1;
++v1;
}
while ( v1 != a1 + 10 );
printf("\n\n%d ELEMENTOS DE X QUE SON MAYORES QUE LOS CORRESPONDIENTES DE Y", v3);
return printf("\n\n%d ELEMENTOS DE X QUE SON MENORES QUE LOS CORRESPONDIENTES DE Y", v2);
}

original_code:
void cuenta_elementos(int vector[]) {
    int indice, mayores, menores;
    printf("ELEMENTOS DEL ARRAY Z");
    for (indice = 0, mayores = 0, menores = 0; indice < 10; indice++) {
        printf("%5d", vector[indice]);
        if (vector[indice] == 1) {
            mayores++;
        } else {
            if (vector[indice] == -1) {
                menores++;
            }
        }
    }
    printf("\n\n%d ELEMENTOS DE X QUE SON MAYORES QUE LOS CORRESPONDIENTES DE Y", mayores);
    printf("\n\n%d ELEMENTOS DE X QUE SON MENORES QUE LOS CORRESPONDIENTES DE Y", menores);
}

canonical_original_code:
void cuenta_elementos(int vector[]) {
    int indice; int mayores; int menores;
    printf("ELEMENTOS DEL ARRAY Z");
    for (indice = 0, mayores = 0, menores = 0; indice < 10; indice++) {
        printf("%5d", vector[indice]);
        if (vector[indice] == 1) {
            mayores++;
        } else {
            if (vector[indice] == -1) {
                menores++;
            }
        }
    }
    printf("\n\n%d ELEMENTOS DE X QUE SON MAYORES QUE LOS CORRESPONDIENTES DE Y", mayores);
    printf("\n\n%d ELEMENTOS DE X QUE SON MENORES QUE LOS CORRESPONDIENTES DE Y", menores);
}

variable_types: mayores int

variable_types: menores int


decompiled_code:
int __fastcall visualiza_vectores(unsigned int *a1, unsigned int *a2, unsigned int *a3)
{
printf("ELEMENTOS DEL ARRAY X");
visualiza_vector(a1);
printf("ELEMENTOS DEL ARRAY Y");
visualiza_vector(a2);
return cuenta_elementos(a3);
}

canonical_decompiled_code:
int __fastcall func12(unsigned int *a1, unsigned int *a2, unsigned int *a3)
{
printf("ELEMENTOS DEL ARRAY X");
func10(a1);
printf("ELEMENTOS DEL ARRAY Y");
func10(a2);
return func11(a3);
}

original_code:
void visualiza_vectores(int vector_x[], int vector_y[], int vector_z[]) {
    printf("ELEMENTOS DEL ARRAY X");
    visualiza_vector(vector_x);
    printf("ELEMENTOS DEL ARRAY Y");
    visualiza_vector(vector_y);
    cuenta_elementos(vector_z);
}


decompiled_code:
__int64 __fastcall lee_vector(__int64 a1)
{
__int64 v1; // rbx
__int64 result; // rax

v1 = a1;
do
{
result = __isoc99_scanf();
v1 += 4LL;
}
while ( v1 != a1 + 40 );
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
__int64 v1; // rbx
__int64 result; // rax

v1 = a1;
do
{
result = __isoc99_scanf();
v1 += 4LL;
}
while ( v1 != a1 + 40 );
return result;
}

original_code:
void lee_vector(int vector[]) {
    int indice;
    for (indice = 0; indice < 10; indice++) {
        scanf("%d", &vector[indice]);
    }
}