#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct crypt_hmac {
  int dummy;
};
typedef int /*<<< orphan*/ U;
typedef int /*<<< orphan*/ T;
typedef int /*<<< orphan*/ P_hash;

/* Variables and functions */
int EINVAL;
int ENOMEM;
char *alloca(size_t);
int /*<<< orphan*/ crypt_hmac_destroy(struct crypt_hmac *);
scalar_t__ crypt_hmac_final(struct crypt_hmac *, char *, unsigned int);
scalar_t__ crypt_hmac_init(struct crypt_hmac **, char const *, char const *,
                           size_t);
unsigned int crypt_hmac_size(char const *);
scalar_t__ crypt_hmac_write(struct crypt_hmac *, char *, unsigned int);
scalar_t__ hash_buf(char const *, size_t, char *, unsigned int, char const *);
int /*<<< orphan*/ memcpy(char *, char const *, unsigned int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, size_t);
int pkcs5_pbkdf2(const char *hash, const char *P, size_t Plen, const char *S,
                 size_t Slen, unsigned int c, unsigned int dkLen, char *DK,
                 unsigned int hash_block_size) {
  struct crypt_hmac *hmac;
  char U[80];
  char T[80];
  char P_hash[80];
  int i, k, rc = -EINVAL;
  unsigned int u, hLen, l, r;
  size_t tmplen = Slen + 4;
  char *tmp;
  tmp = alloca(tmplen);
  if (tmp == NULL)
    return -ENOMEM;
  hLen = crypt_hmac_size(hash);
  if (hLen == 0 || hLen > 80)
    return -EINVAL;
  if (c == 0)
    return -EINVAL;
  if (dkLen == 0)
    return -EINVAL;
  if (dkLen > 4294967295U)
    return -EINVAL;
  l = dkLen / hLen;
  if (dkLen % hLen)
    l++;
  r = dkLen - (l - 1) * hLen;
  if (hash_block_size > 0 && Plen > hash_block_size) {
    if (hash_buf(P, Plen, P_hash, hLen, hash))
      return -EINVAL;
    if (crypt_hmac_init(&hmac, hash, P_hash, hLen))
      return -EINVAL;
    memset(P_hash, 0, sizeof(P_hash));
  } else {
    if (crypt_hmac_init(&hmac, hash, P, Plen))
      return -EINVAL;
  }
  for (i = 1; (unsigned int)i <= l; i++) {
    memset(T, 0, hLen);
    for (u = 1; u <= c; u++) {
      if (u == 1) {
        memcpy(tmp, S, Slen);
        tmp[Slen + 0] = (i & 0xff000000) >> 24;
        tmp[Slen + 1] = (i & 0x00ff0000) >> 16;
        tmp[Slen + 2] = (i & 0x0000ff00) >> 8;
        tmp[Slen + 3] = (i & 0x000000ff) >> 0;
        if (crypt_hmac_write(hmac, tmp, tmplen))
          goto out;
      } else {
        if (crypt_hmac_write(hmac, U, hLen))
          goto out;
      }
      if (crypt_hmac_final(hmac, U, hLen))
        goto out;
      for (k = 0; (unsigned int)k < hLen; k++)
        T[k] ^= U[k];
    }
    memcpy(DK + (i - 1) * hLen, T, (unsigned int)i == l ? r : hLen);
  }
  rc = 0;
out:
  crypt_hmac_destroy(hmac);
  memset(U, 0, sizeof(U));
  memset(T, 0, sizeof(T));
  memset(tmp, 0, tmplen);
  return rc;
}


x86 assembly (clang, -O0):
<pkcs5_pbkdf2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%eax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
xor    %eax,%eax
mov    0x2e12(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x13c(%rbp)
mov    -0x30(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x158(%rbp)
mov    -0x158(%rbp),%rdi
call   1080 <alloca@plt>
mov    %rax,-0x160(%rbp)
cmpq   $0x0,-0x160(%rbp)
jne    1211 <pkcs5_pbkdf2+0x81>
xor    %eax,%eax
mov    0x2dd9(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
mov    -0x10(%rbp),%rdi
call   1030 <crypt_hmac_size@plt>
mov    %eax,-0x144(%rbp)
cmpl   $0x0,-0x144(%rbp)
je     123a <pkcs5_pbkdf2+0xaa>
cmpl   $0x50,-0x144(%rbp)
jbe    124d <pkcs5_pbkdf2+0xbd>
xor    %eax,%eax
mov    0x2d95(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
cmpl   $0x0,-0x34(%rbp)
jne    126a <pkcs5_pbkdf2+0xda>
xor    %eax,%eax
mov    0x2d78(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
cmpl   $0x0,0x10(%rbp)
jne    1287 <pkcs5_pbkdf2+0xf7>
xor    %eax,%eax
mov    0x2d5b(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
cmpl   $0xffffffff,0x10(%rbp)
jbe    12a4 <pkcs5_pbkdf2+0x114>
xor    %eax,%eax
mov    0x2d3e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
mov    0x10(%rbp),%eax
xor    %edx,%edx
divl   -0x144(%rbp)
mov    %eax,-0x148(%rbp)
mov    0x10(%rbp),%eax
xor    %edx,%edx
divl   -0x144(%rbp)
cmp    $0x0,%edx
je     12d8 <pkcs5_pbkdf2+0x148>
mov    -0x148(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x148(%rbp)
mov    0x10(%rbp),%eax
mov    -0x148(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x144(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14c(%rbp)
cmpl   $0x0,0x20(%rbp)
jbe    1399 <pkcs5_pbkdf2+0x209>
mov    -0x20(%rbp),%rax
mov    0x20(%rbp),%ecx
cmp    %rcx,%rax
jbe    1399 <pkcs5_pbkdf2+0x209>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
lea    -0x130(%rbp),%rdx
mov    -0x144(%rbp),%ecx
mov    -0x10(%rbp),%r8
call   1040 <hash_buf@plt>
cmp    $0x0,%rax
je     1348 <pkcs5_pbkdf2+0x1b8>
xor    %eax,%eax
mov    0x2c9a(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
mov    -0x10(%rbp),%rsi
lea    -0x130(%rbp),%rdx
mov    -0x144(%rbp),%eax
mov    %eax,%ecx
lea    -0x40(%rbp),%rdi
call   1050 <crypt_hmac_init@plt>
cmp    $0x0,%rax
je     1381 <pkcs5_pbkdf2+0x1f1>
xor    %eax,%eax
mov    0x2c61(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
lea    -0x130(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1060 <memset@plt>
jmp    13d0 <pkcs5_pbkdf2+0x240>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    -0x40(%rbp),%rdi
call   1050 <crypt_hmac_init@plt>
cmp    $0x0,%rax
je     13cb <pkcs5_pbkdf2+0x23b>
xor    %eax,%eax
mov    0x2c17(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1686 <pkcs5_pbkdf2+0x4f6>
jmp    13d0 <pkcs5_pbkdf2+0x240>
movl   $0x1,-0x134(%rbp)
mov    -0x134(%rbp),%eax
cmp    -0x148(%rbp),%eax
ja     162f <pkcs5_pbkdf2+0x49f>
lea    -0xe0(%rbp),%rdi
mov    -0x144(%rbp),%eax
mov    %eax,%edx
xor    %esi,%esi
call   1060 <memset@plt>
movl   $0x1,-0x140(%rbp)
mov    -0x140(%rbp),%eax
cmp    -0x34(%rbp),%eax
ja     15a5 <pkcs5_pbkdf2+0x415>
cmpl   $0x1,-0x140(%rbp)
jne    14e6 <pkcs5_pbkdf2+0x356>
mov    -0x160(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rax
mov    %eax,%edx
call   1090 <memcpy@plt>
mov    -0x134(%rbp),%eax
and    $0xff000000,%eax
shr    $0x18,%eax
mov    %al,%dl
mov    -0x160(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x134(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
mov    %al,%dl
mov    -0x160(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,0x1(%rax,%rcx,1)
mov    -0x134(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
mov    %al,%dl
mov    -0x160(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,0x2(%rax,%rcx,1)
mov    -0x134(%rbp),%eax
and    $0xff,%eax
sar    $0x0,%eax
mov    %al,%dl
mov    -0x160(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    %dl,0x3(%rax,%rcx,1)
mov    -0x40(%rbp),%rdi
mov    -0x160(%rbp),%rsi
mov    -0x158(%rbp),%rax
mov    %eax,%edx
call   10a0 <crypt_hmac_write@plt>
cmp    $0x0,%rax
je     14e1 <pkcs5_pbkdf2+0x351>
jmp    1639 <pkcs5_pbkdf2+0x4a9>
jmp    1510 <pkcs5_pbkdf2+0x380>
mov    -0x40(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x144(%rbp),%edx
call   10a0 <crypt_hmac_write@plt>
cmp    $0x0,%rax
je     150b <pkcs5_pbkdf2+0x37b>
jmp    1639 <pkcs5_pbkdf2+0x4a9>
jmp    1510 <pkcs5_pbkdf2+0x380>
mov    -0x40(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    -0x144(%rbp),%edx
call   10b0 <crypt_hmac_final@plt>
cmp    $0x0,%rax
je     1535 <pkcs5_pbkdf2+0x3a5>
jmp    1639 <pkcs5_pbkdf2+0x4a9>
movl   $0x0,-0x138(%rbp)
mov    -0x138(%rbp),%eax
cmp    -0x144(%rbp),%eax
jae    158c <pkcs5_pbkdf2+0x3fc>
movslq -0x138(%rbp),%rax
movsbl -0x90(%rbp,%rax,1),%edx
ff
movslq -0x138(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%ecx
ff
xor    %edx,%ecx
mov    %cl,-0xe0(%rbp,%rax,1)
mov    -0x138(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x138(%rbp)
jmp    153f <pkcs5_pbkdf2+0x3af>
jmp    1591 <pkcs5_pbkdf2+0x401>
mov    -0x140(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x140(%rbp)
jmp    140c <pkcs5_pbkdf2+0x27c>
mov    0x18(%rbp),%rax
mov    -0x134(%rbp),%ecx
sub    $0x1,%ecx
imul   -0x144(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x170(%rbp)
lea    -0xe0(%rbp),%rax
mov    %rax,-0x168(%rbp)
mov    -0x134(%rbp),%eax
cmp    -0x148(%rbp),%eax
jne    15f6 <pkcs5_pbkdf2+0x466>
mov    -0x14c(%rbp),%eax
mov    %eax,-0x174(%rbp)
jmp    1602 <pkcs5_pbkdf2+0x472>
mov    -0x144(%rbp),%eax
mov    %eax,-0x174(%rbp)
mov    -0x168(%rbp),%rsi
mov    -0x170(%rbp),%rdi
mov    -0x174(%rbp),%edx
call   1090 <memcpy@plt>
mov    -0x134(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x134(%rbp)
jmp    13da <pkcs5_pbkdf2+0x24a>
movl   $0x0,-0x13c(%rbp)
mov    -0x40(%rbp),%rdi
call   1070 <crypt_hmac_destroy@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1060 <memset@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1060 <memset@plt>
mov    -0x160(%rbp),%rdi
mov    -0x158(%rbp),%rdx
xor    %esi,%esi
call   1060 <memset@plt>
mov    -0x13c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pkcs5_pbkdf2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x188,%rsp
mov    %r9d,0xc(%rsp)
mov    %rcx,0x80(%rsp)
mov    %rdx,%rbx
mov    %rsi,%r12
mov    %rdi,%rbp
mov    0x2e1a(%rip),%r14
xor    %r15d,%r15d
xor    %r13d,%r13d
sub    (%r14),%r13d
mov    %r8,0x88(%rsp)
lea    0x4(%r8),%rdi
mov    %rdi,0x40(%rsp)
call   1080 <alloca@plt>
test   %rax,%rax
je     1298 <pkcs5_pbkdf2+0x108>
mov    %rax,0x38(%rsp)
mov    %rbp,%rdi
call   1030 <crypt_hmac_size@plt>
lea    -0x51(%rax),%ecx
cmp    $0xffffffaf,%ecx
jbe    12ba <pkcs5_pbkdf2+0x12a>
mov    %rax,0x18(%rsp)
cmpl   $0x0,0xc(%rsp)
je     12ba <pkcs5_pbkdf2+0x12a>
mov    0x1c0(%rsp),%r15d
test   %r15d,%r15d
je     12ba <pkcs5_pbkdf2+0x12a>
mov    %r15d,%eax
xor    %edx,%edx
divl   0x18(%rsp)
mov    0x1d0(%rsp),%ecx
cmp    $0x1,%edx
sbb    $0xffffffff,%eax
mov    %rax,0x20(%rsp)
test   %ecx,%ecx
je     12a4 <pkcs5_pbkdf2+0x114>
mov    %ecx,%eax
cmp    %rbx,%rax
jae    12a4 <pkcs5_pbkdf2+0x114>
lea    0x130(%rsp),%rdx
mov    %r12,%rdi
mov    %rbx,%rsi
mov    0x18(%rsp),%rbx
mov    %ebx,%ecx
mov    %rbp,%r8
call   1040 <hash_buf@plt>
test   %rax,%rax
jne    12ba <pkcs5_pbkdf2+0x12a>
mov    %ebx,%ecx
mov    %rsp,%rdi
lea    0x130(%rsp),%rdx
mov    %rbp,%rsi
call   1050 <crypt_hmac_init@plt>
test   %rax,%rax
jne    12ba <pkcs5_pbkdf2+0x12a>
lea    0x130(%rsp),%rdi
mov    $0x50,%edx
xor    %esi,%esi
call   1060 <memset@plt>
jmp    12d5 <pkcs5_pbkdf2+0x145>
mov    0x2d41(%rip),%rax
sub    (%rax),%r15d
jmp    12c0 <pkcs5_pbkdf2+0x130>
mov    %rsp,%rdi
mov    %rbp,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1050 <crypt_hmac_init@plt>
test   %rax,%rax
je     12d5 <pkcs5_pbkdf2+0x145>
xor    %r15d,%r15d
sub    (%r14),%r15d
mov    %r15d,%eax
add    $0x188,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x20(%rsp),%rcx
test   %ecx,%ecx
je     15ed <pkcs5_pbkdf2+0x45d>
lea    -0x1(%rcx),%eax
mov    0x18(%rsp),%rbx
imul   %ebx,%eax
sub    %eax,%r15d
mov    %r15d,0x28(%rsp)
mov    %ebx,%r12d
mov    %ecx,%eax
mov    %rax,0x48(%rsp)
add    $0x1,%ecx
mov    %rcx,0x20(%rsp)
mov    %r12d,%eax
and    $0xffffffe0,%eax
mov    %rax,0x30(%rsp)
add    $0xffffffffffffffe0,%rax
mov    %rax,0x60(%rsp)
mov    %rax,%rcx
shr    $0x5,%rcx
add    $0x1,%rcx
mov    %rcx,%rax
mov    %rcx,0x58(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x50(%rsp)
mov    %r12d,%ebp
and    $0xfffffff8,%ebp
mov    $0x1,%eax
mov    %rax,0x10(%rsp)
lea    0x90(%rsp),%rdi
mov    %r13d,0x2c(%rsp)
xor    %esi,%esi
mov    %r12,%rdx
call   1060 <memset@plt>
mov    0x10(%rsp),%rax
mov    %rax,%rcx
shr    $0x18,%rcx
mov    %rcx,0x78(%rsp)
mov    %rax,%rcx
shr    $0x10,%rcx
mov    %rcx,0x70(%rsp)
shr    $0x8,%rax
mov    %rax,0x68(%rsp)
mov    $0x1,%r15d
lea    0xe0(%rsp),%r14
jmp    13af <pkcs5_pbkdf2+0x21f>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%r15d
cmp    0xc(%rsp),%r15d
ja     159c <pkcs5_pbkdf2+0x40c>
cmp    $0x1,%r15d
jne    1414 <pkcs5_pbkdf2+0x284>
mov    0x38(%rsp),%r13
mov    %r13,%rdi
mov    0x80(%rsp),%rsi
mov    0x88(%rsp),%rbx
mov    %ebx,%edx
call   1090 <memcpy@plt>
mov    0x78(%rsp),%rax
mov    %al,0x0(%r13,%rbx,1)
mov    0x70(%rsp),%rax
mov    %al,0x1(%r13,%rbx,1)
mov    0x68(%rsp),%rax
mov    %al,0x2(%r13,%rbx,1)
mov    0x10(%rsp),%rax
mov    %al,0x3(%r13,%rbx,1)
mov    0x18(%rsp),%rbx
mov    (%rsp),%rdi
mov    %r13,%rsi
mov    0x2c(%rsp),%r13d
mov    0x40(%rsp),%rdx
jmp    141d <pkcs5_pbkdf2+0x28d>
mov    (%rsp),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   10a0 <crypt_hmac_write@plt>
test   %rax,%rax
jne    15e8 <pkcs5_pbkdf2+0x458>
mov    (%rsp),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   10b0 <crypt_hmac_final@plt>
test   %rax,%rax
jne    15e8 <pkcs5_pbkdf2+0x458>
cmp    $0x8,%ebx
jae    1456 <pkcs5_pbkdf2+0x2c6>
xor    %eax,%eax
lea    0xe0(%rsp),%r14
jmp    1570 <pkcs5_pbkdf2+0x3e0>
cmp    $0x20,%ebx
lea    0xe0(%rsp),%r14
jae    146a <pkcs5_pbkdf2+0x2da>
xor    %ecx,%ecx
jmp    1540 <pkcs5_pbkdf2+0x3b0>
cmpq   $0x0,0x60(%rsp)
je     158d <pkcs5_pbkdf2+0x3fd>
mov    0x50(%rsp),%rcx
xor    %eax,%eax
nopl   (%rax)
movaps 0x90(%rsp,%rax,1),%xmm0
movaps 0xa0(%rsp,%rax,1),%xmm1
movaps 0xb0(%rsp,%rax,1),%xmm2
movaps 0xc0(%rsp,%rax,1),%xmm3
xorps  0xe0(%rsp,%rax,1),%xmm0
xorps  0xf0(%rsp,%rax,1),%xmm1
movaps %xmm0,0x90(%rsp,%rax,1)
movaps %xmm1,0xa0(%rsp,%rax,1)
xorps  0x100(%rsp,%rax,1),%xmm2
xorps  0x110(%rsp,%rax,1),%xmm3
movaps %xmm2,0xb0(%rsp,%rax,1)
movaps %xmm3,0xc0(%rsp,%rax,1)
add    $0x40,%rax
add    $0xfffffffffffffffe,%rcx
jne    1480 <pkcs5_pbkdf2+0x2f0>
testb  $0x1,0x58(%rsp)
je     1521 <pkcs5_pbkdf2+0x391>
movaps 0x90(%rsp,%rax,1),%xmm0
movaps 0xa0(%rsp,%rax,1),%xmm1
xorps  0xe0(%rsp,%rax,1),%xmm0
xorps  0xf0(%rsp,%rax,1),%xmm1
movaps %xmm0,0x90(%rsp,%rax,1)
movaps %xmm1,0xa0(%rsp,%rax,1)
cmp    %r12,0x30(%rsp)
je     13a0 <pkcs5_pbkdf2+0x210>
mov    0x30(%rsp),%rax
mov    %rax,%rcx
test   $0x18,%r12b
je     1570 <pkcs5_pbkdf2+0x3e0>
nopw   0x0(%rax,%rax,1)
mov    0xe0(%rsp,%rcx,1),%rax
xor    %rax,0x90(%rsp,%rcx,1)
add    $0x8,%rcx
cmp    %rcx,%rbp
jne    1540 <pkcs5_pbkdf2+0x3b0>
mov    %rbp,%rax
cmp    %r12,%rbp
je     13a0 <pkcs5_pbkdf2+0x210>
cs nopw 0x0(%rax,%rax,1)
nop
movzbl 0xe0(%rsp,%rax,1),%ecx
xor    %cl,0x90(%rsp,%rax,1)
add    $0x1,%rax
cmp    %rax,%r12
jne    1570 <pkcs5_pbkdf2+0x3e0>
jmp    13a0 <pkcs5_pbkdf2+0x210>
xor    %eax,%eax
testb  $0x1,0x58(%rsp)
jne    14f1 <pkcs5_pbkdf2+0x361>
jmp    1521 <pkcs5_pbkdf2+0x391>
mov    0x10(%rsp),%r14
lea    -0x1(%r14),%edi
imul   %ebx,%edi
add    0x1c8(%rsp),%rdi
cmp    0x48(%rsp),%r14
mov    %ebx,%edx
cmove  0x28(%rsp),%edx
lea    0x90(%rsp),%r15
mov    %r15,%rsi
call   1090 <memcpy@plt>
mov    %r15,%rdi
add    $0x1,%r14
xor    %r15d,%r15d
mov    %r14,0x10(%rsp)
cmp    0x20(%rsp),%r14
jne    1354 <pkcs5_pbkdf2+0x1c4>
jmp    15f0 <pkcs5_pbkdf2+0x460>
mov    %r13d,%r15d
jmp    15f0 <pkcs5_pbkdf2+0x460>
xor    %r15d,%r15d
mov    (%rsp),%rdi
call   1070 <crypt_hmac_destroy@plt>
lea    0xe0(%rsp),%rdi
mov    $0x50,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x90(%rsp),%rdi
mov    $0x50,%edx
xor    %esi,%esi
call   1060 <memset@plt>
mov    0x38(%rsp),%rdi
xor    %esi,%esi
mov    0x40(%rsp),%rdx
call   1060 <memset@plt>
jmp    12c0 <pkcs5_pbkdf2+0x130>

LLVM IR (-O0):
%struct.crypt_hmac = type { i32 }
@EINVAL = global i32 0
@ENOMEM = global i32 0
define i32 @pkcs5_pbkdf2(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4, i32 %5, i32 %6, i8* %7, i32 %8) {
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i32
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i32
%20 = alloca %struct.crypt_hmac*
%21 = alloca [80 x i8]
%22 = alloca [80 x i8]
%23 = alloca [80 x i8]
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i64
%32 = alloca i8*
store i8* %0, i8** %11
store i8* %1, i8** %12
store i64 %2, i64* %13
store i8* %3, i8** %14
store i64 %4, i64* %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i8* %7, i8** %18
store i32 %8, i32* %19
%33 = load i32, i32* @EINVAL
%34 = sub nsw i32 0, %33
store i32 %34, i32* %26
%35 = load i64, i64* %15
%36 = add i64 %35, 4
store i64 %36, i64* %31
%37 = load i64, i64* %31
%38 = call i8* @alloca(i64 %37)
store i8* %38, i8** %32
%39 = load i8*, i8** %32
%40 = icmp eq i8* %39, null
br i1 %40, label %41, label %44
41: ; preds = %9
%42 = load i32, i32* @ENOMEM
%43 = sub nsw i32 0, %42
store i32 %43, i32* %10
br label %269
44: ; preds = %9
%45 = load i8*, i8** %11
%46 = call i32 @crypt_hmac_size(i8* %45)
store i32 %46, i32* %28
%47 = load i32, i32* %28
%48 = icmp eq i32 %47, 0
br i1 %48, label %52, label %49
49: ; preds = %44
%50 = load i32, i32* %28
%51 = icmp ugt i32 %50, 80
br i1 %51, label %52, label %55
52: ; preds = %49, %44
%53 = load i32, i32* @EINVAL
%54 = sub nsw i32 0, %53
store i32 %54, i32* %10
br label %269
55: ; preds = %49
%56 = load i32, i32* %16
%57 = icmp eq i32 %56, 0
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load i32, i32* @EINVAL
%60 = sub nsw i32 0, %59
store i32 %60, i32* %10
br label %269
61: ; preds = %55
%62 = load i32, i32* %17
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load i32, i32* @EINVAL
%66 = sub nsw i32 0, %65
store i32 %66, i32* %10
br label %269
67: ; preds = %61
%68 = load i32, i32* %17
%69 = icmp ugt i32 %68, -1
br i1 %69, label %70, label %73
70: ; preds = %67
%71 = load i32, i32* @EINVAL
%72 = sub nsw i32 0, %71
store i32 %72, i32* %10
br label %269
73: ; preds = %67
%74 = load i32, i32* %17
%75 = load i32, i32* %28
%76 = udiv i32 %74, %75
store i32 %76, i32* %29
%77 = load i32, i32* %17
%78 = load i32, i32* %28
%79 = urem i32 %77, %78
%80 = icmp ne i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %73
%82 = load i32, i32* %29
%83 = add i32 %82, 1
store i32 %83, i32* %29
br label %84
84: ; preds = %81, %73
%85 = load i32, i32* %17
%86 = load i32, i32* %29
%87 = sub i32 %86, 1
%88 = load i32, i32* %28
%89 = mul i32 %87, %88
%90 = sub i32 %85, %89
store i32 %90, i32* %30
%91 = load i32, i32* %19
%92 = icmp ugt i32 %91, 0
br i1 %92, label %93, label %122
93: ; preds = %84
%94 = load i64, i64* %13
%95 = load i32, i32* %19
%96 = zext i32 %95 to i64
%97 = icmp ugt i64 %94, %96
br i1 %97, label %98, label %122
98: ; preds = %93
%99 = load i8*, i8** %12
%100 = load i64, i64* %13
%101 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%102 = load i32, i32* %28
%103 = load i8*, i8** %11
%104 = call i64 @hash_buf(i8* %99, i64 %100, i8* %101, i32 %102, i8* %103)
%105 = icmp ne i64 %104, 0
br i1 %105, label %106, label %109
106: ; preds = %98
%107 = load i32, i32* @EINVAL
%108 = sub nsw i32 0, %107
store i32 %108, i32* %10
br label %269
109: ; preds = %98
%110 = load i8*, i8** %11
%111 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%112 = load i32, i32* %28
%113 = zext i32 %112 to i64
%114 = call i64 @crypt_hmac_init(%struct.crypt_hmac** %20, i8* %110, i8* %111, i64 %113)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %119
116: ; preds = %109
%117 = load i32, i32* @EINVAL
%118 = sub nsw i32 0, %117
store i32 %118, i32* %10
br label %269
119: ; preds = %109
%120 = getelementptr inbounds [80 x i8], [80 x i8]* %23, i64 0, i64 0
%121 = call i32 @memset(i8* %120, i32 0, i64 80)
br label %132
122: ; preds = %93, %84
%123 = load i8*, i8** %11
%124 = load i8*, i8** %12
%125 = load i64, i64* %13
%126 = call i64 @crypt_hmac_init(%struct.crypt_hmac** %20, i8* %123, i8* %124, i64 %125)
%127 = icmp ne i64 %126, 0
br i1 %127, label %128, label %131
128: ; preds = %122
%129 = load i32, i32* @EINVAL
%130 = sub nsw i32 0, %129
store i32 %130, i32* %10
br label %269
131: ; preds = %122
br label %132
132: ; preds = %131, %119
store i32 1, i32* %24
br label %133
133: ; preds = %254, %132
%134 = load i32, i32* %24
%135 = load i32, i32* %29
%136 = icmp ule i32 %134, %135
br i1 %136, label %137, label %257
137: ; preds = %133
%138 = getelementptr inbounds [80 x i8], [80 x i8]* %22, i64 0, i64 0
%139 = load i32, i32* %28
%140 = zext i32 %139 to i64
%141 = call i32 @memset(i8* %138, i32 0, i64 %140)
store i32 1, i32* %27
br label %142
142: ; preds = %232, %137
%143 = load i32, i32* %27
%144 = load i32, i32* %16
%145 = icmp ule i32 %143, %144
br i1 %145, label %146, label %235
146: ; preds = %142
%147 = load i32, i32* %27
%148 = icmp eq i32 %147, 1
br i1 %148, label %149, label %195
149: ; preds = %146
%150 = load i8*, i8** %32
%151 = load i8*, i8** %14
%152 = load i64, i64* %15
%153 = trunc i64 %152 to i32
%154 = call i32 @memcpy(i8* %150, i8* %151, i32 %153)
%155 = load i32, i32* %24
%156 = and i32 %155, -16777216
%157 = lshr i32 %156, 24
%158 = trunc i32 %157 to i8
%159 = load i8*, i8** %32
%160 = load i64, i64* %15
%161 = add i64 %160, 0
%162 = getelementptr inbounds i8, i8* %159, i64 %161
store i8 %158, i8* %162
%163 = load i32, i32* %24
%164 = and i32 %163, 16711680
%165 = ashr i32 %164, 16
%166 = trunc i32 %165 to i8
%167 = load i8*, i8** %32
%168 = load i64, i64* %15
%169 = add i64 %168, 1
%170 = getelementptr inbounds i8, i8* %167, i64 %169
store i8 %166, i8* %170
%171 = load i32, i32* %24
%172 = and i32 %171, 65280
%173 = ashr i32 %172, 8
%174 = trunc i32 %173 to i8
%175 = load i8*, i8** %32
%176 = load i64, i64* %15
%177 = add i64 %176, 2
%178 = getelementptr inbounds i8, i8* %175, i64 %177
store i8 %174, i8* %178
%179 = load i32, i32* %24
%180 = and i32 %179, 255
%181 = ashr i32 %180, 0
%182 = trunc i32 %181 to i8
%183 = load i8*, i8** %32
%184 = load i64, i64* %15
%185 = add i64 %184, 3
%186 = getelementptr inbounds i8, i8* %183, i64 %185
store i8 %182, i8* %186
%187 = load %struct.crypt_hmac*, %struct.crypt_hmac** %20
%188 = load i8*, i8** %32
%189 = load i64, i64* %31
%190 = trunc i64 %189 to i32
%191 = call i64 @crypt_hmac_write(%struct.crypt_hmac* %187, i8* %188, i32 %190)
%192 = icmp ne i64 %191, 0
br i1 %192, label %193, label %194
193: ; preds = %149
br label %258
194: ; preds = %149
br label %203
195: ; preds = %146
%196 = load %struct.crypt_hmac*, %struct.crypt_hmac** %20
%197 = getelementptr inbounds [80 x i8], [80 x i8]* %21, i64 0, i64 0
%198 = load i32, i32* %28
%199 = call i64 @crypt_hmac_write(%struct.crypt_hmac* %196, i8* %197, i32 %198)
%200 = icmp ne i64 %199, 0
br i1 %200, label %201, label %202
201: ; preds = %195
br label %258
202: ; preds = %195
br label %203
203: ; preds = %202, %194
%204 = load %struct.crypt_hmac*, %struct.crypt_hmac** %20
%205 = getelementptr inbounds [80 x i8], [80 x i8]* %21, i64 0, i64 0
%206 = load i32, i32* %28
%207 = call i64 @crypt_hmac_final(%struct.crypt_hmac* %204, i8* %205, i32 %206)
%208 = icmp ne i64 %207, 0
br i1 %208, label %209, label %210
209: ; preds = %203
br label %258
210: ; preds = %203
store i32 0, i32* %25
br label %211
211: ; preds = %228, %210
%212 = load i32, i32* %25
%213 = load i32, i32* %28
%214 = icmp ult i32 %212, %213
br i1 %214, label %215, label %231
215: ; preds = %211
%216 = load i32, i32* %25
%217 = sext i32 %216 to i64
%218 = getelementptr inbounds [80 x i8], [80 x i8]* %21, i64 0, i64 %217
%219 = load i8, i8* %218
%220 = sext i8 %219 to i32
%221 = load i32, i32* %25
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds [80 x i8], [80 x i8]* %22, i64 0, i64 %222
%224 = load i8, i8* %223
%225 = sext i8 %224 to i32
%226 = xor i32 %225, %220
%227 = trunc i32 %226 to i8
store i8 %227, i8* %223
br label %228
228: ; preds = %215
%229 = load i32, i32* %25
%230 = add nsw i32 %229, 1
store i32 %230, i32* %25
br label %211
231: ; preds = %211
br label %232
232: ; preds = %231
%233 = load i32, i32* %27
%234 = add i32 %233, 1
store i32 %234, i32* %27
br label %142
235: ; preds = %142
%236 = load i8*, i8** %18
%237 = load i32, i32* %24
%238 = sub nsw i32 %237, 1
%239 = load i32, i32* %28
%240 = mul i32 %238, %239
%241 = zext i32 %240 to i64
%242 = getelementptr inbounds i8, i8* %236, i64 %241
%243 = getelementptr inbounds [80 x i8], [80 x i8]* %22, i64 0, i64 0
%244 = load i32, i32* %24
%245 = load i32, i32* %29
%246 = icmp eq i32 %244, %245
br i1 %246, label %247, label %249
247: ; preds = %235
%248 = load i32, i32* %30
br label %251
249: ; preds = %235
%250 = load i32, i32* %28
br label %251
251: ; preds = %249, %247
%252 = phi i32 [ %248, %247 ], [ %250, %249 ]
%253 = call i32 @memcpy(i8* %242, i8* %243, i32 %252)
br label %254
254: ; preds = %251
%255 = load i32, i32* %24
%256 = add nsw i32 %255, 1
store i32 %256, i32* %24
br label %133
257: ; preds = %133
store i32 0, i32* %26
br label %258
258: ; preds = %257, %209, %201, %193
%259 = load %struct.crypt_hmac*, %struct.crypt_hmac** %20
%260 = call i32 @crypt_hmac_destroy(%struct.crypt_hmac* %259)
%261 = getelementptr inbounds [80 x i8], [80 x i8]* %21, i64 0, i64 0
%262 = call i32 @memset(i8* %261, i32 0, i64 80)
%263 = getelementptr inbounds [80 x i8], [80 x i8]* %22, i64 0, i64 0
%264 = call i32 @memset(i8* %263, i32 0, i64 80)
%265 = load i8*, i8** %32
%266 = load i64, i64* %31
%267 = call i32 @memset(i8* %265, i32 0, i64 %266)
%268 = load i32, i32* %26
store i32 %268, i32* %10
br label %269
269: ; preds = %258, %128, %116, %106, %70, %64, %58, %52, %41
%270 = load i32, i32* %10
ret i32 %270
}

LLVM IR (-O2):
%struct.crypt_hmac = type { i32 }
@EINVAL = global i32 0
@ENOMEM = global i32 0
define i32 @pkcs5_pbkdf2(i8* %0, i8* %1, i64 %2, i8* %3, i64 %4, i32 %5, i32 %6, i8* %7, i32 %8) {
%10 = alloca %struct.crypt_hmac*
%11 = alloca [80 x i8]
%12 = alloca [80 x i8]
%13 = alloca [80 x i8]
%14 = bitcast %struct.crypt_hmac** %10 to i8*
%15 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 0
%16 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 0
%17 = getelementptr inbounds [80 x i8], [80 x i8]* %13, i64 0, i64 0
%18 = load i32, i32* @EINVAL
%19 = sub nsw i32 0, %18
%20 = add i64 %4, 4
%21 = tail call i8* @alloca(i64 %20)
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %26
23: ; preds = %9
%24 = load i32, i32* @ENOMEM
%25 = sub nsw i32 0, %24
br label %245
26: ; preds = %9
%27 = tail call i32 @crypt_hmac_size(i8* %0)
%28 = add i32 %27, -81
%29 = icmp ult i32 %28, -80
br i1 %29, label %30, label %33
30: ; preds = %26
%31 = load i32, i32* @EINVAL
%32 = sub nsw i32 0, %31
br label %245
33: ; preds = %26
%34 = icmp eq i32 %5, 0
br i1 %34, label %35, label %38
35: ; preds = %33
%36 = load i32, i32* @EINVAL
%37 = sub nsw i32 0, %36
br label %245
38: ; preds = %33
%39 = icmp eq i32 %6, 0
br i1 %39, label %40, label %43
40: ; preds = %38
%41 = load i32, i32* @EINVAL
%42 = sub nsw i32 0, %41
br label %245
43: ; preds = %38
%44 = udiv i32 %6, %27
%45 = urem i32 %6, %27
%46 = icmp ne i32 %45, 0
%47 = zext i1 %46 to i32
%48 = add i32 %44, %47
%49 = add i32 %48, -1
%50 = mul i32 %49, %27
%51 = sub i32 %6, %50
%52 = icmp ne i32 %8, 0
%53 = zext i32 %8 to i64
%54 = icmp ult i64 %53, %2
%55 = and i1 %52, %54
br i1 %55, label %56, label %71
56: ; preds = %43
%57 = call i64 @hash_buf(i8* %1, i64 %2, i8* %17, i32 %27, i8* %0)
%58 = icmp eq i64 %57, 0
br i1 %58, label %62, label %59
59: ; preds = %56
%60 = load i32, i32* @EINVAL
%61 = sub nsw i32 0, %60
br label %245
62: ; preds = %56
%63 = zext i32 %27 to i64
%64 = call i64 @crypt_hmac_init(%struct.crypt_hmac** %10, i8* %0, i8* %17, i64 %63)
%65 = icmp eq i64 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %62
%67 = load i32, i32* @EINVAL
%68 = sub nsw i32 0, %67
br label %245
69: ; preds = %62
%70 = call i32 @memset(i8* %17, i32 0, i64 80)
br label %77
71: ; preds = %43
%72 = call i64 @crypt_hmac_init(%struct.crypt_hmac** %10, i8* %0, i8* %1, i64 %2)
%73 = icmp eq i64 %72, 0
br i1 %73, label %77, label %74
74: ; preds = %71
%75 = load i32, i32* @EINVAL
%76 = sub nsw i32 0, %75
br label %245
77: ; preds = %71, %69
%78 = icmp eq i32 %48, 0
br i1 %78, label %238, label %79
79: ; preds = %77
%80 = zext i32 %27 to i64
%81 = trunc i64 %4 to i32
%82 = getelementptr inbounds i8, i8* %21, i64 %4
%83 = add i64 %4, 1
%84 = getelementptr inbounds i8, i8* %21, i64 %83
%85 = add i64 %4, 2
%86 = getelementptr inbounds i8, i8* %21, i64 %85
%87 = add i64 %4, 3
%88 = getelementptr inbounds i8, i8* %21, i64 %87
%89 = trunc i64 %20 to i32
%90 = zext i32 %48 to i64
%91 = add i32 %48, 1
%92 = zext i32 %91 to i64
%93 = and i64 %80, 4294967264
%94 = add nsw i64 %93, -32
%95 = lshr exact i64 %94, 5
%96 = add nuw nsw i64 %95, 1
%97 = icmp ult i32 %27, 8
%98 = icmp ult i32 %27, 32
%99 = and i64 %80, 4294967264
%100 = and i64 %96, 1
%101 = icmp eq i64 %94, 0
%102 = and i64 %96, 1152921504606846974
%103 = icmp eq i64 %100, 0
%104 = icmp eq i64 %99, %80
%105 = and i64 %80, 24
%106 = icmp eq i64 %105, 0
%107 = and i64 %80, 4294967288
%108 = icmp eq i64 %107, %80
br label %109
109: ; preds = %227, %79
%110 = phi i64 [ 1, %79 ], [ %236, %227 ]
%111 = call i32 @memset(i8* %16, i32 0, i64 %80)
%112 = lshr i64 %110, 24
%113 = trunc i64 %112 to i8
%114 = lshr i64 %110, 16
%115 = trunc i64 %114 to i8
%116 = lshr i64 %110, 8
%117 = trunc i64 %116 to i8
%118 = trunc i64 %110 to i8
br label %119
119: ; preds = %109, %224
%120 = phi i32 [ 1, %109 ], [ %225, %224 ]
%121 = icmp eq i32 %120, 1
br i1 %121, label %122, label %127
122: ; preds = %119
%123 = call i32 @memcpy(i8* %21, i8* %3, i32 %81)
store i8 %113, i8* %82
store i8 %115, i8* %84
store i8 %117, i8* %86
store i8 %118, i8* %88
%124 = load %struct.crypt_hmac*, %struct.crypt_hmac** %10
%125 = call i64 @crypt_hmac_write(%struct.crypt_hmac* %124, i8* %21, i32 %89)
%126 = icmp eq i64 %125, 0
br i1 %126, label %131, label %238
127: ; preds = %119
%128 = load %struct.crypt_hmac*, %struct.crypt_hmac** %10
%129 = call i64 @crypt_hmac_write(%struct.crypt_hmac* %128, i8* %15, i32 %27)
%130 = icmp eq i64 %129, 0
br i1 %130, label %131, label %238
131: ; preds = %127, %122
%132 = load %struct.crypt_hmac*, %struct.crypt_hmac** %10
%133 = call i64 @crypt_hmac_final(%struct.crypt_hmac* %132, i8* %15, i32 %27)
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %238
135: ; preds = %131
br i1 %97, label %213, label %136
136: ; preds = %135
br i1 %98, label %198, label %137
137: ; preds = %136
br i1 %101, label %177, label %138
138: ; preds = %137, %138
%139 = phi i64 [ %174, %138 ], [ 0, %137 ]
%140 = phi i64 [ %175, %138 ], [ 0, %137 ]
%141 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 %139
%142 = bitcast i8* %141 to <16 x i8>*
%143 = load <16 x i8>, <16 x i8>* %142
%144 = getelementptr inbounds i8, i8* %141, i64 16
%145 = bitcast i8* %144 to <16 x i8>*
%146 = load <16 x i8>, <16 x i8>* %145
%147 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 %139
%148 = bitcast i8* %147 to <16 x i8>*
%149 = load <16 x i8>, <16 x i8>* %148
%150 = getelementptr inbounds i8, i8* %147, i64 16
%151 = bitcast i8* %150 to <16 x i8>*
%152 = load <16 x i8>, <16 x i8>* %151
%153 = xor <16 x i8> %149, %143
%154 = xor <16 x i8> %152, %146
%155 = bitcast i8* %147 to <16 x i8>*
store <16 x i8> %153, <16 x i8>* %155
%156 = bitcast i8* %150 to <16 x i8>*
store <16 x i8> %154, <16 x i8>* %156
%157 = or i64 %139, 32
%158 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 %157
%159 = bitcast i8* %158 to <16 x i8>*
%160 = load <16 x i8>, <16 x i8>* %159
%161 = getelementptr inbounds i8, i8* %158, i64 16
%162 = bitcast i8* %161 to <16 x i8>*
%163 = load <16 x i8>, <16 x i8>* %162
%164 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 %157
%165 = bitcast i8* %164 to <16 x i8>*
%166 = load <16 x i8>, <16 x i8>* %165
%167 = getelementptr inbounds i8, i8* %164, i64 16
%168 = bitcast i8* %167 to <16 x i8>*
%169 = load <16 x i8>, <16 x i8>* %168
%170 = xor <16 x i8> %166, %160
%171 = xor <16 x i8> %169, %163
%172 = bitcast i8* %164 to <16 x i8>*
store <16 x i8> %170, <16 x i8>* %172
%173 = bitcast i8* %167 to <16 x i8>*
store <16 x i8> %171, <16 x i8>* %173
%174 = add nuw i64 %139, 64
%175 = add i64 %140, 2
%176 = icmp eq i64 %175, %102
br i1 %176, label %177, label %138
177: ; preds = %138, %137
%178 = phi i64 [ 0, %137 ], [ %174, %138 ]
br i1 %103, label %196, label %179
179: ; preds = %177
%180 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 %178
%181 = bitcast i8* %180 to <16 x i8>*
%182 = load <16 x i8>, <16 x i8>* %181
%183 = getelementptr inbounds i8, i8* %180, i64 16
%184 = bitcast i8* %183 to <16 x i8>*
%185 = load <16 x i8>, <16 x i8>* %184
%186 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 %178
%187 = bitcast i8* %186 to <16 x i8>*
%188 = load <16 x i8>, <16 x i8>* %187
%189 = getelementptr inbounds i8, i8* %186, i64 16
%190 = bitcast i8* %189 to <16 x i8>*
%191 = load <16 x i8>, <16 x i8>* %190
%192 = xor <16 x i8> %188, %182
%193 = xor <16 x i8> %191, %185
%194 = bitcast i8* %186 to <16 x i8>*
store <16 x i8> %192, <16 x i8>* %194
%195 = bitcast i8* %189 to <16 x i8>*
store <16 x i8> %193, <16 x i8>* %195
br label %196
196: ; preds = %177, %179
br i1 %104, label %224, label %197
197: ; preds = %196
br i1 %106, label %213, label %198
198: ; preds = %136, %197
%199 = phi i64 [ %99, %197 ], [ 0, %136 ]
br label %200
200: ; preds = %200, %198
%201 = phi i64 [ %199, %198 ], [ %210, %200 ]
%202 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 %201
%203 = bitcast i8* %202 to <8 x i8>*
%204 = load <8 x i8>, <8 x i8>* %203
%205 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 %201
%206 = bitcast i8* %205 to <8 x i8>*
%207 = load <8 x i8>, <8 x i8>* %206
%208 = xor <8 x i8> %207, %204
%209 = bitcast i8* %205 to <8 x i8>*
store <8 x i8> %208, <8 x i8>* %209
%210 = add nuw i64 %201, 8
%211 = icmp eq i64 %210, %107
br i1 %211, label %212, label %200
212: ; preds = %200
br i1 %108, label %224, label %213
213: ; preds = %135, %197, %212
%214 = phi i64 [ 0, %135 ], [ %99, %197 ], [ %107, %212 ]
br label %215
215: ; preds = %213, %215
%216 = phi i64 [ %222, %215 ], [ %214, %213 ]
%217 = getelementptr inbounds [80 x i8], [80 x i8]* %11, i64 0, i64 %216
%218 = load i8, i8* %217
%219 = getelementptr inbounds [80 x i8], [80 x i8]* %12, i64 0, i64 %216
%220 = load i8, i8* %219
%221 = xor i8 %220, %218
store i8 %221, i8* %219
%222 = add nuw nsw i64 %216, 1
%223 = icmp eq i64 %222, %80
br i1 %223, label %224, label %215
224: ; preds = %215, %212, %196
%225 = add i32 %120, 1
%226 = icmp ugt i32 %225, %5
br i1 %226, label %227, label %119
227: ; preds = %224
%228 = trunc i64 %110 to i32
%229 = add i32 %228, -1
%230 = mul i32 %229, %27
%231 = zext i32 %230 to i64
%232 = getelementptr inbounds i8, i8* %7, i64 %231
%233 = icmp eq i64 %110, %90
%234 = select i1 %233, i32 %51, i32 %27
%235 = call i32 @memcpy(i8* %232, i8* %16, i32 %234)
%236 = add nuw nsw i64 %110, 1
%237 = icmp eq i64 %236, %92
br i1 %237, label %238, label %109
238: ; preds = %227, %131, %127, %122, %77
%239 = phi i32 [ 0, %77 ], [ %19, %122 ], [ %19, %127 ], [ %19, %131 ], [ 0, %227 ]
%240 = load %struct.crypt_hmac*, %struct.crypt_hmac** %10
%241 = call i32 @crypt_hmac_destroy(%struct.crypt_hmac* %240)
%242 = call i32 @memset(i8* %15, i32 0, i64 80)
%243 = call i32 @memset(i8* %16, i32 0, i64 80)
%244 = call i32 @memset(i8* %21, i32 0, i64 %20)
br label %245
245: ; preds = %238, %74, %66, %59, %40, %35, %30, %23
%246 = phi i32 [ %25, %23 ], [ %32, %30 ], [ %37, %35 ], [ %42, %40 ], [ %61, %59 ], [ %68, %66 ], [ %239, %238 ], [ %76, %74 ]
ret i32 %246
}