#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_5__ TYPE_1__;

/* Type definitions */
struct TYPE_5__ {
  int A;
  int B;
  int C;
  int D;
};
typedef TYPE_1__ MD5_CTX;

/* Variables and functions */
int MD5_DIGEST_LENGTH;
int /*<<< orphan*/ MD5_Final(unsigned char *, TYPE_1__ *);
int /*<<< orphan*/ MD5_Init(TYPE_1__ *);
int /*<<< orphan*/ MD5_Update(TYPE_1__ *, char *, int);
int atoi(char *);
int conv(unsigned char);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  MD5_CTX c;
  unsigned char buffer[MD5_DIGEST_LENGTH], *hash, *orgdata;
  int i, seclen, orglen, datalen;
  long size;
  char *orgmsg, *append;
  if (argc != 5) {
    printf("Usage: %s secretlen orgdata orghash appenddata\n", argv[0]);
    exit(1);
  }
  seclen = atoi(argv[1]);
  orglen = strlen(argv[2]);
  orgdata = argv[2];
  hash = argv[3];
  append = argv[4];
  for (i = 0; i < 16; i++)
    hash[i] = conv(hash[2 * i]) * 0x10 + conv(hash[2 * i + 1]);
  datalen = (orglen + seclen) / 64 * 64 + 64;
  MD5_Init(&c);
  for (i = 0; i < datalen; i++)
    MD5_Update(&c, "A", 1);
  c.A = *(int *)(hash + 0x00);
  c.B = *(int *)(hash + 0x04);
  c.C = *(int *)(hash + 0x08);
  c.D = *(int *)(hash + 0x0c);
  MD5_Update(&c, append, strlen(append));
  MD5_Final(buffer, &c);
  for (i = 0; i < 16; i++)
    printf("%02x", buffer[i]);
  printf("%s\x80", orgdata);
  fflush(stdout);
  for (i = orglen + seclen + 1; i < datalen - 8; i++)
    write(1, "\x00", 1);
  size = orglen + seclen;
  size <<= 3;
  write(1, (char *)&size, 8);
  printf("%s", append);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e20(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x70(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
cmpl   $0x5,-0x8(%rbp)
je     120e <main+0x6e>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1090 <atoi@plt>
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rax
mov    %rax,-0x68(%rbp)
movl   $0x0,-0x44(%rbp)
cmpl   $0x10,-0x44(%rbp)
jge    12ba <main+0x11a>
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1060 <conv@plt>
shl    $0x4,%eax
mov    %eax,-0x74(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x44(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movzbl (%rax,%rcx,1),%edi
call   1060 <conv@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
add    %ecx,%eax
mov    %al,%dl
mov    -0x38(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1259 <main+0xb9>
mov    -0x4c(%rbp),%eax
add    -0x48(%rbp),%eax
mov    $0x40,%ecx
cltd
idiv   %ecx
shl    $0x6,%eax
add    $0x40,%eax
mov    %eax,-0x50(%rbp)
lea    -0x20(%rbp),%rdi
call   10a0 <MD5_Init@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x50(%rbp),%eax
jge    1310 <main+0x170>
lea    -0x20(%rbp),%rdi
lea    0xd38(%rip),%rsi
mov    $0x1,%edx
call   10c0 <MD5_Update@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    12e1 <main+0x141>
mov    -0x38(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x38(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x38(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x68(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x80(%rbp),%rsi
mov    %eax,%edx
lea    -0x20(%rbp),%rdi
call   10c0 <MD5_Update@plt>
mov    -0x70(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <MD5_Final@plt>
movl   $0x0,-0x44(%rbp)
cmpl   $0x10,-0x44(%rbp)
jge    139d <main+0x1fd>
mov    -0x70(%rbp),%rax
movslq -0x44(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    136b <main+0x1cb>
mov    -0x40(%rbp),%rsi
lea    0xc8f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
mov    -0x4c(%rbp),%eax
add    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    -0x50(%rbp),%ecx
sub    $0x8,%ecx
cmp    %ecx,%eax
jge    13fb <main+0x25b>
mov    $0x1,%edx
lea    0xc58(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    13c9 <main+0x229>
mov    -0x4c(%rbp),%eax
add    -0x48(%rbp),%eax
cltq
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x58(%rbp)
lea    -0x58(%rbp),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1040 <write@plt>
mov    -0x68(%rbp),%rsi
lea    0xc0a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
mov    %rsp,%rcx
mov    0x2e22(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rdx
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rdx
mov    %rdx,%rsp
cmp    $0x5,%edi
jne    144f <main+0x2af>
mov    %rdx,-0x50(%rbp)
mov    %rcx,-0x60(%rbp)
mov    0x8(%rbx),%rdi
call   1090 <atoi@plt>
mov    %eax,%r13d
mov    0x10(%rbx),%rdi
call   1050 <strlen@plt>
mov    %eax,%r12d
mov    0x10(%rbx),%rax
mov    %rax,-0x48(%rbp)
mov    0x18(%rbx),%r15
mov    0x20(%rbx),%rax
mov    %rax,-0x58(%rbp)
xor    %ebx,%ebx
movzbl (%r15,%rbx,2),%edi
call   1060 <conv@plt>
mov    %eax,%r14d
shl    $0x4,%r14d
movzbl 0x1(%r15,%rbx,2),%edi
call   1060 <conv@plt>
add    %r14d,%eax
mov    %al,(%r15,%rbx,1)
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1210 <main+0x70>
mov    %r12,%rbx
mov    %ebx,%eax
add    %r13d,%ebx
lea    0x3f(%rax,%r13,1),%r12d
cmovns %ebx,%r12d
and    $0xffffffc0,%r12d
lea    -0x40(%rbp),%rdi
call   10a0 <MD5_Init@plt>
mov    %rbx,-0x30(%rbp)
cmp    $0xffffffc1,%ebx
jl     1296 <main+0xf6>
xor    %eax,%eax
mov    %r12d,%r14d
or     $0x3f,%r14d
cmovle %eax,%r14d
add    $0x1,%r14d
lea    0xdb4(%rip),%r13
lea    -0x40(%rbp),%rbx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    $0x1,%edx
call   10c0 <MD5_Update@plt>
add    $0xffffffff,%r14d
jne    1280 <main+0xe0>
movups (%r15),%xmm0
movaps %xmm0,-0x40(%rbp)
mov    -0x58(%rbp),%r15
mov    %r15,%rdi
call   1050 <strlen@plt>
lea    -0x40(%rbp),%r14
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
call   10c0 <MD5_Update@plt>
mov    -0x50(%rbp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <MD5_Final@plt>
movzbl (%rbx),%esi
lea    0xd5e(%rip),%r13
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x1(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x2(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x3(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x4(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x5(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x6(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x7(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0x9(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xa(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xb(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xc(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xd(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xe(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movzbl 0xf(%rbx),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc80(%rip),%rdi
mov    -0x48(%rbp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2c0f(%rip),%rax
mov    (%rax),%edi
call   1080 <fflush@plt>
or     $0x38,%r12d
mov    -0x30(%rbp),%rax
lea    0x1(%rax),%ebx
cmp    %r12d,%ebx
jge    140a <main+0x26a>
lea    0xc57(%rip),%r14
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
add    $0x1,%ebx
cmp    %r12d,%ebx
jl     13f0 <main+0x250>
movslq -0x30(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x68(%rbp)
lea    -0x68(%rbp),%rsi
mov    $0x1,%edi
mov    $0x8,%edx
call   1040 <write@plt>
lea    0xc0b(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    -0x60(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%rbx),%rsi
lea    0xba7(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
%struct.TYPE_5__ = type { i32, i32, i32, i32 }
@MD5_DIGEST_LENGTH = global i32 0
@.str = [48 x i8] c"Usage: %s secretlen orgdata orghash appenddata\0A\00"
@.str.1 = [2 x i8] c"A\00"
@.str.2 = [5 x i8] c"%02x\00"
@.str.3 = [4 x i8] c"%s\80\00"
@stdout = global i32 0
@.str.4 = [2 x i8] zeroinitializer
@.str.5 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.TYPE_5__
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%18 = load i32, i32* @MD5_DIGEST_LENGTH
%19 = zext i32 %18 to i64
%20 = call i8* @llvm.stacksave()
store i8* %20, i8** %7
%21 = alloca i8, i64 %19
store i64 %19, i64* %8
%22 = load i32, i32* %4
%23 = icmp ne i32 %22, 5
br i1 %23, label %24, label %30
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 0
%27 = load i8*, i8** %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %27)
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %2
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 1
%33 = load i8*, i8** %32
%34 = call i32 @atoi(i8* %33)
store i32 %34, i32* %12
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32 @strlen(i8* %37)
store i32 %38, i32* %13
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i64 2
%41 = load i8*, i8** %40
store i8* %41, i8** %10
%42 = load i8**, i8*** %5
%43 = getelementptr inbounds i8*, i8** %42, i64 3
%44 = load i8*, i8** %43
store i8* %44, i8** %9
%45 = load i8**, i8*** %5
%46 = getelementptr inbounds i8*, i8** %45, i64 4
%47 = load i8*, i8** %46
store i8* %47, i8** %17
store i32 0, i32* %11
br label %48
48: ; preds = %74, %30
%49 = load i32, i32* %11
%50 = icmp slt i32 %49, 16
br i1 %50, label %51, label %77
51: ; preds = %48
%52 = load i8*, i8** %9
%53 = load i32, i32* %11
%54 = mul nsw i32 2, %53
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i8, i8* %52, i64 %55
%57 = load i8, i8* %56
%58 = call i32 @conv(i8 zeroext %57)
%59 = mul nsw i32 %58, 16
%60 = load i8*, i8** %9
%61 = load i32, i32* %11
%62 = mul nsw i32 2, %61
%63 = add nsw i32 %62, 1
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8, i8* %60, i64 %64
%66 = load i8, i8* %65
%67 = call i32 @conv(i8 zeroext %66)
%68 = add nsw i32 %59, %67
%69 = trunc i32 %68 to i8
%70 = load i8*, i8** %9
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %70, i64 %72
store i8 %69, i8* %73
br label %74
74: ; preds = %51
%75 = load i32, i32* %11
%76 = add nsw i32 %75, 1
store i32 %76, i32* %11
br label %48
77: ; preds = %48
%78 = load i32, i32* %13
%79 = load i32, i32* %12
%80 = add nsw i32 %78, %79
%81 = sdiv i32 %80, 64
%82 = mul nsw i32 %81, 64
%83 = add nsw i32 %82, 64
store i32 %83, i32* %14
%84 = call i32 @MD5_Init(%struct.TYPE_5__* %6)
store i32 0, i32* %11
br label %85
85: ; preds = %91, %77
%86 = load i32, i32* %11
%87 = load i32, i32* %14
%88 = icmp slt i32 %86, %87
br i1 %88, label %89, label %94
89: ; preds = %85
%90 = call i32 @MD5_Update(%struct.TYPE_5__* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %91
91: ; preds = %89
%92 = load i32, i32* %11
%93 = add nsw i32 %92, 1
store i32 %93, i32* %11
br label %85
94: ; preds = %85
%95 = load i8*, i8** %9
%96 = getelementptr inbounds i8, i8* %95, i64 0
%97 = bitcast i8* %96 to i32*
%98 = load i32, i32* %97
%99 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 0
store i32 %98, i32* %99
%100 = load i8*, i8** %9
%101 = getelementptr inbounds i8, i8* %100, i64 4
%102 = bitcast i8* %101 to i32*
%103 = load i32, i32* %102
%104 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 1
store i32 %103, i32* %104
%105 = load i8*, i8** %9
%106 = getelementptr inbounds i8, i8* %105, i64 8
%107 = bitcast i8* %106 to i32*
%108 = load i32, i32* %107
%109 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 2
store i32 %108, i32* %109
%110 = load i8*, i8** %9
%111 = getelementptr inbounds i8, i8* %110, i64 12
%112 = bitcast i8* %111 to i32*
%113 = load i32, i32* %112
%114 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %6, i32 0, i32 3
store i32 %113, i32* %114
%115 = load i8*, i8** %17
%116 = load i8*, i8** %17
%117 = call i32 @strlen(i8* %116)
%118 = call i32 @MD5_Update(%struct.TYPE_5__* %6, i8* %115, i32 %117)
%119 = call i32 @MD5_Final(i8* %21, %struct.TYPE_5__* %6)
store i32 0, i32* %11
br label %120
120: ; preds = %130, %94
%121 = load i32, i32* %11
%122 = icmp slt i32 %121, 16
br i1 %122, label %123, label %133
123: ; preds = %120
%124 = load i32, i32* %11
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i8, i8* %21, i64 %125
%127 = load i8, i8* %126
%128 = zext i8 %127 to i32
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %128)
br label %130
130: ; preds = %123
%131 = load i32, i32* %11
%132 = add nsw i32 %131, 1
store i32 %132, i32* %11
br label %120
133: ; preds = %120
%134 = load i8*, i8** %10
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %134)
%136 = load i32, i32* @stdout
%137 = call i32 @fflush(i32 %136)
%138 = load i32, i32* %13
%139 = load i32, i32* %12
%140 = add nsw i32 %138, %139
%141 = add nsw i32 %140, 1
store i32 %141, i32* %11
br label %142
142: ; preds = %149, %133
%143 = load i32, i32* %11
%144 = load i32, i32* %14
%145 = sub nsw i32 %144, 8
%146 = icmp slt i32 %143, %145
br i1 %146, label %147, label %152
147: ; preds = %142
%148 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 1)
br label %149
149: ; preds = %147
%150 = load i32, i32* %11
%151 = add nsw i32 %150, 1
store i32 %151, i32* %11
br label %142
152: ; preds = %142
%153 = load i32, i32* %13
%154 = load i32, i32* %12
%155 = add nsw i32 %153, %154
%156 = sext i32 %155 to i64
store i64 %156, i64* %15
%157 = load i64, i64* %15
%158 = shl i64 %157, 3
store i64 %158, i64* %15
%159 = bitcast i64* %15 to i8*
%160 = call i32 @write(i32 1, i8* %159, i32 8)
%161 = load i8*, i8** %17
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %161)
store i32 0, i32* %3
%163 = load i8*, i8** %7
%164 = load i32, i32* %3
ret i32 %164
}

LLVM IR (-O2):
%struct.TYPE_5__ = type { i32, i32, i32, i32 }
@MD5_DIGEST_LENGTH = global i32 0
@.str = [48 x i8] c"Usage: %s secretlen orgdata orghash appenddata\0A\00"
@.str.1 = [2 x i8] c"A\00"
@.str.2 = [5 x i8] c"%02x\00"
@.str.3 = [4 x i8] c"%s\80\00"
@stdout = global i32 0
@.str.4 = [2 x i8] zeroinitializer
@.str.5 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca <4 x i32>
%4 = bitcast <4 x i32>* %3 to %struct.TYPE_5__*
%5 = alloca i64
%6 = bitcast <4 x i32>* %3 to i8*
%7 = load i32, i32* @MD5_DIGEST_LENGTH
%8 = zext i32 %7 to i64
%9 = tail call i8* @llvm.stacksave()
%10 = alloca i8, i64 %8
%11 = bitcast i64* %5 to i8*
%12 = icmp eq i32 %0, 5
br i1 %12, label %17, label %13
13: ; preds = %2
%14 = load i8*, i8** %1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = tail call i32 @exit(i32 1)
unreachable
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = tail call i32 @atoi(i8* %19)
%21 = getelementptr inbounds i8*, i8** %1, i64 2
%22 = load i8*, i8** %21
%23 = tail call i32 @strlen(i8* %22)
%24 = load i8*, i8** %21
%25 = getelementptr inbounds i8*, i8** %1, i64 3
%26 = load i8*, i8** %25
%27 = getelementptr inbounds i8*, i8** %1, i64 4
%28 = load i8*, i8** %27
br label %29
29: ; preds = %17, %29
%30 = phi i64 [ 0, %17 ], [ %43, %29 ]
%31 = shl nuw nsw i64 %30, 1
%32 = getelementptr inbounds i8, i8* %26, i64 %31
%33 = load i8, i8* %32
%34 = tail call i32 @conv(i8 zeroext %33)
%35 = shl nsw i32 %34, 4
%36 = or i64 %31, 1
%37 = getelementptr inbounds i8, i8* %26, i64 %36
%38 = load i8, i8* %37
%39 = tail call i32 @conv(i8 zeroext %38)
%40 = add nsw i32 %39, %35
%41 = trunc i32 %40 to i8
%42 = getelementptr inbounds i8, i8* %26, i64 %30
store i8 %41, i8* %42
%43 = add nuw nsw i64 %30, 1
%44 = icmp eq i64 %43, 16
br i1 %44, label %45, label %29
45: ; preds = %29
%46 = add nsw i32 %23, %20
%47 = sdiv i32 %46, 64
%48 = shl nsw i32 %47, 6
%49 = call i32 @MD5_Init(%struct.TYPE_5__* %4)
%50 = icmp sgt i32 %46, -64
br i1 %50, label %51, label %59
51: ; preds = %45
%52 = or i32 %48, 63
%53 = call i32 @llvm.smax.i32(i32 %52, i32 0)
br label %54
54: ; preds = %51, %54
%55 = phi i32 [ %57, %54 ], [ 0, %51 ]
%56 = call i32 @MD5_Update(%struct.TYPE_5__* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 1)
%57 = add nuw i32 %55, 1
%58 = icmp eq i32 %55, %53
br i1 %58, label %59, label %54
59: ; preds = %54, %45
%60 = bitcast i8* %26 to <4 x i32>*
%61 = load <4 x i32>, <4 x i32>* %60
store <4 x i32> %61, <4 x i32>* %3
%62 = call i32 @strlen(i8* %28)
%63 = call i32 @MD5_Update(%struct.TYPE_5__* %4, i8* %28, i32 %62)
%64 = call i32 @MD5_Final(i8* %10, %struct.TYPE_5__* %4)
%65 = load i8, i8* %10
%66 = zext i8 %65 to i32
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds i8, i8* %10, i64 1
%69 = load i8, i8* %68
%70 = zext i8 %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %70)
%72 = getelementptr inbounds i8, i8* %10, i64 2
%73 = load i8, i8* %72
%74 = zext i8 %73 to i32
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %74)
%76 = getelementptr inbounds i8, i8* %10, i64 3
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %78)
%80 = getelementptr inbounds i8, i8* %10, i64 4
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %82)
%84 = getelementptr inbounds i8, i8* %10, i64 5
%85 = load i8, i8* %84
%86 = zext i8 %85 to i32
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %86)
%88 = getelementptr inbounds i8, i8* %10, i64 6
%89 = load i8, i8* %88
%90 = zext i8 %89 to i32
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %90)
%92 = getelementptr inbounds i8, i8* %10, i64 7
%93 = load i8, i8* %92
%94 = zext i8 %93 to i32
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %94)
%96 = getelementptr inbounds i8, i8* %10, i64 8
%97 = load i8, i8* %96
%98 = zext i8 %97 to i32
%99 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %98)
%100 = getelementptr inbounds i8, i8* %10, i64 9
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %102)
%104 = getelementptr inbounds i8, i8* %10, i64 10
%105 = load i8, i8* %104
%106 = zext i8 %105 to i32
%107 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %106)
%108 = getelementptr inbounds i8, i8* %10, i64 11
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %110)
%112 = getelementptr inbounds i8, i8* %10, i64 12
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %114)
%116 = getelementptr inbounds i8, i8* %10, i64 13
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %118)
%120 = getelementptr inbounds i8, i8* %10, i64 14
%121 = load i8, i8* %120
%122 = zext i8 %121 to i32
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %122)
%124 = getelementptr inbounds i8, i8* %10, i64 15
%125 = load i8, i8* %124
%126 = zext i8 %125 to i32
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %126)
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %24)
%129 = load i32, i32* @stdout
%130 = call i32 @fflush(i32 %129)
%131 = or i32 %48, 56
%132 = add nsw i32 %46, 1
%133 = icmp slt i32 %132, %131
br i1 %133, label %134, label %139
134: ; preds = %59, %134
%135 = phi i32 [ %137, %134 ], [ %132, %59 ]
%136 = call i32 @write(i32 1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32 1)
%137 = add nsw i32 %135, 1
%138 = icmp slt i32 %137, %131
br i1 %138, label %134, label %139
139: ; preds = %134, %59
%140 = sext i32 %46 to i64
%141 = shl nsw i64 %140, 3
store i64 %141, i64* %5
%142 = call i32 @write(i32 1, i8* %11, i32 8)
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %28)
ret i32 0
}