-#include "Python.h"\r\r\rstatic PyObject *__Pyx_UnpackItem(PyObject *, int);\rstatic int __Pyx_EndUnpack(PyObject *, int);\rstatic int __Pyx_PrintItem(PyObject *);\rstatic int __Pyx_PrintNewline(void);\rstatic void __Pyx_ReRaise(void);\rstatic void __Pyx_RaiseWithTraceback(PyObject *, PyObject *, PyObject *);\rstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list);\rstatic PyObject *__Pyx_GetExcValue(void);\rstatic PyObject *__Pyx_GetName(PyObject *dict, char *name);\r\rstatic PyObject *__pyx_m;\rstatic PyObject *__pyx_d;\rstatic PyObject *__pyx_b;\r\r\rPyObject *__pyx_f_primes(PyObject *__pyx_self, PyObject *__pyx_args); /*proto*/\rPyObject *__pyx_f_primes(PyObject *__pyx_self, PyObject *__pyx_args) {\r int __pyx_v_kmax;\r int __pyx_v_n;\r int __pyx_v_k;\r int __pyx_v_i;\r int (__pyx_v_p[1000]);\r PyObject *__pyx_v_result;\r PyObject *__pyx_r;\r PyObject *__pyx_1 = 0;\r int __pyx_2;\r int __pyx_3;\r int __pyx_4;\r PyObject *__pyx_5 = 0;\r PyObject *__pyx_6 = 0;\r if (!PyArg_ParseTuple(__pyx_args, "i", &__pyx_v_kmax)) return 0;\r __pyx_v_result = Py_None; Py_INCREF(__pyx_v_result);\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":2 */\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":3 */\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":4 */\r __pyx_1 = PyList_New(0); if (!__pyx_1) goto __pyx_L1;\r Py_DECREF(__pyx_v_result);\r __pyx_v_result = __pyx_1;\r __pyx_1 = 0;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":5 */\r __pyx_2 = (__pyx_v_kmax > 1000);\r if (__pyx_2) {\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":6 */\r __pyx_v_kmax = 1000;\r goto __pyx_L2;\r }\r __pyx_L2:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":7 */\r __pyx_v_k = 0;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":8 */\r __pyx_v_n = 2;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":9 */\r while (1) {\r __pyx_L3:;\r __pyx_2 = (__pyx_v_k < __pyx_v_kmax);\r if (!__pyx_2) break;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":10 */\r __pyx_v_i = 0;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":11 */\r while (1) {\r __pyx_L5:;\r if (__pyx_3 = (__pyx_v_i < __pyx_v_k)) {\r __pyx_3 = ((__pyx_v_n % (__pyx_v_p[__pyx_v_i])) != 0);\r }\r if (!__pyx_3) break;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":12 */\r __pyx_v_i = (__pyx_v_i + 1);\r }\r __pyx_L6:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":13 */\r __pyx_4 = (__pyx_v_i == __pyx_v_k);\r if (__pyx_4) {\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":14 */\r (__pyx_v_p[__pyx_v_k]) = __pyx_v_n;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":15 */\r __pyx_v_k = (__pyx_v_k + 1);\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":16 */\r __pyx_1 = PyObject_GetAttrString(__pyx_v_result, "append"); if (!__pyx_1) goto __pyx_L1;\r __pyx_5 = PyInt_FromLong(__pyx_v_n); if (!__pyx_5) goto __pyx_L1;\r __pyx_6 = PyTuple_New(1); if (!__pyx_6) goto __pyx_L1;\r PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);\r __pyx_5 = 0;\r __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_5) goto __pyx_L1;\r Py_DECREF(__pyx_6); __pyx_6 = 0;\r Py_DECREF(__pyx_5); __pyx_5 = 0;\r goto __pyx_L7;\r }\r __pyx_L7:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":17 */\r __pyx_v_n = (__pyx_v_n + 1);\r }\r __pyx_L4:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":18 */\r Py_INCREF(__pyx_v_result);\r __pyx_r = __pyx_v_result;\r goto __pyx_L0;\r\r __pyx_r = Py_None; Py_INCREF(__pyx_r);\r goto __pyx_L0;\r __pyx_L1:;\r Py_XDECREF(__pyx_1);\r Py_XDECREF(__pyx_5);\r Py_XDECREF(__pyx_6);\r __pyx_r = 0;\r __pyx_L0:;\r Py_DECREF(__pyx_v_result);\r return __pyx_r;\r}\r\rstatic struct PyMethodDef __pyx_methods[] = {\r {"primes", (PyCFunction)__pyx_f_primes, METH_VARARGS, 0},\r {0, 0, 0, 0}\r};\r\rvoid initprimes(void); /*proto*/\rvoid initprimes(void) {\r __pyx_m = Py_InitModule4("primes", __pyx_methods, 0, 0, PYTHON_API_VERSION);\r __pyx_d = PyModule_GetDict(__pyx_m);\r __pyx_b = PyImport_AddModule("__builtin__");\r PyDict_SetItemString(__pyx_d, "__builtins__", __pyx_b);\r}\r/* Runtime support code */\r
\ No newline at end of file
+#include "Python.h"\r\r\rstatic PyObject *__Pyx_UnpackItem(PyObject *, int);\rstatic int __Pyx_EndUnpack(PyObject *, int);\rstatic int __Pyx_PrintItem(PyObject *);\rstatic int __Pyx_PrintNewline(void);\rstatic void __Pyx_ReRaise(void);\rstatic void __Pyx_RaiseWithTraceback(PyObject *, PyObject *, PyObject *);\rstatic PyObject *__Pyx_Import(PyObject *name, PyObject *from_list);\rstatic PyObject *__Pyx_GetExcValue(void);\rstatic PyObject *__Pyx_GetName(PyObject *dict, char *name);\r\rstatic PyObject *__pyx_m;\rstatic PyObject *__pyx_d;\rstatic PyObject *__pyx_b;\r\r\rPyObject *__pyx_f_primes(PyObject *__pyx_self, PyObject *__pyx_args); /*proto*/\rPyObject *__pyx_f_primes(PyObject *__pyx_self, PyObject *__pyx_args) {\r int __pyx_v_kmax;\r int __pyx_v_n;\r int __pyx_v_k;\r int __pyx_v_i;\r int (__pyx_v_p[1000]);\r PyObject *__pyx_v_result;\r PyObject *__pyx_r;\r PyObject *__pyx_1 = 0;\r int __pyx_2;\r int __pyx_3;\r int __pyx_4;\r PyObject *__pyx_5 = 0;\r PyObject *__pyx_6 = 0;\r if (!PyArg_ParseTuple(__pyx_args, "i", &__pyx_v_kmax)) return 0;\r __pyx_v_result = Py_None; Py_INCREF(__pyx_v_result);\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":2 */\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":3 */\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":4 */\r __pyx_1 = PyList_New(0); if (!__pyx_1) goto __pyx_L1;\r Py_DECREF(__pyx_v_result);\r __pyx_v_result = __pyx_1;\r __pyx_1 = 0;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":5 */\r __pyx_2 = (__pyx_v_kmax > 1000);\r if (__pyx_2) {\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":6 */\r __pyx_v_kmax = 1000;\r goto __pyx_L2;\r }\r __pyx_L2:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":7 */\r __pyx_v_k = 0;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":8 */\r __pyx_v_n = 2;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":9 */\r while (1) {\r __pyx_L3:;\r __pyx_2 = (__pyx_v_k < __pyx_v_kmax);\r if (!__pyx_2) break;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":10 */\r __pyx_v_i = 0;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":11 */\r while (1) {\r __pyx_L5:;\r if (__pyx_3 = (__pyx_v_i < __pyx_v_k)) {\r __pyx_3 = ((__pyx_v_n % (__pyx_v_p[__pyx_v_i])) != 0);\r }\r if (!__pyx_3) break;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":12 */\r __pyx_v_i = (__pyx_v_i + 1);\r }\r __pyx_L6:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":13 */\r __pyx_4 = (__pyx_v_i == __pyx_v_k);\r if (__pyx_4) {\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":14 */\r (__pyx_v_p[__pyx_v_k]) = __pyx_v_n;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":15 */\r __pyx_v_k = (__pyx_v_k + 1);\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":16 */\r __pyx_1 = PyObject_GetAttrString(__pyx_v_result, "append"); if (!__pyx_1) goto __pyx_L1;\r __pyx_5 = PyInt_FromLong(__pyx_v_n); if (!__pyx_5) goto __pyx_L1;\r __pyx_6 = PyTuple_New(1); if (!__pyx_6) goto __pyx_L1;\r PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);\r __pyx_5 = 0;\r __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_5) goto __pyx_L1;\r Py_DECREF(__pyx_6); __pyx_6 = 0;\r Py_DECREF(__pyx_5); __pyx_5 = 0;\r goto __pyx_L7;\r }\r __pyx_L7:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":17 */\r __pyx_v_n = (__pyx_v_n + 1);\r }\r __pyx_L4:;\r\r /* "ProjectsA:Python:Pyrex:Demos:primes.pyx":18 */\r Py_INCREF(__pyx_v_result);\r __pyx_r = __pyx_v_result;\r goto __pyx_L0;\r\r __pyx_r = Py_None; Py_INCREF(__pyx_r);\r goto __pyx_L0;\r __pyx_L1:;\r Py_XDECREF(__pyx_1);\r Py_XDECREF(__pyx_5);\r Py_XDECREF(__pyx_6);\r __pyx_r = 0;\r __pyx_L0:;\r Py_DECREF(__pyx_v_result);\r return __pyx_r;\r}\r\rstatic struct PyMethodDef __pyx_methods[] = {\r {"primes", (PyCFunction)__pyx_f_primes, METH_VARARGS, 0},\r {0, 0, 0, 0}\r};\r\rvoid initprimes(void); /*proto*/\rvoid initprimes(void) {\r __pyx_m = Py_InitModule4("primes", __pyx_methods, 0, 0, PYTHON_API_VERSION);\r __pyx_d = PyModule_GetDict(__pyx_m);\r __pyx_b = PyImport_AddModule("__builtin__");\r PyDict_SetItemString(__pyx_d, "__builtins__", __pyx_b);\r}\r/* Runtime support code */\r