{"type": "func", "start": 399480, "end": 399572, "name": "sub_61878", "pseudocode": "// \n// sub_61878 from 0x61878 to 0x618d4 (92 bytes)\n// \n// 4 xrefs:\n// > sub_618D4 @ 0x61994\n// > sub_618D4 @ 0x61ad0\n// > sub_61AF0 @ 0x61b30\n// > sub_61BE8 @ 0x61c1c\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:13:53 +0000\n// \n\n__int64 __fastcall sub_61878(int a1, char a2)\n{\n  int v4; // w0\n  unsigned int v5; // w19\n  __int64 v6; // x2\n\n  v4 = fcntl(a1, 3);\n  v5 = 43;\n  if ( v4 != -1 )\n  {\n    if ( (a2 & 1) != 0 )\n      v6 = v4 | 0x800u;\n    else\n      v6 = v4 & 0xFFFFF7FF;\n    if ( fcntl(a1, 4, v6) == -1 )\n      return 43;\n    else\n      return 0;\n  }\n  return v5;\n}", "assembly": "; \n; sub_61878 from 0x61878 to 0x618d4 (92 bytes)\n; \n; 4 xrefs:\n; > sub_618D4 @ 0x61994\n; > sub_618D4 @ 0x61ad0\n; > sub_61AF0 @ 0x61b30\n; > sub_61BE8 @ 0x61c1c\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:13:53 +0000\n; \nSTR             X21, [SP,#-0x10+var_20]!                               ; +0x0, 0x61878\nMOV             W21, W1                                                ; +0x4, 0x6187c\nMOV             W1, #3; cmd                                            ; +0x8, 0x61880\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0xc, 0x61884\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0x10, 0x61888\nADD             X29, SP, #0x20                                         ; +0x14, 0x6188c\nMOV             W20, W0                                                ; +0x18, 0x61890\nBL              .fcntl                                                 ; +0x1c, 0x61894\nCMN             W0, #1                                                 ; +0x20, 0x61898\nMOV             W19, #0x2B ; '+'                                       ; +0x24, 0x6189c\nB.EQ            loc_618C8                                              ; +0x28, 0x618a0\nORR             W8, W0, #0x800                                         ; +0x2c, 0x618a4\nAND             W9, W0, #0xFFFFF7FF                                    ; +0x30, 0x618a8\nTST             W21, #1                                                ; +0x34, 0x618ac\nCSEL            W2, W8, W9, NE                                         ; +0x38, 0x618b0\nMOV             W1, #4; cmd                                            ; +0x3c, 0x618b4\nMOV             W0, W20; fd                                            ; +0x40, 0x618b8\nBL              .fcntl                                                 ; +0x44, 0x618bc\nCMN             W0, #1                                                 ; +0x48, 0x618c0\nCSEL            W19, W19, WZR, EQ                                      ; +0x4c, 0x618c4\nMOV             W0, W19                                                ; +0x50, 0x618c8\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x54, 0x618cc\nB               loc_61DC0                                              ; +0x58, 0x618d0", "xrefs": ["sub_618D4 @ 0x61994", "sub_618D4 @ 0x61ad0", "sub_61AF0 @ 0x61b30", "sub_61BE8 @ 0x61c1c"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}