// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/minalpherv11/ref/minalpher.c
// Function: TweakGen
static void TweakGen(
  unsigned char       *_L_,   /* I/O  Tweak       */
  unsigned long long  _i,     /* I    an integer  */
  unsigned long long  _j      /* I    an integer  */
  )
{
  int d;
  unsigned char t,dat[BLOCK_SIZE];

  /*-- y^{i}(y+1)^{j}L --*/
  while( _j>0 ){

    Copy( dat, _L_, BLOCK_SIZE );
    t = _L_[0];

    for( d=0; d<(BLOCK_SIZE-1); d++ ) _L_[d] = _L_[d+1];
    _L_[31]  = t<<1;
    _L_[28] ^= t;
    _L_[29] ^= t; 

    if( (t&0x80) == 0x80 ) _L_[31] ^= R;
    Xor( _L_, dat, BLOCK_SIZE );

    _j--;
  }

  while( _i>0 ){

    Copy( dat, _L_, BLOCK_SIZE );
    t = _L_[0];

    for( d=0; d<(BLOCK_SIZE-1); d++ ) _L_[d] = _L_[d+1];
    _L_[31]  = t<<1;
    _L_[28] ^= t;
    _L_[29] ^= t; 

    if( (t&0x80) == 0x80 ) _L_[31] ^= R;

    _i--;
  }
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
cmpq $0x0, -0x18(%rsp)
jbe 0x2d41
jmp 0x2c1d
movl $0x0, -0x4c(%rsp)
cmpl $0x20, -0x4c(%rsp)
jge 0x2c4f
movq -0x8(%rsp), %rax
movslq -0x4c(%rsp), %rcx
movb (%rax,%rcx), %cl
movslq -0x4c(%rsp), %rax
movb %cl, -0x48(%rsp,%rax)
movl -0x4c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rsp)
jmp 0x2c25
jmp 0x2c51
movq -0x8(%rsp), %rax
movb (%rax), %al
movb %al, -0x1d(%rsp)
movl $0x0, -0x1c(%rsp)
cmpl $0x1f, -0x1c(%rsp)
jge 0x2c97
movq -0x8(%rsp), %rax
movl -0x1c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x2c64
movzbl -0x1d(%rsp), %eax
shll %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, 0x1f(%rax)
movzbl -0x1d(%rsp), %edx
movq -0x8(%rsp), %rax
movzbl 0x1c(%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x1c(%rax)
movzbl -0x1d(%rsp), %edx
movq -0x8(%rsp), %rax
movzbl 0x1d(%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x1d(%rax)
movzbl -0x1d(%rsp), %eax
andl $0x80, %eax
cmpl $0x80, %eax
jne 0x2cf1
movq -0x8(%rsp), %rax
movzbl 0x1f(%rax), %ecx
xorl $0xa3, %ecx
movb %cl, 0x1f(%rax)
jmp 0x2cf3
movl $0x0, -0x50(%rsp)
cmpl $0x20, -0x50(%rsp)
jge 0x2d2c
movslq -0x50(%rsp), %rax
movzbl -0x48(%rsp,%rax), %esi
movq -0x8(%rsp), %rax
movslq -0x50(%rsp), %rcx
movzbl (%rax,%rcx), %edx
xorl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rsp)
jmp 0x2cfb
jmp 0x2d2e
movq -0x18(%rsp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rsp)
jmp 0x2c0f
jmp 0x2d43
cmpq $0x0, -0x10(%rsp)
jbe 0x2e38
jmp 0x2d51
movl $0x0, -0x54(%rsp)
cmpl $0x20, -0x54(%rsp)
jge 0x2d83
movq -0x8(%rsp), %rax
movslq -0x54(%rsp), %rcx
movb (%rax,%rcx), %cl
movslq -0x54(%rsp), %rax
movb %cl, -0x48(%rsp,%rax)
movl -0x54(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rsp)
jmp 0x2d59
jmp 0x2d85
movq -0x8(%rsp), %rax
movb (%rax), %al
movb %al, -0x1d(%rsp)
movl $0x0, -0x1c(%rsp)
cmpl $0x1f, -0x1c(%rsp)
jge 0x2dcb
movq -0x8(%rsp), %rax
movl -0x1c(%rsp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movb (%rax,%rcx), %dl
movq -0x8(%rsp), %rax
movslq -0x1c(%rsp), %rcx
movb %dl, (%rax,%rcx)
movl -0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rsp)
jmp 0x2d98
movzbl -0x1d(%rsp), %eax
shll %eax
movb %al, %cl
movq -0x8(%rsp), %rax
movb %cl, 0x1f(%rax)
movzbl -0x1d(%rsp), %edx
movq -0x8(%rsp), %rax
movzbl 0x1c(%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x1c(%rax)
movzbl -0x1d(%rsp), %edx
movq -0x8(%rsp), %rax
movzbl 0x1d(%rax), %ecx
xorl %edx, %ecx
movb %cl, 0x1d(%rax)
movzbl -0x1d(%rsp), %eax
andl $0x80, %eax
cmpl $0x80, %eax
jne 0x2e25
movq -0x8(%rsp), %rax
movzbl 0x1f(%rax), %ecx
xorl $0xa3, %ecx
movb %cl, 0x1f(%rax)
movq -0x10(%rsp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rsp)
jmp 0x2d43
retq
nopl (%rax)