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

_Bool sg_get_initial_dsense(void)

{
  char *pcVar1;
  int iVar2;
  int in_GS_OFFSET;
  _Bool _Var3;
  int k;
  int local_10;
  undefined4 uStack_8;
  
  uStack_8 = 0x18196;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar1 = getenv("SG3_UTILS_DSENSE");
  if (pcVar1 != (char *)0x0) {
    iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);
    if (iVar2 == 1) {
      _Var3 = k != 0;
      goto LAB_000181dd;
    }
  }
  _Var3 = false;
LAB_000181dd:
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return _Var3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



bool sg_get_initial_dsense(void)

{
  char *pcVar1;
  int iVar2;
  int unaff_EBX;
  int in_GS_OFFSET;
  bool bVar3;
  int local_18;
  int local_14;
  undefined4 uStack_8;
  
  uStack_8 = 0x18196;
  entry();
  local_14 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));
  if (pcVar1 != (char *)0x0) {
    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);
    if (iVar2 == 1) {
      bVar3 = local_18 != 0;
      goto LAB_000181dd;
    }
  }
  bVar3 = false;
LAB_000181dd:
  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {
    return bVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0002f100();
}


PUSH EBX
CALL 0x00017820
ADD EBX,0x30bf2
SUB ESP,0x24
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x18],EAX
XOR EAX,EAX
LEA EAX,[EBX + 0xfffe734f]
PUSH EAX
CALL 0x00017350
ADD ESP,0x10
TEST EAX,EAX
JZ 0x000181db
SUB ESP,0x4
LEA EDX,[ESP + 0xc]
PUSH EDX
LEA EDX,[EBX + 0xfffe74e0]
PUSH EDX
PUSH EAX
CALL 0x00017480
ADD ESP,0x10
CMP EAX,0x1
JZ 0x000181f0
XOR EAX,EAX
MOV ECX,dword ptr [ESP + 0xc]
XOR ECX,dword ptr GS:[0x14]
JNZ 0x000181fb
ADD ESP,0x18
POP EBX
RET
MOV EAX,dword ptr [ESP + 0x8]
TEST EAX,EAX
SETNZ AL
JMP 0x000181dd
CALL 0x0002f100
(translation_unit "bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0002f100();\n}\n\n" (function_definition "bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0002f100();\n}" primitive_type (function_declarator "sg_get_initial_dsense(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0002f100();\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "bool bVar3;" primitive_type identifier ;) (declaration "int local_18;" primitive_type identifier ;) (declaration "int local_14;" primitive_type identifier ;) (declaration "undefined4 uStack_8;" type_identifier identifier ;) (expression_statement "uStack_8 = 0x18196;" (assignment_expression "uStack_8 = 0x18196" identifier = number_literal) ;) (expression_statement "entry();" (call_expression "entry()" identifier (argument_list "()" ( ))) ;) (expression_statement "local_14 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_14 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));" (assignment_expression "pcVar1 = getenv((char *)(unaff_EBX + 0x17f41))" identifier = (call_expression "getenv((char *)(unaff_EBX + 0x17f41))" identifier (argument_list "((char *)(unaff_EBX + 0x17f41))" ( (cast_expression "(char *)(unaff_EBX + 0x17f41)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_EBX + 0x17f41)" ( (binary_expression "unaff_EBX + 0x17f41" identifier + number_literal) ))) )))) ;) (if_statement "if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }" if (parenthesized_expression "(pcVar1 != (char *)0x0)" ( (binary_expression "pcVar1 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }" { (expression_statement "iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);" (assignment_expression "iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18)" identifier = (call_expression "__isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18)" identifier (argument_list "(pcVar1,unaff_EBX + 0x180d2,&local_18)" ( identifier , (binary_expression "unaff_EBX + 0x180d2" identifier + number_literal) , (pointer_expression "&local_18" & identifier) )))) ;) (if_statement "if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }" { (expression_statement "bVar3 = local_18 != 0;" (assignment_expression "bVar3 = local_18 != 0" identifier = (binary_expression "local_18 != 0" identifier != number_literal)) ;) (goto_statement "goto LAB_000181dd;" goto statement_identifier ;) })) })) (expression_statement "bVar3 = false;" (assignment_expression "bVar3 = false" identifier = false) ;) (labeled_statement "LAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }" if (parenthesized_expression "(local_14 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_14 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return bVar3;\n  }" { (return_statement "return bVar3;" return identifier ;) }))) comment (expression_statement "FUN_0002f100();" (call_expression "FUN_0002f100()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\n_Bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  _Bool _Var3;\n  int k;\n  int local_10;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv("SG3_UTILS_DSENSE");\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);\n    if (iVar2 == 1) {\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }\n  }\n  _Var3 = false;\nLAB_000181dd:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return _Var3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment (function_definition "_Bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  _Bool _Var3;\n  int k;\n  int local_10;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv("SG3_UTILS_DSENSE");\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);\n    if (iVar2 == 1) {\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }\n  }\n  _Var3 = false;\nLAB_000181dd:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return _Var3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" type_identifier (function_declarator "sg_get_initial_dsense(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  char *pcVar1;\n  int iVar2;\n  int in_GS_OFFSET;\n  _Bool _Var3;\n  int k;\n  int local_10;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  local_10 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv("SG3_UTILS_DSENSE");\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);\n    if (iVar2 == 1) {\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }\n  }\n  _Var3 = false;\nLAB_000181dd:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return _Var3;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "_Bool _Var3;" type_identifier identifier ;) (declaration "int k;" primitive_type identifier ;) (declaration "int local_10;" primitive_type identifier ;) (declaration "undefined4 uStack_8;" type_identifier identifier ;) (expression_statement "uStack_8 = 0x18196;" (assignment_expression "uStack_8 = 0x18196" identifier = number_literal) ;) (expression_statement "local_10 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_10 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "pcVar1 = getenv("SG3_UTILS_DSENSE");" (assignment_expression "pcVar1 = getenv("SG3_UTILS_DSENSE")" identifier = (call_expression "getenv("SG3_UTILS_DSENSE")" identifier (argument_list "("SG3_UTILS_DSENSE")" ( (string_literal ""SG3_UTILS_DSENSE"" " string_content ") )))) ;) (if_statement "if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);\n    if (iVar2 == 1) {\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }\n  }" if (parenthesized_expression "(pcVar1 != (char *)0x0)" ( (binary_expression "pcVar1 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);\n    if (iVar2 == 1) {\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }\n  }" { (expression_statement "iVar2 = __isoc99_sscanf(pcVar1,"%d",&k);" (assignment_expression "iVar2 = __isoc99_sscanf(pcVar1,"%d",&k)" identifier = (call_expression "__isoc99_sscanf(pcVar1,"%d",&k)" identifier (argument_list "(pcVar1,"%d",&k)" ( identifier , (string_literal ""%d"" " string_content ") , (pointer_expression "&k" & identifier) )))) ;) (if_statement "if (iVar2 == 1) {\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n      _Var3 = k != 0;\n      goto LAB_000181dd;\n    }" { (expression_statement "_Var3 = k != 0;" (assignment_expression "_Var3 = k != 0" identifier = (binary_expression "k != 0" identifier != number_literal)) ;) (goto_statement "goto LAB_000181dd;" goto statement_identifier ;) })) })) (expression_statement "_Var3 = false;" (assignment_expression "_Var3 = false" identifier = false) ;) (labeled_statement "LAB_000181dd:\n  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return _Var3;\n  }" statement_identifier : (if_statement "if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return _Var3;\n  }" if (parenthesized_expression "(local_10 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_10 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return _Var3;\n  }" { (return_statement "return _Var3;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    \n  FUN_0002f100();\n}\n\n" (function_definition "bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    \n  FUN_0002f100();\n}" primitive_type (function_declarator "sg_get_initial_dsense(void)" identifier (parameter_list "(void)" ( (parameter_declaration "void" primitive_type) ))) (compound_statement "{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    \n  FUN_0002f100();\n}" { (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int unaff_EBX;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "bool bVar3;" primitive_type identifier ;) (declaration "int local_18;" primitive_type identifier ;) (declaration "int local_14;" primitive_type identifier ;) (declaration "undefined4 uStack_8;" type_identifier identifier ;) (expression_statement "uStack_8 = 0x18196;" (assignment_expression "uStack_8 = 0x18196" identifier = number_literal) ;) (expression_statement "entry();" (call_expression "entry()" identifier (argument_list "()" ( ))) ;) (expression_statement "local_14 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_14 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));" (assignment_expression "pcVar1 = getenv((char *)(unaff_EBX + 0x17f41))" identifier = (call_expression "getenv((char *)(unaff_EBX + 0x17f41))" identifier (argument_list "((char *)(unaff_EBX + 0x17f41))" ( (cast_expression "(char *)(unaff_EBX + 0x17f41)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(unaff_EBX + 0x17f41)" ( (binary_expression "unaff_EBX + 0x17f41" identifier + number_literal) ))) )))) ;) (if_statement "if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }" if (parenthesized_expression "(pcVar1 != (char *)0x0)" ( (binary_expression "pcVar1 != (char *)0x0" identifier != (cast_expression "(char *)0x0" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }" { (expression_statement "iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);" (assignment_expression "iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18)" identifier = (call_expression "__isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18)" identifier (argument_list "(pcVar1,unaff_EBX + 0x180d2,&local_18)" ( identifier , (binary_expression "unaff_EBX + 0x180d2" identifier + number_literal) , (pointer_expression "&local_18" & identifier) )))) ;) (if_statement "if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }" if (parenthesized_expression "(iVar2 == 1)" ( (binary_expression "iVar2 == 1" identifier == number_literal) )) (compound_statement "{\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }" { (expression_statement "bVar3 = local_18 != 0;" (assignment_expression "bVar3 = local_18 != 0" identifier = (binary_expression "local_18 != 0" identifier != number_literal)) ;) (goto_statement "goto LAB_000181dd;" goto statement_identifier ;) })) })) (expression_statement "bVar3 = false;" (assignment_expression "bVar3 = false" identifier = false) ;) (labeled_statement "LAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }" statement_identifier : (if_statement "if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }" if (parenthesized_expression "(local_14 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_14 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return bVar3;\n  }" { (return_statement "return bVar3;" return identifier ;) }))) (expression_statement "FUN_0002f100();" (call_expression "FUN_0002f100()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (call_expression IDENT (argument_list ( ))) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (binary_expression IDENT + LIT) , (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (binary_expression IDENT != LIT)) ;) (goto_statement goto statement_identifier ;) })) })) (expression_statement (assignment_expression IDENT = BOOL) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "bool sg_get_initial_dsense(void)\n\n{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    \n  FUN_0002f100();\n}" (primitive_type "bool") (function_declarator "sg_get_initial_dsense(void)" (identifier "sg_get_initial_dsense") (parameter_list "(void)" (( "(") (parameter_declaration "void" (primitive_type "void")) () ")"))) (compound_statement "{\n  char *pcVar1;\n  int iVar2;\n  int unaff_EBX;\n  int in_GS_OFFSET;\n  bool bVar3;\n  int local_18;\n  int local_14;\n  undefined4 uStack_8;\n  \n  uStack_8 = 0x18196;\n  entry();\n  local_14 = *(int *)(in_GS_OFFSET + 0x14);\n  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));\n  if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }\n  bVar3 = false;\nLAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }\n                    \n  FUN_0002f100();\n}" ({ "{") (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int unaff_EBX;" (primitive_type "int") (identifier "unaff_EBX") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "bool bVar3;" (primitive_type "bool") (identifier "bVar3") (; ";")) (declaration "int local_18;" (primitive_type "int") (identifier "local_18") (; ";")) (declaration "int local_14;" (primitive_type "int") (identifier "local_14") (; ";")) (declaration "undefined4 uStack_8;" (type_identifier "undefined4") (identifier "uStack_8") (; ";")) (expression_statement "uStack_8 = 0x18196;" (assignment_expression "uStack_8 = 0x18196" (identifier "uStack_8") (= "=") (number_literal "0x18196")) (; ";")) (expression_statement "entry();" (call_expression "entry()" (identifier "entry") (argument_list "()" (( "(") () ")"))) (; ";")) (expression_statement "local_14 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_14 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_14") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (expression_statement "pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));" (assignment_expression "pcVar1 = getenv((char *)(unaff_EBX + 0x17f41))" (identifier "pcVar1") (= "=") (call_expression "getenv((char *)(unaff_EBX + 0x17f41))" (identifier "getenv") (argument_list "((char *)(unaff_EBX + 0x17f41))" (( "(") (cast_expression "(char *)(unaff_EBX + 0x17f41)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(unaff_EBX + 0x17f41)" (( "(") (binary_expression "unaff_EBX + 0x17f41" (identifier "unaff_EBX") (+ "+") (number_literal "0x17f41")) () ")"))) () ")")))) (; ";")) (if_statement "if (pcVar1 != (char *)0x0) {\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }" (if "if") (parenthesized_expression "(pcVar1 != (char *)0x0)" (( "(") (binary_expression "pcVar1 != (char *)0x0" (identifier "pcVar1") (!= "!=") (cast_expression "(char *)0x0" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);\n    if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }\n  }" ({ "{") (expression_statement "iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);" (assignment_expression "iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18)" (identifier "iVar2") (= "=") (call_expression "__isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18)" (identifier "__isoc99_sscanf") (argument_list "(pcVar1,unaff_EBX + 0x180d2,&local_18)" (( "(") (identifier "pcVar1") (, ",") (binary_expression "unaff_EBX + 0x180d2" (identifier "unaff_EBX") (+ "+") (number_literal "0x180d2")) (, ",") (pointer_expression "&local_18" (& "&") (identifier "local_18")) () ")")))) (; ";")) (if_statement "if (iVar2 == 1) {\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }" (if "if") (parenthesized_expression "(iVar2 == 1)" (( "(") (binary_expression "iVar2 == 1" (identifier "iVar2") (== "==") (number_literal "1")) () ")")) (compound_statement "{\n      bVar3 = local_18 != 0;\n      goto LAB_000181dd;\n    }" ({ "{") (expression_statement "bVar3 = local_18 != 0;" (assignment_expression "bVar3 = local_18 != 0" (identifier "bVar3") (= "=") (binary_expression "local_18 != 0" (identifier "local_18") (!= "!=") (number_literal "0"))) (; ";")) (goto_statement "goto LAB_000181dd;" (goto "goto") (statement_identifier "LAB_000181dd") (; ";")) (} "}"))) (} "}"))) (expression_statement "bVar3 = false;" (assignment_expression "bVar3 = false" (identifier "bVar3") (= "=") (false "false")) (; ";")) (labeled_statement "LAB_000181dd:\n  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }" (statement_identifier "LAB_000181dd") (: ":") (if_statement "if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return bVar3;\n  }" (if "if") (parenthesized_expression "(local_14 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_14 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_14") (== "==") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n    return bVar3;\n  }" ({ "{") (return_statement "return bVar3;" (return "return") (identifier "bVar3") (; ";")) (} "}")))) (expression_statement "FUN_0002f100();" (call_expression "FUN_0002f100()" (identifier "FUN_0002f100") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

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

type_1 function_1(void)

{
  char *var_3;
  int var_5;
  int var_1;
  type_1 _Var3;
  int var_6;
  int var_7;
  type_2 uStack_8;
  
  uStack_8 = 0x18196;
  var_7 = *(int *)(var_1 + 0x14);
  var_3 = var_2("SG3_UTILS_DSENSE");
  if (var_3 != (char *)0x0) {
    var_5 = var_4(var_3,"%d",&var_6);
    if (var_5 == 1) {
      _Var3 = var_6 != 0;
      goto LAB_000181dd;
    }
  }
  _Var3 = false;
LAB_000181dd:
  if (var_7 == *(int *)(var_1 + 0x14)) {
    return _Var3;
  }
                    /* WARNING: Subroutine does not return */
  var_8();
}


(translation_unit (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))) (expression_statement (assignment_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (number_literal)))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (binary_expression left: (identifier) right: (number_literal)) (pointer_expression argument: (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: (number_literal)))) (goto_statement label: (statement_identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (false))) (labeled_statement label: (statement_identifier) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))) consequence: (compound_statement (return_statement (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

bool MASKED(void)

{
  char *pcVar1;
  int iVar2;
  int unaff_EBX;
  int in_GS_OFFSET;
  bool bVar3;
  int local_18;
  int local_14;
  undefined4 uStack_8;
  
  uStack_8 = 0x18196;
  entry();
  local_14 = *(int *)(in_GS_OFFSET + 0x14);
  pcVar1 = getenv((char *)(unaff_EBX + 0x17f41));
  if (pcVar1 != (char *)0x0) {
    iVar2 = __isoc99_sscanf(pcVar1,unaff_EBX + 0x180d2,&local_18);
    if (iVar2 == 1) {
      bVar3 = local_18 != 0;
      goto LAB_000181dd;
    }
  }
  bVar3 = false;
LAB_000181dd:
  if (local_14 == *(int *)(in_GS_OFFSET + 0x14)) {
    return bVar3;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0002f100();
}

