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

int MHD_create_thread_(MHD_thread_handle_ID_ *thread,size_t stack_size,
                      MHD_THREAD_START_ROUTINE_ start_routine,void *arg)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  pthread_attr_t attr;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x22d19;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (stack_size == 0) {
    iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,
                           arg);
LAB_00022d97:
    if (iVar1 == 0) goto LAB_00022d67;
  }
  else {
    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);
    if (iVar1 == 0) {
      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);
      if (iVar1 == 0) {
        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,
                               (__start_routine *)start_routine,arg);
      }
      pthread_attr_destroy((pthread_attr_t *)&attr);
      goto LAB_00022d97;
    }
  }
  piVar2 = __errno_location();
  *piVar2 = iVar1;
LAB_00022d67:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail_local();
  }
  return (uint)(iVar1 == 0);
}



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

bool FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  pthread_attr_t local_44;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x22d19;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 == 0) {
    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);
LAB_00022d97:
    if (iVar1 == 0) goto LAB_00022d67;
  }
  else {
    iVar1 = pthread_attr_init(&local_44);
    if (iVar1 == 0) {
      iVar1 = pthread_attr_setstacksize(&local_44,param_2);
      if (iVar1 == 0) {
        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);
      }
      pthread_attr_destroy(&local_44);
      goto LAB_00022d97;
    }
  }
  piVar2 = __errno_location();
  *piVar2 = iVar1;
LAB_00022d67:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_00028540();
  }
  return iVar1 == 0;
}


PUSH EBP
PUSH EDI
PUSH ESI
PUSH EBX
CALL 0x00013810
ADD EBX,0x110c7
SUB ESP,0x4c
MOV EAX,GS:[0x14]
MOV dword ptr [ESP + 0x3c],EAX
XOR EAX,EAX
MOV EAX,dword ptr [ESP + 0x64]
MOV EDI,dword ptr [ESP + 0x60]
MOV EDX,dword ptr [ESP + 0x68]
MOV ECX,dword ptr [ESP + 0x6c]
TEST EAX,EAX
JZ 0x00022d88
MOV dword ptr [ESP + 0xc],ECX
SUB ESP,0xc
MOV dword ptr [ESP + 0x14],EDX
LEA EBP,[ESP + 0x24]
PUSH EBP
CALL 0x000130b0
ADD ESP,0x10
MOV ESI,EAX
TEST EAX,EAX
JZ 0x00022da0
CALL 0x000134b0
MOV dword ptr [EAX],ESI
XOR EAX,EAX
TEST ESI,ESI
SETZ AL
MOV EDI,dword ptr [ESP + 0x3c]
XOR EDI,dword ptr GS:[0x14]
JNZ 0x00022de0
ADD ESP,0x4c
POP EBX
POP ESI
POP EDI
POP EBP
RET
PUSH ECX
PUSH EDX
PUSH 0x0
PUSH EDI
CALL 0x000136e0
ADD ESP,0x10
MOV ESI,EAX
TEST ESI,ESI
JZ 0x00022d67
JMP 0x00022d60
SUB ESP,0x8
PUSH dword ptr [ESP + 0x6c]
PUSH EBP
CALL 0x00013550
ADD ESP,0x10
MOV EDX,dword ptr [ESP + 0x8]
MOV ECX,dword ptr [ESP + 0xc]
TEST EAX,EAX
MOV ESI,EAX
JZ 0x00022dd0
SUB ESP,0xc
PUSH EBP
CALL 0x00013120
ADD ESP,0x10
JMP 0x00022d97
PUSH ECX
PUSH EDX
PUSH EBP
PUSH EDI
CALL 0x000136e0
ADD ESP,0x10
MOV ESI,EAX
JMP 0x00022dbe
CALL 0x00028540
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nbool FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}\n\n" comment (function_definition "bool FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}" primitive_type (function_declarator "FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)" identifier (parameter_list "(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)" ( (parameter_declaration "pthread_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "__start_routine *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "void *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pthread_attr_t local_44;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x22d19;" (assignment_expression "uStack_14 = 0x22d19" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }" { (expression_statement "iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);" (assignment_expression "iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4)" identifier = (call_expression "pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4)" identifier (argument_list "(param_1,(pthread_attr_t *)0x0,param_3,param_4)" ( identifier , (cast_expression "(pthread_attr_t *)0x0" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , identifier )))) ;) (labeled_statement "LAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;" statement_identifier : (if_statement "if (iVar1 == 0) goto LAB_00022d67;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00022d67;" goto statement_identifier ;))) }) (else_clause "else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" else (compound_statement "{\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" { (expression_statement "iVar1 = pthread_attr_init(&local_44);" (assignment_expression "iVar1 = pthread_attr_init(&local_44)" identifier = (call_expression "pthread_attr_init(&local_44)" identifier (argument_list "(&local_44)" ( (pointer_expression "&local_44" & identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }" { (expression_statement "iVar1 = pthread_attr_setstacksize(&local_44,param_2);" (assignment_expression "iVar1 = pthread_attr_setstacksize(&local_44,param_2)" identifier = (call_expression "pthread_attr_setstacksize(&local_44,param_2)" identifier (argument_list "(&local_44,param_2)" ( (pointer_expression "&local_44" & identifier) , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }" { (expression_statement "iVar1 = pthread_create(param_1,&local_44,param_3,param_4);" (assignment_expression "iVar1 = pthread_create(param_1,&local_44,param_3,param_4)" identifier = (call_expression "pthread_create(param_1,&local_44,param_3,param_4)" identifier (argument_list "(param_1,&local_44,param_3,param_4)" ( identifier , (pointer_expression "&local_44" & identifier) , identifier , identifier )))) ;) })) (expression_statement "pthread_attr_destroy(&local_44);" (call_expression "pthread_attr_destroy(&local_44)" identifier (argument_list "(&local_44)" ( (pointer_expression "&local_44" & identifier) ))) ;) (goto_statement "goto LAB_00022d97;" goto statement_identifier ;) })) }))) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (labeled_statement "LAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00028540();\n  }" statement_identifier : (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    FUN_00028540();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    FUN_00028540();\n  }" { comment (expression_statement "FUN_00028540();" (call_expression "FUN_00028540()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return iVar1 == 0;" return (binary_expression "iVar1 == 0" identifier == number_literal) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n/* WARNING: Unknown calling convention */\n\nint MHD_create_thread_(MHD_thread_handle_ID_ *thread,size_t stack_size,\n                      MHD_THREAD_START_ROUTINE_ start_routine,void *arg)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t attr;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (stack_size == 0) {\n    iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return (uint)(iVar1 == 0);\n}\n\n" comment comment (function_definition "int MHD_create_thread_(MHD_thread_handle_ID_ *thread,size_t stack_size,\n                      MHD_THREAD_START_ROUTINE_ start_routine,void *arg)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t attr;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (stack_size == 0) {\n    iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return (uint)(iVar1 == 0);\n}" primitive_type (function_declarator "MHD_create_thread_(MHD_thread_handle_ID_ *thread,size_t stack_size,\n                      MHD_THREAD_START_ROUTINE_ start_routine,void *arg)" identifier (parameter_list "(MHD_thread_handle_ID_ *thread,size_t stack_size,\n                      MHD_THREAD_START_ROUTINE_ start_routine,void *arg)" ( (parameter_declaration "MHD_thread_handle_ID_ *thread" type_identifier (pointer_declarator "*thread" * identifier)) , (parameter_declaration "size_t stack_size" primitive_type identifier) , (parameter_declaration "MHD_THREAD_START_ROUTINE_ start_routine" type_identifier identifier) , (parameter_declaration "void *arg" primitive_type (pointer_declarator "*arg" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t attr;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (stack_size == 0) {\n    iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }\n  return (uint)(iVar1 == 0);\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pthread_attr_t attr;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x22d19;" (assignment_expression "uStack_14 = 0x22d19" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (stack_size == 0) {\n    iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }\n  }" if (parenthesized_expression "(stack_size == 0)" ( (binary_expression "stack_size == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }" { (expression_statement "iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg);" (assignment_expression "iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg)" identifier = (call_expression "pthread_create(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg)" identifier (argument_list "(&thread->handle,(pthread_attr_t *)0x0,(__start_routine *)start_routine,\n                           arg)" ( (pointer_expression "&thread->handle" & (field_expression "thread->handle" identifier -> field_identifier)) , (cast_expression "(pthread_attr_t *)0x0" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , (cast_expression "(__start_routine *)start_routine" ( (type_descriptor "__start_routine *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier )))) ;) (labeled_statement "LAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;" statement_identifier : (if_statement "if (iVar1 == 0) goto LAB_00022d67;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00022d67;" goto statement_identifier ;))) }) (else_clause "else {\n    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }\n  }" else (compound_statement "{\n    iVar1 = pthread_attr_init((pthread_attr_t *)&attr);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }\n  }" { (expression_statement "iVar1 = pthread_attr_init((pthread_attr_t *)&attr);" (assignment_expression "iVar1 = pthread_attr_init((pthread_attr_t *)&attr)" identifier = (call_expression "pthread_attr_init((pthread_attr_t *)&attr)" identifier (argument_list "((pthread_attr_t *)&attr)" ( (cast_expression "(pthread_attr_t *)&attr" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&attr" & identifier)) )))) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }\n      pthread_attr_destroy((pthread_attr_t *)&attr);\n      goto LAB_00022d97;\n    }" { (expression_statement "iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size);" (assignment_expression "iVar1 = pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size)" identifier = (call_expression "pthread_attr_setstacksize((pthread_attr_t *)&attr,stack_size)" identifier (argument_list "((pthread_attr_t *)&attr,stack_size)" ( (cast_expression "(pthread_attr_t *)&attr" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&attr" & identifier)) , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);\n      }" { (expression_statement "iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg);" (assignment_expression "iVar1 = pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg)" identifier = (call_expression "pthread_create(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg)" identifier (argument_list "(&thread->handle,(pthread_attr_t *)&attr,\n                               (__start_routine *)start_routine,arg)" ( (pointer_expression "&thread->handle" & (field_expression "thread->handle" identifier -> field_identifier)) , (cast_expression "(pthread_attr_t *)&attr" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&attr" & identifier)) , (cast_expression "(__start_routine *)start_routine" ( (type_descriptor "__start_routine *" type_identifier (abstract_pointer_declarator "*" *)) ) identifier) , identifier )))) ;) })) (expression_statement "pthread_attr_destroy((pthread_attr_t *)&attr);" (call_expression "pthread_attr_destroy((pthread_attr_t *)&attr)" identifier (argument_list "((pthread_attr_t *)&attr)" ( (cast_expression "(pthread_attr_t *)&attr" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) (pointer_expression "&attr" & identifier)) ))) ;) (goto_statement "goto LAB_00022d97;" goto statement_identifier ;) })) }))) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (labeled_statement "LAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" statement_identifier : (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail_local();\n  }" { comment (expression_statement "__stack_chk_fail_local();" (call_expression "__stack_chk_fail_local()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return (uint)(iVar1 == 0);" return (call_expression "(uint)(iVar1 == 0)" (parenthesized_expression "(uint)" ( identifier )) (argument_list "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) ))) ;) })))
(translation_unit "bool FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}\n\n" (function_definition "bool FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}" primitive_type (function_declarator "FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)" identifier (parameter_list "(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)" ( (parameter_declaration "pthread_t *param_1" type_identifier (pointer_declarator "*param_1" * identifier)) , (parameter_declaration "size_t param_2" primitive_type identifier) , (parameter_declaration "__start_routine *param_3" type_identifier (pointer_declarator "*param_3" * identifier)) , (parameter_declaration "void *param_4" primitive_type (pointer_declarator "*param_4" * identifier)) ))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "int *piVar2;" primitive_type (pointer_declarator "*piVar2" * identifier) ;) (declaration "int in_GS_OFFSET;" primitive_type identifier ;) (declaration "pthread_attr_t local_44;" type_identifier identifier ;) (declaration "int local_20;" primitive_type identifier ;) (declaration "undefined4 uStack_14;" type_identifier identifier ;) (expression_statement "uStack_14 = 0x22d19;" (assignment_expression "uStack_14 = 0x22d19" identifier = number_literal) ;) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" identifier = (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) ;) (if_statement "if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" if (parenthesized_expression "(param_2 == 0)" ( (binary_expression "param_2 == 0" identifier == number_literal) )) (compound_statement "{\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }" { (expression_statement "iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);" (assignment_expression "iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4)" identifier = (call_expression "pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4)" identifier (argument_list "(param_1,(pthread_attr_t *)0x0,param_3,param_4)" ( identifier , (cast_expression "(pthread_attr_t *)0x0" ( (type_descriptor "pthread_attr_t *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal) , identifier , identifier )))) ;) (labeled_statement "LAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;" statement_identifier : (if_statement "if (iVar1 == 0) goto LAB_00022d67;" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (goto_statement "goto LAB_00022d67;" goto statement_identifier ;))) }) (else_clause "else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" else (compound_statement "{\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" { (expression_statement "iVar1 = pthread_attr_init(&local_44);" (assignment_expression "iVar1 = pthread_attr_init(&local_44)" identifier = (call_expression "pthread_attr_init(&local_44)" identifier (argument_list "(&local_44)" ( (pointer_expression "&local_44" & identifier) )))) ;) (if_statement "if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }" { (expression_statement "iVar1 = pthread_attr_setstacksize(&local_44,param_2);" (assignment_expression "iVar1 = pthread_attr_setstacksize(&local_44,param_2)" identifier = (call_expression "pthread_attr_setstacksize(&local_44,param_2)" identifier (argument_list "(&local_44,param_2)" ( (pointer_expression "&local_44" & identifier) , identifier )))) ;) (if_statement "if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }" { (expression_statement "iVar1 = pthread_create(param_1,&local_44,param_3,param_4);" (assignment_expression "iVar1 = pthread_create(param_1,&local_44,param_3,param_4)" identifier = (call_expression "pthread_create(param_1,&local_44,param_3,param_4)" identifier (argument_list "(param_1,&local_44,param_3,param_4)" ( identifier , (pointer_expression "&local_44" & identifier) , identifier , identifier )))) ;) })) (expression_statement "pthread_attr_destroy(&local_44);" (call_expression "pthread_attr_destroy(&local_44)" identifier (argument_list "(&local_44)" ( (pointer_expression "&local_44" & identifier) ))) ;) (goto_statement "goto LAB_00022d97;" goto statement_identifier ;) })) }))) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" identifier = (call_expression "__errno_location()" identifier (argument_list "()" ( )))) ;) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" * identifier) = identifier) ;) (labeled_statement "LAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }" statement_identifier : (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }" if (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" ( (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" identifier != (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" * (cast_expression "(int *)(in_GS_OFFSET + 0x14)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_GS_OFFSET + 0x14)" ( (binary_expression "in_GS_OFFSET + 0x14" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    FUN_00028540();\n  }" { (expression_statement "FUN_00028540();" (call_expression "FUN_00028540()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return iVar1 == 0;" return (binary_expression "iVar1 == 0" identifier == number_literal) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE (pointer_declarator * IDENT)) , (parameter_declaration TYPE (pointer_declarator * IDENT)) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (declaration TYPE IDENT ;) (expression_statement (assignment_expression IDENT = LIT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT) , IDENT , IDENT )))) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (goto_statement goto statement_identifier ;))) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( (pointer_expression & IDENT) , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , (pointer_expression & IDENT) , IDENT , IDENT )))) ;) })) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression & IDENT) ))) ;) (goto_statement goto statement_identifier ;) })) }))) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( )))) ;) (expression_statement (assignment_expression (pointer_expression * IDENT) = IDENT) ;) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (return_statement return (binary_expression IDENT == LIT) ;) })))
(function_definition "bool FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)\n\n{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}" (primitive_type "bool") (function_declarator "FUN_00022d10(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)" (identifier "FUN_00022d10") (parameter_list "(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)" (( "(") (parameter_declaration "pthread_t *param_1" (type_identifier "pthread_t") (pointer_declarator "*param_1" (* "*") (identifier "param_1"))) (, ",") (parameter_declaration "size_t param_2" (primitive_type "size_t") (identifier "param_2")) (, ",") (parameter_declaration "__start_routine *param_3" (type_identifier "__start_routine") (pointer_declarator "*param_3" (* "*") (identifier "param_3"))) (, ",") (parameter_declaration "void *param_4" (primitive_type "void") (pointer_declarator "*param_4" (* "*") (identifier "param_4"))) () ")"))) (compound_statement "{\n  int iVar1;\n  int *piVar2;\n  int in_GS_OFFSET;\n  pthread_attr_t local_44;\n  int local_20;\n  undefined4 uStack_14;\n  \n  uStack_14 = 0x22d19;\n  local_20 = *(int *)(in_GS_OFFSET + 0x14);\n  if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }\n  piVar2 = __errno_location();\n  *piVar2 = iVar1;\nLAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }\n  return iVar1 == 0;\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "int *piVar2;" (primitive_type "int") (pointer_declarator "*piVar2" (* "*") (identifier "piVar2")) (; ";")) (declaration "int in_GS_OFFSET;" (primitive_type "int") (identifier "in_GS_OFFSET") (; ";")) (declaration "pthread_attr_t local_44;" (type_identifier "pthread_attr_t") (identifier "local_44") (; ";")) (declaration "int local_20;" (primitive_type "int") (identifier "local_20") (; ";")) (declaration "undefined4 uStack_14;" (type_identifier "undefined4") (identifier "uStack_14") (; ";")) (expression_statement "uStack_14 = 0x22d19;" (assignment_expression "uStack_14 = 0x22d19" (identifier "uStack_14") (= "=") (number_literal "0x22d19")) (; ";")) (expression_statement "local_20 = *(int *)(in_GS_OFFSET + 0x14);" (assignment_expression "local_20 = *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (= "=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) (; ";")) (if_statement "if (param_2 == 0) {\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }\n  else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" (if "if") (parenthesized_expression "(param_2 == 0)" (( "(") (binary_expression "param_2 == 0" (identifier "param_2") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);\nLAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;\n  }" ({ "{") (expression_statement "iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);" (assignment_expression "iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4)" (identifier "iVar1") (= "=") (call_expression "pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4)" (identifier "pthread_create") (argument_list "(param_1,(pthread_attr_t *)0x0,param_3,param_4)" (( "(") (identifier "param_1") (, ",") (cast_expression "(pthread_attr_t *)0x0" (( "(") (type_descriptor "pthread_attr_t *" (type_identifier "pthread_attr_t") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0")) (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (labeled_statement "LAB_00022d97:\n    if (iVar1 == 0) goto LAB_00022d67;" (statement_identifier "LAB_00022d97") (: ":") (if_statement "if (iVar1 == 0) goto LAB_00022d67;" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (goto_statement "goto LAB_00022d67;" (goto "goto") (statement_identifier "LAB_00022d67") (; ";")))) (} "}")) (else_clause "else {\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" (else "else") (compound_statement "{\n    iVar1 = pthread_attr_init(&local_44);\n    if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }\n  }" ({ "{") (expression_statement "iVar1 = pthread_attr_init(&local_44);" (assignment_expression "iVar1 = pthread_attr_init(&local_44)" (identifier "iVar1") (= "=") (call_expression "pthread_attr_init(&local_44)" (identifier "pthread_attr_init") (argument_list "(&local_44)" (( "(") (pointer_expression "&local_44" (& "&") (identifier "local_44")) () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      iVar1 = pthread_attr_setstacksize(&local_44,param_2);\n      if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }\n      pthread_attr_destroy(&local_44);\n      goto LAB_00022d97;\n    }" ({ "{") (expression_statement "iVar1 = pthread_attr_setstacksize(&local_44,param_2);" (assignment_expression "iVar1 = pthread_attr_setstacksize(&local_44,param_2)" (identifier "iVar1") (= "=") (call_expression "pthread_attr_setstacksize(&local_44,param_2)" (identifier "pthread_attr_setstacksize") (argument_list "(&local_44,param_2)" (( "(") (pointer_expression "&local_44" (& "&") (identifier "local_44")) (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if (iVar1 == 0) {\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);\n      }" ({ "{") (expression_statement "iVar1 = pthread_create(param_1,&local_44,param_3,param_4);" (assignment_expression "iVar1 = pthread_create(param_1,&local_44,param_3,param_4)" (identifier "iVar1") (= "=") (call_expression "pthread_create(param_1,&local_44,param_3,param_4)" (identifier "pthread_create") (argument_list "(param_1,&local_44,param_3,param_4)" (( "(") (identifier "param_1") (, ",") (pointer_expression "&local_44" (& "&") (identifier "local_44")) (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (; ";")) (} "}"))) (expression_statement "pthread_attr_destroy(&local_44);" (call_expression "pthread_attr_destroy(&local_44)" (identifier "pthread_attr_destroy") (argument_list "(&local_44)" (( "(") (pointer_expression "&local_44" (& "&") (identifier "local_44")) () ")"))) (; ";")) (goto_statement "goto LAB_00022d97;" (goto "goto") (statement_identifier "LAB_00022d97") (; ";")) (} "}"))) (} "}")))) (expression_statement "piVar2 = __errno_location();" (assignment_expression "piVar2 = __errno_location()" (identifier "piVar2") (= "=") (call_expression "__errno_location()" (identifier "__errno_location") (argument_list "()" (( "(") () ")")))) (; ";")) (expression_statement "*piVar2 = iVar1;" (assignment_expression "*piVar2 = iVar1" (pointer_expression "*piVar2" (* "*") (identifier "piVar2")) (= "=") (identifier "iVar1")) (; ";")) (labeled_statement "LAB_00022d67:\n  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }" (statement_identifier "LAB_00022d67") (: ":") (if_statement "if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {\n                    \n    FUN_00028540();\n  }" (if "if") (parenthesized_expression "(local_20 != *(int *)(in_GS_OFFSET + 0x14))" (( "(") (binary_expression "local_20 != *(int *)(in_GS_OFFSET + 0x14)" (identifier "local_20") (!= "!=") (pointer_expression "*(int *)(in_GS_OFFSET + 0x14)" (* "*") (cast_expression "(int *)(in_GS_OFFSET + 0x14)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_GS_OFFSET + 0x14)" (( "(") (binary_expression "in_GS_OFFSET + 0x14" (identifier "in_GS_OFFSET") (+ "+") (number_literal "0x14")) () ")"))))) () ")")) (compound_statement "{\n                    \n    FUN_00028540();\n  }" ({ "{") (expression_statement "FUN_00028540();" (call_expression "FUN_00028540()" (identifier "FUN_00028540") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (return_statement "return iVar1 == 0;" (return "return") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) (; ";")) (} "}")))

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

int function_1(type_1 *thread,size_t var_2,
                      type_2 start_routine,void *arg)

{
  int var_4;
  int *piVar2;
  int var_1;
  type_3 attr;
  int var_9;
  type_4 uStack_14;
  
  uStack_14 = 0x22d19;
  var_9 = *(int *)(var_1 + 0x14);
  if (var_2 == 0) {
    var_4 = var_3(&thread->handle,(type_3 *)0x0,(type_5 *)start_routine,
                           arg);
LAB_00022d97:
    if (var_4 == 0) goto LAB_00022d67;
  }
  else {
    var_4 = var_5((type_3 *)&attr);
    if (var_4 == 0) {
      var_4 = var_6((type_3 *)&attr,var_2);
      if (var_4 == 0) {
        var_4 = var_3(&thread->handle,(type_3 *)&attr,
                               (type_5 *)start_routine,arg);
      }
      var_7((type_3 *)&attr);
      goto LAB_00022d97;
    }
  }
  piVar2 = var_8();
  *piVar2 = var_4;
LAB_00022d67:
  if (var_9 != *(int *)(var_1 + 0x14)) {
                    /* WARNING: Subroutine does not return */
    var_10();
  }
  return (uint)(var_4 == 0);
}


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

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

bool MASKED(pthread_t *param_1,size_t param_2,__start_routine *param_3,void *param_4)

{
  int iVar1;
  int *piVar2;
  int in_GS_OFFSET;
  pthread_attr_t local_44;
  int local_20;
  undefined4 uStack_14;
  
  uStack_14 = 0x22d19;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_2 == 0) {
    iVar1 = pthread_create(param_1,(pthread_attr_t *)0x0,param_3,param_4);
LAB_00022d97:
    if (iVar1 == 0) goto LAB_00022d67;
  }
  else {
    iVar1 = pthread_attr_init(&local_44);
    if (iVar1 == 0) {
      iVar1 = pthread_attr_setstacksize(&local_44,param_2);
      if (iVar1 == 0) {
        iVar1 = pthread_create(param_1,&local_44,param_3,param_4);
      }
      pthread_attr_destroy(&local_44);
      goto LAB_00022d97;
    }
  }
  piVar2 = __errno_location();
  *piVar2 = iVar1;
LAB_00022d67:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    FUN_00028540();
  }
  return iVar1 == 0;
}

