
int chacha20poly1305_decrypt(chacha20poly1305_state *st,uchar *in,ulong inlen,uchar *out)

{
  long lVar1;
  int iVar2;
  ulong inlen_00;
  long in_FS_OFFSET;
  uchar padzero [16];
  
  lVar1 = *(long *)(in_FS_OFFSET + 0x28);
  padzero[0] = '\0';
  padzero[1] = '\0';
  padzero[2] = '\0';
  padzero[3] = '\0';
  padzero[4] = '\0';
  padzero[5] = '\0';
  padzero[6] = '\0';
  padzero[7] = '\0';
  padzero[8] = '\0';
  padzero[9] = '\0';
  padzero[10] = '\0';
  padzero[0xb] = '\0';
  padzero[0xc] = '\0';
  padzero[0xd] = '\0';
  padzero[0xe] = '\0';
  padzero[0xf] = '\0';
  if (inlen == 0) {
    iVar2 = 0;
  }
  else {
    if (st == (chacha20poly1305_state *)0x0) {
                    /* WARNING: Subroutine does not return */
      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);
    }
    if (st->aadflg != 0) {
      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);
      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))
      goto LAB_0013916e;
      st->aadflg = 0;
    }
    iVar2 = poly1305_process(&st->poly,in,inlen);
    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {
      st->ctlen = st->ctlen + inlen;
    }
  }
LAB_0013916e:
  if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return iVar2;
}



undefined8 chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)

{
  undefined8 uVar1;
  long in_FS_OFFSET;
  undefined1 local_48 [16];
  long local_30;
  
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  local_48 = (undefined1  [16])0x0;
  if (param_3 == 0) {
    uVar1 = 0;
  }
  else {
    if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);
    }
    if (*(int *)(param_1 + 0x100) != 0) {
      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&
         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;
      *(undefined4 *)(param_1 + 0x100) = 0;
    }
    uVar1 = poly1305_process(param_1,param_2,param_3);
    if (((int)uVar1 == 0) &&
       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {
      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;
    }
  }
LAB_0013916e:
  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar1;
}


PUSH R13
PXOR XMM0,XMM0
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x28
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x18],RAX
XOR EAX,EAX
MOVAPS xmmword ptr [RSP],XMM0
TEST RDX,RDX
JZ 0x001391b0
MOV RBX,RDI
TEST RDI,RDI
JZ 0x001391cb
MOV EAX,dword ptr [RDI + 0x100]
MOV R12,RSI
MOV RBP,RDX
MOV R13,RCX
TEST EAX,EAX
JZ 0x0013915c
MOV RCX,qword ptr [RDI + 0xf0]
MOV EDX,0x10
AND ECX,0xf
SUB RDX,RCX
CMP RDX,0x10
JNZ 0x001391b8
MOV dword ptr [RBX + 0x100],0x0
MOV RDX,RBP
MOV RSI,R12
MOV RDI,RBX
CALL 0x00114c40
TEST EAX,EAX
JZ 0x00139190
MOV RCX,qword ptr [RSP + 0x18]
XOR RCX,qword ptr FS:[0x28]
JNZ 0x001391c6
ADD RSP,0x28
POP RBX
POP RBP
POP R12
POP R13
RET
LEA RDI,[RBX + 0x58]
MOV RCX,R13
MOV RDX,RBP
MOV RSI,R12
CALL 0x00113a90
TEST EAX,EAX
JNZ 0x0013916e
ADD qword ptr [RBX + 0xf8],RBP
JMP 0x0013916e
XOR EAX,EAX
JMP 0x0013916e
MOV RSI,RSP
CALL 0x00114c40
TEST EAX,EAX
JZ 0x00139152
JMP 0x0013916e
CALL 0x00113880
MOV EDX,0x1d
LEA RSI,[0x1b9cb8]
LEA RDI,[0x1d23c3]
CALL 0x00114270
(translation_unit "undefined8 chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)\n\n{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return uVar1;\n}\n\n" (function_definition "undefined8 chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)\n\n{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return uVar1;\n}" type_identifier (function_declarator "chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)" identifier (parameter_list "(long param_1,undefined8 param_2,long param_3,undefined8 param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return uVar1;\n}" { (declaration "undefined8 uVar1;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 local_48 [16];" type_identifier (array_declarator "local_48 [16]" identifier [ number_literal ]) ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "local_48 = (undefined1  [16])0x0;" (assignment_expression "local_48 = (undefined1  [16])0x0" identifier = (cast_expression "(undefined1  [16])0x0" ( (type_descriptor "undefined1  [16]" type_identifier (abstract_array_declarator "[16]" [ number_literal ])) ) number_literal)) ;) (if_statement "if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar1 = 0;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" else (compound_statement "{\n    if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" { (if_statement "if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" { comment (expression_statement "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);" (call_expression "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" identifier (argument_list "("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" ( (string_literal ""st != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_decrypt.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }" if (parenthesized_expression "(*(int *)(param_1 + 0x100) != 0)" ( (binary_expression "*(int *)(param_1 + 0x100) != 0" (pointer_expression "*(int *)(param_1 + 0x100)" * (cast_expression "(int *)(param_1 + 0x100)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100)" ( (binary_expression "param_1 + 0x100" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }" { (if_statement "if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;" if (parenthesized_expression "(((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0))" ( (binary_expression "((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)" (parenthesized_expression "((*(ulong *)(param_1 + 0xf0) & 0xf) != 0)" ( (binary_expression "(*(ulong *)(param_1 + 0xf0) & 0xf) != 0" (parenthesized_expression "(*(ulong *)(param_1 + 0xf0) & 0xf)" ( (binary_expression "*(ulong *)(param_1 + 0xf0) & 0xf" (pointer_expression "*(ulong *)(param_1 + 0xf0)" * (cast_expression "(ulong *)(param_1 + 0xf0)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf0)" ( (binary_expression "param_1 + 0xf0" identifier + number_literal) )))) & number_literal) )) != number_literal) )) && (parenthesized_expression "(uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)" ( (comma_expression "uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0" (assignment_expression "uVar1 = poly1305_process(param_1,local_48)" identifier = (call_expression "poly1305_process(param_1,local_48)" identifier (argument_list "(param_1,local_48)" ( identifier , identifier )))) , (binary_expression "(int)uVar1 != 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) != number_literal)) ))) )) (goto_statement "goto LAB_0013916e;" goto statement_identifier ;)) (expression_statement "*(undefined4 *)(param_1 + 0x100) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x100) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x100)" * (cast_expression "(undefined4 *)(param_1 + 0x100)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100)" ( (binary_expression "param_1 + 0x100" identifier + number_literal) )))) = number_literal) ;) })) (expression_statement "uVar1 = poly1305_process(param_1,param_2,param_3);" (assignment_expression "uVar1 = poly1305_process(param_1,param_2,param_3)" identifier = (call_expression "poly1305_process(param_1,param_2,param_3)" identifier (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }" if (parenthesized_expression "(((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0))" ( (binary_expression "((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)" (parenthesized_expression "((int)uVar1 == 0)" ( (binary_expression "(int)uVar1 == 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal) )) && (parenthesized_expression "(uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)" ( (comma_expression "uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0" (assignment_expression "uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4)" identifier = (call_expression "chacha_crypt(param_1 + 0x58,param_2,param_3,param_4)" identifier (argument_list "(param_1 + 0x58,param_2,param_3,param_4)" ( (binary_expression "param_1 + 0x58" identifier + number_literal) , identifier , identifier , identifier )))) , (binary_expression "(int)uVar1 == 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal)) ))) )) (compound_statement "{\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }" { (expression_statement "*(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;" (assignment_expression "*(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3" (pointer_expression "*(long *)(param_1 + 0xf8)" * (cast_expression "(long *)(param_1 + 0xf8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf8)" ( (binary_expression "param_1 + 0xf8" identifier + number_literal) )))) = (binary_expression "*(long *)(param_1 + 0xf8) + param_3" (pointer_expression "*(long *)(param_1 + 0xf8)" * (cast_expression "(long *)(param_1 + 0xf8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf8)" ( (binary_expression "param_1 + 0xf8" identifier + number_literal) )))) + identifier)) ;) })) }))) (labeled_statement "LAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" statement_identifier : (if_statement "if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" if (parenthesized_expression "(local_30 != *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 != *(long *)(in_FS_OFFSET + 0x28)" identifier != (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" { comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit "int chacha20poly1305_decrypt(chacha20poly1305_state *st,uchar *in,ulong inlen,uchar *out)\n\n{\n  long lVar1;\n  int iVar2;\n  ulong inlen_00;\n  long in_FS_OFFSET;\n  uchar padzero [16];\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  padzero[0] = '\0';\n  padzero[1] = '\0';\n  padzero[2] = '\0';\n  padzero[3] = '\0';\n  padzero[4] = '\0';\n  padzero[5] = '\0';\n  padzero[6] = '\0';\n  padzero[7] = '\0';\n  padzero[8] = '\0';\n  padzero[9] = '\0';\n  padzero[10] = '\0';\n  padzero[0xb] = '\0';\n  padzero[0xc] = '\0';\n  padzero[0xd] = '\0';\n  padzero[0xe] = '\0';\n  padzero[0xf] = '\0';\n  if (inlen == 0) {\n    iVar2 = 0;\n  }\n  else {\n    if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }\n    iVar2 = poly1305_process(&st->poly,in,inlen);\n    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }\n  }\nLAB_0013916e:\n  if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return iVar2;\n}\n\n" (function_definition "int chacha20poly1305_decrypt(chacha20poly1305_state *st,uchar *in,ulong inlen,uchar *out)\n\n{\n  long lVar1;\n  int iVar2;\n  ulong inlen_00;\n  long in_FS_OFFSET;\n  uchar padzero [16];\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  padzero[0] = '\0';\n  padzero[1] = '\0';\n  padzero[2] = '\0';\n  padzero[3] = '\0';\n  padzero[4] = '\0';\n  padzero[5] = '\0';\n  padzero[6] = '\0';\n  padzero[7] = '\0';\n  padzero[8] = '\0';\n  padzero[9] = '\0';\n  padzero[10] = '\0';\n  padzero[0xb] = '\0';\n  padzero[0xc] = '\0';\n  padzero[0xd] = '\0';\n  padzero[0xe] = '\0';\n  padzero[0xf] = '\0';\n  if (inlen == 0) {\n    iVar2 = 0;\n  }\n  else {\n    if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }\n    iVar2 = poly1305_process(&st->poly,in,inlen);\n    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }\n  }\nLAB_0013916e:\n  if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return iVar2;\n}" primitive_type (function_declarator "chacha20poly1305_decrypt(chacha20poly1305_state *st,uchar *in,ulong inlen,uchar *out)" identifier (parameter_list "(chacha20poly1305_state *st,uchar *in,ulong inlen,uchar *out)" ( (parameter_declaration "chacha20poly1305_state *st" type_identifier (pointer_declarator "*st" * identifier)) , (parameter_declaration "uchar *in" type_identifier (pointer_declarator "*in" * identifier)) , (parameter_declaration "ulong inlen" type_identifier identifier) , (parameter_declaration "uchar *out" type_identifier (pointer_declarator "*out" * identifier)) ))) (compound_statement "{\n  long lVar1;\n  int iVar2;\n  ulong inlen_00;\n  long in_FS_OFFSET;\n  uchar padzero [16];\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  padzero[0] = '\0';\n  padzero[1] = '\0';\n  padzero[2] = '\0';\n  padzero[3] = '\0';\n  padzero[4] = '\0';\n  padzero[5] = '\0';\n  padzero[6] = '\0';\n  padzero[7] = '\0';\n  padzero[8] = '\0';\n  padzero[9] = '\0';\n  padzero[10] = '\0';\n  padzero[0xb] = '\0';\n  padzero[0xc] = '\0';\n  padzero[0xd] = '\0';\n  padzero[0xe] = '\0';\n  padzero[0xf] = '\0';\n  if (inlen == 0) {\n    iVar2 = 0;\n  }\n  else {\n    if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }\n    iVar2 = poly1305_process(&st->poly,in,inlen);\n    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }\n  }\nLAB_0013916e:\n  if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }\n  return iVar2;\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "ulong inlen_00;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "uchar padzero [16];" type_identifier (array_declarator "padzero [16]" identifier [ number_literal ]) ;) (expression_statement "lVar1 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "lVar1 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "padzero[0] = '\0';" (assignment_expression "padzero[0] = '\0'" (subscript_expression "padzero[0]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[1] = '\0';" (assignment_expression "padzero[1] = '\0'" (subscript_expression "padzero[1]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[2] = '\0';" (assignment_expression "padzero[2] = '\0'" (subscript_expression "padzero[2]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[3] = '\0';" (assignment_expression "padzero[3] = '\0'" (subscript_expression "padzero[3]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[4] = '\0';" (assignment_expression "padzero[4] = '\0'" (subscript_expression "padzero[4]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[5] = '\0';" (assignment_expression "padzero[5] = '\0'" (subscript_expression "padzero[5]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[6] = '\0';" (assignment_expression "padzero[6] = '\0'" (subscript_expression "padzero[6]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[7] = '\0';" (assignment_expression "padzero[7] = '\0'" (subscript_expression "padzero[7]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[8] = '\0';" (assignment_expression "padzero[8] = '\0'" (subscript_expression "padzero[8]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[9] = '\0';" (assignment_expression "padzero[9] = '\0'" (subscript_expression "padzero[9]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[10] = '\0';" (assignment_expression "padzero[10] = '\0'" (subscript_expression "padzero[10]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[0xb] = '\0';" (assignment_expression "padzero[0xb] = '\0'" (subscript_expression "padzero[0xb]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[0xc] = '\0';" (assignment_expression "padzero[0xc] = '\0'" (subscript_expression "padzero[0xc]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[0xd] = '\0';" (assignment_expression "padzero[0xd] = '\0'" (subscript_expression "padzero[0xd]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[0xe] = '\0';" (assignment_expression "padzero[0xe] = '\0'" (subscript_expression "padzero[0xe]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (expression_statement "padzero[0xf] = '\0';" (assignment_expression "padzero[0xf] = '\0'" (subscript_expression "padzero[0xf]" identifier [ number_literal ]) = (char_literal "'\0'" ' escape_sequence ')) ;) (if_statement "if (inlen == 0) {\n    iVar2 = 0;\n  }\n  else {\n    if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }\n    iVar2 = poly1305_process(&st->poly,in,inlen);\n    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }\n  }" if (parenthesized_expression "(inlen == 0)" ( (binary_expression "inlen == 0" identifier == number_literal) )) (compound_statement "{\n    iVar2 = 0;\n  }" { (expression_statement "iVar2 = 0;" (assignment_expression "iVar2 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }\n    iVar2 = poly1305_process(&st->poly,in,inlen);\n    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }\n  }" else (compound_statement "{\n    if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }\n    iVar2 = poly1305_process(&st->poly,in,inlen);\n    if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }\n  }" { (if_statement "if (st == (chacha20poly1305_state *)0x0) {\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" if (parenthesized_expression "(st == (chacha20poly1305_state *)0x0)" ( (binary_expression "st == (chacha20poly1305_state *)0x0" identifier == (cast_expression "(chacha20poly1305_state *)0x0" ( (type_descriptor "chacha20poly1305_state *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" { comment (expression_statement "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);" (call_expression "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" identifier (argument_list "("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" ( (string_literal ""st != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_decrypt.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (st->aadflg != 0) {\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }" if (parenthesized_expression "(st->aadflg != 0)" ( (binary_expression "st->aadflg != 0" (field_expression "st->aadflg" identifier -> field_identifier) != number_literal) )) (compound_statement "{\n      inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);\n      if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;\n      st->aadflg = 0;\n    }" { (expression_statement "inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf);" (assignment_expression "inlen_00 = 0x10 - (ulong)((uint)st->aadlen & 0xf)" identifier = (binary_expression "0x10 - (ulong)((uint)st->aadlen & 0xf)" number_literal - (call_expression "(ulong)((uint)st->aadlen & 0xf)" (parenthesized_expression "(ulong)" ( identifier )) (argument_list "((uint)st->aadlen & 0xf)" ( (binary_expression "(uint)st->aadlen & 0xf" (cast_expression "(uint)st->aadlen" ( (type_descriptor "uint" type_identifier) ) (field_expression "st->aadlen" identifier -> field_identifier)) & number_literal) ))))) ;) (if_statement "if ((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))\n      goto LAB_0013916e;" if (parenthesized_expression "((inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0))" ( (binary_expression "(inlen_00 != 0x10) && (iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0)" (parenthesized_expression "(inlen_00 != 0x10)" ( (binary_expression "inlen_00 != 0x10" identifier != number_literal) )) && (parenthesized_expression "(iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0)" ( (comma_expression "iVar2 = poly1305_process(&st->poly,padzero,inlen_00), iVar2 != 0" (assignment_expression "iVar2 = poly1305_process(&st->poly,padzero,inlen_00)" identifier = (call_expression "poly1305_process(&st->poly,padzero,inlen_00)" identifier (argument_list "(&st->poly,padzero,inlen_00)" ( (pointer_expression "&st->poly" & (field_expression "st->poly" identifier -> field_identifier)) , identifier , identifier )))) , (binary_expression "iVar2 != 0" identifier != number_literal)) ))) )) (goto_statement "goto LAB_0013916e;" goto statement_identifier ;)) (expression_statement "st->aadflg = 0;" (assignment_expression "st->aadflg = 0" (field_expression "st->aadflg" identifier -> field_identifier) = number_literal) ;) })) (expression_statement "iVar2 = poly1305_process(&st->poly,in,inlen);" (assignment_expression "iVar2 = poly1305_process(&st->poly,in,inlen)" identifier = (call_expression "poly1305_process(&st->poly,in,inlen)" identifier (argument_list "(&st->poly,in,inlen)" ( (pointer_expression "&st->poly" & (field_expression "st->poly" identifier -> field_identifier)) , identifier , identifier )))) ;) (if_statement "if ((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)) {\n      st->ctlen = st->ctlen + inlen;\n    }" if (parenthesized_expression "((iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0))" ( (binary_expression "(iVar2 == 0) && (iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0)" ( (comma_expression "iVar2 = chacha_crypt(&st->chacha,in,inlen,out), iVar2 == 0" (assignment_expression "iVar2 = chacha_crypt(&st->chacha,in,inlen,out)" identifier = (call_expression "chacha_crypt(&st->chacha,in,inlen,out)" identifier (argument_list "(&st->chacha,in,inlen,out)" ( (pointer_expression "&st->chacha" & (field_expression "st->chacha" identifier -> field_identifier)) , identifier , identifier , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) (compound_statement "{\n      st->ctlen = st->ctlen + inlen;\n    }" { (expression_statement "st->ctlen = st->ctlen + inlen;" (assignment_expression "st->ctlen = st->ctlen + inlen" (field_expression "st->ctlen" identifier -> field_identifier) = (binary_expression "st->ctlen + inlen" (field_expression "st->ctlen" identifier -> field_identifier) + identifier)) ;) })) }))) (labeled_statement "LAB_0013916e:\n  if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" statement_identifier : (if_statement "if (lVar1 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" if (parenthesized_expression "(lVar1 != *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "lVar1 != *(long *)(in_FS_OFFSET + 0x28)" identifier != (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    __stack_chk_fail();\n  }" { comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return iVar2;" return identifier ;) })))
(translation_unit "undefined8 chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)\n\n{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return uVar1;\n}\n\n" (function_definition "undefined8 chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)\n\n{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return uVar1;\n}" type_identifier (function_declarator "chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)" identifier (parameter_list "(long param_1,undefined8 param_2,long param_3,undefined8 param_4)" ( (parameter_declaration "long param_1" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_2" type_identifier identifier) , (parameter_declaration "long param_3" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_4" type_identifier identifier) ))) (compound_statement "{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return uVar1;\n}" { (declaration "undefined8 uVar1;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 local_48 [16];" type_identifier (array_declarator "local_48 [16]" identifier [ number_literal ]) ;) (declaration "long local_30;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" identifier = (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) ;) (expression_statement "local_48 = (undefined1  [16])0x0;" (assignment_expression "local_48 = (undefined1  [16])0x0" identifier = (cast_expression "(undefined1  [16])0x0" ( (type_descriptor "undefined1  [16]" type_identifier (abstract_array_declarator "[16]" [ number_literal ])) ) number_literal)) ;) (if_statement "if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n    uVar1 = 0;\n  }" { (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" identifier = number_literal) ;) }) (else_clause "else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" else (compound_statement "{\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" { (if_statement "if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" { (expression_statement "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);" (call_expression "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" identifier (argument_list "("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" ( (string_literal ""st != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_decrypt.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }" if (parenthesized_expression "(*(int *)(param_1 + 0x100) != 0)" ( (binary_expression "*(int *)(param_1 + 0x100) != 0" (pointer_expression "*(int *)(param_1 + 0x100)" * (cast_expression "(int *)(param_1 + 0x100)" ( (type_descriptor "int *" primitive_type (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100)" ( (binary_expression "param_1 + 0x100" identifier + number_literal) )))) != number_literal) )) (compound_statement "{\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }" { (if_statement "if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;" if (parenthesized_expression "(((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0))" ( (binary_expression "((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)" (parenthesized_expression "((*(ulong *)(param_1 + 0xf0) & 0xf) != 0)" ( (binary_expression "(*(ulong *)(param_1 + 0xf0) & 0xf) != 0" (parenthesized_expression "(*(ulong *)(param_1 + 0xf0) & 0xf)" ( (binary_expression "*(ulong *)(param_1 + 0xf0) & 0xf" (pointer_expression "*(ulong *)(param_1 + 0xf0)" * (cast_expression "(ulong *)(param_1 + 0xf0)" ( (type_descriptor "ulong *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf0)" ( (binary_expression "param_1 + 0xf0" identifier + number_literal) )))) & number_literal) )) != number_literal) )) && (parenthesized_expression "(uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)" ( (comma_expression "uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0" (assignment_expression "uVar1 = poly1305_process(param_1,local_48)" identifier = (call_expression "poly1305_process(param_1,local_48)" identifier (argument_list "(param_1,local_48)" ( identifier , identifier )))) , (binary_expression "(int)uVar1 != 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) != number_literal)) ))) )) (goto_statement "goto LAB_0013916e;" goto statement_identifier ;)) (expression_statement "*(undefined4 *)(param_1 + 0x100) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x100) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x100)" * (cast_expression "(undefined4 *)(param_1 + 0x100)" ( (type_descriptor "undefined4 *" type_identifier (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0x100)" ( (binary_expression "param_1 + 0x100" identifier + number_literal) )))) = number_literal) ;) })) (expression_statement "uVar1 = poly1305_process(param_1,param_2,param_3);" (assignment_expression "uVar1 = poly1305_process(param_1,param_2,param_3)" identifier = (call_expression "poly1305_process(param_1,param_2,param_3)" identifier (argument_list "(param_1,param_2,param_3)" ( identifier , identifier , identifier )))) ;) (if_statement "if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }" if (parenthesized_expression "(((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0))" ( (binary_expression "((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)" (parenthesized_expression "((int)uVar1 == 0)" ( (binary_expression "(int)uVar1 == 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal) )) && (parenthesized_expression "(uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)" ( (comma_expression "uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0" (assignment_expression "uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4)" identifier = (call_expression "chacha_crypt(param_1 + 0x58,param_2,param_3,param_4)" identifier (argument_list "(param_1 + 0x58,param_2,param_3,param_4)" ( (binary_expression "param_1 + 0x58" identifier + number_literal) , identifier , identifier , identifier )))) , (binary_expression "(int)uVar1 == 0" (cast_expression "(int)uVar1" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal)) ))) )) (compound_statement "{\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }" { (expression_statement "*(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;" (assignment_expression "*(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3" (pointer_expression "*(long *)(param_1 + 0xf8)" * (cast_expression "(long *)(param_1 + 0xf8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf8)" ( (binary_expression "param_1 + 0xf8" identifier + number_literal) )))) = (binary_expression "*(long *)(param_1 + 0xf8) + param_3" (pointer_expression "*(long *)(param_1 + 0xf8)" * (cast_expression "(long *)(param_1 + 0xf8)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(param_1 + 0xf8)" ( (binary_expression "param_1 + 0xf8" identifier + number_literal) )))) + identifier)) ;) })) }))) (labeled_statement "LAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" statement_identifier : (if_statement "if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" if (parenthesized_expression "(local_30 != *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_30 != *(long *)(in_FS_OFFSET + 0x28)" identifier != (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n                    \n    __stack_chk_fail();\n  }" { (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) }))) (return_statement "return uVar1;" return identifier ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (declaration (sized_type_specifier long) IDENT ;) (declaration TYPE (array_declarator IDENT [ LIT ]) ;) (declaration (sized_type_specifier long) IDENT ;) (expression_statement (assignment_expression IDENT = (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE (abstract_array_declarator [ LIT ])) ) LIT)) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) }) (else_clause else (compound_statement { (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 ))) ;) })) (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 (parenthesized_expression ( (binary_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) & LIT) )) != LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT )))) , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) != LIT)) ))) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor TYPE (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = LIT) ;) })) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) ;) (if_statement if (parenthesized_expression ( (binary_expression (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) == LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( (binary_expression IDENT + LIT) , IDENT , IDENT , IDENT )))) , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) == LIT)) ))) )) (compound_statement { (expression_statement (assignment_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) = (binary_expression (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) )))) + IDENT)) ;) })) }))) (labeled_statement statement_identifier : (if_statement if (parenthesized_expression ( (binary_expression IDENT != (pointer_expression * (cast_expression ( (type_descriptor (sized_type_specifier long) (abstract_pointer_declarator *)) ) (parenthesized_expression ( (binary_expression IDENT + LIT) ))))) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( ))) ;) }))) (return_statement return IDENT ;) })))
(function_definition "undefined8 chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)\n\n{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return uVar1;\n}" (type_identifier "undefined8") (function_declarator "chacha20poly1305_decrypt(long param_1,undefined8 param_2,long param_3,undefined8 param_4)" (identifier "chacha20poly1305_decrypt") (parameter_list "(long param_1,undefined8 param_2,long param_3,undefined8 param_4)" (( "(") (parameter_declaration "long param_1" (sized_type_specifier "long" (long "long")) (identifier "param_1")) (, ",") (parameter_declaration "undefined8 param_2" (type_identifier "undefined8") (identifier "param_2")) (, ",") (parameter_declaration "long param_3" (sized_type_specifier "long" (long "long")) (identifier "param_3")) (, ",") (parameter_declaration "undefined8 param_4" (type_identifier "undefined8") (identifier "param_4")) () ")"))) (compound_statement "{\n  undefined8 uVar1;\n  long in_FS_OFFSET;\n  undefined1 local_48 [16];\n  long local_30;\n  \n  local_30 = *(long *)(in_FS_OFFSET + 0x28);\n  local_48 = (undefined1  [16])0x0;\n  if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }\nLAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }\n  return uVar1;\n}" ({ "{") (declaration "undefined8 uVar1;" (type_identifier "undefined8") (identifier "uVar1") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "undefined1 local_48 [16];" (type_identifier "undefined1") (array_declarator "local_48 [16]" (identifier "local_48") ([ "[") (number_literal "16") (] "]")) (; ";")) (declaration "long local_30;" (sized_type_specifier "long" (long "long")) (identifier "local_30") (; ";")) (expression_statement "local_30 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_30 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_30") (= "=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) (; ";")) (expression_statement "local_48 = (undefined1  [16])0x0;" (assignment_expression "local_48 = (undefined1  [16])0x0" (identifier "local_48") (= "=") (cast_expression "(undefined1  [16])0x0" (( "(") (type_descriptor "undefined1  [16]" (type_identifier "undefined1") (abstract_array_declarator "[16]" ([ "[") (number_literal "16") (] "]"))) () ")") (number_literal "0x0"))) (; ";")) (if_statement "if (param_3 == 0) {\n    uVar1 = 0;\n  }\n  else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n    uVar1 = 0;\n  }" ({ "{") (expression_statement "uVar1 = 0;" (assignment_expression "uVar1 = 0" (identifier "uVar1") (= "=") (number_literal "0")) (; ";")) (} "}")) (else_clause "else {\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" (else "else") (compound_statement "{\n    if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }\n    if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }\n    uVar1 = poly1305_process(param_1,param_2,param_3);\n    if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }\n  }" ({ "{") (if_statement "if (param_1 == 0) {\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" (if "if") (parenthesized_expression "(param_1 == 0)" (( "(") (binary_expression "param_1 == 0" (identifier "param_1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n      crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);\n    }" ({ "{") (expression_statement "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);" (call_expression "crypt_argchk("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" (identifier "crypt_argchk") (argument_list "("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d)" (( "(") (string_literal ""st != NULL"" (" """) (string_content "st != NULL") (" """)) (, ",") (string_literal ""src/encauth/chachapoly/chacha20poly1305_decrypt.c"" (" """) (string_content "src/encauth/chachapoly/chacha20poly1305_decrypt.c") (" """)) (, ",") (number_literal "0x1d") () ")"))) (; ";")) (} "}"))) (if_statement "if (*(int *)(param_1 + 0x100) != 0) {\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }" (if "if") (parenthesized_expression "(*(int *)(param_1 + 0x100) != 0)" (( "(") (binary_expression "*(int *)(param_1 + 0x100) != 0" (pointer_expression "*(int *)(param_1 + 0x100)" (* "*") (cast_expression "(int *)(param_1 + 0x100)" (( "(") (type_descriptor "int *" (primitive_type "int") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x100)" (( "(") (binary_expression "param_1 + 0x100" (identifier "param_1") (+ "+") (number_literal "0x100")) () ")")))) (!= "!=") (number_literal "0")) () ")")) (compound_statement "{\n      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;\n      *(undefined4 *)(param_1 + 0x100) = 0;\n    }" ({ "{") (if_statement "if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;" (if "if") (parenthesized_expression "(((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0))" (( "(") (binary_expression "((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&\n         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)" (parenthesized_expression "((*(ulong *)(param_1 + 0xf0) & 0xf) != 0)" (( "(") (binary_expression "(*(ulong *)(param_1 + 0xf0) & 0xf) != 0" (parenthesized_expression "(*(ulong *)(param_1 + 0xf0) & 0xf)" (( "(") (binary_expression "*(ulong *)(param_1 + 0xf0) & 0xf" (pointer_expression "*(ulong *)(param_1 + 0xf0)" (* "*") (cast_expression "(ulong *)(param_1 + 0xf0)" (( "(") (type_descriptor "ulong *" (type_identifier "ulong") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xf0)" (( "(") (binary_expression "param_1 + 0xf0" (identifier "param_1") (+ "+") (number_literal "0xf0")) () ")")))) (& "&") (number_literal "0xf")) () ")")) (!= "!=") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)" (( "(") (comma_expression "uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0" (assignment_expression "uVar1 = poly1305_process(param_1,local_48)" (identifier "uVar1") (= "=") (call_expression "poly1305_process(param_1,local_48)" (identifier "poly1305_process") (argument_list "(param_1,local_48)" (( "(") (identifier "param_1") (, ",") (identifier "local_48") () ")")))) (, ",") (binary_expression "(int)uVar1 != 0" (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")) (!= "!=") (number_literal "0"))) () ")"))) () ")")) (goto_statement "goto LAB_0013916e;" (goto "goto") (statement_identifier "LAB_0013916e") (; ";"))) (expression_statement "*(undefined4 *)(param_1 + 0x100) = 0;" (assignment_expression "*(undefined4 *)(param_1 + 0x100) = 0" (pointer_expression "*(undefined4 *)(param_1 + 0x100)" (* "*") (cast_expression "(undefined4 *)(param_1 + 0x100)" (( "(") (type_descriptor "undefined4 *" (type_identifier "undefined4") (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0x100)" (( "(") (binary_expression "param_1 + 0x100" (identifier "param_1") (+ "+") (number_literal "0x100")) () ")")))) (= "=") (number_literal "0")) (; ";")) (} "}"))) (expression_statement "uVar1 = poly1305_process(param_1,param_2,param_3);" (assignment_expression "uVar1 = poly1305_process(param_1,param_2,param_3)" (identifier "uVar1") (= "=") (call_expression "poly1305_process(param_1,param_2,param_3)" (identifier "poly1305_process") (argument_list "(param_1,param_2,param_3)" (( "(") (identifier "param_1") (, ",") (identifier "param_2") (, ",") (identifier "param_3") () ")")))) (; ";")) (if_statement "if (((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }" (if "if") (parenthesized_expression "(((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0))" (( "(") (binary_expression "((int)uVar1 == 0) &&\n       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)" (parenthesized_expression "((int)uVar1 == 0)" (( "(") (binary_expression "(int)uVar1 == 0" (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")) (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)" (( "(") (comma_expression "uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0" (assignment_expression "uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4)" (identifier "uVar1") (= "=") (call_expression "chacha_crypt(param_1 + 0x58,param_2,param_3,param_4)" (identifier "chacha_crypt") (argument_list "(param_1 + 0x58,param_2,param_3,param_4)" (( "(") (binary_expression "param_1 + 0x58" (identifier "param_1") (+ "+") (number_literal "0x58")) (, ",") (identifier "param_2") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (, ",") (binary_expression "(int)uVar1 == 0" (cast_expression "(int)uVar1" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar1")) (== "==") (number_literal "0"))) () ")"))) () ")")) (compound_statement "{\n      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;\n    }" ({ "{") (expression_statement "*(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;" (assignment_expression "*(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3" (pointer_expression "*(long *)(param_1 + 0xf8)" (* "*") (cast_expression "(long *)(param_1 + 0xf8)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xf8)" (( "(") (binary_expression "param_1 + 0xf8" (identifier "param_1") (+ "+") (number_literal "0xf8")) () ")")))) (= "=") (binary_expression "*(long *)(param_1 + 0xf8) + param_3" (pointer_expression "*(long *)(param_1 + 0xf8)" (* "*") (cast_expression "(long *)(param_1 + 0xf8)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(param_1 + 0xf8)" (( "(") (binary_expression "param_1 + 0xf8" (identifier "param_1") (+ "+") (number_literal "0xf8")) () ")")))) (+ "+") (identifier "param_3"))) (; ";")) (} "}"))) (} "}")))) (labeled_statement "LAB_0013916e:\n  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" (statement_identifier "LAB_0013916e") (: ":") (if_statement "if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {\n                    \n    __stack_chk_fail();\n  }" (if "if") (parenthesized_expression "(local_30 != *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_30 != *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_30") (!= "!=") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n                    \n    __stack_chk_fail();\n  }" ({ "{") (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))) (return_statement "return uVar1;" (return "return") (identifier "uVar1") (; ";")) (} "}")))

int function_1(type_1 *var_3,type_2 *in,type_3 var_2,type_2 *out)

{
  long var_9;
  int var_7;
  type_3 var_5;
  long var_1;
  type_2 padzero [16];
  
  var_9 = *(long *)(var_1 + 0x28);
  padzero[0] = '\0';
  padzero[1] = '\0';
  padzero[2] = '\0';
  padzero[3] = '\0';
  padzero[4] = '\0';
  padzero[5] = '\0';
  padzero[6] = '\0';
  padzero[7] = '\0';
  padzero[8] = '\0';
  padzero[9] = '\0';
  padzero[10] = '\0';
  padzero[0xb] = '\0';
  padzero[0xc] = '\0';
  padzero[0xd] = '\0';
  padzero[0xe] = '\0';
  padzero[0xf] = '\0';
  if (var_2 == 0) {
    var_7 = 0;
  }
  else {
    if (var_3 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
      var_4("st != NULL","src/encauth/chachapoly/chacha20poly1305_decrypt.c",0x1d);
    }
    if (var_3->aadflg != 0) {
      var_5 = 0x10 - (type_3)((type_4)var_3->aadlen & 0xf);
      if ((var_5 != 0x10) && (var_7 = var_6(&var_3->poly,padzero,var_5), var_7 != 0))
      goto LAB_0013916e;
      var_3->aadflg = 0;
    }
    var_7 = var_6(&var_3->poly,in,var_2);
    if ((var_7 == 0) && (var_7 = var_8(&var_3->chacha,in,var_2,out), var_7 == 0)) {
      var_3->ctlen = var_3->ctlen + var_2;
    }
  }
LAB_0013916e:
  if (var_9 != *(long *)(var_1 + 0x28)) {
                    /* WARNING: Subroutine does not return */
    var_10();
  }
  return var_7;
}


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

undefined8 MASKED(long param_1,undefined8 param_2,long param_3,undefined8 param_4)

{
  undefined8 uVar1;
  long in_FS_OFFSET;
  undefined1 local_48 [16];
  long local_30;
  
  local_30 = *(long *)(in_FS_OFFSET + 0x28);
  local_48 = (undefined1  [16])0x0;
  if (param_3 == 0) {
    uVar1 = 0;
  }
  else {
    if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
      crypt_argchk("st != NULL","src/encauth/chachapoly/MASKED.c",0x1d);
    }
    if (*(int *)(param_1 + 0x100) != 0) {
      if (((*(ulong *)(param_1 + 0xf0) & 0xf) != 0) &&
         (uVar1 = poly1305_process(param_1,local_48), (int)uVar1 != 0)) goto LAB_0013916e;
      *(undefined4 *)(param_1 + 0x100) = 0;
    }
    uVar1 = poly1305_process(param_1,param_2,param_3);
    if (((int)uVar1 == 0) &&
       (uVar1 = chacha_crypt(param_1 + 0x58,param_2,param_3,param_4), (int)uVar1 == 0)) {
      *(long *)(param_1 + 0xf8) = *(long *)(param_1 + 0xf8) + param_3;
    }
  }
LAB_0013916e:
  if (local_30 != *(long *)(in_FS_OFFSET + 0x28)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar1;
}

