
/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

int proxy_socks5_selectchap(Proxy_Socket p)

{
  char cVar1;
  long lVar2;
  char *pcVar3;
  char *pcVar4;
  long lVar5;
  int iVar6;
  long in_FS_OFFSET;
  byte bVar7;
  char chapbuf [514];
  
  bVar7 = 0;
  lVar2 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar3 = conf_get_str(p->conf,0x10);
  pcVar4 = conf_get_str(p->conf,0x11);
  if ((*pcVar3 == '\0') && (*pcVar4 == '\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';
    lVar5 = -1;
    pcVar4 = pcVar3;
    do {
      if (lVar5 == 0) break;
      lVar5 = lVar5 + -1;
      cVar1 = *pcVar4;
      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;
    } while (cVar1 != '\0');
    iVar6 = ~(uint)lVar5 - 1;
    if (iVar6 < 1) {
      iVar6 = 1;
    }
    if (0xff < iVar6) {
      iVar6 = 0xff;
    }
    chapbuf[6] = (char)iVar6;
    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);
    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);
    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 (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}



undefined8 FUN_0010c780(long param_1)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  long lVar4;
  int iVar5;
  long in_FS_OFFSET;
  byte bVar6;
  undefined1 local_238;
  undefined1 local_237;
  undefined1 local_236;
  undefined1 local_235;
  undefined1 local_234;
  undefined1 local_233;
  undefined1 local_232;
  undefined1 local_231 [513];
  long local_30;
  
  bVar6 = 0;
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);
  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);
  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {
    (**(code **)(**(long **)(param_1 + 0x18) + 8))
              (*(long **)(param_1 + 0x18),
               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);
  }
  else {
    local_238 = 1;
    local_237 = 2;
    local_236 = 0x11;
    local_235 = 1;
    local_234 = 0x85;
    local_233 = 2;
    lVar4 = -1;
    pcVar3 = pcVar2;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      cVar1 = *pcVar3;
      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;
    } while (cVar1 != '\0');
    iVar5 = ~(uint)lVar4 - 1;
    if (iVar5 < 1) {
      iVar5 = 1;
    }
    if (0xff < iVar5) {
      iVar5 = 0xff;
    }
    local_232 = (undefined1)iVar5;
    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);
    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))
              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);
    *(undefined4 *)(param_1 + 0xd8) = 0;
    *(undefined4 *)(param_1 + 0xdc) = 0;
    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;
    *(undefined4 *)(param_1 + 0xe4) = 0;
    *(undefined4 *)(param_1 + 0x84) = 8;
  }
  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}


PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x210
MOV RBP,RDI
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x208],RAX
XOR EAX,EAX
MOV RDI,qword ptr [RDI + 0xd0]
MOV ESI,0x10
CALL 0x0010b453
MOV R12,RAX
MOV RDI,qword ptr [RBP + 0xd0]
MOV ESI,0x11
CALL 0x0010b453
CMP byte ptr [R12],0x0
JNZ 0x0010c7da
CMP byte ptr [RAX],0x0
JZ 0x0010c8af
MOV byte ptr [RSP],0x1
MOV byte ptr [RSP + 0x1],0x2
MOV byte ptr [RSP + 0x2],0x11
MOV byte ptr [RSP + 0x3],0x1
MOV byte ptr [RSP + 0x4],0x85
MOV byte ptr [RSP + 0x5],0x2
MOV R13,-0x1
MOV EAX,0x0
MOV RCX,R13
MOV RDI,R12
SCASB.REPNE RDI
MOV RAX,RCX
NOT RAX
LEA RBX,[RAX + R13*0x1]
TEST EBX,EBX
MOV EDX,0x1
CMOVLE EBX,EDX
CMP EBX,0xff
MOV EDX,0xff
CMOVG EBX,EDX
MOV byte ptr [RSP + 0x6],BL
MOVSXD RDX,EBX
MOV R14,RSP
LEA RDI,[R14 + 0x7]
MOV ECX,0x1fb
MOV RSI,R12
CALL 0x001084b0
MOV RDI,qword ptr [RBP + 0x10]
LEA EDX,[RBX + 0x7]
MOV RAX,qword ptr [RDI]
MOV RSI,R14
CALL qword ptr [RAX + 0x10]
MOV dword ptr [RBP + 0xd8],0x0
MOV dword ptr [RBP + 0xdc],0x0
MOV dword ptr [RBP + 0xe0],R13D
MOV dword ptr [RBP + 0xe4],0x0
MOV dword ptr [RBP + 0x84],0x8
MOV EAX,0x1
MOV RCX,qword ptr [RSP + 0x208]
XOR RCX,qword ptr FS:[0x28]
JNZ 0x0010c8cc
ADD RSP,0x210
POP RBX
POP RBP
POP R12
POP R13
POP R14
RET
MOV RDI,qword ptr [RBP + 0x18]
MOV RAX,qword ptr [RDI]
MOV ECX,0x0
MOV EDX,0x1f40
LEA RSI,[0x15de58]
CALL qword ptr [RAX + 0x8]
JMP 0x0010c887
CALL 0x00108280
(translation_unit "undefined8 FUN_0010c780(long param_1)\n\n{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "undefined8 FUN_0010c780(long param_1)\n\n{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" type_identifier (function_declarator "FUN_0010c780(long param_1)" identifier (parameter_list "(long param_1)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar6;" type_identifier identifier ;) (declaration "undefined1 local_238;" type_identifier identifier ;) (declaration "undefined1 local_237;" type_identifier identifier ;) (declaration "undefined1 local_236;" type_identifier identifier ;) (declaration "undefined1 local_235;" type_identifier identifier ;) (declaration "undefined1 local_234;" type_identifier identifier ;) (declaration "undefined1 local_233;" type_identifier identifier ;) (declaration "undefined1 local_232;" type_identifier identifier ;) (declaration "undefined1 local_231 [513];" type_identifier (array_declarator "local_231 [513]" identifier [ number_literal ]) ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar6 = 0;" (assignment_expression "bVar6 = 0" identifier = number_literal) ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);" (assignment_expression "pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" identifier = (cast_expression "(char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" identifier (argument_list "(*(undefined8 *)(param_1 + 0xd0),0x10)" ( (pointer_expression "*(undefined8 *)(param_1 + 0xd0)" * (cast_expression "(undefined8 *)(param_1 + 0xd0)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))) , number_literal ))))) ;) (expression_statement "pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);" (assignment_expression "pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" identifier = (cast_expression "(char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" identifier (argument_list "(*(undefined8 *)(param_1 + 0xd0),0x11)" ( (pointer_expression "*(undefined8 *)(param_1 + 0xd0)" * (cast_expression "(undefined8 *)(param_1 + 0xd0)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))) , number_literal ))))) ;) (if_statement "if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" if (parenthesized_expression "((*pcVar2 == '\0') && (*pcVar3 == '\0'))" ( (binary_expression "(*pcVar2 == '\0') && (*pcVar3 == '\0')" (parenthesized_expression "(*pcVar2 == '\0')" ( (binary_expression "*pcVar2 == '\0'" (pointer_expression "*pcVar2" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) && (parenthesized_expression "(*pcVar3 == '\0')" ( (binary_expression "*pcVar3 == '\0'" (pointer_expression "*pcVar3" * identifier) == (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }" { (expression_statement "(**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);" (call_expression "(**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (parenthesized_expression "(**(code **)(**(long **)(param_1 + 0x18) + 8))" ( (pointer_expression "**(code **)(**(long **)(param_1 + 0x18) + 8)" * (pointer_expression "*(code **)(**(long **)(param_1 + 0x18) + 8)" * (cast_expression "(code **)(**(long **)(param_1 + 0x18) + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(long **)(param_1 + 0x18) + 8)" ( (binary_expression "**(long **)(param_1 + 0x18) + 8" (pointer_expression "**(long **)(param_1 + 0x18)" * (pointer_expression "*(long **)(param_1 + 0x18)" * (cast_expression "(long **)(param_1 + 0x18)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" ( (pointer_expression "*(long **)(param_1 + 0x18)" * (cast_expression "(long **)(param_1 + 0x18)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" 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_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" else (compound_statement "{\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" { (expression_statement "local_238 = 1;" (assignment_expression "local_238 = 1" identifier = number_literal) ;) (expression_statement "local_237 = 2;" (assignment_expression "local_237 = 2" identifier = number_literal) ;) (expression_statement "local_236 = 0x11;" (assignment_expression "local_236 = 0x11" identifier = number_literal) ;) (expression_statement "local_235 = 1;" (assignment_expression "local_235 = 1" identifier = number_literal) ;) (expression_statement "local_234 = 0x85;" (assignment_expression "local_234 = 0x85" identifier = number_literal) ;) (expression_statement "local_233 = 2;" (assignment_expression "local_233 = 2" identifier = number_literal) ;) (expression_statement "lVar4 = -1;" (assignment_expression "lVar4 = -1" identifier = number_literal) ;) (expression_statement "pcVar3 = pcVar2;" (assignment_expression "pcVar3 = pcVar2" identifier = identifier) ;) (do_statement "do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');" do (compound_statement "{\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    }" { (if_statement "if (lVar4 == 0) break;" if (parenthesized_expression "(lVar4 == 0)" ( (binary_expression "lVar4 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar4 = lVar4 + -1;" (assignment_expression "lVar4 = lVar4 + -1" identifier = (binary_expression "lVar4 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" identifier = (pointer_expression "*pcVar3" * identifier)) ;) (expression_statement "pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;" (assignment_expression "pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1" identifier = (binary_expression "pcVar3 + (ulong)bVar6 * -2 + 1" (binary_expression "pcVar3 + (ulong)bVar6 * -2" identifier + (binary_expression "(ulong)bVar6 * -2" (cast_expression "(ulong)bVar6" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "iVar5 = ~(uint)lVar4 - 1;" (assignment_expression "iVar5 = ~(uint)lVar4 - 1" identifier = (binary_expression "~(uint)lVar4 - 1" (unary_expression "~(uint)lVar4" ~ (cast_expression "(uint)lVar4" ( (type_descriptor "uint" type_identifier) ) identifier)) - number_literal)) ;) (if_statement "if (iVar5 < 1) {\n      iVar5 = 1;\n    }" if (parenthesized_expression "(iVar5 < 1)" ( (binary_expression "iVar5 < 1" identifier < number_literal) )) (compound_statement "{\n      iVar5 = 1;\n    }" { (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" identifier = number_literal) ;) })) (if_statement "if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }" if (parenthesized_expression "(0xff < iVar5)" ( (binary_expression "0xff < iVar5" number_literal < identifier) )) (compound_statement "{\n      iVar5 = 0xff;\n    }" { (expression_statement "iVar5 = 0xff;" (assignment_expression "iVar5 = 0xff" identifier = number_literal) ;) })) (expression_statement "local_232 = (undefined1)iVar5;" (assignment_expression "local_232 = (undefined1)iVar5" identifier = (cast_expression "(undefined1)iVar5" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "__memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);" (call_expression "__memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb)" identifier (argument_list "(local_231,pcVar2,(long)iVar5,0x1fb)" ( identifier , identifier , (cast_expression "(long)iVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) , number_literal ))) ;) (expression_statement "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);" (call_expression "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7)" (parenthesized_expression "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))" ( (pointer_expression "**(code **)(**(long **)(param_1 + 0x10) + 0x10)" * (pointer_expression "*(code **)(**(long **)(param_1 + 0x10) + 0x10)" * (cast_expression "(code **)(**(long **)(param_1 + 0x10) + 0x10)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(long **)(param_1 + 0x10) + 0x10)" ( (binary_expression "**(long **)(param_1 + 0x10) + 0x10" (pointer_expression "**(long **)(param_1 + 0x10)" * (pointer_expression "*(long **)(param_1 + 0x10)" * (cast_expression "(long **)(param_1 + 0x10)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(long **)(param_1 + 0x10),&local_238,iVar5 + 7)" ( (pointer_expression "*(long **)(param_1 + 0x10)" * (cast_expression "(long **)(param_1 + 0x10)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) , (pointer_expression "&local_238" & identifier) , (binary_expression "iVar5 + 7" identifier + number_literal) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0xd8) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xd8) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xd8)" * (cast_expression "(undefined4 *)(param_1 + 0xd8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd8)" ( (binary_expression "param_1 + 0xd8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xdc) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xdc) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xdc)" * (cast_expression "(undefined4 *)(param_1 + 0xdc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xdc)" ( (binary_expression "param_1 + 0xdc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xe0) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0xe0) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0xe0)" * (cast_expression "(undefined4 *)(param_1 + 0xe0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xe0)" ( (binary_expression "param_1 + 0xe0" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xe4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xe4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xe4)" * (cast_expression "(undefined4 *)(param_1 + 0xe4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xe4)" ( (binary_expression "param_1 + 0xe4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x84) = 8;" (assignment_expression "*(undefined4 *)(param_1 + 0x84) = 8" (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) ;) }))) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }" if (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "/* WARNING: Enum "anon_enum_32": Some values do not have unique names */\n\nint proxy_socks5_selectchap(Proxy_Socket p)\n\n{\n  char cVar1;\n  long lVar2;\n  char *pcVar3;\n  char *pcVar4;\n  long lVar5;\n  int iVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char chapbuf [514];\n  \n  bVar7 = 0;\n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar3 = conf_get_str(p->conf,0x10);\n  pcVar4 = conf_get_str(p->conf,0x11);\n  if ((*pcVar3 == '\0') && (*pcVar4 == '\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    lVar5 = -1;\n    pcVar4 = pcVar3;\n    do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar6 = ~(uint)lVar5 - 1;\n    if (iVar6 < 1) {\n      iVar6 = 1;\n    }\n    if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }\n    chapbuf[6] = (char)iVar6;\n    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);\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 (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" comment (function_definition "int proxy_socks5_selectchap(Proxy_Socket p)\n\n{\n  char cVar1;\n  long lVar2;\n  char *pcVar3;\n  char *pcVar4;\n  long lVar5;\n  int iVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char chapbuf [514];\n  \n  bVar7 = 0;\n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar3 = conf_get_str(p->conf,0x10);\n  pcVar4 = conf_get_str(p->conf,0x11);\n  if ((*pcVar3 == '\0') && (*pcVar4 == '\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    lVar5 = -1;\n    pcVar4 = pcVar3;\n    do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar6 = ~(uint)lVar5 - 1;\n    if (iVar6 < 1) {\n      iVar6 = 1;\n    }\n    if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }\n    chapbuf[6] = (char)iVar6;\n    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);\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 (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\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  char cVar1;\n  long lVar2;\n  char *pcVar3;\n  char *pcVar4;\n  long lVar5;\n  int iVar6;\n  long in_FS_OFFSET;\n  byte bVar7;\n  char chapbuf [514];\n  \n  bVar7 = 0;\n  lVar2 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar3 = conf_get_str(p->conf,0x10);\n  pcVar4 = conf_get_str(p->conf,0x11);\n  if ((*pcVar3 == '\0') && (*pcVar4 == '\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    lVar5 = -1;\n    pcVar4 = pcVar3;\n    do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar6 = ~(uint)lVar5 - 1;\n    if (iVar6 < 1) {\n      iVar6 = 1;\n    }\n    if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }\n    chapbuf[6] = (char)iVar6;\n    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);\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 (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "long lVar2;" (sized_type_specifier "long" long) identifier ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "char *pcVar4;" primitive_type (pointer_declarator "*pcVar4" * identifier) ;) (declaration "long lVar5;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar6;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar7;" type_identifier identifier ;) (declaration "char chapbuf [514];" primitive_type (array_declarator "chapbuf [514]" identifier [ number_literal ]) ;) (expression_statement "bVar7 = 0;" (assignment_expression "bVar7 = 0" identifier = number_literal) ;) (expression_statement "lVar2 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar2 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "pcVar3 = conf_get_str(p->conf,0x10);" (assignment_expression "pcVar3 = 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 "pcVar4 = conf_get_str(p->conf,0x11);" (assignment_expression "pcVar4 = 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 ((*pcVar3 == '\0') && (*pcVar4 == '\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    lVar5 = -1;\n    pcVar4 = pcVar3;\n    do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar6 = ~(uint)lVar5 - 1;\n    if (iVar6 < 1) {\n      iVar6 = 1;\n    }\n    if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }\n    chapbuf[6] = (char)iVar6;\n    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);\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 "((*pcVar3 == '\0') && (*pcVar4 == '\0'))" ( (binary_expression "(*pcVar3 == '\0') && (*pcVar4 == '\0')" (parenthesized_expression "(*pcVar3 == '\0')" ( (binary_expression "*pcVar3 == '\0'" (pointer_expression "*pcVar3" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) && (parenthesized_expression "(*pcVar4 == '\0')" ( (binary_expression "*pcVar4 == '\0'" (pointer_expression "*pcVar4" * 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    lVar5 = -1;\n    pcVar4 = pcVar3;\n    do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar6 = ~(uint)lVar5 - 1;\n    if (iVar6 < 1) {\n      iVar6 = 1;\n    }\n    if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }\n    chapbuf[6] = (char)iVar6;\n    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);\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    lVar5 = -1;\n    pcVar4 = pcVar3;\n    do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar6 = ~(uint)lVar5 - 1;\n    if (iVar6 < 1) {\n      iVar6 = 1;\n    }\n    if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }\n    chapbuf[6] = (char)iVar6;\n    __memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);\n    (*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);\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 "lVar5 = -1;" (assignment_expression "lVar5 = -1" identifier = number_literal) ;) (expression_statement "pcVar4 = pcVar3;" (assignment_expression "pcVar4 = pcVar3" identifier = identifier) ;) (do_statement "do {\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    } while (cVar1 != '\0');" do (compound_statement "{\n      if (lVar5 == 0) break;\n      lVar5 = lVar5 + -1;\n      cVar1 = *pcVar4;\n      pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;\n    }" { (if_statement "if (lVar5 == 0) break;" if (parenthesized_expression "(lVar5 == 0)" ( (binary_expression "lVar5 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar5 = lVar5 + -1;" (assignment_expression "lVar5 = lVar5 + -1" identifier = (binary_expression "lVar5 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *pcVar4;" (assignment_expression "cVar1 = *pcVar4" identifier = (pointer_expression "*pcVar4" * identifier)) ;) (expression_statement "pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1;" (assignment_expression "pcVar4 = pcVar4 + (ulong)bVar7 * -2 + 1" identifier = (binary_expression "pcVar4 + (ulong)bVar7 * -2 + 1" (binary_expression "pcVar4 + (ulong)bVar7 * -2" identifier + (binary_expression "(ulong)bVar7 * -2" (cast_expression "(ulong)bVar7" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "iVar6 = ~(uint)lVar5 - 1;" (assignment_expression "iVar6 = ~(uint)lVar5 - 1" identifier = (binary_expression "~(uint)lVar5 - 1" (unary_expression "~(uint)lVar5" ~ (cast_expression "(uint)lVar5" ( (type_descriptor "uint" type_identifier) ) identifier)) - number_literal)) ;) (if_statement "if (iVar6 < 1) {\n      iVar6 = 1;\n    }" if (parenthesized_expression "(iVar6 < 1)" ( (binary_expression "iVar6 < 1" identifier < number_literal) )) (compound_statement "{\n      iVar6 = 1;\n    }" { (expression_statement "iVar6 = 1;" (assignment_expression "iVar6 = 1" identifier = number_literal) ;) })) (if_statement "if (0xff < iVar6) {\n      iVar6 = 0xff;\n    }" if (parenthesized_expression "(0xff < iVar6)" ( (binary_expression "0xff < iVar6" number_literal < identifier) )) (compound_statement "{\n      iVar6 = 0xff;\n    }" { (expression_statement "iVar6 = 0xff;" (assignment_expression "iVar6 = 0xff" identifier = number_literal) ;) })) (expression_statement "chapbuf[6] = (char)iVar6;" (assignment_expression "chapbuf[6] = (char)iVar6" (subscript_expression "chapbuf[6]" identifier [ number_literal ]) = (cast_expression "(char)iVar6" ( (type_descriptor "char" primitive_type) ) identifier)) ;) (expression_statement "__memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb);" (call_expression "__memcpy_chk(chapbuf + 7,pcVar3,(long)iVar6,0x1fb)" identifier (argument_list "(chapbuf + 7,pcVar3,(long)iVar6,0x1fb)" ( (binary_expression "chapbuf + 7" identifier + number_literal) , identifier , (cast_expression "(long)iVar6" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) , number_literal ))) ;) (expression_statement "(*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7);" (call_expression "(*(*p->sub_socket)->write)(p->sub_socket,chapbuf,iVar6 + 7)" (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,iVar6 + 7)" ( (field_expression "p->sub_socket" identifier -> field_identifier) , identifier , (binary_expression "iVar6 + 7" identifier + number_literal) ))) ;) (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 (lVar2 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }" if (parenthesized_expression "(lVar2 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar2 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "undefined8 FUN_0010c780(long param_1)\n\n{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    \n  __stack_chk_fail();\n}\n\n" (function_definition "undefined8 FUN_0010c780(long param_1)\n\n{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    \n  __stack_chk_fail();\n}" type_identifier (function_declarator "FUN_0010c780(long param_1)" identifier (parameter_list "(long param_1)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    \n  __stack_chk_fail();\n}" { (declaration "char cVar1;" primitive_type identifier ;) (declaration "char *pcVar2;" primitive_type (pointer_declarator "*pcVar2" * identifier) ;) (declaration "char *pcVar3;" primitive_type (pointer_declarator "*pcVar3" * identifier) ;) (declaration "long lVar4;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar5;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "byte bVar6;" type_identifier identifier ;) (declaration "undefined1 local_238;" type_identifier identifier ;) (declaration "undefined1 local_237;" type_identifier identifier ;) (declaration "undefined1 local_236;" type_identifier identifier ;) (declaration "undefined1 local_235;" type_identifier identifier ;) (declaration "undefined1 local_234;" type_identifier identifier ;) (declaration "undefined1 local_233;" type_identifier identifier ;) (declaration "undefined1 local_232;" type_identifier identifier ;) (declaration "undefined1 local_231 [513];" type_identifier (array_declarator "local_231 [513]" identifier [ number_literal ]) ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "bVar6 = 0;" (assignment_expression "bVar6 = 0" identifier = number_literal) ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);" (assignment_expression "pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" identifier = (cast_expression "(char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" identifier (argument_list "(*(undefined8 *)(param_1 + 0xd0),0x10)" ( (pointer_expression "*(undefined8 *)(param_1 + 0xd0)" * (cast_expression "(undefined8 *)(param_1 + 0xd0)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))) , number_literal ))))) ;) (expression_statement "pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);" (assignment_expression "pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" identifier = (cast_expression "(char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (call_expression "FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" identifier (argument_list "(*(undefined8 *)(param_1 + 0xd0),0x11)" ( (pointer_expression "*(undefined8 *)(param_1 + 0xd0)" * (cast_expression "(undefined8 *)(param_1 + 0xd0)" ( (type_descriptor "undefined8 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd0)" ( (binary_expression "param_1 + 0xd0" identifier + number_literal) )))) , number_literal ))))) ;) (if_statement "if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" if (parenthesized_expression "((*pcVar2 == '\0') && (*pcVar3 == '\0'))" ( (binary_expression "(*pcVar2 == '\0') && (*pcVar3 == '\0')" (parenthesized_expression "(*pcVar2 == '\0')" ( (binary_expression "*pcVar2 == '\0'" (pointer_expression "*pcVar2" * identifier) == (char_literal "'\0'" ' escape_sequence ')) )) && (parenthesized_expression "(*pcVar3 == '\0')" ( (binary_expression "*pcVar3 == '\0'" (pointer_expression "*pcVar3" * identifier) == (char_literal "'\0'" ' escape_sequence ')) ))) )) (compound_statement "{\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }" { (expression_statement "(**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);" (call_expression "(**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (parenthesized_expression "(**(code **)(**(long **)(param_1 + 0x18) + 8))" ( (pointer_expression "**(code **)(**(long **)(param_1 + 0x18) + 8)" * (pointer_expression "*(code **)(**(long **)(param_1 + 0x18) + 8)" * (cast_expression "(code **)(**(long **)(param_1 + 0x18) + 8)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(long **)(param_1 + 0x18) + 8)" ( (binary_expression "**(long **)(param_1 + 0x18) + 8" (pointer_expression "**(long **)(param_1 + 0x18)" * (pointer_expression "*(long **)(param_1 + 0x18)" * (cast_expression "(long **)(param_1 + 0x18)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" ( (pointer_expression "*(long **)(param_1 + 0x18)" * (cast_expression "(long **)(param_1 + 0x18)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" 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_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" else (compound_statement "{\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" { (expression_statement "local_238 = 1;" (assignment_expression "local_238 = 1" identifier = number_literal) ;) (expression_statement "local_237 = 2;" (assignment_expression "local_237 = 2" identifier = number_literal) ;) (expression_statement "local_236 = 0x11;" (assignment_expression "local_236 = 0x11" identifier = number_literal) ;) (expression_statement "local_235 = 1;" (assignment_expression "local_235 = 1" identifier = number_literal) ;) (expression_statement "local_234 = 0x85;" (assignment_expression "local_234 = 0x85" identifier = number_literal) ;) (expression_statement "local_233 = 2;" (assignment_expression "local_233 = 2" identifier = number_literal) ;) (expression_statement "lVar4 = -1;" (assignment_expression "lVar4 = -1" identifier = number_literal) ;) (expression_statement "pcVar3 = pcVar2;" (assignment_expression "pcVar3 = pcVar2" identifier = identifier) ;) (do_statement "do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');" do (compound_statement "{\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    }" { (if_statement "if (lVar4 == 0) break;" if (parenthesized_expression "(lVar4 == 0)" ( (binary_expression "lVar4 == 0" identifier == number_literal) )) (break_statement "break;" break ;)) (expression_statement "lVar4 = lVar4 + -1;" (assignment_expression "lVar4 = lVar4 + -1" identifier = (binary_expression "lVar4 + -1" identifier + number_literal)) ;) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" identifier = (pointer_expression "*pcVar3" * identifier)) ;) (expression_statement "pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;" (assignment_expression "pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1" identifier = (binary_expression "pcVar3 + (ulong)bVar6 * -2 + 1" (binary_expression "pcVar3 + (ulong)bVar6 * -2" identifier + (binary_expression "(ulong)bVar6 * -2" (cast_expression "(ulong)bVar6" ( (type_descriptor "ulong" type_identifier) ) identifier) * number_literal)) + number_literal)) ;) }) while (parenthesized_expression "(cVar1 != '\0')" ( (binary_expression "cVar1 != '\0'" identifier != (char_literal "'\0'" ' escape_sequence ')) )) ;) (expression_statement "iVar5 = ~(uint)lVar4 - 1;" (assignment_expression "iVar5 = ~(uint)lVar4 - 1" identifier = (binary_expression "~(uint)lVar4 - 1" (unary_expression "~(uint)lVar4" ~ (cast_expression "(uint)lVar4" ( (type_descriptor "uint" type_identifier) ) identifier)) - number_literal)) ;) (if_statement "if (iVar5 < 1) {\n      iVar5 = 1;\n    }" if (parenthesized_expression "(iVar5 < 1)" ( (binary_expression "iVar5 < 1" identifier < number_literal) )) (compound_statement "{\n      iVar5 = 1;\n    }" { (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" identifier = number_literal) ;) })) (if_statement "if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }" if (parenthesized_expression "(0xff < iVar5)" ( (binary_expression "0xff < iVar5" number_literal < identifier) )) (compound_statement "{\n      iVar5 = 0xff;\n    }" { (expression_statement "iVar5 = 0xff;" (assignment_expression "iVar5 = 0xff" identifier = number_literal) ;) })) (expression_statement "local_232 = (undefined1)iVar5;" (assignment_expression "local_232 = (undefined1)iVar5" identifier = (cast_expression "(undefined1)iVar5" ( (type_descriptor "undefined1" type_identifier) ) identifier)) ;) (expression_statement "__memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);" (call_expression "__memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb)" identifier (argument_list "(local_231,pcVar2,(long)iVar5,0x1fb)" ( identifier , identifier , (cast_expression "(long)iVar5" ( (type_descriptor "long" (sized_type_specifier "long" long)) ) identifier) , number_literal ))) ;) (expression_statement "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);" (call_expression "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7)" (parenthesized_expression "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))" ( (pointer_expression "**(code **)(**(long **)(param_1 + 0x10) + 0x10)" * (pointer_expression "*(code **)(**(long **)(param_1 + 0x10) + 0x10)" * (cast_expression "(code **)(**(long **)(param_1 + 0x10) + 0x10)" ( (type_descriptor "code **" type_identifier (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(**(long **)(param_1 + 0x10) + 0x10)" ( (binary_expression "**(long **)(param_1 + 0x10) + 0x10" (pointer_expression "**(long **)(param_1 + 0x10)" * (pointer_expression "*(long **)(param_1 + 0x10)" * (cast_expression "(long **)(param_1 + 0x10)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) + number_literal) ))))) )) (argument_list "(*(long **)(param_1 + 0x10),&local_238,iVar5 + 7)" ( (pointer_expression "*(long **)(param_1 + 0x10)" * (cast_expression "(long **)(param_1 + 0x10)" ( (type_descriptor "long **" (sized_type_specifier "long" long) (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) , (pointer_expression "&local_238" & identifier) , (binary_expression "iVar5 + 7" identifier + number_literal) ))) ;) (expression_statement "*(undefined4 *)(param_1 + 0xd8) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xd8) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xd8)" * (cast_expression "(undefined4 *)(param_1 + 0xd8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xd8)" ( (binary_expression "param_1 + 0xd8" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xdc) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xdc) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xdc)" * (cast_expression "(undefined4 *)(param_1 + 0xdc)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xdc)" ( (binary_expression "param_1 + 0xdc" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xe0) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0xe0) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0xe0)" * (cast_expression "(undefined4 *)(param_1 + 0xe0)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xe0)" ( (binary_expression "param_1 + 0xe0" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0xe4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xe4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xe4)" * (cast_expression "(undefined4 *)(param_1 + 0xe4)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xe4)" ( (binary_expression "param_1 + 0xe4" identifier + number_literal) )))) = number_literal) ;) (expression_statement "*(undefined4 *)(param_1 + 0x84) = 8;" (assignment_expression "*(undefined4 *)(param_1 + 0x84) = 8" (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) ;) }))) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }" if (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return 1;\n  }" { (return_statement "return 1;" return number_literal ;) })) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE 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 (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (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 (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + LIT) ))))) )) (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (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 = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = IDENT) ;) (do_statement do (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (break_statement break ;)) (expression_statement (assignment_expression IDENT = (binary_expression IDENT + LIT)) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * IDENT)) ;) (expression_statement (assignment_expression IDENT = (binary_expression (binary_expression IDENT + (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) * LIT)) + LIT)) ;) }) while (parenthesized_expression ( (binary_expression IDENT != (char_literal ' escape_sequence ')) )) ;) (expression_statement (assignment_expression IDENT = (binary_expression (unary_expression ~ (cast_expression ( (type_descriptor TYPE) ) IDENT)) - LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) })) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT , (cast_expression ( (type_descriptor (sized_type_specifier long)) ) 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 (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) + LIT) ))))) )) (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) , (pointer_expression & IDENT) , (binary_expression IDENT + 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) ;) (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 (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "undefined8 FUN_0010c780(long param_1)\n\n{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    \n  __stack_chk_fail();\n}" (type_identifier "undefined8") (function_declarator "FUN_0010c780(long param_1)" (identifier "FUN_0010c780") (parameter_list "(long param_1)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) () ")"))) (compound_statement "{\n  char cVar1;\n  char *pcVar2;\n  char *pcVar3;\n  long lVar4;\n  int iVar5;\n  long in_FS_OFFSET;\n  byte bVar6;\n  undefined1 local_238;\n  undefined1 local_237;\n  undefined1 local_236;\n  undefined1 local_235;\n  undefined1 local_234;\n  undefined1 local_233;\n  undefined1 local_232;\n  undefined1 local_231 [513];\n  long local_30;\n  \n  bVar6 = 0;\n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);\n  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);\n  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }\n  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }\n                    \n  __stack_chk_fail();\n}" ({ "{") (declaration "char cVar1;" (primitive_type "char") (identifier "cVar1") (; ";")) (declaration "char *pcVar2;" (primitive_type "char") (pointer_declarator "*pcVar2" (* "*") (identifier "pcVar2")) (; ";")) (declaration "char *pcVar3;" (primitive_type "char") (pointer_declarator "*pcVar3" (* "*") (identifier "pcVar3")) (; ";")) (declaration "long lVar4;" (sized_type_specifier "long" (long "long")) (identifier "lVar4") (; ";")) (declaration "int iVar5;" (primitive_type "int") (identifier "iVar5") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "byte bVar6;" (type_identifier "byte") (identifier "bVar6") (; ";")) (declaration "undefined1 local_238;" (type_identifier "undefined1") (identifier "local_238") (; ";")) (declaration "undefined1 local_237;" (type_identifier "undefined1") (identifier "local_237") (; ";")) (declaration "undefined1 local_236;" (type_identifier "undefined1") (identifier "local_236") (; ";")) (declaration "undefined1 local_235;" (type_identifier "undefined1") (identifier "local_235") (; ";")) (declaration "undefined1 local_234;" (type_identifier "undefined1") (identifier "local_234") (; ";")) (declaration "undefined1 local_233;" (type_identifier "undefined1") (identifier "local_233") (; ";")) (declaration "undefined1 local_232;" (type_identifier "undefined1") (identifier "local_232") (; ";")) (declaration "undefined1 local_231 [513];" (type_identifier "undefined1") (array_declarator "local_231 [513]" (identifier "local_231") ([ "[") (number_literal "513") (] "]")) (; ";")) (declaration "long local_30;" (sized_type_specifier "long" (long "long")) (identifier "local_30") (; ";")) (expression_statement "bVar6 = 0;" (assignment_expression "bVar6 = 0" (identifier "bVar6") (= "=") (number_literal "0")) (; ";")) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_30") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (expression_statement "pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);" (assignment_expression "pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" (identifier "pcVar2") (= "=") (cast_expression "(char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10)" (identifier "FUN_0010b453") (argument_list "(*(undefined8 *)(param_1 + 0xd0),0x10)" (( "(") (pointer_expression "*(undefined8 *)(param_1 + 0xd0)" (* "*") (cast_expression "(undefined8 *)(param_1 + 0xd0)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd0)" (( "(") (binary_expression "param_1 + 0xd0" (identifier "param_1") (+ "+") (number_literal "0xd0")) () ")")))) (, ",") (number_literal "0x10") () ")"))))) (; ";")) (expression_statement "pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);" (assignment_expression "pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" (identifier "pcVar3") (= "=") (cast_expression "(char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (call_expression "FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11)" (identifier "FUN_0010b453") (argument_list "(*(undefined8 *)(param_1 + 0xd0),0x11)" (( "(") (pointer_expression "*(undefined8 *)(param_1 + 0xd0)" (* "*") (cast_expression "(undefined8 *)(param_1 + 0xd0)" (( "(") (type_descriptor "undefined8 *" (type_identifier "undefined8") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd0)" (( "(") (binary_expression "param_1 + 0xd0" (identifier "param_1") (+ "+") (number_literal "0xd0")) () ")")))) (, ",") (number_literal "0x11") () ")"))))) (; ";")) (if_statement "if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }\n  else {\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" (if "if") (parenthesized_expression "((*pcVar2 == '\0') && (*pcVar3 == '\0'))" (( "(") (binary_expression "(*pcVar2 == '\0') && (*pcVar3 == '\0')" (parenthesized_expression "(*pcVar2 == '\0')" (( "(") (binary_expression "*pcVar2 == '\0'" (pointer_expression "*pcVar2" (* "*") (identifier "pcVar2")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (&& "&&") (parenthesized_expression "(*pcVar3 == '\0')" (( "(") (binary_expression "*pcVar3 == '\0'" (pointer_expression "*pcVar3" (* "*") (identifier "pcVar3")) (== "==") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")"))) () ")")) (compound_statement "{\n    (**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);\n  }" ({ "{") (expression_statement "(**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);" (call_expression "(**(code **)(**(long **)(param_1 + 0x18) + 8))\n              (*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (parenthesized_expression "(**(code **)(**(long **)(param_1 + 0x18) + 8))" (( "(") (pointer_expression "**(code **)(**(long **)(param_1 + 0x18) + 8)" (* "*") (pointer_expression "*(code **)(**(long **)(param_1 + 0x18) + 8)" (* "*") (cast_expression "(code **)(**(long **)(param_1 + 0x18) + 8)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(**(long **)(param_1 + 0x18) + 8)" (( "(") (binary_expression "**(long **)(param_1 + 0x18) + 8" (pointer_expression "**(long **)(param_1 + 0x18)" (* "*") (pointer_expression "*(long **)(param_1 + 0x18)" (* "*") (cast_expression "(long **)(param_1 + 0x18)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))))) (+ "+") (number_literal "8")) () ")"))))) () ")")) (argument_list "(*(long **)(param_1 + 0x18),\n               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0)" (( "(") (pointer_expression "*(long **)(param_1 + 0x18)" (* "*") (cast_expression "(long **)(param_1 + 0x18)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) (, ",") (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_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" (else "else") (compound_statement "{\n    local_238 = 1;\n    local_237 = 2;\n    local_236 = 0x11;\n    local_235 = 1;\n    local_234 = 0x85;\n    local_233 = 2;\n    lVar4 = -1;\n    pcVar3 = pcVar2;\n    do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');\n    iVar5 = ~(uint)lVar4 - 1;\n    if (iVar5 < 1) {\n      iVar5 = 1;\n    }\n    if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }\n    local_232 = (undefined1)iVar5;\n    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);\n    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);\n    *(undefined4 *)(param_1 + 0xd8) = 0;\n    *(undefined4 *)(param_1 + 0xdc) = 0;\n    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;\n    *(undefined4 *)(param_1 + 0xe4) = 0;\n    *(undefined4 *)(param_1 + 0x84) = 8;\n  }" ({ "{") (expression_statement "local_238 = 1;" (assignment_expression "local_238 = 1" (identifier "local_238") (= "=") (number_literal "1")) (; ";")) (expression_statement "local_237 = 2;" (assignment_expression "local_237 = 2" (identifier "local_237") (= "=") (number_literal "2")) (; ";")) (expression_statement "local_236 = 0x11;" (assignment_expression "local_236 = 0x11" (identifier "local_236") (= "=") (number_literal "0x11")) (; ";")) (expression_statement "local_235 = 1;" (assignment_expression "local_235 = 1" (identifier "local_235") (= "=") (number_literal "1")) (; ";")) (expression_statement "local_234 = 0x85;" (assignment_expression "local_234 = 0x85" (identifier "local_234") (= "=") (number_literal "0x85")) (; ";")) (expression_statement "local_233 = 2;" (assignment_expression "local_233 = 2" (identifier "local_233") (= "=") (number_literal "2")) (; ";")) (expression_statement "lVar4 = -1;" (assignment_expression "lVar4 = -1" (identifier "lVar4") (= "=") (number_literal "-1")) (; ";")) (expression_statement "pcVar3 = pcVar2;" (assignment_expression "pcVar3 = pcVar2" (identifier "pcVar3") (= "=") (identifier "pcVar2")) (; ";")) (do_statement "do {\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    } while (cVar1 != '\0');" (do "do") (compound_statement "{\n      if (lVar4 == 0) break;\n      lVar4 = lVar4 + -1;\n      cVar1 = *pcVar3;\n      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;\n    }" ({ "{") (if_statement "if (lVar4 == 0) break;" (if "if") (parenthesized_expression "(lVar4 == 0)" (( "(") (binary_expression "lVar4 == 0" (identifier "lVar4") (== "==") (number_literal "0")) () ")")) (break_statement "break;" (break "break") (; ";"))) (expression_statement "lVar4 = lVar4 + -1;" (assignment_expression "lVar4 = lVar4 + -1" (identifier "lVar4") (= "=") (binary_expression "lVar4 + -1" (identifier "lVar4") (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "cVar1 = *pcVar3;" (assignment_expression "cVar1 = *pcVar3" (identifier "cVar1") (= "=") (pointer_expression "*pcVar3" (* "*") (identifier "pcVar3"))) (; ";")) (expression_statement "pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;" (assignment_expression "pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1" (identifier "pcVar3") (= "=") (binary_expression "pcVar3 + (ulong)bVar6 * -2 + 1" (binary_expression "pcVar3 + (ulong)bVar6 * -2" (identifier "pcVar3") (+ "+") (binary_expression "(ulong)bVar6 * -2" (cast_expression "(ulong)bVar6" (( "(") (type_descriptor "ulong" (type_identifier "ulong")) () ")") (identifier "bVar6")) (* "*") (number_literal "-2"))) (+ "+") (number_literal "1"))) (; ";")) (} "}")) (while "while") (parenthesized_expression "(cVar1 != '\0')" (( "(") (binary_expression "cVar1 != '\0'" (identifier "cVar1") (!= "!=") (char_literal "'\0'" (' "'") (escape_sequence "\0") (' "'"))) () ")")) (; ";")) (expression_statement "iVar5 = ~(uint)lVar4 - 1;" (assignment_expression "iVar5 = ~(uint)lVar4 - 1" (identifier "iVar5") (= "=") (binary_expression "~(uint)lVar4 - 1" (unary_expression "~(uint)lVar4" (~ "~") (cast_expression "(uint)lVar4" (( "(") (type_descriptor "uint" (type_identifier "uint")) () ")") (identifier "lVar4"))) (- "-") (number_literal "1"))) (; ";")) (if_statement "if (iVar5 < 1) {\n      iVar5 = 1;\n    }" (if "if") (parenthesized_expression "(iVar5 < 1)" (( "(") (binary_expression "iVar5 < 1" (identifier "iVar5") (< "<") (number_literal "1")) () ")")) (compound_statement "{\n      iVar5 = 1;\n    }" ({ "{") (expression_statement "iVar5 = 1;" (assignment_expression "iVar5 = 1" (identifier "iVar5") (= "=") (number_literal "1")) (; ";")) (} "}"))) (if_statement "if (0xff < iVar5) {\n      iVar5 = 0xff;\n    }" (if "if") (parenthesized_expression "(0xff < iVar5)" (( "(") (binary_expression "0xff < iVar5" (number_literal "0xff") (< "<") (identifier "iVar5")) () ")")) (compound_statement "{\n      iVar5 = 0xff;\n    }" ({ "{") (expression_statement "iVar5 = 0xff;" (assignment_expression "iVar5 = 0xff" (identifier "iVar5") (= "=") (number_literal "0xff")) (; ";")) (} "}"))) (expression_statement "local_232 = (undefined1)iVar5;" (assignment_expression "local_232 = (undefined1)iVar5" (identifier "local_232") (= "=") (cast_expression "(undefined1)iVar5" (( "(") (type_descriptor "undefined1" (type_identifier "undefined1")) () ")") (identifier "iVar5"))) (; ";")) (expression_statement "__memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);" (call_expression "__memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb)" (identifier "__memcpy_chk") (argument_list "(local_231,pcVar2,(long)iVar5,0x1fb)" (( "(") (identifier "local_231") (, ",") (identifier "pcVar2") (, ",") (cast_expression "(long)iVar5" (( "(") (type_descriptor "long" (sized_type_specifier "long" (long "long"))) () ")") (identifier "iVar5")) (, ",") (number_literal "0x1fb") () ")"))) (; ";")) (expression_statement "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);" (call_expression "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))\n              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7)" (parenthesized_expression "(**(code **)(**(long **)(param_1 + 0x10) + 0x10))" (( "(") (pointer_expression "**(code **)(**(long **)(param_1 + 0x10) + 0x10)" (* "*") (pointer_expression "*(code **)(**(long **)(param_1 + 0x10) + 0x10)" (* "*") (cast_expression "(code **)(**(long **)(param_1 + 0x10) + 0x10)" (( "(") (type_descriptor "code **" (type_identifier "code") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(**(long **)(param_1 + 0x10) + 0x10)" (( "(") (binary_expression "**(long **)(param_1 + 0x10) + 0x10" (pointer_expression "**(long **)(param_1 + 0x10)" (* "*") (pointer_expression "*(long **)(param_1 + 0x10)" (* "*") (cast_expression "(long **)(param_1 + 0x10)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (+ "+") (number_literal "0x10")) () ")"))))) () ")")) (argument_list "(*(long **)(param_1 + 0x10),&local_238,iVar5 + 7)" (( "(") (pointer_expression "*(long **)(param_1 + 0x10)" (* "*") (cast_expression "(long **)(param_1 + 0x10)" (( "(") (type_descriptor "long **" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (, ",") (pointer_expression "&local_238" (& "&") (identifier "local_238")) (, ",") (binary_expression "iVar5 + 7" (identifier "iVar5") (+ "+") (number_literal "7")) () ")"))) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xd8) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xd8) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xd8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xd8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xd8)" (( "(") (binary_expression "param_1 + 0xd8" (identifier "param_1") (+ "+") (number_literal "0xd8")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xdc) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xdc) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xdc)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xdc)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xdc)" (( "(") (binary_expression "param_1 + 0xdc" (identifier "param_1") (+ "+") (number_literal "0xdc")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xe0) = 0xffffffff;" (assignment_expression "*(undefined4 *)(param_1 + 0xe0) = 0xffffffff" (pointer_expression "*(undefined4 *)(param_1 + 0xe0)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xe0)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xe0)" (( "(") (binary_expression "param_1 + 0xe0" (identifier "param_1") (+ "+") (number_literal "0xe0")) () ")")))) (= "=") (number_literal "0xffffffff")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0xe4) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0xe4) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0xe4)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0xe4)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xe4)" (( "(") (binary_expression "param_1 + 0xe4" (identifier "param_1") (+ "+") (number_literal "0xe4")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "*(undefined4 *)(param_1 + 0x84) = 8;" (assignment_expression "*(undefined4 *)(param_1 + 0x84) = 8" (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 "8")) (; ";")) (} "}")))) (if_statement "if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return 1;\n  }" (if "if") (parenthesized_expression "(local_30 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_30 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_30") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n    return 1;\n  }" ({ "{") (return_statement "return 1;" (return "return") (number_literal "1") (; ";")) (} "}"))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

/* WARNING: Enum "anon_enum_32": Some values do not have unique names */

int function_1(type_1 p)

{
  char var_5;
  long var_9;
  char *pcVar3;
  char *var_4;
  long var_3;
  int var_6;
  long var_1;
  type_2 bVar7;
  char var_8 [514];
  
  bVar7 = 0;
  var_9 = *(long *)(var_1 + 0x28);
  pcVar3 = var_2(p->conf,0x10);
  var_4 = var_2(p->conf,0x11);
  if ((*pcVar3 == '\0') && (*var_4 == '\0')) {
    (*(*p->plug)->closing)
              (p->plug,"Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000
               ,0);
  }
  else {
    var_8[0] = '\x01';
    var_8[1] = '\x02';
    var_8[2] = '\x11';
    var_8[3] = '\x01';
    var_8[4] = -0x7b;
    var_8[5] = '\x02';
    var_3 = -1;
    var_4 = pcVar3;
    do {
      if (var_3 == 0) break;
      var_3 = var_3 + -1;
      var_5 = *var_4;
      var_4 = var_4 + (type_3)bVar7 * -2 + 1;
    } while (var_5 != '\0');
    var_6 = ~(type_4)var_3 - 1;
    if (var_6 < 1) {
      var_6 = 1;
    }
    if (0xff < var_6) {
      var_6 = 0xff;
    }
    var_8[6] = (char)var_6;
    var_7(var_8 + 7,pcVar3,(long)var_6,0x1fb);
    (*(*p->sub_socket)->write)(p->sub_socket,var_8,var_6 + 7);
    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_9 == *(long *)(var_1 + 0x28)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  var_10();
}


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

undefined8 MASKED(long param_1)

{
  char cVar1;
  char *pcVar2;
  char *pcVar3;
  long lVar4;
  int iVar5;
  long in_FS_OFFSET;
  byte bVar6;
  undefined1 local_238;
  undefined1 local_237;
  undefined1 local_236;
  undefined1 local_235;
  undefined1 local_234;
  undefined1 local_233;
  undefined1 local_232;
  undefined1 local_231 [513];
  long local_30;
  
  bVar6 = 0;
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  pcVar2 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x10);
  pcVar3 = (char *)FUN_0010b453(*(undefined8 *)(param_1 + 0xd0),0x11);
  if ((*pcVar2 == '\0') && (*pcVar3 == '\0')) {
    (**(code **)(**(long **)(param_1 + 0x18) + 8))
              (*(long **)(param_1 + 0x18),
               "Proxy error: Server chose CHAP authentication but we didn\'t offer it!",8000,0);
  }
  else {
    local_238 = 1;
    local_237 = 2;
    local_236 = 0x11;
    local_235 = 1;
    local_234 = 0x85;
    local_233 = 2;
    lVar4 = -1;
    pcVar3 = pcVar2;
    do {
      if (lVar4 == 0) break;
      lVar4 = lVar4 + -1;
      cVar1 = *pcVar3;
      pcVar3 = pcVar3 + (ulong)bVar6 * -2 + 1;
    } while (cVar1 != '\0');
    iVar5 = ~(uint)lVar4 - 1;
    if (iVar5 < 1) {
      iVar5 = 1;
    }
    if (0xff < iVar5) {
      iVar5 = 0xff;
    }
    local_232 = (undefined1)iVar5;
    __memcpy_chk(local_231,pcVar2,(long)iVar5,0x1fb);
    (**(code **)(**(long **)(param_1 + 0x10) + 0x10))
              (*(long **)(param_1 + 0x10),&local_238,iVar5 + 7);
    *(undefined4 *)(param_1 + 0xd8) = 0;
    *(undefined4 *)(param_1 + 0xdc) = 0;
    *(undefined4 *)(param_1 + 0xe0) = 0xffffffff;
    *(undefined4 *)(param_1 + 0xe4) = 0;
    *(undefined4 *)(param_1 + 0x84) = 8;
  }
  if (local_30 == *(long *)(in_FS_OFFSET + 0x28)) {
    return 1;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

