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

int fxp_close_recv(sftp_packet *pktin,sftp_request *req)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  uint uVar5;
  char *ptr;
  
  safefree(req);
  if (pktin->type == 0x65) {
    uVar5 = pktin->savedpos;
    ptr = pktin->data;
    if (pktin->length - uVar5 < 4) {
      fxp_errtype = -1;
      fxp_error_message = "malformed FXP_STATUS packet";
    }
    else {
      bVar1 = ptr[uVar5];
      bVar2 = ptr[uVar5 + 3];
      bVar3 = ptr[uVar5 + 1];
      bVar4 = ptr[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";
    ptr = pktin->data;
  }
  if (ptr != (char *)0x0) {
    safefree(ptr);
  }
  safefree(pktin);
  return (uint)(fxp_errtype == 0);
}



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

bool FUN_00031360(int *param_1,undefined4 param_2)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  int iVar5;
  int iVar6;
  
  FUN_0001dd30(param_2);
  if (param_1[4] == 0x65) {
    iVar5 = param_1[3];
    iVar6 = *param_1;
    if ((uint)(param_1[1] - iVar5) < 4) {
      DAT_000d03ec = 0xffffffff;
      DAT_000d03f0 = "malformed FXP_STATUS packet";
    }
    else {
      bVar1 = *(byte *)(iVar6 + iVar5);
      bVar2 = *(byte *)(iVar6 + 3 + iVar5);
      bVar3 = *(byte *)(iVar6 + 1 + iVar5);
      bVar4 = *(byte *)(iVar6 + 2 + iVar5);
      param_1[3] = iVar5 + 4;
      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;
      if (DAT_000d03ec < 9) {
        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];
      }
      else {
        DAT_000d03f0 = "unknown error code";
      }
    }
  }
  else {
    DAT_000d03ec = 0xffffffff;
    DAT_000d03f0 = "expected FXP_STATUS packet";
    iVar6 = *param_1;
  }
  if (iVar6 != 0) {
    FUN_0001dd30(iVar6);
  }
  FUN_0001dd30(param_1);
  return DAT_000d03ec == 0;
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV ESI,dword ptr [ESP + 0x10]
CALL 0x000149a0
ADD EBX,0x9ea24
SUB ESP,0xc
PUSH dword ptr [ESP + 0x20]
CALL 0x0001dd30
ADD ESP,0x10
CMP dword ptr [ESI + 0x10],0x65
JZ 0x000313d0
MOV dword ptr [EBX + 0x65c],0xffffffff
LEA EAX,[EBX + 0xfffc436b]
MOV dword ptr [EBX + 0x660],EAX
MOV EAX,dword ptr [ESI]
TEST EAX,EAX
JZ 0x000313af
SUB ESP,0xc
PUSH EAX
CALL 0x0001dd30
ADD ESP,0x10
SUB ESP,0xc
PUSH ESI
CALL 0x0001dd30
MOV EDX,dword ptr [EBX + 0x65c]
ADD ESP,0x10
XOR EAX,EAX
POP EBX
POP ESI
TEST EDX,EDX
POP EDI
SETZ AL
RET
MOV ECX,dword ptr [ESI + 0xc]
MOV EDX,dword ptr [ESI + 0x4]
MOV EAX,dword ptr [ESI]
SUB EDX,ECX
CMP EDX,0x3
JBE 0x00031428
MOVZX EDX,byte ptr [EAX + ECX*0x1]
MOVZX EDI,byte ptr [EAX + ECX*0x1 + 0x3]
SHL EDX,0x18
OR EDX,EDI
MOVZX EDI,byte ptr [EAX + ECX*0x1 + 0x1]
SHL EDI,0x10
OR EDX,EDI
MOVZX EDI,byte ptr [EAX + ECX*0x1 + 0x2]
ADD ECX,0x4
MOV dword ptr [ESI + 0xc],ECX
SHL EDI,0x8
OR EDX,EDI
MOV dword ptr [EBX + 0x65c],EDX
CMP EDX,0x8
JBE 0x00031448
LEA EDX,[EBX + 0xfffc43a2]
MOV dword ptr [EBX + 0x660],EDX
JMP 0x0003139f
MOV dword ptr [EBX + 0x65c],0xffffffff
LEA EDX,[EBX + 0xfffc4386]
MOV dword ptr [EBX + 0x660],EDX
JMP 0x0003139f
MOV EDX,dword ptr [EBX + EDX*0x4 + 0xffffee50]
MOV dword ptr [EBX + 0x660],EDX
JMP 0x0003139f
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nbool FUN_00031360(int *param_1,undefined4 param_2)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\n}\n\n" comment (function_definition "bool FUN_00031360(int *param_1,undefined4 param_2)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\n}" primitive_type (function_declarator "FUN_00031360(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  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\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 "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "FUN_0001dd30(param_2);" (call_expression "FUN_0001dd30(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (if_statement "if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\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    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }" { (expression_statement "iVar5 = param_1[3];" (assignment_expression "iVar5 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "iVar6 = *param_1;" (assignment_expression "iVar6 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" if (parenthesized_expression "((uint)(param_1[1] - iVar5) < 4)" ( (binary_expression "(uint)(param_1[1] - iVar5) < 4" (call_expression "(uint)(param_1[1] - iVar5)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - iVar5)" ( (binary_expression "param_1[1] - iVar5" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier) ))) < number_literal) )) (compound_statement "{\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }" { (expression_statement "DAT_000d03ec = 0xffffffff;" (assignment_expression "DAT_000d03ec = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000d03f0 = "malformed FXP_STATUS packet";" (assignment_expression "DAT_000d03f0 = "malformed FXP_STATUS packet"" identifier = (string_literal ""malformed FXP_STATUS packet"" " string_content ")) ;) }) (else_clause "else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" else (compound_statement "{\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" { (expression_statement "bVar1 = *(byte *)(iVar6 + iVar5);" (assignment_expression "bVar1 = *(byte *)(iVar6 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + iVar5)" * (cast_expression "(byte *)(iVar6 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + iVar5)" ( (binary_expression "iVar6 + iVar5" identifier + identifier) ))))) ;) (expression_statement "bVar2 = *(byte *)(iVar6 + 3 + iVar5);" (assignment_expression "bVar2 = *(byte *)(iVar6 + 3 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + 3 + iVar5)" * (cast_expression "(byte *)(iVar6 + 3 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 3 + iVar5)" ( (binary_expression "iVar6 + 3 + iVar5" (binary_expression "iVar6 + 3" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar3 = *(byte *)(iVar6 + 1 + iVar5);" (assignment_expression "bVar3 = *(byte *)(iVar6 + 1 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + 1 + iVar5)" * (cast_expression "(byte *)(iVar6 + 1 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 1 + iVar5)" ( (binary_expression "iVar6 + 1 + iVar5" (binary_expression "iVar6 + 1" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar4 = *(byte *)(iVar6 + 2 + iVar5);" (assignment_expression "bVar4 = *(byte *)(iVar6 + 2 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + 2 + iVar5)" * (cast_expression "(byte *)(iVar6 + 2 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 2 + iVar5)" ( (binary_expression "iVar6 + 2 + iVar5" (binary_expression "iVar6 + 2" identifier + number_literal) + identifier) ))))) ;) (expression_statement "param_1[3] = iVar5 + 4;" (assignment_expression "param_1[3] = iVar5 + 4" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (binary_expression "iVar5 + 4" identifier + number_literal)) ;) (expression_statement "DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;" (assignment_expression "DAT_000d03ec = (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 (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }" if (parenthesized_expression "(DAT_000d03ec < 9)" ( (binary_expression "DAT_000d03ec < 9" identifier < number_literal) )) (compound_statement "{\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }" { (expression_statement "DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];" (assignment_expression "DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec]" identifier = (subscript_expression "(&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec]" (parenthesized_expression "(&PTR_s_unexpected_OK_response_000cebe0)" ( (pointer_expression "&PTR_s_unexpected_OK_response_000cebe0" & identifier) )) [ identifier ])) ;) }) (else_clause "else {\n        DAT_000d03f0 = "unknown error code";\n      }" else (compound_statement "{\n        DAT_000d03f0 = "unknown error code";\n      }" { (expression_statement "DAT_000d03f0 = "unknown error code";" (assignment_expression "DAT_000d03f0 = "unknown error code"" identifier = (string_literal ""unknown error code"" " string_content ")) ;) }))) }))) }) (else_clause "else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }" else (compound_statement "{\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }" { (expression_statement "DAT_000d03ec = 0xffffffff;" (assignment_expression "DAT_000d03ec = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000d03f0 = "expected FXP_STATUS packet";" (assignment_expression "DAT_000d03f0 = "expected FXP_STATUS packet"" identifier = (string_literal ""expected FXP_STATUS packet"" " string_content ")) ;) (expression_statement "iVar6 = *param_1;" (assignment_expression "iVar6 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) (if_statement "if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }" if (parenthesized_expression "(iVar6 != 0)" ( (binary_expression "iVar6 != 0" identifier != number_literal) )) (compound_statement "{\n    FUN_0001dd30(iVar6);\n  }" { (expression_statement "FUN_0001dd30(iVar6);" (call_expression "FUN_0001dd30(iVar6)" identifier (argument_list "(iVar6)" ( identifier ))) ;) })) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return DAT_000d03ec == 0;" return (binary_expression "DAT_000d03ec == 0" identifier == number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint fxp_close_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  char *ptr;\n  \n  safefree(req);\n  if (pktin->type == 0x65) {\n    uVar5 = pktin->savedpos;\n    ptr = pktin->data;\n    if (pktin->length - uVar5 < 4) {\n      fxp_errtype = -1;\n      fxp_error_message = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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    ptr = pktin->data;\n  }\n  if (ptr != (char *)0x0) {\n    safefree(ptr);\n  }\n  safefree(pktin);\n  return (uint)(fxp_errtype == 0);\n}\n\n" comment comment (function_definition "int fxp_close_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  char *ptr;\n  \n  safefree(req);\n  if (pktin->type == 0x65) {\n    uVar5 = pktin->savedpos;\n    ptr = pktin->data;\n    if (pktin->length - uVar5 < 4) {\n      fxp_errtype = -1;\n      fxp_error_message = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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    ptr = pktin->data;\n  }\n  if (ptr != (char *)0x0) {\n    safefree(ptr);\n  }\n  safefree(pktin);\n  return (uint)(fxp_errtype == 0);\n}" primitive_type (function_declarator "fxp_close_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  char *ptr;\n  \n  safefree(req);\n  if (pktin->type == 0x65) {\n    uVar5 = pktin->savedpos;\n    ptr = pktin->data;\n    if (pktin->length - uVar5 < 4) {\n      fxp_errtype = -1;\n      fxp_error_message = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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    ptr = pktin->data;\n  }\n  if (ptr != (char *)0x0) {\n    safefree(ptr);\n  }\n  safefree(pktin);\n  return (uint)(fxp_errtype == 0);\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 "char *ptr;" primitive_type (pointer_declarator "*ptr" * identifier) ;) (expression_statement "safefree(req);" (call_expression "safefree(req)" identifier (argument_list "(req)" ( identifier ))) ;) (if_statement "if (pktin->type == 0x65) {\n    uVar5 = pktin->savedpos;\n    ptr = pktin->data;\n    if (pktin->length - uVar5 < 4) {\n      fxp_errtype = -1;\n      fxp_error_message = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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    ptr = pktin->data;\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    ptr = pktin->data;\n    if (pktin->length - uVar5 < 4) {\n      fxp_errtype = -1;\n      fxp_error_message = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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)) ;) (expression_statement "ptr = pktin->data;" (assignment_expression "ptr = pktin->data" identifier = (field_expression "pktin->data" 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 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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 = ptr[uVar5];\n      bVar2 = ptr[uVar5 + 3];\n      bVar3 = ptr[uVar5 + 1];\n      bVar4 = ptr[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 = ptr[uVar5];" (assignment_expression "bVar1 = ptr[uVar5]" identifier = (subscript_expression "ptr[uVar5]" identifier [ identifier ])) ;) (expression_statement "bVar2 = ptr[uVar5 + 3];" (assignment_expression "bVar2 = ptr[uVar5 + 3]" identifier = (subscript_expression "ptr[uVar5 + 3]" identifier [ (binary_expression "uVar5 + 3" identifier + number_literal) ])) ;) (expression_statement "bVar3 = ptr[uVar5 + 1];" (assignment_expression "bVar3 = ptr[uVar5 + 1]" identifier = (subscript_expression "ptr[uVar5 + 1]" identifier [ (binary_expression "uVar5 + 1" identifier + number_literal) ])) ;) (expression_statement "bVar4 = ptr[uVar5 + 2];" (assignment_expression "bVar4 = ptr[uVar5 + 2]" identifier = (subscript_expression "ptr[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    ptr = pktin->data;\n  }" else (compound_statement "{\n    fxp_errtype = -1;\n    fxp_error_message = "expected FXP_STATUS packet";\n    ptr = pktin->data;\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 ")) ;) (expression_statement "ptr = pktin->data;" (assignment_expression "ptr = pktin->data" identifier = (field_expression "pktin->data" identifier -> field_identifier)) ;) }))) (if_statement "if (ptr != (char *)0x0) {\n    safefree(ptr);\n  }" if (parenthesized_expression "(ptr != (char *)0x0)" ( (binary_expression "ptr != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    safefree(ptr);\n  }" { (expression_statement "safefree(ptr);" (call_expression "safefree(ptr)" identifier (argument_list "(ptr)" ( identifier ))) ;) })) (expression_statement "safefree(pktin);" (call_expression "safefree(pktin)" identifier (argument_list "(pktin)" ( identifier ))) ;) (return_statement "return (uint)(fxp_errtype == 0);" return (call_expression "(uint)(fxp_errtype == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(fxp_errtype == 0)" ( (binary_expression "fxp_errtype == 0" identifier == number_literal) ))) ;) })))
(translation_unit "bool FUN_00031360(int *param_1,undefined4 param_2)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\n}\n\n" (function_definition "bool FUN_00031360(int *param_1,undefined4 param_2)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\n}" primitive_type (function_declarator "FUN_00031360(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  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\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 "int iVar5;" primitive_type identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (expression_statement "FUN_0001dd30(param_2);" (call_expression "FUN_0001dd30(param_2)" identifier (argument_list "(param_2)" ( identifier ))) ;) (if_statement "if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\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    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }" { (expression_statement "iVar5 = param_1[3];" (assignment_expression "iVar5 = param_1[3]" identifier = (subscript_expression "param_1[3]" identifier [ number_literal ])) ;) (expression_statement "iVar6 = *param_1;" (assignment_expression "iVar6 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (if_statement "if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" if (parenthesized_expression "((uint)(param_1[1] - iVar5) < 4)" ( (binary_expression "(uint)(param_1[1] - iVar5) < 4" (call_expression "(uint)(param_1[1] - iVar5)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(param_1[1] - iVar5)" ( (binary_expression "param_1[1] - iVar5" (subscript_expression "param_1[1]" identifier [ number_literal ]) - identifier) ))) < number_literal) )) (compound_statement "{\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }" { (expression_statement "DAT_000d03ec = 0xffffffff;" (assignment_expression "DAT_000d03ec = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000d03f0 = "malformed FXP_STATUS packet";" (assignment_expression "DAT_000d03f0 = "malformed FXP_STATUS packet"" identifier = (string_literal ""malformed FXP_STATUS packet"" " string_content ")) ;) }) (else_clause "else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" else (compound_statement "{\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" { (expression_statement "bVar1 = *(byte *)(iVar6 + iVar5);" (assignment_expression "bVar1 = *(byte *)(iVar6 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + iVar5)" * (cast_expression "(byte *)(iVar6 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + iVar5)" ( (binary_expression "iVar6 + iVar5" identifier + identifier) ))))) ;) (expression_statement "bVar2 = *(byte *)(iVar6 + 3 + iVar5);" (assignment_expression "bVar2 = *(byte *)(iVar6 + 3 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + 3 + iVar5)" * (cast_expression "(byte *)(iVar6 + 3 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 3 + iVar5)" ( (binary_expression "iVar6 + 3 + iVar5" (binary_expression "iVar6 + 3" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar3 = *(byte *)(iVar6 + 1 + iVar5);" (assignment_expression "bVar3 = *(byte *)(iVar6 + 1 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + 1 + iVar5)" * (cast_expression "(byte *)(iVar6 + 1 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 1 + iVar5)" ( (binary_expression "iVar6 + 1 + iVar5" (binary_expression "iVar6 + 1" identifier + number_literal) + identifier) ))))) ;) (expression_statement "bVar4 = *(byte *)(iVar6 + 2 + iVar5);" (assignment_expression "bVar4 = *(byte *)(iVar6 + 2 + iVar5)" identifier = (pointer_expression "*(byte *)(iVar6 + 2 + iVar5)" * (cast_expression "(byte *)(iVar6 + 2 + iVar5)" ( (type_descriptor "byte *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(iVar6 + 2 + iVar5)" ( (binary_expression "iVar6 + 2 + iVar5" (binary_expression "iVar6 + 2" identifier + number_literal) + identifier) ))))) ;) (expression_statement "param_1[3] = iVar5 + 4;" (assignment_expression "param_1[3] = iVar5 + 4" (subscript_expression "param_1[3]" identifier [ number_literal ]) = (binary_expression "iVar5 + 4" identifier + number_literal)) ;) (expression_statement "DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;" (assignment_expression "DAT_000d03ec = (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 (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }" if (parenthesized_expression "(DAT_000d03ec < 9)" ( (binary_expression "DAT_000d03ec < 9" identifier < number_literal) )) (compound_statement "{\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }" { (expression_statement "DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];" (assignment_expression "DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec]" identifier = (subscript_expression "(&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec]" (parenthesized_expression "(&PTR_s_unexpected_OK_response_000cebe0)" ( (pointer_expression "&PTR_s_unexpected_OK_response_000cebe0" & identifier) )) [ identifier ])) ;) }) (else_clause "else {\n        DAT_000d03f0 = "unknown error code";\n      }" else (compound_statement "{\n        DAT_000d03f0 = "unknown error code";\n      }" { (expression_statement "DAT_000d03f0 = "unknown error code";" (assignment_expression "DAT_000d03f0 = "unknown error code"" identifier = (string_literal ""unknown error code"" " string_content ")) ;) }))) }))) }) (else_clause "else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }" else (compound_statement "{\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }" { (expression_statement "DAT_000d03ec = 0xffffffff;" (assignment_expression "DAT_000d03ec = 0xffffffff" identifier = number_literal) ;) (expression_statement "DAT_000d03f0 = "expected FXP_STATUS packet";" (assignment_expression "DAT_000d03f0 = "expected FXP_STATUS packet"" identifier = (string_literal ""expected FXP_STATUS packet"" " string_content ")) ;) (expression_statement "iVar6 = *param_1;" (assignment_expression "iVar6 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) }))) (if_statement "if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }" if (parenthesized_expression "(iVar6 != 0)" ( (binary_expression "iVar6 != 0" identifier != number_literal) )) (compound_statement "{\n    FUN_0001dd30(iVar6);\n  }" { (expression_statement "FUN_0001dd30(iVar6);" (call_expression "FUN_0001dd30(iVar6)" identifier (argument_list "(iVar6)" ( identifier ))) ;) })) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" identifier (argument_list "(param_1)" ( identifier ))) ;) (return_statement "return DAT_000d03ec == 0;" return (binary_expression "DAT_000d03ec == 0" identifier == number_literal) ;) })))
(translation_unit (function_definition TYPE (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 ;) (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 = (subscript_expression IDENT [ LIT ])) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (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 ")) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) (return_statement return (binary_expression IDENT == LIT) ;) })))
(function_definition "bool FUN_00031360(int *param_1,undefined4 param_2)\n\n{\n  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\n}" (primitive_type "bool") (function_declarator "FUN_00031360(int *param_1,undefined4 param_2)" (identifier "FUN_00031360") (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  byte bVar1;\n  byte bVar2;\n  byte bVar3;\n  byte bVar4;\n  int iVar5;\n  int iVar6;\n  \n  FUN_0001dd30(param_2);\n  if (param_1[4] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }\n  if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }\n  FUN_0001dd30(param_1);\n  return DAT_000d03ec == 0;\n}" ({ "{") (declaration "byte bVar1;" (type_identifier "byte") (identifier "bVar1") (; ";")) (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 "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "int iVar6;" (primitive_type "int") (identifier "iVar6") (; ";")) (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] == 0x65) {\n    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }\n  else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\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    iVar5 = param_1[3];\n    iVar6 = *param_1;\n    if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }\n  }" ({ "{") (expression_statement "iVar5 = param_1[3];" (assignment_expression "iVar5 = param_1[3]" (identifier "iVar5") (= "=") (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]"))) (; ";")) (expression_statement "iVar6 = *param_1;" (assignment_expression "iVar6 = *param_1" (identifier "iVar6") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (if_statement "if ((uint)(param_1[1] - iVar5) < 4) {\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }\n    else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" (if "if") (parenthesized_expression "((uint)(param_1[1] - iVar5) < 4)" (( "(") (binary_expression "(uint)(param_1[1] - iVar5) < 4" (call_expression "(uint)(param_1[1] - iVar5)" (parenthesized_expression "(uint)" (( "(") (identifier "uint") () ")")) (argument_list "(param_1[1] - iVar5)" (( "(") (binary_expression "param_1[1] - iVar5" (subscript_expression "param_1[1]" (identifier "param_1") ([ "[") (number_literal "1") (] "]")) (- "-") (identifier "iVar5")) () ")"))) (< "<") (number_literal "4")) () ")")) (compound_statement "{\n      DAT_000d03ec = 0xffffffff;\n      DAT_000d03f0 = "malformed FXP_STATUS packet";\n    }" ({ "{") (expression_statement "DAT_000d03ec = 0xffffffff;" (assignment_expression "DAT_000d03ec = 0xffffffff" (identifier "DAT_000d03ec") (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "DAT_000d03f0 = "malformed FXP_STATUS packet";" (assignment_expression "DAT_000d03f0 = "malformed FXP_STATUS packet"" (identifier "DAT_000d03f0") (= "=") (string_literal ""malformed FXP_STATUS packet"" (" """) (string_content "malformed FXP_STATUS packet") (" """))) (; ";")) (} "}")) (else_clause "else {\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" (else "else") (compound_statement "{\n      bVar1 = *(byte *)(iVar6 + iVar5);\n      bVar2 = *(byte *)(iVar6 + 3 + iVar5);\n      bVar3 = *(byte *)(iVar6 + 1 + iVar5);\n      bVar4 = *(byte *)(iVar6 + 2 + iVar5);\n      param_1[3] = iVar5 + 4;\n      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;\n      if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }\n    }" ({ "{") (expression_statement "bVar1 = *(byte *)(iVar6 + iVar5);" (assignment_expression "bVar1 = *(byte *)(iVar6 + iVar5)" (identifier "bVar1") (= "=") (pointer_expression "*(byte *)(iVar6 + iVar5)" (* "*") (cast_expression "(byte *)(iVar6 + iVar5)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + iVar5)" (( "(") (binary_expression "iVar6 + iVar5" (identifier "iVar6") (+ "+") (identifier "iVar5")) () ")"))))) (; ";")) (expression_statement "bVar2 = *(byte *)(iVar6 + 3 + iVar5);" (assignment_expression "bVar2 = *(byte *)(iVar6 + 3 + iVar5)" (identifier "bVar2") (= "=") (pointer_expression "*(byte *)(iVar6 + 3 + iVar5)" (* "*") (cast_expression "(byte *)(iVar6 + 3 + iVar5)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + 3 + iVar5)" (( "(") (binary_expression "iVar6 + 3 + iVar5" (binary_expression "iVar6 + 3" (identifier "iVar6") (+ "+") (number_literal "3")) (+ "+") (identifier "iVar5")) () ")"))))) (; ";")) (expression_statement "bVar3 = *(byte *)(iVar6 + 1 + iVar5);" (assignment_expression "bVar3 = *(byte *)(iVar6 + 1 + iVar5)" (identifier "bVar3") (= "=") (pointer_expression "*(byte *)(iVar6 + 1 + iVar5)" (* "*") (cast_expression "(byte *)(iVar6 + 1 + iVar5)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + 1 + iVar5)" (( "(") (binary_expression "iVar6 + 1 + iVar5" (binary_expression "iVar6 + 1" (identifier "iVar6") (+ "+") (number_literal "1")) (+ "+") (identifier "iVar5")) () ")"))))) (; ";")) (expression_statement "bVar4 = *(byte *)(iVar6 + 2 + iVar5);" (assignment_expression "bVar4 = *(byte *)(iVar6 + 2 + iVar5)" (identifier "bVar4") (= "=") (pointer_expression "*(byte *)(iVar6 + 2 + iVar5)" (* "*") (cast_expression "(byte *)(iVar6 + 2 + iVar5)" (( "(") (type_descriptor "byte *" (type_identifier "byte") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(iVar6 + 2 + iVar5)" (( "(") (binary_expression "iVar6 + 2 + iVar5" (binary_expression "iVar6 + 2" (identifier "iVar6") (+ "+") (number_literal "2")) (+ "+") (identifier "iVar5")) () ")"))))) (; ";")) (expression_statement "param_1[3] = iVar5 + 4;" (assignment_expression "param_1[3] = iVar5 + 4" (subscript_expression "param_1[3]" (identifier "param_1") ([ "[") (number_literal "3") (] "]")) (= "=") (binary_expression "iVar5 + 4" (identifier "iVar5") (+ "+") (number_literal "4"))) (; ";")) (expression_statement "DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;" (assignment_expression "DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8" (identifier "DAT_000d03ec") (= "=") (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 "uint")) () ")") (identifier "bVar1")) (<< "<<") (number_literal "0x18")) (| "|") (cast_expression "(uint)bVar2" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar2"))) (| "|") (binary_expression "(uint)bVar3 << 0x10" (cast_expression "(uint)bVar3" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar3")) (<< "<<") (number_literal "0x10"))) (| "|") (binary_expression "(uint)bVar4 << 8" (cast_expression "(uint)bVar4" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "bVar4")) (<< "<<") (number_literal "8")))) (; ";")) (if_statement "if (DAT_000d03ec < 9) {\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }\n      else {\n        DAT_000d03f0 = "unknown error code";\n      }" (if "if") (parenthesized_expression "(DAT_000d03ec < 9)" (( "(") (binary_expression "DAT_000d03ec < 9" (identifier "DAT_000d03ec") (< "<") (number_literal "9")) () ")")) (compound_statement "{\n        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];\n      }" ({ "{") (expression_statement "DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];" (assignment_expression "DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec]" (identifier "DAT_000d03f0") (= "=") (subscript_expression "(&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec]" (parenthesized_expression "(&PTR_s_unexpected_OK_response_000cebe0)" (( "(") (pointer_expression "&PTR_s_unexpected_OK_response_000cebe0" (& "&") (identifier "PTR_s_unexpected_OK_response_000cebe0")) () ")")) ([ "[") (identifier "DAT_000d03ec") (] "]"))) (; ";")) (} "}")) (else_clause "else {\n        DAT_000d03f0 = "unknown error code";\n      }" (else "else") (compound_statement "{\n        DAT_000d03f0 = "unknown error code";\n      }" ({ "{") (expression_statement "DAT_000d03f0 = "unknown error code";" (assignment_expression "DAT_000d03f0 = "unknown error code"" (identifier "DAT_000d03f0") (= "=") (string_literal ""unknown error code"" (" """) (string_content "unknown error code") (" """))) (; ";")) (} "}")))) (} "}")))) (} "}")) (else_clause "else {\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }" (else "else") (compound_statement "{\n    DAT_000d03ec = 0xffffffff;\n    DAT_000d03f0 = "expected FXP_STATUS packet";\n    iVar6 = *param_1;\n  }" ({ "{") (expression_statement "DAT_000d03ec = 0xffffffff;" (assignment_expression "DAT_000d03ec = 0xffffffff" (identifier "DAT_000d03ec") (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "DAT_000d03f0 = "expected FXP_STATUS packet";" (assignment_expression "DAT_000d03f0 = "expected FXP_STATUS packet"" (identifier "DAT_000d03f0") (= "=") (string_literal ""expected FXP_STATUS packet"" (" """) (string_content "expected FXP_STATUS packet") (" """))) (; ";")) (expression_statement "iVar6 = *param_1;" (assignment_expression "iVar6 = *param_1" (identifier "iVar6") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (} "}")))) (if_statement "if (iVar6 != 0) {\n    FUN_0001dd30(iVar6);\n  }" (if "if") (parenthesized_expression "(iVar6 != 0)" (( "(") (binary_expression "iVar6 != 0" (identifier "iVar6") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    FUN_0001dd30(iVar6);\n  }" ({ "{") (expression_statement "FUN_0001dd30(iVar6);" (call_expression "FUN_0001dd30(iVar6)" (identifier "FUN_0001dd30") (argument_list "(iVar6)" (( "(") (identifier "iVar6") () ")"))) (; ";")) (} "}"))) (expression_statement "FUN_0001dd30(param_1);" (call_expression "FUN_0001dd30(param_1)" (identifier "FUN_0001dd30") (argument_list "(param_1)" (( "(") (identifier "param_1") () ")"))) (; ";")) (return_statement "return DAT_000d03ec == 0;" (return "return") (binary_expression "DAT_000d03ec == 0" (identifier "DAT_000d03ec") (== "==") (number_literal "0")) (; ";")) (} "}")))

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

int function_1(type_1 *pktin,type_2 *req)

{
  type_3 bVar1;
  type_3 bVar2;
  type_3 bVar3;
  type_3 bVar4;
  type_4 var_2;
  char *var_5;
  
  var_1(req);
  if (pktin->type == 0x65) {
    var_2 = pktin->savedpos;
    var_5 = pktin->data;
    if (pktin->length - var_2 < 4) {
      var_4 = -1;
      fxp_error_message = "malformed FXP_STATUS packet";
    }
    else {
      bVar1 = var_5[var_2];
      bVar2 = var_5[var_2 + 3];
      bVar3 = var_5[var_2 + 1];
      bVar4 = var_5[var_2 + 2];
      pktin->savedpos = var_2 + 4;
      var_4 = (type_4)bVar1 << 0x18 | (type_4)bVar2 | (type_4)bVar3 << 0x10 | (type_4)bVar4 << 8;
      if ((type_4)var_4 < 9) {
        fxp_error_message = *(char **)(var_3 + var_4 * 4);
      }
      else {
        fxp_error_message = "unknown error code";
      }
    }
  }
  else {
    var_4 = -1;
    fxp_error_message = "expected FXP_STATUS packet";
    var_5 = pktin->data;
  }
  if (var_5 != (char *)0x0) {
    var_1(var_5);
  }
  var_1(pktin);
  return (type_4)(var_4 == 0);
}


(translation_unit (function_definition type: (primitive_type) 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: (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)) (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: (subscript_expression argument: (identifier) index: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (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)))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier))))))) (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 (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (binary_expression left: (identifier) right: (number_literal))))))

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

bool MASKED(int *param_1,undefined4 param_2)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  int iVar5;
  int iVar6;
  
  FUN_0001dd30(param_2);
  if (param_1[4] == 0x65) {
    iVar5 = param_1[3];
    iVar6 = *param_1;
    if ((uint)(param_1[1] - iVar5) < 4) {
      DAT_000d03ec = 0xffffffff;
      DAT_000d03f0 = "malformed FXP_STATUS packet";
    }
    else {
      bVar1 = *(byte *)(iVar6 + iVar5);
      bVar2 = *(byte *)(iVar6 + 3 + iVar5);
      bVar3 = *(byte *)(iVar6 + 1 + iVar5);
      bVar4 = *(byte *)(iVar6 + 2 + iVar5);
      param_1[3] = iVar5 + 4;
      DAT_000d03ec = (uint)bVar1 << 0x18 | (uint)bVar2 | (uint)bVar3 << 0x10 | (uint)bVar4 << 8;
      if (DAT_000d03ec < 9) {
        DAT_000d03f0 = (&PTR_s_unexpected_OK_response_000cebe0)[DAT_000d03ec];
      }
      else {
        DAT_000d03f0 = "unknown error code";
      }
    }
  }
  else {
    DAT_000d03ec = 0xffffffff;
    DAT_000d03f0 = "expected FXP_STATUS packet";
    iVar6 = *param_1;
  }
  if (iVar6 != 0) {
    FUN_0001dd30(iVar6);
  }
  FUN_0001dd30(param_1);
  return DAT_000d03ec == 0;
}

