
/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

int proxy_socks5_selectchap(Proxy_Socket p)

{
  int iVar1;
  char *__s;
  char *pcVar2;
  size_t sVar3;
  int iVar4;
  int in_GS_OFFSET;
  char chapbuf [514];
  
  iVar1 = *(int *)(in_GS_OFFSET + 0x14);
  __s = conf_get_str(p->conf,0x10);
  pcVar2 = conf_get_str(p->conf,0x11);
  if ((*__s == '\0') && (*pcVar2 == '\0')) {
    (*(*p->plug)->closing)
              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000
               ,0);
  }
  else {
    chapbuf[0] = '\x01';
    chapbuf[1] = '\x02';
    chapbuf[2] = '\x11';
    chapbuf[3] = '\x01';
    chapbuf[4] = -0x7b;
    chapbuf[5] = '\x02';
    sVar3 = strlen(__s);
    if (sVar3 < 0x100) {
      if (sVar3 == 0) {
        iVar4 = 8;
        sVar3 = 1;
        chapbuf[6] = '\x01';
      }
      else {
        chapbuf[6] = (char)sVar3;
        iVar4 = sVar3 + 7;
      }
    }
    else {
      iVar4 = 0x106;
      sVar3 = 0xff;
      chapbuf[6] = -1;
    }
    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);
    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);
    p->chap_num_attributes = 0;
    p->chap_num_attributes_processed = 0;
    p->chap_current_attribute = -1;
    p->chap_current_datalen = 0;
    p->state = 8;
  }
  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail_local();
}



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

undefined4 FUN_00019e90(int param_1)

{
  char *__s;
  char *pcVar1;
  size_t sVar2;
  int iVar3;
  int in_GS_OFFSET;
  undefined4 local_222;
  undefined2 local_21e;
  undefined1 local_21c;
  undefined1 local_21b [507];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x19e99;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);
  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);
  if ((*__s == '\0') && (*pcVar1 == '\0')) {
    (**(code **)(**(int **)(param_1 + 0xc) + 4))
              (*(int **)(param_1 + 0xc),
               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);
  }
  else {
    local_222 = 0x1110201;
    local_21e = 0x285;
    sVar2 = strlen(__s);
    if (sVar2 < 0x100) {
      if (sVar2 == 0) {
        iVar3 = 8;
        sVar2 = 1;
        local_21c = 1;
      }
      else {
        local_21c = (undefined1)sVar2;
        iVar3 = sVar2 + 7;
      }
    }
    else {
      iVar3 = 0x106;
      sVar2 = 0xff;
      local_21c = 0xff;
    }
    __memcpy_chk(local_21b,__s,sVar2,0x1fb);
    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);
    *(undefined4 *)(param_1 + 0x78) = 0;
    *(undefined4 *)(param_1 + 0x7c) = 0;
    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;
    *(undefined4 *)(param_1 + 0x84) = 0;
    *(undefined4 *)(param_1 + 0x44) = 8;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006dad0();
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00015fa0
ADD EBX,0x8aed7
SUB ESP,0x224
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x214],EAX
XOR EAX,EAX
MOV ESI,dword ptr [ESP + 0x238]
PUSH 0x10
PUSH dword ptr [ESI + 0x74]
CALL 0x00018b50
POP EDX
POP ECX
PUSH 0x11
PUSH dword ptr [ESI + 0x74]
MOV EBP,EAX
CALL 0x00018b50
ADD ESP,0x10
CMP byte ptr [EBP],0x0
JNZ 0x00019ee5
CMP byte ptr [EAX],0x0
JZ 0x00019fa8
MOV EAX,0x285
MOV dword ptr [ESP + 0xa],0x1110201
SUB ESP,0xc
MOV word ptr [ESP + 0x1a],AX
PUSH EBP
CALL 0x00014440
ADD ESP,0x10
CMP EAX,0xff
JA 0x00019f90
TEST EAX,EAX
JZ 0x00019fc8
MOV EDX,EAX
LEA EDI,[EAX + 0x7]
MOV byte ptr [ESP + 0x10],DL
PUSH 0x1fb
PUSH EAX
PUSH EBP
LEA EAX,[ESP + 0x1d]
LEA EBP,[ESP + 0x16]
PUSH EAX
CALL 0x00014390
MOV EAX,dword ptr [ESI + 0x8]
ADD ESP,0xc
MOV EDX,dword ptr [EAX]
PUSH EDI
PUSH EBP
PUSH EAX
CALL dword ptr [EDX + 0x8]
MOV dword ptr [ESI + 0x78],0x0
MOV dword ptr [ESI + 0x7c],0x0
MOV dword ptr [ESI + 0x80],0xffffffff
ADD ESP,0x10
MOV dword ptr [ESI + 0x84],0x0
MOV dword ptr [ESI + 0x44],0x8
MOV ECX,dword ptr [ESP + 0x20c]
XOR ECX,dword ptr GS:[0x14]
MOV EAX,0x1
JNZ 0x00019fdc
ADD ESP,0x21c
POP EBX
POP ESI
POP EDI
POP EBP
RET
MOV EDI,0x106
MOV EAX,0xff
MOV EDX,0xffffffff
JMP 0x00019f1b
MOV EAX,dword ptr [ESI + 0xc]
LEA ECX,[EBX + 0xfffca028]
MOV EDX,dword ptr [EAX]
PUSH 0x0
PUSH 0x1f40
PUSH ECX
PUSH EAX
CALL dword ptr [EDX + 0x4]
ADD ESP,0x10
JMP 0x00019f6e
MOV EDI,0x8
MOV EAX,0x1
MOV EDX,0x1
JMP 0x00019f1b
CALL 0x0006dad0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nundefined4 FUN_00019e90(int param_1)\n\n{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006dad0();\n}\n\n" comment (function_definition "undefined4 FUN_00019e90(int param_1)\n\n{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006dad0();\n}" type_identifier (function_declarator "FUN_00019e90(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  FUN_0006dad0();\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_222;" type_identifier identifier ;) (declaration "undefined2 local_21e;" type_identifier identifier ;) (declaration "undefined1 local_21c;" type_identifier identifier ;) (declaration "undefined1 local_21b [507];" type_identifier (array_declarator "local_21b [507]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x19e99;" (assignment_expression "uStack_14 = 0x19e99" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);" (assignment_expression "__s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" identifier = (cast_expression "(char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x74),0x10)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x74)" * (cast_expression "(undefined4 *)(param_1 + 0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x74)" ( (binary_expression "param_1 + 0x74" identifier + number_literal) )))) , number_literal ))))) ;) (expression_statement "pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);" (assignment_expression "pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" identifier = (cast_expression "(char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x74),0x11)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x74)" * (cast_expression "(undefined4 *)(param_1 + 0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x74)" ( (binary_expression "param_1 + 0x74" identifier + number_literal) )))) , number_literal ))))) ;) (if_statement "if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" if (parenthesized_expression "((*__s == '\0') && (*pcVar1 == '\0'))" ( (binary_expression "(*__s == '\0') && (*pcVar1 == '\0')" (parenthesized_expression "(*__s == '\0')" ( (binary_expression "*__s == '\0'" (pointer_expression "*__s" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) && (parenthesized_expression "(*pcVar1 == '\0')" ( (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }" { (expression_statement "(**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);" (call_expression "(**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (parenthesized_expression "(**(code **)(**(int **)(param_1 + 0xc) + 4))" ( (pointer_expression "**(code **)(**(int **)(param_1 + 0xc) + 4)" * (pointer_expression "*(code **)(**(int **)(param_1 + 0xc) + 4)" * (cast_expression "(code **)(**(int **)(param_1 + 0xc) + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(param_1 + 0xc) + 4)" ( (binary_expression "**(int **)(param_1 + 0xc) + 4" (pointer_expression "**(int **)(param_1 + 0xc)" * (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" ( (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) , (string_literal ""Proxy error: Server chose CHAP authentication but we didn\'t offer it!"" " string_content escape_sequence string_content ") , number_literal , number_literal ))) ;) }) (else_clause "else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" else (compound_statement "{\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" { (expression_statement "local_222 = 0x1110201;" (assignment_expression "local_222 = 0x1110201" identifier = number_literal) ;) (expression_statement "local_21e = 0x285;" (assignment_expression "local_21e = 0x285" identifier = number_literal) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (if_statement "if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" if (parenthesized_expression "(sVar2 < 0x100)" ( (binary_expression "sVar2 < 0x100" identifier < number_literal) )) (compound_statement "{\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }" { (if_statement "if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }" { (expression_statement "iVar3 = 8;" (assignment_expression "iVar3 = 8" identifier = number_literal) ;) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) (expression_statement "local_21c = 1;" (assignment_expression "local_21c = 1" identifier = number_literal) ;) }) (else_clause "else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" else (compound_statement "{\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" { (expression_statement "local_21c = (undefined1)sVar2;" (assignment_expression "local_21c = (undefined1)sVar2" identifier = (cast_expression "(undefined1)sVar2" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "iVar3 = sVar2 + 7;" (assignment_expression "iVar3 = sVar2 + 7" identifier = (binary_expression "sVar2 + 7" identifier + number_literal)) ;) }))) }) (else_clause "else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" else (compound_statement "{\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" { (expression_statement "iVar3 = 0x106;" (assignment_expression "iVar3 = 0x106" identifier = number_literal) ;) (expression_statement "sVar2 = 0xff;" (assignment_expression "sVar2 = 0xff" identifier = number_literal) ;) (expression_statement "local_21c = 0xff;" (assignment_expression "local_21c = 0xff" identifier = number_literal) ;) }))) (expression_statement "__memcpy_chk(local_21b,__s,sVar2,0x1fb);" (call_expression "__memcpy_chk(local_21b,__s,sVar2,0x1fb)" identifier (argument_list "(local_21b,__s,sVar2,0x1fb)" ( identifier , identifier , identifier , number_literal ))) ;) (expression_statement "(**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);" (call_expression "(**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3)" (parenthesized_expression "(**(code **)(**(int **)(param_1 + 8) + 8))" ( (pointer_expression "**(code **)(**(int **)(param_1 + 8) + 8)" * (pointer_expression "*(code **)(**(int **)(param_1 + 8) + 8)" * (cast_expression "(code **)(**(int **)(param_1 + 8) + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(param_1 + 8) + 8)" ( (binary_expression "**(int **)(param_1 + 8) + 8" (pointer_expression "**(int **)(param_1 + 8)" * (pointer_expression "*(int **)(param_1 + 8)" * (cast_expression "(int **)(param_1 + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(int **)(param_1 + 8),&local_222,iVar3)" ( (pointer_expression "*(int **)(param_1 + 8)" * (cast_expression "(int **)(param_1 + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (pointer_expression "&local_222" & identifier) , identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x78) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x78) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x78)" * (cast_expression "(undefined4 *)(param_1 + 0x78)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x78)" ( (binary_expression "param_1 + 0x78" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x7c) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x7c) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x7c)" * (cast_expression "(undefined4 *)(param_1 + 0x7c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x7c)" ( (binary_expression "param_1 + 0x7c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x80) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0x80) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0x80)" * (cast_expression "(undefined4 *)(param_1 + 0x80)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x80)" ( (binary_expression "param_1 + 0x80" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x84) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x84) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x84)" * (cast_expression "(undefined4 *)(param_1 + 0x84)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x84)" ( (binary_expression "param_1 + 0x84" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x44) = 8;" (assignment_expression "*(undefined4 *)(param_1 + 0x44) = 8" (pointer_expression "*(undefined4 *)(param_1 + 0x44)" * (cast_expression "(undefined4 *)(param_1 + 0x44)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x44)" ( (binary_expression "param_1 + 0x44" identifier + number_literal) )))) = number_literal) ;) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) comment (expression_statement "FUN_0006dad0();" (call_expression "FUN_0006dad0()" 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/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nint proxy_socks5_selectchap(Proxy_Socket p)\n\n{\n  int iVar1;\n  char *__s;\n  char *pcVar2;\n  size_t sVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  char chapbuf [514];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = conf_get_str(p->conf,0x10);\n  pcVar2 = conf_get_str(p->conf,0x11);\n  if ((*__s == '\0') && (*pcVar2 == '\0')) {\n    (*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0);\n  }\n  else {\n    chapbuf[0] = '\x01';\n    chapbuf[1] = '\x02';\n    chapbuf[2] = '\x11';\n    chapbuf[3] = '\x01';\n    chapbuf[4] = -0x7b;\n    chapbuf[5] = '\x02';\n    sVar3 = strlen(__s);\n    if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }\n    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);\n    p->chap_num_attributes = 0;\n    p->chap_num_attributes_processed = 0;\n    p->chap_current_attribute = -1;\n    p->chap_current_datalen = 0;\n    p->state = 8;\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}\n\n" comment comment comment (function_definition "int proxy_socks5_selectchap(Proxy_Socket p)\n\n{\n  int iVar1;\n  char *__s;\n  char *pcVar2;\n  size_t sVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  char chapbuf [514];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = conf_get_str(p->conf,0x10);\n  pcVar2 = conf_get_str(p->conf,0x11);\n  if ((*__s == '\0') && (*pcVar2 == '\0')) {\n    (*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0);\n  }\n  else {\n    chapbuf[0] = '\x01';\n    chapbuf[1] = '\x02';\n    chapbuf[2] = '\x11';\n    chapbuf[3] = '\x01';\n    chapbuf[4] = -0x7b;\n    chapbuf[5] = '\x02';\n    sVar3 = strlen(__s);\n    if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }\n    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);\n    p->chap_num_attributes = 0;\n    p->chap_num_attributes_processed = 0;\n    p->chap_current_attribute = -1;\n    p->chap_current_datalen = 0;\n    p->state = 8;\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" primitive_type (function_declarator "proxy_socks5_selectchap(Proxy_Socket p)" identifier (parameter_list "(Proxy_Socket p)" ( (parameter_declaration "Proxy_Socket p" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  char *__s;\n  char *pcVar2;\n  size_t sVar3;\n  int iVar4;\n  int in_GS_OFFSET;\n  char chapbuf [514];\n  \n  iVar1 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = conf_get_str(p->conf,0x10);\n  pcVar2 = conf_get_str(p->conf,0x11);\n  if ((*__s == '\0') && (*pcVar2 == '\0')) {\n    (*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0);\n  }\n  else {\n    chapbuf[0] = '\x01';\n    chapbuf[1] = '\x02';\n    chapbuf[2] = '\x11';\n    chapbuf[3] = '\x01';\n    chapbuf[4] = -0x7b;\n    chapbuf[5] = '\x02';\n    sVar3 = strlen(__s);\n    if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }\n    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);\n    p->chap_num_attributes = 0;\n    p->chap_num_attributes_processed = 0;\n    p->chap_current_attribute = -1;\n    p->chap_current_datalen = 0;\n    p->state = 8;\n  }\n  if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail_local();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "size_t sVar3;" primitive_type identifier ;) (declaration "int iVar4;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "char chapbuf [514];" primitive_type (array_declarator "chapbuf [514]" identifier [ number_literal ]) ;) (expression_statement "iVar1 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "iVar1 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__s = conf_get_str(p->conf,0x10);" (assignment_expression "__s = conf_get_str(p->conf,0x10)" identifier = (call_expression "conf_get_str(p->conf,0x10)" identifier (argument_list "(p->conf,0x10)" ( (field_expression "p->conf" identifier -> field_identifier) , number_literal )))) ;) (expression_statement "pcVar2 = conf_get_str(p->conf,0x11);" (assignment_expression "pcVar2 = conf_get_str(p->conf,0x11)" identifier = (call_expression "conf_get_str(p->conf,0x11)" identifier (argument_list "(p->conf,0x11)" ( (field_expression "p->conf" identifier -> field_identifier) , number_literal )))) ;) (if_statement "if ((*__s == '\0') && (*pcVar2 == '\0')) {\n    (*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0);\n  }\n  else {\n    chapbuf[0] = '\x01';\n    chapbuf[1] = '\x02';\n    chapbuf[2] = '\x11';\n    chapbuf[3] = '\x01';\n    chapbuf[4] = -0x7b;\n    chapbuf[5] = '\x02';\n    sVar3 = strlen(__s);\n    if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }\n    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);\n    p->chap_num_attributes = 0;\n    p->chap_num_attributes_processed = 0;\n    p->chap_current_attribute = -1;\n    p->chap_current_datalen = 0;\n    p->state = 8;\n  }" if (parenthesized_expression "((*__s == '\0') && (*pcVar2 == '\0'))" ( (binary_expression "(*__s == '\0') && (*pcVar2 == '\0')" (parenthesized_expression "(*__s == '\0')" ( (binary_expression "*__s == '\0'" (pointer_expression "*__s" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) && (parenthesized_expression "(*pcVar2 == '\0')" ( (binary_expression "*pcVar2 == '\0'" (pointer_expression "*pcVar2" * identifier) == (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    (*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0);\n  }" { (expression_statement "(*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0);" (call_expression "(*(*p->plug)->closing)\n              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0)" (parenthesized_expression "(*(*p->plug)->closing)" ( (pointer_expression "*(*p->plug)->closing" * (field_expression "(*p->plug)->closing" (parenthesized_expression "(*p->plug)" ( (pointer_expression "*p->plug" * (field_expression "p->plug" identifier -> field_identifier)) )) -> field_identifier)) )) (argument_list "(p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000\n               ,0)" ( (field_expression "p->plug" identifier -> field_identifier) , (string_literal ""Proxy error: Server chose CHAP authentication but we didn\'t offer it!"" " string_content escape_sequence string_content ") , number_literal , number_literal ))) ;) }) (else_clause "else {\n    chapbuf[0] = '\x01';\n    chapbuf[1] = '\x02';\n    chapbuf[2] = '\x11';\n    chapbuf[3] = '\x01';\n    chapbuf[4] = -0x7b;\n    chapbuf[5] = '\x02';\n    sVar3 = strlen(__s);\n    if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }\n    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);\n    p->chap_num_attributes = 0;\n    p->chap_num_attributes_processed = 0;\n    p->chap_current_attribute = -1;\n    p->chap_current_datalen = 0;\n    p->state = 8;\n  }" else (compound_statement "{\n    chapbuf[0] = '\x01';\n    chapbuf[1] = '\x02';\n    chapbuf[2] = '\x11';\n    chapbuf[3] = '\x01';\n    chapbuf[4] = -0x7b;\n    chapbuf[5] = '\x02';\n    sVar3 = strlen(__s);\n    if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }\n    __memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);\n    p->chap_num_attributes = 0;\n    p->chap_num_attributes_processed = 0;\n    p->chap_current_attribute = -1;\n    p->chap_current_datalen = 0;\n    p->state = 8;\n  }" { (expression_statement "chapbuf[0] = '\x01';" (assignment_expression "chapbuf[0] = '\x01'" (subscript_expression "chapbuf[0]" identifier [ number_literal ]) = (char_literal "'\x01'" ' escape_sequence ')) ;) (expression_statement "chapbuf[1] = '\x02';" (assignment_expression "chapbuf[1] = '\x02'" (subscript_expression "chapbuf[1]" identifier [ number_literal ]) = (char_literal "'\x02'" ' escape_sequence ')) ;) (expression_statement "chapbuf[2] = '\x11';" (assignment_expression "chapbuf[2] = '\x11'" (subscript_expression "chapbuf[2]" identifier [ number_literal ]) = (char_literal "'\x11'" ' escape_sequence ')) ;) (expression_statement "chapbuf[3] = '\x01';" (assignment_expression "chapbuf[3] = '\x01'" (subscript_expression "chapbuf[3]" identifier [ number_literal ]) = (char_literal "'\x01'" ' escape_sequence ')) ;) (expression_statement "chapbuf[4] = -0x7b;" (assignment_expression "chapbuf[4] = -0x7b" (subscript_expression "chapbuf[4]" identifier [ number_literal ]) = number_literal) ;) (expression_statement "chapbuf[5] = '\x02';" (assignment_expression "chapbuf[5] = '\x02'" (subscript_expression "chapbuf[5]" identifier [ number_literal ]) = (char_literal "'\x02'" ' escape_sequence ')) ;) (expression_statement "sVar3 = strlen(__s);" (assignment_expression "sVar3 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (if_statement "if (sVar3 < 0x100) {\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }\n    else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }" if (parenthesized_expression "(sVar3 < 0x100)" ( (binary_expression "sVar3 < 0x100" identifier < number_literal) )) (compound_statement "{\n      if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }\n    }" { (if_statement "if (sVar3 == 0) {\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }\n      else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }" if (parenthesized_expression "(sVar3 == 0)" ( (binary_expression "sVar3 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar4 = 8;\n        sVar3 = 1;\n        chapbuf[6] = '\x01';\n      }" { (expression_statement "iVar4 = 8;" (assignment_expression "iVar4 = 8" identifier = number_literal) ;) (expression_statement "sVar3 = 1;" (assignment_expression "sVar3 = 1" identifier = number_literal) ;) (expression_statement "chapbuf[6] = '\x01';" (assignment_expression "chapbuf[6] = '\x01'" (subscript_expression "chapbuf[6]" identifier [ number_literal ]) = (char_literal "'\x01'" ' escape_sequence ')) ;) }) (else_clause "else {\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }" else (compound_statement "{\n        chapbuf[6] = (char)sVar3;\n        iVar4 = sVar3 + 7;\n      }" { (expression_statement "chapbuf[6] = (char)sVar3;" (assignment_expression "chapbuf[6] = (char)sVar3" (subscript_expression "chapbuf[6]" identifier [ number_literal ]) = (cast_expression "(char)sVar3" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "iVar4 = sVar3 + 7;" (assignment_expression "iVar4 = sVar3 + 7" identifier = (binary_expression "sVar3 + 7" identifier + number_literal)) ;) }))) }) (else_clause "else {\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }" else (compound_statement "{\n      iVar4 = 0x106;\n      sVar3 = 0xff;\n      chapbuf[6] = -1;\n    }" { (expression_statement "iVar4 = 0x106;" (assignment_expression "iVar4 = 0x106" identifier = number_literal) ;) (expression_statement "sVar3 = 0xff;" (assignment_expression "sVar3 = 0xff" identifier = number_literal) ;) (expression_statement "chapbuf[6] = -1;" (assignment_expression "chapbuf[6] = -1" (subscript_expression "chapbuf[6]" identifier [ number_literal ]) = number_literal) ;) }))) (expression_statement "__memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb);" (call_expression "__memcpy_chk(chapbuf + 7,__s,sVar3,0x1fb)" identifier (argument_list "(chapbuf + 7,__s,sVar3,0x1fb)" ( (binary_expression "chapbuf + 7" identifier + number_literal) , identifier , identifier , number_literal ))) ;) (expression_statement "(*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4);" (call_expression "(*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar4)" (parenthesized_expression "(*(*p->sub_socket)->write)" ( (pointer_expression "*(*p->sub_socket)->write" * (field_expression "(*p->sub_socket)->write" (parenthesized_expression "(*p->sub_socket)" ( (pointer_expression "*p->sub_socket" * (field_expression "p->sub_socket" identifier -> field_identifier)) )) -> field_identifier)) )) (argument_list "(p->sub_socket,chapbuf,iVar4)" ( (field_expression "p->sub_socket" identifier -> field_identifier) , identifier , identifier ))) ;) (expression_statement "p->chap_num_attributes = 0;" (assignment_expression "p->chap_num_attributes = 0" (field_expression "p->chap_num_attributes" identifier -> field_identifier) = number_literal) ;) (expression_statement "p->chap_num_attributes_processed = 0;" (assignment_expression "p->chap_num_attributes_processed = 0" (field_expression "p->chap_num_attributes_processed" identifier -> field_identifier) = number_literal) ;) (expression_statement "p->chap_current_attribute = -1;" (assignment_expression "p->chap_current_attribute = -1" (field_expression "p->chap_current_attribute" identifier -> field_identifier) = number_literal) ;) (expression_statement "p->chap_current_datalen = 0;" (assignment_expression "p->chap_current_datalen = 0" (field_expression "p->chap_current_datalen" identifier -> field_identifier) = number_literal) ;) (expression_statement "p->state = 8;" (assignment_expression "p->state = 8" (field_expression "p->state" identifier -> field_identifier) = number_literal) ;) }))) (if_statement "if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }" if (parenthesized_expression "(iVar1 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "iVar1 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "undefined4 FUN_00019e90(int param_1)\n\n{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    \n  FUN_0006dad0();\n}\n\n" (function_definition "undefined4 FUN_00019e90(int param_1)\n\n{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    \n  FUN_0006dad0();\n}" type_identifier (function_declarator "FUN_00019e90(int param_1)" identifier (parameter_list "(int param_1)" ( (parameter_declaration "int param_1" primitive_type identifier) ))) (compound_statement "{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    \n  FUN_0006dad0();\n}" { (declaration "char *__s;" primitive_type (pointer_declarator "*__s" * identifier) ;) (declaration "char *pcVar1;" primitive_type (pointer_declarator "*pcVar1" * identifier) ;) (declaration "size_t sVar2;" primitive_type identifier ;) (declaration "int iVar3;" primitive_type identifier ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "undefined4 local_222;" type_identifier identifier ;) (declaration "undefined2 local_21e;" type_identifier identifier ;) (declaration "undefined1 local_21c;" type_identifier identifier ;) (declaration "undefined1 local_21b [507];" type_identifier (array_declarator "local_21b [507]" identifier [ number_literal ]) ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x19e99;" (assignment_expression "uStack_14 = 0x19e99" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (expression_statement "__s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);" (assignment_expression "__s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" identifier = (cast_expression "(char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x74),0x10)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x74)" * (cast_expression "(undefined4 *)(param_1 + 0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x74)" ( (binary_expression "param_1 + 0x74" identifier + number_literal) )))) , number_literal ))))) ;) (expression_statement "pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);" (assignment_expression "pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" identifier = (cast_expression "(char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" identifier (argument_list "(*(undefined4 *)(param_1 + 0x74),0x11)" ( (pointer_expression "*(undefined4 *)(param_1 + 0x74)" * (cast_expression "(undefined4 *)(param_1 + 0x74)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x74)" ( (binary_expression "param_1 + 0x74" identifier + number_literal) )))) , number_literal ))))) ;) (if_statement "if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" if (parenthesized_expression "((*__s == '\0') && (*pcVar1 == '\0'))" ( (binary_expression "(*__s == '\0') && (*pcVar1 == '\0')" (parenthesized_expression "(*__s == '\0')" ( (binary_expression "*__s == '\0'" (pointer_expression "*__s" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) && (parenthesized_expression "(*pcVar1 == '\0')" ( (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" * identifier) == (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }" { (expression_statement "(**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);" (call_expression "(**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (parenthesized_expression "(**(code **)(**(int **)(param_1 + 0xc) + 4))" ( (pointer_expression "**(code **)(**(int **)(param_1 + 0xc) + 4)" * (pointer_expression "*(code **)(**(int **)(param_1 + 0xc) + 4)" * (cast_expression "(code **)(**(int **)(param_1 + 0xc) + 4)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(param_1 + 0xc) + 4)" ( (binary_expression "**(int **)(param_1 + 0xc) + 4" (pointer_expression "**(int **)(param_1 + 0xc)" * (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" ( (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) , (string_literal ""Proxy error: Server chose CHAP authentication but we didn\'t offer it!"" " string_content escape_sequence string_content ") , number_literal , number_literal ))) ;) }) (else_clause "else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" else (compound_statement "{\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" { (expression_statement "local_222 = 0x1110201;" (assignment_expression "local_222 = 0x1110201" identifier = number_literal) ;) (expression_statement "local_21e = 0x285;" (assignment_expression "local_21e = 0x285" identifier = number_literal) ;) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" identifier = (call_expression "strlen(__s)" identifier (argument_list "(__s)" ( identifier )))) ;) (if_statement "if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" if (parenthesized_expression "(sVar2 < 0x100)" ( (binary_expression "sVar2 < 0x100" identifier < number_literal) )) (compound_statement "{\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }" { (if_statement "if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" if (parenthesized_expression "(sVar2 == 0)" ( (binary_expression "sVar2 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }" { (expression_statement "iVar3 = 8;" (assignment_expression "iVar3 = 8" identifier = number_literal) ;) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" identifier = number_literal) ;) (expression_statement "local_21c = 1;" (assignment_expression "local_21c = 1" identifier = number_literal) ;) }) (else_clause "else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" else (compound_statement "{\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" { (expression_statement "local_21c = (undefined1)sVar2;" (assignment_expression "local_21c = (undefined1)sVar2" identifier = (cast_expression "(undefined1)sVar2" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "iVar3 = sVar2 + 7;" (assignment_expression "iVar3 = sVar2 + 7" identifier = (binary_expression "sVar2 + 7" identifier + number_literal)) ;) }))) }) (else_clause "else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" else (compound_statement "{\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" { (expression_statement "iVar3 = 0x106;" (assignment_expression "iVar3 = 0x106" identifier = number_literal) ;) (expression_statement "sVar2 = 0xff;" (assignment_expression "sVar2 = 0xff" identifier = number_literal) ;) (expression_statement "local_21c = 0xff;" (assignment_expression "local_21c = 0xff" identifier = number_literal) ;) }))) (expression_statement "__memcpy_chk(local_21b,__s,sVar2,0x1fb);" (call_expression "__memcpy_chk(local_21b,__s,sVar2,0x1fb)" identifier (argument_list "(local_21b,__s,sVar2,0x1fb)" ( identifier , identifier , identifier , number_literal ))) ;) (expression_statement "(**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);" (call_expression "(**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3)" (parenthesized_expression "(**(code **)(**(int **)(param_1 + 8) + 8))" ( (pointer_expression "**(code **)(**(int **)(param_1 + 8) + 8)" * (pointer_expression "*(code **)(**(int **)(param_1 + 8) + 8)" * (cast_expression "(code **)(**(int **)(param_1 + 8) + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(int **)(param_1 + 8) + 8)" ( (binary_expression "**(int **)(param_1 + 8) + 8" (pointer_expression "**(int **)(param_1 + 8)" * (pointer_expression "*(int **)(param_1 + 8)" * (cast_expression "(int **)(param_1 + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(int **)(param_1 + 8),&local_222,iVar3)" ( (pointer_expression "*(int **)(param_1 + 8)" * (cast_expression "(int **)(param_1 + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) , (pointer_expression "&local_222" & identifier) , identifier ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0x78) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x78) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x78)" * (cast_expression "(undefined4 *)(param_1 + 0x78)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x78)" ( (binary_expression "param_1 + 0x78" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x7c) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x7c) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x7c)" * (cast_expression "(undefined4 *)(param_1 + 0x7c)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x7c)" ( (binary_expression "param_1 + 0x7c" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x80) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0x80) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0x80)" * (cast_expression "(undefined4 *)(param_1 + 0x80)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x80)" ( (binary_expression "param_1 + 0x80" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x84) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x84) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x84)" * (cast_expression "(undefined4 *)(param_1 + 0x84)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x84)" ( (binary_expression "param_1 + 0x84" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x44) = 8;" (assignment_expression "*(undefined4 *)(param_1 + 0x44) = 8" (pointer_expression "*(undefined4 *)(param_1 + 0x44)" * (cast_expression "(undefined4 *)(param_1 + 0x44)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x44)" ( (binary_expression "param_1 + 0x44" identifier + number_literal) )))) = number_literal) ;) }))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }" if (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" identifier == (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "FUN_0006dad0();" (call_expression "FUN_0006dad0()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (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 (array_declarator IDENT [ LIT ]) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (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 = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , LIT ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , LIT ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' escape_sequence ')) )) && (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == (char_literal ' escape_sequence ')) ))) )) (compound_statement { (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + LIT) ))))) )) (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (string_literal " string_content escape_sequence string_content ") , LIT , LIT ))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) }))) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) }))) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , LIT ))) ;) (expression_statement (call_expression (parenthesized_expression ( (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression (pointer_expression * (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + LIT) ))))) )) (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression & IDENT) , IDENT ))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) }))) (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 LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "undefined4 FUN_00019e90(int param_1)\n\n{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    \n  FUN_0006dad0();\n}" (type_identifier "undefined4") (function_declarator "FUN_00019e90(int param_1)" (identifier "FUN_00019e90") (parameter_list "(int param_1)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) () ")"))) (compound_statement "{\n  char *__s;\n  char *pcVar1;\n  size_t sVar2;\n  int iVar3;\n  int in_GS_OFFSET;\n  undefined4 local_222;\n  undefined2 local_21e;\n  undefined1 local_21c;\n  undefined1 local_21b [507];\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x19e99;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);\n  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);\n  if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }\n  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }\n                    \n  FUN_0006dad0();\n}" ({ "{") (declaration "char *__s;" (primitive_type "char") (pointer_declarator "*__s" (* "*") (identifier "__s")) (; ";")) (declaration "char *pcVar1;" (primitive_type "char") (pointer_declarator "*pcVar1" (* "*") (identifier "pcVar1")) (; ";")) (declaration "size_t sVar2;" (primitive_type "size_t") (identifier "sVar2") (; ";")) (declaration "int iVar3;" (primitive_type "int") (identifier "iVar3") (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "undefined4 local_222;" (type_identifier "undefined4") (identifier "local_222") (; ";")) (declaration "undefined2 local_21e;" (type_identifier "undefined2") (identifier "local_21e") (; ";")) (declaration "undefined1 local_21c;" (type_identifier "undefined1") (identifier "local_21c") (; ";")) (declaration "undefined1 local_21b [507];" (type_identifier "undefined1") (array_declarator "local_21b [507]" (identifier "local_21b") ([ "[") (number_literal "507") (] "]")) (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x19e99;" (assignment_expression "uStack_14 = 0x19e99" (identifier "uStack_14") (= "=") (number_literal "0x19e99")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (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 "__s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);" (assignment_expression "__s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" (identifier "__s") (= "=") (cast_expression "(char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10)" (identifier "FUN_00018b50") (argument_list "(*(undefined4 *)(param_1 + 0x74),0x10)" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x74)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x74)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x74)" (( "(") (binary_expression "param_1 + 0x74" (identifier "param_1") (+ "+") (number_literal "0x74")) () ")")))) (, ",") (number_literal "0x10") () ")"))))) (; ";")) (expression_statement "pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);" (assignment_expression "pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" (identifier "pcVar1") (= "=") (cast_expression "(char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11)" (identifier "FUN_00018b50") (argument_list "(*(undefined4 *)(param_1 + 0x74),0x11)" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x74)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x74)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x74)" (( "(") (binary_expression "param_1 + 0x74" (identifier "param_1") (+ "+") (number_literal "0x74")) () ")")))) (, ",") (number_literal "0x11") () ")"))))) (; ";")) (if_statement "if ((*__s == '\0') && (*pcVar1 == '\0')) {\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" (if "if") (parenthesized_expression "((*__s == '\0') && (*pcVar1 == '\0'))" (( "(") (binary_expression "(*__s == '\0') && (*pcVar1 == '\0')" (parenthesized_expression "(*__s == '\0')" (( "(") (binary_expression "*__s == '\0'" (pointer_expression "*__s" (* "*") (identifier "__s")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (&& "&&") (parenthesized_expression "(*pcVar1 == '\0')" (( "(") (binary_expression "*pcVar1 == '\0'" (pointer_expression "*pcVar1" (* "*") (identifier "pcVar1")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")"))) () ")")) (compound_statement "{\n    (**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }" ({ "{") (expression_statement "(**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);" (call_expression "(**(code **)(**(int **)(param_1 + 0xc) + 4))\n              (*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (parenthesized_expression "(**(code **)(**(int **)(param_1 + 0xc) + 4))" (( "(") (pointer_expression "**(code **)(**(int **)(param_1 + 0xc) + 4)" (* "*") (pointer_expression "*(code **)(**(int **)(param_1 + 0xc) + 4)" (* "*") (cast_expression "(code **)(**(int **)(param_1 + 0xc) + 4)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(**(int **)(param_1 + 0xc) + 4)" (( "(") (binary_expression "**(int **)(param_1 + 0xc) + 4" (pointer_expression "**(int **)(param_1 + 0xc)" (* "*") (pointer_expression "*(int **)(param_1 + 0xc)" (* "*") (cast_expression "(int **)(param_1 + 0xc)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) (+ "+") (number_literal "4")) () ")"))))) () ")")) (argument_list "(*(int **)(param_1 + 0xc),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (( "(") (pointer_expression "*(int **)(param_1 + 0xc)" (* "*") (cast_expression "(int **)(param_1 + 0xc)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (, ",") (string_literal ""Proxy error: Server chose CHAP authentication but we didn\'t offer it!"" (" """) (string_content "Proxy error: Server chose CHAP authentication but we didn") (escape_sequence "\'") (string_content "t offer it!") (" """)) (, ",") (number_literal "8000") (, ",") (number_literal "0") () ")"))) (; ";")) (} "}")) (else_clause "else {\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" (else "else") (compound_statement "{\n    local_222 = 0x1110201;\n    local_21e = 0x285;\n    sVar2 = strlen(__s);\n    if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }\n    __memcpy_chk(local_21b,__s,sVar2,0x1fb);\n    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);\n    *(undefined4 *)(param_1 + 0x78) = 0;\n    *(undefined4 *)(param_1 + 0x7c) = 0;\n    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0x84) = 0;\n    *(undefined4 *)(param_1 + 0x44) = 8;\n  }" ({ "{") (expression_statement "local_222 = 0x1110201;" (assignment_expression "local_222 = 0x1110201" (identifier "local_222") (= "=") (number_literal "0x1110201")) (; ";")) (expression_statement "local_21e = 0x285;" (assignment_expression "local_21e = 0x285" (identifier "local_21e") (= "=") (number_literal "0x285")) (; ";")) (expression_statement "sVar2 = strlen(__s);" (assignment_expression "sVar2 = strlen(__s)" (identifier "sVar2") (= "=") (call_expression "strlen(__s)" (identifier "strlen") (argument_list "(__s)" (( "(") (identifier "__s") () ")")))) (; ";")) (if_statement "if (sVar2 < 0x100) {\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }\n    else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" (if "if") (parenthesized_expression "(sVar2 < 0x100)" (( "(") (binary_expression "sVar2 < 0x100" (identifier "sVar2") (< "<") (number_literal "0x100")) () ")")) (compound_statement "{\n      if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }\n    }" ({ "{") (if_statement "if (sVar2 == 0) {\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }\n      else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" (if "if") (parenthesized_expression "(sVar2 == 0)" (( "(") (binary_expression "sVar2 == 0" (identifier "sVar2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar3 = 8;\n        sVar2 = 1;\n        local_21c = 1;\n      }" ({ "{") (expression_statement "iVar3 = 8;" (assignment_expression "iVar3 = 8" (identifier "iVar3") (= "=") (number_literal "8")) (; ";")) (expression_statement "sVar2 = 1;" (assignment_expression "sVar2 = 1" (identifier "sVar2") (= "=") (number_literal "1")) (; ";")) (expression_statement "local_21c = 1;" (assignment_expression "local_21c = 1" (identifier "local_21c") (= "=") (number_literal "1")) (; ";")) (} "}")) (else_clause "else {\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" (else "else") (compound_statement "{\n        local_21c = (undefined1)sVar2;\n        iVar3 = sVar2 + 7;\n      }" ({ "{") (expression_statement "local_21c = (undefined1)sVar2;" (assignment_expression "local_21c = (undefined1)sVar2" (identifier "local_21c") (= "=") (cast_expression "(undefined1)sVar2" (( "(") (type_descriptor "undefined1" (type_identifier "undefined1")) () ")") (identifier "sVar2"))) (; ";")) (expression_statement "iVar3 = sVar2 + 7;" (assignment_expression "iVar3 = sVar2 + 7" (identifier "iVar3") (= "=") (binary_expression "sVar2 + 7" (identifier "sVar2") (+ "+") (number_literal "7"))) (; ";")) (} "}")))) (} "}")) (else_clause "else {\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" (else "else") (compound_statement "{\n      iVar3 = 0x106;\n      sVar2 = 0xff;\n      local_21c = 0xff;\n    }" ({ "{") (expression_statement "iVar3 = 0x106;" (assignment_expression "iVar3 = 0x106" (identifier "iVar3") (= "=") (number_literal "0x106")) (; ";")) (expression_statement "sVar2 = 0xff;" (assignment_expression "sVar2 = 0xff" (identifier "sVar2") (= "=") (number_literal "0xff")) (; ";")) (expression_statement "local_21c = 0xff;" (assignment_expression "local_21c = 0xff" (identifier "local_21c") (= "=") (number_literal "0xff")) (; ";")) (} "}")))) (expression_statement "__memcpy_chk(local_21b,__s,sVar2,0x1fb);" (call_expression "__memcpy_chk(local_21b,__s,sVar2,0x1fb)" (identifier "__memcpy_chk") (argument_list "(local_21b,__s,sVar2,0x1fb)" (( "(") (identifier "local_21b") (, ",") (identifier "__s") (, ",") (identifier "sVar2") (, ",") (number_literal "0x1fb") () ")"))) (; ";")) (expression_statement "(**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);" (call_expression "(**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3)" (parenthesized_expression "(**(code **)(**(int **)(param_1 + 8) + 8))" (( "(") (pointer_expression "**(code **)(**(int **)(param_1 + 8) + 8)" (* "*") (pointer_expression "*(code **)(**(int **)(param_1 + 8) + 8)" (* "*") (cast_expression "(code **)(**(int **)(param_1 + 8) + 8)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(**(int **)(param_1 + 8) + 8)" (( "(") (binary_expression "**(int **)(param_1 + 8) + 8" (pointer_expression "**(int **)(param_1 + 8)" (* "*") (pointer_expression "*(int **)(param_1 + 8)" (* "*") (cast_expression "(int **)(param_1 + 8)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (+ "+") (number_literal "8")) () ")"))))) () ")")) (argument_list "(*(int **)(param_1 + 8),&local_222,iVar3)" (( "(") (pointer_expression "*(int **)(param_1 + 8)" (* "*") (cast_expression "(int **)(param_1 + 8)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (, ",") (pointer_expression "&local_222" (& "&") (identifier "local_222")) (, ",") (identifier "iVar3") () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x78) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x78) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x78)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x78)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x78)" (( "(") (binary_expression "param_1 + 0x78" (identifier "param_1") (+ "+") (number_literal "0x78")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x7c) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x7c) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x7c)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x7c)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x7c)" (( "(") (binary_expression "param_1 + 0x7c" (identifier "param_1") (+ "+") (number_literal "0x7c")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x80) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0x80) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0x80)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x80)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x80)" (( "(") (binary_expression "param_1 + 0x80" (identifier "param_1") (+ "+") (number_literal "0x80")) () ")")))) (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x84) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x84) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x84)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x84)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x84)" (( "(") (binary_expression "param_1 + 0x84" (identifier "param_1") (+ "+") (number_literal "0x84")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x44) = 8;" (assignment_expression "*(undefined4 *)(param_1 + 0x44) = 8" (pointer_expression "*(undefined4 *)(param_1 + 0x44)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x44)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x44)" (( "(") (binary_expression "param_1 + 0x44" (identifier "param_1") (+ "+") (number_literal "0x44")) () ")")))) (= "=") (number_literal "8")) (; ";")) (} "}")))) (if_statement "if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {\n    return 1;\n  }" (if "if") (parenthesized_expression "(local_20 == *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 == *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (== "==") (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 1;\n  }" ({ "{") (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "FUN_0006dad0();" (call_expression "FUN_0006dad0()" (identifier "FUN_0006dad0") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */
/* WARNING: Unknown calling convention */
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

int function_1(type_1 p)

{
  int var_7;
  char *__s;
  char *pcVar2;
  size_t var_4;
  int iVar4;
  int var_1;
  char var_6 [514];
  
  var_7 = *(int *)(var_1 + 0x14);
  __s = var_2(p->conf,0x10);
  pcVar2 = var_2(p->conf,0x11);
  if ((*__s == '\0') && (*pcVar2 == '\0')) {
    (*(*p->plug)->closing)
              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000
               ,0);
  }
  else {
    var_6[0] = '\x01';
    var_6[1] = '\x02';
    var_6[2] = '\x11';
    var_6[3] = '\x01';
    var_6[4] = -0x7b;
    var_6[5] = '\x02';
    var_4 = var_3(__s);
    if (var_4 < 0x100) {
      if (var_4 == 0) {
        iVar4 = 8;
        var_4 = 1;
        var_6[6] = '\x01';
      }
      else {
        var_6[6] = (char)var_4;
        iVar4 = var_4 + 7;
      }
    }
    else {
      iVar4 = 0x106;
      var_4 = 0xff;
      var_6[6] = -1;
    }
    var_5(var_6 + 7,__s,var_4,0x1fb);
    (*(*p->sub_socket)->write)(p->sub_socket,var_6,iVar4);
    p->chap_num_attributes = 0;
    p->chap_num_attributes_processed = 0;
    p->chap_current_attribute = -1;
    p->chap_current_datalen = 0;
    p->state = 8;
  }
  if (var_7 == *(int *)(var_1 + 0x14)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  var_8();
}


(translation_unit (function_definition type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (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: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (declaration type: (type_identifier) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (declaration type: (primitive_type) declarator: (identifier)) (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (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: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (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))))) (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (call_expression function: (identifier) arguments: (argument_list (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))))) (number_literal)))))) (if_statement condition: (parenthesized_expression (binary_expression left: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (escape_sequence)))) right: (parenthesized_expression (binary_expression left: (pointer_expression argument: (identifier)) right: (char_literal (escape_sequence)))))) consequence: (compound_statement (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal))))))) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (string_literal (string_content) (escape_sequence) (string_content)) (number_literal) (number_literal))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (type_identifier)) value: (identifier)))) (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (number_literal)))))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (number_literal)))) (expression_statement (call_expression function: (parenthesized_expression (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (pointer_expression argument: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))))) right: (number_literal))))))) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator declarator: (abstract_pointer_declarator))) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) (pointer_expression argument: (identifier)) (identifier)))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (type_identifier) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (number_literal)))))) (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 (number_literal)))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

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

undefined4 MASKED(int param_1)

{
  char *__s;
  char *pcVar1;
  size_t sVar2;
  int iVar3;
  int in_GS_OFFSET;
  undefined4 local_222;
  undefined2 local_21e;
  undefined1 local_21c;
  undefined1 local_21b [507];
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x19e99;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  __s = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x10);
  pcVar1 = (char *)FUN_00018b50(*(undefined4 *)(param_1 + 0x74),0x11);
  if ((*__s == '\0') && (*pcVar1 == '\0')) {
    (**(code **)(**(int **)(param_1 + 0xc) + 4))
              (*(int **)(param_1 + 0xc),
               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);
  }
  else {
    local_222 = 0x1110201;
    local_21e = 0x285;
    sVar2 = strlen(__s);
    if (sVar2 < 0x100) {
      if (sVar2 == 0) {
        iVar3 = 8;
        sVar2 = 1;
        local_21c = 1;
      }
      else {
        local_21c = (undefined1)sVar2;
        iVar3 = sVar2 + 7;
      }
    }
    else {
      iVar3 = 0x106;
      sVar2 = 0xff;
      local_21c = 0xff;
    }
    __memcpy_chk(local_21b,__s,sVar2,0x1fb);
    (**(code **)(**(int **)(param_1 + 8) + 8))(*(int **)(param_1 + 8),&local_222,iVar3);
    *(undefined4 *)(param_1 + 0x78) = 0;
    *(undefined4 *)(param_1 + 0x7c) = 0;
    *(undefined4 *)(param_1 + 0x80) = 0xffffffff;
    *(undefined4 *)(param_1 + 0x84) = 0;
    *(undefined4 *)(param_1 + 0x44) = 8;
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  FUN_0006dad0();
}

