// File: /workspace/github_c_makefile_star2_O0/snow1eo[P]IPsec_IKEv2/hmac/sha1.c
// Function: sha1_process_bytes
void
sha1_process_bytes (const void *buffer, size_t len, struct sha1_ctx *ctx)
{
  /* When we already have some bits in our internal buffer concatenate
     both inputs first.  */
  if (ctx->buflen != 0)
    {
      size_t left_over = ctx->buflen;
      size_t add = 128 - left_over > len ? len : 128 - left_over;

      memcpy (&((char *) ctx->buffer)[left_over], buffer, add);
      ctx->buflen += add;

      if (ctx->buflen > 64)
	{
	  sha1_process_block (ctx->buffer, ctx->buflen & ~63, ctx);

	  ctx->buflen &= 63;
	  /* The regions in the following copy operation cannot overlap.  */
	  memcpy (ctx->buffer,
		  &((char *) ctx->buffer)[(left_over + add) & ~63],
		  ctx->buflen);
	}

      buffer = (const char *) buffer + add;
      len -= add;
    }

  /* Process available complete blocks.  */
  if (len >= 64)
    {
#if !_STRING_ARCH_unaligned
# define alignof(type) offsetof (struct { char c; type x; }, x)
# define UNALIGNED_P(p) (((size_t) p) % alignof (uint32_t) != 0)
      if (UNALIGNED_P (buffer))
	while (len > 64)
	  {
	    sha1_process_block (memcpy (ctx->buffer, buffer, 64), 64, ctx);
	    buffer = (const char *) buffer + 64;
	    len -= 64;
	  }
      else
#endif
	{
	  sha1_process_block (buffer, len & ~63, ctx);
	  buffer = (const char *) buffer + (len & ~63);
	  len &= 63;
	}
    }

  /* Move remaining bytes in internal buffer.  */
  if (len > 0)
    {
      size_t left_over = ctx->buflen;

      memcpy (&((char *) ctx->buffer)[left_over], buffer, len);
      left_over += len;
      if (left_over >= 64)
	{
	  sha1_process_block (ctx->buffer, 64, ctx);
	  left_over -= 64;
	  memcpy (ctx->buffer, &ctx->buffer[16], left_over);
	}
      ctx->buflen = left_over;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x1c(%rax)
je 0xb3e3
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rax, -0x20(%rbp)
movl $0x80, %eax
subq -0x20(%rbp), %rax
cmpq -0x10(%rbp), %rax
jbe 0xb326
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xb333
movl $0x80, %eax
subq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
addq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x32c0
movq -0x28(%rbp), %rdx
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %ecx
addq %rdx, %rcx
movl %ecx, 0x1c(%rax)
movq -0x18(%rbp), %rax
cmpl $0x40, 0x1c(%rax)
jbe 0xb3c8
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
andl $-0x40, %eax
movl %eax, %eax
movl %eax, %esi
movq -0x18(%rbp), %rdx
callq 0x35a0
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %ecx
andl $0x3f, %ecx
movl %ecx, 0x1c(%rax)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
andq $-0x40, %rax
addq %rax, %rsi
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movl %eax, %edx
callq 0x32c0
movq -0x8(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x10(%rbp)
cmpq $0x40, -0x10(%rbp)
jb 0xb483
movq -0x8(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
je 0xb44d
jmp 0xb3fe
cmpq $0x40, -0x10(%rbp)
jbe 0xb44b
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq %rdi, -0x40(%rbp)
movq -0x8(%rbp), %rsi
movl $0x40, %edx
callq 0x32c0
movq -0x40(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl $0x40, %esi
callq 0x35a0
movq -0x8(%rbp), %rax
addq $0x40, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
subq $0x40, %rax
movq %rax, -0x10(%rbp)
jmp 0xb3fe
jmp 0xb481
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
andq $-0x40, %rsi
movq -0x18(%rbp), %rdx
callq 0x35a0
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
andq $-0x40, %rcx
addq %rcx, %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
andq $0x3f, %rax
movq %rax, -0x10(%rbp)
jmp 0xb483
cmpq $0x0, -0x10(%rbp)
jbe 0xb511
movq -0x18(%rbp), %rax
movl 0x1c(%rax), %eax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
addq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x32c0
movq -0x10(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x40, -0x30(%rbp)
jb 0xb504
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rdx
movl $0x40, %esi
callq 0x35a0
movq -0x30(%rbp), %rax
subq $0x40, %rax
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
addq $0x20, %rdi
movq -0x18(%rbp), %rsi
addq $0x20, %rsi
addq $0x40, %rsi
movq -0x30(%rbp), %rdx
callq 0x32c0
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x1c(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)