
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

fxp_handle * fxp_open_recv(sftp_packet *pktin,sftp_request *req)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  uint uVar5;
  int iVar6;
  char *pcVar7;
  fxp_handle *pfVar8;
  int in_GS_OFFSET;
  char *hstring;
  int len;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x2f919;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  safefree(req);
  if (pktin->type == 0x66) {
    iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);
    if (iVar6 != 0) {
      pfVar8 = (fxp_handle *)safemalloc(1,8);
      iVar6 = len;
      pcVar7 = (char *)safemalloc(len + 1,1);
      memcpy(pcVar7,hstring,iVar6);
      pcVar7[iVar6] = '\0';
      pfVar8->hstring = pcVar7;
      pfVar8->hlen = len;
      if (pktin->data != (char *)0x0) {
        safefree(pktin->data);
      }
      safefree(pktin);
      goto LAB_0002f993;
    }
    fxp_errtype = -1;
    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";
    if (pktin->data != (char *)0x0) {
      safefree(pktin->data);
    }
  }
  else {
    pcVar7 = pktin->data;
    if (pktin->type == 0x65) {
      uVar5 = pktin->savedpos;
      if (pktin->length - uVar5 < 4) {
        fxp_errtype = -1;
        fxp_error_message = "malformed FXP_STATUS packet";
      }
      else {
        bVar1 = pcVar7[uVar5];
        bVar2 = pcVar7[uVar5 + 3];
        bVar3 = pcVar7[uVar5 + 1];
        bVar4 = pcVar7[uVar5 + 2];
        pktin->savedpos = uVar5 + 4;
        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;
        if ((uint)fxp_errtype < 9) {
          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);
        }
        else {
          fxp_error_message = "unknown error code";
        }
      }
    }
    else {
      fxp_errtype = -1;
      fxp_error_message = "expected FXP_STATUS packet";
    }
    if (pcVar7 != (char *)0x0) {
      safefree(pcVar7);
    }
  }
  pfVar8 = (fxp_handle *)0x0;
  safefree(pktin);
LAB_0002f993:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return pfVar8;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 * FUN_0002f910(int *param_1,undefined4 param_2)

{
  int iVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  byte bVar5;
  int iVar6;
  int iVar7;
  void *__dest;
  undefined4 *puVar8;
  int in_GS_OFFSET;
  void *local_28;
  size_t local_24;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  FUN_0001dd30(param_2);
  if (param_1[4] == 0x66) {
    iVar7 = FUN_0002e400();
    if (iVar7 != 0) {
      puVar8 = (undefined4 *)FUN_0001db90(1,8);
      __dest = (void *)FUN_0001db90(local_24 + 1,1);
      memcpy(__dest,local_28,local_24);
      *(undefined1 *)((int)__dest + local_24) = 0;
      *puVar8 = __dest;
      puVar8[1] = local_24;
      if (*param_1 != 0) {
        FUN_0001dd30(*param_1);
      }
      FUN_0001dd30(param_1);
      goto LAB_0002f993;
    }
    DAT_000cd214 = 0xffffffff;
    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";
    if (*param_1 != 0) {
      FUN_0001dd30(*param_1);
    }
  }
  else {
    iVar7 = *param_1;
    if (param_1[4] == 0x65) {
      iVar6 = param_1[3];
      if ((uint)(param_1[1] - iVar6) < 4) {
        DAT_000cd214 = 0xffffffff;
        DAT_000cd218 = "malformed FXP_STATUS packet";
      }
      else {
        bVar2 = *(byte *)(iVar7 + iVar6);
        bVar3 = *(byte *)(iVar7 + 3 + iVar6);
        bVar4 = *(byte *)(iVar7 + 1 + iVar6);
        bVar5 = *(byte *)(iVar7 + 2 + iVar6);
        param_1[3] = iVar6 + 4;
        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;
        if (DAT_000cd214 < 9) {
          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];
        }
        else {
          DAT_000cd218 = "unknown error code";
        }
      }
    }
    else {
      DAT_000cd214 = 0xffffffff;
      DAT_000cd218 = "expected FXP_STATUS packet";
    }
    if (iVar7 != 0) {
      FUN_0001dd30(iVar7);
    }
  }
  puVar8 = (undefined4 *)0x0;
  FUN_0001dd30(param_1);
LAB_0002f993:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return puVar8;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008d800();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x000149a0
ADD EBX,0x9d457
SUB ESP,0x38
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x28],EAX
XOR EAX,EAX
MOV ESI,dword ptr [ESP + 0x4c]
PUSH dword ptr [ESP + 0x50]
CALL 0x0001dd30
MOV EAX,dword ptr [ESI + 0x10]
ADD ESP,0x10
CMP EAX,0x66
JNZ 0x0002fa30
LEA ECX,[ESP + 0x18]
LEA EDX,[ESP + 0x14]
MOV EAX,ESI
CALL 0x0002e400
TEST EAX,EAX
JNZ 0x0002f9b0
MOV dword ptr [EBX + 0x4a4],0xffffffff
LEA EAX,[EBX + 0xfffc4e30]
MOV dword ptr [EBX + 0x4a8],EAX
MOV EAX,dword ptr [ESI]
TEST EAX,EAX
JZ 0x0002f985
SUB ESP,0xc
PUSH EAX
CALL 0x0001dd30
ADD ESP,0x10
SUB ESP,0xc
XOR EDI,EDI
PUSH ESI
CALL 0x0001dd30
ADD ESP,0x10
MOV EAX,EDI
MOV EDI,dword ptr [ESP + 0x1c]
XOR EDI,dword ptr GS:[0x14]
JNZ 0x0002faf2
ADD ESP,0x2c
POP EBX
POP ESI
POP EDI
POP EBP
RET
SUB ESP,0x8
PUSH 0x8
PUSH 0x1
CALL 0x0001db90
MOV ECX,dword ptr [ESP + 0x24]
MOV EDX,dword ptr [ESP + 0x28]
MOV EDI,EAX
MOV dword ptr [ESP + 0x1c],ECX
POP EAX
LEA EAX,[EDX + 0x1]
POP ECX
PUSH 0x1
MOV dword ptr [ESP + 0x14],EDX
PUSH EAX
CALL 0x0001db90
ADD ESP,0xc
MOV EDX,dword ptr [ESP + 0xc]
MOV EBP,EAX
PUSH EDX
MOV ECX,dword ptr [ESP + 0x14]
MOV dword ptr [ESP + 0x10],EDX
PUSH ECX
PUSH EAX
CALL 0x00014130
MOV EDX,dword ptr [ESP + 0x18]
MOV byte ptr [EBP + EDX*0x1],0x0
MOV EAX,dword ptr [ESP + 0x28]
ADD ESP,0x10
MOV dword ptr [EDI],EBP
MOV dword ptr [EDI + 0x4],EAX
MOV EAX,dword ptr [ESI]
TEST EAX,EAX
JZ 0x0002fa1b
SUB ESP,0xc
PUSH EAX
CALL 0x0001dd30
ADD ESP,0x10
SUB ESP,0xc
PUSH ESI
CALL 0x0001dd30
ADD ESP,0x10
JMP 0x0002f993
MOV EDX,dword ptr [ESI]
CMP EAX,0x65
JZ 0x0002fa70
MOV dword ptr [EBX + 0x4a4],0xffffffff
LEA EAX,[EBX + 0xfffc4bf6]
MOV dword ptr [EBX + 0x4a8],EAX
TEST EDX,EDX
JZ 0x0002f985
SUB ESP,0xc
PUSH EDX
CALL 0x0001dd30
ADD ESP,0x10
JMP 0x0002f985
MOV ECX,dword ptr [ESI + 0xc]
MOV EAX,dword ptr [ESI + 0x4]
SUB EAX,ECX
CMP EAX,0x3
JBE 0x0002fac0
MOVZX EAX,byte ptr [EDX + ECX*0x1]
MOVZX EDI,byte ptr [EDX + ECX*0x1 + 0x3]
SHL EAX,0x18
OR EAX,EDI
MOVZX EDI,byte ptr [EDX + ECX*0x1 + 0x1]
SHL EDI,0x10
OR EAX,EDI
MOVZX EDI,byte ptr [EDX + ECX*0x1 + 0x2]
ADD ECX,0x4
MOV dword ptr [ESI + 0xc],ECX
SHL EDI,0x8
OR EAX,EDI
MOV dword ptr [EBX + 0x4a4],EAX
CMP EAX,0x8
JBE 0x0002fae0
LEA EAX,[EBX + 0xfffc4c2d]
MOV dword ptr [EBX + 0x4a8],EAX
JMP 0x0002fa4d
MOV dword ptr [EBX + 0x4a4],0xffffffff
LEA EAX,[EBX + 0xfffc4c11]
MOV dword ptr [EBX + 0x4a8],EAX
JMP 0x0002fa4d
MOV EAX,dword ptr [EBX + EAX*0x4 + 0xffffee50]
MOV dword ptr [EBX + 0x4a8],EAX
JMP 0x0002fa4d
CALL 0x0008d800
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 * FUN_0002f910(int *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}\n\n" comment (function_definition "undefined4 * FUN_0002f910(int *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}" type_identifier (pointer_declarator "* FUN_0002f910(int *param_1,undefined4 param_2)" * (function_declarator "FUN_0002f910(int *param_1,undefined4 param_2)" identifier (parameter_list "(int *param_1,undefined4 param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0008d800();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "byte bVar2;" type_identifier identifier ;) (declaration "byte bVar3;" type_identifier identifier ;) (declaration "byte bVar4;" type_identifier identifier ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined4 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "void *local_28;" primitive_type (pointer_declarator "*local_28" * identifier) ;) (declaration "size_t local_24;" primitive_type identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "FUN_0001dd30(param_2);" (call_expression "FUN_0001dd30(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (if_statement "if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" if (parenthesized_expression "(param_1[4] == 0x66)" ( (binary_expression "param_1[4] == 0x66" (subscript_expression "param_1[4]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }" { (expression_statement "iVar7 = FUN_0002e400();" (assignment_expression "iVar7 = FUN_0002e400()" identifier = (call_expression "FUN_0002e400()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }" if (parenthesized_expression "(iVar7 != 0)" ( (binary_expression "iVar7 != 0" identifier != number_literal) )) (compound_statement "{\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }" { (expression_statement "puVar8 = (undefined4 *)FUN_0001db90(1,8);" (assignment_expression "puVar8 = (undefined4 *)FUN_0001db90(1,8)" identifier = (cast_expression "(undefined4 *)FUN_0001db90(1,8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(1,8)" identifier (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "__dest = (void *)FUN_0001db90(local_24 + 1,1);" (assignment_expression "__dest = (void *)FUN_0001db90(local_24 + 1,1)" identifier = (cast_expression "(void *)FUN_0001db90(local_24 + 1,1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(local_24 + 1,1)" identifier (argument_list "(local_24 + 1,1)" ( (binary_expression "local_24 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "memcpy(__dest,local_28,local_24);" (call_expression "memcpy(__dest,local_28,local_24)" identifier (argument_list "(__dest,local_28,local_24)" ( identifier , identifier , identifier ))) ;) (expression_statement "*(undefined1 *)((int)__dest + local_24) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + local_24) = 0" (pointer_expression "*(undefined1 *)((int)__dest + local_24)" * (cast_expression "(undefined1 *)((int)__dest + local_24)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + local_24)" ( (binary_expression "(int)__dest + local_24" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "*puVar8 = __dest;" (assignment_expression "*puVar8 = __dest" (pointer_expression "*puVar8" * identifier) = identifier) ;) (expression_statement "puVar8[1] = local_24;" (assignment_expression "puVar8[1] = local_24" (subscript_expression "puVar8[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }" if (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) (compound_statement "{\n        FUN_0001dd30(*param_1);\n      }" { (expression_statement "FUN_0001dd30(*param_1);" (call_expression "FUN_0001dd30(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) ))) ;) })) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (goto_statement "goto LAB_0002f993;" goto statement_identifier ;) })) (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";" (assignment_expression "DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n"" identifier = (string_literal ""OPEN returned malformed FXP_HANDLE\n"" " string_content escape_sequence ")) ;) (if_statement "if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }" if (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) (compound_statement "{\n      FUN_0001dd30(*param_1);\n    }" { (expression_statement "FUN_0001dd30(*param_1);" (call_expression "FUN_0001dd30(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) ))) ;) })) }) (else_clause "else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" else (compound_statement "{\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" { (expression_statement "iVar7 = *param_1;" (assignment_expression "iVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" if (parenthesized_expression "(param_1[4] == 0x65)" ( (binary_expression "param_1[4] == 0x65" (subscript_expression "param_1[4]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }" { (expression_statement "iVar6 = param_1[3];" (assignment_expression "iVar6 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (if_statement "if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" if (parenthesized_expression "((uint)(param_1[1] - iVar6) < 4)" ( (binary_expression "(uint)(param_1[1] - iVar6) < 4" (call_expression "(uint)(param_1[1] - iVar6)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - iVar6)" ( (binary_expression "param_1[1] - iVar6" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier) ))) < number_literal) )) (compound_statement "{\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }" { (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000cd218 = "malformed FXP_STATUS packet";" (assignment_expression "DAT_000cd218 = "malformed FXP_STATUS packet"" identifier = (string_literal ""malformed FXP_STATUS packet"" " string_content ")) ;) }) (else_clause "else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" else (compound_statement "{\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" { (expression_statement "bVar2 = *(byte *)(iVar7 + iVar6);" (assignment_expression "bVar2 = *(byte *)(iVar7 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + iVar6)" * (cast_expression "(byte *)(iVar7 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + iVar6)" ( (binary_expression "iVar7 + iVar6" identifier + identifier) ))))) ;) (expression_statement "bVar3 = *(byte *)(iVar7 + 3 + iVar6);" (assignment_expression "bVar3 = *(byte *)(iVar7 + 3 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + 3 + iVar6)" * (cast_expression "(byte *)(iVar7 + 3 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 3 + iVar6)" ( (binary_expression "iVar7 + 3 + iVar6" (binary_expression "iVar7 + 3" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar4 = *(byte *)(iVar7 + 1 + iVar6);" (assignment_expression "bVar4 = *(byte *)(iVar7 + 1 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + 1 + iVar6)" * (cast_expression "(byte *)(iVar7 + 1 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 1 + iVar6)" ( (binary_expression "iVar7 + 1 + iVar6" (binary_expression "iVar7 + 1" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar5 = *(byte *)(iVar7 + 2 + iVar6);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 2 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + 2 + iVar6)" * (cast_expression "(byte *)(iVar7 + 2 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 2 + iVar6)" ( (binary_expression "iVar7 + 2 + iVar6" (binary_expression "iVar7 + 2" identifier + number_literal) + identifier) ))))) ;) (expression_statement "param_1[3] = iVar6 + 4;" (assignment_expression "param_1[3] = iVar6 + 4" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (binary_expression "iVar6 + 4" identifier + number_literal)) ;) (expression_statement "DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;" (assignment_expression "DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8" identifier = (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8" (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10" (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3" (binary_expression "(uint)bVar2 << 0x18" (cast_expression "(uint)bVar2" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal) | (cast_expression "(uint)bVar3" ( (type_descriptor "uint" type_identifier) ) identifier)) | (binary_expression "(uint)bVar4 << 0x10" (cast_expression "(uint)bVar4" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal)) | (binary_expression "(uint)bVar5 << 8" (cast_expression "(uint)bVar5" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal))) ;) (if_statement "if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }" if (parenthesized_expression "(DAT_000cd214 < 9)" ( (binary_expression "DAT_000cd214 < 9" identifier < number_literal) )) (compound_statement "{\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }" { (expression_statement "DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];" (assignment_expression "DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214]" identifier = (subscript_expression "(&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214]" (parenthesized_expression "(&PTR_s_unexpected_OK_response_000cbbc0)" ( (pointer_expression "&PTR_s_unexpected_OK_response_000cbbc0" & identifier) )) [ identifier ])) ;) }) (else_clause "else {\n          DAT_000cd218 = "unknown error code";\n        }" else (compound_statement "{\n          DAT_000cd218 = "unknown error code";\n        }" { (expression_statement "DAT_000cd218 = "unknown error code";" (assignment_expression "DAT_000cd218 = "unknown error code"" identifier = (string_literal ""unknown error code"" " string_content ")) ;) }))) }))) }) (else_clause "else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" else (compound_statement "{\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" { (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000cd218 = "expected FXP_STATUS packet";" (assignment_expression "DAT_000cd218 = "expected FXP_STATUS packet"" identifier = (string_literal ""expected FXP_STATUS packet"" " string_content ")) ;) }))) (if_statement "if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }" if (parenthesized_expression "(iVar7 != 0)" ( (binary_expression "iVar7 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0001dd30(iVar7);\n    }" { (expression_statement "FUN_0001dd30(iVar7);" (call_expression "FUN_0001dd30(iVar7)" identifier (argument_list "(iVar7)" ( identifier ))) ;) })) }))) (expression_statement "puVar8 = (undefined4 *)0x0;" (assignment_expression "puVar8 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (labeled_statement "LAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return puVar8;\n  }" { (return_statement "return puVar8;" return identifier ;) }))) comment (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nfxp_handle * fxp_open_recv(sftp_packet *pktin,sftp_request *req)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  uint uVar5;\n  int iVar6;\n  char *pcVar7;\n  fxp_handle *pfVar8;\n  int in_GS_OFFSET;\n  char *hstring;\n  int len;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x2f919;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  safefree(req);\n  if (pktin->type == 0x66) {\n    iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);\n    if (iVar6 != 0) {\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }\n    fxp_errtype = -1;\n    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";\n    if (pktin->data != (char *)0x0) {\n      safefree(pktin->data);\n    }\n  }\n  else {\n    pcVar7 = pktin->data;\n    if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }\n    if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }\n  }\n  pfVar8 = (fxp_handle *)0x0;\n  safefree(pktin);\nLAB_0002f993:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pfVar8;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "fxp_handle * fxp_open_recv(sftp_packet *pktin,sftp_request *req)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  uint uVar5;\n  int iVar6;\n  char *pcVar7;\n  fxp_handle *pfVar8;\n  int in_GS_OFFSET;\n  char *hstring;\n  int len;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x2f919;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  safefree(req);\n  if (pktin->type == 0x66) {\n    iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);\n    if (iVar6 != 0) {\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }\n    fxp_errtype = -1;\n    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";\n    if (pktin->data != (char *)0x0) {\n      safefree(pktin->data);\n    }\n  }\n  else {\n    pcVar7 = pktin->data;\n    if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }\n    if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }\n  }\n  pfVar8 = (fxp_handle *)0x0;\n  safefree(pktin);\nLAB_0002f993:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pfVar8;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" type_identifier (pointer_declarator "* fxp_open_recv(sftp_packet *pktin,sftp_request *req)" * (function_declarator "fxp_open_recv(sftp_packet *pktin,sftp_request *req)" identifier (parameter_list "(sftp_packet *pktin,sftp_request *req)" ( (parameter_declaration "sftp_packet *pktin" type_identifier (pointer_declarator "*pktin" * identifier)) , (parameter_declaration "sftp_request *req" type_identifier (pointer_declarator "*req" * identifier)) )))) (compound_statement "{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  uint uVar5;\n  int iVar6;\n  char *pcVar7;\n  fxp_handle *pfVar8;\n  int in_GS_OFFSET;\n  char *hstring;\n  int len;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x2f919;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  safefree(req);\n  if (pktin->type == 0x66) {\n    iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);\n    if (iVar6 != 0) {\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }\n    fxp_errtype = -1;\n    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";\n    if (pktin->data != (char *)0x0) {\n      safefree(pktin->data);\n    }\n  }\n  else {\n    pcVar7 = pktin->data;\n    if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }\n    if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }\n  }\n  pfVar8 = (fxp_handle *)0x0;\n  safefree(pktin);\nLAB_0002f993:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pfVar8;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "byte bVar1;" type_identifier identifier ;) (declaration "byte bVar2;" type_identifier identifier ;) (declaration "byte bVar3;" type_identifier identifier ;) (declaration "byte bVar4;" type_identifier identifier ;) (declaration "uint uVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "char *pcVar7;" primitive_type (pointer_declarator "*pcVar7" * identifier) ;) (declaration "fxp_handle *pfVar8;" type_identifier (pointer_declarator "*pfVar8" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char *hstring;" primitive_type (pointer_declarator "*hstring" * identifier) ;) (declaration "int len;" primitive_type identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x2f919;" (assignment_expression "uStack_14 = 0x2f919" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "safefree(req);" (call_expression "safefree(req)" identifier (argument_list "(req)" ( identifier ))) ;) (if_statement "if (pktin->type == 0x66) {\n    iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);\n    if (iVar6 != 0) {\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }\n    fxp_errtype = -1;\n    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";\n    if (pktin->data != (char *)0x0) {\n      safefree(pktin->data);\n    }\n  }\n  else {\n    pcVar7 = pktin->data;\n    if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }\n    if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }\n  }" if (parenthesized_expression "(pktin->type == 0x66)" ( (binary_expression "pktin->type == 0x66" (field_expression "pktin->type" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n    iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);\n    if (iVar6 != 0) {\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }\n    fxp_errtype = -1;\n    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";\n    if (pktin->data != (char *)0x0) {\n      safefree(pktin->data);\n    }\n  }" { (expression_statement "iVar6 = sftp_pkt_getstring(pktin,&hstring,&len);" (assignment_expression "iVar6 = sftp_pkt_getstring(pktin,&hstring,&len)" identifier = (call_expression "sftp_pkt_getstring(pktin,&hstring,&len)" identifier (argument_list "(pktin,&hstring,&len)" ( identifier , (pointer_expression "&hstring" & identifier) , (pointer_expression "&len" & identifier) )))) ;) (if_statement "if (iVar6 != 0) {\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }" if (parenthesized_expression "(iVar6 != 0)" ( (binary_expression "iVar6 != 0" identifier != number_literal) )) (compound_statement "{\n      pfVar8 = (fxp_handle *)safemalloc(1,8);\n      iVar6 = len;\n      pcVar7 = (char *)safemalloc(len + 1,1);\n      memcpy(pcVar7,hstring,iVar6);\n      pcVar7[iVar6] = '\0';\n      pfVar8->hstring = pcVar7;\n      pfVar8->hlen = len;\n      if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }\n      safefree(pktin);\n      goto LAB_0002f993;\n    }" { (expression_statement "pfVar8 = (fxp_handle *)safemalloc(1,8);" (assignment_expression "pfVar8 = (fxp_handle *)safemalloc(1,8)" identifier = (cast_expression "(fxp_handle *)safemalloc(1,8)" ( (type_descriptor "fxp_handle *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(1,8)" identifier (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "iVar6 = len;" (assignment_expression "iVar6 = len" identifier = identifier) ;) (expression_statement "pcVar7 = (char *)safemalloc(len + 1,1);" (assignment_expression "pcVar7 = (char *)safemalloc(len + 1,1)" identifier = (cast_expression "(char *)safemalloc(len + 1,1)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "safemalloc(len + 1,1)" identifier (argument_list "(len + 1,1)" ( (binary_expression "len + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "memcpy(pcVar7,hstring,iVar6);" (call_expression "memcpy(pcVar7,hstring,iVar6)" identifier (argument_list "(pcVar7,hstring,iVar6)" ( identifier , identifier , identifier ))) ;) (expression_statement "pcVar7[iVar6] = '\0';" (assignment_expression "pcVar7[iVar6] = '\0'" (subscript_expression "pcVar7[iVar6]" identifier [ identifier ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "pfVar8->hstring = pcVar7;" (assignment_expression "pfVar8->hstring = pcVar7" (field_expression "pfVar8->hstring" identifier -> field_identifier) = identifier) ;) (expression_statement "pfVar8->hlen = len;" (assignment_expression "pfVar8->hlen = len" (field_expression "pfVar8->hlen" identifier -> field_identifier) = identifier) ;) (if_statement "if (pktin->data != (char *)0x0) {\n        safefree(pktin->data);\n      }" if (parenthesized_expression "(pktin->data != (char *)0x0)" ( (binary_expression "pktin->data != (char *)0x0" (field_expression "pktin->data" identifier -> field_identifier) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        safefree(pktin->data);\n      }" { (expression_statement "safefree(pktin->data);" (call_expression "safefree(pktin->data)" identifier (argument_list "(pktin->data)" ( (field_expression "pktin->data" identifier -> field_identifier) ))) ;) })) (expression_statement "safefree(pktin);" (call_expression "safefree(pktin)" identifier (argument_list "(pktin)" ( identifier ))) ;) (goto_statement "goto LAB_0002f993;" goto statement_identifier ;) })) (expression_statement "fxp_errtype = -1;" (assignment_expression "fxp_errtype = -1" identifier = number_literal) ;) (expression_statement "fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";" (assignment_expression "fxp_error_message = "OPEN returned malformed FXP_HANDLE\n"" identifier = (string_literal ""OPEN returned malformed FXP_HANDLE\n"" " string_content escape_sequence ")) ;) (if_statement "if (pktin->data != (char *)0x0) {\n      safefree(pktin->data);\n    }" if (parenthesized_expression "(pktin->data != (char *)0x0)" ( (binary_expression "pktin->data != (char *)0x0" (field_expression "pktin->data" identifier -> field_identifier) != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      safefree(pktin->data);\n    }" { (expression_statement "safefree(pktin->data);" (call_expression "safefree(pktin->data)" identifier (argument_list "(pktin->data)" ( (field_expression "pktin->data" identifier -> field_identifier) ))) ;) })) }) (else_clause "else {\n    pcVar7 = pktin->data;\n    if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }\n    if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }\n  }" else (compound_statement "{\n    pcVar7 = pktin->data;\n    if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }\n    if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }\n  }" { (expression_statement "pcVar7 = pktin->data;" (assignment_expression "pcVar7 = pktin->data" identifier = (field_expression "pktin->data" identifier -> field_identifier)) ;) (if_statement "if (pktin->type == 0x65) {\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }\n    else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }" if (parenthesized_expression "(pktin->type == 0x65)" ( (binary_expression "pktin->type == 0x65" (field_expression "pktin->type" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n      uVar5 = pktin->savedpos;\n      if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }\n    }" { (expression_statement "uVar5 = pktin->savedpos;" (assignment_expression "uVar5 = pktin->savedpos" identifier = (field_expression "pktin->savedpos" identifier -> field_identifier)) ;) (if_statement "if (pktin->length - uVar5 < 4) {\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }" if (parenthesized_expression "(pktin->length - uVar5 < 4)" ( (binary_expression "pktin->length - uVar5 < 4" (binary_expression "pktin->length - uVar5" (field_expression "pktin->length" identifier -> field_identifier) - identifier) < number_literal) )) (compound_statement "{\n        fxp_errtype = -1;\n        fxp_error_message = "malformed FXP_STATUS packet";\n      }" { (expression_statement "fxp_errtype = -1;" (assignment_expression "fxp_errtype = -1" identifier = number_literal) ;) (expression_statement "fxp_error_message = "malformed FXP_STATUS packet";" (assignment_expression "fxp_error_message = "malformed FXP_STATUS packet"" identifier = (string_literal ""malformed FXP_STATUS packet"" " string_content ")) ;) }) (else_clause "else {\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }" else (compound_statement "{\n        bVar1 = pcVar7[uVar5];\n        bVar2 = pcVar7[uVar5 + 3];\n        bVar3 = pcVar7[uVar5 + 1];\n        bVar4 = pcVar7[uVar5 + 2];\n        pktin->savedpos = uVar5 + 4;\n        fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n        if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }\n      }" { (expression_statement "bVar1 = pcVar7[uVar5];" (assignment_expression "bVar1 = pcVar7[uVar5]" identifier = (subscript_expression "pcVar7[uVar5]" identifier [ identifier ])) ;) (expression_statement "bVar2 = pcVar7[uVar5 + 3];" (assignment_expression "bVar2 = pcVar7[uVar5 + 3]" identifier = (subscript_expression "pcVar7[uVar5 + 3]" identifier [ (binary_expression "uVar5 + 3" identifier + number_literal) ])) ;) (expression_statement "bVar3 = pcVar7[uVar5 + 1];" (assignment_expression "bVar3 = pcVar7[uVar5 + 1]" identifier = (subscript_expression "pcVar7[uVar5 + 1]" identifier [ (binary_expression "uVar5 + 1" identifier + number_literal) ])) ;) (expression_statement "bVar4 = pcVar7[uVar5 + 2];" (assignment_expression "bVar4 = pcVar7[uVar5 + 2]" identifier = (subscript_expression "pcVar7[uVar5 + 2]" identifier [ (binary_expression "uVar5 + 2" identifier + number_literal) ])) ;) (expression_statement "pktin->savedpos = uVar5 + 4;" (assignment_expression "pktin->savedpos = uVar5 + 4" (field_expression "pktin->savedpos" identifier -> field_identifier) = (binary_expression "uVar5 + 4" identifier + number_literal)) ;) (expression_statement "fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;" (assignment_expression "fxp_errtype = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8" identifier = (binary_expression "(uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8" (binary_expression "(uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10" (binary_expression "(uint)bVar1 << 0x18 | (uint)bVar2" (binary_expression "(uint)bVar1 << 0x18" (cast_expression "(uint)bVar1" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal) | (cast_expression "(uint)bVar2" ( (type_descriptor "uint" type_identifier) ) identifier)) | (binary_expression "(uint)bVar3 << 0x10" (cast_expression "(uint)bVar3" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal)) | (binary_expression "(uint)bVar4 << 8" (cast_expression "(uint)bVar4" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal))) ;) (if_statement "if ((uint)fxp_errtype < 9) {\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }\n        else {\n          fxp_error_message = "unknown error code";\n        }" if (parenthesized_expression "((uint)fxp_errtype < 9)" ( (binary_expression "(uint)fxp_errtype < 9" (cast_expression "(uint)fxp_errtype" ( (type_descriptor "uint" type_identifier) ) identifier) < number_literal) )) (compound_statement "{\n          fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);\n        }" { (expression_statement "fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4);" (assignment_expression "fxp_error_message = *(char **)(messages_3690 + fxp_errtype * 4)" identifier = (pointer_expression "*(char **)(messages_3690 + fxp_errtype * 4)" * (cast_expression "(char **)(messages_3690 + fxp_errtype * 4)" ( (type_descriptor "char **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(messages_3690 + fxp_errtype * 4)" ( (binary_expression "messages_3690 + fxp_errtype * 4" identifier + (binary_expression "fxp_errtype * 4" identifier * number_literal)) ))))) ;) }) (else_clause "else {\n          fxp_error_message = "unknown error code";\n        }" else (compound_statement "{\n          fxp_error_message = "unknown error code";\n        }" { (expression_statement "fxp_error_message = "unknown error code";" (assignment_expression "fxp_error_message = "unknown error code"" identifier = (string_literal ""unknown error code"" " string_content ")) ;) }))) }))) }) (else_clause "else {\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }" else (compound_statement "{\n      fxp_errtype = -1;\n      fxp_error_message = "expected FXP_STATUS packet";\n    }" { (expression_statement "fxp_errtype = -1;" (assignment_expression "fxp_errtype = -1" identifier = number_literal) ;) (expression_statement "fxp_error_message = "expected FXP_STATUS packet";" (assignment_expression "fxp_error_message = "expected FXP_STATUS packet"" identifier = (string_literal ""expected FXP_STATUS packet"" " string_content ")) ;) }))) (if_statement "if (pcVar7 != (char *)0x0) {\n      safefree(pcVar7);\n    }" if (parenthesized_expression "(pcVar7 != (char *)0x0)" ( (binary_expression "pcVar7 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n      safefree(pcVar7);\n    }" { (expression_statement "safefree(pcVar7);" (call_expression "safefree(pcVar7)" identifier (argument_list "(pcVar7)" ( identifier ))) ;) })) }))) (expression_statement "pfVar8 = (fxp_handle *)0x0;" (assignment_expression "pfVar8 = (fxp_handle *)0x0" identifier = (cast_expression "(fxp_handle *)0x0" ( (type_descriptor "fxp_handle *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "safefree(pktin);" (call_expression "safefree(pktin)" identifier (argument_list "(pktin)" ( identifier ))) ;) (labeled_statement "LAB_0002f993:\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pfVar8;\n  }" statement_identifier : (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return pfVar8;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return pfVar8;\n  }" { (return_statement "return pfVar8;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "undefined4 * FUN_0002f910(int *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    \n  FUN_0008d800();\n}\n\n" (function_definition "undefined4 * FUN_0002f910(int *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    \n  FUN_0008d800();\n}" type_identifier (pointer_declarator "* FUN_0002f910(int *param_1,undefined4 param_2)" * (function_declarator "FUN_0002f910(int *param_1,undefined4 param_2)" identifier (parameter_list "(int *param_1,undefined4 param_2)" ( (parameter_declaration "int *param_1" primitive_type (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "undefined4 param_2" type_identifier identifier) )))) (compound_statement "{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    \n  FUN_0008d800();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "byte bVar2;" type_identifier identifier ;) (declaration "byte bVar3;" type_identifier identifier ;) (declaration "byte bVar4;" type_identifier identifier ;) (declaration "byte bVar5;" type_identifier identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "int iVar7;" primitive_type identifier ;) (declaration "void *__dest;" primitive_type (pointer_declarator "*__dest" * identifier) ;) (declaration "undefined4 *puVar8;" type_identifier (pointer_declarator "*puVar8" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "void *local_28;" primitive_type (pointer_declarator "*local_28" * identifier) ;) (declaration "size_t local_24;" primitive_type identifier ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "FUN_0001dd30(param_2);" (call_expression "FUN_0001dd30(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (if_statement "if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" if (parenthesized_expression "(param_1[4] == 0x66)" ( (binary_expression "param_1[4] == 0x66" (subscript_expression "param_1[4]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }" { (expression_statement "iVar7 = FUN_0002e400();" (assignment_expression "iVar7 = FUN_0002e400()" identifier = (call_expression "FUN_0002e400()" identifier (argument_list "()" ( )))) ;) (if_statement "if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }" if (parenthesized_expression "(iVar7 != 0)" ( (binary_expression "iVar7 != 0" identifier != number_literal) )) (compound_statement "{\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }" { (expression_statement "puVar8 = (undefined4 *)FUN_0001db90(1,8);" (assignment_expression "puVar8 = (undefined4 *)FUN_0001db90(1,8)" identifier = (cast_expression "(undefined4 *)FUN_0001db90(1,8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(1,8)" identifier (argument_list "(1,8)" ( number_literal , number_literal ))))) ;) (expression_statement "__dest = (void *)FUN_0001db90(local_24 + 1,1);" (assignment_expression "__dest = (void *)FUN_0001db90(local_24 + 1,1)" identifier = (cast_expression "(void *)FUN_0001db90(local_24 + 1,1)" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0001db90(local_24 + 1,1)" identifier (argument_list "(local_24 + 1,1)" ( (binary_expression "local_24 + 1" identifier + number_literal) , number_literal ))))) ;) (expression_statement "memcpy(__dest,local_28,local_24);" (call_expression "memcpy(__dest,local_28,local_24)" identifier (argument_list "(__dest,local_28,local_24)" ( identifier , identifier , identifier ))) ;) (expression_statement "*(undefined1 *)((int)__dest + local_24) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + local_24) = 0" (pointer_expression "*(undefined1 *)((int)__dest + local_24)" * (cast_expression "(undefined1 *)((int)__dest + local_24)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "((int)__dest + local_24)" ( (binary_expression "(int)__dest + local_24" (cast_expression "(int)__dest" ( (type_descriptor "int" primitive_type) ) identifier) + identifier) )))) = number_literal) ;) (expression_statement "*puVar8 = __dest;" (assignment_expression "*puVar8 = __dest" (pointer_expression "*puVar8" * identifier) = identifier) ;) (expression_statement "puVar8[1] = local_24;" (assignment_expression "puVar8[1] = local_24" (subscript_expression "puVar8[1]" identifier [ number_literal ]) = identifier) ;) (if_statement "if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }" if (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) (compound_statement "{\n        FUN_0001dd30(*param_1);\n      }" { (expression_statement "FUN_0001dd30(*param_1);" (call_expression "FUN_0001dd30(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) ))) ;) })) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (goto_statement "goto LAB_0002f993;" goto statement_identifier ;) })) (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";" (assignment_expression "DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n"" identifier = (string_literal ""OPEN returned malformed FXP_HANDLE\n"" " string_content escape_sequence ")) ;) (if_statement "if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }" if (parenthesized_expression "(*param_1 != 0)" ( (binary_expression "*param_1 != 0" (pointer_expression "*param_1" * identifier) != number_literal) )) (compound_statement "{\n      FUN_0001dd30(*param_1);\n    }" { (expression_statement "FUN_0001dd30(*param_1);" (call_expression "FUN_0001dd30(*param_1)" identifier (argument_list "(*param_1)" ( (pointer_expression "*param_1" * identifier) ))) ;) })) }) (else_clause "else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" else (compound_statement "{\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" { (expression_statement "iVar7 = *param_1;" (assignment_expression "iVar7 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" if (parenthesized_expression "(param_1[4] == 0x65)" ( (binary_expression "param_1[4] == 0x65" (subscript_expression "param_1[4]" identifier [ number_literal ]) == number_literal) )) (compound_statement "{\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }" { (expression_statement "iVar6 = param_1[3];" (assignment_expression "iVar6 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (if_statement "if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" if (parenthesized_expression "((uint)(param_1[1] - iVar6) < 4)" ( (binary_expression "(uint)(param_1[1] - iVar6) < 4" (call_expression "(uint)(param_1[1] - iVar6)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - iVar6)" ( (binary_expression "param_1[1] - iVar6" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier) ))) < number_literal) )) (compound_statement "{\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }" { (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000cd218 = "malformed FXP_STATUS packet";" (assignment_expression "DAT_000cd218 = "malformed FXP_STATUS packet"" identifier = (string_literal ""malformed FXP_STATUS packet"" " string_content ")) ;) }) (else_clause "else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" else (compound_statement "{\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" { (expression_statement "bVar2 = *(byte *)(iVar7 + iVar6);" (assignment_expression "bVar2 = *(byte *)(iVar7 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + iVar6)" * (cast_expression "(byte *)(iVar7 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + iVar6)" ( (binary_expression "iVar7 + iVar6" identifier + identifier) ))))) ;) (expression_statement "bVar3 = *(byte *)(iVar7 + 3 + iVar6);" (assignment_expression "bVar3 = *(byte *)(iVar7 + 3 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + 3 + iVar6)" * (cast_expression "(byte *)(iVar7 + 3 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 3 + iVar6)" ( (binary_expression "iVar7 + 3 + iVar6" (binary_expression "iVar7 + 3" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar4 = *(byte *)(iVar7 + 1 + iVar6);" (assignment_expression "bVar4 = *(byte *)(iVar7 + 1 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + 1 + iVar6)" * (cast_expression "(byte *)(iVar7 + 1 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 1 + iVar6)" ( (binary_expression "iVar7 + 1 + iVar6" (binary_expression "iVar7 + 1" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar5 = *(byte *)(iVar7 + 2 + iVar6);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 2 + iVar6)" identifier = (pointer_expression "*(byte *)(iVar7 + 2 + iVar6)" * (cast_expression "(byte *)(iVar7 + 2 + iVar6)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar7 + 2 + iVar6)" ( (binary_expression "iVar7 + 2 + iVar6" (binary_expression "iVar7 + 2" identifier + number_literal) + identifier) ))))) ;) (expression_statement "param_1[3] = iVar6 + 4;" (assignment_expression "param_1[3] = iVar6 + 4" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (binary_expression "iVar6 + 4" identifier + number_literal)) ;) (expression_statement "DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;" (assignment_expression "DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8" identifier = (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8" (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10" (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3" (binary_expression "(uint)bVar2 << 0x18" (cast_expression "(uint)bVar2" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal) | (cast_expression "(uint)bVar3" ( (type_descriptor "uint" type_identifier) ) identifier)) | (binary_expression "(uint)bVar4 << 0x10" (cast_expression "(uint)bVar4" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal)) | (binary_expression "(uint)bVar5 << 8" (cast_expression "(uint)bVar5" ( (type_descriptor "uint" type_identifier) ) identifier) << number_literal))) ;) (if_statement "if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }" if (parenthesized_expression "(DAT_000cd214 < 9)" ( (binary_expression "DAT_000cd214 < 9" identifier < number_literal) )) (compound_statement "{\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }" { (expression_statement "DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];" (assignment_expression "DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214]" identifier = (subscript_expression "(&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214]" (parenthesized_expression "(&PTR_s_unexpected_OK_response_000cbbc0)" ( (pointer_expression "&PTR_s_unexpected_OK_response_000cbbc0" & identifier) )) [ identifier ])) ;) }) (else_clause "else {\n          DAT_000cd218 = "unknown error code";\n        }" else (compound_statement "{\n          DAT_000cd218 = "unknown error code";\n        }" { (expression_statement "DAT_000cd218 = "unknown error code";" (assignment_expression "DAT_000cd218 = "unknown error code"" identifier = (string_literal ""unknown error code"" " string_content ")) ;) }))) }))) }) (else_clause "else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" else (compound_statement "{\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" { (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000cd218 = "expected FXP_STATUS packet";" (assignment_expression "DAT_000cd218 = "expected FXP_STATUS packet"" identifier = (string_literal ""expected FXP_STATUS packet"" " string_content ")) ;) }))) (if_statement "if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }" if (parenthesized_expression "(iVar7 != 0)" ( (binary_expression "iVar7 != 0" identifier != number_literal) )) (compound_statement "{\n      FUN_0001dd30(iVar7);\n    }" { (expression_statement "FUN_0001dd30(iVar7);" (call_expression "FUN_0001dd30(iVar7)" identifier (argument_list "(iVar7)" ( identifier ))) ;) })) }))) (expression_statement "puVar8 = (undefined4 *)0x0;" (assignment_expression "puVar8 = (undefined4 *)0x0" identifier = (cast_expression "(undefined4 *)0x0" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) ;) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (labeled_statement "LAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }" statement_identifier : (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return puVar8;\n  }" { (return_statement "return puVar8;" return identifier ;) }))) (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (pointer_declarator * (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) )))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( LIT , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , LIT ))))) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) + IDENT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * IDENT) ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (goto_statement goto statement_identifier ;) })) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content escape_sequence ")) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * IDENT) ))) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (if_statement if (parenthesized_expression ( (binary_expression (subscript_expression IDENT [ LIT ]) == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (subscript_expression IDENT [ LIT ]) - IDENT) ))) < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) ))))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (binary_expression IDENT + LIT) + IDENT) ))))) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) << LIT) | (cast_expression ( (type_descriptor TYPE) ) IDENT)) | (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) << LIT)) | (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) << LIT))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression (parenthesized_expression ( (pointer_expression & IDENT) )) [ IDENT ])) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) }))) }))) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (string_literal " string_content ")) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) }))) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "undefined4 * FUN_0002f910(int *param_1,undefined4 param_2)\n\n{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    \n  FUN_0008d800();\n}" (type_identifier "undefined4") (pointer_declarator "* FUN_0002f910(int *param_1,undefined4 param_2)" (* "*") (function_declarator "FUN_0002f910(int *param_1,undefined4 param_2)" (identifier "FUN_0002f910") (parameter_list "(int *param_1,undefined4 param_2)" (( "(") (parameter_declaration "int *param_1" (primitive_type "int") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "undefined4 param_2" (type_identifier "undefined4") (identifier "param_2")) () ")")))) (compound_statement "{\n  int iVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  byte bVar5;\n  int iVar6;\n  int iVar7;\n  void *__dest;\n  undefined4 *puVar8;\n  int in_GS_OFFSET;\n  void *local_28;\n  size_t local_24;\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }\n  puVar8 = (undefined4 *)0x0;\n  FUN_0001dd30(param_1);\nLAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }\n                    \n  FUN_0008d800();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "byte bVar2;" (type_identifier "byte") (identifier "bVar2") (; ";")) (declaration "byte bVar3;" (type_identifier "byte") (identifier "bVar3") (; ";")) (declaration "byte bVar4;" (type_identifier "byte") (identifier "bVar4") (; ";")) (declaration "byte bVar5;" (type_identifier "byte") (identifier "bVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (declaration "int iVar7;" (primitive_type "int") (identifier "iVar7") (; ";")) (declaration "void *__dest;" (primitive_type "void") (pointer_declarator "*__dest" (* "*") (identifier "__dest")) (; ";")) (declaration "undefined4 *puVar8;" (type_identifier "undefined4") (pointer_declarator "*puVar8" (* "*") (identifier "puVar8")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "void *local_28;" (primitive_type "void") (pointer_declarator "*local_28" (* "*") (identifier "local_28")) (; ";")) (declaration "size_t local_24;" (primitive_type "size_t") (identifier "local_24") (; ";")) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "FUN_0001dd30(param_2);" (call_expression "FUN_0001dd30(param_2)" (identifier "FUN_0001dd30") (argument_list "(param_2)" (( "(") (identifier "param_2") () ")"))) (; ";")) (if_statement "if (param_1[4] == 0x66) {\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }\n  else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" (if "if") (parenthesized_expression "(param_1[4] == 0x66)" (( "(") (binary_expression "param_1[4] == 0x66" (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]")) (== "==") (number_literal "0x66")) () ")")) (compound_statement "{\n    iVar7 = FUN_0002e400();\n    if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }\n    DAT_000cd214 = 0xffffffff;\n    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";\n    if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }\n  }" ({ "{") (expression_statement "iVar7 = FUN_0002e400();" (assignment_expression "iVar7 = FUN_0002e400()" (identifier "iVar7") (= "=") (call_expression "FUN_0002e400()" (identifier "FUN_0002e400") (argument_list "()" (( "(") () ")")))) (; ";")) (if_statement "if (iVar7 != 0) {\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }" (if "if") (parenthesized_expression "(iVar7 != 0)" (( "(") (binary_expression "iVar7 != 0" (identifier "iVar7") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      puVar8 = (undefined4 *)FUN_0001db90(1,8);\n      __dest = (void *)FUN_0001db90(local_24 + 1,1);\n      memcpy(__dest,local_28,local_24);\n      *(undefined1 *)((int)__dest + local_24) = 0;\n      *puVar8 = __dest;\n      puVar8[1] = local_24;\n      if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }\n      FUN_0001dd30(param_1);\n      goto LAB_0002f993;\n    }" ({ "{") (expression_statement "puVar8 = (undefined4 *)FUN_0001db90(1,8);" (assignment_expression "puVar8 = (undefined4 *)FUN_0001db90(1,8)" (identifier "puVar8") (= "=") (cast_expression "(undefined4 *)FUN_0001db90(1,8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001db90(1,8)" (identifier "FUN_0001db90") (argument_list "(1,8)" (( "(") (number_literal "1") (, ",") (number_literal "8") () ")"))))) (; ";")) (expression_statement "__dest = (void *)FUN_0001db90(local_24 + 1,1);" (assignment_expression "__dest = (void *)FUN_0001db90(local_24 + 1,1)" (identifier "__dest") (= "=") (cast_expression "(void *)FUN_0001db90(local_24 + 1,1)" (( "(") (type_descriptor "void *" (primitive_type "void") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0001db90(local_24 + 1,1)" (identifier "FUN_0001db90") (argument_list "(local_24 + 1,1)" (( "(") (binary_expression "local_24 + 1" (identifier "local_24") (+ "+") (number_literal "1")) (, ",") (number_literal "1") () ")"))))) (; ";")) (expression_statement "memcpy(__dest,local_28,local_24);" (call_expression "memcpy(__dest,local_28,local_24)" (identifier "memcpy") (argument_list "(__dest,local_28,local_24)" (( "(") (identifier "__dest") (, ",") (identifier "local_28") (, ",") (identifier "local_24") () ")"))) (; ";")) (expression_statement "*(undefined1 *)((int)__dest + local_24) = 0;" (assignment_expression "*(undefined1 *)((int)__dest + local_24) = 0" (pointer_expression "*(undefined1 *)((int)__dest + local_24)" (* "*") (cast_expression "(undefined1 *)((int)__dest + local_24)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "((int)__dest + local_24)" (( "(") (binary_expression "(int)__dest + local_24" (cast_expression "(int)__dest" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "__dest")) (+ "+") (identifier "local_24")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*puVar8 = __dest;" (assignment_expression "*puVar8 = __dest" (pointer_expression "*puVar8" (* "*") (identifier "puVar8")) (= "=") (identifier "__dest")) (; ";")) (expression_statement "puVar8[1] = local_24;" (assignment_expression "puVar8[1] = local_24" (subscript_expression "puVar8[1]" (identifier "puVar8") ([ "[") (number_literal "1") (] "]")) (= "=") (identifier "local_24")) (; ";")) (if_statement "if (*param_1 != 0) {\n        FUN_0001dd30(*param_1);\n      }" (if "if") (parenthesized_expression "(*param_1 != 0)" (( "(") (binary_expression "*param_1 != 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n        FUN_0001dd30(*param_1);\n      }" ({ "{") (expression_statement "FUN_0001dd30(*param_1);" (call_expression "FUN_0001dd30(*param_1)" (identifier "FUN_0001dd30") (argument_list "(*param_1)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) () ")"))) (; ";")) (} "}"))) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" (identifier "FUN_0001dd30") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (goto_statement "goto LAB_0002f993;" (goto "goto") (statement_identifier "LAB_0002f993") (; ";")) (} "}"))) (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" (identifier "DAT_000cd214") (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";" (assignment_expression "DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n"" (identifier "DAT_000cd218") (= "=") (string_literal ""OPEN returned malformed FXP_HANDLE\n"" (" """) (string_content "OPEN returned malformed FXP_HANDLE") (escape_sequence "\n") (" """))) (; ";")) (if_statement "if (*param_1 != 0) {\n      FUN_0001dd30(*param_1);\n    }" (if "if") (parenthesized_expression "(*param_1 != 0)" (( "(") (binary_expression "*param_1 != 0" (pointer_expression "*param_1" (* "*") (identifier "param_1")) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0001dd30(*param_1);\n    }" ({ "{") (expression_statement "FUN_0001dd30(*param_1);" (call_expression "FUN_0001dd30(*param_1)" (identifier "FUN_0001dd30") (argument_list "(*param_1)" (( "(") (pointer_expression "*param_1" (* "*") (identifier "param_1")) () ")"))) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" (else "else") (compound_statement "{\n    iVar7 = *param_1;\n    if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }\n    if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }\n  }" ({ "{") (expression_statement "iVar7 = *param_1;" (assignment_expression "iVar7 = *param_1" (identifier "iVar7") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if (param_1[4] == 0x65) {\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }\n    else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" (if "if") (parenthesized_expression "(param_1[4] == 0x65)" (( "(") (binary_expression "param_1[4] == 0x65" (subscript_expression "param_1[4]" (identifier "param_1") ([ "[") (number_literal "4") (] "]")) (== "==") (number_literal "0x65")) () ")")) (compound_statement "{\n      iVar6 = param_1[3];\n      if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }\n    }" ({ "{") (expression_statement "iVar6 = param_1[3];" (assignment_expression "iVar6 = param_1[3]" (identifier "iVar6") (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (if_statement "if ((uint)(param_1[1] - iVar6) < 4) {\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }\n      else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" (if "if") (parenthesized_expression "((uint)(param_1[1] - iVar6) < 4)" (( "(") (binary_expression "(uint)(param_1[1] - iVar6) < 4" (call_expression "(uint)(param_1[1] - iVar6)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_1[1] - iVar6)" (( "(") (binary_expression "param_1[1] - iVar6" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (identifier "iVar6")) () ")"))) (< "<") (number_literal "4")) () ")")) (compound_statement "{\n        DAT_000cd214 = 0xffffffff;\n        DAT_000cd218 = "malformed FXP_STATUS packet";\n      }" ({ "{") (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" (identifier "DAT_000cd214") (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "DAT_000cd218 = "malformed FXP_STATUS packet";" (assignment_expression "DAT_000cd218 = "malformed FXP_STATUS packet"" (identifier "DAT_000cd218") (= "=") (string_literal ""malformed FXP_STATUS packet"" (" """) (string_content "malformed FXP_STATUS packet") (" """))) (; ";")) (} "}")) (else_clause "else {\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" (else "else") (compound_statement "{\n        bVar2 = *(byte *)(iVar7 + iVar6);\n        bVar3 = *(byte *)(iVar7 + 3 + iVar6);\n        bVar4 = *(byte *)(iVar7 + 1 + iVar6);\n        bVar5 = *(byte *)(iVar7 + 2 + iVar6);\n        param_1[3] = iVar6 + 4;\n        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;\n        if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }\n      }" ({ "{") (expression_statement "bVar2 = *(byte *)(iVar7 + iVar6);" (assignment_expression "bVar2 = *(byte *)(iVar7 + iVar6)" (identifier "bVar2") (= "=") (pointer_expression "*(byte *)(iVar7 + iVar6)" (* "*") (cast_expression "(byte *)(iVar7 + iVar6)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + iVar6)" (( "(") (binary_expression "iVar7 + iVar6" (identifier "iVar7") (+ "+") (identifier "iVar6")) () ")"))))) (; ";")) (expression_statement "bVar3 = *(byte *)(iVar7 + 3 + iVar6);" (assignment_expression "bVar3 = *(byte *)(iVar7 + 3 + iVar6)" (identifier "bVar3") (= "=") (pointer_expression "*(byte *)(iVar7 + 3 + iVar6)" (* "*") (cast_expression "(byte *)(iVar7 + 3 + iVar6)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 3 + iVar6)" (( "(") (binary_expression "iVar7 + 3 + iVar6" (binary_expression "iVar7 + 3" (identifier "iVar7") (+ "+") (number_literal "3")) (+ "+") (identifier "iVar6")) () ")"))))) (; ";")) (expression_statement "bVar4 = *(byte *)(iVar7 + 1 + iVar6);" (assignment_expression "bVar4 = *(byte *)(iVar7 + 1 + iVar6)" (identifier "bVar4") (= "=") (pointer_expression "*(byte *)(iVar7 + 1 + iVar6)" (* "*") (cast_expression "(byte *)(iVar7 + 1 + iVar6)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 1 + iVar6)" (( "(") (binary_expression "iVar7 + 1 + iVar6" (binary_expression "iVar7 + 1" (identifier "iVar7") (+ "+") (number_literal "1")) (+ "+") (identifier "iVar6")) () ")"))))) (; ";")) (expression_statement "bVar5 = *(byte *)(iVar7 + 2 + iVar6);" (assignment_expression "bVar5 = *(byte *)(iVar7 + 2 + iVar6)" (identifier "bVar5") (= "=") (pointer_expression "*(byte *)(iVar7 + 2 + iVar6)" (* "*") (cast_expression "(byte *)(iVar7 + 2 + iVar6)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar7 + 2 + iVar6)" (( "(") (binary_expression "iVar7 + 2 + iVar6" (binary_expression "iVar7 + 2" (identifier "iVar7") (+ "+") (number_literal "2")) (+ "+") (identifier "iVar6")) () ")"))))) (; ";")) (expression_statement "param_1[3] = iVar6 + 4;" (assignment_expression "param_1[3] = iVar6 + 4" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (binary_expression "iVar6 + 4" (identifier "iVar6") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;" (assignment_expression "DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8" (identifier "DAT_000cd214") (= "=") (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8" (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10" (binary_expression "(uint)bVar2 << 0x18 | (uint)bVar3" (binary_expression "(uint)bVar2 << 0x18" (cast_expression "(uint)bVar2" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar2")) (<< "<<") (number_literal "0x18")) (| "|") (cast_expression "(uint)bVar3" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar3"))) (| "|") (binary_expression "(uint)bVar4 << 0x10" (cast_expression "(uint)bVar4" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar4")) (<< "<<") (number_literal "0x10"))) (| "|") (binary_expression "(uint)bVar5 << 8" (cast_expression "(uint)bVar5" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar5")) (<< "<<") (number_literal "8")))) (; ";")) (if_statement "if (DAT_000cd214 < 9) {\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }\n        else {\n          DAT_000cd218 = "unknown error code";\n        }" (if "if") (parenthesized_expression "(DAT_000cd214 < 9)" (( "(") (binary_expression "DAT_000cd214 < 9" (identifier "DAT_000cd214") (< "<") (number_literal "9")) () ")")) (compound_statement "{\n          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];\n        }" ({ "{") (expression_statement "DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];" (assignment_expression "DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214]" (identifier "DAT_000cd218") (= "=") (subscript_expression "(&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214]" (parenthesized_expression "(&PTR_s_unexpected_OK_response_000cbbc0)" (( "(") (pointer_expression "&PTR_s_unexpected_OK_response_000cbbc0" (& "&") (identifier "PTR_s_unexpected_OK_response_000cbbc0")) () ")")) ([ "[") (identifier "DAT_000cd214") (] "]"))) (; ";")) (} "}")) (else_clause "else {\n          DAT_000cd218 = "unknown error code";\n        }" (else "else") (compound_statement "{\n          DAT_000cd218 = "unknown error code";\n        }" ({ "{") (expression_statement "DAT_000cd218 = "unknown error code";" (assignment_expression "DAT_000cd218 = "unknown error code"" (identifier "DAT_000cd218") (= "=") (string_literal ""unknown error code"" (" """) (string_content "unknown error code") (" """))) (; ";")) (} "}")))) (} "}")))) (} "}")) (else_clause "else {\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" (else "else") (compound_statement "{\n      DAT_000cd214 = 0xffffffff;\n      DAT_000cd218 = "expected FXP_STATUS packet";\n    }" ({ "{") (expression_statement "DAT_000cd214 = 0xffffffff;" (assignment_expression "DAT_000cd214 = 0xffffffff" (identifier "DAT_000cd214") (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "DAT_000cd218 = "expected FXP_STATUS packet";" (assignment_expression "DAT_000cd218 = "expected FXP_STATUS packet"" (identifier "DAT_000cd218") (= "=") (string_literal ""expected FXP_STATUS packet"" (" """) (string_content "expected FXP_STATUS packet") (" """))) (; ";")) (} "}")))) (if_statement "if (iVar7 != 0) {\n      FUN_0001dd30(iVar7);\n    }" (if "if") (parenthesized_expression "(iVar7 != 0)" (( "(") (binary_expression "iVar7 != 0" (identifier "iVar7") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      FUN_0001dd30(iVar7);\n    }" ({ "{") (expression_statement "FUN_0001dd30(iVar7);" (call_expression "FUN_0001dd30(iVar7)" (identifier "FUN_0001dd30") (argument_list "(iVar7)" (( "(") (identifier "iVar7") () ")"))) (; ";")) (} "}"))) (} "}")))) (expression_statement "puVar8 = (undefined4 *)0x0;" (assignment_expression "puVar8 = (undefined4 *)0x0" (identifier "puVar8") (= "=") (cast_expression "(undefined4 *)0x0" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) (; ";")) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" (identifier "FUN_0001dd30") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (labeled_statement "LAB_0002f993:\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }" (statement_identifier "LAB_0002f993") (: ":") (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return puVar8;\n  }" (if "if") (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "iVar1") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return puVar8;\n  }" ({ "{") (return_statement "return puVar8;" (return "return") (identifier "puVar8") (; ";")) (} "}")))) (expression_statement "FUN_0008d800();" (call_expression "FUN_0008d800()" (identifier "FUN_0008d800") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */

type_1 * function_1(type_2 *pktin,type_3 *req)

{
  type_4 bVar1;
  type_4 bVar2;
  type_4 bVar3;
  type_4 bVar4;
  type_5 var_8;
  int var_4;
  char *var_11;
  type_1 *pfVar8;
  int var_1;
  char *hstring;
  int var_6;
  int var_12;
  type_6 uStack_14;
  
  uStack_14 = 0x2f919;
  var_12 = *(int *)(var_1 + 0x14);
  var_2(req);
  if (pktin->type == 0x66) {
    var_4 = var_3(pktin,&hstring,&var_6);
    if (var_4 != 0) {
      pfVar8 = (type_1 *)var_5(1,8);
      var_4 = var_6;
      var_11 = (char *)var_5(var_6 + 1,1);
      var_7(var_11,hstring,var_4);
      var_11[var_4] = '\0';
      pfVar8->hstring = var_11;
      pfVar8->hlen = var_6;
      if (pktin->data != (char *)0x0) {
        var_2(pktin->data);
      }
      var_2(pktin);
      goto LAB_0002f993;
    }
    var_10 = -1;
    fxp_error_message = "OPEN returned malformed FXP_HANDLE\n";
    if (pktin->data != (char *)0x0) {
      var_2(pktin->data);
    }
  }
  else {
    var_11 = pktin->data;
    if (pktin->type == 0x65) {
      var_8 = pktin->savedpos;
      if (pktin->length - var_8 < 4) {
        var_10 = -1;
        fxp_error_message = "malformed FXP_STATUS packet";
      }
      else {
        bVar1 = var_11[var_8];
        bVar2 = var_11[var_8 + 3];
        bVar3 = var_11[var_8 + 1];
        bVar4 = var_11[var_8 + 2];
        pktin->savedpos = var_8 + 4;
        var_10 = (type_5)bVar1 << 0x18 | (type_5)bVar2 | (type_5)bVar3 << 0x10 | (type_5)bVar4 << 8;
        if ((type_5)var_10 < 9) {
          fxp_error_message = *(char **)(var_9 + var_10 * 4);
        }
        else {
          fxp_error_message = "unknown error code";
        }
      }
    }
    else {
      var_10 = -1;
      fxp_error_message = "expected FXP_STATUS packet";
    }
    if (var_11 != (char *)0x0) {
      var_2(var_11);
    }
  }
  pfVar8 = (type_1 *)0x0;
  var_2(pktin);
LAB_0002f993:
  if (var_12 == *(int *)(var_1 + 0x14)) {
    return pfVar8;
  }
                    /* WARNING: Subroutine does not return */
  var_13();
}


(translation_unit (function_definition type: (type_identifier) declarator: (pointer_declarator declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (type_identifier) declarator: (identifier))))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (number_literal) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)) (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (identifier))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (identifier))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (goto_statement label: (statement_identifier)))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content) (escape_sequence)))) (if_statement condition: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (identifier)))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (if_statement condition: (parenthesized_expression (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (identifier) index: (number_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (identifier)))) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (identifier))))))) (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (number_literal)) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal)) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)) right: (number_literal))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (parenthesized_expression (pointer_expression argument: (identifier))) index: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content))))))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (string_literal (string_content))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier))))))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */

undefined4 * MASKED(int *param_1,undefined4 param_2)

{
  int iVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  byte bVar5;
  int iVar6;
  int iVar7;
  void *__dest;
  undefined4 *puVar8;
  int in_GS_OFFSET;
  void *local_28;
  size_t local_24;
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  FUN_0001dd30(param_2);
  if (param_1[4] == 0x66) {
    iVar7 = FUN_0002e400();
    if (iVar7 != 0) {
      puVar8 = (undefined4 *)FUN_0001db90(1,8);
      __dest = (void *)FUN_0001db90(local_24 + 1,1);
      memcpy(__dest,local_28,local_24);
      *(undefined1 *)((int)__dest + local_24) = 0;
      *puVar8 = __dest;
      puVar8[1] = local_24;
      if (*param_1 != 0) {
        FUN_0001dd30(*param_1);
      }
      FUN_0001dd30(param_1);
      goto LAB_0002f993;
    }
    DAT_000cd214 = 0xffffffff;
    DAT_000cd218 = "OPEN returned malformed FXP_HANDLE\n";
    if (*param_1 != 0) {
      FUN_0001dd30(*param_1);
    }
  }
  else {
    iVar7 = *param_1;
    if (param_1[4] == 0x65) {
      iVar6 = param_1[3];
      if ((uint)(param_1[1] - iVar6) < 4) {
        DAT_000cd214 = 0xffffffff;
        DAT_000cd218 = "malformed FXP_STATUS packet";
      }
      else {
        bVar2 = *(byte *)(iVar7 + iVar6);
        bVar3 = *(byte *)(iVar7 + 3 + iVar6);
        bVar4 = *(byte *)(iVar7 + 1 + iVar6);
        bVar5 = *(byte *)(iVar7 + 2 + iVar6);
        param_1[3] = iVar6 + 4;
        DAT_000cd214 = (uint)bVar2 << 0x18 | (uint)bVar3 | (uint)bVar4 << 0x10 | (uint)bVar5 << 8;
        if (DAT_000cd214 < 9) {
          DAT_000cd218 = (&PTR_s_unexpected_OK_response_000cbbc0)[DAT_000cd214];
        }
        else {
          DAT_000cd218 = "unknown error code";
        }
      }
    }
    else {
      DAT_000cd214 = 0xffffffff;
      DAT_000cd218 = "expected FXP_STATUS packet";
    }
    if (iVar7 != 0) {
      FUN_0001dd30(iVar7);
    }
  }
  puVar8 = (undefined4 *)0x0;
  FUN_0001dd30(param_1);
LAB_0002f993:
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return puVar8;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0008d800();
}

