#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 */
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
struct TYPE_4__ {
  unsigned long *data;
  int num;
  unsigned long Nl;
  unsigned long Nh;
  unsigned long A;
  unsigned long B;
  unsigned long C;
  unsigned long D;
};
typedef unsigned long MD4_LONG;
typedef TYPE_1__ MD4_CTX;

/* Variables and functions */
int MD4_LBLOCK;
int /*<<< orphan*/ md4_block_host_order(TYPE_1__ *, unsigned long *, int);
int MD4_Final(unsigned char *md, MD4_CTX *c) {
  register MD4_LONG *p;
  register unsigned long l;
  register int i, j;
  static const unsigned char end[4] = {0x80, 0x00, 0x00, 0x00};
  const unsigned char *cp = end;
  p = c->data;
  i = c->num >> 2;
  j = c->num & 0x03;
  l = (j == 0) ? 0 : p[i];
  {
    switch (j) {
    case 0:
      l = ((unsigned long)(*((cp)++)));
    case 1:
      l |= ((unsigned long)(*((cp)++))) << 8;
    case 2:
      l |= ((unsigned long)(*((cp)++))) << 16;
    case 3:
      l |= ((unsigned long)(*((cp)++))) << 24;
    }
  };
  p[i++] = l;
  if (i > (MD4_LBLOCK - 2)) {
    if (i < MD4_LBLOCK)
      p[i] = 0;
    md4_block_host_order(c, p, 1);
    i = 0;
  }
  for (; i < (MD4_LBLOCK - 2); i++)
    p[i] = 0;
  p[MD4_LBLOCK - 2] = c->Nl;
  p[MD4_LBLOCK - 1] = c->Nh;
  md4_block_host_order(c, p, 1);
  do {
    unsigned long ll;
    ll = (c)->A;
    (*(((md))++) = (unsigned char)(((ll)) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 24) & 0xff), ll);
    ll = (c)->B;
    (*(((md))++) = (unsigned char)(((ll)) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 24) & 0xff), ll);
    ll = (c)->C;
    (*(((md))++) = (unsigned char)(((ll)) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 24) & 0xff), ll);
    ll = (c)->D;
    (*(((md))++) = (unsigned char)(((ll)) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 8) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 16) & 0xff),
     *(((md))++) = (unsigned char)(((ll) >> 24) & 0xff), ll);
  } while (0);
  c->num = 0;
  return 1;
}


x86 assembly (clang, -O0):
<MD4_Final>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xee9(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x2,%eax
mov    %eax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%eax
and    $0x3,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    1165 <MD4_Final+0x55>
xor    %eax,%eax
mov    %rax,-0x40(%rbp)
jmp    1175 <MD4_Final+0x65>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%eax
mov    %rax,-0x48(%rbp)
sub    $0x3,%rax
ja     1212 <MD4_Final+0x102>
mov    -0x48(%rbp),%rax
lea    0xe67(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movzbl (%rax),%eax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movzbl (%rax),%eax
shl    $0x8,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movzbl (%rax),%eax
shl    $0x10,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x30(%rbp)
movzbl (%rax),%eax
shl    $0x18,%rax
or     -0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rax
mov    -0x24(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x24(%rbp)
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
mov    0x2daa(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jle    127e <MD4_Final+0x16e>
mov    -0x24(%rbp),%eax
mov    0x2d93(%rip),%rcx
cmp    (%rcx),%eax
jge    1265 <MD4_Final+0x155>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <md4_block_host_order@plt>
movl   $0x0,-0x24(%rbp)
jmp    1283 <MD4_Final+0x173>
mov    -0x24(%rbp),%eax
mov    0x2d53(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x2,%ecx
cmp    %ecx,%eax
jge    12b8 <MD4_Final+0x1a8>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1283 <MD4_Final+0x173>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
mov    -0x18(%rbp),%rax
mov    0x2d15(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdx
mov    -0x18(%rbp),%rax
mov    0x2cf6(%rip),%rcx
mov    (%rcx),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x1,%edx
call   1030 <md4_block_host_order@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
mov    0x38(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x8,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x10,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x38(%rbp),%rax
shr    $0x18,%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,0x8(%rax)
mov    $0x1,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MD4_Final>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
mov    (%rsi),%r15
mov    0x8(%rsi),%esi
mov    %esi,%eax
sar    $0x2,%eax
cltq
and    $0x3,%esi
je     115a <MD4_Final+0x3a>
mov    (%r15,%rax,8),%rcx
lea    0xeb2(%rip),%rdx
cmp    $0x3,%esi
je     1182 <MD4_Final+0x62>
cmp    $0x2,%esi
je     1174 <MD4_Final+0x54>
jmp    1166 <MD4_Final+0x46>
lea    0xea0(%rip),%rdx
mov    $0x80,%ecx
movzbl (%rdx),%esi
add    $0x1,%rdx
shl    $0x8,%rsi
or     %rsi,%rcx
movzbl (%rdx),%esi
add    $0x1,%rdx
shl    $0x10,%rsi
or     %rsi,%rcx
movzbl (%rdx),%edx
shl    $0x18,%rdx
or     %rcx,%rdx
lea    0x1(%rax),%ecx
mov    %rdx,(%r15,%rax,8)
mov    0x2e46(%rip),%r13
mov    0x0(%r13),%ebx
lea    -0x2(%rbx),%ebp
cmp    %ebp,%eax
jl     11cd <MD4_Final+0xad>
cmp    %ebx,%ecx
jge    11b4 <MD4_Final+0x94>
movslq %ecx,%rax
movq   $0x0,(%r15,%rax,8)
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <md4_block_host_order@plt>
mov    0x0(%r13),%ebx
lea    -0x2(%rbx),%ebp
xor    %ecx,%ecx
cmp    %ebp,%ecx
jge    11ee <MD4_Final+0xce>
movslq %ecx,%rax
lea    (%r15,%rax,8),%rdi
mov    %ebx,%eax
sub    %ecx,%eax
add    $0xfffffffd,%eax
lea    0x8(,%rax,8),%rdx
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x10(%r12),%rax
movslq %ebp,%rcx
mov    %rax,(%r15,%rcx,8)
mov    0x18(%r12),%rax
movslq %ebx,%rcx
mov    %rax,-0x8(%r15,%rcx,8)
mov    %r12,%rdi
mov    %r15,%rsi
mov    $0x1,%edx
call   1040 <md4_block_host_order@plt>
mov    0x20(%r12),%eax
mov    %eax,(%r14)
mov    0x28(%r12),%eax
mov    %eax,0x4(%r14)
mov    0x30(%r12),%eax
mov    %eax,0x8(%r14)
mov    0x38(%r12),%eax
mov    %eax,0xc(%r14)
movl   $0x0,0x8(%r12)
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.TYPE_4__ = type { i64*, i32, i64, i64, i64, i64, i64, i64 }
@MD4_Final.end = internal unnamed_addr constant [4 x i8] c"\80\00\00\00"
@MD4_LBLOCK = global i32 0
define i32 @MD4_Final(i8* nocapture writeonly %0, %struct.TYPE_4__* %1) {
%3 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 0
%4 = load i64*, i64** %3
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 1
%6 = load i32, i32* %5
%7 = ashr i32 %6, 2
%8 = and i32 %6, 3
%9 = icmp eq i32 %8, 0
%10 = sext i32 %7 to i64
br i1 %9, label %14, label %11
11: ; preds = %2
%12 = getelementptr inbounds i64, i64* %4, i64 %10
%13 = load i64, i64* %12
switch i32 %8, label %42 [
i32 3, label %30
i32 1, label %14
i32 2, label %22
]
14: ; preds = %2, %11
%15 = phi i64 [ %13, %11 ], [ 128, %2 ]
%16 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @MD4_Final.end, i64 0, i64 0), %11 ], [ getelementptr inbounds ([4 x i8], [4 x i8]* @MD4_Final.end, i64 0, i64 1), %2 ]
%17 = getelementptr inbounds i8, i8* %16, i64 1
%18 = load i8, i8* %16
%19 = zext i8 %18 to i64
%20 = shl nuw nsw i64 %19, 8
%21 = or i64 %20, %15
br label %22
22: ; preds = %11, %14
%23 = phi i64 [ %13, %11 ], [ %21, %14 ]
%24 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @MD4_Final.end, i64 0, i64 0), %11 ], [ %17, %14 ]
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %24
%27 = zext i8 %26 to i64
%28 = shl nuw nsw i64 %27, 16
%29 = or i64 %28, %23
br label %30
30: ; preds = %11, %22
%31 = phi i64 [ %13, %11 ], [ %29, %22 ]
%32 = phi i8* [ getelementptr inbounds ([4 x i8], [4 x i8]* @MD4_Final.end, i64 0, i64 0), %11 ], [ %25, %22 ]
%33 = load i8, i8* %32
%34 = zext i8 %33 to i64
%35 = shl nuw nsw i64 %34, 24
%36 = or i64 %35, %31
%37 = add nsw i32 %7, 1
%38 = getelementptr inbounds i64, i64* %4, i64 %10
store i64 %36, i64* %38
%39 = load i32, i32* @MD4_LBLOCK
%40 = add nsw i32 %39, -2
%41 = icmp slt i32 %7, %40
br i1 %41, label %52, label %43
42: ; preds = %11
unreachable
43: ; preds = %30
%44 = icmp slt i32 %37, %39
br i1 %44, label %45, label %48
45: ; preds = %43
%46 = sext i32 %37 to i64
%47 = getelementptr inbounds i64, i64* %4, i64 %46
store i64 0, i64* %47
br label %48
48: ; preds = %45, %43
%49 = tail call i32 @md4_block_host_order(%struct.TYPE_4__* %1, i64* %4, i32 1)
%50 = load i32, i32* @MD4_LBLOCK
%51 = add nsw i32 %50, -2
br label %52
52: ; preds = %48, %30
%53 = phi i32 [ %51, %48 ], [ %40, %30 ]
%54 = phi i32 [ %50, %48 ], [ %39, %30 ]
%55 = phi i32 [ 0, %48 ], [ %37, %30 ]
%56 = icmp slt i32 %55, %53
br i1 %56, label %57, label %66
57: ; preds = %52
%58 = sext i32 %55 to i64
%59 = getelementptr i64, i64* %4, i64 %58
%60 = bitcast i64* %59 to i8*
%61 = add i32 %54, -3
%62 = sub i32 %61, %55
%63 = zext i32 %62 to i64
%64 = shl nuw nsw i64 %63, 3
%65 = add nuw nsw i64 %64, 8
br label %66
66: ; preds = %57, %52
%67 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 2
%68 = load i64, i64* %67
%69 = sext i32 %53 to i64
%70 = getelementptr inbounds i64, i64* %4, i64 %69
store i64 %68, i64* %70
%71 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 3
%72 = load i64, i64* %71
%73 = add nsw i32 %54, -1
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i64, i64* %4, i64 %74
store i64 %72, i64* %75
%76 = tail call i32 @md4_block_host_order(%struct.TYPE_4__* %1, i64* %4, i32 1)
%77 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 4
%78 = load i64, i64* %77
%79 = trunc i64 %78 to i8
%80 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %79, i8* %0
%81 = lshr i64 %78, 8
%82 = trunc i64 %81 to i8
%83 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %82, i8* %80
%84 = lshr i64 %78, 16
%85 = trunc i64 %84 to i8
%86 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %85, i8* %83
%87 = lshr i64 %78, 24
%88 = trunc i64 %87 to i8
%89 = getelementptr inbounds i8, i8* %0, i64 4
store i8 %88, i8* %86
%90 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 5
%91 = load i64, i64* %90
%92 = trunc i64 %91 to i8
%93 = getelementptr inbounds i8, i8* %0, i64 5
store i8 %92, i8* %89
%94 = lshr i64 %91, 8
%95 = trunc i64 %94 to i8
%96 = getelementptr inbounds i8, i8* %0, i64 6
store i8 %95, i8* %93
%97 = lshr i64 %91, 16
%98 = trunc i64 %97 to i8
%99 = getelementptr inbounds i8, i8* %0, i64 7
store i8 %98, i8* %96
%100 = lshr i64 %91, 24
%101 = trunc i64 %100 to i8
%102 = getelementptr inbounds i8, i8* %0, i64 8
store i8 %101, i8* %99
%103 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 6
%104 = load i64, i64* %103
%105 = trunc i64 %104 to i8
%106 = getelementptr inbounds i8, i8* %0, i64 9
store i8 %105, i8* %102
%107 = lshr i64 %104, 8
%108 = trunc i64 %107 to i8
%109 = getelementptr inbounds i8, i8* %0, i64 10
store i8 %108, i8* %106
%110 = lshr i64 %104, 16
%111 = trunc i64 %110 to i8
%112 = getelementptr inbounds i8, i8* %0, i64 11
store i8 %111, i8* %109
%113 = lshr i64 %104, 24
%114 = trunc i64 %113 to i8
%115 = getelementptr inbounds i8, i8* %0, i64 12
store i8 %114, i8* %112
%116 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %1, i64 0, i32 7
%117 = load i64, i64* %116
%118 = trunc i64 %117 to i8
%119 = getelementptr inbounds i8, i8* %0, i64 13
store i8 %118, i8* %115
%120 = lshr i64 %117, 8
%121 = trunc i64 %120 to i8
%122 = getelementptr inbounds i8, i8* %0, i64 14
store i8 %121, i8* %119
%123 = lshr i64 %117, 16
%124 = trunc i64 %123 to i8
%125 = getelementptr inbounds i8, i8* %0, i64 15
store i8 %124, i8* %122
%126 = lshr i64 %117, 24
%127 = trunc i64 %126 to i8
store i8 %127, i8* %125
store i32 0, i32* %5
ret i32 1
}