main

decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
char v3; // r15
char *v4; // r14
char v5; // r13
char v6; // r12
int v7; // eax

v3 = 0;
v4 = 0LL;
v5 = 0;
v6 = 0;
while ( 1 )
{
v7 = getopt(argc, (char *const *)argv, "gcpv:");
if ( v7 == -1 )
break;
if ( v7 == 103 )
{
run_cuda = 1;
}
else if ( v7 <= 103 )
{
if ( v7 == 63 )
{
print_usage();
exit(0);
}
if ( v7 == 99 )
v3 = 1;
}
else if ( v7 == 112 )
{
v6 = 1;
}
else if ( v7 == 118 )
{
v4 = optarg;
v5 = 1;
}
}
if ( !((unsigned __int8)(v6 | v3) | (unsigned __int8)v5) )
{
print_usage();
return 0;
}
if ( v5 )
{
if ( !((unsigned __int8)v6 | (unsigned __int8)v3) )
visual_mode(v4);
fwrite("Error: Cannot run visual mode with correctness or performance tests.\n", 1uLL, 0x45uLL, stderr);
abort();
}
if ( !v3 )
goto LABEL_21;
correctness_tests();
if ( v6 )
{
putchar(10);
LABEL_21:
performance_tests();
}
return 0;
}

canonical_decompiled_code:
int __cdecl main(int argc, const char **argv, const char **envp)
{
char v3; // r15
char *v4; // r14
char v5; // r13
char v6; // r12
int v7; // eax

v3 = 0;
v4 = 0LL;
v5 = 0;
v6 = 0;
while ( 1 )
{
v7 = getopt(argc, (char *const *)argv, "gcpv:");
if ( v7 == -1 )
break;
if ( v7 == 103 )
{
run_cuda = 1;
}
else if ( v7 <= 103 )
{
if ( v7 == 63 )
{
func0();
exit(0);
}
if ( v7 == 99 )
v3 = 1;
}
else if ( v7 == 112 )
{
v6 = 1;
}
else if ( v7 == 118 )
{
v4 = optarg;
v5 = 1;
}
}
if ( !((unsigned __int8)(v6 | v3) | (unsigned __int8)v5) )
{
func0();
return 0;
}
if ( v5 )
{
if ( !((unsigned __int8)v6 | (unsigned __int8)v3) )
func10(v4);
fwrite("Error: Cannot run visual mode with correctness or performance tests.\n", 1uLL, 0x45uLL, stderr);
abort();
}
if ( !v3 )
goto LABEL_21;
func6();
if ( v6 )
{
putchar(10);
LABEL_21:
func8();
}
return 0;
}

original_code:
int main(int argc, char** argv) {
    bool cflag = (char)0, pflag = (char)0, vflag = (char)0;
    char* filename = 0;
    int c;
    while((c = getopt(argc, argv, "gcpv:")) != -1) {
        switch(c) {
            case 'c':
                cflag = (char)1;
                break;
            case 'p':
                pflag = (char)1;
                break;
            case 'v':
                vflag = (char)1;
                filename = optarg;
                break;
            case 'g':
                run_cuda=1;
                break;
            case '?':
                print_usage();
                exit(0);
                break;
        }
    }
    if(!vflag && !cflag && !pflag) {
        print_usage();
    }
    if(vflag && (cflag || pflag)) {
        fprintf(stderr, "Error: Cannot run visual mode with correctness or performance tests.\n");
        abort();
    }
    if(cflag) {
        correctness_tests();
    }
    if(pflag) {
        if(cflag) printf("\n");
        performance_tests();
    }
    if(vflag) {
        visual_mode(filename);
    }
    return 0;
}

canonical_original_code:
int main(int argc, char **argv) {
    char cflag = (char)0; char pflag = (char)0; char vflag = (char)0;
    char *filename = 0;
    int c;
    while((c = getopt(argc, argv, "gcpv:")) != -1) {
        switch(c) {
            case 'c':
                cflag = (char)1;
                break;
            case 'p':
                pflag = (char)1;
                break;
            case 'v':
                vflag = (char)1;
                filename = optarg;
                break;
            case 'g':
                run_cuda=1;
                break;
            case '?':
                print_usage();
                exit(0);
                break;
        }
    }
    if(!vflag && !cflag && !pflag) {
        print_usage();
    }
    if(vflag && (cflag || pflag)) {
        fprintf(stderr, "Error: Cannot run visual mode with correctness or performance tests.\n");
        abort();
    }
    if(cflag) {
        correctness_tests();
    }
    if(pflag) {
        if(cflag) printf("\n");
        performance_tests();
    }
    if(vflag) {
        visual_mode(filename);
    }
    return 0;
}

variable_types: argc int

variable_types:
argv
char **

variable_types: cflag char

variable_types: pflag char

variable_types: vflag char

variable_types: c int


decompiled_code:
void gol_parallel()
{
;
}

canonical_decompiled_code:
void func0()
{
;
}

original_code:
void gol_parallel(bool* cells, int n, int m, int iterations, int nthreads) {
}

canonical_original_code:
void gol_parallel(char *cells, int n, int m, int iterations, int nthreads) {
}

variable_types:
cells
char *

variable_types: n int

variable_types: m int

variable_types: iterations int

variable_types: nthreads int

return_type: void


original_code:
void gol_serial(bool* cells, int n, int m, int iterations) {
    int t, i, j;
    int neighbors;
    bool* cells_new = malloc(n * m * sizeof(bool));
    bool* temp;
    for(t = 0; t < iterations; ++t) {
        for(i = 0; i < n; ++i) {
            for(j = 0; j < m; ++j) {
                neighbors = 0;
                if(i>0 && j>0) neighbors += cells[(i-1) * m + j-1] ? 1 : 0;
                if(i>0) neighbors += cells[(i-1) * m + j] ? 1 : 0;
                if(i>0 && j<m-1) neighbors += cells[(i-1) * m + j+1] ? 1 : 0;
                if(j>0) neighbors += cells[i * m + j-1] ? 1 : 0;
                if(j<m-1) neighbors += cells[i * m + j+1] ? 1 : 0;
                if(i<n-1 && j>0) neighbors += cells[(i+1) * m + j-1] ? 1 : 0;
                if(i<n-1) neighbors += cells[(i+1) * m + j] ? 1 : 0;
                if(i<n-1 && j<m-1) neighbors += cells[(i+1) * m + j+1] ? 1 : 0;
                cells_new[i * m + j] = neighbors == 3 || (cells[i*m+j] && neighbors == 2);
            }
        }
        temp = cells;
        cells = cells_new;
        cells_new = temp;
    }
    if(iterations % 2) {
        for(i = 0; i < n; ++i) {
            for(j = 0; j < m; ++j) {
                cells_new[i * m + j] = cells[i * m + j];
            }
        }
    }
    free(iterations % 2 ? cells : cells_new);
}

canonical_original_code:
void gol_serial(char *cells, int n, int m, int iterations) {
    int t; int i; int j;
    int neighbors;
    char *cells_new = malloc(n * m * sizeof(bool));
    char *temp;
    for(t = 0; t < iterations; ++t) {
        for(i = 0; i < n; ++i) {
            for(j = 0; j < m; ++j) {
                neighbors = 0;
                if(i>0 && j>0) neighbors += cells[(i-1) * m + j-1] ? 1 : 0;
                if(i>0) neighbors += cells[(i-1) * m + j] ? 1 : 0;
                if(i>0 && j<m-1) neighbors += cells[(i-1) * m + j+1] ? 1 : 0;
                if(j>0) neighbors += cells[i * m + j-1] ? 1 : 0;
                if(j<m-1) neighbors += cells[i * m + j+1] ? 1 : 0;
                if(i<n-1 && j>0) neighbors += cells[(i+1) * m + j-1] ? 1 : 0;
                if(i<n-1) neighbors += cells[(i+1) * m + j] ? 1 : 0;
                if(i<n-1 && j<m-1) neighbors += cells[(i+1) * m + j+1] ? 1 : 0;
                cells_new[i * m + j] = neighbors == 3 || (cells[i*m+j] && neighbors == 2);
            }
        }
        temp = cells;
        cells = cells_new;
        cells_new = temp;
    }
    if(iterations % 2) {
        for(i = 0; i < n; ++i) {
            for(j = 0; j < m; ++j) {
                cells_new[i * m + j] = cells[i * m + j];
            }
        }
    }
    free(iterations % 2 ? cells : cells_new);
}

variable_types: t int

variable_types: i int

variable_types: j int

variable_types: neighbors int

variable_types:
temp
char *


decompiled_code:
void __fastcall guac_terminal_buffer_free(void *ptr)
{
void **v2; // rbp
int v3; // ebx
void *v4; // rdi

v2 = (void **)*((_QWORD *)ptr + 2);
if ( *((int *)ptr + 8) > 0 )
{
v3 = 0;
do
{
v4 = *v2;
++v3;
v2 += 2;
free(v4);
}
while ( *((_DWORD *)ptr + 8) > v3 );
v2 = (void **)*((_QWORD *)ptr + 2);
}
free(v2);
free(ptr);
}

canonical_decompiled_code:
void __fastcall func0(void *ptr)
{
void **v2; // rbp
int v3; // ebx
void *v4; // rdi

v2 = (void **)*((_QWORD *)ptr + 2);
if ( *((int *)ptr + 8) > 0 )
{
v3 = 0;
do
{
v4 = *v2;
++v3;
v2 += 2;
free(v4);
}
while ( *((_DWORD *)ptr + 8) > v3 );
v2 = (void **)*((_QWORD *)ptr + 2);
}
free(v2);
free(ptr);
}

original_code:
void guac_terminal_buffer_free(guac_terminal_buffer* buffer) {
    int i;
    guac_terminal_buffer_row* row = buffer->rows;
    for (i=0; i<buffer->available; i++) {
        free(row->characters);
        row++;
    }
    free(buffer->rows);
    free(buffer);
}

canonical_original_code:
void guac_terminal_buffer_free(struct guac_terminal_buffer *buffer) {
    int i;
    struct guac_terminal_buffer_row *row = buffer->rows;
    for (i=0; i<buffer->available; i++) {
        free(row->characters);
        row++;
    }
    free(buffer->rows);
    free(buffer);
}

variable_types: struct guac_terminal_buffer { struct guac_terminal_char { int value; struct guac_terminal_attributes { _Bool bold; _Bool reverse; _Bool cursor; _Bool underscore; int foreground; int background; } attributes; } default_character; struct guac_terminal_buffer_row { struct guac_terminal_char *characters; int length; int available; } *rows; int top; int length; int available; } *

variable_types: struct guac_terminal_buffer_row { struct guac_terminal_char { int value; struct guac_terminal_attributes { _Bool bold; _Bool reverse; _Bool cursor; _Bool underscore; int foreground; int background; } attributes; } *characters; int length; int available; } *

user_defined_types: struct guac_terminal_buffer { struct guac_terminal_char default_character; struct guac_terminal_buffer_row *rows; int top; int length; int available; }

user_defined_types: struct guac_terminal_char { int value; struct guac_terminal_attributes attributes; }


original_code:
guac_terminal_buffer_row* guac_terminal_buffer_get_row(guac_terminal_buffer* buffer, int row, int width) {
    int i;
    guac_terminal_char* first;
    guac_terminal_buffer_row* buffer_row;
    int index = buffer->top + row;
    if (index < 0)
        index += buffer->available;
    else if (index >= buffer->available)
        index -= buffer->available;
    buffer_row = &(buffer->rows[index]);
    if (width >= buffer_row->length) {
        if (width > buffer_row->available) {
            buffer_row->available = width*2;
            buffer_row->characters = realloc(buffer_row->characters, sizeof(guac_terminal_char) * buffer_row->available);
        }
        first = &(buffer_row->characters[buffer_row->length]);
        for (i=buffer_row->length; i<width; i++)
            *(first++) = buffer->default_character;
        buffer_row->length = width;
    }
    return buffer_row;
}

canonical_original_code:
struct guac_terminal_buffer_row *guac_terminal_buffer_get_row(struct guac_terminal_buffer *buffer, int row, int width) {
    int i;
    struct guac_terminal_char *first;
    struct guac_terminal_buffer_row *buffer_row;
    int index = buffer->top + row;
    if (index < 0)
        index += buffer->available;
    else if (index >= buffer->available)
        index -= buffer->available;
    buffer_row = &(buffer->rows[index]);
    if (width >= buffer_row->length) {
        if (width > buffer_row->available) {
            buffer_row->available = width*2;
            buffer_row->characters = realloc(buffer_row->characters, sizeof(guac_terminal_char) * buffer_row->available);
        }
        first = &(buffer_row->characters[buffer_row->length]);
        for (i=buffer_row->length; i<width; i++)
            *(first++) = buffer->default_character;
        buffer_row->length = width;
    }
    return buffer_row;
}

variable_types: struct guac_terminal_buffer { struct guac_terminal_char default_character; struct guac_terminal_buffer_row *rows; int top; int length; int available; } *

variable_types: row int

variable_types: width int

variable_types: index int

return_type: struct guac_terminal_buffer_row { struct guac_terminal_char { int value; struct guac_terminal_attributes { _Bool bold; _Bool reverse; _Bool cursor; _Bool underscore; int foreground; int background; } attributes; } *characters; int length; int available; } *

user_defined_types: struct guac_terminal_buffer_row { struct guac_terminal_char *characters; int length; int available; }


decompiled_code:
void *__fastcall guac_terminal_buffer_copy_columns(const __m128i *a1, int a2, unsigned int a3, unsigned int a4, int a5)
{
__int64 v8; // r13
int v9; // ebx
int v10; // er14
int v11; // eax
__int64 v12; // rbp
int v13; // ebx
int v14; // eax

v8 = guac_terminal_buffer_get_row(a1, a2, a4 + a5 + 1);
v9 = guac_terminal_fit_to_range(a3, 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
v10 = guac_terminal_fit_to_range(a4, 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
v11 = guac_terminal_fit_to_range((unsigned int)(a5 + v9), 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
v12 = v11;
v13 = v11 - a5;
v14 = guac_terminal_fit_to_range((unsigned int)(a5 + v10), 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
return memmove(
(void *)(16 * v12 + *(_QWORD *)v8),
(const void *)(*(_QWORD *)v8 + 16LL * v13),
16LL * (v14 - (int)v12 + 1));
}

canonical_decompiled_code:
void *__fastcall func2(const __m128i *a1, int a2, unsigned int a3, unsigned int a4, int a5)
{
__int64 v8; // r13
int v9; // ebx
int v10; // er14
int v11; // eax
__int64 v12; // rbp
int v13; // ebx
int v14; // eax

v8 = func1(a1, a2, a4 + a5 + 1);
v9 = guac_terminal_fit_to_range(a3, 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
v10 = guac_terminal_fit_to_range(a4, 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
v11 = guac_terminal_fit_to_range((unsigned int)(a5 + v9), 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
v12 = v11;
v13 = v11 - a5;
v14 = guac_terminal_fit_to_range((unsigned int)(a5 + v10), 0LL, (unsigned int)(*(_DWORD *)(v8 + 8) - 1));
return memmove(
(void *)(16 * v12 + *(_QWORD *)v8),
(const void *)(*(_QWORD *)v8 + 16LL * v13),
16LL * (v14 - (int)v12 + 1));
}

original_code:
void guac_terminal_buffer_copy_columns(guac_terminal_buffer* buffer, int row,
        int start_column, int end_column, int offset) {
    guac_terminal_char* src;
    guac_terminal_char* dst;
    guac_terminal_buffer_row* buffer_row = guac_terminal_buffer_get_row(buffer, row, end_column + offset + 1);
    start_column = guac_terminal_fit_to_range(start_column, 0, buffer_row->length - 1);
    end_column = guac_terminal_fit_to_range(end_column, 0, buffer_row->length - 1);
    start_column = guac_terminal_fit_to_range(start_column + offset, 0, buffer_row->length - 1) - offset;
    end_column = guac_terminal_fit_to_range(end_column + offset, 0, buffer_row->length - 1) - offset;
    src = &(buffer_row->characters[start_column]);
    dst = &(buffer_row->characters[start_column + offset]);
    memmove(dst, src, sizeof(guac_terminal_char) * (end_column - start_column + 1));
}

canonical_original_code:
void guac_terminal_buffer_copy_columns(struct guac_terminal_buffer *buffer, int row, int start_column, int end_column, int offset) {
    struct guac_terminal_char *src;
    struct guac_terminal_char *dst;
    struct guac_terminal_buffer_row *buffer_row = guac_terminal_buffer_get_row(buffer, row, end_column + offset + 1);
    start_column = guac_terminal_fit_to_range(start_column, 0, buffer_row->length - 1);
    end_column = guac_terminal_fit_to_range(end_column, 0, buffer_row->length - 1);
    start_column = guac_terminal_fit_to_range(start_column + offset, 0, buffer_row->length - 1) - offset;
    end_column = guac_terminal_fit_to_range(end_column + offset, 0, buffer_row->length - 1) - offset;
    src = &(buffer_row->characters[start_column]);
    dst = &(buffer_row->characters[start_column + offset]);
    memmove(dst, src, sizeof(guac_terminal_char) * (end_column - start_column + 1));
}

variable_types: offset int

variable_types: struct guac_terminal_char { int value; struct guac_terminal_attributes { _Bool bold; _Bool reverse; _Bool cursor; _Bool underscore; int foreground; int background; } attributes; } *


decompiled_code:
__int64 __fastcall guac_terminal_buffer_copy_rows(const __m128i *a1, int a2, int a3, int a4)
{
__int64 result; // rax
int v5; // er15
int v6; // er14
int v7; // er13
__int64 v8; // rbx
int v9; // esi
__int64 v10; // rbp

result = 1LL;
v5 = -1;
v6 = a3;
if ( a4 <= 0 )
v6 = a2;
if ( a4 <= 0 )
v5 = 1;
if ( a2 <= a3 )
{
v7 = a2;
do
{
++v7;
v8 = guac_terminal_buffer_get_row(a1, v6, 0);
v9 = v6 + a4;
v6 += v5;
v10 = guac_terminal_buffer_get_row(a1, v9, *(_DWORD *)(v8 + 8));
memcpy(*(void **)v10, *(const void **)v8, 16LL * *(int *)(v8 + 8));
result = *(unsigned int *)(v8 + 8);
*(_DWORD *)(v10 + 8) = result;
}
while ( a3 >= v7 );
}
return result;
}

original_code:
void guac_terminal_buffer_copy_rows(guac_terminal_buffer* buffer,
        int start_row, int end_row, int offset) {
    int i, current_row;
    int step;
    if (offset > 0) {
        current_row = end_row;
        step = -1;
    }
    else {
        current_row = start_row;
        step = 1;
    }
    for (i = start_row; i <= end_row; i++) {
        guac_terminal_buffer_row* src_row = guac_terminal_buffer_get_row(buffer, current_row, 0);
        guac_terminal_buffer_row* dst_row = guac_terminal_buffer_get_row(buffer, current_row + offset, src_row->length);
        memcpy(dst_row->characters, src_row->characters, sizeof(guac_terminal_char) * src_row->length);
        dst_row->length = src_row->length;
        current_row += step;
    }
}

canonical_original_code:
void guac_terminal_buffer_copy_rows(struct guac_terminal_buffer *buffer, int start_row, int end_row, int offset) {
    int i; int current_row;
    int step;
    if (offset > 0) {
        current_row = end_row;
        step = -1;
    }
    else {
        current_row = start_row;
        step = 1;
    }
    for (i = start_row; i <= end_row; i++) {
        struct guac_terminal_buffer_row *src_row = guac_terminal_buffer_get_row(buffer, current_row, 0);
        struct guac_terminal_buffer_row *dst_row = guac_terminal_buffer_get_row(buffer, current_row + offset, src_row->length);
        memcpy(dst_row->characters, src_row->characters, sizeof(guac_terminal_char) * src_row->length);
        dst_row->length = src_row->length;
        current_row += step;
    }
}

variable_types: step int

user_defined_types: struct guac_terminal_attributes { _Bool bold; _Bool reverse; _Bool cursor; _Bool underscore; int foreground; int background; }


decompiled_code:
__int64 __fastcall guac_terminal_buffer_set_columns(const __m128i *a1, int a2, int a3, int a4, const __m128i *a5)
{
__int64 result; // rax
__int64 v9; // rdx

result = *(_QWORD *)guac_terminal_buffer_get_row(a1, a2, a4 + 1) + 16LL * a3;
if ( a4 >= a3 )
{
v9 = result + 16 * ((unsigned int)(a4 - a3) + 1LL);
do
{
result += 16LL;
*(__m128i *)(result - 16) = _mm_loadu_si128(a5);
}
while ( result != v9 );
}
if ( a1[1].m128i_i32[3] <= a2 )
a1[1].m128i_i32[3] = a2 + 1;
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(const __m128i *a1, int a2, int a3, int a4, const __m128i *a5)
{
__int64 result; // rax
__int64 v9; // rdx

result = *(_QWORD *)func1(a1, a2, a4 + 1) + 16LL * a3;
if ( a4 >= a3 )
{
v9 = result + 16 * ((unsigned int)(a4 - a3) + 1LL);
do
{
result += 16LL;
*(__m128i *)(result - 16) = _mm_loadu_si128(a5);
}
while ( result != v9 );
}
if ( a1[1].m128i_i32[3] <= a2 )
a1[1].m128i_i32[3] = a2 + 1;
return result;
}

original_code:
void guac_terminal_buffer_set_columns(guac_terminal_buffer* buffer, int row,
        int start_column, int end_column, guac_terminal_char* character) {
    int i;
    guac_terminal_char* current;
    guac_terminal_buffer_row* buffer_row = guac_terminal_buffer_get_row(buffer, row, end_column+1);
    current = &(buffer_row->characters[start_column]);
    for (i=start_column; i<=end_column; i++)
        *(current++) = *character;
    if (row >= buffer->length)
        buffer->length = row+1;
}

canonical_original_code:
void guac_terminal_buffer_set_columns(struct guac_terminal_buffer *buffer, int row, int start_column, int end_column, struct guac_terminal_char *character) {
    int i;
    struct guac_terminal_char *current;
    struct guac_terminal_buffer_row *buffer_row = guac_terminal_buffer_get_row(buffer, row, end_column+1);
    current = &(buffer_row->characters[start_column]);
    for (i=start_column; i<=end_column; i++)
        *(current++) = *character;
    if (row >= buffer->length)
        buffer->length = row+1;
}

variable_types:
character
struct guac_terminal_char *


decompiled_code:
void __fastcall guac_ssh_cursor_free(__int64 a1, _QWORD *a2)
{
guac_client_free_buffer(a1, *a2);
free(a2);
}

canonical_decompiled_code:
void __fastcall func0(__int64 a1, _QWORD *a2)
{
guac_client_free_buffer(a1, *a2);
free(a2);
}

original_code:
void guac_ssh_cursor_free(guac_client* client, guac_ssh_cursor* cursor) {
    guac_client_free_buffer(client, cursor->buffer);
    free(cursor);
}

canonical_original_code:
void guac_ssh_cursor_free(struct guac_client *client, struct guac_ssh_cursor *cursor) {
    guac_client_free_buffer(client, cursor->buffer);
    free(cursor);
}

variable_types: struct guac_client { struct guac_socket { void *data; long (*read_handler)(struct guac_socket *socket, void *buf, unsigned long count); long (*write_handler)(struct guac_socket *socket, void *buf, unsigned long count); int (*select_handler)(struct guac_socket *socket, int usec_timeout); int (*free_handler)(struct guac_socket *socket); int __ready; int __ready_buf[3]; int __written; char __out_buf[8192]; int __instructionbuf_parse_start; int __instructionbuf_size; int __instructionbuf_used_length; char *__instructionbuf; int __instructionbuf_elementc; char *__instructionbuf_elementv[64]; int __threadsafe_instructions; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } __instruction_write_lock; union pthread_mutex_t __buffer_lock; } *socket; enum guac_client_state { GUAC_CLIENT_RUNNING=0, GUAC_CLIENT_STOPPING=1 } state; long last_received_timestamp; long last_sent_timestamp; struct guac_client_info { int optimal_width; int optimal_height; char **audio_mimetypes; char **video_mimetypes; } info; void *data; int (*handle_messages)(struct guac_client *client); int (*mouse_handler)(struct guac_client *client, int x, int y, int button_mask); int (*key_handler)(struct guac_client *client, int keysym, int pressed); int (*clipboard_handler)(struct guac_client *client, char *copied); int (*size_handler)(struct guac_client *client, int width, int height); int (*free_handler)(struct guac_client *client); void (*log_info_handler)(struct guac_client *client, char *format, __builtin_va_list args); void (*log_error_handler)(struct guac_client *client, char *format, __builtin_va_list args); struct guac_pool { int min_size; int __next_value; struct guac_pool_int { int value; struct guac_pool_int *__next; } *__head; struct guac_pool_int *__tail; } *__buffer_pool; struct guac_pool *__layer_pool; struct guac_pool *__stream_pool; } *

variable_types: struct guac_ssh_cursor { struct guac_layer { int index; } *buffer; int width; int height; int hotspot_x; int hotspot_y; } *

user_defined_types: struct guac_client { struct guac_socket *socket; enum guac_client_state state; long last_received_timestamp; long last_sent_timestamp; struct guac_client_info info; void *data; int (*handle_messages)(struct guac_client *client); int (*mouse_handler)(struct guac_client *client, int x, int y, int button_mask); int (*key_handler)(struct guac_client *client, int keysym, int pressed); int (*clipboard_handler)(struct guac_client *client, char *copied); int (*size_handler)(struct guac_client *client, int width, int height); int (*free_handler)(struct guac_client *client); void (*log_info_handler)(struct guac_client *client, char *format, __builtin_va_list args); void (*log_error_handler)(struct guac_client *client, char *format, __builtin_va_list args); struct guac_pool *__buffer_pool; struct guac_pool *__layer_pool; struct guac_pool *__stream_pool; }

user_defined_types: struct guac_ssh_cursor { struct guac_layer *buffer; int width; int height; int hotspot_x; int hotspot_y; }

user_defined_types: struct guac_socket { void *data; long (*read_handler)(struct guac_socket *socket, void *buf, unsigned long count); long (*write_handler)(struct guac_socket *socket, void *buf, unsigned long count); int (*select_handler)(struct guac_socket *socket, int usec_timeout); int (*free_handler)(struct guac_socket *socket); int __ready; int __ready_buf[3]; int __written; char __out_buf[8192]; int __instructionbuf_parse_start; int __instructionbuf_size; int __instructionbuf_used_length; char *__instructionbuf; int __instructionbuf_elementc; char *__instructionbuf_elementv[64]; int __threadsafe_instructions; union pthread_mutex_t __instruction_write_lock; union pthread_mutex_t __buffer_lock; }

user_defined_types: struct guac_pool { int min_size; int __next_value; struct guac_pool_int *__head; struct guac_pool_int *__tail; }

user_defined_types: union pthread_mutex_t { struct __pthread_mutex_s __data; char __size[40]; long __align; }

user_defined_types: struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list __list; }


decompiled_code:
__int64 __fastcall guac_ssh_set_cursor(_QWORD *a1, __int64 a2)
{
return guac_protocol_send_cursor(
*a1,
*(unsigned int *)(a2 + 16),
*(unsigned int *)(a2 + 20),
*(_QWORD *)a2,
0LL,
0LL,
*(unsigned int *)(a2 + 8),
*(unsigned int *)(a2 + 12));
}

canonical_decompiled_code:
__int64 __fastcall func1(_QWORD *a1, __int64 a2)
{
return guac_protocol_send_cursor(
*a1,
*(unsigned int *)(a2 + 16),
*(unsigned int *)(a2 + 20),
*(_QWORD *)a2,
0LL,
0LL,
*(unsigned int *)(a2 + 8),
*(unsigned int *)(a2 + 12));
}

original_code:
void guac_ssh_set_cursor(guac_client* client, guac_ssh_cursor* cursor) {
    guac_protocol_send_cursor(client->socket,
            cursor->hotspot_x, cursor->hotspot_y,
            cursor->buffer,
            0, 0, cursor->width, cursor->height);
}

canonical_original_code:
void guac_ssh_set_cursor(struct guac_client *client, struct guac_ssh_cursor *cursor) {
    guac_protocol_send_cursor(client->socket,
            cursor->hotspot_x, cursor->hotspot_y,
            cursor->buffer,
            0, 0, cursor->width, cursor->height);
}

user_defined_types: enum guac_client_state { GUAC_CLIENT_RUNNING=0, GUAC_CLIENT_STOPPING=1 }

user_defined_types: struct guac_client_info { int optimal_width; int optimal_height; char **audio_mimetypes; char **video_mimetypes; }

user_defined_types: struct guac_pool_int { int value; struct guac_pool_int *__next; }

user_defined_types: struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; }


decompiled_code:
__int64 __fastcall guac_terminal_fit_to_range(signed int a1, unsigned int a2, unsigned int a3)
{
__int64 result; // rax

result = a2;
if ( a1 >= (int)a2 )
{
result = a3;
if ( a1 <= (int)a3 )
result = (unsigned int)a1;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(signed int a1, unsigned int a2, unsigned int a3)
{
__int64 result; // rax

result = a2;
if ( a1 >= (int)a2 )
{
result = a3;
if ( a1 <= (int)a3 )
result = (unsigned int)a1;
}
return result;
}

original_code:
int guac_terminal_fit_to_range(int value, int min, int max) {
    if (value < min) return min;
    if (value > max) return max;
    return value;
}

variable_types: value int

variable_types: min int

variable_types: max int

return_type: int


original_code:
int guac_terminal_encode_utf8(int codepoint, char* utf8) {
    int i;
    int mask, bytes;
    if (codepoint <= 0x007F) {
        mask = 0x00;
        bytes = 1;
    }
    else if (codepoint <= 0x7FF) {
        mask = 0xC0;
        bytes = 2;
    }
    else if (codepoint <= 0xFFFF) {
        mask = 0xE0;
        bytes = 3;
    }
    else if (codepoint <= 0x1FFFFF) {
        mask = 0xF0;
        bytes = 4;
    }
    else {
        *(utf8++) = '?';
        return 1;
    }
    utf8 += bytes - 1;
    for (i=1; i<bytes; i++) {
        *(utf8--) = 0x80 | (codepoint & 0x3F);
        codepoint >>= 6;
    }
    *utf8 = mask | codepoint;
    return bytes;
}

canonical_original_code:
int guac_terminal_encode_utf8(int codepoint, char *utf8) {
    int i;
    int mask; int bytes;
    if (codepoint <= 0x007F) {
        mask = 0x00;
        bytes = 1;
    }
    else if (codepoint <= 0x7FF) {
        mask = 0xC0;
        bytes = 2;
    }
    else if (codepoint <= 0xFFFF) {
        mask = 0xE0;
        bytes = 3;
    }
    else if (codepoint <= 0x1FFFFF) {
        mask = 0xF0;
        bytes = 4;
    }
    else {
        *(utf8++) = '?';
        return 1;
    }
    utf8 += bytes - 1;
    for (i=1; i<bytes; i++) {
        *(utf8--) = 0x80 | (codepoint & 0x3F);
        codepoint >>= 6;
    }
    *utf8 = mask | codepoint;
    return bytes;
}

variable_types: codepoint int

variable_types: i int

variable_types: mask int

variable_types: bytes int


decompiled_code:
bool __fastcall guac_terminal_has_glyph(int a1)
{
return (a1 & 0xFFFFFFDF) != 0;
}

canonical_decompiled_code:
bool __fastcall func2(int a1)
{
return (a1 & 0xFFFFFFDF) != 0;
}

original_code:
_Bool guac_terminal_has_glyph(int codepoint) {
    return
           codepoint != 0
        && codepoint != ' ';
}


decompiled_code:
__int64 __fastcall guac_terminal_write_all(int fd, void *buf, int a3)
{
unsigned int v3; // er12
int v5; // ebx
int v6; // eax

v3 = a3;
if ( a3 <= 0 )
return v3;
v5 = a3;
while ( 1 )
{
v6 = write(fd, buf, v5);
if ( v6 <= 0 )
break;
v5 -= v6;
buf = (char *)buf + v6;
if ( v5 <= 0 )
return v3;
}
return 0xFFFFFFFFLL;
}

canonical_decompiled_code:
__int64 __fastcall func3(int fd, void *buf, int a3)
{
unsigned int v3; // er12
int v5; // ebx
int v6; // eax

v3 = a3;
if ( a3 <= 0 )
return v3;
v5 = a3;
while ( 1 )
{
v6 = write(fd, buf, v5);
if ( v6 <= 0 )
break;
v5 -= v6;
buf = (char *)buf + v6;
if ( v5 <= 0 )
return v3;
}
return 0xFFFFFFFFLL;
}

original_code:
int guac_terminal_write_all(int fd, const char* buffer, int size) {
    int remaining = size;
    while (remaining > 0) {
        int ret_val = write(fd, buffer, remaining);
        if (ret_val <= 0)
            return -1;
        remaining -= ret_val;
        buffer += ret_val;
    }
    return size;
}

canonical_original_code:
int guac_terminal_write_all(int fd, char *buffer, int size) {
    int remaining = size;
    while (remaining > 0) {
        int ret_val = write(fd, buffer, remaining);
        if (ret_val <= 0)
            return -1;
        remaining -= ret_val;
        buffer += ret_val;
    }
    return size;
}

variable_types: fd int

variable_types:
buffer
char *

variable_types: size int

variable_types: remaining int


canonical_name: main

repo: CaillaRose/PaddyHW

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

v3 = atoi(argv[1]);
if ( v3 > 0 )
{
v4 = v3;
for ( i = 1; v4 >= (int)i; ++i )
{
while ( (unsigned int)isSquare(i) != 1 )
{
printf("%d is neither a square or triangular number.\n", i);
LABEL_4:
if ( v4 < (int)++i )
return 0;
}
printf("%d is a square number!\n", i);
if ( (unsigned int)isTriangle(i) == 1 )
{
printf("%d is also a Triangular Number!\n", i);
goto LABEL_4;
}
puts("But is not also a triangular number...");
}
}
return 0;
}

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

v3 = atoi(argv[1]);
if ( v3 > 0 )
{
v4 = v3;
for ( i = 1; v4 >= (int)i; ++i )
{
while ( (unsigned int)func7(i) != 1 )
{
printf("%d is neither a square or triangular number.\n", i);
LABEL_4:
if ( v4 < (int)++i )
return 0;
}
printf("%d is a square number!\n", i);
if ( (unsigned int)func8(i) == 1 )
{
printf("%d is also a Triangular Number!\n", i);
goto LABEL_4;
}
puts("But is not also a triangular number...");
}
}
return 0;
}

original_code:
int main(int argc, char *argv[])
{
 int n = atoi(argv[1]);
 int i,testSq,testTri;
 for (i=1; i<=n; i++)
 {
  testSq = isSquare(i);
  if (testSq == 1)
  {
   printf("%d is a square number!\n", i);
   testTri = isTriangle(i);
   if (testTri == 1)
   {
    printf("%d is also a Triangular Number!\n", i);
   }
   else
   {
    printf("But is not also a triangular number...\n");
   }
  }
  else
  {
    printf("%d is neither a square or triangular number.\n", i);
  }
 }
 return 0;
}

canonical_original_code:
int main(int argc, char *argv[])
{
 int n = atoi(argv[1]);
 int i; int testSq; int testTri;
 for (i=1; i<=n; i++)
 {
  testSq = isSquare(i);
  if (testSq == 1)
  {
   printf("%d is a square number!\n", i);
   testTri = isTriangle(i);
   if (testTri == 1)
   {
    printf("%d is also a Triangular Number!\n", i);
   }
   else
   {
    printf("But is not also a triangular number...\n");
   }
  }
  else
  {
    printf("%d is neither a square or triangular number.\n", i);
  }
 }
 return 0;
}

variable_types: argc int

variable_types:
argv
char *[]

variable_types: n int

variable_types: testSq int

variable_types: testTri int


isSquare

decompiled_code:
_BOOL8 __fastcall isSquare(int a1)
{
double v1; // xmm0_8
double v2; // xmm0_8

v1 = (double)a1;
if ( (double)a1 < 0.0 )
v2 = sqrt(v1);
else
v2 = sqrt(v1);
return (int)v2 * (int)v2 == a1;
}

canonical_decompiled_code:
_BOOL8 __fastcall func7(int a1)
{
double v1; // xmm0_8
double v2; // xmm0_8

v1 = (double)a1;
if ( (double)a1 < 0.0 )
v2 = sqrt(v1);
else
v2 = sqrt(v1);
return (int)v2 * (int)v2 == a1;
}

original_code:
int isSquare(int i)
{
 int root = (sqrt(i));
 if(root*root == i) return 1;
 else return 0;
}

variable_types: root int


isTriangle

decompiled_code:
_BOOL8 __fastcall isTriangle(int a1)
{
return isSquare(8 * a1 + 1);
}

canonical_decompiled_code:
_BOOL8 __fastcall func8(int a1)
{
return func7(8 * a1 + 1);
}

original_code:
int isTriangle(int i)
{
 int test = (8*i)+1;
 int testSq = isSquare(test);
 if(testSq == 1) return 1;
 else return 0;
}

variable_types: test int


repo: Caltoopia/caltoopia-calvin

decompiled_code:
void __fastcall ActorInstance_RVC_decoder__texture_Y__idct2d__clip_constructor(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

canonical_decompiled_code:
void __fastcall func6(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

original_code:
static void ActorInstance_RVC_decoder__texture_Y__idct2d__clip_constructor(AbstractActorInstance *pBase) {
  ActorInstance_RVC_decoder__texture_Y__idct2d__clip *thisActor=(ActorInstance_RVC_decoder__texture_Y__idct2d__clip*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

canonical_original_code:
static void ActorInstance_RVC_decoder__texture_Y__idct2d__clip_constructor(struct AbstractActorInstance *pBase) {
  struct ActorInstance_RVC_decoder__texture_Y__idct2d__clip *thisActor = (ActorInstance_RVC_decoder__texture_Y__idct2d__clip*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

variable_types: struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } *

variable_types: struct ActorInstance_RVC_decoder__texture_Y__idct2d__clip { struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } base; int _fsmState; int sflag; } *

user_defined_types: struct AbstractActorInstance { struct dllist_link_tag listEntry; struct ActorClass *actorClass; char *instanceName; int numInputPorts; struct InputPort *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); }

user_defined_types: struct ActorInstance_RVC_decoder__texture_Y__idct2d__clip { struct AbstractActorInstance base; int _fsmState; int sflag; }

user_defined_types: struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); }

user_defined_types: struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort *producer; struct LocalInputPort localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; }

user_defined_types: struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn *functions; }

user_defined_types: struct OutputPort { struct LocalOutputPort localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t consumers; }

user_defined_types: struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t mutex; }


decompiled_code:
__int64 __fastcall pinRead_bool_t(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
unsigned int v3; // er8
_DWORD *v4; // rdx

v1 = *(_DWORD *)(a1 + 24);
v2 = *(unsigned int **)(a1 + 16);
if ( !v1 )
__assert_fail("p->available > 0", "../../actors-fifo.h", 0x6Bu, "pinRead_bool_t");
v3 = *v2;
v4 = v2 + 1;
if ( *(_QWORD *)(a1 + 8) <= (unsigned __int64)(v2 + 1) )
v4 = *(_DWORD **)a1;
*(_QWORD *)(a1 + 16) = v4;
*(_DWORD *)(a1 + 24) = v1 - 1;
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
unsigned int v3; // er8
_DWORD *v4; // rdx

v1 = *(_DWORD *)(a1 + 24);
v2 = *(unsigned int **)(a1 + 16);
if ( !v1 )
__assert_fail("p->available > 0", "../../actors-fifo.h", 0x6Bu, "pinRead_bool_t");
v3 = *v2;
v4 = v2 + 1;
if ( *(_QWORD *)(a1 + 8) <= (unsigned __int64)(v2 + 1) )
v4 = *(_DWORD **)a1;
*(_QWORD *)(a1 + 16) = v4;
*(_DWORD *)(a1 + 24) = v1 - 1;
return v3;
}

original_code:
static inline bool_t pinRead_bool_t(LocalInputPort *p)
{
  const bool_t *readPtr=(const bool_t *) p->readPtr;
  bool_t result;
  ((void) sizeof ((p->available > 0) ? 1 : 0), __extension__ ({ if (p->available > 0) ; else __assert_fail ("p->available > 0", "../../actors-fifo.h", 107, __extension__ __PRETTY_FUNCTION__); }));
  result = (bool_t) *readPtr++;
  if (readPtr >= (const bool_t*) p->bufferEnd)
    readPtr = (const bool_t*)p->bufferStart;
  p->readPtr=readPtr;
  p->available--;
  return result;
}

canonical_original_code:
static inline int pinRead_bool_t(struct LocalInputPort *p)
{
  int *readPtr = (const bool_t *) p->readPtr;
  int result;
  ((void) sizeof ((p->available > 0) ? 1 : 0), __extension__ ({ if (p->available > 0) ; else __assert_fail ("p->available > 0", "../../actors-fifo.h", 107, __extension__ __PRETTY_FUNCTION__); }));
  result = (bool_t) *readPtr++;
  if (readPtr >= (int *) p->bufferEnd)
    readPtr = (int *)p->bufferStart;
  p->readPtr=readPtr;
  p->available--;
  return result;
}

variable_types: struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } *

variable_types:
readPtr
int *

variable_types: result int


decompiled_code:
void *__fastcall RVC_decoder__texture_Y__idct2d__clip_action_scheduler(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( !v1 )
goto LABEL_8;
}
while ( v1 != 1 );
while ( (unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) > 0x3F
&& (unsigned int)pinAvailOut_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) > 0x3F )
{
action1(a1);
*(_DWORD *)(a1 + 72) = 0;
LABEL_8:
if ( !(unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) )
break;
action0__read_signed(a1);
*(_DWORD *)(a1 + 72) = 1;
}
return &exitcode_block_Any;
}

canonical_decompiled_code:
void *__fastcall func14(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( !v1 )
goto LABEL_8;
}
while ( v1 != 1 );
while ( (unsigned int)func13(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) > 0x3F
&& (unsigned int)func12(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) > 0x3F )
{
func11(a1);
*(_DWORD *)(a1 + 72) = 0;
LABEL_8:
if ( !(unsigned int)func13(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) )
break;
func8(a1);
*(_DWORD *)(a1 + 72) = 1;
}
return &exitcode_block_Any;
}

original_code:
static const int *RVC_decoder__texture_Y__idct2d__clip_action_scheduler(AbstractActorInstance *pBase) {
  const int *result = exit_code_yield;
  ActorInstance_RVC_decoder__texture_Y__idct2d__clip *thisActor=(ActorInstance_RVC_decoder__texture_Y__idct2d__clip*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_bool_t(&(thisActor->base.inputPort[1].localInputPort)) >= 1)) {
          action0__read_signed(thisActor);
          thisActor->_fsmState = 1;
          continue;
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action1__clip(thisActor);
            thisActor->_fsmState = 0;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

canonical_original_code:
static int *RVC_decoder__texture_Y__idct2d__clip_action_scheduler(struct AbstractActorInstance *pBase) {
  int *result = exit_code_yield;
  struct ActorInstance_RVC_decoder__texture_Y__idct2d__clip *thisActor = (ActorInstance_RVC_decoder__texture_Y__idct2d__clip*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_bool_t(&(thisActor->base.inputPort[1].localInputPort)) >= 1)) {
          action0__read_signed(thisActor);
          thisActor->_fsmState = 1;
          continue;
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action1__clip(thisActor);
            thisActor->_fsmState = 0;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

variable_types:
result
int *

variable_types:
context
void *

return_type: int *

user_defined_types: struct dllist_link_tag { struct dllist_link_tag *suc; }

user_defined_types: struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; }

user_defined_types: struct ActionDescription { char *name; int *consumption; int *production; }

user_defined_types: struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; }

user_defined_types: struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); }


decompiled_code:
void __fastcall ActorInstance_RVC_decoder__texture_V__idct2d__clip_constructor(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

original_code:
static void ActorInstance_RVC_decoder__texture_V__idct2d__clip_constructor(AbstractActorInstance *pBase) {
  ActorInstance_RVC_decoder__texture_V__idct2d__clip *thisActor=(ActorInstance_RVC_decoder__texture_V__idct2d__clip*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

canonical_original_code:
static void ActorInstance_RVC_decoder__texture_V__idct2d__clip_constructor(struct AbstractActorInstance *pBase) {
  struct ActorInstance_RVC_decoder__texture_V__idct2d__clip *thisActor = (ActorInstance_RVC_decoder__texture_V__idct2d__clip*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

variable_types: struct ActorInstance_RVC_decoder__texture_V__idct2d__clip { struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } base; int _fsmState; int sflag; } *

user_defined_types: struct ActorInstance_RVC_decoder__texture_V__idct2d__clip { struct AbstractActorInstance base; int _fsmState; int sflag; }

user_defined_types: union pthread_mutex_t { struct __pthread_mutex_s __data; char __size[40]; long __align; }

user_defined_types: struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list __list; }


decompiled_code:
void *__fastcall RVC_decoder__texture_V__idct2d__clip_action_scheduler(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( !v1 )
goto LABEL_8;
}
while ( v1 != 1 );
while ( (unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) > 0x3F
&& (unsigned int)pinAvailOut_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) > 0x3F )
{
action1(a1);
*(_DWORD *)(a1 + 72) = 0;
LABEL_8:
if ( !(unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) )
break;
action0__read_signed(a1);
*(_DWORD *)(a1 + 72) = 1;
}
return &exitcode_block_Any;
}

original_code:
static const int *RVC_decoder__texture_V__idct2d__clip_action_scheduler(AbstractActorInstance *pBase) {
  const int *result = exit_code_yield;
  ActorInstance_RVC_decoder__texture_V__idct2d__clip *thisActor=(ActorInstance_RVC_decoder__texture_V__idct2d__clip*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_bool_t(&(thisActor->base.inputPort[1].localInputPort)) >= 1)) {
          action0__read_signed(thisActor);
          thisActor->_fsmState = 1;
          continue;
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action1__clip(thisActor);
            thisActor->_fsmState = 0;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

canonical_original_code:
static int *RVC_decoder__texture_V__idct2d__clip_action_scheduler(struct AbstractActorInstance *pBase) {
  int *result = exit_code_yield;
  struct ActorInstance_RVC_decoder__texture_V__idct2d__clip *thisActor = (ActorInstance_RVC_decoder__texture_V__idct2d__clip*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_bool_t(&(thisActor->base.inputPort[1].localInputPort)) >= 1)) {
          action0__read_signed(thisActor);
          thisActor->_fsmState = 1;
          continue;
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action1__clip(thisActor);
            thisActor->_fsmState = 0;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}


decompiled_code:
void __fastcall ActorInstance_RVC_decoder__GEN_mgnt_Merger420_constructor(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

original_code:
static void ActorInstance_RVC_decoder__GEN_mgnt_Merger420_constructor(AbstractActorInstance *pBase) {
  ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor=(ActorInstance_RVC_decoder__GEN_mgnt_Merger420*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

canonical_original_code:
static void ActorInstance_RVC_decoder__GEN_mgnt_Merger420_constructor(struct AbstractActorInstance *pBase) {
  struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor = (ActorInstance_RVC_decoder__GEN_mgnt_Merger420*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

variable_types: struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 { struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } base; int _fsmState; } *

user_defined_types: struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 { struct AbstractActorInstance base; int _fsmState; }


decompiled_code:
void *__fastcall pinReadRepeat_int32_t(char **a1, char *a2, unsigned int a3)
{
size_t v3; // r8
char *v6; // rsi
unsigned int v7; // eax
unsigned __int64 v8; // r12
char *v9; // rbp
void *result; // rax
size_t v11; // r13
char *v12; // rax

v3 = 4LL * (int)a3;
v6 = a1[2];
v7 = *((_DWORD *)a1 + 6);
v8 = (unsigned __int64)a1[1];
v9 = &v6[v3];
if ( v7 < a3 )
__assert_fail("p->available >= n", "../../actors-fifo.h", 0x7Eu, "pinReadRepeat_int32_t");
*((_DWORD *)a1 + 6) = v7 - a3;
if ( (unsigned __int64)v9 >= v8 )
{
v11 = (int)v8 - (int)v6;
v12 = (char *)memcpy(a2, v6, v11);
v6 = *a1;
v3 = (size_t)&v9[-v8];
a2 = &v12[v11];
v9 = &v9[(_QWORD)*a1 - v8];
}
result = memcpy(a2, v6, v3);
a1[2] = v9;
return result;
}

canonical_decompiled_code:
void *__fastcall func7(char **a1, char *a2, unsigned int a3)
{
size_t v3; // r8
char *v6; // rsi
unsigned int v7; // eax
unsigned __int64 v8; // r12
char *v9; // rbp
void *result; // rax
size_t v11; // r13
char *v12; // rax

v3 = 4LL * (int)a3;
v6 = a1[2];
v7 = *((_DWORD *)a1 + 6);
v8 = (unsigned __int64)a1[1];
v9 = &v6[v3];
if ( v7 < a3 )
__assert_fail("p->available >= n", "../../actors-fifo.h", 0x7Eu, "pinReadRepeat_int32_t");
*((_DWORD *)a1 + 6) = v7 - a3;
if ( (unsigned __int64)v9 >= v8 )
{
v11 = (int)v8 - (int)v6;
v12 = (char *)memcpy(a2, v6, v11);
v6 = *a1;
v3 = (size_t)&v9[-v8];
a2 = &v12[v11];
v9 = &v9[(_QWORD)*a1 - v8];
}
result = memcpy(a2, v6, v3);
a1[2] = v9;
return result;
}

original_code:
static inline void pinReadRepeat_int32_t(LocalInputPort *p,
                                            int32_t *buf,
                                            int n)
{
  const char *startPtr=(char*) p->readPtr;
  const char *endPtr=(char*) ((int32_t*) startPtr + n);
  const char *bufferEnd=(char*) p->bufferEnd;
  ((void) sizeof ((p->available >= n) ? 1 : 0), __extension__ ({ if (p->available >= n) ; else __assert_fail ("p->available >= n", "../../actors-fifo.h", 126, __extension__ __PRETTY_FUNCTION__); }));
  p->available -= n;
  if (endPtr >= bufferEnd) {
    int numBytes=bufferEnd-startPtr;
    memcpy(buf, startPtr, numBytes);
    buf=(int32_t*) ((char*) buf + numBytes);
    startPtr=p->bufferStart;
    endPtr=startPtr+(endPtr-bufferEnd);
  }
  memcpy(buf, startPtr, endPtr-startPtr);
  p->readPtr=endPtr;
}

canonical_original_code:
static inline void pinReadRepeat_int32_t(struct LocalInputPort *p, int *buf, int n)
{
  char *startPtr = (char*) p->readPtr;
  char *endPtr = (char*) ((int32_t*) startPtr + n);
  char *bufferEnd = (char*) p->bufferEnd;
  ((void) sizeof ((p->available >= n) ? 1 : 0), __extension__ ({ if (p->available >= n) ; else __assert_fail ("p->available >= n", "../../actors-fifo.h", 126, __extension__ __PRETTY_FUNCTION__); }));
  p->available -= n;
  if (endPtr >= bufferEnd) {
    int numBytes = bufferEnd-startPtr;
    memcpy(buf, startPtr, numBytes);
    buf=(int *) ((char *) buf + numBytes);
    startPtr=p->bufferStart;
    endPtr=startPtr+(endPtr-bufferEnd);
  }
  memcpy(buf, startPtr, endPtr-startPtr);
  p->readPtr=endPtr;
}

variable_types:
buf
int *

variable_types:
startPtr
char *

variable_types:
endPtr
char *

variable_types:
bufferEnd
char *

variable_types: numBytes int


decompiled_code:
void *__fastcall pinWriteRepeat_int32_t(char **a1, char *a2, unsigned int a3)
{
size_t v3; // r8
char *v5; // rdi
unsigned int v6; // eax
unsigned __int64 v7; // r13
char *v8; // r12
void *result; // rax
size_t v10; // r14

v3 = 4LL * (int)a3;
v5 = a1[2];
v6 = *((_DWORD *)a1 + 6);
v7 = (unsigned __int64)a1[1];
v8 = &v5[v3];
if ( v6 < a3 )
__assert_fail("p->spaceLeft >= n", "../../actors-fifo.h", 0x55u, "pinWriteRepeat_int32_t");
*((_DWORD *)a1 + 6) = v6 - a3;
if ( (unsigned __int64)v8 >= v7 )
{
v10 = (int)v7 - (int)v5;
memcpy(v5, a2, v10);
v5 = *a1;
v3 = (size_t)&v8[-v7];
a2 += v10;
v8 = &v8[(_QWORD)*a1 - v7];
}
result = memcpy(v5, a2, v3);
a1[2] = v8;
return result;
}

canonical_decompiled_code:
void *__fastcall func8(char **a1, char *a2, unsigned int a3)
{
size_t v3; // r8
char *v5; // rdi
unsigned int v6; // eax
unsigned __int64 v7; // r13
char *v8; // r12
void *result; // rax
size_t v10; // r14

v3 = 4LL * (int)a3;
v5 = a1[2];
v6 = *((_DWORD *)a1 + 6);
v7 = (unsigned __int64)a1[1];
v8 = &v5[v3];
if ( v6 < a3 )
__assert_fail("p->spaceLeft >= n", "../../actors-fifo.h", 0x55u, "pinWriteRepeat_int32_t");
*((_DWORD *)a1 + 6) = v6 - a3;
if ( (unsigned __int64)v8 >= v7 )
{
v10 = (int)v7 - (int)v5;
memcpy(v5, a2, v10);
v5 = *a1;
v3 = (size_t)&v8[-v7];
a2 += v10;
v8 = &v8[(_QWORD)*a1 - v7];
}
result = memcpy(v5, a2, v3);
a1[2] = v8;
return result;
}

original_code:
static inline void pinWriteRepeat_int32_t(LocalOutputPort *p,
                                             int32_t *buf,
                                             int n)
{
  char *startPtr=(char*) p->writePtr;
  char *endPtr=(char*) ((int32_t*) startPtr + n);
  char *bufferEnd=(char*) p->bufferEnd;
  ((void) sizeof ((p->spaceLeft >= n) ? 1 : 0), __extension__ ({ if (p->spaceLeft >= n) ; else __assert_fail ("p->spaceLeft >= n", "../../actors-fifo.h", 85, __extension__ __PRETTY_FUNCTION__); }));
  p->spaceLeft -= n;
  if (endPtr >= bufferEnd) {
    int numBytes=bufferEnd-startPtr;
    memcpy(startPtr, buf, numBytes);
    buf=(int32_t*) ((char*) buf + numBytes);
    startPtr=p->bufferStart;
    endPtr=startPtr+(endPtr-bufferEnd);
  }
  memcpy(startPtr,buf,endPtr-startPtr);
  p->writePtr=endPtr;
}

canonical_original_code:
static inline void pinWriteRepeat_int32_t(struct LocalOutputPort *p, int *buf, int n)
{
  char *startPtr = (char*) p->writePtr;
  char *endPtr = (char*) ((int32_t*) startPtr + n);
  char *bufferEnd = (char*) p->bufferEnd;
  ((void) sizeof ((p->spaceLeft >= n) ? 1 : 0), __extension__ ({ if (p->spaceLeft >= n) ; else __assert_fail ("p->spaceLeft >= n", "../../actors-fifo.h", 85, __extension__ __PRETTY_FUNCTION__); }));
  p->spaceLeft -= n;
  if (endPtr >= bufferEnd) {
    int numBytes = bufferEnd-startPtr;
    memcpy(startPtr, buf, numBytes);
    buf=(int *) ((char *) buf + numBytes);
    startPtr=p->bufferStart;
    endPtr=startPtr+(endPtr-bufferEnd);
  }
  memcpy(startPtr,buf,endPtr-startPtr);
  p->writePtr=endPtr;
}

variable_types: struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } *

variable_types: n int


decompiled_code:
void __fastcall action0__Ya(__int64 a1)
{
char *v1; // rbp

v1 = (char *)malloc(0x400uLL);
pinReadRepeat_int32_t((char **)(*(_QWORD *)(a1 + 40) + 24LL), v1, 0x100u);
pinWriteRepeat_int32_t(*(char ***)(a1 + 56), v1, 0x100u);
free(v1);
}

original_code:
static void action0__Ya(ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor) {
  int32_t* y;
  ;
  y = malloc((sizeof(int32_t) * 256));
  pinReadRepeat_int32_t(&(thisActor->base.inputPort[0].localInputPort), y, 256);
  pinWriteRepeat_int32_t(&(thisActor->base.outputPort[0].localOutputPort), y, 256);
  free((void*) y);
  ;
}

canonical_original_code:
static void action0__Ya(struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor) {
  int *y;
  ;
  y = malloc((sizeof(int) * 256));
  pinReadRepeat_int32_t(&(thisActor->base.inputPort[0].localInputPort), y, 256);
  pinWriteRepeat_int32_t(&(thisActor->base.outputPort[0].localOutputPort), y, 256);
  free((void *) y);
  ;
}

variable_types:
y
int *

user_defined_types: struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; }


decompiled_code:
void __fastcall action1__Ua(__int64 a1)
{
char *v1; // rbp

v1 = (char *)malloc(0x100uLL);
pinReadRepeat_int32_t((char **)(*(_QWORD *)(a1 + 40) + 128LL), v1, 0x40u);
pinWriteRepeat_int32_t(*(char ***)(a1 + 56), v1, 0x40u);
free(v1);
}

original_code:
static void action1__Ua(ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor) {
  int32_t* u;
  ;
  u = malloc((sizeof(int32_t) * 64));
  pinReadRepeat_int32_t(&(thisActor->base.inputPort[1].localInputPort), u, 64);
  pinWriteRepeat_int32_t(&(thisActor->base.outputPort[0].localOutputPort), u, 64);
  free((void*) u);
  ;
}

canonical_original_code:
static void action1__Ua(struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor) {
  int *u;
  ;
  u = malloc((sizeof(int) * 64));
  pinReadRepeat_int32_t(&(thisActor->base.inputPort[1].localInputPort), u, 64);
  pinWriteRepeat_int32_t(&(thisActor->base.outputPort[0].localOutputPort), u, 64);
  free((void *) u);
  ;
}

variable_types:
u
int *

user_defined_types: struct AbstractActorInstance { struct dllist_link_tag listEntry; struct ActorClass *actorClass; char *instanceName; int numInputPorts; struct InputPort *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); }


decompiled_code:
void __fastcall action2__Va(__int64 a1)
{
char *v1; // rbp

v1 = (char *)malloc(0x100uLL);
pinReadRepeat_int32_t((char **)(*(_QWORD *)(a1 + 40) + 232LL), v1, 0x40u);
pinWriteRepeat_int32_t(*(char ***)(a1 + 56), v1, 0x40u);
free(v1);
}

original_code:
static void action2__Va(ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor) {
  int32_t* v;
  ;
  v = malloc((sizeof(int32_t) * 64));
  pinReadRepeat_int32_t(&(thisActor->base.inputPort[2].localInputPort), v, 64);
  pinWriteRepeat_int32_t(&(thisActor->base.outputPort[0].localOutputPort), v, 64);
  free((void*) v);
  ;
}

canonical_original_code:
static void action2__Va(struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor) {
  int *v;
  ;
  v = malloc((sizeof(int) * 64));
  pinReadRepeat_int32_t(&(thisActor->base.inputPort[2].localInputPort), v, 64);
  pinWriteRepeat_int32_t(&(thisActor->base.outputPort[0].localOutputPort), v, 64);
  free((void *) v);
  ;
}

variable_types:
v
int *


decompiled_code:
void *__fastcall RVC_decoder__GEN_mgnt_Merger420_action_scheduler(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( v1 == 1 )
goto LABEL_9;
if ( v1 == 2 )
goto LABEL_12;
}
while ( v1 );
while ( (unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) > 0xFF
&& (unsigned int)pinAvailOut_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) > 0xFF )
{
action0__Ya(a1);
*(_DWORD *)(a1 + 72) = 1;
LABEL_9:
if ( (unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) <= 0x3F
|| (unsigned int)pinAvailOut_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) <= 0x3F )
{
break;
}
action1__Ua(a1);
*(_DWORD *)(a1 + 72) = 2;
LABEL_12:
if ( (unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 256LL)) <= 0x3F
|| (unsigned int)pinAvailOut_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) <= 0x3F )
{
break;
}
action2__Va(a1);
*(_DWORD *)(a1 + 72) = 0;
}
return &exitcode_block_Any;
}

canonical_decompiled_code:
void *__fastcall func14(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( v1 == 1 )
goto LABEL_9;
if ( v1 == 2 )
goto LABEL_12;
}
while ( v1 );
while ( (unsigned int)func13(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) > 0xFF
&& (unsigned int)func12(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) > 0xFF )
{
func9(a1);
*(_DWORD *)(a1 + 72) = 1;
LABEL_9:
if ( (unsigned int)func13(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) <= 0x3F
|| (unsigned int)func12(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) <= 0x3F )
{
break;
}
func10(a1);
*(_DWORD *)(a1 + 72) = 2;
LABEL_12:
if ( (unsigned int)func13(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 256LL)) <= 0x3F
|| (unsigned int)func12(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) <= 0x3F )
{
break;
}
func11(a1);
*(_DWORD *)(a1 + 72) = 0;
}
return &exitcode_block_Any;
}

original_code:
static const int *RVC_decoder__GEN_mgnt_Merger420_action_scheduler(AbstractActorInstance *pBase) {
  const int *result = exit_code_yield;
  ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor=(ActorInstance_RVC_decoder__GEN_mgnt_Merger420*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 256)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 256)) {
            action0__Ya(thisActor);
            thisActor->_fsmState = 1;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[1].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action1__Ua(thisActor);
            thisActor->_fsmState = 2;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 2:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[2].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action2__Va(thisActor);
            thisActor->_fsmState = 0;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

canonical_original_code:
static int *RVC_decoder__GEN_mgnt_Merger420_action_scheduler(struct AbstractActorInstance *pBase) {
  int *result = exit_code_yield;
  struct ActorInstance_RVC_decoder__GEN_mgnt_Merger420 *thisActor = (ActorInstance_RVC_decoder__GEN_mgnt_Merger420*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 256)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 256)) {
            action0__Ya(thisActor);
            thisActor->_fsmState = 1;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[1].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action1__Ua(thisActor);
            thisActor->_fsmState = 2;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 2:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[2].localInputPort)) >= 64)) {
          if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 64)) {
            action2__Va(thisActor);
            thisActor->_fsmState = 0;
            continue;
          } else {
            result = exitcode_block_Any;
            goto out;
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

variable_types: struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } *


rshift

decompiled_code:
__int64 __fastcall rshift(int a1, char a2)
{
return (unsigned int)(a1 >> a2);
}

canonical_decompiled_code:
__int64 __fastcall func6(int a1, char a2)
{
return (unsigned int)(a1 >> a2);
}

original_code: static inline int32_t rshift(int32_t x, int32_t n) { return x >> n; }

canonical_original_code: static inline int rshift(int x, int n) { return x >> n; }

variable_types: x int


decompiled_code:
__int64 __fastcall RVC_decoder__motion_V__interpolationcompensate(__int64 a1, unsigned int a2, int a3, int a4, int a5)
{
__int64 result; // rax
int v6; // esi
int v7; // er9
int v8; // eax

result = a2;
v6 = *(_DWORD *)(a1 + 84);
if ( v6 )
{
v7 = *(_DWORD *)(a1 + 128);
if ( v6 == 1 )
{
result = rshift((int)result + a4 + 1 - v7, 1);
}
else
{
v8 = a3 + result;
if ( v6 == 2 )
result = rshift(v8 + 1 - v7, 1);
else
result = rshift(a5 + a4 + v8 + 2 - v7, 2);
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1, unsigned int a2, int a3, int a4, int a5)
{
__int64 result; // rax
int v6; // esi
int v7; // er9
int v8; // eax

result = a2;
v6 = *(_DWORD *)(a1 + 84);
if ( v6 )
{
v7 = *(_DWORD *)(a1 + 128);
if ( v6 == 1 )
{
result = func6((int)result + a4 + 1 - v7, 1);
}
else
{
v8 = a3 + result;
if ( v6 == 2 )
result = func6(v8 + 1 - v7, 1);
else
result = func6(a5 + a4 + v8 + 2 - v7, 2);
}
}
return result;
}

original_code:
static inline int32_t RVC_decoder__motion_V__interpolationcompensate(ActorInstance_RVC_decoder__motion_V__interpolation* thisActor, int32_t p00, int32_t p10, int32_t p01, int32_t p11){
  return (((thisActor->flags == 0)) ? (p00):((((thisActor->flags == 1)) ? (rshift((((p00 + p01) + 1) - thisActor->round), 1)):((((thisActor->flags == 2)) ? (rshift((((p00 + p10) + 1) - thisActor->round), 1)):(rshift((((((p00 + p10) + p01) + p11) + 2) - thisActor->round), 2)))))));
}

canonical_original_code:
static inline int RVC_decoder__motion_V__interpolationcompensate(struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor, int p00, int p10, int p01, int p11){
  return (((thisActor->flags == 0)) ? (p00):((((thisActor->flags == 1)) ? (rshift((((p00 + p01) + 1) - thisActor->round), 1)):((((thisActor->flags == 2)) ? (rshift((((p00 + p10) + 1) - thisActor->round), 1)):(rshift((((((p00 + p10) + p01) + p11) + 2) - thisActor->round), 2)))))));
}

variable_types: struct ActorInstance_RVC_decoder__motion_V__interpolation { struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } base; int _fsmState; int x; int d5; int flags; int d9; int d1; int d0; int d4; int d6; int d7; int d3; int d2; int y; int d8; int round; } *

user_defined_types: struct ActorInstance_RVC_decoder__motion_V__interpolation { struct AbstractActorInstance base; int _fsmState; int x; int d5; int flags; int d9; int d1; int d0; int d4; int d6; int d7; int d3; int d2; int y; int d8; int round; }


decompiled_code:
void __fastcall ActorInstance_RVC_decoder__motion_V__interpolation_constructor(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

canonical_decompiled_code:
void __fastcall func8(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

original_code:
static void ActorInstance_RVC_decoder__motion_V__interpolation_constructor(AbstractActorInstance *pBase) {
  ActorInstance_RVC_decoder__motion_V__interpolation *thisActor=(ActorInstance_RVC_decoder__motion_V__interpolation*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

canonical_original_code:
static void ActorInstance_RVC_decoder__motion_V__interpolation_constructor(struct AbstractActorInstance *pBase) {
  struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor = (ActorInstance_RVC_decoder__motion_V__interpolation*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

user_defined_types: struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); }


decompiled_code:
__int64 __fastcall pinRead_int32_t(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
unsigned int v3; // er8
_DWORD *v4; // rdx

v1 = *(_DWORD *)(a1 + 24);
v2 = *(unsigned int **)(a1 + 16);
if ( !v1 )
__assert_fail("p->available > 0", "../../actors-fifo.h", 0x6Bu, "pinRead_int32_t");
v3 = *v2;
v4 = v2 + 1;
if ( *(_QWORD *)(a1 + 8) <= (unsigned __int64)(v2 + 1) )
v4 = *(_DWORD **)a1;
*(_QWORD *)(a1 + 16) = v4;
*(_DWORD *)(a1 + 24) = v1 - 1;
return v3;
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
unsigned int v3; // er8
_DWORD *v4; // rdx

v1 = *(_DWORD *)(a1 + 24);
v2 = *(unsigned int **)(a1 + 16);
if ( !v1 )
__assert_fail("p->available > 0", "../../actors-fifo.h", 0x6Bu, "pinRead_int32_t");
v3 = *v2;
v4 = v2 + 1;
if ( *(_QWORD *)(a1 + 8) <= (unsigned __int64)(v2 + 1) )
v4 = *(_DWORD **)a1;
*(_QWORD *)(a1 + 16) = v4;
*(_DWORD *)(a1 + 24) = v1 - 1;
return v3;
}

original_code:
static inline int32_t pinRead_int32_t(LocalInputPort *p)
{
  const int32_t *readPtr=(const int32_t *) p->readPtr;
  int32_t result;
  ((void) sizeof ((p->available > 0) ? 1 : 0), __extension__ ({ if (p->available > 0) ; else __assert_fail ("p->available > 0", "../../actors-fifo.h", 107, __extension__ __PRETTY_FUNCTION__); }));
  result = (int32_t) *readPtr++;
  if (readPtr >= (const int32_t*) p->bufferEnd)
    readPtr = (const int32_t*)p->bufferStart;
  p->readPtr=readPtr;
  p->available--;
  return result;
}

canonical_original_code:
static inline int pinRead_int32_t(struct LocalInputPort *p)
{
  int *readPtr = (const int32_t *) p->readPtr;
  int result;
  ((void) sizeof ((p->available > 0) ? 1 : 0), __extension__ ({ if (p->available > 0) ; else __assert_fail ("p->available > 0", "../../actors-fifo.h", 107, __extension__ __PRETTY_FUNCTION__); }));
  result = (int) *readPtr++;
  if (readPtr >= (int *) p->bufferEnd)
    readPtr = (int *)p->bufferStart;
  p->readPtr=readPtr;
  p->available--;
  return result;
}

variable_types: struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } *

variable_types:
readPtr
int *

variable_types: result int


decompiled_code:
_BOOL8 __fastcall RVC_decoder__motion_V__interpolation__DOLLAR__d1756(__int64 a1, __int64 a2)
{
return *(_DWORD *)(a2 + 120) == 9;
}

original_code:
bool_t RVC_decoder__motion_V__interpolation__DOLLAR__d1756(art_action_context_t *context, ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    bool_t ret;
    ret = (thisActor->y == 9);
    return ret;
  }
}

canonical_original_code:
int RVC_decoder__motion_V__interpolation__DOLLAR__d1756(void *context, struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    int ret;
    ret = (thisActor->y == 9);
    return ret;
  }
}

variable_types:
context
void *

variable_types: ret int

user_defined_types: struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort *producer; struct LocalInputPort localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; }


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

result = 1LL;
if ( *(_DWORD *)(a2 + 76) )
result = *(_DWORD *)(a2 + 120) == 0;
return result;
}

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

result = 1LL;
if ( *(_DWORD *)(a2 + 76) )
result = *(_DWORD *)(a2 + 120) == 0;
return result;
}

original_code:
bool_t RVC_decoder__motion_V__interpolation__DOLLAR__d1763(art_action_context_t *context, ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    bool_t ret;
    ret = ((thisActor->x == 0) || (thisActor->y == 0));
    return ret;
  }
}

canonical_original_code:
int RVC_decoder__motion_V__interpolation__DOLLAR__d1763(void *context, struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    int ret;
    ret = ((thisActor->x == 0) || (thisActor->y == 0));
    return ret;
  }
}

user_defined_types: struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn *functions; }


decompiled_code:
_BOOL8 __fastcall RVC_decoder__motion_V__interpolation__DOLLAR__d1796(__int64 a1, __int64 a2)
{
return *(_DWORD *)(a2 + 76) != 0;
}

canonical_decompiled_code:
_BOOL8 __fastcall func17(__int64 a1, __int64 a2)
{
return *(_DWORD *)(a2 + 76) != 0;
}

original_code:
bool_t RVC_decoder__motion_V__interpolation__DOLLAR__d1796(art_action_context_t *context, ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    bool_t ret;
    ret = (thisActor->x != 0);
    return ret;
  }
}

canonical_original_code:
int RVC_decoder__motion_V__interpolation__DOLLAR__d1796(void *context, struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    int ret;
    ret = (thisActor->x != 0);
    return ret;
  }
}

user_defined_types: struct OutputPort { struct LocalOutputPort localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t consumers; }


decompiled_code:
_BOOL8 __fastcall RVC_decoder__motion_V__interpolation__DOLLAR__d1800(__int64 a1, __int64 a2)
{
return *(_DWORD *)(a2 + 120) != 0;
}

original_code:
bool_t RVC_decoder__motion_V__interpolation__DOLLAR__d1800(art_action_context_t *context, ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    bool_t ret;
    ret = (thisActor->y != 0);
    return ret;
  }
}

canonical_original_code:
int RVC_decoder__motion_V__interpolation__DOLLAR__d1800(void *context, struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    int ret;
    ret = (thisActor->y != 0);
    return ret;
  }
}

user_defined_types: struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t mutex; }


decompiled_code:
_BOOL8 __fastcall RVC_decoder__motion_V__interpolation__DOLLAR__d1804(__int64 a1, __int64 a2)
{
return *(_DWORD *)(a2 + 120) != 9;
}

original_code:
bool_t RVC_decoder__motion_V__interpolation__DOLLAR__d1804(art_action_context_t *context, ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    bool_t ret;
    ret = (thisActor->y != 9);
    return ret;
  }
}

canonical_original_code:
int RVC_decoder__motion_V__interpolation__DOLLAR__d1804(void *context, struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor) {
  {
    int ret;
    ret = (thisActor->y != 9);
    return ret;
  }
}

user_defined_types: struct dllist_link_tag { struct dllist_link_tag *suc; }


decompiled_code:
void *__fastcall RVC_decoder__motion_V__interpolation_action_scheduler(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( !v1 )
goto LABEL_8;
}
while ( v1 != 1 );
while ( 1 )
{
while ( !(unsigned int)RVC_decoder__motion_V__interpolation__DOLLAR__d1756(0LL, a1) )
{
if ( !(unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) )
return &exitcode_block_Any;
if ( (unsigned int)RVC_decoder__motion_V__interpolation__DOLLAR__d1763(0LL, a1) )
{
action2__row_col_0(a1);
*(_DWORD *)(a1 + 72) = 1;
}
else
{
if ( !(unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL))
|| !(unsigned int)RVC_decoder__motion_V__interpolation__DOLLAR__d1796(0LL, a1)
|| !(unsigned int)RVC_decoder__motion_V__interpolation__DOLLAR__d1800(0LL, a1)
|| !(unsigned int)RVC_decoder__motion_V__interpolation__DOLLAR__d1804(0LL, a1)
|| !(unsigned int)pinAvailOut_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) )
{
return &exitcode_block_Any;
}
action3__other(a1);
*(_DWORD *)(a1 + 72) = 1;
}
}
*(_DWORD *)(a1 + 72) = 0;
LABEL_8:
if ( !(unsigned int)pinAvailIn_int32_t_isra_0(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) )
break;
action0__start(a1);
*(_DWORD *)(a1 + 72) = 1;
}
return &exitcode_block_Any;
}

canonical_decompiled_code:
void *__fastcall func20(__int64 a1)
{
int v1; // eax

v1 = *(_DWORD *)(a1 + 72);
do
{
if ( !v1 )
goto LABEL_8;
}
while ( v1 != 1 );
while ( 1 )
{
while ( !(unsigned int)func15(0LL, a1) )
{
if ( !(unsigned int)func14(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL)) )
return &exitcode_block_Any;
if ( (unsigned int)func16(0LL, a1) )
{
func10(a1);
*(_DWORD *)(a1 + 72) = 1;
}
else
{
if ( !(unsigned int)func14(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 48LL))
|| !(unsigned int)func17(0LL, a1)
|| !(unsigned int)func18(0LL, a1)
|| !(unsigned int)func19(0LL, a1)
|| !(unsigned int)func13(*(_DWORD *)(*(_QWORD *)(a1 + 56) + 24LL)) )
{
return &exitcode_block_Any;
}
action3__other(a1);
*(_DWORD *)(a1 + 72) = 1;
}
}
*(_DWORD *)(a1 + 72) = 0;
LABEL_8:
if ( !(unsigned int)func14(*(_DWORD *)(*(_QWORD *)(a1 + 40) + 152LL)) )
break;
func12(a1);
*(_DWORD *)(a1 + 72) = 1;
}
return &exitcode_block_Any;
}

original_code:
static const int *RVC_decoder__motion_V__interpolation_action_scheduler(AbstractActorInstance *pBase) {
  const int *result = exit_code_yield;
  ActorInstance_RVC_decoder__motion_V__interpolation *thisActor=(ActorInstance_RVC_decoder__motion_V__interpolation*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[1].localInputPort)) >= 1)) {
          action0__start(thisActor);
          thisActor->_fsmState = 1;
          continue;
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if (RVC_decoder__motion_V__interpolation__DOLLAR__d1756(context, thisActor)) {
          action1__done(thisActor);
          thisActor->_fsmState = 0;
          continue;
        }
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 1)) {
          if (RVC_decoder__motion_V__interpolation__DOLLAR__d1763(context, thisActor)) {
            action2__row_col_0(thisActor);
            thisActor->_fsmState = 1;
            continue;
          }
        }
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 1)) {
          if (RVC_decoder__motion_V__interpolation__DOLLAR__d1796(context, thisActor) && RVC_decoder__motion_V__interpolation__DOLLAR__d1800(context, thisActor) && RVC_decoder__motion_V__interpolation__DOLLAR__d1804(context, thisActor)) {
            if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 1)) {
              action3__other(thisActor);
              thisActor->_fsmState = 1;
              continue;
            } else {
              result = exitcode_block_Any;
              goto out;
            }
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

canonical_original_code:
static int *RVC_decoder__motion_V__interpolation_action_scheduler(struct AbstractActorInstance *pBase) {
  int *result = exit_code_yield;
  struct ActorInstance_RVC_decoder__motion_V__interpolation *thisActor = (ActorInstance_RVC_decoder__motion_V__interpolation*) pBase;
  void *context = ((void *)0); context = context;
  while(1) {
    switch(thisActor->_fsmState) {
      case 0:
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[1].localInputPort)) >= 1)) {
          action0__start(thisActor);
          thisActor->_fsmState = 1;
          continue;
        }
        result = exitcode_block_Any;
        goto out;
        break;
      case 1:
        if (RVC_decoder__motion_V__interpolation__DOLLAR__d1756(context, thisActor)) {
          action1__done(thisActor);
          thisActor->_fsmState = 0;
          continue;
        }
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 1)) {
          if (RVC_decoder__motion_V__interpolation__DOLLAR__d1763(context, thisActor)) {
            action2__row_col_0(thisActor);
            thisActor->_fsmState = 1;
            continue;
          }
        }
        if ((pinAvailIn_int32_t(&(thisActor->base.inputPort[0].localInputPort)) >= 1)) {
          if (RVC_decoder__motion_V__interpolation__DOLLAR__d1796(context, thisActor) && RVC_decoder__motion_V__interpolation__DOLLAR__d1800(context, thisActor) && RVC_decoder__motion_V__interpolation__DOLLAR__d1804(context, thisActor)) {
            if ((pinAvailOut_int32_t(&(thisActor->base.outputPort[0].localOutputPort)) >= 1)) {
              action3__other(thisActor);
              thisActor->_fsmState = 1;
              continue;
            } else {
              result = exitcode_block_Any;
              goto out;
            }
          }
        }
        result = exitcode_block_Any;
        goto out;
        break;
    }
  }
  out:

  return result;
}

variable_types:
result
int *

user_defined_types: struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; }


decompiled_code:
void __fastcall ActorInstance_RVC_decoder__texture_U__IQ_constructor(__int64 a1)
{
*(_DWORD *)(a1 + 72) = 0;
}

original_code:
static void ActorInstance_RVC_decoder__texture_U__IQ_constructor(AbstractActorInstance *pBase) {
  ActorInstance_RVC_decoder__texture_U__IQ *thisActor=(ActorInstance_RVC_decoder__texture_U__IQ*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

canonical_original_code:
static void ActorInstance_RVC_decoder__texture_U__IQ_constructor(struct AbstractActorInstance *pBase) {
  struct ActorInstance_RVC_decoder__texture_U__IQ *thisActor = (ActorInstance_RVC_decoder__texture_U__IQ*) pBase;
  thisActor->_fsmState = 0;
  {
  }
}

variable_types: struct ActorInstance_RVC_decoder__texture_U__IQ { struct AbstractActorInstance { struct dllist_link_tag { struct dllist_link_tag *suc; } listEntry; struct ActorClass { unsigned int majorVersion; unsigned int minorVersion; char *name; int sizeActorInstance; int numInputPorts; struct PortDescription { int dummy; char *name; int tokenSize; struct tokenFn { char *(*serialize)(void *, char *); char *(*deserialize)(void **, char *); long (*size)(void *); int (*free)(void *, int); } *functions; } *inputPortDescriptions; int numOutputPorts; struct PortDescription *outputPortDescriptions; int numActions; struct ActionDescription { char *name; int *consumption; int *production; } *actionDescriptions; int *(*action_scheduler)(struct AbstractActorInstance *); void (*constructor)(struct AbstractActorInstance *); void (*destructor)(struct AbstractActorInstance *); void (*set_param)(struct AbstractActorInstance *, char *, char *); } *actorClass; char *instanceName; int numInputPorts; struct InputPort { struct dllist_link_tag asConsumer; struct OutputPort { struct LocalOutputPort { void *bufferStart; void *bufferEnd; void *writePtr; unsigned int spaceLeft; } localOutputPort; unsigned int capacity; unsigned int tokensProduced; unsigned int fullAt; struct tokenFn functions; struct dllist_head_t { struct dllist_link_tag head_element; union pthread_mutex_t { struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __list; } __data; char __size[40]; long __align; } mutex; } consumers; } *producer; struct LocalInputPort { void *bufferStart; void *bufferEnd; void *readPtr; unsigned int available; } localInputPort; unsigned int tokensConsumed; unsigned int drainedAt; unsigned int capacity; struct tokenFn functions; } *inputPort; int numOutputPorts; struct OutputPort *outputPort; int *(*action_scheduler)(struct AbstractActorInstance *); } base; int _fsmState; int round; int count; int quant; } *

user_defined_types: struct ActorInstance_RVC_decoder__texture_U__IQ { struct AbstractActorInstance base; int _fsmState; int round; int count; int quant; }


canonical_decompiled_code:
__int64 __fastcall func7(__int64 a1)
{
int v1; // eax
unsigned int *v2; // rcx
unsigned int v3; // er8
_DWORD *v4; // rdx

v1 = *(_DWORD *)(a1 + 24);
v2 = *(unsigned int **)(a1 + 16);
if ( !v1 )
__assert_fail("p->available > 0", "../../actors-fifo.h", 0x6Bu, "pinRead_int32_t");
v3 = *v2;
v4 = v2 + 1;
if ( *(_QWORD *)(a1 + 8) <= (unsigned __int64)(v2 + 1) )
v4 = *(_DWORD **)a1;
*(_QWORD *)(a1 + 16) = v4;
*(_DWORD *)(a1 + 24) = v1 - 1;
return v3;
}