Skip to content

Instantly share code, notes, and snippets.

@disconnect3d
Created January 14, 2017 11:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save disconnect3d/4b3f2ced918d562dbf8e7102de645d8b to your computer and use it in GitHub Desktop.
Save disconnect3d/4b3f2ced918d562dbf8e7102de645d8b to your computer and use it in GitHub Desktop.
/*
//// Decompiled from .so compiled with Cython
//// hidden.pyx code:
import numpy as np
def bar(x):
print "Hello from bar"
arr = np.array(x)
return arr * arr.T
*/
int __fastcall _pyx_pw_6hidden_1bar(PyObject *__pyx_self, PyObject *__pyx_v_x)
{
PyObject *v2; // r13@1
PyObject *v3; // rbp@1
_QWORD *v4; // rax@1
_QWORD *v5; // rbx@1
bool v6; // zf@6
PyObject *v7; // rbp@8
_QWORD *v8; // rax@8
__int64 v9; // rdx@10
char *v10; // rsi@10
int (__fastcall *v11)(_QWORD *, char *); // rax@10
__int64 v12; // rax@11
__int64 v13; // rbp@11
void *v14; // rax@15
__int64 v15; // rax@17
int (__fastcall *v16)(__int64, PyObject *); // rbx@18
__int64 v17; // r12@18
int v18; // eax@18
_QWORD *v19; // rax@19
__int64 v20; // r12@20
__int64 v21; // rdx@23
char *v22; // rsi@23
int (__fastcall *v23)(_QWORD *, char *); // rax@23
__int64 v24; // rax@24
__int64 v25; // rbp@24
__int64 v26; // rax@26
int v27; // ST08_4@28
int v28; // ST08_4@30
int v29; // er12@34
int v30; // er13@34
_typeobject *v31; // rdx@40
int (__fastcall *v32)(PyObject *, PyObject *); // rax@40
_QWORD *v33; // rax@41
__int64 v34; // rax@49
int (__fastcall *v35)(__int64, __int64, _QWORD); // rbx@50
int v36; // eax@51
_QWORD *v37; // rax@52
_QWORD *v38; // rax@67
__int64 v39; // rax@71
__int64 v40; // rax@73
__int64 v41; // r15@73
int (__fastcall *v42)(__int64, __int64, _QWORD); // rbx@74
int v43; // eax@75
_QWORD *v44; // rax@76
int (__fastcall *v45)(PyObject *, char *); // rax@81
_QWORD *v46; // rax@82
__int64 v47; // rax@83
__int64 v48; // rax@87
__int64 v49; // rax@88
_QWORD *v50; // rax@89
__int64 v51; // rax@94
_QWORD *v52; // rax@96
v2 = __pyx_v_x;
v3 = _pyx_kp_s_Hello_from_bar;
LODWORD(v4) = PySys_GetObject("stdout");
v5 = v4;
if ( !v4 )
{
v30 = 673;
v29 = 5;
PyErr_SetString(PyExc_RuntimeError, &unk_2B3C);
goto LABEL_35;
}
++*v4;
if ( PyFile_SoftSpace(v4, 0LL) && PyFile_WriteString(" ", v5) < 0
|| PyFile_WriteObject(v3, v5, 1LL) < 0
|| PyFile_WriteString("\n", v5) < 0 )
{
v6 = (*v5)-- == 1LL;
if ( v6 )
(*(void (__fastcall **)(_QWORD *))(v5[1] + 48LL))(v5);
v5 = 0LL;
v29 = 5;
v30 = 673;
goto LABEL_35;
}
v6 = (*v5)-- == 1LL;
if ( v6 )
(*(void (__fastcall **)(_QWORD *))(v5[1] + 48LL))(v5);
v7 = _pyx_n_s_np;
LODWORD(v8) = PyDict_GetItem(_pyx_d, _pyx_n_s_np);
v5 = v8;
if ( v8 )
{
++*v8;
}
else
{
v31 = _pyx_b->ob_type;
v32 = (int (__fastcall *)(PyObject *, PyObject *))v31->tp_getattro;
if ( v32 )
{
LODWORD(v33) = v32(_pyx_b, v7);
v5 = v33;
}
else
{
v45 = (int (__fastcall *)(PyObject *, char *))v31->tp_getattr;
if ( v45 )
{
LODWORD(v46) = v45(_pyx_b, (char *)&v7[2].ob_refcnt + 4);
v5 = v46;
}
else
{
LODWORD(v52) = PyObject_GetAttr(_pyx_b, v7);
v5 = v52;
}
}
if ( !v5 )
{
v30 = 682;
v29 = 6;
PyErr_Format(PyExc_NameError, "name '%.200s' is not defined", (char *)&v7[2].ob_refcnt + 4);
goto LABEL_35;
}
}
v9 = v5[1];
v10 = (char *)_pyx_n_s_array;
v11 = *(int (__fastcall **)(_QWORD *, char *))(v9 + 144);
if ( v11 )
goto LABEL_11;
v11 = *(int (__fastcall **)(_QWORD *, char *))(v9 + 64);
if ( v11 )
{
v10 = (char *)&_pyx_n_s_array[2].ob_refcnt + 4;
LABEL_11:
LODWORD(v12) = v11(v5, v10);
v13 = v12;
goto LABEL_12;
}
LODWORD(v48) = PyObject_GetAttr(v5, _pyx_n_s_array);
v13 = v48;
LABEL_12:
if ( !v13 )
{
v6 = (*v5)-- == 1LL;
if ( !v6 )
{
v5 = 0LL;
v30 = 684;
v29 = 6;
goto LABEL_35;
}
v20 = 0LL;
v30 = 684;
goto LABEL_61;
}
v6 = (*v5)-- == 1LL;
if ( v6 )
(*(void (__fastcall **)(_QWORD *))(v5[1] + 48LL))(v5);
v14 = *(void **)(v13 + 8);
if ( v14 != &PyMethod_Type || (v5 = *(_QWORD **)(v13 + 24)) == 0LL )
{
if ( v14 == &PyCFunction_Type )
{
v15 = *(_QWORD *)(v13 + 16);
if ( *(_BYTE *)(v15 + 16) & 8 )
{
v16 = *(int (__fastcall **)(__int64, PyObject *))(v15 + 8);
v17 = *(_QWORD *)(v13 + 24);
v18 = *(_DWORD *)(PyThreadState_Current + 24LL) + 1;
*(_DWORD *)(PyThreadState_Current + 24LL) = v18;
if ( v18 > Py_CheckRecursionLimit && _Py_CheckRecursiveCall(" while calling a Python object") )
goto LABEL_80;
LODWORD(v19) = v16(v17, v2);
v5 = v19;
--*(_DWORD *)(PyThreadState_Current + 24LL);
if ( !v19 )
{
LODWORD(v47) = PyErr_Occurred();
if ( !v47 )
PyErr_SetString(PyExc_SystemError, "NULL result without error in PyObject_Call");
goto LABEL_80;
}
LABEL_20:
v20 = v13;
goto LABEL_21;
}
}
LODWORD(v40) = PyTuple_New(1LL);
v41 = v40;
if ( !v40 )
{
LABEL_80:
v20 = v13;
v30 = 698;
v25 = 0LL;
LABEL_56:
v6 = (*(_QWORD *)v20)-- == 1LL;
if ( !v6 )
goto LABEL_57;
goto LABEL_63;
}
++v2->ob_refcnt;
*(_QWORD *)(v40 + 24) = v2;
v42 = *(int (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)(v13 + 8) + 128LL);
if ( v42 )
{
v43 = *(_DWORD *)(PyThreadState_Current + 24LL) + 1;
*(_DWORD *)(PyThreadState_Current + 24LL) = v43;
if ( v43 > Py_CheckRecursionLimit && _Py_CheckRecursiveCall(" while calling a Python object") )
{
LABEL_92:
v6 = (*(_QWORD *)v41)-- == 1LL;
if ( !v6 )
goto LABEL_80;
v5 = 0LL;
goto LABEL_78;
}
LODWORD(v44) = v42(v13, v41, 0LL);
v5 = v44;
--*(_DWORD *)(PyThreadState_Current + 24LL);
if ( !v44 )
{
LODWORD(v51) = PyErr_Occurred();
if ( !v51 )
PyErr_SetString(PyExc_SystemError, "NULL result without error in PyObject_Call");
goto LABEL_92;
}
v20 = v13;
v6 = (*(_QWORD *)v41)-- == 1LL;
if ( !v6 )
goto LABEL_21;
}
else
{
LODWORD(v50) = PyObject_Call(v13, v40, 0LL);
v6 = (*(_QWORD *)v41)-- == 1LL;
v5 = v50;
if ( !v6 )
{
LABEL_79:
if ( v5 )
goto LABEL_20;
goto LABEL_80;
}
}
LABEL_78:
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v41 + 8) + 48LL))(v41);
goto LABEL_79;
}
v20 = *(_QWORD *)(v13 + 16);
++*v5;
++*(_QWORD *)v20;
v6 = (*(_QWORD *)v13)-- == 1LL;
if ( v6 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v13 + 8) + 48LL))(v13);
LODWORD(v34) = PyTuple_New(2LL);
v25 = v34;
if ( !v34 )
{
v30 = 701;
v6 = (*v5)-- == 1LL;
if ( !v6 )
goto LABEL_56;
LABEL_61:
(*(void (__fastcall **)(_QWORD *))(v5[1] + 48LL))(v5);
if ( !v20 )
goto LABEL_99;
v25 = 0LL;
v6 = (*(_QWORD *)v20)-- == 1LL;
if ( !v6 )
{
LABEL_57:
if ( v25 )
{
v5 = 0LL;
v29 = 6;
v6 = (*(_QWORD *)v25)-- == 1LL;
if ( v6 )
LABEL_38:
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v25 + 8) + 48LL))(v25);
LABEL_35:
_Pyx_AddTraceback("hidden.bar", v30, v29, "hidden.pyx");
LODWORD(v26) = 0;
if ( !v5 )
return v26;
goto LABEL_29;
}
LABEL_99:
v29 = 6;
v5 = 0LL;
goto LABEL_35;
}
LABEL_63:
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v20 + 8) + 48LL))(v20);
goto LABEL_57;
}
*(_QWORD *)(v34 + 24) = v5;
++v2->ob_refcnt;
*(_QWORD *)(v34 + 32) = v2;
v35 = *(int (__fastcall **)(__int64, __int64, _QWORD))(*(_QWORD *)(v20 + 8) + 128LL);
if ( v35 )
{
v36 = *(_DWORD *)(PyThreadState_Current + 24LL) + 1;
*(_DWORD *)(PyThreadState_Current + 24LL) = v36;
if ( v36 > Py_CheckRecursionLimit && _Py_CheckRecursiveCall(" while calling a Python object") )
goto LABEL_68;
LODWORD(v37) = v35(v20, v25, 0LL);
v5 = v37;
--*(_DWORD *)(PyThreadState_Current + 24LL);
if ( !v37 )
{
LODWORD(v39) = PyErr_Occurred();
if ( !v39 )
PyErr_SetString(PyExc_SystemError, "NULL result without error in PyObject_Call");
goto LABEL_68;
}
}
else
{
LODWORD(v38) = PyObject_Call(v20, v34, 0LL);
v5 = v38;
if ( !v38 )
{
LABEL_68:
v30 = 707;
goto LABEL_56;
}
}
v6 = (*(_QWORD *)v25)-- == 1LL;
if ( v6 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v25 + 8) + 48LL))(v25);
LABEL_21:
v6 = (*(_QWORD *)v20)-- == 1LL;
if ( v6 )
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v20 + 8) + 48LL))(v20);
v21 = v5[1];
v22 = (char *)_pyx_n_s_T;
v23 = *(int (__fastcall **)(_QWORD *, char *))(v21 + 144);
if ( v23 )
goto LABEL_24;
v23 = *(int (__fastcall **)(_QWORD *, char *))(v21 + 64);
if ( v23 )
{
v22 = (char *)&_pyx_n_s_T[2].ob_refcnt + 4;
LABEL_24:
LODWORD(v24) = v23(v5, v22);
v25 = v24;
goto LABEL_25;
}
LODWORD(v49) = PyObject_GetAttr(v5, _pyx_n_s_T);
v25 = v49;
LABEL_25:
if ( !v25 )
{
v30 = 722;
v29 = 7;
goto LABEL_35;
}
LODWORD(v26) = PyNumber_Multiply(v5, v25);
if ( !v26 )
{
v29 = 7;
v30 = 724;
v6 = (*(_QWORD *)v25)-- == 1LL;
if ( !v6 )
goto LABEL_35;
goto LABEL_38;
}
v6 = (*(_QWORD *)v25)-- == 1LL;
if ( v6 )
{
v27 = v26;
(*(void (__fastcall **)(__int64))(*(_QWORD *)(v25 + 8) + 48LL))(v25);
LODWORD(v26) = v27;
}
LABEL_29:
v6 = (*v5)-- == 1LL;
if ( v6 )
{
v28 = v26;
(*(void (__fastcall **)(_QWORD *))(v5[1] + 48LL))(v5);
LODWORD(v26) = v28;
}
return v26;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment