#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 */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ memcpy(int *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *md5(char *initial_msg, size_t initial_len) {
  uint8_t *msg = NULL;
  uint32_t r[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
                  5, 9,  14, 20, 5, 9,  14, 20, 5, 9,  14, 20, 5, 9,  14, 20,
                  4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
                  6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};
  uint32_t k[] = {
      0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a,
      0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
      0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340,
      0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
      0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8,
      0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
      0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa,
      0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
      0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92,
      0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
      0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391};
  uint32_t h0 = 0x67452301;
  uint32_t h1 = 0xefcdab89;
  uint32_t h2 = 0x98badcfe;
  uint32_t h3 = 0x10325476;
  int new_len;
  for (new_len = initial_len * 8 + 1; new_len % 512 != 448; new_len++)
    ;
  new_len /= 8;
  msg = calloc(new_len + 64, 1);
  memcpy(msg, initial_msg, initial_len);
  msg[initial_len] = 128;
  uint32_t bits_len = 8 * initial_len;
  memcpy(msg + new_len, &bits_len, 4);
  int offset;
  for (offset = 0; offset < new_len; offset += (512 / 8)) {
    uint32_t *w = (uint32_t *)(msg + offset);
    uint32_t a = h0;
    uint32_t b = h1;
    uint32_t c = h2;
    uint32_t d = h3;
    uint32_t i;
    for (i = 0; i < 64; i++) {
      uint32_t f, g;
      if (i < 16) {
        f = (b & c) | ((~b) & d);
        g = i;
      } else if (i < 32) {
        f = (d & b) | ((~d) & c);
        g = (5 * i + 1) % 16;
      } else if (i < 48) {
        f = b ^ c ^ d;
        g = (3 * i + 5) % 16;
      } else {
        f = c ^ (b | (~d));
        g = (7 * i) % 16;
      }
      uint32_t temp = d;
      d = c;
      c = b;
      b = b + ((((a + f + k[i] + w[g])) << (r[i])) |
               (((a + f + k[i] + w[g])) >> (32 - (r[i]))));
      a = temp;
    }
    h0 += a;
    h1 += b;
    h2 += c;
    h3 += d;
  }
  free(msg);
  char *output = calloc(33, 1);
  uint8_t *p = (uint8_t *)&h0;
  sprintf(output, "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  p = (uint8_t *)&h1;
  sprintf(&output[8], "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  p = (uint8_t *)&h2;
  sprintf(&output[16], "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  p = (uint8_t *)&h3;
  sprintf(&output[24], "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  output[32] = '\0';
  return output;
}


x86 assembly (clang, -O0):
<md5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x120(%rbp),%rdi
lea    0xe97(%rip),%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
lea    -0x220(%rbp),%rdi
lea    0xf7f(%rip),%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
movl   $0x67452301,-0x224(%rbp)
23 45 67
movl   $0xefcdab89,-0x228(%rbp)
ab cd ef
movl   $0x98badcfe,-0x22c(%rbp)
dc ba 98
movl   $0x10325476,-0x230(%rbp)
54 32 10
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    $0x1,%rax
mov    %eax,-0x234(%rbp)
mov    -0x234(%rbp),%eax
mov    $0x200,%ecx
cltd
idiv   %ecx
cmp    $0x1c0,%edx
je     11f8 <md5+0xb8>
jmp    11e4 <md5+0xa4>
mov    -0x234(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x234(%rbp)
jmp    11c5 <md5+0x85>
mov    -0x234(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,-0x234(%rbp)
mov    -0x234(%rbp),%edi
add    $0x40,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %eax,%eax
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movl   $0x80,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,-0x238(%rbp)
mov    -0x18(%rbp),%rdi
movslq -0x234(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
xor    %eax,%eax
lea    -0x238(%rbp),%rsi
mov    $0x4,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x23c(%rbp)
mov    -0x23c(%rbp),%eax
cmp    -0x234(%rbp),%eax
jge    1539 <md5+0x3f9>
mov    -0x18(%rbp),%rax
movslq -0x23c(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x248(%rbp)
mov    -0x224(%rbp),%eax
mov    %eax,-0x24c(%rbp)
mov    -0x228(%rbp),%eax
mov    %eax,-0x250(%rbp)
mov    -0x22c(%rbp),%eax
mov    %eax,-0x254(%rbp)
mov    -0x230(%rbp),%eax
mov    %eax,-0x258(%rbp)
movl   $0x0,-0x25c(%rbp)
cmpl   $0x40,-0x25c(%rbp)
jge    14dd <md5+0x39d>
cmpl   $0x10,-0x25c(%rbp)
jge    1335 <md5+0x1f5>
mov    -0x250(%rbp),%eax
and    -0x254(%rbp),%eax
mov    -0x250(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x258(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x260(%rbp)
mov    -0x25c(%rbp),%eax
mov    %eax,-0x264(%rbp)
jmp    1402 <md5+0x2c2>
cmpl   $0x20,-0x25c(%rbp)
jge    1382 <md5+0x242>
mov    -0x258(%rbp),%eax
and    -0x250(%rbp),%eax
mov    -0x258(%rbp),%ecx
xor    $0xffffffff,%ecx
and    -0x254(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x260(%rbp)
imul   $0x5,-0x25c(%rbp),%eax
add    $0x1,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x264(%rbp)
jmp    13fd <md5+0x2bd>
cmpl   $0x30,-0x25c(%rbp)
jge    13c4 <md5+0x284>
mov    -0x250(%rbp),%eax
xor    -0x254(%rbp),%eax
xor    -0x258(%rbp),%eax
mov    %eax,-0x260(%rbp)
imul   $0x3,-0x25c(%rbp),%eax
add    $0x5,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x264(%rbp)
jmp    13f8 <md5+0x2b8>
mov    -0x254(%rbp),%eax
mov    -0x250(%rbp),%ecx
mov    -0x258(%rbp),%edx
xor    $0xffffffff,%edx
or     %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x260(%rbp)
imul   $0x7,-0x25c(%rbp),%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
mov    %edx,-0x264(%rbp)
jmp    13fd <md5+0x2bd>
jmp    1402 <md5+0x2c2>
mov    -0x258(%rbp),%eax
mov    %eax,-0x268(%rbp)
mov    -0x254(%rbp),%eax
mov    %eax,-0x258(%rbp)
mov    -0x250(%rbp),%eax
mov    %eax,-0x254(%rbp)
mov    -0x250(%rbp),%eax
mov    -0x24c(%rbp),%edx
add    -0x260(%rbp),%edx
movslq -0x25c(%rbp),%rcx
add    -0x220(%rbp,%rcx,4),%edx
mov    -0x248(%rbp),%rcx
movslq -0x264(%rbp),%rsi
add    (%rcx,%rsi,4),%edx
movslq -0x25c(%rbp),%rcx
mov    -0x120(%rbp,%rcx,4),%ecx
shl    %cl,%edx
mov    %edx,-0x27c(%rbp)
mov    -0x24c(%rbp),%edx
add    -0x260(%rbp),%edx
movslq -0x25c(%rbp),%rcx
add    -0x220(%rbp,%rcx,4),%edx
mov    -0x248(%rbp),%rcx
movslq -0x264(%rbp),%rsi
add    (%rcx,%rsi,4),%edx
movslq -0x25c(%rbp),%rsi
mov    $0x20,%ecx
sub    -0x120(%rbp,%rsi,4),%ecx
sar    %cl,%edx
mov    -0x27c(%rbp),%ecx
or     %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x250(%rbp)
mov    -0x268(%rbp),%eax
mov    %eax,-0x24c(%rbp)
mov    -0x25c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x25c(%rbp)
jmp    12e7 <md5+0x1a7>
mov    -0x24c(%rbp),%eax
add    -0x224(%rbp),%eax
mov    %eax,-0x224(%rbp)
mov    -0x250(%rbp),%eax
add    -0x228(%rbp),%eax
mov    %eax,-0x228(%rbp)
mov    -0x254(%rbp),%eax
add    -0x22c(%rbp),%eax
mov    %eax,-0x22c(%rbp)
mov    -0x258(%rbp),%eax
add    -0x230(%rbp),%eax
mov    %eax,-0x230(%rbp)
mov    -0x23c(%rbp),%eax
add    $0x40,%eax
mov    %eax,-0x23c(%rbp)
jmp    1282 <md5+0x142>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,-0x270(%rbp)
lea    -0x224(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x270(%rbp),%rdi
mov    -0x278(%rbp),%rax
mov    (%rax),%edx
mov    -0x278(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x278(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x278(%rbp),%rax
mov    0xc(%rax),%r9d
lea    0xc63(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x228(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x270(%rbp),%rdi
add    $0x8,%rdi
mov    -0x278(%rbp),%rax
mov    (%rax),%edx
mov    -0x278(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x278(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x278(%rbp),%rax
mov    0xc(%rax),%r9d
lea    0xc15(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x22c(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x270(%rbp),%rdi
add    $0x10,%rdi
mov    -0x278(%rbp),%rax
mov    (%rax),%edx
mov    -0x278(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x278(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x278(%rbp),%rax
mov    0xc(%rax),%r9d
lea    0xbc7(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x230(%rbp),%rax
mov    %rax,-0x278(%rbp)
mov    -0x270(%rbp),%rdi
add    $0x18,%rdi
mov    -0x278(%rbp),%rax
mov    (%rax),%edx
mov    -0x278(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x278(%rbp),%rax
mov    0x8(%rax),%r8d
mov    -0x278(%rbp),%rax
mov    0xc(%rax),%r9d
lea    0xb79(%rip),%rsi
call   1060 <sprintf@plt>
mov    -0x270(%rbp),%rax
movb   $0x0,0x20(%rax)
mov    -0x270(%rbp),%rax
add    $0x280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r12
mov    %rdi,%r14
lea    0x0(,%rsi,8),%r15d
mov    %r15d,%ebp
nop
mov    %ebp,%eax
lea    0x1(%rax),%ebp
lea    0x200(%rax),%ecx
test   %ebp,%ebp
cmovns %ebp,%ecx
and    $0xfffffe00,%ecx
neg    %ecx
add    %ecx,%eax
add    $0x1,%eax
cmp    $0x1c0,%eax
jne    1160 <md5+0x20>
lea    0x7(%rbp),%ebx
test   %ebp,%ebp
cmovns %ebp,%ebx
sar    $0x3,%ebx
lea    0x40(%rbx),%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%r13
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <memcpy@plt>
movl   $0x80,0x0(%r13,%r12,4)
mov    %r15d,0x1c(%rsp)
movslq %ebx,%rax
mov    %r13,0x20(%rsp)
mov    %rax,0x28(%rsp)
lea    0x0(,%rax,4),%rdi
add    %r13,%rdi
lea    0x1c(%rsp),%rsi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <memcpy@plt>
cmp    $0x8,%ebp
jl     1339 <md5+0x1f9>
mov    $0x67452301,%r14d
mov    $0xefcdab89,%ecx
mov    $0x98badcfe,%r13d
mov    $0x10325476,%ebx
xor    %edx,%edx
lea    0xef2(%rip),%r9
lea    0xdeb(%rip),%r10
jmp    1253 <md5+0x113>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
add    %r14d,%eax
mov    %eax,%r14d
mov    0x10(%rsp),%ecx
add    %r15d,%ecx
mov    0x14(%rsp),%r13d
add    %r8d,%r13d
mov    0x18(%rsp),%ebx
add    %esi,%ebx
mov    0x30(%rsp),%rdx
add    $0x40,%rdx
cmp    0x28(%rsp),%rdx
jge    134f <md5+0x20f>
mov    0x20(%rsp),%rax
mov    %rdx,0x30(%rsp)
lea    (%rax,%rdx,4),%r11
mov    $0x1,%r12d
mov    $0x5,%ebp
xor    %eax,%eax
xor    %edx,%edx
xor    %edi,%edi
mov    %ebx,0x18(%rsp)
mov    %r13d,0x14(%rsp)
mov    %ecx,0x10(%rsp)
mov    %ecx,%r15d
mov    %r14d,0xc(%rsp)
jmp    12e2 <md5+0x1a2>
nopl   0x0(%rax)
mov    %esi,%r15d
xor    %r14d,%r15d
and    %r8d,%r15d
xor    %r14d,%r15d
mov    %rdi,%rbx
add    %ecx,%r15d
add    (%rax,%r9,1),%r15d
add    (%r11,%rbx,4),%r15d
movzbl (%rax,%r10,1),%ecx
mov    %r15d,%ebx
shl    %cl,%ebx
neg    %cl
sar    %cl,%r15d
or     %ebx,%r15d
add    %r8d,%r15d
add    $0x1,%rdi
add    $0x7,%rdx
add    $0x5,%r12
add    $0x3,%rbp
add    $0x4,%rax
mov    %esi,%ebx
mov    %r8d,%r13d
cmp    $0x40,%rdi
je     1220 <md5+0xe0>
mov    %r14d,%ecx
mov    %r15d,%r8d
mov    %r13d,%esi
mov    %ebx,%r14d
cmp    $0xf,%rdi
jbe    1290 <md5+0x150>
cmp    $0x1f,%rdi
ja     1310 <md5+0x1d0>
mov    %r8d,%r15d
xor    %esi,%r15d
and    %r14d,%r15d
xor    %esi,%r15d
mov    %r12d,%ebx
jmp    1331 <md5+0x1f1>
nopl   0x0(%rax,%rax,1)
cmp    $0x2f,%rdi
ja     1323 <md5+0x1e3>
mov    %esi,%r15d
xor    %r8d,%r15d
xor    %r14d,%r15d
mov    %ebp,%ebx
jmp    1331 <md5+0x1f1>
mov    %r14d,%r15d
not    %r15d
or     %r8d,%r15d
xor    %esi,%r15d
mov    %edx,%ebx
and    $0xf,%ebx
jmp    129f <md5+0x15f>
mov    $0x10325476,%ebx
mov    $0x98badcfe,%r13d
mov    $0xefcdab89,%ecx
mov    $0x67452301,%r14d
mov    0x20(%rsp),%rdi
mov    %ecx,%r12d
call   1030 <free@plt>
mov    $0x21,%edi
mov    $0x1,%esi
call   1040 <calloc@plt>
mov    %rax,%rbp
mov    %r14d,%edx
lea    0xe88(%rip),%r14
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <sprintf@plt>
lea    0x8(%rbp),%rdi
mov    %r14,%rsi
mov    %r12d,%edx
call   1060 <sprintf@plt>
lea    0x10(%rbp),%rdi
mov    %r14,%rsi
mov    %r13d,%edx
call   1060 <sprintf@plt>
lea    0x18(%rbp),%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1060 <sprintf@plt>
movb   $0x0,0x20(%rbp)
mov    %rbp,%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.md5.r = [64 x i32] [i32 7, i32 12, i32 17, i32 22, i32 7, i32 12, i32 17, i32 22, i32 7, i32 12, i32 17, i32 22, i32 7, i32 12, i32 17, i32 22, i32 5, i32 9, i32 14, i32 20, i32 5, i32 9, i32 14, i32 20, i32 5, i32 9, i32 14, i32 20, i32 5, i32 9, i32 14, i32 20, i32 4, i32 11, i32 16, i32 23, i32 4, i32 11, i32 16, i32 23, i32 4, i32 11, i32 16, i32 23, i32 4, i32 11, i32 16, i32 23, i32 6, i32 10, i32 15, i32 21, i32 6, i32 10, i32 15, i32 21, i32 6, i32 10, i32 15, i32 21, i32 6, i32 10, i32 15, i32 21]
@__const.md5.k = [64 x i32] [i32 -680876936, i32 -389564586, i32 606105819, i32 -1044525330, i32 -176418897, i32 1200080426, i32 -1473231341, i32 -45705983, i32 1770035416, i32 -1958414417, i32 -42063, i32 -1990404162, i32 1804603682, i32 -40341101, i32 -1502002290, i32 1236535329, i32 -165796510, i32 -1069501632, i32 643717713, i32 -373897302, i32 -701558691, i32 38016083, i32 -660478335, i32 -405537848, i32 568446438, i32 -1019803690, i32 -187363961, i32 1163531501, i32 -1444681467, i32 -51403784, i32 1735328473, i32 -1926607734, i32 -378558, i32 -2022574463, i32 1839030562, i32 -35309556, i32 -1530992060, i32 1272893353, i32 -155497632, i32 -1094730640, i32 681279174, i32 -358537222, i32 -722521979, i32 76029189, i32 -640364487, i32 -421815835, i32 530742520, i32 -995338651, i32 -198630844, i32 1126891415, i32 -1416354905, i32 -57434055, i32 1700485571, i32 -1894986606, i32 -1051523, i32 -2054922799, i32 1873313359, i32 -30611744, i32 -1560198380, i32 1309151649, i32 -145523070, i32 -1120210379, i32 718787259, i32 -343485551]
@.str = [21 x i8] c"%2.2x%2.2x%2.2x%2.2x\00"
define i8* @md5(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
%6 = alloca [64 x i32]
%7 = alloca [64 x i32]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i8*
%25 = alloca i32*
store i8* %0, i8** %3
store i64 %1, i64* %4
store i32* null, i32** %5
%26 = bitcast [64 x i32]* %6 to i8*
%27 = bitcast [64 x i32]* %7 to i8*
store i32 1732584193, i32* %8
store i32 -271733879, i32* %9
store i32 -1732584194, i32* %10
store i32 271733878, i32* %11
%28 = load i64, i64* %4
%29 = mul i64 %28, 8
%30 = add i64 %29, 1
%31 = trunc i64 %30 to i32
store i32 %31, i32* %12
br label %32
32: ; preds = %37, %2
%33 = load i32, i32* %12
%34 = srem i32 %33, 512
%35 = icmp ne i32 %34, 448
br i1 %35, label %36, label %40
36: ; preds = %32
br label %37
37: ; preds = %36
%38 = load i32, i32* %12
%39 = add nsw i32 %38, 1
store i32 %39, i32* %12
br label %32
40: ; preds = %32
%41 = load i32, i32* %12
%42 = sdiv i32 %41, 8
store i32 %42, i32* %12
%43 = load i32, i32* %12
%44 = add nsw i32 %43, 64
%45 = call i8* @calloc(i32 %44, i32 1)
%46 = bitcast i8* %45 to i32*
store i32* %46, i32** %5
%47 = load i32*, i32** %5
%48 = load i8*, i8** %3
%49 = load i64, i64* %4
%50 = call i32 (i32*, ...) @memcpy(i32* %47, i8* %48, i64 %49)
%51 = load i32*, i32** %5
%52 = load i64, i64* %4
%53 = getelementptr inbounds i32, i32* %51, i64 %52
store i32 128, i32* %53
%54 = load i64, i64* %4
%55 = mul i64 8, %54
%56 = trunc i64 %55 to i32
store i32 %56, i32* %13
%57 = load i32*, i32** %5
%58 = load i32, i32* %12
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds i32, i32* %57, i64 %59
%61 = call i32 (i32*, ...) @memcpy(i32* %60, i32* %13, i32 4)
store i32 0, i32* %14
br label %62
62: ; preds = %195, %40
%63 = load i32, i32* %14
%64 = load i32, i32* %12
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %198
66: ; preds = %62
%67 = load i32*, i32** %5
%68 = load i32, i32* %14
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %67, i64 %69
store i32* %70, i32** %15
%71 = load i32, i32* %8
store i32 %71, i32* %16
%72 = load i32, i32* %9
store i32 %72, i32* %17
%73 = load i32, i32* %10
store i32 %73, i32* %18
%74 = load i32, i32* %11
store i32 %74, i32* %19
store i32 0, i32* %20
br label %75
75: ; preds = %179, %66
%76 = load i32, i32* %20
%77 = icmp slt i32 %76, 64
br i1 %77, label %78, label %182
78: ; preds = %75
%79 = load i32, i32* %20
%80 = icmp slt i32 %79, 16
br i1 %80, label %81, label %91
81: ; preds = %78
%82 = load i32, i32* %17
%83 = load i32, i32* %18
%84 = and i32 %82, %83
%85 = load i32, i32* %17
%86 = xor i32 %85, -1
%87 = load i32, i32* %19
%88 = and i32 %86, %87
%89 = or i32 %84, %88
store i32 %89, i32* %21
%90 = load i32, i32* %20
store i32 %90, i32* %22
br label %132
91: ; preds = %78
%92 = load i32, i32* %20
%93 = icmp slt i32 %92, 32
br i1 %93, label %94, label %107
94: ; preds = %91
%95 = load i32, i32* %19
%96 = load i32, i32* %17
%97 = and i32 %95, %96
%98 = load i32, i32* %19
%99 = xor i32 %98, -1
%100 = load i32, i32* %18
%101 = and i32 %99, %100
%102 = or i32 %97, %101
store i32 %102, i32* %21
%103 = load i32, i32* %20
%104 = mul nsw i32 5, %103
%105 = add nsw i32 %104, 1
%106 = srem i32 %105, 16
store i32 %106, i32* %22
br label %131
107: ; preds = %91
%108 = load i32, i32* %20
%109 = icmp slt i32 %108, 48
br i1 %109, label %110, label %120
110: ; preds = %107
%111 = load i32, i32* %17
%112 = load i32, i32* %18
%113 = xor i32 %111, %112
%114 = load i32, i32* %19
%115 = xor i32 %113, %114
store i32 %115, i32* %21
%116 = load i32, i32* %20
%117 = mul nsw i32 3, %116
%118 = add nsw i32 %117, 5
%119 = srem i32 %118, 16
store i32 %119, i32* %22
br label %130
120: ; preds = %107
%121 = load i32, i32* %18
%122 = load i32, i32* %17
%123 = load i32, i32* %19
%124 = xor i32 %123, -1
%125 = or i32 %122, %124
%126 = xor i32 %121, %125
store i32 %126, i32* %21
%127 = load i32, i32* %20
%128 = mul nsw i32 7, %127
%129 = srem i32 %128, 16
store i32 %129, i32* %22
br label %130
130: ; preds = %120, %110
br label %131
131: ; preds = %130, %94
br label %132
132: ; preds = %131, %81
%133 = load i32, i32* %19
store i32 %133, i32* %23
%134 = load i32, i32* %18
store i32 %134, i32* %19
%135 = load i32, i32* %17
store i32 %135, i32* %18
%136 = load i32, i32* %17
%137 = load i32, i32* %16
%138 = load i32, i32* %21
%139 = add nsw i32 %137, %138
%140 = load i32, i32* %20
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [64 x i32], [64 x i32]* %7, i64 0, i64 %141
%143 = load i32, i32* %142
%144 = add nsw i32 %139, %143
%145 = load i32*, i32** %15
%146 = load i32, i32* %22
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds i32, i32* %145, i64 %147
%149 = load i32, i32* %148
%150 = add nsw i32 %144, %149
%151 = load i32, i32* %20
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds [64 x i32], [64 x i32]* %6, i64 0, i64 %152
%154 = load i32, i32* %153
%155 = shl i32 %150, %154
%156 = load i32, i32* %16
%157 = load i32, i32* %21
%158 = add nsw i32 %156, %157
%159 = load i32, i32* %20
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds [64 x i32], [64 x i32]* %7, i64 0, i64 %160
%162 = load i32, i32* %161
%163 = add nsw i32 %158, %162
%164 = load i32*, i32** %15
%165 = load i32, i32* %22
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i32, i32* %164, i64 %166
%168 = load i32, i32* %167
%169 = add nsw i32 %163, %168
%170 = load i32, i32* %20
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [64 x i32], [64 x i32]* %6, i64 0, i64 %171
%173 = load i32, i32* %172
%174 = sub nsw i32 32, %173
%175 = ashr i32 %169, %174
%176 = or i32 %155, %175
%177 = add nsw i32 %136, %176
store i32 %177, i32* %17
%178 = load i32, i32* %23
store i32 %178, i32* %16
br label %179
179: ; preds = %132
%180 = load i32, i32* %20
%181 = add nsw i32 %180, 1
store i32 %181, i32* %20
br label %75
182: ; preds = %75
%183 = load i32, i32* %16
%184 = load i32, i32* %8
%185 = add nsw i32 %184, %183
store i32 %185, i32* %8
%186 = load i32, i32* %17
%187 = load i32, i32* %9
%188 = add nsw i32 %187, %186
store i32 %188, i32* %9
%189 = load i32, i32* %18
%190 = load i32, i32* %10
%191 = add nsw i32 %190, %189
store i32 %191, i32* %10
%192 = load i32, i32* %19
%193 = load i32, i32* %11
%194 = add nsw i32 %193, %192
store i32 %194, i32* %11
br label %195
195: ; preds = %182
%196 = load i32, i32* %14
%197 = add nsw i32 %196, 64
store i32 %197, i32* %14
br label %62
198: ; preds = %62
%199 = load i32*, i32** %5
%200 = call i32 @free(i32* %199)
%201 = call i8* @calloc(i32 33, i32 1)
store i8* %201, i8** %24
store i32* %8, i32** %25
%202 = load i8*, i8** %24
%203 = load i32*, i32** %25
%204 = getelementptr inbounds i32, i32* %203, i64 0
%205 = load i32, i32* %204
%206 = load i32*, i32** %25
%207 = getelementptr inbounds i32, i32* %206, i64 1
%208 = load i32, i32* %207
%209 = load i32*, i32** %25
%210 = getelementptr inbounds i32, i32* %209, i64 2
%211 = load i32, i32* %210
%212 = load i32*, i32** %25
%213 = getelementptr inbounds i32, i32* %212, i64 3
%214 = load i32, i32* %213
%215 = call i32 @sprintf(i8* %202, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %205, i32 %208, i32 %211, i32 %214)
store i32* %9, i32** %25
%216 = load i8*, i8** %24
%217 = getelementptr inbounds i8, i8* %216, i64 8
%218 = load i32*, i32** %25
%219 = getelementptr inbounds i32, i32* %218, i64 0
%220 = load i32, i32* %219
%221 = load i32*, i32** %25
%222 = getelementptr inbounds i32, i32* %221, i64 1
%223 = load i32, i32* %222
%224 = load i32*, i32** %25
%225 = getelementptr inbounds i32, i32* %224, i64 2
%226 = load i32, i32* %225
%227 = load i32*, i32** %25
%228 = getelementptr inbounds i32, i32* %227, i64 3
%229 = load i32, i32* %228
%230 = call i32 @sprintf(i8* %217, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %220, i32 %223, i32 %226, i32 %229)
store i32* %10, i32** %25
%231 = load i8*, i8** %24
%232 = getelementptr inbounds i8, i8* %231, i64 16
%233 = load i32*, i32** %25
%234 = getelementptr inbounds i32, i32* %233, i64 0
%235 = load i32, i32* %234
%236 = load i32*, i32** %25
%237 = getelementptr inbounds i32, i32* %236, i64 1
%238 = load i32, i32* %237
%239 = load i32*, i32** %25
%240 = getelementptr inbounds i32, i32* %239, i64 2
%241 = load i32, i32* %240
%242 = load i32*, i32** %25
%243 = getelementptr inbounds i32, i32* %242, i64 3
%244 = load i32, i32* %243
%245 = call i32 @sprintf(i8* %232, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %235, i32 %238, i32 %241, i32 %244)
store i32* %11, i32** %25
%246 = load i8*, i8** %24
%247 = getelementptr inbounds i8, i8* %246, i64 24
%248 = load i32*, i32** %25
%249 = getelementptr inbounds i32, i32* %248, i64 0
%250 = load i32, i32* %249
%251 = load i32*, i32** %25
%252 = getelementptr inbounds i32, i32* %251, i64 1
%253 = load i32, i32* %252
%254 = load i32*, i32** %25
%255 = getelementptr inbounds i32, i32* %254, i64 2
%256 = load i32, i32* %255
%257 = load i32*, i32** %25
%258 = getelementptr inbounds i32, i32* %257, i64 3
%259 = load i32, i32* %258
%260 = call i32 @sprintf(i8* %247, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %250, i32 %253, i32 %256, i32 %259)
%261 = load i8*, i8** %24
%262 = getelementptr inbounds i8, i8* %261, i64 32
store i8 0, i8* %262
%263 = load i8*, i8** %24
ret i8* %263
}

LLVM IR (-O2):
@__const.md5.r = [64 x i32] [i32 7, i32 12, i32 17, i32 22, i32 7, i32 12, i32 17, i32 22, i32 7, i32 12, i32 17, i32 22, i32 7, i32 12, i32 17, i32 22, i32 5, i32 9, i32 14, i32 20, i32 5, i32 9, i32 14, i32 20, i32 5, i32 9, i32 14, i32 20, i32 5, i32 9, i32 14, i32 20, i32 4, i32 11, i32 16, i32 23, i32 4, i32 11, i32 16, i32 23, i32 4, i32 11, i32 16, i32 23, i32 4, i32 11, i32 16, i32 23, i32 6, i32 10, i32 15, i32 21, i32 6, i32 10, i32 15, i32 21, i32 6, i32 10, i32 15, i32 21, i32 6, i32 10, i32 15, i32 21]
@__const.md5.k = [64 x i32] [i32 -680876936, i32 -389564586, i32 606105819, i32 -1044525330, i32 -176418897, i32 1200080426, i32 -1473231341, i32 -45705983, i32 1770035416, i32 -1958414417, i32 -42063, i32 -1990404162, i32 1804603682, i32 -40341101, i32 -1502002290, i32 1236535329, i32 -165796510, i32 -1069501632, i32 643717713, i32 -373897302, i32 -701558691, i32 38016083, i32 -660478335, i32 -405537848, i32 568446438, i32 -1019803690, i32 -187363961, i32 1163531501, i32 -1444681467, i32 -51403784, i32 1735328473, i32 -1926607734, i32 -378558, i32 -2022574463, i32 1839030562, i32 -35309556, i32 -1530992060, i32 1272893353, i32 -155497632, i32 -1094730640, i32 681279174, i32 -358537222, i32 -722521979, i32 76029189, i32 -640364487, i32 -421815835, i32 530742520, i32 -995338651, i32 -198630844, i32 1126891415, i32 -1416354905, i32 -57434055, i32 1700485571, i32 -1894986606, i32 -1051523, i32 -2054922799, i32 1873313359, i32 -30611744, i32 -1560198380, i32 1309151649, i32 -145523070, i32 -1120210379, i32 718787259, i32 -343485551]
@.str = [21 x i8] c"%2.2x%2.2x%2.2x%2.2x\00"
define noalias i8* @md5(i8* %0, i64 %1) {
%3 = alloca i32
%4 = trunc i64 %1 to i32
%5 = shl i32 %4, 3
%6 = or i32 %5, 1
br label %7
7: ; preds = %7, %2
%8 = phi i32 [ %6, %2 ], [ %11, %7 ]
%9 = srem i32 %8, 512
%10 = icmp eq i32 %9, 448
%11 = add nsw i32 %8, 1
br i1 %10, label %12, label %7
12: ; preds = %7
%13 = sdiv i32 %8, 8
%14 = add nsw i32 %13, 64
%15 = tail call i8* @calloc(i32 %14, i32 1)
%16 = bitcast i8* %15 to i32*
%17 = tail call i32 (i32*, ...) @memcpy(i32* %16, i8* %0, i64 %1)
%18 = getelementptr inbounds i32, i32* %16, i64 %1
store i32 128, i32* %18
%19 = bitcast i32* %3 to i8*
store i32 %5, i32* %3
%20 = sext i32 %13 to i64
%21 = getelementptr inbounds i32, i32* %16, i64 %20
%22 = call i32 (i32*, ...) @memcpy(i32* %21, i32* %3, i32 4)
%23 = icmp sgt i32 %8, 7
br i1 %23, label %24, label %93
24: ; preds = %12, %86
%25 = phi i64 [ %91, %86 ], [ 0, %12 ]
%26 = phi i32 [ %90, %86 ], [ 271733878, %12 ]
%27 = phi i32 [ %89, %86 ], [ -1732584194, %12 ]
%28 = phi i32 [ %88, %86 ], [ -271733879, %12 ]
%29 = phi i32 [ %87, %86 ], [ 1732584193, %12 ]
%30 = getelementptr inbounds i32, i32* %16, i64 %25
br label %31
31: ; preds = %24, %67
%32 = phi i64 [ 0, %24 ], [ %84, %67 ]
%33 = phi i32 [ %26, %24 ], [ %34, %67 ]
%34 = phi i32 [ %27, %24 ], [ %35, %67 ]
%35 = phi i32 [ %28, %24 ], [ %83, %67 ]
%36 = phi i32 [ %29, %24 ], [ %33, %67 ]
%37 = icmp ult i64 %32, 16
br i1 %37, label %38, label %43
38: ; preds = %31
%39 = and i32 %34, %35
%40 = xor i32 %35, -1
%41 = and i32 %33, %40
%42 = or i32 %41, %39
br label %67
43: ; preds = %31
%44 = icmp ult i64 %32, 32
br i1 %44, label %45, label %53
45: ; preds = %43
%46 = and i32 %33, %35
%47 = xor i32 %33, -1
%48 = and i32 %34, %47
%49 = or i32 %46, %48
%50 = mul nuw nsw i64 %32, 5
%51 = add nuw nsw i64 %50, 1
%52 = and i64 %51, 15
br label %67
53: ; preds = %43
%54 = icmp ult i64 %32, 48
br i1 %54, label %55, label %61
55: ; preds = %53
%56 = xor i32 %34, %35
%57 = xor i32 %56, %33
%58 = mul nuw nsw i64 %32, 3
%59 = add nuw nsw i64 %58, 5
%60 = and i64 %59, 15
br label %67
61: ; preds = %53
%62 = xor i32 %33, -1
%63 = or i32 %35, %62
%64 = xor i32 %63, %34
%65 = mul i64 %32, 7
%66 = and i64 %65, 15
br label %67
67: ; preds = %45, %61, %55, %38
%68 = phi i32 [ %42, %38 ], [ %49, %45 ], [ %57, %55 ], [ %64, %61 ]
%69 = phi i64 [ %32, %38 ], [ %52, %45 ], [ %60, %55 ], [ %66, %61 ]
%70 = add nsw i32 %68, %36
%71 = getelementptr inbounds [64 x i32], [64 x i32]* @__const.md5.k, i64 0, i64 %32
%72 = load i32, i32* %71
%73 = add nsw i32 %70, %72
%74 = getelementptr inbounds i32, i32* %30, i64 %69
%75 = load i32, i32* %74
%76 = add nsw i32 %73, %75
%77 = getelementptr inbounds [64 x i32], [64 x i32]* @__const.md5.r, i64 0, i64 %32
%78 = load i32, i32* %77
%79 = shl i32 %76, %78
%80 = sub nsw i32 32, %78
%81 = ashr i32 %76, %80
%82 = or i32 %81, %79
%83 = add nsw i32 %82, %35
%84 = add nuw nsw i64 %32, 1
%85 = icmp eq i64 %84, 64
br i1 %85, label %86, label %31
86: ; preds = %67
%87 = add nsw i32 %33, %29
%88 = add nsw i32 %83, %28
%89 = add nsw i32 %35, %27
%90 = add nsw i32 %34, %26
%91 = add nuw nsw i64 %25, 64
%92 = icmp slt i64 %91, %20
br i1 %92, label %24, label %93
93: ; preds = %86, %12
%94 = phi i32 [ 1732584193, %12 ], [ %87, %86 ]
%95 = phi i32 [ -271733879, %12 ], [ %88, %86 ]
%96 = phi i32 [ -1732584194, %12 ], [ %89, %86 ]
%97 = phi i32 [ 271733878, %12 ], [ %90, %86 ]
%98 = call i32 @free(i32* %16)
%99 = call dereferenceable_or_null(33) i8* @calloc(i32 33, i32 1)
%100 = call i32 @sprintf(i8* dereferenceable(1) %99, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %94, i32 poison, i32 poison, i32 poison)
%101 = getelementptr inbounds i8, i8* %99, i64 8
%102 = call i32 @sprintf(i8* %101, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %95, i32 poison, i32 poison, i32 poison)
%103 = getelementptr inbounds i8, i8* %99, i64 16
%104 = call i32 @sprintf(i8* %103, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %96, i32 poison, i32 poison, i32 poison)
%105 = getelementptr inbounds i8, i8* %99, i64 24
%106 = call i32 @sprintf(i8* %105, i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %97, i32 poison, i32 poison, i32 poison)
%107 = getelementptr inbounds i8, i8* %99, i64 32
store i8 0, i8* %107
ret i8* %99
}