
int chacha20poly1305_memory
              (uchar *key,ulong keylen,uchar *iv,ulong ivlen,uchar *aad,ulong aadlen,uchar *in,
              ulong inlen,uchar *out,uchar *tag,ulong *taglen,int direction)

{
  long lVar1;
  int iVar2;
  long in_FS_OFFSET;
  chacha20poly1305_state st;
  
  lVar1 = *(long *)(in_FS_OFFSET + 0x28);
  if (key == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);
  }
  if (iv == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);
  }
  if (in == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);
  }
  if (out == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);
  }
  if (tag == (uchar *)0x0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);
  }
  iVar2 = chacha20poly1305_init(&st,key,keylen);
  if (((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&
     ((aad == (uchar *)0x0 ||
      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))) {
    if (direction == 0) {
      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);
    }
    else {
      iVar2 = 0x10;
      if (direction != 1) goto LAB_001366ad;
      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);
    }
    if (iVar2 == 0) {
      iVar2 = chacha20poly1305_done(&st,tag,taglen);
    }
  }
LAB_001366ad:
  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {
    return iVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}



undefined8
chacha20poly1305_memory
          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6
          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,
          int param_12)

{
  int iVar1;
  undefined8 uVar2;
  long in_FS_OFFSET;
  undefined1 local_148 [264];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);
  }
  if (param_3 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);
  }
  if (param_7 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);
  }
  if (param_9 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);
  }
  if (param_10 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);
  }
  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);
  if ((((int)uVar2 == 0) &&
      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&
     ((param_5 == 0 ||
      ((param_6 == 0 ||
       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {
    if (param_12 == 0) {
      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);
      iVar1 = (int)uVar2;
    }
    else {
      uVar2 = 0x10;
      if (param_12 != 1) goto LAB_001366ad;
      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);
      iVar1 = (int)uVar2;
    }
    if (iVar1 == 0) {
      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);
    }
  }
LAB_001366ad:
  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
    return uVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}


PUSH R15
PUSH R14
PUSH R13
PUSH R12
PUSH RBP
PUSH RBX
SUB RSP,0x138
MOV RAX,qword ptr [RSP + 0x190]
MOV qword ptr [RSP + 0x8],RCX
MOV qword ptr [RSP + 0x10],R9
MOV RBP,qword ptr [RSP + 0x170]
MOV qword ptr [RSP + 0x18],RAX
MOV R12,qword ptr [RSP + 0x180]
MOV R13,qword ptr [RSP + 0x188]
MOV RAX,qword ptr FS:[0x28]
MOV qword ptr [RSP + 0x128],RAX
XOR EAX,EAX
TEST RDI,RDI
JZ 0x001367f4
MOV R14,RDX
TEST RDX,RDX
JZ 0x001367dc
TEST RBP,RBP
JZ 0x001367c4
TEST R12,R12
JZ 0x001367ac
TEST R13,R13
JZ 0x00136794
LEA RBX,[RSP + 0x20]
MOV RDX,RSI
MOV RSI,RDI
MOV R15,R8
MOV RDI,RBX
CALL 0x001140c0
TEST EAX,EAX
JZ 0x001366e0
MOV RCX,qword ptr [RSP + 0x128]
XOR RCX,qword ptr FS:[0x28]
JNZ 0x0013678f
ADD RSP,0x138
POP RBX
POP RBP
POP R12
POP R13
POP R14
POP R15
RET
MOV RDX,qword ptr [RSP + 0x8]
MOV RSI,R14
MOV RDI,RBX
CALL 0x00113b50
TEST EAX,EAX
JNZ 0x001366ad
TEST R15,R15
JZ 0x00136701
CMP qword ptr [RSP + 0x10],0x0
JNZ 0x00136750
MOV EDX,dword ptr [RSP + 0x198]
TEST EDX,EDX
JZ 0x00136770
CMP dword ptr [RSP + 0x198],0x1
MOV EAX,0x10
JNZ 0x001366ad
MOV RDX,qword ptr [RSP + 0x178]
MOV RCX,R12
MOV RSI,RBP
MOV RDI,RBX
CALL 0x001144f0
TEST EAX,EAX
JNZ 0x001366ad
MOV RDX,qword ptr [RSP + 0x18]
MOV RSI,R13
MOV RDI,RBX
CALL 0x00114750
JMP 0x001366ad
MOV RDX,qword ptr [RSP + 0x10]
MOV RSI,R15
MOV RDI,RBX
CALL 0x00114c50
TEST EAX,EAX
JZ 0x00136701
JMP 0x001366ad
MOV RDX,qword ptr [RSP + 0x178]
MOV RCX,R12
MOV RSI,RBP
MOV RDI,RBX
CALL 0x001144c0
TEST EAX,EAX
JZ 0x00136739
JMP 0x001366ad
CALL 0x00113880
MOV EDX,0x2d
LEA RSI,[0x1aad78]
LEA RDI,[0x1aa761]
CALL 0x00114270
MOV EDX,0x2c
LEA RSI,[0x1aad78]
LEA RDI,[0x1a87a1]
CALL 0x00114270
MOV EDX,0x2b
LEA RSI,[0x1aad78]
LEA RDI,[0x1a8790]
CALL 0x00114270
MOV EDX,0x2a
LEA RSI,[0x1aad78]
LEA RDI,[0x1aada9]
CALL 0x00114270
MOV EDX,0x29
LEA RSI,[0x1aad78]
LEA RDI,[0x1c5e5d]
CALL 0x00114270
(translation_unit "undefined8\nchacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)\n\n{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "undefined8\nchacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)\n\n{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" type_identifier (function_declarator "chacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)" identifier (parameter_list "(long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)" ( (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) , (parameter_declaration "long param_5" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_6" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_7" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_8" type_identifier identifier) , (parameter_declaration "long param_9" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_10" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_11" type_identifier identifier) , (parameter_declaration "int param_12" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined8 uVar2;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 local_148 [264];" type_identifier (array_declarator "local_148 [264]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(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) ))))) ;) (if_statement "if (param_1 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\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("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }" { comment (expression_statement "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);" (call_expression "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" identifier (argument_list "("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" ( (string_literal ""key != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_3 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" { comment (expression_statement "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);" (call_expression "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" identifier (argument_list "("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" ( (string_literal ""iv != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_7 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" if (parenthesized_expression "(param_7 == 0)" ( (binary_expression "param_7 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" { comment (expression_statement "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);" (call_expression "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" identifier (argument_list "("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" ( (string_literal ""in != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_9 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" if (parenthesized_expression "(param_9 == 0)" ( (binary_expression "param_9 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" { comment (expression_statement "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);" (call_expression "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" identifier (argument_list "("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_10 == 0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" if (parenthesized_expression "(param_10 == 0)" ( (binary_expression "param_10 == 0" identifier == number_literal) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" { comment (expression_statement "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);" (call_expression "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" identifier (argument_list "("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" ( (string_literal ""tag != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "uVar2 = chacha20poly1305_init(local_148,param_1,param_2);" (assignment_expression "uVar2 = chacha20poly1305_init(local_148,param_1,param_2)" identifier = (call_expression "chacha20poly1305_init(local_148,param_1,param_2)" identifier (argument_list "(local_148,param_1,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }" if (parenthesized_expression "((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))))))" ( (binary_expression "(((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))" (parenthesized_expression "(((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0))" ( (binary_expression "((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)" (parenthesized_expression "((int)uVar2 == 0)" ( (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal) )) && (parenthesized_expression "(uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)" ( (comma_expression "uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0" (assignment_expression "uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4)" identifier = (call_expression "chacha20poly1305_setiv(local_148,param_3,param_4)" identifier (argument_list "(local_148,param_3,param_4)" ( identifier , identifier , identifier )))) , (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal)) ))) )) && (parenthesized_expression "((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))" ( (parenthesized_expression "(param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))))" ( (binary_expression "param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))" (binary_expression "param_5 == 0" identifier == number_literal) || (parenthesized_expression "((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))" ( (parenthesized_expression "(param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))" ( (binary_expression "param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)" (binary_expression "param_6 == 0" identifier == number_literal) || (parenthesized_expression "(uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)" ( (comma_expression "uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0" (assignment_expression "uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6)" identifier = (call_expression "chacha20poly1305_add_aad(local_148,param_5,param_6)" identifier (argument_list "(local_148,param_5,param_6)" ( identifier , identifier , identifier )))) , (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal)) ))) )) ))) )) ))) )) (compound_statement "{\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }" { (if_statement "if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" if (parenthesized_expression "(param_12 == 0)" ( (binary_expression "param_12 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" { (expression_statement "uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);" (assignment_expression "uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9)" identifier = (call_expression "chacha20poly1305_encrypt(local_148,param_7,param_8,param_9)" identifier (argument_list "(local_148,param_7,param_8,param_9)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "iVar1 = (int)uVar2;" (assignment_expression "iVar1 = (int)uVar2" identifier = (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" else (compound_statement "{\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" { (expression_statement "uVar2 = 0x10;" (assignment_expression "uVar2 = 0x10" identifier = number_literal) ;) (if_statement "if (param_12 != 1) goto LAB_001366ad;" if (parenthesized_expression "(param_12 != 1)" ( (binary_expression "param_12 != 1" identifier != number_literal) )) (goto_statement "goto LAB_001366ad;" goto statement_identifier ;)) (expression_statement "uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);" (assignment_expression "uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9)" identifier = (call_expression "chacha20poly1305_decrypt(local_148,param_7,param_8,param_9)" identifier (argument_list "(local_148,param_7,param_8,param_9)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "iVar1 = (int)uVar2;" (assignment_expression "iVar1 = (int)uVar2" identifier = (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }))) (if_statement "if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }" { (expression_statement "uVar2 = chacha20poly1305_done(local_148,param_10,param_11);" (assignment_expression "uVar2 = chacha20poly1305_done(local_148,param_10,param_11)" identifier = (call_expression "chacha20poly1305_done(local_148,param_10,param_11)" identifier (argument_list "(local_148,param_10,param_11)" ( identifier , identifier , identifier )))) ;) })) })) (labeled_statement "LAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return uVar2;\n  }" { (return_statement "return uVar2;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "int chacha20poly1305_memory\n              (uchar *key,ulong keylen,uchar *iv,ulong ivlen,uchar *aad,ulong aadlen,uchar *in,\n              ulong inlen,uchar *out,uchar *tag,ulong *taglen,int direction)\n\n{\n  long lVar1;\n  int iVar2;\n  long in_FS_OFFSET;\n  chacha20poly1305_state st;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (iv == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (in == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (tag == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  iVar2 = chacha20poly1305_init(&st,key,keylen);\n  if (((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&\n     ((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))) {\n    if (direction == 0) {\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }\n    else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }\n    if (iVar2 == 0) {\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }\n  }\nLAB_001366ad:\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}\n\n" (function_definition "int chacha20poly1305_memory\n              (uchar *key,ulong keylen,uchar *iv,ulong ivlen,uchar *aad,ulong aadlen,uchar *in,\n              ulong inlen,uchar *out,uchar *tag,ulong *taglen,int direction)\n\n{\n  long lVar1;\n  int iVar2;\n  long in_FS_OFFSET;\n  chacha20poly1305_state st;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (iv == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (in == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (tag == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  iVar2 = chacha20poly1305_init(&st,key,keylen);\n  if (((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&\n     ((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))) {\n    if (direction == 0) {\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }\n    else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }\n    if (iVar2 == 0) {\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }\n  }\nLAB_001366ad:\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" primitive_type (function_declarator "chacha20poly1305_memory\n              (uchar *key,ulong keylen,uchar *iv,ulong ivlen,uchar *aad,ulong aadlen,uchar *in,\n              ulong inlen,uchar *out,uchar *tag,ulong *taglen,int direction)" identifier (parameter_list "(uchar *key,ulong keylen,uchar *iv,ulong ivlen,uchar *aad,ulong aadlen,uchar *in,\n              ulong inlen,uchar *out,uchar *tag,ulong *taglen,int direction)" ( (parameter_declaration "uchar *key" type_identifier (pointer_declarator "*key" * identifier)) , (parameter_declaration "ulong keylen" type_identifier identifier) , (parameter_declaration "uchar *iv" type_identifier (pointer_declarator "*iv" * identifier)) , (parameter_declaration "ulong ivlen" type_identifier identifier) , (parameter_declaration "uchar *aad" type_identifier (pointer_declarator "*aad" * identifier)) , (parameter_declaration "ulong aadlen" type_identifier 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)) , (parameter_declaration "uchar *tag" type_identifier (pointer_declarator "*tag" * identifier)) , (parameter_declaration "ulong *taglen" type_identifier (pointer_declarator "*taglen" * identifier)) , (parameter_declaration "int direction" primitive_type identifier) ))) (compound_statement "{\n  long lVar1;\n  int iVar2;\n  long in_FS_OFFSET;\n  chacha20poly1305_state st;\n  \n  lVar1 = *(long *)(in_FS_OFFSET + 0x28);\n  if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (iv == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (in == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (tag == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  iVar2 = chacha20poly1305_init(&st,key,keylen);\n  if (((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&\n     ((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))) {\n    if (direction == 0) {\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }\n    else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }\n    if (iVar2 == 0) {\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }\n  }\nLAB_001366ad:\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }\n                    /* WARNING: Subroutine does not return */\n  __stack_chk_fail();\n}" { (declaration "long lVar1;" (sized_type_specifier "long" long) identifier ;) (declaration "int iVar2;" primitive_type identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "chacha20poly1305_state st;" type_identifier identifier ;) (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) ))))) ;) (if_statement "if (key == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }" if (parenthesized_expression "(key == (uchar *)0x0)" ( (binary_expression "key == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }" { comment (expression_statement "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);" (call_expression "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" identifier (argument_list "("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" ( (string_literal ""key != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (iv == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" if (parenthesized_expression "(iv == (uchar *)0x0)" ( (binary_expression "iv == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" { comment (expression_statement "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);" (call_expression "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" identifier (argument_list "("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" ( (string_literal ""iv != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (in == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" if (parenthesized_expression "(in == (uchar *)0x0)" ( (binary_expression "in == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" { comment (expression_statement "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);" (call_expression "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" identifier (argument_list "("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" ( (string_literal ""in != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (out == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" if (parenthesized_expression "(out == (uchar *)0x0)" ( (binary_expression "out == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" { comment (expression_statement "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);" (call_expression "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" identifier (argument_list "("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (tag == (uchar *)0x0) {\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" if (parenthesized_expression "(tag == (uchar *)0x0)" ( (binary_expression "tag == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) )) (compound_statement "{\n                    /* WARNING: Subroutine does not return */\n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" { comment (expression_statement "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);" (call_expression "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" identifier (argument_list "("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" ( (string_literal ""tag != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "iVar2 = chacha20poly1305_init(&st,key,keylen);" (assignment_expression "iVar2 = chacha20poly1305_init(&st,key,keylen)" identifier = (call_expression "chacha20poly1305_init(&st,key,keylen)" identifier (argument_list "(&st,key,keylen)" ( (pointer_expression "&st" & identifier) , identifier , identifier )))) ;) (if_statement "if (((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&\n     ((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))) {\n    if (direction == 0) {\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }\n    else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }\n    if (iVar2 == 0) {\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }\n  }" if (parenthesized_expression "(((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&\n     ((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0))))))" ( (binary_expression "((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)) &&\n     ((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))" (parenthesized_expression "((iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0))" ( (binary_expression "(iVar2 == 0) && (iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)" (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) && (parenthesized_expression "(iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0)" ( (comma_expression "iVar2 = chacha20poly1305_setiv(&st,iv,ivlen), iVar2 == 0" (assignment_expression "iVar2 = chacha20poly1305_setiv(&st,iv,ivlen)" identifier = (call_expression "chacha20poly1305_setiv(&st,iv,ivlen)" identifier (argument_list "(&st,iv,ivlen)" ( (pointer_expression "&st" & identifier) , identifier , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) && (parenthesized_expression "((aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))))" ( (parenthesized_expression "(aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0))))" ( (binary_expression "aad == (uchar *)0x0 ||\n      ((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))" (binary_expression "aad == (uchar *)0x0" identifier == (cast_expression "(uchar *)0x0" ( (type_descriptor "uchar *" type_identifier (abstract_pointer_declarator "*" *)) ) number_literal)) || (parenthesized_expression "((aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)))" ( (parenthesized_expression "(aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0))" ( (binary_expression "aadlen == 0 || (iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)" (binary_expression "aadlen == 0" identifier == number_literal) || (parenthesized_expression "(iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0)" ( (comma_expression "iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen), iVar2 == 0" (assignment_expression "iVar2 = chacha20poly1305_add_aad(&st,aad,aadlen)" identifier = (call_expression "chacha20poly1305_add_aad(&st,aad,aadlen)" identifier (argument_list "(&st,aad,aadlen)" ( (pointer_expression "&st" & identifier) , identifier , identifier )))) , (binary_expression "iVar2 == 0" identifier == number_literal)) ))) )) ))) )) ))) )) (compound_statement "{\n    if (direction == 0) {\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }\n    else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }\n    if (iVar2 == 0) {\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }\n  }" { (if_statement "if (direction == 0) {\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }\n    else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }" if (parenthesized_expression "(direction == 0)" ( (binary_expression "direction == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);\n    }" { (expression_statement "iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out);" (assignment_expression "iVar2 = chacha20poly1305_encrypt(&st,in,inlen,out)" identifier = (call_expression "chacha20poly1305_encrypt(&st,in,inlen,out)" identifier (argument_list "(&st,in,inlen,out)" ( (pointer_expression "&st" & identifier) , identifier , identifier , identifier )))) ;) }) (else_clause "else {\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }" else (compound_statement "{\n      iVar2 = 0x10;\n      if (direction != 1) goto LAB_001366ad;\n      iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);\n    }" { (expression_statement "iVar2 = 0x10;" (assignment_expression "iVar2 = 0x10" identifier = number_literal) ;) (if_statement "if (direction != 1) goto LAB_001366ad;" if (parenthesized_expression "(direction != 1)" ( (binary_expression "direction != 1" identifier != number_literal) )) (goto_statement "goto LAB_001366ad;" goto statement_identifier ;)) (expression_statement "iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out);" (assignment_expression "iVar2 = chacha20poly1305_decrypt(&st,in,inlen,out)" identifier = (call_expression "chacha20poly1305_decrypt(&st,in,inlen,out)" identifier (argument_list "(&st,in,inlen,out)" ( (pointer_expression "&st" & identifier) , identifier , identifier , identifier )))) ;) }))) (if_statement "if (iVar2 == 0) {\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }" if (parenthesized_expression "(iVar2 == 0)" ( (binary_expression "iVar2 == 0" identifier == number_literal) )) (compound_statement "{\n      iVar2 = chacha20poly1305_done(&st,tag,taglen);\n    }" { (expression_statement "iVar2 = chacha20poly1305_done(&st,tag,taglen);" (assignment_expression "iVar2 = chacha20poly1305_done(&st,tag,taglen)" identifier = (call_expression "chacha20poly1305_done(&st,tag,taglen)" identifier (argument_list "(&st,tag,taglen)" ( (pointer_expression "&st" & identifier) , identifier , identifier )))) ;) })) })) (labeled_statement "LAB_001366ad:\n  if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\n  }" statement_identifier : (if_statement "if (lVar1 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return iVar2;\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    return iVar2;\n  }" { (return_statement "return iVar2;" return identifier ;) }))) comment (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit "undefined8\nchacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)\n\n{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    \n  __stack_chk_fail();\n}\n\n" (function_definition "undefined8\nchacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)\n\n{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    \n  __stack_chk_fail();\n}" type_identifier (function_declarator "chacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)" identifier (parameter_list "(long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)" ( (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) , (parameter_declaration "long param_5" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_6" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_7" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_8" type_identifier identifier) , (parameter_declaration "long param_9" (sized_type_specifier "long" long) identifier) , (parameter_declaration "long param_10" (sized_type_specifier "long" long) identifier) , (parameter_declaration "undefined8 param_11" type_identifier identifier) , (parameter_declaration "int param_12" primitive_type identifier) ))) (compound_statement "{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    \n  __stack_chk_fail();\n}" { (declaration "int iVar1;" primitive_type identifier ;) (declaration "undefined8 uVar2;" type_identifier identifier ;) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" long) identifier ;) (declaration "undefined1 local_148 [264];" type_identifier (array_declarator "local_148 [264]" identifier [ number_literal ]) ;) (declaration "long local_40;" (sized_type_specifier "long" long) identifier ;) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(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) ))))) ;) (if_statement "if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }" if (parenthesized_expression "(param_1 == 0)" ( (binary_expression "param_1 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }" { (expression_statement "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);" (call_expression "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" identifier (argument_list "("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" ( (string_literal ""key != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" if (parenthesized_expression "(param_3 == 0)" ( (binary_expression "param_3 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" { (expression_statement "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);" (call_expression "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" identifier (argument_list "("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" ( (string_literal ""iv != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" if (parenthesized_expression "(param_7 == 0)" ( (binary_expression "param_7 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" { (expression_statement "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);" (call_expression "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" identifier (argument_list "("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" ( (string_literal ""in != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" if (parenthesized_expression "(param_9 == 0)" ( (binary_expression "param_9 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" { (expression_statement "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);" (call_expression "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" identifier (argument_list "("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" ( (string_literal ""out != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (if_statement "if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" if (parenthesized_expression "(param_10 == 0)" ( (binary_expression "param_10 == 0" identifier == number_literal) )) (compound_statement "{\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" { (expression_statement "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);" (call_expression "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" identifier (argument_list "("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" ( (string_literal ""tag != NULL"" " string_content ") , (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" " string_content ") , number_literal ))) ;) })) (expression_statement "uVar2 = chacha20poly1305_init(local_148,param_1,param_2);" (assignment_expression "uVar2 = chacha20poly1305_init(local_148,param_1,param_2)" identifier = (call_expression "chacha20poly1305_init(local_148,param_1,param_2)" identifier (argument_list "(local_148,param_1,param_2)" ( identifier , identifier , identifier )))) ;) (if_statement "if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }" if (parenthesized_expression "((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))))))" ( (binary_expression "(((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))" (parenthesized_expression "(((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0))" ( (binary_expression "((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)" (parenthesized_expression "((int)uVar2 == 0)" ( (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal) )) && (parenthesized_expression "(uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)" ( (comma_expression "uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0" (assignment_expression "uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4)" identifier = (call_expression "chacha20poly1305_setiv(local_148,param_3,param_4)" identifier (argument_list "(local_148,param_3,param_4)" ( identifier , identifier , identifier )))) , (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal)) ))) )) && (parenthesized_expression "((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))" ( (parenthesized_expression "(param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))))" ( (binary_expression "param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))" (binary_expression "param_5 == 0" identifier == number_literal) || (parenthesized_expression "((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))" ( (parenthesized_expression "(param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))" ( (binary_expression "param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)" (binary_expression "param_6 == 0" identifier == number_literal) || (parenthesized_expression "(uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)" ( (comma_expression "uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0" (assignment_expression "uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6)" identifier = (call_expression "chacha20poly1305_add_aad(local_148,param_5,param_6)" identifier (argument_list "(local_148,param_5,param_6)" ( identifier , identifier , identifier )))) , (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier) == number_literal)) ))) )) ))) )) ))) )) (compound_statement "{\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }" { (if_statement "if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" if (parenthesized_expression "(param_12 == 0)" ( (binary_expression "param_12 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" { (expression_statement "uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);" (assignment_expression "uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9)" identifier = (call_expression "chacha20poly1305_encrypt(local_148,param_7,param_8,param_9)" identifier (argument_list "(local_148,param_7,param_8,param_9)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "iVar1 = (int)uVar2;" (assignment_expression "iVar1 = (int)uVar2" identifier = (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }) (else_clause "else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" else (compound_statement "{\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" { (expression_statement "uVar2 = 0x10;" (assignment_expression "uVar2 = 0x10" identifier = number_literal) ;) (if_statement "if (param_12 != 1) goto LAB_001366ad;" if (parenthesized_expression "(param_12 != 1)" ( (binary_expression "param_12 != 1" identifier != number_literal) )) (goto_statement "goto LAB_001366ad;" goto statement_identifier ;)) (expression_statement "uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);" (assignment_expression "uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9)" identifier = (call_expression "chacha20poly1305_decrypt(local_148,param_7,param_8,param_9)" identifier (argument_list "(local_148,param_7,param_8,param_9)" ( identifier , identifier , identifier , identifier )))) ;) (expression_statement "iVar1 = (int)uVar2;" (assignment_expression "iVar1 = (int)uVar2" identifier = (cast_expression "(int)uVar2" ( (type_descriptor "int" primitive_type) ) identifier)) ;) }))) (if_statement "if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }" if (parenthesized_expression "(iVar1 == 0)" ( (binary_expression "iVar1 == 0" identifier == number_literal) )) (compound_statement "{\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }" { (expression_statement "uVar2 = chacha20poly1305_done(local_148,param_10,param_11);" (assignment_expression "uVar2 = chacha20poly1305_done(local_148,param_10,param_11)" identifier = (call_expression "chacha20poly1305_done(local_148,param_10,param_11)" identifier (argument_list "(local_148,param_10,param_11)" ( identifier , identifier , identifier )))) ;) })) })) (labeled_statement "LAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }" statement_identifier : (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }" if (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" ( (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" identifier == (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" * (cast_expression "(long *)(in_FS_OFFSET + 0x28)" ( (type_descriptor "long *" (sized_type_specifier "long" long) (abstract_pointer_declarator "*" *)) ) (parenthesized_expression "(in_FS_OFFSET + 0x28)" ( (binary_expression "in_FS_OFFSET + 0x28" identifier + number_literal) ))))) )) (compound_statement "{\n    return uVar2;\n  }" { (return_statement "return uVar2;" return identifier ;) }))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" identifier (argument_list "()" ( ))) ;) })))
(translation_unit (function_definition TYPE (function_declarator IDENT (parameter_list ( (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration (sized_type_specifier long) IDENT) , (parameter_declaration TYPE IDENT) , (parameter_declaration TYPE IDENT) ))) (compound_statement { (declaration TYPE IDENT ;) (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) ))))) ;) (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 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 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 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 IDENT == LIT) )) (compound_statement { (expression_statement (call_expression IDENT (argument_list ( (string_literal " string_content ") , (string_literal " string_content ") , 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 (parenthesized_expression ( (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) == LIT) )) && (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) == LIT)) ))) )) && (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT == LIT) || (parenthesized_expression ( (parenthesized_expression ( (binary_expression (binary_expression IDENT == LIT) || (parenthesized_expression ( (comma_expression (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT )))) , (binary_expression (cast_expression ( (type_descriptor TYPE) ) IDENT) == LIT)) ))) )) ))) )) ))) )) (compound_statement { (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }) (else_clause else (compound_statement { (expression_statement (assignment_expression IDENT = LIT) ;) (if_statement if (parenthesized_expression ( (binary_expression IDENT != LIT) )) (goto_statement goto statement_identifier ;)) (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , IDENT , IDENT )))) ;) (expression_statement (assignment_expression IDENT = (cast_expression ( (type_descriptor TYPE) ) IDENT)) ;) }))) (if_statement if (parenthesized_expression ( (binary_expression IDENT == LIT) )) (compound_statement { (expression_statement (assignment_expression IDENT = (call_expression IDENT (argument_list ( IDENT , IDENT , 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 { (return_statement return IDENT ;) }))) (expression_statement (call_expression IDENT (argument_list ( ))) ;) })))
(function_definition "undefined8\nchacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)\n\n{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    \n  __stack_chk_fail();\n}" (type_identifier "undefined8") (function_declarator "chacha20poly1305_memory\n          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)" (identifier "chacha20poly1305_memory") (parameter_list "(long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6\n          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,\n          int param_12)" (( "(") (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")) (, ",") (parameter_declaration "long param_5" (sized_type_specifier "long" (long "long")) (identifier "param_5")) (, ",") (parameter_declaration "long param_6" (sized_type_specifier "long" (long "long")) (identifier "param_6")) (, ",") (parameter_declaration "long param_7" (sized_type_specifier "long" (long "long")) (identifier "param_7")) (, ",") (parameter_declaration "undefined8 param_8" (type_identifier "undefined8") (identifier "param_8")) (, ",") (parameter_declaration "long param_9" (sized_type_specifier "long" (long "long")) (identifier "param_9")) (, ",") (parameter_declaration "long param_10" (sized_type_specifier "long" (long "long")) (identifier "param_10")) (, ",") (parameter_declaration "undefined8 param_11" (type_identifier "undefined8") (identifier "param_11")) (, ",") (parameter_declaration "int param_12" (primitive_type "int") (identifier "param_12")) () ")"))) (compound_statement "{\n  int iVar1;\n  undefined8 uVar2;\n  long in_FS_OFFSET;\n  undefined1 local_148 [264];\n  long local_40;\n  \n  local_40 = *(long *)(in_FS_OFFSET + 0x28);\n  if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }\n  if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }\n  if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }\n  if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }\n  if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }\n  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);\n  if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }\nLAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }\n                    \n  __stack_chk_fail();\n}" ({ "{") (declaration "int iVar1;" (primitive_type "int") (identifier "iVar1") (; ";")) (declaration "undefined8 uVar2;" (type_identifier "undefined8") (identifier "uVar2") (; ";")) (declaration "long in_FS_OFFSET;" (sized_type_specifier "long" (long "long")) (identifier "in_FS_OFFSET") (; ";")) (declaration "undefined1 local_148 [264];" (type_identifier "undefined1") (array_declarator "local_148 [264]" (identifier "local_148") ([ "[") (number_literal "264") (] "]")) (; ";")) (declaration "long local_40;" (sized_type_specifier "long" (long "long")) (identifier "local_40") (; ";")) (expression_statement "local_40 = *(long *)(in_FS_OFFSET + 0x28);" (assignment_expression "local_40 = *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (= "=") (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")) () ")"))))) (; ";")) (if_statement "if (param_1 == 0) {\n                    \n    crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\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("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);\n  }" ({ "{") (expression_statement "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);" (call_expression "crypt_argchk("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" (identifier "crypt_argchk") (argument_list "("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29)" (( "(") (string_literal ""key != NULL"" (" """) (string_content "key != NULL") (" """)) (, ",") (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" (" """) (string_content "src/encauth/chachapoly/chacha20poly1305_memory.c") (" """)) (, ",") (number_literal "0x29") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_3 == 0) {\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" (if "if") (parenthesized_expression "(param_3 == 0)" (( "(") (binary_expression "param_3 == 0" (identifier "param_3") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);\n  }" ({ "{") (expression_statement "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);" (call_expression "crypt_argchk("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" (identifier "crypt_argchk") (argument_list "("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a)" (( "(") (string_literal ""iv != NULL"" (" """) (string_content "iv != NULL") (" """)) (, ",") (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" (" """) (string_content "src/encauth/chachapoly/chacha20poly1305_memory.c") (" """)) (, ",") (number_literal "0x2a") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_7 == 0) {\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" (if "if") (parenthesized_expression "(param_7 == 0)" (( "(") (binary_expression "param_7 == 0" (identifier "param_7") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);\n  }" ({ "{") (expression_statement "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);" (call_expression "crypt_argchk("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" (identifier "crypt_argchk") (argument_list "("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b)" (( "(") (string_literal ""in != NULL"" (" """) (string_content "in != NULL") (" """)) (, ",") (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" (" """) (string_content "src/encauth/chachapoly/chacha20poly1305_memory.c") (" """)) (, ",") (number_literal "0x2b") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_9 == 0) {\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" (if "if") (parenthesized_expression "(param_9 == 0)" (( "(") (binary_expression "param_9 == 0" (identifier "param_9") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);\n  }" ({ "{") (expression_statement "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);" (call_expression "crypt_argchk("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" (identifier "crypt_argchk") (argument_list "("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c)" (( "(") (string_literal ""out != NULL"" (" """) (string_content "out != NULL") (" """)) (, ",") (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" (" """) (string_content "src/encauth/chachapoly/chacha20poly1305_memory.c") (" """)) (, ",") (number_literal "0x2c") () ")"))) (; ";")) (} "}"))) (if_statement "if (param_10 == 0) {\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" (if "if") (parenthesized_expression "(param_10 == 0)" (( "(") (binary_expression "param_10 == 0" (identifier "param_10") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n                    \n    crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);\n  }" ({ "{") (expression_statement "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);" (call_expression "crypt_argchk("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" (identifier "crypt_argchk") (argument_list "("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d)" (( "(") (string_literal ""tag != NULL"" (" """) (string_content "tag != NULL") (" """)) (, ",") (string_literal ""src/encauth/chachapoly/chacha20poly1305_memory.c"" (" """) (string_content "src/encauth/chachapoly/chacha20poly1305_memory.c") (" """)) (, ",") (number_literal "0x2d") () ")"))) (; ";")) (} "}"))) (expression_statement "uVar2 = chacha20poly1305_init(local_148,param_1,param_2);" (assignment_expression "uVar2 = chacha20poly1305_init(local_148,param_1,param_2)" (identifier "uVar2") (= "=") (call_expression "chacha20poly1305_init(local_148,param_1,param_2)" (identifier "chacha20poly1305_init") (argument_list "(local_148,param_1,param_2)" (( "(") (identifier "local_148") (, ",") (identifier "param_1") (, ",") (identifier "param_2") () ")")))) (; ";")) (if_statement "if ((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }" (if "if") (parenthesized_expression "((((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))))))" (( "(") (binary_expression "(((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&\n     ((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))" (parenthesized_expression "(((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0))" (( "(") (binary_expression "((int)uVar2 == 0) &&\n      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)" (parenthesized_expression "((int)uVar2 == 0)" (( "(") (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar2")) (== "==") (number_literal "0")) () ")")) (&& "&&") (parenthesized_expression "(uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)" (( "(") (comma_expression "uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0" (assignment_expression "uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4)" (identifier "uVar2") (= "=") (call_expression "chacha20poly1305_setiv(local_148,param_3,param_4)" (identifier "chacha20poly1305_setiv") (argument_list "(local_148,param_3,param_4)" (( "(") (identifier "local_148") (, ",") (identifier "param_3") (, ",") (identifier "param_4") () ")")))) (, ",") (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar2")) (== "==") (number_literal "0"))) () ")"))) () ")")) (&& "&&") (parenthesized_expression "((param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))" (( "(") (parenthesized_expression "(param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))))" (( "(") (binary_expression "param_5 == 0 ||\n      ((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))" (binary_expression "param_5 == 0" (identifier "param_5") (== "==") (number_literal "0")) (|| "||") (parenthesized_expression "((param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))" (( "(") (parenthesized_expression "(param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0))" (( "(") (binary_expression "param_6 == 0 ||\n       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)" (binary_expression "param_6 == 0" (identifier "param_6") (== "==") (number_literal "0")) (|| "||") (parenthesized_expression "(uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)" (( "(") (comma_expression "uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0" (assignment_expression "uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6)" (identifier "uVar2") (= "=") (call_expression "chacha20poly1305_add_aad(local_148,param_5,param_6)" (identifier "chacha20poly1305_add_aad") (argument_list "(local_148,param_5,param_6)" (( "(") (identifier "local_148") (, ",") (identifier "param_5") (, ",") (identifier "param_6") () ")")))) (, ",") (binary_expression "(int)uVar2 == 0" (cast_expression "(int)uVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar2")) (== "==") (number_literal "0"))) () ")"))) () ")")) () ")"))) () ")")) () ")"))) () ")")) (compound_statement "{\n    if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }\n  }" ({ "{") (if_statement "if (param_12 == 0) {\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }\n    else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" (if "if") (parenthesized_expression "(param_12 == 0)" (( "(") (binary_expression "param_12 == 0" (identifier "param_12") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" ({ "{") (expression_statement "uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);" (assignment_expression "uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9)" (identifier "uVar2") (= "=") (call_expression "chacha20poly1305_encrypt(local_148,param_7,param_8,param_9)" (identifier "chacha20poly1305_encrypt") (argument_list "(local_148,param_7,param_8,param_9)" (( "(") (identifier "local_148") (, ",") (identifier "param_7") (, ",") (identifier "param_8") (, ",") (identifier "param_9") () ")")))) (; ";")) (expression_statement "iVar1 = (int)uVar2;" (assignment_expression "iVar1 = (int)uVar2" (identifier "iVar1") (= "=") (cast_expression "(int)uVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar2"))) (; ";")) (} "}")) (else_clause "else {\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" (else "else") (compound_statement "{\n      uVar2 = 0x10;\n      if (param_12 != 1) goto LAB_001366ad;\n      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);\n      iVar1 = (int)uVar2;\n    }" ({ "{") (expression_statement "uVar2 = 0x10;" (assignment_expression "uVar2 = 0x10" (identifier "uVar2") (= "=") (number_literal "0x10")) (; ";")) (if_statement "if (param_12 != 1) goto LAB_001366ad;" (if "if") (parenthesized_expression "(param_12 != 1)" (( "(") (binary_expression "param_12 != 1" (identifier "param_12") (!= "!=") (number_literal "1")) () ")")) (goto_statement "goto LAB_001366ad;" (goto "goto") (statement_identifier "LAB_001366ad") (; ";"))) (expression_statement "uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);" (assignment_expression "uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9)" (identifier "uVar2") (= "=") (call_expression "chacha20poly1305_decrypt(local_148,param_7,param_8,param_9)" (identifier "chacha20poly1305_decrypt") (argument_list "(local_148,param_7,param_8,param_9)" (( "(") (identifier "local_148") (, ",") (identifier "param_7") (, ",") (identifier "param_8") (, ",") (identifier "param_9") () ")")))) (; ";")) (expression_statement "iVar1 = (int)uVar2;" (assignment_expression "iVar1 = (int)uVar2" (identifier "iVar1") (= "=") (cast_expression "(int)uVar2" (( "(") (type_descriptor "int" (primitive_type "int")) () ")") (identifier "uVar2"))) (; ";")) (} "}")))) (if_statement "if (iVar1 == 0) {\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }" (if "if") (parenthesized_expression "(iVar1 == 0)" (( "(") (binary_expression "iVar1 == 0" (identifier "iVar1") (== "==") (number_literal "0")) () ")")) (compound_statement "{\n      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);\n    }" ({ "{") (expression_statement "uVar2 = chacha20poly1305_done(local_148,param_10,param_11);" (assignment_expression "uVar2 = chacha20poly1305_done(local_148,param_10,param_11)" (identifier "uVar2") (= "=") (call_expression "chacha20poly1305_done(local_148,param_10,param_11)" (identifier "chacha20poly1305_done") (argument_list "(local_148,param_10,param_11)" (( "(") (identifier "local_148") (, ",") (identifier "param_10") (, ",") (identifier "param_11") () ")")))) (; ";")) (} "}"))) (} "}"))) (labeled_statement "LAB_001366ad:\n  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }" (statement_identifier "LAB_001366ad") (: ":") (if_statement "if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {\n    return uVar2;\n  }" (if "if") (parenthesized_expression "(local_40 == *(long *)(in_FS_OFFSET + 0x28))" (( "(") (binary_expression "local_40 == *(long *)(in_FS_OFFSET + 0x28)" (identifier "local_40") (== "==") (pointer_expression "*(long *)(in_FS_OFFSET + 0x28)" (* "*") (cast_expression "(long *)(in_FS_OFFSET + 0x28)" (( "(") (type_descriptor "long *" (sized_type_specifier "long" (long "long")) (abstract_pointer_declarator "*" (* "*"))) () ")") (parenthesized_expression "(in_FS_OFFSET + 0x28)" (( "(") (binary_expression "in_FS_OFFSET + 0x28" (identifier "in_FS_OFFSET") (+ "+") (number_literal "0x28")) () ")"))))) () ")")) (compound_statement "{\n    return uVar2;\n  }" ({ "{") (return_statement "return uVar2;" (return "return") (identifier "uVar2") (; ";")) (} "}")))) (expression_statement "__stack_chk_fail();" (call_expression "__stack_chk_fail()" (identifier "__stack_chk_fail") (argument_list "()" (( "(") () ")"))) (; ";")) (} "}")))

int function_1
              (type_1 *var_2,type_2 keylen,type_1 *var_4,type_2 ivlen,type_1 *var_11,type_2 var_12,type_1 *var_5,
              type_2 inlen,type_1 *var_6,type_1 *var_7,type_2 *taglen,int var_14)

{
  long var_18;
  int var_9;
  long var_1;
  type_3 st;
  
  var_18 = *(long *)(var_1 + 0x28);
  if (var_2 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("key != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x29);
  }
  if (var_4 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("iv != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2a);
  }
  if (var_5 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("in != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2b);
  }
  if (var_6 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("out != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2c);
  }
  if (var_7 == (type_1 *)0x0) {
                    /* WARNING: Subroutine does not return */
    var_3("tag != NULL","src/encauth/chachapoly/chacha20poly1305_memory.c",0x2d);
  }
  var_9 = var_8(&st,var_2,keylen);
  if (((var_9 == 0) && (var_9 = var_10(&st,var_4,ivlen), var_9 == 0)) &&
     ((var_11 == (type_1 *)0x0 ||
      ((var_12 == 0 || (var_9 = var_13(&st,var_11,var_12), var_9 == 0)))))) {
    if (var_14 == 0) {
      var_9 = var_15(&st,var_5,inlen,var_6);
    }
    else {
      var_9 = 0x10;
      if (var_14 != 1) goto LAB_001366ad;
      var_9 = var_16(&st,var_5,inlen,var_6);
    }
    if (var_9 == 0) {
      var_9 = var_17(&st,var_7,taglen);
    }
  }
LAB_001366ad:
  if (var_18 == *(long *)(var_1 + 0x28)) {
    return var_9;
  }
                    /* WARNING: Subroutine does not return */
  var_19();
}


(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)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (sized_type_specifier) declarator: (identifier)) (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: (sized_type_specifier) declarator: (identifier)) (parameter_declaration type: (type_identifier) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (identifier)) (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))))))) (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: (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: (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: (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: (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)))))) (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: (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 (identifier) (identifier) (identifier)))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)))))) right: (parenthesized_expression (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (parenthesized_expression (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (number_literal)) right: (parenthesized_expression (comma_expression left: (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier)))) right: (binary_expression left: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier)) right: (number_literal)))))))))))) consequence: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))) alternative: (else_clause (compound_statement (expression_statement (assignment_expression left: (identifier) right: (number_literal))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (goto_statement label: (statement_identifier))) (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (identifier) (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (cast_expression type: (type_descriptor type: (primitive_type)) value: (identifier))))))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal))) consequence: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier) (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 (return_statement (identifier))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list))))))

undefined8
MASKED
          (long param_1,undefined8 param_2,long param_3,undefined8 param_4,long param_5,long param_6
          ,long param_7,undefined8 param_8,long param_9,long param_10,undefined8 param_11,
          int param_12)

{
  int iVar1;
  undefined8 uVar2;
  long in_FS_OFFSET;
  undefined1 local_148 [264];
  long local_40;
  
  local_40 = *(long *)(in_FS_OFFSET + 0x28);
  if (param_1 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("key != NULL","src/encauth/chachapoly/MASKED.c",0x29);
  }
  if (param_3 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("iv != NULL","src/encauth/chachapoly/MASKED.c",0x2a);
  }
  if (param_7 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("in != NULL","src/encauth/chachapoly/MASKED.c",0x2b);
  }
  if (param_9 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("out != NULL","src/encauth/chachapoly/MASKED.c",0x2c);
  }
  if (param_10 == 0) {
                    /* WARNING: Subroutine does not return */
    crypt_argchk("tag != NULL","src/encauth/chachapoly/MASKED.c",0x2d);
  }
  uVar2 = chacha20poly1305_init(local_148,param_1,param_2);
  if ((((int)uVar2 == 0) &&
      (uVar2 = chacha20poly1305_setiv(local_148,param_3,param_4), (int)uVar2 == 0)) &&
     ((param_5 == 0 ||
      ((param_6 == 0 ||
       (uVar2 = chacha20poly1305_add_aad(local_148,param_5,param_6), (int)uVar2 == 0)))))) {
    if (param_12 == 0) {
      uVar2 = chacha20poly1305_encrypt(local_148,param_7,param_8,param_9);
      iVar1 = (int)uVar2;
    }
    else {
      uVar2 = 0x10;
      if (param_12 != 1) goto LAB_001366ad;
      uVar2 = chacha20poly1305_decrypt(local_148,param_7,param_8,param_9);
      iVar1 = (int)uVar2;
    }
    if (iVar1 == 0) {
      uVar2 = chacha20poly1305_done(local_148,param_10,param_11);
    }
  }
LAB_001366ad:
  if (local_40 == *(long *)(in_FS_OFFSET + 0x28)) {
    return uVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

