{"type": "func", "start": 6442519664, "end": 6442520211, "name": "cocos2d::ccDrawCircleSegment", "pseudocode": "// \n// cocos2d::ccDrawCircleSegment from 0x180010c70 to 0x180010e93 (547 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x180132598\n// > <???> @ 0x1801325e0\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801ae200\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid __fastcall cocos2d::ccDrawCircleSegment(\n        cocos2d *this,\n        const struct cocos2d::CCPoint *a2,\n        float a3,\n        float a4,\n        int a5,\n        unsigned __int8 a6,\n        float a7,\n        float a8)\n{\n  float v8; // xmm1_4\n  float *v10; // rdi\n  int v11; // esi\n  float v12; // xmm9_4\n  float v13; // xmm10_4\n  __int64 v14; // rbx\n  float v15; // xmm6_4\n  cocos2d::CCGLProgram *v16; // rcx\n  unsigned int v17; // edx\n\n  if ( *(float *)&dword_1801A2B6C > 0.0 )\n  {\n    cocos2d::ccDrawInit(this);\n    v10 = (float *)calloc(8LL * (unsigned int)(a5 + 2), 1u);\n    if ( v10 )\n    {\n      v11 = 0;\n      v12 = *(float *)this;\n      v13 = *((float *)this + 1);\n      do\n      {\n        v14 = (unsigned int)(2 * v11);\n        v15 = (float)((float)v11 * (float)(a4 / (float)a5)) + a3;\n        v10[v14] = (float)((float)(cosf(v15) * v8) * a7) + v12;\n        ++v11;\n        v10[(unsigned int)(v14 + 1)] = (float)((float)(sinf(v15) * v8) * a8) + v13;\n      }\n      while ( v11 <= (unsigned int)a5 );\n      v16 = (cocos2d::CCGLProgram *)qword_1801A8338;\n      v10[2 * a5 + 2] = v12;\n      v10[2 * a5 + 3] = v13;\n      cocos2d::CCGLProgram::use(v16);\n      cocos2d::CCGLProgram::setUniformsForBuiltins((cocos2d::CCGLProgram *)qword_1801A8338);\n      cocos2d::CCGLProgram::setUniformLocationWith4fv(\n        (cocos2d::CCGLProgram *)qword_1801A8338,\n        dword_1801A2B58,\n        &flt_1801A2B60,\n        1u);\n      cocos2d::ccGLEnableVertexAttribs((cocos2d *)1, v17);\n      _glewVertexAttribPointer(0, 2, 5126);\n      glDrawArrays(3u, 0, a6 + a5 + 1);\n      free(v10);\n      ++g_uNumberOfDraws;\n    }\n  }\n}", "assembly": "; \n; cocos2d::ccDrawCircleSegment from 0x180010c70 to 0x180010e93 (547 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x180132598\n; > <???> @ 0x1801325e0\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801ae200\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     rax, rsp                                                       ; +0x0, 0x180010c70\npush    rbx                                                            ; +0x3, 0x180010c73\nsub     rsp, 0B0h                                                      ; +0x4, 0x180010c74\nmovaps  xmmword ptr [rax-28h], xmm7                                    ; +0xb, 0x180010c7b\nxorps   xmm0, xmm0                                                     ; +0xf, 0x180010c7f\ncomiss  xmm0, cs:dword_1801A2B6C                                       ; +0x12, 0x180010c82\nmov     rbx, rcx                                                       ; +0x19, 0x180010c89\nmovaps  xmmword ptr [rax-38h], xmm8                                    ; +0x1c, 0x180010c8c\nmovaps  xmm7, xmm3                                                     ; +0x21, 0x180010c91\nmovaps  xmmword ptr [rax-68h], xmm11                                   ; +0x24, 0x180010c94\nmovaps  xmm8, xmm1                                                     ; +0x29, 0x180010c99\nmovaps  xmm11, xmm2                                                    ; +0x2d, 0x180010c9d\njnb     loc_180010E77                                                  ; +0x31, 0x180010ca1\nmov     [rax+8], rbp                                                   ; +0x37, 0x180010ca7\nmov     [rax+18h], rdi                                                 ; +0x3b, 0x180010cab\nmov     [rax+20h], r14                                                 ; +0x3f, 0x180010caf\ncall    ?ccDrawInit@cocos2d@@YAXXZ_0; cocos2d::ccDrawInit(void)        ; +0x43, 0x180010cb3\nmov     r14d, [rsp+0B8h+arg_20]                                        ; +0x48, 0x180010cb8\nxorps   xmm0, xmm0                                                     ; +0x50, 0x180010cc0\nmovzx   ebp, [rsp+0B8h+arg_28]                                         ; +0x53, 0x180010cc3\nmov     edx, 1; Size                                                   ; +0x5b, 0x180010ccb\ncvtsi2ss xmm0, r14                                                     ; +0x60, 0x180010cd0\nlea     ecx, [r14+2]                                                   ; +0x65, 0x180010cd5\nshl     rcx, 3; Count                                                  ; +0x69, 0x180010cd9\ndivss   xmm7, xmm0                                                     ; +0x6d, 0x180010cdd\ncall    cs:calloc                                                      ; +0x71, 0x180010ce1\nmov     rdi, rax                                                       ; +0x77, 0x180010ce7\ntest    rax, rax                                                       ; +0x7a, 0x180010cea\njz      loc_180010E5F                                                  ; +0x7d, 0x180010ced\nmov     [rsp+0B8h+arg_8], rsi                                          ; +0x83, 0x180010cf3\nxor     esi, esi                                                       ; +0x8b, 0x180010cfb\nmovaps  [rsp+0B8h+var_18], xmm6                                        ; +0x8d, 0x180010cfd\nmovaps  [rsp+0B8h+var_48], xmm9                                        ; +0x95, 0x180010d05\nmovss   xmm9, dword ptr [rbx]                                          ; +0x9b, 0x180010d0b\nmovaps  [rsp+0B8h+var_58], xmm10                                       ; +0xa0, 0x180010d10\nmovss   xmm10, dword ptr [rbx+4]                                       ; +0xa6, 0x180010d16\nmovaps  [rsp+0B8h+var_78], xmm12                                       ; +0xac, 0x180010d1c\nmovss   xmm12, [rsp+0B8h+arg_38]                                       ; +0xb2, 0x180010d22\nmovaps  [rsp+0B8h+var_88], xmm13                                       ; +0xbc, 0x180010d2c\nmovss   xmm13, dword ptr [rsp+0B8h+arg_30]                             ; +0xc2, 0x180010d32\nnop     dword ptr [rax+00h]                                            ; +0xcc, 0x180010d3c\nxorps   xmm6, xmm6                                                     ; +0xd0, 0x180010d40\nmov     eax, esi                                                       ; +0xd3, 0x180010d43\nlea     ebx, [rsi+rsi]                                                 ; +0xd5, 0x180010d45\ncvtsi2ss xmm6, rax                                                     ; +0xd8, 0x180010d48\nmulss   xmm6, xmm7                                                     ; +0xdd, 0x180010d4d\naddss   xmm6, xmm11                                                    ; +0xe1, 0x180010d51\nmovaps  xmm0, xmm6; X                                                  ; +0xe6, 0x180010d56\ncall    cosf                                                           ; +0xe9, 0x180010d59\nmulss   xmm0, xmm8                                                     ; +0xee, 0x180010d5e\nmulss   xmm0, xmm13                                                    ; +0xf3, 0x180010d63\naddss   xmm0, xmm9                                                     ; +0xf8, 0x180010d68\nmovss   dword ptr [rdi+rbx*4], xmm0                                    ; +0xfd, 0x180010d6d\nmovaps  xmm0, xmm6; X                                                  ; +0x102, 0x180010d72\ncall    sinf                                                           ; +0x105, 0x180010d75\nmulss   xmm0, xmm8                                                     ; +0x10a, 0x180010d7a\nlea     eax, [rbx+1]                                                   ; +0x10f, 0x180010d7f\ninc     esi                                                            ; +0x112, 0x180010d82\nmulss   xmm0, xmm12                                                    ; +0x114, 0x180010d84\naddss   xmm0, xmm10                                                    ; +0x119, 0x180010d89\nmovss   dword ptr [rdi+rax*4], xmm0                                    ; +0x11e, 0x180010d8e\ncmp     esi, r14d                                                      ; +0x123, 0x180010d93\njbe     short loc_180010D40                                            ; +0x126, 0x180010d96\nmov     rcx, cs:qword_1801A8338; this                                  ; +0x128, 0x180010d98\nlea     r8d, [r14+r14]                                                 ; +0x12f, 0x180010d9f\nmovaps  xmm13, [rsp+0B8h+var_88]                                       ; +0x133, 0x180010da3\nlea     eax, [r8+2]                                                    ; +0x139, 0x180010da9\nmovaps  xmm12, [rsp+0B8h+var_78]                                       ; +0x13d, 0x180010dad\nmovaps  xmm6, [rsp+0B8h+var_18]                                        ; +0x143, 0x180010db3\nmov     rsi, [rsp+0B8h+arg_8]                                          ; +0x14b, 0x180010dbb\nmovss   dword ptr [rdi+rax*4], xmm9                                    ; +0x153, 0x180010dc3\nlea     eax, [r8+3]                                                    ; +0x159, 0x180010dc9\nmovss   dword ptr [rdi+rax*4], xmm10                                   ; +0x15d, 0x180010dcd\ncall    ?use@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::use(void) ; +0x163, 0x180010dd3\nmov     rcx, cs:qword_1801A8338; this                                  ; +0x168, 0x180010dd8\ncall    ?setUniformsForBuiltins@CCGLProgram@cocos2d@@QEAAXXZ; cocos2d::CCGLProgram::setUniformsForBuiltins(void) ; +0x16f, 0x180010ddf\nmov     edx, cs:dword_1801A2B58; int                                   ; +0x174, 0x180010de4\nlea     r8, flt_1801A2B60; float *                                     ; +0x17a, 0x180010dea\nmov     rcx, cs:qword_1801A8338; this                                  ; +0x181, 0x180010df1\nmov     r9d, 1; unsigned int                                           ; +0x188, 0x180010df8\ncall    ?setUniformLocationWith4fv@CCGLProgram@cocos2d@@QEAAXHPEAMI@Z; cocos2d::CCGLProgram::setUniformLocationWith4fv(int,float *,uint) ; +0x18e, 0x180010dfe\nmov     ecx, 1; this                                                   ; +0x193, 0x180010e03\ncall    ?ccGLEnableVertexAttribs@cocos2d@@YAXI@Z; cocos2d::ccGLEnableVertexAttribs(uint) ; +0x198, 0x180010e08\nmov     rax, cs:__glewVertexAttribPointer                              ; +0x19d, 0x180010e0d\nxor     r9d, r9d                                                       ; +0x1a4, 0x180010e14\nmov     [rsp+0B8h+var_90], rdi                                         ; +0x1a7, 0x180010e17\nxor     ecx, ecx                                                       ; +0x1ac, 0x180010e1c\nmov     r8d, 1406h                                                     ; +0x1ae, 0x180010e1e\nmov     [rsp+0B8h+var_98], 0                                           ; +0x1b4, 0x180010e24\nlea     edx, [r9+2]                                                    ; +0x1bc, 0x180010e2c\ncall    qword ptr [rax]                                                ; +0x1c0, 0x180010e30\nxor     edx, edx; first                                                ; +0x1c2, 0x180010e32\nlea     r8d, [r14+1]                                                   ; +0x1c4, 0x180010e34\nadd     r8d, ebp; count                                                ; +0x1c8, 0x180010e38\nlea     ecx, [rdx+3]; mode                                             ; +0x1cb, 0x180010e3b\ncall    cs:glDrawArrays                                                ; +0x1ce, 0x180010e3e\nmov     rcx, rdi; Block                                                ; +0x1d4, 0x180010e44\ncall    cs:__imp_free                                                  ; +0x1d7, 0x180010e47\ninc     cs:?g_uNumberOfDraws@@3IA; uint g_uNumberOfDraws               ; +0x1dd, 0x180010e4d\nmovaps  xmm10, [rsp+0B8h+var_58]                                       ; +0x1e3, 0x180010e53\nmovaps  xmm9, [rsp+0B8h+var_48]                                        ; +0x1e9, 0x180010e59\nmov     rdi, [rsp+0B8h+arg_10]                                         ; +0x1ef, 0x180010e5f\nmov     rbp, [rsp+0B8h+arg_0]                                          ; +0x1f7, 0x180010e67\nmov     r14, [rsp+0B8h+arg_18]                                         ; +0x1ff, 0x180010e6f\nlea     r11, [rsp+0B8h+var_8]                                          ; +0x207, 0x180010e77\nmovaps  xmm7, xmmword ptr [r11-20h]                                    ; +0x20f, 0x180010e7f\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x214, 0x180010e84\nmovaps  xmm11, xmmword ptr [r11-60h]                                   ; +0x219, 0x180010e89\nmov     rsp, r11                                                       ; +0x21e, 0x180010e8e\npop     rbx                                                            ; +0x221, 0x180010e91\nretn                                                                   ; +0x222, 0x180010e92", "xrefs": ["<???> @ 0x180132598", "<???> @ 0x1801325e0", "<???> @ 0x1801438a8", "<???> @ 0x1801ae200"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}