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

void * RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,void *value)

{
  ElementInfo *memory;
  _ElementInfo *p_Var1;
  ElementInfo *pEVar2;
  
  if (list_info == (LinkedListInfo *)0x0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,
                  "RemoveElementByValueFromLinkedList");
  }
  if (list_info->signature == 0xabacadab) {
    if ((list_info->elements != 0) && (value != (void *)0x0)) {
      LockSemaphoreInfo(list_info->semaphore);
      memory = list_info->head;
      if (memory->value == value) {
        p_Var1 = memory->next;
        if (memory == list_info->next) {
          list_info->next = p_Var1;
        }
        list_info->head = p_Var1;
        RelinquishMagickMemory(memory);
      }
      else {
        do {
          pEVar2 = memory;
          memory = pEVar2->next;
          if (memory == (_ElementInfo *)0x0) {
            UnlockSemaphoreInfo(list_info->semaphore);
            return (void *)0x0;
          }
        } while (memory->value != value);
        pEVar2->next = memory->next;
        if (memory == list_info->tail) {
          list_info->tail = pEVar2;
          p_Var1 = list_info->next;
        }
        else {
          p_Var1 = list_info->next;
        }
        if (memory == p_Var1) {
          list_info->next = memory->next;
        }
        RelinquishMagickMemory(memory);
      }
      list_info->elements = list_info->elements - 1;
      UnlockSemaphoreInfo(list_info->semaphore);
      return value;
    }
    return (void *)0x0;
  }
                    /* WARNING: Subroutine does not return */
  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,
                "RemoveElementByValueFromLinkedList");
}



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

int RemoveElementByValueFromLinkedList(int param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  int *piVar3;
  
  if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,
                  "RemoveElementByValueFromLinkedList");
  }
  if (*(int *)(param_1 + 0x18) == -0x54535255) {
    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {
      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));
      piVar1 = *(int **)(param_1 + 8);
      if (*piVar1 == param_2) {
        iVar2 = piVar1[1];
        if (piVar1 == *(int **)(param_1 + 0x10)) {
          *(int *)(param_1 + 0x10) = iVar2;
        }
        *(int *)(param_1 + 8) = iVar2;
        RelinquishMagickMemory(piVar1);
      }
      else {
        do {
          piVar3 = piVar1;
          piVar1 = (int *)piVar3[1];
          if (piVar1 == (int *)0x0) {
            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));
            return 0;
          }
        } while (*piVar1 != param_2);
        piVar3[1] = piVar1[1];
        if (piVar1 == *(int **)(param_1 + 0xc)) {
          *(int **)(param_1 + 0xc) = piVar3;
          piVar3 = *(int **)(param_1 + 0x10);
        }
        else {
          piVar3 = *(int **)(param_1 + 0x10);
        }
        if (piVar1 == piVar3) {
          *(int *)(param_1 + 0x10) = piVar1[1];
        }
        RelinquishMagickMemory(piVar1);
      }
      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;
      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));
      return param_2;
    }
    return 0;
  }
                    /* WARNING: Subroutine does not return */
  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,
                "RemoveElementByValueFromLinkedList");
}


PUSH EDI
PUSH ESI
PUSH EBX
MOV ESI,dword ptr [ESP + 0x10]
CALL 0x00038830
ADD EBX,0x2ea3a4
MOV EDI,dword ptr [ESP + 0x14]
TEST ESI,ESI
JZ 0x000eed45
CMP dword ptr [ESI + 0x18],0xabacadab
JNZ 0x000eed64
MOV EAX,dword ptr [ESI + 0x4]
TEST EAX,EAX
JZ 0x000eecbb
TEST EDI,EDI
JZ 0x000eecbb
SUB ESP,0xc
PUSH dword ptr [ESI + 0x14]
CALL 0x00031050
MOV ECX,dword ptr [ESI + 0x8]
ADD ESP,0x10
CMP dword ptr [ECX],EDI
JNZ 0x000eeca6
JMP 0x000eed00
CMP dword ptr [EDX],EDI
JZ 0x000eecc8
MOV ECX,EDX
MOV EDX,dword ptr [ECX + 0x4]
TEST EDX,EDX
JNZ 0x000eeca0
SUB ESP,0xc
PUSH dword ptr [ESI + 0x14]
CALL 0x00031da0
ADD ESP,0x10
POP EBX
XOR EAX,EAX
POP ESI
POP EDI
RET
MOV EAX,dword ptr [EDX + 0x4]
MOV dword ptr [ECX + 0x4],EAX
CMP EDX,dword ptr [ESI + 0xc]
JZ 0x000eed30
CMP EDX,dword ptr [ESI + 0x10]
JZ 0x000eed20
SUB ESP,0xc
PUSH EDX
CALL 0x00033ac8
ADD ESP,0x10
SUB dword ptr [ESI + 0x4],0x1
SUB ESP,0xc
PUSH dword ptr [ESI + 0x14]
CALL 0x00031da0
ADD ESP,0x10
MOV EAX,EDI
POP EBX
POP ESI
POP EDI
RET
MOV EAX,dword ptr [ECX + 0x4]
CMP ECX,dword ptr [ESI + 0x10]
JZ 0x000eed40
SUB ESP,0xc
MOV dword ptr [ESI + 0x8],EAX
PUSH ECX
CALL 0x00033ac8
ADD ESP,0x10
JMP 0x000eece4
MOV EAX,dword ptr [EDX + 0x4]
MOV dword ptr [ESI + 0x10],EAX
JMP 0x000eecd8
MOV dword ptr [ESI + 0xc],ECX
CMP EDX,dword ptr [ESI + 0x10]
JNZ 0x000eecd8
JMP 0x000eed20
MOV dword ptr [ESI + 0x10],EAX
JMP 0x000eed08
LEA EAX,[EBX + 0xffedf480]
PUSH EAX
LEA EAX,[EBX + 0xffedf3a3]
PUSH 0x2fa
PUSH EAX
LEA EAX,[EBX + 0xffedf3bc]
PUSH EAX
CALL 0x000313d0
LEA EAX,[EBX + 0xffedf480]
PUSH EAX
LEA EAX,[EBX + 0xffedf3a3]
PUSH 0x2fb
PUSH EAX
LEA EAX,[EBX + 0xffedf3e4]
PUSH EAX
CALL 0x000313d0
(translation_unit "/* WARNING: Function: __i686.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nint RemoveElementByValueFromLinkedList(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}\n\n" comment (function_definition "int RemoveElementByValueFromLinkedList(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" primitive_type (function_declarator "RemoveElementByValueFromLinkedList(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (if_statement "if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" { comment (expression_statement "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" identifier (argument_list "("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" ( (string_literal ""list_info != (LinkedListInfo *) NULL"" " string_content ") , (string_literal ""MagickCore/linked-list.c"" " string_content ") , number_literal , (string_literal ""RemoveElementByValueFromLinkedList"" " string_content ") ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x18) == -0x54535255)" ( (binary_expression "*(int *)(param_1 + 0x18) == -0x54535255" (pointer_expression "*(int *)(param_1 + 0x18)" * (cast_expression "(int *)(param_1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }" { (if_statement "if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }" if (parenthesized_expression "((*(int *)(param_1 + 4) != 0) && (param_2 != 0))" ( (binary_expression "(*(int *)(param_1 + 4) != 0) && (param_2 != 0)" (parenthesized_expression "(*(int *)(param_1 + 4) != 0)" ( (binary_expression "*(int *)(param_1 + 4) != 0" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) ))) )) (compound_statement "{\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }" { (expression_statement "LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x14))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) ))) ;) (expression_statement "piVar1 = *(int **)(param_1 + 8);" (assignment_expression "piVar1 = *(int **)(param_1 + 8)" identifier = (pointer_expression "*(int **)(param_1 + 8)" * (cast_expression "(int **)(param_1 + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (if_statement "if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" if (parenthesized_expression "(*piVar1 == param_2)" ( (binary_expression "*piVar1 == param_2" (pointer_expression "*piVar1" * identifier) == identifier) )) (compound_statement "{\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }" { (expression_statement "iVar2 = piVar1[1];" (assignment_expression "iVar2 = piVar1[1]" identifier = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) (if_statement "if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }" if (parenthesized_expression "(piVar1 == *(int **)(param_1 + 0x10))" ( (binary_expression "piVar1 == *(int **)(param_1 + 0x10)" identifier == (pointer_expression "*(int **)(param_1 + 0x10)" * (cast_expression "(int **)(param_1 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) )) (compound_statement "{\n          *(int *)(param_1 + 0x10) = iVar2;\n        }" { (expression_statement "*(int *)(param_1 + 0x10) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) })) (expression_statement "*(int *)(param_1 + 8) = iVar2;" (assignment_expression "*(int *)(param_1 + 8) = iVar2" (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) ;) (expression_statement "RelinquishMagickMemory(piVar1);" (call_expression "RelinquishMagickMemory(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) }) (else_clause "else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" else (compound_statement "{\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" { (do_statement "do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);" do (compound_statement "{\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        }" { (expression_statement "piVar3 = piVar1;" (assignment_expression "piVar3 = piVar1" identifier = identifier) ;) (expression_statement "piVar1 = (int *)piVar3[1];" (assignment_expression "piVar1 = (int *)piVar3[1]" identifier = (cast_expression "(int *)piVar3[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar3[1]" identifier [ number_literal ]))) ;) (if_statement "if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }" if (parenthesized_expression "(piVar1 == (int *)0x0)" ( (binary_expression "piVar1 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }" { (expression_statement "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x14))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) ))) ;) (return_statement "return 0;" return number_literal ;) })) }) while (parenthesized_expression "(*piVar1 != param_2)" ( (binary_expression "*piVar1 != param_2" (pointer_expression "*piVar1" * identifier) != identifier) )) ;) (expression_statement "piVar3[1] = piVar1[1];" (assignment_expression "piVar3[1] = piVar1[1]" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) (if_statement "if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" if (parenthesized_expression "(piVar1 == *(int **)(param_1 + 0xc))" ( (binary_expression "piVar1 == *(int **)(param_1 + 0xc)" identifier == (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) (compound_statement "{\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" { (expression_statement "*(int **)(param_1 + 0xc) = piVar3;" (assignment_expression "*(int **)(param_1 + 0xc) = piVar3" (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "piVar3 = *(int **)(param_1 + 0x10);" (assignment_expression "piVar3 = *(int **)(param_1 + 0x10)" identifier = (pointer_expression "*(int **)(param_1 + 0x10)" * (cast_expression "(int **)(param_1 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) }) (else_clause "else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" else (compound_statement "{\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" { (expression_statement "piVar3 = *(int **)(param_1 + 0x10);" (assignment_expression "piVar3 = *(int **)(param_1 + 0x10)" identifier = (pointer_expression "*(int **)(param_1 + 0x10)" * (cast_expression "(int **)(param_1 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) }))) (if_statement "if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }" if (parenthesized_expression "(piVar1 == piVar3)" ( (binary_expression "piVar1 == piVar3" identifier == identifier) )) (compound_statement "{\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }" { (expression_statement "*(int *)(param_1 + 0x10) = piVar1[1];" (assignment_expression "*(int *)(param_1 + 0x10) = piVar1[1]" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) })) (expression_statement "RelinquishMagickMemory(piVar1);" (call_expression "RelinquishMagickMemory(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) }))) (expression_statement "*(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;" (assignment_expression "*(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = (binary_expression "*(int *)(param_1 + 4) + -1" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) + number_literal)) ;) (expression_statement "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x14))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) ))) ;) (return_statement "return param_2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })) comment (expression_statement "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" identifier (argument_list "("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" ( (string_literal ""list_info->signature == MagickCoreSignature"" " string_content ") , (string_literal ""MagickCore/linked-list.c"" " string_content ") , number_literal , (string_literal ""RemoveElementByValueFromLinkedList"" " string_content ") ))) ;) })))
(translation_unit "/* WARNING: Function: __x86.get_pc_thunk.bx replaced with injection: get_pc_thunk_bx */\n\nvoid * RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,void *value)\n\n{\n  ElementInfo *memory;\n  _ElementInfo *p_Var1;\n  ElementInfo *pEVar2;\n  \n  if (list_info == (LinkedListInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (list_info->signature == 0xabacadab) {\n    if ((list_info->elements != 0) && (value != (void *)0x0)) {\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }\n    return (void *)0x0;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}\n\n" comment (function_definition "void * RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,void *value)\n\n{\n  ElementInfo *memory;\n  _ElementInfo *p_Var1;\n  ElementInfo *pEVar2;\n  \n  if (list_info == (LinkedListInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (list_info->signature == 0xabacadab) {\n    if ((list_info->elements != 0) && (value != (void *)0x0)) {\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }\n    return (void *)0x0;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" primitive_type (pointer_declarator "* RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,void *value)" * (function_declarator "RemoveElementByValueFromLinkedList(LinkedListInfo *list_info,void *value)" identifier (parameter_list "(LinkedListInfo *list_info,void *value)" ( (parameter_declaration "LinkedListInfo *list_info" type_identifier (pointer_declarator "*list_info" * identifier)) , (parameter_declaration "void *value" primitive_type (pointer_declarator "*value" * identifier)) )))) (compound_statement "{\n  ElementInfo *memory;\n  _ElementInfo *p_Var1;\n  ElementInfo *pEVar2;\n  \n  if (list_info == (LinkedListInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (list_info->signature == 0xabacadab) {\n    if ((list_info->elements != 0) && (value != (void *)0x0)) {\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }\n    return (void *)0x0;\n  }\n                    /* WARNING: Subroutine does not return */\n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" { (declaration "ElementInfo *memory;" type_identifier (pointer_declarator "*memory" * identifier) ;) (declaration "_ElementInfo *p_Var1;" type_identifier (pointer_declarator "*p_Var1" * identifier) ;) (declaration "ElementInfo *pEVar2;" type_identifier (pointer_declarator "*pEVar2" * identifier) ;) (if_statement "if (list_info == (LinkedListInfo *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" if (parenthesized_expression "(list_info == (LinkedListInfo *)0x0)" ( (binary_expression "list_info == (LinkedListInfo *)0x0" identifier == (cast_expression "(LinkedListInfo *)0x0" ( (type_descriptor "LinkedListInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" { comment (expression_statement "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" identifier (argument_list "("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" ( (string_literal ""list_info != (LinkedListInfo *) NULL"" " string_content ") , (string_literal ""MagickCore/linked-list.c"" " string_content ") , number_literal , (string_literal ""RemoveElementByValueFromLinkedList"" " string_content ") ))) ;) })) (if_statement "if (list_info->signature == 0xabacadab) {\n    if ((list_info->elements != 0) && (value != (void *)0x0)) {\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }\n    return (void *)0x0;\n  }" if (parenthesized_expression "(list_info->signature == 0xabacadab)" ( (binary_expression "list_info->signature == 0xabacadab" (field_expression "list_info->signature" identifier -> field_identifier) == number_literal) )) (compound_statement "{\n    if ((list_info->elements != 0) && (value != (void *)0x0)) {\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }\n    return (void *)0x0;\n  }" { (if_statement "if ((list_info->elements != 0) && (value != (void *)0x0)) {\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }" if (parenthesized_expression "((list_info->elements != 0) && (value != (void *)0x0))" ( (binary_expression "(list_info->elements != 0) && (value != (void *)0x0)" (parenthesized_expression "(list_info->elements != 0)" ( (binary_expression "list_info->elements != 0" (field_expression "list_info->elements" identifier -> field_identifier) != number_literal) )) && (parenthesized_expression "(value != (void *)0x0)" ( (binary_expression "value != (void *)0x0" identifier != (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) ))) )) (compound_statement "{\n      LockSemaphoreInfo(list_info->semaphore);\n      memory = list_info->head;\n      if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }\n      list_info->elements = list_info->elements - 1;\n      UnlockSemaphoreInfo(list_info->semaphore);\n      return value;\n    }" { (expression_statement "LockSemaphoreInfo(list_info->semaphore);" (call_expression "LockSemaphoreInfo(list_info->semaphore)" identifier (argument_list "(list_info->semaphore)" ( (field_expression "list_info->semaphore" identifier -> field_identifier) ))) ;) (expression_statement "memory = list_info->head;" (assignment_expression "memory = list_info->head" identifier = (field_expression "list_info->head" identifier -> field_identifier)) ;) (if_statement "if (memory->value == value) {\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }\n      else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }" if (parenthesized_expression "(memory->value == value)" ( (binary_expression "memory->value == value" (field_expression "memory->value" identifier -> field_identifier) == identifier) )) (compound_statement "{\n        p_Var1 = memory->next;\n        if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }\n        list_info->head = p_Var1;\n        RelinquishMagickMemory(memory);\n      }" { (expression_statement "p_Var1 = memory->next;" (assignment_expression "p_Var1 = memory->next" identifier = (field_expression "memory->next" identifier -> field_identifier)) ;) (if_statement "if (memory == list_info->next) {\n          list_info->next = p_Var1;\n        }" if (parenthesized_expression "(memory == list_info->next)" ( (binary_expression "memory == list_info->next" identifier == (field_expression "list_info->next" identifier -> field_identifier)) )) (compound_statement "{\n          list_info->next = p_Var1;\n        }" { (expression_statement "list_info->next = p_Var1;" (assignment_expression "list_info->next = p_Var1" (field_expression "list_info->next" identifier -> field_identifier) = identifier) ;) })) (expression_statement "list_info->head = p_Var1;" (assignment_expression "list_info->head = p_Var1" (field_expression "list_info->head" identifier -> field_identifier) = identifier) ;) (expression_statement "RelinquishMagickMemory(memory);" (call_expression "RelinquishMagickMemory(memory)" identifier (argument_list "(memory)" ( identifier ))) ;) }) (else_clause "else {\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }" else (compound_statement "{\n        do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);\n        pEVar2->next = memory->next;\n        if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }\n        if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }\n        RelinquishMagickMemory(memory);\n      }" { (do_statement "do {\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        } while (memory->value != value);" do (compound_statement "{\n          pEVar2 = memory;\n          memory = pEVar2->next;\n          if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }\n        }" { (expression_statement "pEVar2 = memory;" (assignment_expression "pEVar2 = memory" identifier = identifier) ;) (expression_statement "memory = pEVar2->next;" (assignment_expression "memory = pEVar2->next" identifier = (field_expression "pEVar2->next" identifier -> field_identifier)) ;) (if_statement "if (memory == (_ElementInfo *)0x0) {\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }" if (parenthesized_expression "(memory == (_ElementInfo *)0x0)" ( (binary_expression "memory == (_ElementInfo *)0x0" identifier == (cast_expression "(_ElementInfo *)0x0" ( (type_descriptor "_ElementInfo *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n            UnlockSemaphoreInfo(list_info->semaphore);\n            return (void *)0x0;\n          }" { (expression_statement "UnlockSemaphoreInfo(list_info->semaphore);" (call_expression "UnlockSemaphoreInfo(list_info->semaphore)" identifier (argument_list "(list_info->semaphore)" ( (field_expression "list_info->semaphore" identifier -> field_identifier) ))) ;) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) }) while (parenthesized_expression "(memory->value != value)" ( (binary_expression "memory->value != value" (field_expression "memory->value" identifier -> field_identifier) != identifier) )) ;) (expression_statement "pEVar2->next = memory->next;" (assignment_expression "pEVar2->next = memory->next" (field_expression "pEVar2->next" identifier -> field_identifier) = (field_expression "memory->next" identifier -> field_identifier)) ;) (if_statement "if (memory == list_info->tail) {\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }\n        else {\n          p_Var1 = list_info->next;\n        }" if (parenthesized_expression "(memory == list_info->tail)" ( (binary_expression "memory == list_info->tail" identifier == (field_expression "list_info->tail" identifier -> field_identifier)) )) (compound_statement "{\n          list_info->tail = pEVar2;\n          p_Var1 = list_info->next;\n        }" { (expression_statement "list_info->tail = pEVar2;" (assignment_expression "list_info->tail = pEVar2" (field_expression "list_info->tail" identifier -> field_identifier) = identifier) ;) (expression_statement "p_Var1 = list_info->next;" (assignment_expression "p_Var1 = list_info->next" identifier = (field_expression "list_info->next" identifier -> field_identifier)) ;) }) (else_clause "else {\n          p_Var1 = list_info->next;\n        }" else (compound_statement "{\n          p_Var1 = list_info->next;\n        }" { (expression_statement "p_Var1 = list_info->next;" (assignment_expression "p_Var1 = list_info->next" identifier = (field_expression "list_info->next" identifier -> field_identifier)) ;) }))) (if_statement "if (memory == p_Var1) {\n          list_info->next = memory->next;\n        }" if (parenthesized_expression "(memory == p_Var1)" ( (binary_expression "memory == p_Var1" identifier == identifier) )) (compound_statement "{\n          list_info->next = memory->next;\n        }" { (expression_statement "list_info->next = memory->next;" (assignment_expression "list_info->next = memory->next" (field_expression "list_info->next" identifier -> field_identifier) = (field_expression "memory->next" identifier -> field_identifier)) ;) })) (expression_statement "RelinquishMagickMemory(memory);" (call_expression "RelinquishMagickMemory(memory)" identifier (argument_list "(memory)" ( identifier ))) ;) }))) (expression_statement "list_info->elements = list_info->elements - 1;" (assignment_expression "list_info->elements = list_info->elements - 1" (field_expression "list_info->elements" identifier -> field_identifier) = (binary_expression "list_info->elements - 1" (field_expression "list_info->elements" identifier -> field_identifier) - number_literal)) ;) (expression_statement "UnlockSemaphoreInfo(list_info->semaphore);" (call_expression "UnlockSemaphoreInfo(list_info->semaphore)" identifier (argument_list "(list_info->semaphore)" ( (field_expression "list_info->semaphore" identifier -> field_identifier) ))) ;) (return_statement "return value;" return identifier ;) })) (return_statement "return (void *)0x0;" return (cast_expression "(void *)0x0" ( (type_descriptor "void *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal) ;) })) comment (expression_statement "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" identifier (argument_list "("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" ( (string_literal ""list_info->signature == MagickCoreSignature"" " string_content ") , (string_literal ""MagickCore/linked-list.c"" " string_content ") , number_literal , (string_literal ""RemoveElementByValueFromLinkedList"" " string_content ") ))) ;) })))
(translation_unit "int RemoveElementByValueFromLinkedList(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    \n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}\n\n" (function_definition "int RemoveElementByValueFromLinkedList(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    \n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" primitive_type (function_declarator "RemoveElementByValueFromLinkedList(int param_1,int param_2)" identifier (parameter_list "(int param_1,int param_2)" ( (parameter_declaration "int param_1" primitive_type identifier) , (parameter_declaration "int param_2" primitive_type identifier) ))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    \n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" { (declaration "int *piVar1;" primitive_type (pointer_declarator "*piVar1" * identifier) ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "int *piVar3;" primitive_type (pointer_declarator "*piVar3" * identifier) ;) (if_statement "if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" { (expression_statement "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" identifier (argument_list "("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" ( (string_literal ""list_info != (LinkedListInfo *) NULL"" " string_content ") , (string_literal ""MagickCore/linked-list.c"" " string_content ") , number_literal , (string_literal ""RemoveElementByValueFromLinkedList"" " string_content ") ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }" if (parenthesized_expression "(*(int *)(param_1 + 0x18) == -0x54535255)" ( (binary_expression "*(int *)(param_1 + 0x18) == -0x54535255" (pointer_expression "*(int *)(param_1 + 0x18)" * (cast_expression "(int *)(param_1 + 0x18)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x18)" ( (binary_expression "param_1 + 0x18" identifier + number_literal) )))) == number_literal) )) (compound_statement "{\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }" { (if_statement "if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }" if (parenthesized_expression "((*(int *)(param_1 + 4) != 0) && (param_2 != 0))" ( (binary_expression "(*(int *)(param_1 + 4) != 0) && (param_2 != 0)" (parenthesized_expression "(*(int *)(param_1 + 4) != 0)" ( (binary_expression "*(int *)(param_1 + 4) != 0" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) != number_literal) )) && (parenthesized_expression "(param_2 != 0)" ( (binary_expression "param_2 != 0" identifier != number_literal) ))) )) (compound_statement "{\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }" { (expression_statement "LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x14))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) ))) ;) (expression_statement "piVar1 = *(int **)(param_1 + 8);" (assignment_expression "piVar1 = *(int **)(param_1 + 8)" identifier = (pointer_expression "*(int **)(param_1 + 8)" * (cast_expression "(int **)(param_1 + 8)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 8)" ( (binary_expression "param_1 + 8" identifier + number_literal) ))))) ;) (if_statement "if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" if (parenthesized_expression "(*piVar1 == param_2)" ( (binary_expression "*piVar1 == param_2" (pointer_expression "*piVar1" * identifier) == identifier) )) (compound_statement "{\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }" { (expression_statement "iVar2 = piVar1[1];" (assignment_expression "iVar2 = piVar1[1]" identifier = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) (if_statement "if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }" if (parenthesized_expression "(piVar1 == *(int **)(param_1 + 0x10))" ( (binary_expression "piVar1 == *(int **)(param_1 + 0x10)" identifier == (pointer_expression "*(int **)(param_1 + 0x10)" * (cast_expression "(int **)(param_1 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) )) (compound_statement "{\n          *(int *)(param_1 + 0x10) = iVar2;\n        }" { (expression_statement "*(int *)(param_1 + 0x10) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = identifier) ;) })) (expression_statement "*(int *)(param_1 + 8) = iVar2;" (assignment_expression "*(int *)(param_1 + 8) = iVar2" (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) ;) (expression_statement "RelinquishMagickMemory(piVar1);" (call_expression "RelinquishMagickMemory(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) }) (else_clause "else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" else (compound_statement "{\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" { (do_statement "do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);" do (compound_statement "{\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        }" { (expression_statement "piVar3 = piVar1;" (assignment_expression "piVar3 = piVar1" identifier = identifier) ;) (expression_statement "piVar1 = (int *)piVar3[1];" (assignment_expression "piVar1 = (int *)piVar3[1]" identifier = (cast_expression "(int *)piVar3[1]" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (subscript_expression "piVar3[1]" identifier [ number_literal ]))) ;) (if_statement "if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }" if (parenthesized_expression "(piVar1 == (int *)0x0)" ( (binary_expression "piVar1 == (int *)0x0" identifier == (cast_expression "(int *)0x0" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }" { (expression_statement "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x14))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) ))) ;) (return_statement "return 0;" return number_literal ;) })) }) while (parenthesized_expression "(*piVar1 != param_2)" ( (binary_expression "*piVar1 != param_2" (pointer_expression "*piVar1" * identifier) != identifier) )) ;) (expression_statement "piVar3[1] = piVar1[1];" (assignment_expression "piVar3[1] = piVar1[1]" (subscript_expression "piVar3[1]" identifier [ number_literal ]) = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) (if_statement "if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" if (parenthesized_expression "(piVar1 == *(int **)(param_1 + 0xc))" ( (binary_expression "piVar1 == *(int **)(param_1 + 0xc)" identifier == (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) ))))) )) (compound_statement "{\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" { (expression_statement "*(int **)(param_1 + 0xc) = piVar3;" (assignment_expression "*(int **)(param_1 + 0xc) = piVar3" (pointer_expression "*(int **)(param_1 + 0xc)" * (cast_expression "(int **)(param_1 + 0xc)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0xc)" ( (binary_expression "param_1 + 0xc" identifier + number_literal) )))) = identifier) ;) (expression_statement "piVar3 = *(int **)(param_1 + 0x10);" (assignment_expression "piVar3 = *(int **)(param_1 + 0x10)" identifier = (pointer_expression "*(int **)(param_1 + 0x10)" * (cast_expression "(int **)(param_1 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) }) (else_clause "else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" else (compound_statement "{\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" { (expression_statement "piVar3 = *(int **)(param_1 + 0x10);" (assignment_expression "piVar3 = *(int **)(param_1 + 0x10)" identifier = (pointer_expression "*(int **)(param_1 + 0x10)" * (cast_expression "(int **)(param_1 + 0x10)" ( (type_descriptor "int **" primitive_type (abstract_pointer_declarator "**" * (abstract_pointer_declarator "*" *))) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) ))))) ;) }))) (if_statement "if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }" if (parenthesized_expression "(piVar1 == piVar3)" ( (binary_expression "piVar1 == piVar3" identifier == identifier) )) (compound_statement "{\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }" { (expression_statement "*(int *)(param_1 + 0x10) = piVar1[1];" (assignment_expression "*(int *)(param_1 + 0x10) = piVar1[1]" (pointer_expression "*(int *)(param_1 + 0x10)" * (cast_expression "(int *)(param_1 + 0x10)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x10)" ( (binary_expression "param_1 + 0x10" identifier + number_literal) )))) = (subscript_expression "piVar1[1]" identifier [ number_literal ])) ;) })) (expression_statement "RelinquishMagickMemory(piVar1);" (call_expression "RelinquishMagickMemory(piVar1)" identifier (argument_list "(piVar1)" ( identifier ))) ;) }))) (expression_statement "*(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;" (assignment_expression "*(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) = (binary_expression "*(int *)(param_1 + 4) + -1" (pointer_expression "*(int *)(param_1 + 4)" * (cast_expression "(int *)(param_1 + 4)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 4)" ( (binary_expression "param_1 + 4" identifier + number_literal) )))) + number_literal)) ;) (expression_statement "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" identifier (argument_list "(*(undefined4 *)(param_1 + 0x14))" ( (pointer_expression "*(undefined4 *)(param_1 + 0x14)" * (cast_expression "(undefined4 *)(param_1 + 0x14)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x14)" ( (binary_expression "param_1 + 0x14" identifier + number_literal) )))) ))) ;) (return_statement "return param_2;" return identifier ;) })) (return_statement "return 0;" return number_literal ;) })) (expression_statement "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" identifier (argument_list "("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" ( (string_literal ""list_info->signature == MagickCoreSignature"" " string_content ") , (string_literal ""MagickCore/linked-list.c"" " string_content ") , number_literal , (string_literal ""RemoveElementByValueFromLinkedList"" " string_content ") ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE (pointer_declarator * IDENT) ;) (declaration TYPE IDENT ;) (declaration TYPE (pointer_declarator * IDENT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) == LIT) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) != LIT) )) && (parenthesized_expression ( (binary_expression IDENT != LIT) ))) )) (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 IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (if_statement if (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) == IDENT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) })) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }) (else_clause else (compound_statement { (do_statement do (compound_statement { (expression_statement (assignment_expression IDENT = IDENT) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (subscript_expression IDENT [ LIT ]))) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) LIT)) )) (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) )))) ))) ;) (return_statement return LIT ;) })) }) while (parenthesized_expression ( (binary_expression (pointer_expression * IDENT) != IDENT) )) ;) (expression_statement (assignment_expression (subscript_expression IDENT [ LIT ]) = (subscript_expression IDENT [ LIT ])) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = IDENT) ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator * (abstract_pointer_declarator *))) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == IDENT) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (subscript_expression IDENT [ LIT ])) ;) })) (expression_statement (call_expression IDENT (argument_list ( IDENT ))) ;) }))) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + LIT)) ;) (expression_statement (call_expression IDENT (argument_list ( (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) ))) ;) (return_statement return IDENT ;) })) (return_statement return LIT ;) })) (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , LIT , (string_literal " string_content ") ))) ;) })))
(function_definition "int RemoveElementByValueFromLinkedList(int param_1,int param_2)\n\n{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    \n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" (primitive_type "int") (function_declarator "RemoveElementByValueFromLinkedList(int param_1,int param_2)" (identifier "RemoveElementByValueFromLinkedList") (parameter_list "(int param_1,int param_2)" (( "(") (parameter_declaration "int param_1" (primitive_type "int") (identifier "param_1")) (, ",") (parameter_declaration "int param_2" (primitive_type "int") (identifier "param_2")) () ")"))) (compound_statement "{\n  int *piVar1;\n  int iVar2;\n  int *piVar3;\n  \n  if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }\n  if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }\n                    \n  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");\n}" ({ "{") (declaration "int *piVar1;" (primitive_type "int") (pointer_declarator "*piVar1" (* "*") (identifier "piVar1")) (; ";")) (declaration "int iVar2;" (primitive_type "int") (identifier "iVar2") (; ";")) (declaration "int *piVar3;" (primitive_type "int") (pointer_declarator "*piVar3" (* "*") (identifier "piVar3")) (; ";")) (if_statement "if (param_1 == 0) {\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");\n  }" ({ "{") (expression_statement "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" (identifier "__assert_fail") (argument_list "("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,\n                  "RemoveElementByValueFromLinkedList")" (( "(") (string_literal ""list_info != (LinkedListInfo *) NULL"" (" """) (string_content "list_info != (LinkedListInfo *) NULL") (" """)) (, ",") (string_literal ""MagickCore/linked-list.c"" (" """) (string_content "MagickCore/linked-list.c") (" """)) (, ",") (number_literal "0x2fa") (, ",") (string_literal ""RemoveElementByValueFromLinkedList"" (" """) (string_content "RemoveElementByValueFromLinkedList") (" """)) () ")"))) (; ";")) (} "}"))) (if_statement "if (*(int *)(param_1 + 0x18) == -0x54535255) {\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x18) == -0x54535255)" (( "(") (binary_expression "*(int *)(param_1 + 0x18) == -0x54535255" (pointer_expression "*(int *)(param_1 + 0x18)" (* "*") (cast_expression "(int *)(param_1 + 0x18)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x18)" (( "(") (binary_expression "param_1 + 0x18" (identifier "param_1") (+ "+") (number_literal "0x18")) () ")")))) (== "==") (number_literal "-0x54535255")) () ")")) (compound_statement "{\n    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }\n    return 0;\n  }" ({ "{") (if_statement "if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }" (if "if") (parenthesized_expression "((*(int *)(param_1 + 4) != 0) && (param_2 != 0))" (( "(") (binary_expression "(*(int *)(param_1 + 4) != 0) && (param_2 != 0)" (parenthesized_expression "(*(int *)(param_1 + 4) != 0)" (( "(") (binary_expression "*(int *)(param_1 + 4) != 0" (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(param_2 != 0)" (( "(") (binary_expression "param_2 != 0" (identifier "param_2") (!= "!=") (number_literal "0")) () ")"))) () ")")) (compound_statement "{\n      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      piVar1 = *(int **)(param_1 + 8);\n      if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }\n      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;\n      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n      return param_2;\n    }" ({ "{") (expression_statement "LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" (identifier "LockSemaphoreInfo") (argument_list "(*(undefined4 *)(param_1 + 0x14))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) () ")"))) (; ";")) (expression_statement "piVar1 = *(int **)(param_1 + 8);" (assignment_expression "piVar1 = *(int **)(param_1 + 8)" (identifier "piVar1") (= "=") (pointer_expression "*(int **)(param_1 + 8)" (* "*") (cast_expression "(int **)(param_1 + 8)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 8)" (( "(") (binary_expression "param_1 + 8" (identifier "param_1") (+ "+") (number_literal "8")) () ")"))))) (; ";")) (if_statement "if (*piVar1 == param_2) {\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }\n      else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" (if "if") (parenthesized_expression "(*piVar1 == param_2)" (( "(") (binary_expression "*piVar1 == param_2" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (== "==") (identifier "param_2")) () ")")) (compound_statement "{\n        iVar2 = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }\n        *(int *)(param_1 + 8) = iVar2;\n        RelinquishMagickMemory(piVar1);\n      }" ({ "{") (expression_statement "iVar2 = piVar1[1];" (assignment_expression "iVar2 = piVar1[1]" (identifier "iVar2") (= "=") (subscript_expression "piVar1[1]" (identifier "piVar1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (piVar1 == *(int **)(param_1 + 0x10)) {\n          *(int *)(param_1 + 0x10) = iVar2;\n        }" (if "if") (parenthesized_expression "(piVar1 == *(int **)(param_1 + 0x10))" (( "(") (binary_expression "piVar1 == *(int **)(param_1 + 0x10)" (identifier "piVar1") (== "==") (pointer_expression "*(int **)(param_1 + 0x10)" (* "*") (cast_expression "(int **)(param_1 + 0x10)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) () ")")) (compound_statement "{\n          *(int *)(param_1 + 0x10) = iVar2;\n        }" ({ "{") (expression_statement "*(int *)(param_1 + 0x10) = iVar2;" (assignment_expression "*(int *)(param_1 + 0x10) = iVar2" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (identifier "iVar2")) (; ";")) (} "}"))) (expression_statement "*(int *)(param_1 + 8) = iVar2;" (assignment_expression "*(int *)(param_1 + 8) = iVar2" (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 "iVar2")) (; ";")) (expression_statement "RelinquishMagickMemory(piVar1);" (call_expression "RelinquishMagickMemory(piVar1)" (identifier "RelinquishMagickMemory") (argument_list "(piVar1)" (( "(") (identifier "piVar1") () ")"))) (; ";")) (} "}")) (else_clause "else {\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" (else "else") (compound_statement "{\n        do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);\n        piVar3[1] = piVar1[1];\n        if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }\n        RelinquishMagickMemory(piVar1);\n      }" ({ "{") (do_statement "do {\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        } while (*piVar1 != param_2);" (do "do") (compound_statement "{\n          piVar3 = piVar1;\n          piVar1 = (int *)piVar3[1];\n          if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }\n        }" ({ "{") (expression_statement "piVar3 = piVar1;" (assignment_expression "piVar3 = piVar1" (identifier "piVar3") (= "=") (identifier "piVar1")) (; ";")) (expression_statement "piVar1 = (int *)piVar3[1];" (assignment_expression "piVar1 = (int *)piVar3[1]" (identifier "piVar1") (= "=") (cast_expression "(int *)piVar3[1]" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")))) (; ";")) (if_statement "if (piVar1 == (int *)0x0) {\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }" (if "if") (parenthesized_expression "(piVar1 == (int *)0x0)" (( "(") (binary_expression "piVar1 == (int *)0x0" (identifier "piVar1") (== "==") (cast_expression "(int *)0x0" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (number_literal "0x0"))) () ")")) (compound_statement "{\n            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));\n            return 0;\n          }" ({ "{") (expression_statement "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" (identifier "UnlockSemaphoreInfo") (argument_list "(*(undefined4 *)(param_1 + 0x14))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) () ")"))) (; ";")) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (} "}")) (while "while") (parenthesized_expression "(*piVar1 != param_2)" (( "(") (binary_expression "*piVar1 != param_2" (pointer_expression "*piVar1" (* "*") (identifier "piVar1")) (!= "!=") (identifier "param_2")) () ")")) (; ";")) (expression_statement "piVar3[1] = piVar1[1];" (assignment_expression "piVar3[1] = piVar1[1]" (subscript_expression "piVar3[1]" (identifier "piVar3") ([ "[") (number_literal "1") (] "]")) (= "=") (subscript_expression "piVar1[1]" (identifier "piVar1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (if_statement "if (piVar1 == *(int **)(param_1 + 0xc)) {\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }\n        else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" (if "if") (parenthesized_expression "(piVar1 == *(int **)(param_1 + 0xc))" (( "(") (binary_expression "piVar1 == *(int **)(param_1 + 0xc)" (identifier "piVar1") (== "==") (pointer_expression "*(int **)(param_1 + 0xc)" (* "*") (cast_expression "(int **)(param_1 + 0xc)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")"))))) () ")")) (compound_statement "{\n          *(int **)(param_1 + 0xc) = piVar3;\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" ({ "{") (expression_statement "*(int **)(param_1 + 0xc) = piVar3;" (assignment_expression "*(int **)(param_1 + 0xc) = piVar3" (pointer_expression "*(int **)(param_1 + 0xc)" (* "*") (cast_expression "(int **)(param_1 + 0xc)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0xc)" (( "(") (binary_expression "param_1 + 0xc" (identifier "param_1") (+ "+") (number_literal "0xc")) () ")")))) (= "=") (identifier "piVar3")) (; ";")) (expression_statement "piVar3 = *(int **)(param_1 + 0x10);" (assignment_expression "piVar3 = *(int **)(param_1 + 0x10)" (identifier "piVar3") (= "=") (pointer_expression "*(int **)(param_1 + 0x10)" (* "*") (cast_expression "(int **)(param_1 + 0x10)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (} "}")) (else_clause "else {\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" (else "else") (compound_statement "{\n          piVar3 = *(int **)(param_1 + 0x10);\n        }" ({ "{") (expression_statement "piVar3 = *(int **)(param_1 + 0x10);" (assignment_expression "piVar3 = *(int **)(param_1 + 0x10)" (identifier "piVar3") (= "=") (pointer_expression "*(int **)(param_1 + 0x10)" (* "*") (cast_expression "(int **)(param_1 + 0x10)" (( "(") (type_descriptor "int **" (primitive_type "int") (abstract_pointer_declarator "**" (* "*") (abstract_pointer_declarator "*" (* "*")))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")"))))) (; ";")) (} "}")))) (if_statement "if (piVar1 == piVar3) {\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }" (if "if") (parenthesized_expression "(piVar1 == piVar3)" (( "(") (binary_expression "piVar1 == piVar3" (identifier "piVar1") (== "==") (identifier "piVar3")) () ")")) (compound_statement "{\n          *(int *)(param_1 + 0x10) = piVar1[1];\n        }" ({ "{") (expression_statement "*(int *)(param_1 + 0x10) = piVar1[1];" (assignment_expression "*(int *)(param_1 + 0x10) = piVar1[1]" (pointer_expression "*(int *)(param_1 + 0x10)" (* "*") (cast_expression "(int *)(param_1 + 0x10)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x10)" (( "(") (binary_expression "param_1 + 0x10" (identifier "param_1") (+ "+") (number_literal "0x10")) () ")")))) (= "=") (subscript_expression "piVar1[1]" (identifier "piVar1") ([ "[") (number_literal "1") (] "]"))) (; ";")) (} "}"))) (expression_statement "RelinquishMagickMemory(piVar1);" (call_expression "RelinquishMagickMemory(piVar1)" (identifier "RelinquishMagickMemory") (argument_list "(piVar1)" (( "(") (identifier "piVar1") () ")"))) (; ";")) (} "}")))) (expression_statement "*(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;" (assignment_expression "*(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1" (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (= "=") (binary_expression "*(int *)(param_1 + 4) + -1" (pointer_expression "*(int *)(param_1 + 4)" (* "*") (cast_expression "(int *)(param_1 + 4)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 4)" (( "(") (binary_expression "param_1 + 4" (identifier "param_1") (+ "+") (number_literal "4")) () ")")))) (+ "+") (number_literal "-1"))) (; ";")) (expression_statement "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));" (call_expression "UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14))" (identifier "UnlockSemaphoreInfo") (argument_list "(*(undefined4 *)(param_1 + 0x14))" (( "(") (pointer_expression "*(undefined4 *)(param_1 + 0x14)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x14)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x14)" (( "(") (binary_expression "param_1 + 0x14" (identifier "param_1") (+ "+") (number_literal "0x14")) () ")")))) () ")"))) (; ";")) (return_statement "return param_2;" (return "return") (identifier "param_2") (; ";")) (} "}"))) (return_statement "return 0;" (return "return") (number_literal "0") (; ";")) (} "}"))) (expression_statement "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList");" (call_expression "__assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" (identifier "__assert_fail") (argument_list "("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,\n                "RemoveElementByValueFromLinkedList")" (( "(") (string_literal ""list_info->signature == MagickCoreSignature"" (" """) (string_content "list_info->signature == MagickCoreSignature") (" """)) (, ",") (string_literal ""MagickCore/linked-list.c"" (" """) (string_content "MagickCore/linked-list.c") (" """)) (, ",") (number_literal "0x2fb") (, ",") (string_literal ""RemoveElementByValueFromLinkedList"" (" """) (string_content "RemoveElementByValueFromLinkedList") (" """)) () ")"))) (; ";")) (} "}")))

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

void * function_1(type_1 *var_1,void *var_3)

{
  type_2 *var_5;
  type_3 *var_8;
  type_2 *pEVar2;
  
  if (var_1 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_2("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,
                  "RemoveElementByValueFromLinkedList");
  }
  if (var_1->signature == 0xabacadab) {
    if ((var_1->elements != 0) && (var_3 != (void *)0x0)) {
      var_4(var_1->semaphore);
      var_5 = var_1->head;
      if (var_5->var_3 == var_3) {
        var_8 = var_5->next;
        if (var_5 == var_1->next) {
          var_1->next = var_8;
        }
        var_1->head = var_8;
        var_6(var_5);
      }
      else {
        do {
          pEVar2 = var_5;
          var_5 = pEVar2->next;
          if (var_5 == (type_3 *)0x0) {
            var_7(var_1->semaphore);
            return (void *)0x0;
          }
        } while (var_5->var_3 != var_3);
        pEVar2->next = var_5->next;
        if (var_5 == var_1->tail) {
          var_1->tail = pEVar2;
          var_8 = var_1->next;
        }
        else {
          var_8 = var_1->next;
        }
        if (var_5 == var_8) {
          var_1->next = var_5->next;
        }
        var_6(var_5);
      }
      var_1->elements = var_1->elements - 1;
      var_7(var_1->semaphore);
      return var_3;
    }
    return (void *)0x0;
  }
                    /* WARNING: Subroutine does not return */
  var_2("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,
                "RemoveElementByValueFromLinkedList");
}


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

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

int MASKED(int param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  int *piVar3;
  
  if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
    __assert_fail("list_info != (LinkedListInfo *) NULL","MagickCore/linked-list.c",0x2fa,
                  "MASKED");
  }
  if (*(int *)(param_1 + 0x18) == -0x54535255) {
    if ((*(int *)(param_1 + 4) != 0) && (param_2 != 0)) {
      LockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));
      piVar1 = *(int **)(param_1 + 8);
      if (*piVar1 == param_2) {
        iVar2 = piVar1[1];
        if (piVar1 == *(int **)(param_1 + 0x10)) {
          *(int *)(param_1 + 0x10) = iVar2;
        }
        *(int *)(param_1 + 8) = iVar2;
        RelinquishMagickMemory(piVar1);
      }
      else {
        do {
          piVar3 = piVar1;
          piVar1 = (int *)piVar3[1];
          if (piVar1 == (int *)0x0) {
            UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));
            return 0;
          }
        } while (*piVar1 != param_2);
        piVar3[1] = piVar1[1];
        if (piVar1 == *(int **)(param_1 + 0xc)) {
          *(int **)(param_1 + 0xc) = piVar3;
          piVar3 = *(int **)(param_1 + 0x10);
        }
        else {
          piVar3 = *(int **)(param_1 + 0x10);
        }
        if (piVar1 == piVar3) {
          *(int *)(param_1 + 0x10) = piVar1[1];
        }
        RelinquishMagickMemory(piVar1);
      }
      *(int *)(param_1 + 4) = *(int *)(param_1 + 4) + -1;
      UnlockSemaphoreInfo(*(undefined4 *)(param_1 + 0x14));
      return param_2;
    }
    return 0;
  }
                    /* WARNING: Subroutine does not return */
  __assert_fail("list_info->signature == MagickCoreSignature","MagickCore/linked-list.c",0x2fb,
                "MASKED");
}

