
uint xcrc32(uchar *buf,int len,uint init)

{
  byte *pbVar1;
  byte bVar2;
  ulong uVar3;
  uint crc;
  uint uVar4;
  
  if (len != 0) {
    pbVar1 = buf + (ulong)(len - 1) + 1;
    uVar3 = (ulong)init;
    do {
      bVar2 = *buf;
      buf = buf + 1;
      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];
      uVar3 = (ulong)uVar4;
    } while (buf != pbVar1);
    return uVar4;
  }
  return init;
}



ulong FUN_004995c0(byte *param_1,int param_2,ulong param_3)

{
  byte *pbVar1;
  byte bVar2;
  
  if (param_2 != 0) {
    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;
    param_3 = param_3 & 0xffffffff;
    do {
      bVar2 = *param_1;
      param_1 = param_1 + 1;
      param_3 = (ulong)((int)param_3 << 8 ^
                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)
                       );
    } while (param_1 != pbVar1);
    return param_3;
  }
  return param_3 & 0xffffffff;
}


TEST ESI,ESI
JZ 0x004995f8
LEA EAX,[RSI + -0x1]
LEA RCX,[0x589b00]
LEA RSI,[RDI + RAX*0x1 + 0x1]
MOV EAX,EDX
NOP dword ptr [RAX]
MOV EDX,EAX
SHR EAX,0x18
XOR AL,byte ptr [RDI]
ADD RDI,0x1
MOVZX EAX,AL
SHL EDX,0x8
XOR EDX,dword ptr [RCX + RAX*0x4]
MOV EAX,EDX
CMP RDI,RSI
JNZ 0x004995d8
RET
MOV EAX,EDX
RET
(translation_unit "ulong FUN_004995c0(byte *param_1,int param_2,ulong param_3)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}\n\n" (function_definition "ulong FUN_004995c0(byte *param_1,int param_2,ulong param_3)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}" type_identifier (function_declarator "FUN_004995c0(byte *param_1,int param_2,ulong param_3)" identifier (parameter_list "(byte *param_1,int param_2,ulong param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}" { (declaration "byte *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "byte bVar2;" type_identifier identifier ;) (if_statement "if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }" { (expression_statement "pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;" (assignment_expression "pbVar1 = param_1 + (ulong)(param_2 - 1) + 1" identifier = (binary_expression "param_1 + (ulong)(param_2 - 1) + 1" (binary_expression "param_1 + (ulong)(param_2 - 1)" identifier + (call_expression "(ulong)(param_2 - 1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(param_2 - 1)" ( (binary_expression "param_2 - 1" identifier - number_literal) )))) + number_literal)) ;) (expression_statement "param_3 = param_3 & 0xffffffff;" (assignment_expression "param_3 = param_3 & 0xffffffff" identifier = (binary_expression "param_3 & 0xffffffff" identifier & number_literal)) ;) (do_statement "do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);" do (compound_statement "{\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    }" { (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );" (assignment_expression "param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" identifier = (call_expression "(ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" ( (binary_expression "(int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" (binary_expression "(int)param_3 << 8" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) << number_literal) ^ (pointer_expression "*(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" * (cast_expression "(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" ( (binary_expression "&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4" (pointer_expression "&DAT_00589b00" & identifier) + (binary_expression "(ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4" (call_expression "(ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2)" (call_expression "(ulong)(byte)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(byte)" ( identifier ))) (argument_list "((byte)(param_3 >> 0x18) ^ bVar2)" ( (binary_expression "(byte)(param_3 >> 0x18) ^ bVar2" (call_expression "(byte)(param_3 >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(param_3 >> 0x18)" ( (binary_expression "param_3 >> 0x18" identifier >> number_literal) ))) ^ identifier) ))) * number_literal)) ))))) )))) ;) }) while (parenthesized_expression "(param_1 != pbVar1)" ( (binary_expression "param_1 != pbVar1" identifier != identifier) )) ;) (return_statement "return param_3;" return identifier ;) })) (return_statement "return param_3 & 0xffffffff;" return (binary_expression "param_3 & 0xffffffff" identifier & number_literal) ;) })))
(translation_unit "uint xcrc32(uchar *buf,int len,uint init)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  ulong uVar3;\n  uint crc;\n  uint uVar4;\n  \n  if (len != 0) {\n    pbVar1 = buf + (ulong)(len - 1) + 1;\n    uVar3 = (ulong)init;\n    do {\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    } while (buf != pbVar1);\n    return uVar4;\n  }\n  return init;\n}\n\n" (function_definition "uint xcrc32(uchar *buf,int len,uint init)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  ulong uVar3;\n  uint crc;\n  uint uVar4;\n  \n  if (len != 0) {\n    pbVar1 = buf + (ulong)(len - 1) + 1;\n    uVar3 = (ulong)init;\n    do {\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    } while (buf != pbVar1);\n    return uVar4;\n  }\n  return init;\n}" type_identifier (function_declarator "xcrc32(uchar *buf,int len,uint init)" identifier (parameter_list "(uchar *buf,int len,uint init)" ( (parameter_declaration "uchar *buf" type_identifier (pointer_declarator "*buf" * identifier)) , (parameter_declaration "int len" primitive_type identifier) , (parameter_declaration "uint init" type_identifier identifier) ))) (compound_statement "{\n  byte *pbVar1;\n  byte bVar2;\n  ulong uVar3;\n  uint crc;\n  uint uVar4;\n  \n  if (len != 0) {\n    pbVar1 = buf + (ulong)(len - 1) + 1;\n    uVar3 = (ulong)init;\n    do {\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    } while (buf != pbVar1);\n    return uVar4;\n  }\n  return init;\n}" { (declaration "byte *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "byte bVar2;" type_identifier identifier ;) (declaration "ulong uVar3;" type_identifier identifier ;) (declaration "uint crc;" type_identifier identifier ;) (declaration "uint uVar4;" type_identifier identifier ;) (if_statement "if (len != 0) {\n    pbVar1 = buf + (ulong)(len - 1) + 1;\n    uVar3 = (ulong)init;\n    do {\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    } while (buf != pbVar1);\n    return uVar4;\n  }" if (parenthesized_expression "(len != 0)" ( (binary_expression "len != 0" identifier != number_literal) )) (compound_statement "{\n    pbVar1 = buf + (ulong)(len - 1) + 1;\n    uVar3 = (ulong)init;\n    do {\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    } while (buf != pbVar1);\n    return uVar4;\n  }" { (expression_statement "pbVar1 = buf + (ulong)(len - 1) + 1;" (assignment_expression "pbVar1 = buf + (ulong)(len - 1) + 1" identifier = (binary_expression "buf + (ulong)(len - 1) + 1" (binary_expression "buf + (ulong)(len - 1)" identifier + (call_expression "(ulong)(len - 1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(len - 1)" ( (binary_expression "len - 1" identifier - number_literal) )))) + number_literal)) ;) (expression_statement "uVar3 = (ulong)init;" (assignment_expression "uVar3 = (ulong)init" identifier = (cast_expression "(ulong)init" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) (do_statement "do {\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    } while (buf != pbVar1);" do (compound_statement "{\n      bVar2 = *buf;\n      buf = buf + 1;\n      uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];\n      uVar3 = (ulong)uVar4;\n    }" { (expression_statement "bVar2 = *buf;" (assignment_expression "bVar2 = *buf" identifier = (pointer_expression "*buf" * identifier)) ;) (expression_statement "buf = buf + 1;" (assignment_expression "buf = buf + 1" identifier = (binary_expression "buf + 1" identifier + number_literal)) ;) (expression_statement "uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)];" (assignment_expression "uVar4 = (int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)]" identifier = (binary_expression "(int)uVar3 << 8 ^ crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)]" (binary_expression "(int)uVar3 << 8" (cast_expression "(int)uVar3" ( (type_descriptor "int" primitive_type) ) identifier) << number_literal) ^ (subscript_expression "crc32_table[(byte)((byte)(uVar3 >> 0x18) ^ bVar2)]" identifier [ (call_expression "(byte)((byte)(uVar3 >> 0x18) ^ bVar2)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "((byte)(uVar3 >> 0x18) ^ bVar2)" ( (binary_expression "(byte)(uVar3 >> 0x18) ^ bVar2" (call_expression "(byte)(uVar3 >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(uVar3 >> 0x18)" ( (binary_expression "uVar3 >> 0x18" identifier >> number_literal) ))) ^ identifier) ))) ]))) ;) (expression_statement "uVar3 = (ulong)uVar4;" (assignment_expression "uVar3 = (ulong)uVar4" identifier = (cast_expression "(ulong)uVar4" ( (type_descriptor "ulong" type_identifier) ) identifier)) ;) }) while (parenthesized_expression "(buf != pbVar1)" ( (binary_expression "buf != pbVar1" identifier != identifier) )) ;) (return_statement "return uVar4;" return identifier ;) })) (return_statement "return init;" return identifier ;) })))
(translation_unit "ulong FUN_004995c0(byte *param_1,int param_2,ulong param_3)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}\n\n" (function_definition "ulong FUN_004995c0(byte *param_1,int param_2,ulong param_3)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}" type_identifier (function_declarator "FUN_004995c0(byte *param_1,int param_2,ulong param_3)" identifier (parameter_list "(byte *param_1,int param_2,ulong param_3)" ( (parameter_declaration "byte *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "int param_2" primitive_type identifier) , (parameter_declaration "ulong param_3" type_identifier identifier) ))) (compound_statement "{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}" { (declaration "byte *pbVar1;" type_identifier (pointer_declarator "*pbVar1" * identifier) ;) (declaration "byte bVar2;" type_identifier identifier ;) (if_statement "if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }" if (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) )) (compound_statement "{\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }" { (expression_statement "pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;" (assignment_expression "pbVar1 = param_1 + (ulong)(param_2 - 1) + 1" identifier = (binary_expression "param_1 + (ulong)(param_2 - 1) + 1" (binary_expression "param_1 + (ulong)(param_2 - 1)" identifier + (call_expression "(ulong)(param_2 - 1)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(param_2 - 1)" ( (binary_expression "param_2 - 1" identifier - number_literal) )))) + number_literal)) ;) (expression_statement "param_3 = param_3 & 0xffffffff;" (assignment_expression "param_3 = param_3 & 0xffffffff" identifier = (binary_expression "param_3 & 0xffffffff" identifier & number_literal)) ;) (do_statement "do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);" do (compound_statement "{\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    }" { (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" identifier = (pointer_expression "*param_1" * identifier)) ;) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" identifier = (binary_expression "param_1 + 1" identifier + number_literal)) ;) (expression_statement "param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );" (assignment_expression "param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" identifier = (call_expression "(ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" ( (binary_expression "(int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" (binary_expression "(int)param_3 << 8" (cast_expression "(int)param_3" ( (type_descriptor "int" primitive_type) ) identifier) << number_literal) ^ (pointer_expression "*(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" * (cast_expression "(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" ( (type_descriptor "uint *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" ( (binary_expression "&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4" (pointer_expression "&DAT_00589b00" & identifier) + (binary_expression "(ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4" (call_expression "(ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2)" (call_expression "(ulong)(byte)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "(byte)" ( identifier ))) (argument_list "((byte)(param_3 >> 0x18) ^ bVar2)" ( (binary_expression "(byte)(param_3 >> 0x18) ^ bVar2" (call_expression "(byte)(param_3 >> 0x18)" (parenthesized_expression "(byte)" ( identifier )) (argument_list "(param_3 >> 0x18)" ( (binary_expression "param_3 >> 0x18" identifier >> number_literal) ))) ^ identifier) ))) * number_literal)) ))))) )))) ;) }) while (parenthesized_expression "(param_1 != pbVar1)" ( (binary_expression "param_1 != pbVar1" identifier != identifier) )) ;) (return_statement "return param_3;" return identifier ;) })) (return_statement "return param_3 & 0xffffffff;" return (binary_expression "param_3 & 0xffffffff" identifier & number_literal) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT - LIT) )))) + LIT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT & LIT)) ;) (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) << LIT) ^ (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression (pointer_expression & IDENT) + (binary_expression (call_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( IDENT ))) (argument_list ( (binary_expression (call_expression (parenthesized_expression ( IDENT )) (argument_list ( (binary_expression IDENT >> LIT) ))) ^ IDENT) ))) * LIT)) ))))) )))) ;) }) while (parenthesized_expression ( (binary_expression IDENT != IDENT) )) ;) (return_statement return IDENT ;) })) (return_statement return (binary_expression IDENT & LIT) ;) })))
(function_definition "ulong FUN_004995c0(byte *param_1,int param_2,ulong param_3)\n\n{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}" (type_identifier "ulong") (function_declarator "FUN_004995c0(byte *param_1,int param_2,ulong param_3)" (identifier "FUN_004995c0") (parameter_list "(byte *param_1,int param_2,ulong param_3)" (( "(") (parameter_declaration "byte *param_1" (type_identifier "byte") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) (, ",") (parameter_declaration "ulong param_3" (type_identifier "ulong") (identifier "param_3")) () ")"))) (compound_statement "{\n  byte *pbVar1;\n  byte bVar2;\n  \n  if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }\n  return param_3 & 0xffffffff;\n}" ({ "{") (declaration "byte *pbVar1;" (type_identifier "byte") (pointer_declarator "*pbVar1" (* "*") (identifier "pbVar1")) (; ";")) (declaration "byte bVar2;" (type_identifier "byte") (identifier "bVar2") (; ";")) (if_statement "if (param_2 != 0) {\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }" (if "if") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;\n    param_3 = param_3 & 0xffffffff;\n    do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);\n    return param_3;\n  }" ({ "{") (expression_statement "pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;" (assignment_expression "pbVar1 = param_1 + (ulong)(param_2 - 1) + 1" (identifier "pbVar1") (= "=") (binary_expression "param_1 + (ulong)(param_2 - 1) + 1" (binary_expression "param_1 + (ulong)(param_2 - 1)" (identifier "param_1") (+ "+") (call_expression "(ulong)(param_2 - 1)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "(param_2 - 1)" (( "(") (binary_expression "param_2 - 1" (identifier "param_2") (- "-") (number_literal "1")) () ")")))) (+ "+") (number_literal "1"))) (; ";")) (expression_statement "param_3 = param_3 & 0xffffffff;" (assignment_expression "param_3 = param_3 & 0xffffffff" (identifier "param_3") (= "=") (binary_expression "param_3 & 0xffffffff" (identifier "param_3") (& "&") (number_literal "0xffffffff"))) (; ";")) (do_statement "do {\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    } while (param_1 != pbVar1);" (do "do") (compound_statement "{\n      bVar2 = *param_1;\n      param_1 = param_1 + 1;\n      param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );\n    }" ({ "{") (expression_statement "bVar2 = *param_1;" (assignment_expression "bVar2 = *param_1" (identifier "bVar2") (= "=") (pointer_expression "*param_1" (* "*") (identifier "param_1"))) (; ";")) (expression_statement "param_1 = param_1 + 1;" (assignment_expression "param_1 = param_1 + 1" (identifier "param_1") (= "=") (binary_expression "param_1 + 1" (identifier "param_1") (+ "+") (number_literal "1"))) (; ";")) (expression_statement "param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       );" (assignment_expression "param_3 = (ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" (identifier "param_3") (= "=") (call_expression "(ulong)((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "((int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)\n                       )" (( "(") (binary_expression "(int)param_3 << 8 ^\n                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" (binary_expression "(int)param_3 << 8" (cast_expression "(int)param_3" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "param_3")) (<< "<<") (number_literal "8")) (^ "^") (pointer_expression "*(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" (* "*") (cast_expression "(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" (( "(") (type_descriptor "uint *" (type_identifier "uint") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)" (( "(") (binary_expression "&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4" (pointer_expression "&DAT_00589b00" (& "&") (identifier "DAT_00589b00")) (+ "+") (binary_expression "(ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4" (call_expression "(ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2)" (call_expression "(ulong)(byte)" (parenthesized_expression "(ulong)" (( "(") (identifier "ulong") () ")")) (argument_list "(byte)" (( "(") (identifier "byte") () ")"))) (argument_list "((byte)(param_3 >> 0x18) ^ bVar2)" (( "(") (binary_expression "(byte)(param_3 >> 0x18) ^ bVar2" (call_expression "(byte)(param_3 >> 0x18)" (parenthesized_expression "(byte)" (( "(") (identifier "byte") () ")")) (argument_list "(param_3 >> 0x18)" (( "(") (binary_expression "param_3 >> 0x18" (identifier "param_3") (>> ">>") (number_literal "0x18")) () ")"))) (^ "^") (identifier "bVar2")) () ")"))) (* "*") (number_literal "4"))) () ")"))))) () ")")))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(param_1 != pbVar1)" (( "(") (binary_expression "param_1 != pbVar1" (identifier "param_1") (!= "!=") (identifier "pbVar1")) () ")")) (; ";")) (return_statement "return param_3;" (return "return") (identifier "param_3") (; ";")) (} "}"))) (return_statement "return param_3 & 0xffffffff;" (return "return") (binary_expression "param_3 & 0xffffffff" (identifier "param_3") (& "&") (number_literal "0xffffffff")) (; ";")) (} "}")))

type_1 function_1(type_2 *var_2,int var_1,type_1 init)

{
  type_3 *var_5;
  type_3 var_4;
  type_4 var_3;
  type_1 crc;
  type_1 uVar4;
  
  if (var_1 != 0) {
    var_5 = var_2 + (type_4)(var_1 - 1) + 1;
    var_3 = (type_4)init;
    do {
      var_4 = *var_2;
      var_2 = var_2 + 1;
      uVar4 = (int)var_3 << 8 ^ crc32_table[(type_3)((type_3)(var_3 >> 0x18) ^ var_4)];
      var_3 = (type_4)uVar4;
    } while (var_2 != var_5);
    return uVar4;
  }
  return init;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)))) body: (compound_statement (declaration type: (type_identifier) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (type_identifier) declarator: (identifier)) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (do_statement body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (binary_expression left: (call_expression function: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (identifier))) arguments: (argument_list (binary_expression left: (call_expression function: (parenthesized_expression (identifier)) arguments: (argument_list (binary_expression left: (identifier) right: (number_literal)))) right: (identifier)))) right: (number_literal)))))))))))) condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier)))) (return_statement (identifier)))) (return_statement (binary_expression left: (identifier) right: (number_literal))))))

ulong MASKED(byte *param_1,int param_2,ulong param_3)

{
  byte *pbVar1;
  byte bVar2;
  
  if (param_2 != 0) {
    pbVar1 = param_1 + (ulong)(param_2 - 1) + 1;
    param_3 = param_3 & 0xffffffff;
    do {
      bVar2 = *param_1;
      param_1 = param_1 + 1;
      param_3 = (ulong)((int)param_3 << 8 ^
                       *(uint *)(&DAT_00589b00 + (ulong)(byte)((byte)(param_3 >> 0x18) ^ bVar2) * 4)
                       );
    } while (param_1 != pbVar1);
    return param_3;
  }
  return param_3 & 0xffffffff;
}

