
void pty_open_master(Pty pty)

{
  int iVar1;
  char *__src;
  
  iVar1 = posix_openpt(0x102);
  pty->master_fd = iVar1;
  if (iVar1 < 0) {
    perror("posix_openpt");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  iVar1 = grantpt(iVar1);
  if (-1 < iVar1) {
    iVar1 = unlockpt(pty->master_fd);
    if (-1 < iVar1) {
      cloexec(pty->master_fd);
      pty->name[0xfff] = '\0';
      __src = ptsname(pty->master_fd);
      strncpy(pty->name,__src,0xfff);
      nonblock(pty->master_fd);
      if (ptys_by_fd == (tree234 *)0x0) {
        ptys_by_fd = newtree234(pty_compare_by_fd);
      }
      add234(ptys_by_fd,pty);
      return;
    }
    perror("unlockpt");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  perror("grantpt");
                    /* WARNING: Subroutine does not return */
  exit(1);
}



void FUN_0014a331(long param_1)

{
  int iVar1;
  char *__src;
  
  iVar1 = posix_openpt(0x102);
  *(int *)(param_1 + 8) = iVar1;
  if (iVar1 < 0) {
    perror("posix_openpt");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  iVar1 = grantpt(iVar1);
  if (-1 < iVar1) {
    iVar1 = unlockpt(*(int *)(param_1 + 8));
    if (-1 < iVar1) {
      FUN_00149bd0(*(undefined4 *)(param_1 + 8));
      *(undefined1 *)(param_1 + 0x1017) = 0;
      __src = ptsname(*(int *)(param_1 + 8));
      strncpy((char *)(param_1 + 0x18),__src,0xfff);
      FUN_00149d14(*(undefined4 *)(param_1 + 8));
      if (DAT_0018d3b8 == 0) {
        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);
      }
      FUN_00133134(DAT_0018d3b8,param_1);
      return;
    }
    perror("unlockpt");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  perror("grantpt");
                    /* WARNING: Subroutine does not return */
  exit(1);
}


PUSH RBX
MOV RBX,RDI
MOV EDI,0x102
CALL 0x00110ea0
MOV dword ptr [RBX + 0x8],EAX
TEST EAX,EAX
JS 0x0014a3a8
MOV EDI,EAX
CALL 0x0010f710
TEST EAX,EAX
JS 0x0014a3be
MOV EDI,dword ptr [RBX + 0x8]
CALL 0x0010fb40
TEST EAX,EAX
JS 0x0014a3d4
MOV EDI,dword ptr [RBX + 0x8]
CALL 0x00149bd0
MOV byte ptr [RBX + 0x1017],0x0
MOV EDI,dword ptr [RBX + 0x8]
CALL 0x0010fb30
LEA RDI,[RBX + 0x18]
MOV EDX,0xfff
MOV RSI,RAX
CALL 0x0010f7a0
MOV EDI,dword ptr [RBX + 0x8]
CALL 0x00149d14
CMP qword ptr [0x0018d3b8],0x0
JZ 0x0014a3ea
MOV RSI,RBX
MOV RDI,qword ptr [0x0018d3b8]
CALL 0x00133134
POP RBX
RET
LEA RDI,[0x17927c]
CALL 0x0010fc70
MOV EDI,0x1
CALL 0x001102f0
LEA RDI,[0x179289]
CALL 0x0010fc70
MOV EDI,0x1
CALL 0x001102f0
LEA RDI,[0x179291]
CALL 0x0010fc70
MOV EDI,0x1
CALL 0x001102f0
LEA RDI,[0x14a274]
CALL 0x001330eb
MOV qword ptr [0x0018d3b8],RAX
JMP 0x0014a397
(translation_unit "void FUN_0014a331(long param_1)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  perror("grantpt");\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}\n\n" (function_definition "void FUN_0014a331(long param_1)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  perror("grantpt");\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" primitive_type (function_declarator "FUN_0014a331(long param_1)" identifier (parameter_list "(long param_1)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  perror("grantpt");\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (expression_statement "iVar1 = posix_openpt(0x102);" (assignment_expression "iVar1 = posix_openpt(0x102)" identifier = (call_expression "posix_openpt(0x102)" identifier (argument_list "(0x102)" ( number_literal )))) ;) (expression_statement "*(int *)(param_1 + 8) = iVar1;" (assignment_expression "*(int *)(param_1 + 8) = iVar1" (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" { (expression_statement "perror("posix_openpt");" (call_expression "perror("posix_openpt")" identifier (argument_list "("posix_openpt")" ( (string_literal ""posix_openpt"" " string_content ") ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })) (expression_statement "iVar1 = grantpt(iVar1);" (assignment_expression "iVar1 = grantpt(iVar1)" identifier = (call_expression "grantpt(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" { (expression_statement "iVar1 = unlockpt(*(int *)(param_1 + 8));" (assignment_expression "iVar1 = unlockpt(*(int *)(param_1 + 8))" identifier = (call_expression "unlockpt(*(int *)(param_1 + 8))" identifier (argument_list "(*(int *)(param_1 + 8))" ( (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }" { (expression_statement "FUN_00149bd0(*(undefined4 *)(param_1 + 8));" (call_expression "FUN_00149bd0(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined1 *)(param_1 + 0x1017) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1017) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1017)" * (cast_expression "(undefined1 *)(param_1 + 0x1017)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1017)" ( (binary_expression "param_1 + 0x1017" identifier + number_literal) )))) = number_literal) ;) (expression_statement "__src = ptsname(*(int *)(param_1 + 8));" (assignment_expression "__src = ptsname(*(int *)(param_1 + 8))" identifier = (call_expression "ptsname(*(int *)(param_1 + 8))" identifier (argument_list "(*(int *)(param_1 + 8))" ( (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (expression_statement "strncpy((char *)(param_1 + 0x18),__src,0xfff);" (call_expression "strncpy((char *)(param_1 + 0x18),__src,0xfff)" identifier (argument_list "((char *)(param_1 + 0x18),__src,0xfff)" ( (cast_expression "(char *)(param_1 + 0x18)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))) , identifier , number_literal ))) ;) (expression_statement "FUN_00149d14(*(undefined4 *)(param_1 + 8));" (call_expression "FUN_00149d14(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) ))) ;) (if_statement "if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }" if (parenthesized_expression "(DAT_0018d3b8 == 0)" ( (binary_expression "DAT_0018d3b8 == 0" identifier == number_literal) )) (compound_statement "{\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }" { (expression_statement "DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);" (assignment_expression "DAT_0018d3b8 = FUN_001330eb(FUN_0014a274)" identifier = (call_expression "FUN_001330eb(FUN_0014a274)" identifier (argument_list "(FUN_0014a274)" ( identifier )))) ;) })) (expression_statement "FUN_00133134(DAT_0018d3b8,param_1);" (call_expression "FUN_00133134(DAT_0018d3b8,param_1)" identifier (argument_list "(DAT_0018d3b8,param_1)" ( identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "perror("unlockpt");" (call_expression "perror("unlockpt")" identifier (argument_list "("unlockpt")" ( (string_literal ""unlockpt"" " string_content ") ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })) (expression_statement "perror("grantpt");" (call_expression "perror("grantpt")" identifier (argument_list "("grantpt")" ( (string_literal ""grantpt"" " string_content ") ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })))
(translation_unit "void pty_open_master(Pty pty)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  pty->master_fd = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(pty->master_fd);\n    if (-1 < iVar1) {\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  perror("grantpt");\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}\n\n" (function_definition "void pty_open_master(Pty pty)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  pty->master_fd = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(pty->master_fd);\n    if (-1 < iVar1) {\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  perror("grantpt");\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" primitive_type (function_declarator "pty_open_master(Pty pty)" identifier (parameter_list "(Pty pty)" ( (parameter_declaration "Pty pty" type_identifier identifier) ))) (compound_statement "{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  pty->master_fd = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(pty->master_fd);\n    if (-1 < iVar1) {\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }\n  perror("grantpt");\n                    /* WARNING: Subroutine does not return */\n  exit(1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (expression_statement "iVar1 = posix_openpt(0x102);" (assignment_expression "iVar1 = posix_openpt(0x102)" identifier = (call_expression "posix_openpt(0x102)" identifier (argument_list "(0x102)" ( number_literal )))) ;) (expression_statement "pty->master_fd = iVar1;" (assignment_expression "pty->master_fd = iVar1" (field_expression "pty->master_fd" identifier -> field_identifier) = identifier) ;) (if_statement "if (iVar1 < 0) {\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    perror("posix_openpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" { (expression_statement "perror("posix_openpt");" (call_expression "perror("posix_openpt")" identifier (argument_list "("posix_openpt")" ( (string_literal ""posix_openpt"" " string_content ") ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })) (expression_statement "iVar1 = grantpt(iVar1);" (assignment_expression "iVar1 = grantpt(iVar1)" identifier = (call_expression "grantpt(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n    iVar1 = unlockpt(pty->master_fd);\n    if (-1 < iVar1) {\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar1 = unlockpt(pty->master_fd);\n    if (-1 < iVar1) {\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }\n    perror("unlockpt");\n                    /* WARNING: Subroutine does not return */\n    exit(1);\n  }" { (expression_statement "iVar1 = unlockpt(pty->master_fd);" (assignment_expression "iVar1 = unlockpt(pty->master_fd)" identifier = (call_expression "unlockpt(pty->master_fd)" identifier (argument_list "(pty->master_fd)" ( (field_expression "pty->master_fd" identifier -> field_identifier) )))) ;) (if_statement "if (-1 < iVar1) {\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      cloexec(pty->master_fd);\n      pty->name[0xfff] = '\0';\n      __src = ptsname(pty->master_fd);\n      strncpy(pty->name,__src,0xfff);\n      nonblock(pty->master_fd);\n      if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }\n      add234(ptys_by_fd,pty);\n      return;\n    }" { (expression_statement "cloexec(pty->master_fd);" (call_expression "cloexec(pty->master_fd)" identifier (argument_list "(pty->master_fd)" ( (field_expression "pty->master_fd" identifier -> field_identifier) ))) ;) (expression_statement "pty->name[0xfff] = '\0';" (assignment_expression "pty->name[0xfff] = '\0'" (subscript_expression "pty->name[0xfff]" (field_expression "pty->name" identifier -> field_identifier) [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "__src = ptsname(pty->master_fd);" (assignment_expression "__src = ptsname(pty->master_fd)" identifier = (call_expression "ptsname(pty->master_fd)" identifier (argument_list "(pty->master_fd)" ( (field_expression "pty->master_fd" identifier -> field_identifier) )))) ;) (expression_statement "strncpy(pty->name,__src,0xfff);" (call_expression "strncpy(pty->name,__src,0xfff)" identifier (argument_list "(pty->name,__src,0xfff)" ( (field_expression "pty->name" identifier -> field_identifier) , identifier , number_literal ))) ;) (expression_statement "nonblock(pty->master_fd);" (call_expression "nonblock(pty->master_fd)" identifier (argument_list "(pty->master_fd)" ( (field_expression "pty->master_fd" identifier -> field_identifier) ))) ;) (if_statement "if (ptys_by_fd == (tree234 *)0x0) {\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }" if (parenthesized_expression "(ptys_by_fd == (tree234 *)0x0)" ( (binary_expression "ptys_by_fd == (tree234 *)0x0" identifier == (cast_expression "(tree234 *)0x0" ( (type_descriptor "tree234 *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n        ptys_by_fd = newtree234(pty_compare_by_fd);\n      }" { (expression_statement "ptys_by_fd = newtree234(pty_compare_by_fd);" (assignment_expression "ptys_by_fd = newtree234(pty_compare_by_fd)" identifier = (call_expression "newtree234(pty_compare_by_fd)" identifier (argument_list "(pty_compare_by_fd)" ( identifier )))) ;) })) (expression_statement "add234(ptys_by_fd,pty);" (call_expression "add234(ptys_by_fd,pty)" identifier (argument_list "(ptys_by_fd,pty)" ( identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "perror("unlockpt");" (call_expression "perror("unlockpt")" identifier (argument_list "("unlockpt")" ( (string_literal ""unlockpt"" " string_content ") ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })) (expression_statement "perror("grantpt");" (call_expression "perror("grantpt")" identifier (argument_list "("grantpt")" ( (string_literal ""grantpt"" " string_content ") ))) ;) comment (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })))
(translation_unit "void FUN_0014a331(long param_1)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }\n  perror("grantpt");\n                    \n  exit(1);\n}\n\n" (function_definition "void FUN_0014a331(long param_1)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }\n  perror("grantpt");\n                    \n  exit(1);\n}" primitive_type (function_declarator "FUN_0014a331(long param_1)" identifier (parameter_list "(long param_1)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) ))) (compound_statement "{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }\n  perror("grantpt");\n                    \n  exit(1);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "char *__src;" primitive_type (pointer_declarator "*__src" * identifier) ;) (expression_statement "iVar1 = posix_openpt(0x102);" (assignment_expression "iVar1 = posix_openpt(0x102)" identifier = (call_expression "posix_openpt(0x102)" identifier (argument_list "(0x102)" ( number_literal )))) ;) (expression_statement "*(int *)(param_1 + 8) = iVar1;" (assignment_expression "*(int *)(param_1 + 8) = iVar1" (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) = identifier) ;) (if_statement "if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }" if (parenthesized_expression "(iVar1 < 0)" ( (binary_expression "iVar1 < 0" identifier < number_literal) )) (compound_statement "{\n    perror("posix_openpt");\n                    \n    exit(1);\n  }" { (expression_statement "perror("posix_openpt");" (call_expression "perror("posix_openpt")" identifier (argument_list "("posix_openpt")" ( (string_literal ""posix_openpt"" " string_content ") ))) ;) (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })) (expression_statement "iVar1 = grantpt(iVar1);" (assignment_expression "iVar1 = grantpt(iVar1)" identifier = (call_expression "grantpt(iVar1)" identifier (argument_list "(iVar1)" ( identifier )))) ;) (if_statement "if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }" { (expression_statement "iVar1 = unlockpt(*(int *)(param_1 + 8));" (assignment_expression "iVar1 = unlockpt(*(int *)(param_1 + 8))" identifier = (call_expression "unlockpt(*(int *)(param_1 + 8))" identifier (argument_list "(*(int *)(param_1 + 8))" ( (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (if_statement "if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }" if (parenthesized_expression "(-1 < iVar1)" ( (binary_expression "-1 < iVar1" number_literal < identifier) )) (compound_statement "{\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }" { (expression_statement "FUN_00149bd0(*(undefined4 *)(param_1 + 8));" (call_expression "FUN_00149bd0(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) ))) ;) (expression_statement "*(undefined1 *)(param_1 + 0x1017) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1017) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1017)" * (cast_expression "(undefined1 *)(param_1 + 0x1017)" ( (type_descriptor "undefined1 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x1017)" ( (binary_expression "param_1 + 0x1017" identifier + number_literal) )))) = number_literal) ;) (expression_statement "__src = ptsname(*(int *)(param_1 + 8));" (assignment_expression "__src = ptsname(*(int *)(param_1 + 8))" identifier = (call_expression "ptsname(*(int *)(param_1 + 8))" identifier (argument_list "(*(int *)(param_1 + 8))" ( (pointer_expression "*(int *)(param_1 + 8)" * (cast_expression "(int *)(param_1 + 8)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) )))) ;) (expression_statement "strncpy((char *)(param_1 + 0x18),__src,0xfff);" (call_expression "strncpy((char *)(param_1 + 0x18),__src,0xfff)" identifier (argument_list "((char *)(param_1 + 0x18),__src,0xfff)" ( (cast_expression "(char *)(param_1 + 0x18)" ( (type_descriptor "char *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) ))) , identifier , number_literal ))) ;) (expression_statement "FUN_00149d14(*(undefined4 *)(param_1 + 8));" (call_expression "FUN_00149d14(*(undefined4 *)(param_1 + 8))" identifier (argument_list "(*(undefined4 *)(param_1 + 8))" ( (pointer_expression "*(undefined4 *)(param_1 + 8)" * (cast_expression "(undefined4 *)(param_1 + 8)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) )))) ))) ;) (if_statement "if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }" if (parenthesized_expression "(DAT_0018d3b8 == 0)" ( (binary_expression "DAT_0018d3b8 == 0" identifier == number_literal) )) (compound_statement "{\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }" { (expression_statement "DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);" (assignment_expression "DAT_0018d3b8 = FUN_001330eb(FUN_0014a274)" identifier = (call_expression "FUN_001330eb(FUN_0014a274)" identifier (argument_list "(FUN_0014a274)" ( identifier )))) ;) })) (expression_statement "FUN_00133134(DAT_0018d3b8,param_1);" (call_expression "FUN_00133134(DAT_0018d3b8,param_1)" identifier (argument_list "(DAT_0018d3b8,param_1)" ( identifier , identifier ))) ;) (return_statement "return;" return ;) })) (expression_statement "perror("unlockpt");" (call_expression "perror("unlockpt")" identifier (argument_list "("unlockpt")" ( (string_literal ""unlockpt"" " string_content ") ))) ;) (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })) (expression_statement "perror("grantpt");" (call_expression "perror("grantpt")" identifier (argument_list "("grantpt")" ( (string_literal ""grantpt"" " string_content ") ))) ;) (expression_statement "exit(1);" (call_expression "exit(1)" identifier (argument_list "(1)" ( number_literal ))) ;) })))
(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) ;) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( LIT )))) ;) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT < LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression LIT < IDENT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (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 IDENT = (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) )))) ;) (expression_statement (call_expression IDENT (argument_list ( (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))) , IDENT , LIT ))) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT )))) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT , IDENT ))) ;) (return_statement return ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") ))) ;) (expression_statement (call_expression IDENT (argument_list ( LIT ))) ;) })))
(function_definition "void FUN_0014a331(long param_1)\n\n{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }\n  perror("grantpt");\n                    \n  exit(1);\n}" (primitive_type "void") (function_declarator "FUN_0014a331(long param_1)" (identifier "FUN_0014a331") (parameter_list "(long param_1)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) () ")"))) (compound_statement "{\n  int iVar1;\n  char *__src;\n  \n  iVar1 = posix_openpt(0x102);\n  *(int *)(param_1 + 8) = iVar1;\n  if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }\n  iVar1 = grantpt(iVar1);\n  if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }\n  perror("grantpt");\n                    \n  exit(1);\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "char *__src;" (primitive_type "char") (pointer_declarator "*__src" (* "*") (identifier "__src")) (; ";")) (expression_statement "iVar1 = posix_openpt(0x102);" (assignment_expression "iVar1 = posix_openpt(0x102)" (identifier "iVar1") (= "=") (call_expression "posix_openpt(0x102)" (identifier "posix_openpt") (argument_list "(0x102)" (( "(") (number_literal "0x102") () ")")))) (; ";")) (expression_statement "*(int *)(param_1 + 8) = iVar1;" (assignment_expression "*(int *)(param_1 + 8) = iVar1" (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) (= "=") (identifier "iVar1")) (; ";")) (if_statement "if (iVar1 < 0) {\n    perror("posix_openpt");\n                    \n    exit(1);\n  }" (if "if") (parenthesized_expression "(iVar1 < 0)" (( "(") (binary_expression "iVar1 < 0" (identifier "iVar1") (< "<") (number_literal "0")) () ")")) (compound_statement "{\n    perror("posix_openpt");\n                    \n    exit(1);\n  }" ({ "{") (expression_statement "perror("posix_openpt");" (call_expression "perror("posix_openpt")" (identifier "perror") (argument_list "("posix_openpt")" (( "(") (string_literal ""posix_openpt"" (" """) (string_content "posix_openpt") (" """)) () ")"))) (; ";")) (expression_statement "exit(1);" (call_expression "exit(1)" (identifier "exit") (argument_list "(1)" (( "(") (number_literal "1") () ")"))) (; ";")) (} "}"))) (expression_statement "iVar1 = grantpt(iVar1);" (assignment_expression "iVar1 = grantpt(iVar1)" (identifier "iVar1") (= "=") (call_expression "grantpt(iVar1)" (identifier "grantpt") (argument_list "(iVar1)" (( "(") (identifier "iVar1") () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n    iVar1 = unlockpt(*(int *)(param_1 + 8));\n    if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }\n    perror("unlockpt");\n                    \n    exit(1);\n  }" ({ "{") (expression_statement "iVar1 = unlockpt(*(int *)(param_1 + 8));" (assignment_expression "iVar1 = unlockpt(*(int *)(param_1 + 8))" (identifier "iVar1") (= "=") (call_expression "unlockpt(*(int *)(param_1 + 8))" (identifier "unlockpt") (argument_list "(*(int *)(param_1 + 8))" (( "(") (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")")))) (; ";")) (if_statement "if (-1 < iVar1) {\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }" (if "if") (parenthesized_expression "(-1 < iVar1)" (( "(") (binary_expression "-1 < iVar1" (number_literal "-1") (< "<") (identifier "iVar1")) () ")")) (compound_statement "{\n      FUN_00149bd0(*(undefined4 *)(param_1 + 8));\n      *(undefined1 *)(param_1 + 0x1017) = 0;\n      __src = ptsname(*(int *)(param_1 + 8));\n      strncpy((char *)(param_1 + 0x18),__src,0xfff);\n      FUN_00149d14(*(undefined4 *)(param_1 + 8));\n      if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }\n      FUN_00133134(DAT_0018d3b8,param_1);\n      return;\n    }" ({ "{") (expression_statement "FUN_00149bd0(*(undefined4 *)(param_1 + 8));" (call_expression "FUN_00149bd0(*(undefined4 *)(param_1 + 8))" (identifier "FUN_00149bd0") (argument_list "(*(undefined4 *)(param_1 + 8))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")"))) (; ";")) (expression_statement "*(undefined1 *)(param_1 + 0x1017) = 0;" (assignment_expression "*(undefined1 *)(param_1 + 0x1017) = 0" (pointer_expression "*(undefined1 *)(param_1 + 0x1017)" (* "*") (cast_expression "(undefined1 *)(param_1 + 0x1017)" (( "(") (type_descriptor "undefined1 *" (type_identifier "undefined1") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x1017)" (( "(") (binary_expression "param_1 + 0x1017" (identifier "param_1") (+ "+") (number_literal "0x1017")) () ")")))) (= "=") (number_literal "0")) (; ";")) (expression_statement "__src = ptsname(*(int *)(param_1 + 8));" (assignment_expression "__src = ptsname(*(int *)(param_1 + 8))" (identifier "__src") (= "=") (call_expression "ptsname(*(int *)(param_1 + 8))" (identifier "ptsname") (argument_list "(*(int *)(param_1 + 8))" (( "(") (pointer_expression "*(int *)(param_1 + 8)" (* "*") (cast_expression "(int *)(param_1 + 8)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")")))) (; ";")) (expression_statement "strncpy((char *)(param_1 + 0x18),__src,0xfff);" (call_expression "strncpy((char *)(param_1 + 0x18),__src,0xfff)" (identifier "strncpy") (argument_list "((char *)(param_1 + 0x18),__src,0xfff)" (( "(") (cast_expression "(char *)(param_1 + 0x18)" (( "(") (type_descriptor "char *" (primitive_type "char") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")"))) (, ",") (identifier "__src") (, ",") (number_literal "0xfff") () ")"))) (; ";")) (expression_statement "FUN_00149d14(*(undefined4 *)(param_1 + 8));" (call_expression "FUN_00149d14(*(undefined4 *)(param_1 + 8))" (identifier "FUN_00149d14") (argument_list "(*(undefined4 *)(param_1 + 8))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 8)" (* "*") (cast_expression "(undefined4 *)(param_1 + 8)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")")))) () ")"))) (; ";")) (if_statement "if (DAT_0018d3b8 == 0) {\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }" (if "if") (parenthesized_expression "(DAT_0018d3b8 == 0)" (( "(") (binary_expression "DAT_0018d3b8 == 0" (identifier "DAT_0018d3b8") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);\n      }" ({ "{") (expression_statement "DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);" (assignment_expression "DAT_0018d3b8 = FUN_001330eb(FUN_0014a274)" (identifier "DAT_0018d3b8") (= "=") (call_expression "FUN_001330eb(FUN_0014a274)" (identifier "FUN_001330eb") (argument_list "(FUN_0014a274)" (( "(") (identifier "FUN_0014a274") () ")")))) (; ";")) (} "}"))) (expression_statement "FUN_00133134(DAT_0018d3b8,param_1);" (call_expression "FUN_00133134(DAT_0018d3b8,param_1)" (identifier "FUN_00133134") (argument_list "(DAT_0018d3b8,param_1)" (( "(") (identifier "DAT_0018d3b8") (, ",") (identifier "param_1") () ")"))) (; ";")) (return_statement "return;" (return "return") (; ";")) (} "}"))) (expression_statement "perror("unlockpt");" (call_expression "perror("unlockpt")" (identifier "perror") (argument_list "("unlockpt")" (( "(") (string_literal ""unlockpt"" (" """) (string_content "unlockpt") (" """)) () ")"))) (; ";")) (expression_statement "exit(1);" (call_expression "exit(1)" (identifier "exit") (argument_list "(1)" (( "(") (number_literal "1") () ")"))) (; ";")) (} "}"))) (expression_statement "perror("grantpt");" (call_expression "perror("grantpt")" (identifier "perror") (argument_list "("grantpt")" (( "(") (string_literal ""grantpt"" (" """) (string_content "grantpt") (" """)) () ")"))) (; ";")) (expression_statement "exit(1);" (call_expression "exit(1)" (identifier "exit") (argument_list "(1)" (( "(") (number_literal "1") () ")"))) (; ";")) (} "}")))

void function_1(type_1 pty)

{
  int var_2;
  char *__src;
  
  var_2 = var_1(0x102);
  pty->master_fd = var_2;
  if (var_2 < 0) {
    var_3("posix_openpt");
                    /* WARNING: Subroutine does not return */
    var_4(1);
  }
  var_2 = var_5(var_2);
  if (-1 < var_2) {
    var_2 = var_6(pty->master_fd);
    if (-1 < var_2) {
      var_7(pty->master_fd);
      pty->name[0xfff] = '\0';
      __src = var_8(pty->master_fd);
      var_9(pty->name,__src,0xfff);
      var_10(pty->master_fd);
      if (var_11 == (type_2 *)0x0) {
        var_11 = var_12(pty_compare_by_fd);
      }
      var_13(var_11,pty);
      return;
    }
    var_3("unlockpt");
                    /* WARNING: Subroutine does not return */
    var_4(1);
  }
  var_3("grantpt");
                    /* WARNING: Subroutine does not return */
  var_4(1);
}


(translation_unit (function_definition type: (primitive_type) 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))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (number_literal))))) (expression_statement (assignment_expression left: (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))) right: (identifier))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (number_literal) right: (identifier))) consequence: (compound_statement (expression_statement (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)))))))) (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: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (pointer_expression argument: (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (cast_expression type: (type_descriptor type: (primitive_type) declarator: (abstract_pointer_declarator)) value: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (identifier) (number_literal)))) (expression_statement (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)))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (return_statement))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (string_literal (string_content))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (number_literal)))))))

void MASKED(long param_1)

{
  int iVar1;
  char *__src;
  
  iVar1 = posix_openpt(0x102);
  *(int *)(param_1 + 8) = iVar1;
  if (iVar1 < 0) {
    perror("posix_openpt");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  iVar1 = grantpt(iVar1);
  if (-1 < iVar1) {
    iVar1 = unlockpt(*(int *)(param_1 + 8));
    if (-1 < iVar1) {
      FUN_00149bd0(*(undefined4 *)(param_1 + 8));
      *(undefined1 *)(param_1 + 0x1017) = 0;
      __src = ptsname(*(int *)(param_1 + 8));
      strncpy((char *)(param_1 + 0x18),__src,0xfff);
      FUN_00149d14(*(undefined4 *)(param_1 + 8));
      if (DAT_0018d3b8 == 0) {
        DAT_0018d3b8 = FUN_001330eb(FUN_0014a274);
      }
      FUN_00133134(DAT_0018d3b8,param_1);
      return;
    }
    perror("unlockpt");
                    /* WARNING: Subroutine does not return */
    exit(1);
  }
  perror("grantpt");
                    /* WARNING: Subroutine does not return */
  exit(1);
}

