#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 */

/* Variables and functions */
int /*<<< orphan*/ McbCreateSubKeys(unsigned char *, unsigned char **);
int /*<<< orphan*/ McbEncode64Bits(unsigned char *, unsigned char *,
                                   unsigned char const **, int);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ memset(unsigned char *, int, int);
int rand();
int McbDoDES2(unsigned char *lpIn, unsigned long cbIn, unsigned char Key1[8],
              unsigned char Key2[8], unsigned char *lpOut,
              unsigned long *pcbOut, int nEncrypt, int nPadding, int nEncNo,
              int nCBC) {
  unsigned char bBuffTooSmall;
  unsigned char SubKeys[2][16][6];
  unsigned char in[8], pad, bIsPadded;
  unsigned long cbBlock, cbOut, cbCrypt, n;
  long cbRemaining;
  int nEncryptMode;
  unsigned char *lpTmp1, *lpTmp2;
  if (nEncrypt) {
    if (nCBC) {
      cbOut = ((((cbIn) / 8) + (((cbIn) % 8 > 0) ? 1 : ((nPadding) ? 1 : 0)) +
                ((1) ? 1 : 0)) *
               8);
      cbCrypt = cbOut - 8;
    } else {
      cbOut = ((((cbIn) / 8) + (((cbIn) % 8 > 0) ? 1 : ((nPadding) ? 1 : 0)) +
                ((0) ? 1 : 0)) *
               8);
      cbCrypt = cbOut;
    }
  } else {
    cbOut = ((((cbIn) / 8) - ((nCBC) ? 1 : 0)) * 8);
    cbCrypt = cbOut;
  }
  bBuffTooSmall = *pcbOut < cbOut;
  *pcbOut = cbOut;
  if (!lpOut || bBuffTooSmall || !lpIn) {
    return 0;
  }
  McbCreateSubKeys(Key1, SubKeys[0]);
  if (nEncNo > 1) {
    McbCreateSubKeys(Key2, SubKeys[1]);
  }
  if (nCBC) {
    if (nEncrypt) {
      for (n = 0; n < 8; n++) {
        in[n] = (rand() >> 4) % 256;
      }
      nEncryptMode = nEncrypt;
      for (n = 0; n < (unsigned int)nEncNo; n++) {
        McbEncode64Bits(in, lpOut,
                        (const unsigned char(*)[6])SubKeys[n % 2 == 0 ? 0 : 1],
                        nEncryptMode);
        nEncryptMode = !nEncryptMode;
      }
      lpOut += 8;
    } else {
      lpIn += 8;
      cbIn -= 8;
    }
  }
  cbBlock = 0;
  cbRemaining = cbIn;
  for (cbBlock = 0; cbBlock < cbCrypt; cbBlock += 8) {
    if (cbRemaining == 0) {
      memset(in, 8, 8);
    } else if (cbRemaining < 8) {
      memset(in + cbRemaining, 8 - cbRemaining, 8 - cbRemaining);
      memcpy(in, lpIn + cbBlock, cbRemaining);
    } else {
      memcpy(in, lpIn + cbBlock, 8);
    }
    if (nCBC && nEncrypt) {
      lpTmp1 = lpOut + cbBlock - 8;
      for (n = 0; n < 8; n++) {
        in[n] ^= lpTmp1[n];
      }
    }
    nEncryptMode = nEncrypt;
    for (n = 0; n < (unsigned int)nEncNo; n++) {
      McbEncode64Bits(in, lpOut + cbBlock,
                      (const unsigned char(*)[6])SubKeys[n % 2 == 0 ? 0 : 1],
                      nEncryptMode);
      nEncryptMode = !nEncryptMode;
      memcpy(in, lpOut + cbBlock, 8);
    }
    if (nCBC && !nEncrypt) {
      lpTmp1 = lpIn + cbBlock - 8;
      lpTmp2 = lpOut + cbBlock;
      for (n = 0; n < 8; n++) {
        lpTmp2[n] ^= lpTmp1[n];
      }
    }
    cbRemaining -= 8;
  }
  if (!nEncrypt && nPadding) {
    pad = lpOut[cbOut - 1];
    if (pad <= 8) {
      bIsPadded = 1;
      for (n = cbOut - 2; n > (cbOut - pad); n--) {
        if (lpOut[n] != pad) {
          bIsPadded = 0;
          break;
        }
      }
      if (bIsPadded) {
        *pcbOut -= pad;
      }
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<McbDoDES2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
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    %r9,-0x38(%rbp)
cmpl   $0x0,0x10(%rbp)
je     128f <McbDoDES2+0x13f>
cmpl   $0x0,0x28(%rbp)
je     1213 <McbDoDES2+0xc3>
mov    -0x18(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x158(%rbp)
mov    -0x18(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
jbe    11c4 <McbDoDES2+0x74>
mov    $0x1,%eax
mov    %eax,-0x15c(%rbp)
jmp    11da <McbDoDES2+0x8a>
mov    0x18(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x15c(%rbp)
mov    -0x158(%rbp),%rax
mov    -0x15c(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
sub    $0x8,%rax
mov    %rax,-0x128(%rbp)
jmp    128a <McbDoDES2+0x13a>
mov    -0x18(%rbp),%rax
shr    $0x3,%rax
mov    %rax,-0x168(%rbp)
mov    -0x18(%rbp),%rax
and    $0x7,%rax
cmp    $0x0,%rax
jbe    1244 <McbDoDES2+0xf4>
mov    $0x1,%eax
mov    %eax,-0x16c(%rbp)
jmp    125a <McbDoDES2+0x10a>
mov    0x18(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x16c(%rbp)
mov    -0x168(%rbp),%rax
mov    -0x16c(%rbp),%ecx
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x0,%rax
shl    $0x3,%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
mov    %rax,-0x128(%rbp)
jmp    12c6 <McbDoDES2+0x176>
mov    -0x18(%rbp),%rax
shr    $0x3,%rax
mov    0x28(%rbp),%esi
xor    %ecx,%ecx
mov    $0x1,%edx
cmp    $0x0,%esi
cmovne %edx,%ecx
movslq %ecx,%rcx
sub    %rcx,%rax
shl    $0x3,%rax
mov    %rax,-0x120(%rbp)
mov    -0x120(%rbp),%rax
mov    %rax,-0x128(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
cmp    -0x120(%rbp),%rax
setb   %al
and    $0x1,%al
movzbl %al,%eax
mov    %al,-0x39(%rbp)
mov    -0x120(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
cmpq   $0x0,-0x30(%rbp)
je     1310 <McbDoDES2+0x1c0>
movzbl -0x39(%rbp),%eax
cmp    $0x0,%eax
jne    1310 <McbDoDES2+0x1c0>
cmpq   $0x0,-0x10(%rbp)
jne    131c <McbDoDES2+0x1cc>
movl   $0x0,-0x4(%rbp)
jmp    1843 <McbDoDES2+0x6f3>
mov    -0x20(%rbp),%rdi
lea    -0x100(%rbp),%rsi
call   1040 <McbCreateSubKeys@plt>
cmpl   $0x1,0x20(%rbp)
jle    134a <McbDoDES2+0x1fa>
mov    -0x28(%rbp),%rdi
lea    -0x100(%rbp),%rsi
add    $0x60,%rsi
call   1040 <McbCreateSubKeys@plt>
cmpl   $0x0,0x28(%rbp)
je     1472 <McbDoDES2+0x322>
cmpl   $0x0,0x10(%rbp)
je     1455 <McbDoDES2+0x305>
movq   $0x0,-0x130(%rbp)
cmpq   $0x8,-0x130(%rbp)
08
jae    13b0 <McbDoDES2+0x260>
mov    $0x0,%al
call   1070 <rand@plt>
sar    $0x4,%eax
mov    $0x100,%ecx
cltd
idiv   %ecx
mov    %dl,%cl
mov    -0x130(%rbp),%rax
mov    %cl,-0x108(%rbp,%rax,1)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    1369 <McbDoDES2+0x219>
mov    0x10(%rbp),%eax
mov    %eax,-0x13c(%rbp)
movq   $0x0,-0x130(%rbp)
mov    -0x130(%rbp),%rax
mov    0x20(%rbp),%ecx
cmp    %rcx,%rax
jae    1444 <McbDoDES2+0x2f4>
lea    -0x108(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x130(%rbp),%rdx
and    $0x1,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
cltq
lea    -0x100(%rbp),%rdx
imul   $0x60,%rax,%rax
add    %rax,%rdx
mov    -0x13c(%rbp),%ecx
call   1030 <McbEncode64Bits@plt>
cmpl   $0x0,-0x13c(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x13c(%rbp)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    13c4 <McbDoDES2+0x274>
mov    -0x30(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
jmp    146d <McbDoDES2+0x31d>
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1472 <McbDoDES2+0x322>
movq   $0x0,-0x118(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x138(%rbp)
movq   $0x0,-0x118(%rbp)
mov    -0x118(%rbp),%rax
cmp    -0x128(%rbp),%rax
jae    1753 <McbDoDES2+0x603>
cmpq   $0x0,-0x138(%rbp)
jne    14cd <McbDoDES2+0x37d>
lea    -0x108(%rbp),%rdi
mov    $0x8,%edx
mov    %edx,%esi
call   1050 <memset@plt>
jmp    1550 <McbDoDES2+0x400>
cmpq   $0x8,-0x138(%rbp)
08
jge    152f <McbDoDES2+0x3df>
lea    -0x108(%rbp),%rdi
add    -0x138(%rbp),%rdi
mov    $0x8,%eax
sub    -0x138(%rbp),%rax
mov    %eax,%esi
mov    $0x8,%eax
sub    -0x138(%rbp),%rax
mov    %eax,%edx
call   1050 <memset@plt>
lea    -0x108(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    -0x118(%rbp),%rsi
mov    -0x138(%rbp),%rax
mov    %eax,%edx
call   1060 <memcpy@plt>
jmp    154b <McbDoDES2+0x3fb>
lea    -0x108(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    -0x118(%rbp),%rsi
mov    $0x8,%edx
call   1060 <memcpy@plt>
jmp    1550 <McbDoDES2+0x400>
cmpl   $0x0,0x28(%rbp)
je     15d9 <McbDoDES2+0x489>
cmpl   $0x0,0x10(%rbp)
je     15d9 <McbDoDES2+0x489>
mov    -0x30(%rbp),%rax
add    -0x118(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x148(%rbp)
movq   $0x0,-0x130(%rbp)
cmpq   $0x8,-0x130(%rbp)
08
jae    15d4 <McbDoDES2+0x484>
mov    -0x148(%rbp),%rax
mov    -0x130(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
mov    -0x130(%rbp),%rax
movzbl -0x108(%rbp,%rax,1),%ecx
ff
xor    %edx,%ecx
mov    %cl,-0x108(%rbp,%rax,1)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    1585 <McbDoDES2+0x435>
jmp    15d9 <McbDoDES2+0x489>
mov    0x10(%rbp),%eax
mov    %eax,-0x13c(%rbp)
movq   $0x0,-0x130(%rbp)
mov    -0x130(%rbp),%rax
mov    0x20(%rbp),%ecx
cmp    %rcx,%rax
jae    1690 <McbDoDES2+0x540>
lea    -0x108(%rbp),%rdi
mov    -0x30(%rbp),%rsi
add    -0x118(%rbp),%rsi
mov    -0x130(%rbp),%rdx
and    $0x1,%rdx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x0,%rdx
cmove  %ecx,%eax
cltq
lea    -0x100(%rbp),%rdx
imul   $0x60,%rax,%rax
add    %rax,%rdx
mov    -0x13c(%rbp),%ecx
call   1030 <McbEncode64Bits@plt>
cmpl   $0x0,-0x13c(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x13c(%rbp)
lea    -0x108(%rbp),%rdi
mov    -0x30(%rbp),%rsi
add    -0x118(%rbp),%rsi
mov    $0x8,%edx
call   1060 <memcpy@plt>
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    15ed <McbDoDES2+0x49d>
cmpl   $0x0,0x28(%rbp)
je     172a <McbDoDES2+0x5da>
cmpl   $0x0,0x10(%rbp)
jne    172a <McbDoDES2+0x5da>
mov    -0x10(%rbp),%rax
add    -0x118(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x148(%rbp)
mov    -0x30(%rbp),%rax
add    -0x118(%rbp),%rax
mov    %rax,-0x150(%rbp)
movq   $0x0,-0x130(%rbp)
cmpq   $0x8,-0x130(%rbp)
08
jae    1725 <McbDoDES2+0x5d5>
mov    -0x148(%rbp),%rax
mov    -0x130(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
mov    -0x150(%rbp),%rax
mov    -0x130(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
xor    %esi,%edx
mov    %dl,(%rax,%rcx,1)
mov    -0x130(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x130(%rbp)
jmp    16d7 <McbDoDES2+0x587>
jmp    172a <McbDoDES2+0x5da>
mov    -0x138(%rbp),%rax
sub    $0x8,%rax
mov    %rax,-0x138(%rbp)
mov    -0x118(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x118(%rbp)
jmp    1493 <McbDoDES2+0x343>
cmpl   $0x0,0x10(%rbp)
jne    183c <McbDoDES2+0x6ec>
cmpl   $0x0,0x18(%rbp)
je     183c <McbDoDES2+0x6ec>
mov    -0x30(%rbp),%rax
mov    -0x120(%rbp),%rcx
sub    $0x1,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x109(%rbp)
movzbl -0x109(%rbp),%eax
cmp    $0x8,%eax
jg     1837 <McbDoDES2+0x6e7>
movb   $0x1,-0x10a(%rbp)
mov    -0x120(%rbp),%rax
sub    $0x2,%rax
mov    %rax,-0x130(%rbp)
mov    -0x130(%rbp),%rax
mov    -0x120(%rbp),%rcx
movzbl -0x109(%rbp),%edx
sub    %rdx,%rcx
cmp    %rcx,%rax
jbe    180f <McbDoDES2+0x6bf>
mov    -0x30(%rbp),%rax
mov    -0x130(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movzbl -0x109(%rbp),%ecx
cmp    %ecx,%eax
je     17f3 <McbDoDES2+0x6a3>
movb   $0x0,-0x10a(%rbp)
jmp    180f <McbDoDES2+0x6bf>
jmp    17f8 <McbDoDES2+0x6a8>
mov    -0x130(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x130(%rbp)
jmp    17a8 <McbDoDES2+0x658>
cmpb   $0x0,-0x10a(%rbp)
je     1832 <McbDoDES2+0x6e2>
movzbl -0x109(%rbp),%eax
mov    %eax,%edx
mov    -0x38(%rbp),%rax
mov    (%rax),%rcx
sub    %rdx,%rcx
mov    %rcx,(%rax)
jmp    1837 <McbDoDES2+0x6e7>
jmp    183c <McbDoDES2+0x6ec>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<McbDoDES2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
mov    %r9,%rbp
mov    %r8,%r12
mov    %rcx,%r15
mov    %rsi,%r13
mov    %rdi,0x18(%rsp)
mov    0x168(%rsp),%r14d
cmpl   $0x0,0x150(%rsp)
je     11ba <McbDoDES2+0x6a>
test   $0x7,%r13b
setne  %al
cmpl   $0x0,0x158(%rsp)
setne  %cl
or     %al,%cl
movzbl %cl,%ebx
shl    $0x3,%rbx
test   %r14d,%r14d
je     11cf <McbDoDES2+0x7f>
add    %r13,%rbx
add    $0x8,%rbx
and    $0xfffffffffffffff8,%rbx
lea    -0x8(%rbx),%rax
mov    %rax,0x20(%rsp)
jmp    11db <McbDoDES2+0x8b>
mov    %r14d,%eax
neg    %eax
sbb    %rax,%rax
lea    0x0(,%rax,8),%rbx
add    %r13,%rbx
jmp    11d2 <McbDoDES2+0x82>
add    %r13,%rbx
and    $0xfffffffffffffff8,%rbx
mov    %rbx,0x20(%rsp)
mov    0x0(%rbp),%rcx
mov    %rbx,0x0(%rbp)
xor    %eax,%eax
cmpq   $0x0,0x18(%rsp)
je     1592 <McbDoDES2+0x442>
test   %r12,%r12
je     1592 <McbDoDES2+0x442>
cmp    %rbx,%rcx
jb     1592 <McbDoDES2+0x442>
lea    0x50(%rsp),%rsi
mov    %rdx,%rdi
call   1040 <McbCreateSubKeys@plt>
cmpl   $0x2,0x160(%rsp)
02
jl     122a <McbDoDES2+0xda>
lea    0xb0(%rsp),%rsi
mov    %r15,%rdi
call   1040 <McbCreateSubKeys@plt>
test   %r14d,%r14d
mov    %rbp,0x38(%rsp)
mov    %rbx,0x40(%rsp)
je     1320 <McbDoDES2+0x1d0>
cmpl   $0x0,0x150(%rsp)
je     1520 <McbDoDES2+0x3d0>
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0xe(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0xf(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0x10(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0x11(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0x12(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0x13(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0x14(%rsp)
xor    %eax,%eax
call   1070 <rand@plt>
shr    $0x4,%eax
mov    %al,0x15(%rsp)
cmpl   $0x0,0x160(%rsp)
mov    0x160(%rsp),%r14d
je     1314 <McbDoDES2+0x1c4>
xor    %ebx,%ebx
lea    0xe(%rsp),%r15
mov    0x150(%rsp),%ebp
nopl   0x0(%rax,%rax,1)
mov    %ebx,%eax
and    $0x1,%eax
lea    (%rax,%rax,2),%rax
shl    $0x5,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x50,%rdx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebp,%ecx
call   1030 <McbEncode64Bits@plt>
xor    %eax,%eax
test   %ebp,%ebp
sete   %al
add    $0x1,%rbx
mov    %eax,%ebp
cmp    %rbx,%r14
jne    12e0 <McbDoDES2+0x190>
add    $0x8,%r12
mov    0x168(%rsp),%r14d
cmpq   $0x0,0x20(%rsp)
je     1536 <McbDoDES2+0x3e6>
cmpl   $0x0,0x150(%rsp)
setne  %al
test   %r14d,%r14d
setne  %cl
sete   %dl
and    %al,%cl
mov    %cl,0x17(%rsp)
or     %al,%dl
mov    %dl,0x16(%rsp)
xor    %ebp,%ebp
lea    0xe(%rsp),%rbx
mov    %r12,0x28(%rsp)
jmp    1378 <McbDoDES2+0x228>
nopw   0x0(%rax,%rax,1)
mov    0x48(%rsp),%r13
add    $0xfffffffffffffff8,%r13
add    $0x8,%rbp
cmp    0x20(%rsp),%rbp
jae    1536 <McbDoDES2+0x3e6>
test   %r13,%r13
je     13b0 <McbDoDES2+0x260>
cmp    $0x7,%r13
jg     13d0 <McbDoDES2+0x280>
lea    (%rsp,%r13,1),%rdi
add    $0xe,%rdi
mov    $0x8,%edx
sub    %r13d,%edx
mov    %edx,%esi
call   1050 <memset@plt>
mov    0x18(%rsp),%rax
lea    (%rax,%rbp,1),%rsi
mov    %rbx,%rdi
mov    %r13d,%edx
jmp    13e1 <McbDoDES2+0x291>
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x8,%esi
mov    $0x8,%edx
call   1050 <memset@plt>
jmp    13e6 <McbDoDES2+0x296>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x18(%rsp),%rax
lea    (%rax,%rbp,1),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1060 <memcpy@plt>
mov    %r13,0x48(%rsp)
cmpb   $0x0,0x17(%rsp)
je     143a <McbDoDES2+0x2ea>
mov    -0x8(%r12,%rbp,1),%al
xor    %al,0xe(%rsp)
mov    -0x7(%r12,%rbp,1),%al
xor    %al,0xf(%rsp)
mov    -0x6(%r12,%rbp,1),%al
xor    %al,0x10(%rsp)
mov    -0x5(%r12,%rbp,1),%al
xor    %al,0x11(%rsp)
mov    -0x4(%r12,%rbp,1),%al
xor    %al,0x12(%rsp)
mov    -0x3(%r12,%rbp,1),%al
xor    %al,0x13(%rsp)
mov    -0x2(%r12,%rbp,1),%al
xor    %al,0x14(%rsp)
mov    -0x1(%r12,%rbp,1),%al
xor    %al,0x15(%rsp)
mov    %rbp,0x30(%rsp)
cmpl   $0x0,0x160(%rsp)
mov    0x160(%rsp),%r15d
je     14ba <McbDoDES2+0x36a>
mov    0x28(%rsp),%rax
mov    0x30(%rsp),%rcx
lea    (%rax,%rcx,1),%rbp
mov    0x150(%rsp),%r12d
xor    %r13d,%r13d
nopw   0x0(%rax,%rax,1)
mov    %r13d,%eax
and    $0x1,%eax
lea    (%rax,%rax,2),%rax
shl    $0x5,%rax
lea    (%rsp,%rax,1),%rdx
add    $0x50,%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r12d,%ecx
call   1030 <McbEncode64Bits@plt>
xor    %r14d,%r14d
test   %r12d,%r12d
sete   %r14b
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x8,%edx
call   1060 <memcpy@plt>
add    $0x1,%r13
mov    %r14d,%r12d
cmp    %r13,%r15
jne    1470 <McbDoDES2+0x320>
cmpb   $0x0,0x16(%rsp)
mov    0x28(%rsp),%r12
mov    0x30(%rsp),%rbp
jne    1360 <McbDoDES2+0x210>
mov    0x18(%rsp),%rcx
mov    -0x8(%rcx,%rbp,1),%al
xor    %al,(%r12,%rbp,1)
mov    -0x7(%rcx,%rbp,1),%al
xor    %al,0x1(%r12,%rbp,1)
mov    -0x6(%rcx,%rbp,1),%al
xor    %al,0x2(%r12,%rbp,1)
mov    -0x5(%rcx,%rbp,1),%al
xor    %al,0x3(%r12,%rbp,1)
mov    -0x4(%rcx,%rbp,1),%al
xor    %al,0x4(%r12,%rbp,1)
mov    -0x3(%rcx,%rbp,1),%al
xor    %al,0x5(%r12,%rbp,1)
mov    -0x2(%rcx,%rbp,1),%al
xor    %al,0x6(%r12,%rbp,1)
mov    -0x1(%rcx,%rbp,1),%al
xor    %al,0x7(%r12,%rbp,1)
jmp    1360 <McbDoDES2+0x210>
addq   $0x8,0x18(%rsp)
add    $0xfffffffffffffff8,%r13
cmpq   $0x0,0x20(%rsp)
jne    132c <McbDoDES2+0x1dc>
mov    $0x1,%eax
cmpl   $0x0,0x150(%rsp)
jne    1592 <McbDoDES2+0x442>
cmpl   $0x0,0x158(%rsp)
je     1592 <McbDoDES2+0x442>
mov    0x40(%rsp),%rdi
movzbl -0x1(%rdi,%r12,1),%ecx
cmp    $0x8,%rcx
ja     1592 <McbDoDES2+0x442>
lea    -0x2(%rdi),%rdx
sub    %rcx,%rdi
cmp    %rdi,%rdx
mov    0x38(%rsp),%rsi
jbe    158f <McbDoDES2+0x43f>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %cl,(%r12,%rdx,1)
jne    1592 <McbDoDES2+0x442>
add    $0xffffffffffffffff,%rdx
cmp    %rdi,%rdx
ja     1580 <McbDoDES2+0x430>
sub    %rcx,(%rsi)
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @McbDoDES2(i8* %0, i64 %1, i8* %2, i8* %3, i8* %4, i64* %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i64*
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i8
%23 = alloca [2 x [16 x [6 x i8]]]
%24 = alloca [8 x i8]
%25 = alloca i8
%26 = alloca i8
%27 = alloca i64
%28 = alloca i64
%29 = alloca i64
%30 = alloca i64
%31 = alloca i64
%32 = alloca i32
%33 = alloca i8*
%34 = alloca i8*
store i8* %0, i8** %12
store i64 %1, i64* %13
store i8* %2, i8** %14
store i8* %3, i8** %15
store i8* %4, i8** %16
store i64* %5, i64** %17
store i32 %6, i32* %18
store i32 %7, i32* %19
store i32 %8, i32* %20
store i32 %9, i32* %21
%35 = load i32, i32* %18
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %80
37: ; preds = %10
%38 = load i32, i32* %21
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %60
40: ; preds = %37
%41 = load i64, i64* %13
%42 = udiv i64 %41, 8
%43 = load i64, i64* %13
%44 = urem i64 %43, 8
%45 = icmp ugt i64 %44, 0
br i1 %45, label %46, label %47
46: ; preds = %40
br label %52
47: ; preds = %40
%48 = load i32, i32* %19
%49 = icmp ne i32 %48, 0
%50 = zext i1 %49 to i64
%51 = select i1 %49, i32 1, i32 0
br label %52
52: ; preds = %47, %46
%53 = phi i32 [ 1, %46 ], [ %51, %47 ]
%54 = sext i32 %53 to i64
%55 = add i64 %42, %54
%56 = add i64 %55, 1
%57 = mul i64 %56, 8
store i64 %57, i64* %28
%58 = load i64, i64* %28
%59 = sub i64 %58, 8
store i64 %59, i64* %29
br label %79
60: ; preds = %37
%61 = load i64, i64* %13
%62 = udiv i64 %61, 8
%63 = load i64, i64* %13
%64 = urem i64 %63, 8
%65 = icmp ugt i64 %64, 0
br i1 %65, label %66, label %67
66: ; preds = %60
br label %72
67: ; preds = %60
%68 = load i32, i32* %19
%69 = icmp ne i32 %68, 0
%70 = zext i1 %69 to i64
%71 = select i1 %69, i32 1, i32 0
br label %72
72: ; preds = %67, %66
%73 = phi i32 [ 1, %66 ], [ %71, %67 ]
%74 = sext i32 %73 to i64
%75 = add i64 %62, %74
%76 = add i64 %75, 0
%77 = mul i64 %76, 8
store i64 %77, i64* %28
%78 = load i64, i64* %28
store i64 %78, i64* %29
br label %79
79: ; preds = %72, %52
br label %91
80: ; preds = %10
%81 = load i64, i64* %13
%82 = udiv i64 %81, 8
%83 = load i32, i32* %21
%84 = icmp ne i32 %83, 0
%85 = zext i1 %84 to i64
%86 = select i1 %84, i32 1, i32 0
%87 = sext i32 %86 to i64
%88 = sub i64 %82, %87
%89 = mul i64 %88, 8
store i64 %89, i64* %28
%90 = load i64, i64* %28
store i64 %90, i64* %29
br label %91
91: ; preds = %80, %79
%92 = load i64*, i64** %17
%93 = load i64, i64* %92
%94 = load i64, i64* %28
%95 = icmp ult i64 %93, %94
%96 = zext i1 %95 to i32
%97 = trunc i32 %96 to i8
store i8 %97, i8* %22
%98 = load i64, i64* %28
%99 = load i64*, i64** %17
store i64 %98, i64* %99
%100 = load i8*, i8** %16
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %109
102: ; preds = %91
%103 = load i8, i8* %22
%104 = zext i8 %103 to i32
%105 = icmp ne i32 %104, 0
br i1 %105, label %109, label %106
106: ; preds = %102
%107 = load i8*, i8** %12
%108 = icmp ne i8* %107, null
br i1 %108, label %110, label %109
109: ; preds = %106, %102, %91
store i32 0, i32* %11
br label %377
110: ; preds = %106
%111 = load i8*, i8** %14
%112 = getelementptr inbounds [2 x [16 x [6 x i8]]], [2 x [16 x [6 x i8]]]* %23, i64 0, i64 0
%113 = getelementptr inbounds [16 x [6 x i8]], [16 x [6 x i8]]* %112, i64 0, i64 0
%114 = bitcast [6 x i8]* %113 to i8**
%115 = call i32 @McbCreateSubKeys(i8* %111, i8** %114)
%116 = load i32, i32* %20
%117 = icmp sgt i32 %116, 1
br i1 %117, label %118, label %124
118: ; preds = %110
%119 = load i8*, i8** %15
%120 = getelementptr inbounds [2 x [16 x [6 x i8]]], [2 x [16 x [6 x i8]]]* %23, i64 0, i64 1
%121 = getelementptr inbounds [16 x [6 x i8]], [16 x [6 x i8]]* %120, i64 0, i64 0
%122 = bitcast [6 x i8]* %121 to i8**
%123 = call i32 @McbCreateSubKeys(i8* %119, i8** %122)
br label %124
124: ; preds = %118, %110
%125 = load i32, i32* %21
%126 = icmp ne i32 %125, 0
br i1 %126, label %127, label %181
127: ; preds = %124
%128 = load i32, i32* %18
%129 = icmp ne i32 %128, 0
br i1 %129, label %130, label %175
130: ; preds = %127
store i64 0, i64* %30
br label %131
131: ; preds = %141, %130
%132 = load i64, i64* %30
%133 = icmp ult i64 %132, 8
br i1 %133, label %134, label %144
134: ; preds = %131
%135 = call i32 (...) @rand()
%136 = ashr i32 %135, 4
%137 = srem i32 %136, 256
%138 = trunc i32 %137 to i8
%139 = load i64, i64* %30
%140 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 %139
store i8 %138, i8* %140
br label %141
141: ; preds = %134
%142 = load i64, i64* %30
%143 = add i64 %142, 1
store i64 %143, i64* %30
br label %131
144: ; preds = %131
%145 = load i32, i32* %18
store i32 %145, i32* %32
store i64 0, i64* %30
br label %146
146: ; preds = %169, %144
%147 = load i64, i64* %30
%148 = load i32, i32* %20
%149 = zext i32 %148 to i64
%150 = icmp ult i64 %147, %149
br i1 %150, label %151, label %172
151: ; preds = %146
%152 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%153 = load i8*, i8** %16
%154 = load i64, i64* %30
%155 = urem i64 %154, 2
%156 = icmp eq i64 %155, 0
%157 = zext i1 %156 to i64
%158 = select i1 %156, i32 0, i32 1
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds [2 x [16 x [6 x i8]]], [2 x [16 x [6 x i8]]]* %23, i64 0, i64 %159
%161 = getelementptr inbounds [16 x [6 x i8]], [16 x [6 x i8]]* %160, i64 0, i64 0
%162 = bitcast [6 x i8]* %161 to i8**
%163 = load i32, i32* %32
%164 = call i32 @McbEncode64Bits(i8* %152, i8* %153, i8** %162, i32 %163)
%165 = load i32, i32* %32
%166 = icmp ne i32 %165, 0
%167 = xor i1 %166, true
%168 = zext i1 %167 to i32
store i32 %168, i32* %32
br label %169
169: ; preds = %151
%170 = load i64, i64* %30
%171 = add i64 %170, 1
store i64 %171, i64* %30
br label %146
172: ; preds = %146
%173 = load i8*, i8** %16
%174 = getelementptr inbounds i8, i8* %173, i64 8
store i8* %174, i8** %16
br label %180
175: ; preds = %127
%176 = load i8*, i8** %12
%177 = getelementptr inbounds i8, i8* %176, i64 8
store i8* %177, i8** %12
%178 = load i64, i64* %13
%179 = sub i64 %178, 8
store i64 %179, i64* %13
br label %180
180: ; preds = %175, %172
br label %181
181: ; preds = %180, %124
store i64 0, i64* %27
%182 = load i64, i64* %13
store i64 %182, i64* %31
store i64 0, i64* %27
br label %183
183: ; preds = %323, %181
%184 = load i64, i64* %27
%185 = load i64, i64* %29
%186 = icmp ult i64 %184, %185
br i1 %186, label %187, label %326
187: ; preds = %183
%188 = load i64, i64* %31
%189 = icmp eq i64 %188, 0
br i1 %189, label %190, label %193
190: ; preds = %187
%191 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%192 = call i32 @memset(i8* %191, i32 8, i32 8)
br label %221
193: ; preds = %187
%194 = load i64, i64* %31
%195 = icmp slt i64 %194, 8
br i1 %195, label %196, label %214
196: ; preds = %193
%197 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%198 = load i64, i64* %31
%199 = getelementptr inbounds i8, i8* %197, i64 %198
%200 = load i64, i64* %31
%201 = sub nsw i64 8, %200
%202 = trunc i64 %201 to i32
%203 = load i64, i64* %31
%204 = sub nsw i64 8, %203
%205 = trunc i64 %204 to i32
%206 = call i32 @memset(i8* %199, i32 %202, i32 %205)
%207 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%208 = load i8*, i8** %12
%209 = load i64, i64* %27
%210 = getelementptr inbounds i8, i8* %208, i64 %209
%211 = load i64, i64* %31
%212 = trunc i64 %211 to i32
%213 = call i32 @memcpy(i8* %207, i8* %210, i32 %212)
br label %220
214: ; preds = %193
%215 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%216 = load i8*, i8** %12
%217 = load i64, i64* %27
%218 = getelementptr inbounds i8, i8* %216, i64 %217
%219 = call i32 @memcpy(i8* %215, i8* %218, i32 8)
br label %220
220: ; preds = %214, %196
br label %221
221: ; preds = %220, %190
%222 = load i32, i32* %21
%223 = icmp ne i32 %222, 0
br i1 %223, label %224, label %251
224: ; preds = %221
%225 = load i32, i32* %18
%226 = icmp ne i32 %225, 0
br i1 %226, label %227, label %251
227: ; preds = %224
%228 = load i8*, i8** %16
%229 = load i64, i64* %27
%230 = getelementptr inbounds i8, i8* %228, i64 %229
%231 = getelementptr inbounds i8, i8* %230, i64 -8
store i8* %231, i8** %33
store i64 0, i64* %30
br label %232
232: ; preds = %247, %227
%233 = load i64, i64* %30
%234 = icmp ult i64 %233, 8
br i1 %234, label %235, label %250
235: ; preds = %232
%236 = load i8*, i8** %33
%237 = load i64, i64* %30
%238 = getelementptr inbounds i8, i8* %236, i64 %237
%239 = load i8, i8* %238
%240 = zext i8 %239 to i32
%241 = load i64, i64* %30
%242 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 %241
%243 = load i8, i8* %242
%244 = zext i8 %243 to i32
%245 = xor i32 %244, %240
%246 = trunc i32 %245 to i8
store i8 %246, i8* %242
br label %247
247: ; preds = %235
%248 = load i64, i64* %30
%249 = add i64 %248, 1
store i64 %249, i64* %30
br label %232
250: ; preds = %232
br label %251
251: ; preds = %250, %224, %221
%252 = load i32, i32* %18
store i32 %252, i32* %32
store i64 0, i64* %30
br label %253
253: ; preds = %283, %251
%254 = load i64, i64* %30
%255 = load i32, i32* %20
%256 = zext i32 %255 to i64
%257 = icmp ult i64 %254, %256
br i1 %257, label %258, label %286
258: ; preds = %253
%259 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%260 = load i8*, i8** %16
%261 = load i64, i64* %27
%262 = getelementptr inbounds i8, i8* %260, i64 %261
%263 = load i64, i64* %30
%264 = urem i64 %263, 2
%265 = icmp eq i64 %264, 0
%266 = zext i1 %265 to i64
%267 = select i1 %265, i32 0, i32 1
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds [2 x [16 x [6 x i8]]], [2 x [16 x [6 x i8]]]* %23, i64 0, i64 %268
%270 = getelementptr inbounds [16 x [6 x i8]], [16 x [6 x i8]]* %269, i64 0, i64 0
%271 = bitcast [6 x i8]* %270 to i8**
%272 = load i32, i32* %32
%273 = call i32 @McbEncode64Bits(i8* %259, i8* %262, i8** %271, i32 %272)
%274 = load i32, i32* %32
%275 = icmp ne i32 %274, 0
%276 = xor i1 %275, true
%277 = zext i1 %276 to i32
store i32 %277, i32* %32
%278 = getelementptr inbounds [8 x i8], [8 x i8]* %24, i64 0, i64 0
%279 = load i8*, i8** %16
%280 = load i64, i64* %27
%281 = getelementptr inbounds i8, i8* %279, i64 %280
%282 = call i32 @memcpy(i8* %278, i8* %281, i32 8)
br label %283
283: ; preds = %258
%284 = load i64, i64* %30
%285 = add i64 %284, 1
store i64 %285, i64* %30
br label %253
286: ; preds = %253
%287 = load i32, i32* %21
%288 = icmp ne i32 %287, 0
br i1 %288, label %289, label %320
289: ; preds = %286
%290 = load i32, i32* %18
%291 = icmp ne i32 %290, 0
br i1 %291, label %320, label %292
292: ; preds = %289
%293 = load i8*, i8** %12
%294 = load i64, i64* %27
%295 = getelementptr inbounds i8, i8* %293, i64 %294
%296 = getelementptr inbounds i8, i8* %295, i64 -8
store i8* %296, i8** %33
%297 = load i8*, i8** %16
%298 = load i64, i64* %27
%299 = getelementptr inbounds i8, i8* %297, i64 %298
store i8* %299, i8** %34
store i64 0, i64* %30
br label %300
300: ; preds = %316, %292
%301 = load i64, i64* %30
%302 = icmp ult i64 %301, 8
br i1 %302, label %303, label %319
303: ; preds = %300
%304 = load i8*, i8** %33
%305 = load i64, i64* %30
%306 = getelementptr inbounds i8, i8* %304, i64 %305
%307 = load i8, i8* %306
%308 = zext i8 %307 to i32
%309 = load i8*, i8** %34
%310 = load i64, i64* %30
%311 = getelementptr inbounds i8, i8* %309, i64 %310
%312 = load i8, i8* %311
%313 = zext i8 %312 to i32
%314 = xor i32 %313, %308
%315 = trunc i32 %314 to i8
store i8 %315, i8* %311
br label %316
316: ; preds = %303
%317 = load i64, i64* %30
%318 = add i64 %317, 1
store i64 %318, i64* %30
br label %300
319: ; preds = %300
br label %320
320: ; preds = %319, %289, %286
%321 = load i64, i64* %31
%322 = sub nsw i64 %321, 8
store i64 %322, i64* %31
br label %323
323: ; preds = %320
%324 = load i64, i64* %27
%325 = add i64 %324, 8
store i64 %325, i64* %27
br label %183
326: ; preds = %183
%327 = load i32, i32* %18
%328 = icmp ne i32 %327, 0
br i1 %328, label %376, label %329
329: ; preds = %326
%330 = load i32, i32* %19
%331 = icmp ne i32 %330, 0
br i1 %331, label %332, label %376
332: ; preds = %329
%333 = load i8*, i8** %16
%334 = load i64, i64* %28
%335 = sub i64 %334, 1
%336 = getelementptr inbounds i8, i8* %333, i64 %335
%337 = load i8, i8* %336
store i8 %337, i8* %25
%338 = load i8, i8* %25
%339 = zext i8 %338 to i32
%340 = icmp sle i32 %339, 8
br i1 %340, label %341, label %375
341: ; preds = %332
store i8 1, i8* %26
%342 = load i64, i64* %28
%343 = sub i64 %342, 2
store i64 %343, i64* %30
br label %344
344: ; preds = %362, %341
%345 = load i64, i64* %30
%346 = load i64, i64* %28
%347 = load i8, i8* %25
%348 = zext i8 %347 to i64
%349 = sub i64 %346, %348
%350 = icmp ugt i64 %345, %349
br i1 %350, label %351, label %365
351: ; preds = %344
%352 = load i8*, i8** %16
%353 = load i64, i64* %30
%354 = getelementptr inbounds i8, i8* %352, i64 %353
%355 = load i8, i8* %354
%356 = zext i8 %355 to i32
%357 = load i8, i8* %25
%358 = zext i8 %357 to i32
%359 = icmp ne i32 %356, %358
br i1 %359, label %360, label %361
360: ; preds = %351
store i8 0, i8* %26
br label %365
361: ; preds = %351
br label %362
362: ; preds = %361
%363 = load i64, i64* %30
%364 = add i64 %363, -1
store i64 %364, i64* %30
br label %344
365: ; preds = %360, %344
%366 = load i8, i8* %26
%367 = icmp ne i8 %366, 0
br i1 %367, label %368, label %374
368: ; preds = %365
%369 = load i8, i8* %25
%370 = zext i8 %369 to i64
%371 = load i64*, i64** %17
%372 = load i64, i64* %371
%373 = sub i64 %372, %370
store i64 %373, i64* %371
br label %374
374: ; preds = %368, %365
br label %375
375: ; preds = %374, %332
br label %376
376: ; preds = %375, %329, %326
store i32 1, i32* %11
br label %377
377: ; preds = %376, %109
%378 = load i32, i32* %11
ret i32 %378
}

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