
/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

int sqlite3_limit(sqlite3 *db,int limitId,int newLimit)

{
  int iVar1;
  
  if ((uint)limitId < 0xc) {
    iVar1 = db->aLimit[limitId];
    if (-1 < newLimit) {
      if (aHardLimit[limitId] <= newLimit) {
        newLimit = aHardLimit[limitId];
      }
      db->aLimit[limitId] = newLimit;
    }
  }
  else {
    iVar1 = -1;
  }
  return iVar1;
}



/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

undefined4 FUN_0001ebc0(int param_1,uint param_2,int param_3)

{
  undefined4 uVar1;
  
  if (param_2 < 0xc) {
    param_1 = param_1 + param_2 * 4;
    uVar1 = *(undefined4 *)(param_1 + 0x68);
    if (-1 < param_3) {
      if ((int)(&DAT_00100d80)[param_2] <= param_3) {
        param_3 = (&DAT_00100d80)[param_2];
      }
      *(int *)(param_1 + 0x68) = param_3;
    }
  }
  else {
    uVar1 = 0xffffffff;
  }
  return uVar1;
}


PUSH ESI
CALL 0x000f5a00
ADD ESI,0x12c30e
PUSH EBX
MOV ECX,dword ptr [ESP + 0x10]
MOV EDX,dword ptr [ESP + 0x14]
CMP ECX,0xb
JA 0x0001ec00
MOV EAX,dword ptr [ESP + 0xc]
LEA EBX,[EAX + ECX*0x4]
MOV EAX,dword ptr [EBX + 0x68]
TEST EDX,EDX
JS 0x0001ebf8
LEA ESI,[ESI + 0xfffb5eac]
CMP dword ptr [ESI + ECX*0x4],EDX
CMOVLE EDX,dword ptr [ESI + ECX*0x4]
MOV dword ptr [EBX + 0x68],EDX
POP EBX
POP ESI
RET
MOV EAX,0xffffffff
JMP 0x0001ebf8
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n\nundefined4 FUN_0001ebc0(int param_1,uint param_2,int param_3)\n\n{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}\n\n" comment (function_definition "undefined4 FUN_0001ebc0(int param_1,uint param_2,int param_3)\n\n{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}" type_identifier (function_declarator "FUN_0001ebc0(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (if_statement "if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }" if (parenthesized_expression "(param_2 < 0xc)" ( (binary_expression "param_2 < 0xc" identifier < number_literal) )) (compound_statement "{\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }" { (expression_statement "param_1 = param_1 + param_2 * 4;" (assignment_expression "param_1 = param_1 + param_2 * 4" identifier = (binary_expression "param_1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x68);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x68)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0x68)" * (cast_expression "(undefined4 *)(param_1 + 0x68)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x68)" ( (binary_expression "param_1 + 0x68" identifier + number_literal) ))))) ;) (if_statement "if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }" if (parenthesized_expression "(-1 < param_3)" ( (binary_expression "-1 < param_3" number_literal < identifier) )) (compound_statement "{\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }" { (if_statement "if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }" if (parenthesized_expression "((int)(&DAT_00100d80)[param_2] <= param_3)" ( (binary_expression "(int)(&DAT_00100d80)[param_2] <= param_3" (cast_expression "(int)(&DAT_00100d80)[param_2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "(&DAT_00100d80)[param_2]" (parenthesized_expression "(&DAT_00100d80)" ( (pointer_expression "&DAT_00100d80" & identifier) )) [ identifier ])) <= identifier) )) (compound_statement "{\n        param_3 = (&DAT_00100d80)[param_2];\n      }" { (expression_statement "param_3 = (&DAT_00100d80)[param_2];" (assignment_expression "param_3 = (&DAT_00100d80)[param_2]" identifier = (subscript_expression "(&DAT_00100d80)[param_2]" (parenthesized_expression "(&DAT_00100d80)" ( (pointer_expression "&DAT_00100d80" & identifier) )) [ identifier ])) ;) })) (expression_statement "*(int *)(param_1 + 0x68) = param_3;" (assignment_expression "*(int *)(param_1 + 0x68) = param_3" (pointer_expression "*(int *)(param_1 + 0x68)" * (cast_expression "(int *)(param_1 + 0x68)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x68)" ( (binary_expression "param_1 + 0x68" identifier + number_literal) )))) = identifier) ;) })) }) (else_clause "else {\n    uVar1 = 0xffffffff;\n  }" else (compound_statement "{\n    uVar1 = 0xffffffff;\n  }" { (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" identifier = number_literal) ;) }))) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */\n\nint sqlite3_limit(sqlite3 *db,int limitId,int newLimit)\n\n{\n  int iVar1;\n  \n  if ((uint)limitId < 0xc) {\n    iVar1 = db->aLimit[limitId];\n    if (-1 < newLimit) {\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }\n  }\n  else {\n    iVar1 = -1;\n  }\n  return iVar1;\n}\n\n" comment (function_definition "int sqlite3_limit(sqlite3 *db,int limitId,int newLimit)\n\n{\n  int iVar1;\n  \n  if ((uint)limitId < 0xc) {\n    iVar1 = db->aLimit[limitId];\n    if (-1 < newLimit) {\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }\n  }\n  else {\n    iVar1 = -1;\n  }\n  return iVar1;\n}" primitive_type (function_declarator "sqlite3_limit(sqlite3 *db,int limitId,int newLimit)" identifier (parameter_list "(sqlite3 *db,int limitId,int newLimit)" ( (parameter_declaration "sqlite3 *db" type_identifier (pointer_declarator "*db" * identifier)) , (parameter_declaration "int limitId" primitive_type identifier) , (parameter_declaration "int newLimit" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  \n  if ((uint)limitId < 0xc) {\n    iVar1 = db->aLimit[limitId];\n    if (-1 < newLimit) {\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }\n  }\n  else {\n    iVar1 = -1;\n  }\n  return iVar1;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (if_statement "if ((uint)limitId < 0xc) {\n    iVar1 = db->aLimit[limitId];\n    if (-1 < newLimit) {\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }\n  }\n  else {\n    iVar1 = -1;\n  }" if (parenthesized_expression "((uint)limitId < 0xc)" ( (binary_expression "(uint)limitId < 0xc" (cast_expression "(uint)limitId" ( (type_descriptor "uint" type_identifier) ) identifier) < number_literal) )) (compound_statement "{\n    iVar1 = db->aLimit[limitId];\n    if (-1 < newLimit) {\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }\n  }" { (expression_statement "iVar1 = db->aLimit[limitId];" (assignment_expression "iVar1 = db->aLimit[limitId]" identifier = (subscript_expression "db->aLimit[limitId]" (field_expression "db->aLimit" identifier -> field_identifier) [ identifier ])) ;) (if_statement "if (-1 < newLimit) {\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }" if (parenthesized_expression "(-1 < newLimit)" ( (binary_expression "-1 < newLimit" number_literal < identifier) )) (compound_statement "{\n      if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }\n      db->aLimit[limitId] = newLimit;\n    }" { (if_statement "if (aHardLimit[limitId] <= newLimit) {\n        newLimit = aHardLimit[limitId];\n      }" if (parenthesized_expression "(aHardLimit[limitId] <= newLimit)" ( (binary_expression "aHardLimit[limitId] <= newLimit" (subscript_expression "aHardLimit[limitId]" identifier [ identifier ]) <= identifier) )) (compound_statement "{\n        newLimit = aHardLimit[limitId];\n      }" { (expression_statement "newLimit = aHardLimit[limitId];" (assignment_expression "newLimit = aHardLimit[limitId]" identifier = (subscript_expression "aHardLimit[limitId]" identifier [ identifier ])) ;) })) (expression_statement "db->aLimit[limitId] = newLimit;" (assignment_expression "db->aLimit[limitId] = newLimit" (subscript_expression "db->aLimit[limitId]" (field_expression "db->aLimit" identifier -> field_identifier) [ identifier ]) = identifier) ;) })) }) (else_clause "else {\n    iVar1 = -1;\n  }" else (compound_statement "{\n    iVar1 = -1;\n  }" { (expression_statement "iVar1 = -1;" (assignment_expression "iVar1 = -1" identifier = number_literal) ;) }))) (return_statement "return iVar1;" return identifier ;) })))
(translation_unit "undefined4 FUN_0001ebc0(int param_1,uint param_2,int param_3)\n\n{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}\n\n" (function_definition "undefined4 FUN_0001ebc0(int param_1,uint param_2,int param_3)\n\n{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}" type_identifier (function_declarator "FUN_0001ebc0(int param_1,uint param_2,int param_3)" identifier (parameter_list "(int param_1,uint param_2,int param_3)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "uint param_2" type_identifier identifier) , (parameter_declaration "int param_3" primitive_type identifier) ))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}" { (declaration "undefined4 uVar1;" type_identifier identifier ;) (if_statement "if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }" if (parenthesized_expression "(param_2 < 0xc)" ( (binary_expression "param_2 < 0xc" identifier < number_literal) )) (compound_statement "{\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }" { (expression_statement "param_1 = param_1 + param_2 * 4;" (assignment_expression "param_1 = param_1 + param_2 * 4" identifier = (binary_expression "param_1 + param_2 * 4" identifier + (binary_expression "param_2 * 4" identifier * number_literal))) ;) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x68);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x68)" identifier = (pointer_expression "*(undefined4 *)(param_1 + 0x68)" * (cast_expression "(undefined4 *)(param_1 + 0x68)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x68)" ( (binary_expression "param_1 + 0x68" identifier + number_literal) ))))) ;) (if_statement "if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }" if (parenthesized_expression "(-1 < param_3)" ( (binary_expression "-1 < param_3" number_literal < identifier) )) (compound_statement "{\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }" { (if_statement "if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }" if (parenthesized_expression "((int)(&DAT_00100d80)[param_2] <= param_3)" ( (binary_expression "(int)(&DAT_00100d80)[param_2] <= param_3" (cast_expression "(int)(&DAT_00100d80)[param_2]" ( (type_descriptor "int" primitive_type) ) (subscript_expression "(&DAT_00100d80)[param_2]" (parenthesized_expression "(&DAT_00100d80)" ( (pointer_expression "&DAT_00100d80" & identifier) )) [ identifier ])) <= identifier) )) (compound_statement "{\n        param_3 = (&DAT_00100d80)[param_2];\n      }" { (expression_statement "param_3 = (&DAT_00100d80)[param_2];" (assignment_expression "param_3 = (&DAT_00100d80)[param_2]" identifier = (subscript_expression "(&DAT_00100d80)[param_2]" (parenthesized_expression "(&DAT_00100d80)" ( (pointer_expression "&DAT_00100d80" & identifier) )) [ identifier ])) ;) })) (expression_statement "*(int *)(param_1 + 0x68) = param_3;" (assignment_expression "*(int *)(param_1 + 0x68) = param_3" (pointer_expression "*(int *)(param_1 + 0x68)" * (cast_expression "(int *)(param_1 + 0x68)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x68)" ( (binary_expression "param_1 + 0x68" identifier + number_literal) )))) = identifier) ;) })) }) (else_clause "else {\n    uVar1 = 0xffffffff;\n  }" else (compound_statement "{\n    uVar1 = 0xffffffff;\n  }" { (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" identifier = number_literal) ;) }))) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT + (binary_expression IDENT * LIT))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) (subscript_expression (parenthesized_expression ( (pointer_expression & IDENT) )) [ IDENT ])) <= IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression (parenthesized_expression ( (pointer_expression & IDENT) )) [ IDENT ])) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) })) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined4 FUN_0001ebc0(int param_1,uint param_2,int param_3)\n\n{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}" (type_identifier "undefined4") (function_declarator "FUN_0001ebc0(int param_1,uint param_2,int param_3)" (identifier "FUN_0001ebc0") (parameter_list "(int param_1,uint param_2,int param_3)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "uint param_2" (type_identifier "uint") (identifier "param_2")) (, ",") (parameter_declaration "int param_3" (primitive_type "int") (identifier "param_3")) () ")"))) (compound_statement "{\n  undefined4 uVar1;\n  \n  if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }\n  return uVar1;\n}" ({ "{") (declaration "undefined4 uVar1;" (type_identifier "undefined4") (identifier "uVar1") (; ";")) (if_statement "if (param_2 < 0xc) {\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }\n  else {\n    uVar1 = 0xffffffff;\n  }" (if "if") (parenthesized_expression "(param_2 < 0xc)" (( "(") (binary_expression "param_2 < 0xc" (identifier "param_2") (< "<") (number_literal "0xc")) () ")")) (compound_statement "{\n    param_1 = param_1 + param_2 * 4;\n    uVar1 = *(undefined4 *)(param_1 + 0x68);\n    if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }\n  }" ({ "{") (expression_statement "param_1 = param_1 + param_2 * 4;" (assignment_expression "param_1 = param_1 + param_2 * 4" (identifier "param_1") (= "=") (binary_expression "param_1 + param_2 * 4" (identifier "param_1") (+ "+") (binary_expression "param_2 * 4" (identifier "param_2") (* "*") (number_literal "4")))) (; ";")) (expression_statement "uVar1 = *(undefined4 *)(param_1 + 0x68);" (assignment_expression "uVar1 = *(undefined4 *)(param_1 + 0x68)" (identifier "uVar1") (= "=") (pointer_expression "*(undefined4 *)(param_1 + 0x68)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x68)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x68)" (( "(") (binary_expression "param_1 + 0x68" (identifier "param_1") (+ "+") (number_literal "0x68")) () ")"))))) (; ";")) (if_statement "if (-1 < param_3) {\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }" (if "if") (parenthesized_expression "(-1 < param_3)" (( "(") (binary_expression "-1 < param_3" (number_literal "-1") (< "<") (identifier "param_3")) () ")")) (compound_statement "{\n      if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }\n      *(int *)(param_1 + 0x68) = param_3;\n    }" ({ "{") (if_statement "if ((int)(&DAT_00100d80)[param_2] <= param_3) {\n        param_3 = (&DAT_00100d80)[param_2];\n      }" (if "if") (parenthesized_expression "((int)(&DAT_00100d80)[param_2] <= param_3)" (( "(") (binary_expression "(int)(&DAT_00100d80)[param_2] <= param_3" (cast_expression "(int)(&DAT_00100d80)[param_2]" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (subscript_expression "(&DAT_00100d80)[param_2]" (parenthesized_expression "(&DAT_00100d80)" (( "(") (pointer_expression "&DAT_00100d80" (& "&") (identifier "DAT_00100d80")) () ")")) ([ "[") (identifier "param_2") (] "]"))) (<= "<=") (identifier "param_3")) () ")")) (compound_statement "{\n        param_3 = (&DAT_00100d80)[param_2];\n      }" ({ "{") (expression_statement "param_3 = (&DAT_00100d80)[param_2];" (assignment_expression "param_3 = (&DAT_00100d80)[param_2]" (identifier "param_3") (= "=") (subscript_expression "(&DAT_00100d80)[param_2]" (parenthesized_expression "(&DAT_00100d80)" (( "(") (pointer_expression "&DAT_00100d80" (& "&") (identifier "DAT_00100d80")) () ")")) ([ "[") (identifier "param_2") (] "]"))) (; ";")) (} "}"))) (expression_statement "*(int *)(param_1 + 0x68) = param_3;" (assignment_expression "*(int *)(param_1 + 0x68) = param_3" (pointer_expression "*(int *)(param_1 + 0x68)" (* "*") (cast_expression "(int *)(param_1 + 0x68)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x68)" (( "(") (binary_expression "param_1 + 0x68" (identifier "param_1") (+ "+") (number_literal "0x68")) () ")")))) (= "=") (identifier "param_3")) (; ";")) (} "}"))) (} "}")) (else_clause "else {\n    uVar1 = 0xffffffff;\n  }" (else "else") (compound_statement "{\n    uVar1 = 0xffffffff;\n  }" ({ "{") (expression_statement "uVar1 = 0xffffffff;" (assignment_expression "uVar1 = 0xffffffff" (identifier "uVar1") (= "=") (number_literal "0xffffffff")) (; ";")) (} "}")))) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

int function_1(type_1 *db,int limitId,int var_1)

{
  int iVar1;
  
  if ((type_2)limitId < 0xc) {
    iVar1 = db->aLimit[limitId];
    if (-1 < var_1) {
      if (aHardLimit[limitId] <= var_1) {
        var_1 = aHardLimit[limitId];
      }
      db->aLimit[limitId] = var_1;
    }
  }
  else {
    iVar1 = -1;
  }
  return iVar1;
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (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: (identifier) right: (binary_expression left: (identifier) right: (number_literal))))) (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: (number_literal))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (subscript_expression argument: (parenthesized_expression (pointer_expression argument: (identifier))) index: (identifier))) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (subscript_expression argument: (parenthesized_expression (pointer_expression argument: (identifier))) index: (identifier)))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier)))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (return_statement (identifier)))))

/* WARNING: Function: __i686.get_pc_thunk.si replaced with injection: get_pc_thunk_si */

undefined4 MASKED(int param_1,uint param_2,int param_3)

{
  undefined4 uVar1;
  
  if (param_2 < 0xc) {
    param_1 = param_1 + param_2 * 4;
    uVar1 = *(undefined4 *)(param_1 + 0x68);
    if (-1 < param_3) {
      if ((int)(&DAT_00100d80)[param_2] <= param_3) {
        param_3 = (&DAT_00100d80)[param_2];
      }
      *(int *)(param_1 + 0x68) = param_3;
    }
  }
  else {
    uVar1 = 0xffffffff;
  }
  return uVar1;
}

