// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/icepole128v2/ref/icepole.c
// Function: initState
void initState(ICESTATE S, const unsigned char * k, const unsigned char * nonce)
{
    ICESTATE T;

    /* init state */
    S[0][0] = 0xFF97A42D7F8E6FD4ULL;
    S[0][1] = 0x90FEE5A0A44647C4ULL;
    S[0][2] = 0x8C5BDA0CD6192E76ULL;
    S[0][3] = 0xAD30A6F71B19059CULL;
    S[0][4] = 0x30935AB7D08FFC64ULL;

    S[1][0] = 0xEB5AA93F2317D635ULL;
    S[1][1] = 0xA9A6E6260D712103ULL;
    S[1][2] = 0x81A57C16DBCF555FULL;
    S[1][3] = 0x43B831CD0347C826ULL;
    S[1][4] = 0x01F22F1A11A5569FULL;

    S[2][0] = 0x05E5635A21D9AE61ULL;
    S[2][1] = 0x64BEFEF28CC970F2ULL;
    S[2][2] = 0x613670957BC46611ULL;
    S[2][3] = 0xB87C5A554FD00ECBULL;
    S[2][4] = 0x8C3EE88A1CCF32C8ULL;

    S[3][0] = 0x940C7922AE3A2614ULL;
    S[3][1] = 0x1841F924A2C509E4ULL;
    S[3][2] = 0x16F53526E70465C2ULL;
    S[3][3] = 0x75F644E97F30A13BULL;
    S[3][4] = 0xEAF1FF7B5CECA249ULL;

    /* xor key, nonce */
    S[0][0] = S[0][0] ^ load64(k, 8);
    S[1][0] = S[1][0] ^ load64(k+8, 8);
    S[2][0] = S[2][0] ^ load64(nonce, 8);
    S[3][0] = S[3][0] ^ load64(nonce+8, 8);

    /* do P_12 */
    oneround(T,S,0);
    oneround(S,T,1);
    oneround(T,S,2);
    oneround(S,T,3);
    oneround(T,S,4);
    oneround(S,T,5);
    oneround(T,S,6);
    oneround(S,T,7);
    oneround(T,S,8);
    oneround(S,T,9);
    oneround(T,S,10);
    oneround(S,T,11);
}

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xd0(%rsp)
movq %rsi, 0xc8(%rsp)
movq %rdx, 0xc0(%rsp)
movq 0xd0(%rsp), %rax
movabsq $-0x685bd28071902c, %rcx # imm = 0xFF97A42D7F8E6FD4
movq %rcx, (%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x6f011a5f5bb9b83c, %rcx # imm = 0x90FEE5A0A44647C4
movq %rcx, 0x8(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x73a425f329e6d18a, %rcx # imm = 0x8C5BDA0CD6192E76
movq %rcx, 0x10(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x52cf5908e4e6fa64, %rcx # imm = 0xAD30A6F71B19059C
movq %rcx, 0x18(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x30935ab7d08ffc64, %rcx # imm = 0x30935AB7D08FFC64
movq %rcx, 0x20(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x14a556c0dce829cb, %rcx # imm = 0xEB5AA93F2317D635
movq %rcx, 0x28(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x565919d9f28edefd, %rcx # imm = 0xA9A6E6260D712103
movq %rcx, 0x30(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x7e5a83e92430aaa1, %rcx # imm = 0x81A57C16DBCF555F
movq %rcx, 0x38(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x43b831cd0347c826, %rcx # imm = 0x43B831CD0347C826
movq %rcx, 0x40(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x1f22f1a11a5569f, %rcx # imm = 0x1F22F1A11A5569F
movq %rcx, 0x48(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x5e5635a21d9ae61, %rcx # imm = 0x5E5635A21D9AE61
movq %rcx, 0x50(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x64befef28cc970f2, %rcx # imm = 0x64BEFEF28CC970F2
movq %rcx, 0x58(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x613670957bc46611, %rcx # imm = 0x613670957BC46611
movq %rcx, 0x60(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x4783a5aab02ff135, %rcx # imm = 0xB87C5A554FD00ECB
movq %rcx, 0x68(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x73c11775e330cd38, %rcx # imm = 0x8C3EE88A1CCF32C8
movq %rcx, 0x70(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x6bf386dd51c5d9ec, %rcx # imm = 0x940C7922AE3A2614
movq %rcx, 0x78(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x1841f924a2c509e4, %rcx # imm = 0x1841F924A2C509E4
movq %rcx, 0x80(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x16f53526e70465c2, %rcx # imm = 0x16F53526E70465C2
movq %rcx, 0x88(%rax)
movq 0xd0(%rsp), %rax
movabsq $0x75f644e97f30a13b, %rcx # imm = 0x75F644E97F30A13B
movq %rcx, 0x90(%rax)
movq 0xd0(%rsp), %rax
movabsq $-0x150e0084a3135db7, %rcx # imm = 0xEAF1FF7B5CECA249
movq %rcx, 0x98(%rax)
movq 0xd0(%rsp), %rax
movq (%rax), %rax
movq %rax, (%rsp)
movq 0xc8(%rsp), %rdi
movl $0x8, %esi
callq 0x1090
movq (%rsp), %rcx
xorq %rax, %rcx
movq 0xd0(%rsp), %rax
movq %rcx, (%rax)
movq 0xd0(%rsp), %rax
movq 0x28(%rax), %rax
movq %rax, 0x8(%rsp)
movq 0xc8(%rsp), %rdi
addq $0x8, %rdi
movl $0x8, %esi
callq 0x1090
movq 0x8(%rsp), %rcx
xorq %rax, %rcx
movq 0xd0(%rsp), %rax
movq %rcx, 0x28(%rax)
movq 0xd0(%rsp), %rax
movq 0x50(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0xc0(%rsp), %rdi
movl $0x8, %esi
callq 0x1090
movq 0x10(%rsp), %rcx
xorq %rax, %rcx
movq 0xd0(%rsp), %rax
movq %rcx, 0x50(%rax)
movq 0xd0(%rsp), %rax
movq 0x78(%rax), %rax
movq %rax, 0x18(%rsp)
movq 0xc0(%rsp), %rdi
addq $0x8, %rdi
movl $0x8, %esi
callq 0x1090
movq 0x18(%rsp), %rcx
xorq %rax, %rcx
movq 0xd0(%rsp), %rax
movq %rcx, 0x78(%rax)
leaq 0x20(%rsp), %rdi
movq 0xd0(%rsp), %rsi
xorl %edx, %edx
callq 0x1100
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x1, %edx
callq 0x1100
leaq 0x20(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl $0x2, %edx
callq 0x1100
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x3, %edx
callq 0x1100
leaq 0x20(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl $0x4, %edx
callq 0x1100
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x5, %edx
callq 0x1100
leaq 0x20(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl $0x6, %edx
callq 0x1100
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x7, %edx
callq 0x1100
leaq 0x20(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl $0x8, %edx
callq 0x1100
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0x9, %edx
callq 0x1100
leaq 0x20(%rsp), %rdi
movq 0xd0(%rsp), %rsi
movl $0xa, %edx
callq 0x1100
movq 0xd0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
movl $0xb, %edx
callq 0x1100
addq $0xd8, %rsp
retq
nopl (%rax,%rax)