{"type": "func", "start": 330348, "end": 330402, "name": "sub_50A6C", "pseudocode": "// \n// sub_50A6C from 0x50a6c to 0x50aa2 (54 bytes)\n// \n// 4 xrefs:\n// > sub_50AA4 @ 0x50b2a\n// > sub_50AA4 @ 0x50bf0\n// > sub_50C14 @ 0x50c38\n// > sub_50CA4 @ 0x50cc2\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\nint __fastcall sub_50A6C(int a1, int a2)\n{\n  int v4; // r0\n  unsigned int v5; // r2\n  bool v6; // zf\n  int result; // r0\n\n  v4 = fcntl(a1, 3);\n  if ( v4 == -1 )\n    return 43;\n  v5 = v4 & 0xFFFFF7FF;\n  if ( a2 )\n    v5 = v4 | 0x800;\n  v6 = fcntl(a1, 4, v5) == -1;\n  result = 0;\n  if ( v6 )\n    return 43;\n  return result;\n}", "assembly": "; \n; sub_50A6C from 0x50a6c to 0x50aa2 (54 bytes)\n; \n; 4 xrefs:\n; > sub_50AA4 @ 0x50b2a\n; > sub_50AA4 @ 0x50bf0\n; > sub_50C14 @ 0x50c38\n; > sub_50CA4 @ 0x50cc2\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\nPUSH            {R4,R5,R7,LR}                                          ; +0x0, 0x50a6c\nADD             R7, SP, #8                                             ; +0x2, 0x50a6e\nMOV             R5, R1                                                 ; +0x4, 0x50a70\nMOVS            R1, #3; cmd                                            ; +0x6, 0x50a72\nMOV             R4, R0                                                 ; +0x8, 0x50a74\nBLX             fcntl                                                  ; +0xa, 0x50a76\nADDS            R1, R0, #1                                             ; +0xe, 0x50a7a\nBEQ             loc_50A9E                                              ; +0x10, 0x50a7c\nBIC.W           R2, R0, #0x800                                         ; +0x12, 0x50a7e\nCMP             R5, #0                                                 ; +0x16, 0x50a82\nIT NE                                                                  ; +0x18, 0x50a84\nORRNE.W         R2, R0, #0x800                                         ; +0x1a, 0x50a86\nMOV             R0, R4; fd                                             ; +0x1e, 0x50a8a\nMOVS            R1, #4; cmd                                            ; +0x20, 0x50a8c\nBLX             fcntl                                                  ; +0x22, 0x50a8e\nADDS            R0, #1                                                 ; +0x26, 0x50a92\nMOV.W           R0, #0                                                 ; +0x28, 0x50a94\nIT EQ                                                                  ; +0x2c, 0x50a98\nMOVEQ           R0, #0x2B ; '+'                                        ; +0x2e, 0x50a9a\nPOP             {R4,R5,R7,PC}                                          ; +0x30, 0x50a9c\nMOVS            R0, #0x2B ; '+'                                        ; +0x32, 0x50a9e\nPOP             {R4,R5,R7,PC}                                          ; +0x34, 0x50aa0", "xrefs": ["sub_50AA4 @ 0x50b2a", "sub_50AA4 @ 0x50bf0", "sub_50C14 @ 0x50c38", "sub_50CA4 @ 0x50cc2"], "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"}