#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 /*<<< orphan*/ line;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fgets(char *, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
scalar_t__ md5_wrapper(char *, unsigned char *);
scalar_t__ memcmp(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, unsigned char);
int /*<<< orphan*/ stderr;
size_t strlen(char *);
int md5_check(char *filename) {
  int i;
  size_t n;
  FILE *f;
  int nb_err1, nb_err2;
  int nb_tot1, nb_tot2;
  unsigned char sum[16];
  char buf[33], line[1024];
  if ((f = fopen(filename, "rb")) == NULL) {
    printf("failed to open: %s\n", filename);
    return (1);
  }
  nb_err1 = nb_err2 = 0;
  nb_tot1 = nb_tot2 = 0;
  memset(line, 0, sizeof(line));
  n = sizeof(line);
  while (fgets(line, n - 1, f) != NULL) {
    n = strlen(line);
    if (n < 36)
      continue;
    if (line[32] != ' ' || line[33] != ' ')
      continue;
    if (line[n - 1] == '\n') {
      n--;
      line[n] = '\0';
    }
    if (line[n - 1] == '\r') {
      n--;
      line[n] = '\0';
    }
    nb_tot1++;
    if (md5_wrapper(line + 34, sum) != 0) {
      nb_err1++;
      continue;
    }
    nb_tot2++;
    for (i = 0; i < 16; i++)
      sprintf(buf + i * 2, "%02x", sum[i]);
    if (memcmp(line, buf, 32) != 0) {
      nb_err2++;
      fprintf(stderr, "wrong checksum: %s\n", line + 34);
    }
    n = sizeof(line);
  }
  if (nb_err1 != 0) {
    printf("WARNING: %d (out of %d) input files could "
           "not be read\n",
           nb_err1, nb_tot1);
  }
  if (nb_err2 != 0) {
    printf("WARNING: %d (out of %d) computed checksums did "
           "not match\n",
           nb_err2, nb_tot2);
  }
  return (nb_err1 != 0 || nb_err2 != 0);
}


x86 assembly (clang, -O0):
<md5_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xe56(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    11db <md5_check+0x4b>
mov    -0x10(%rbp),%rsi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    141a <md5_check+0x28a>
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
lea    -0x480(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
movq   $0x400,-0x20(%rbp)
lea    -0x480(%rbp),%rdi
mov    -0x20(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x28(%rbp),%rdx
call   1070 <fgets@plt>
cmp    $0x0,%rax
je     13b1 <md5_check+0x221>
lea    -0x480(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x24,-0x20(%rbp)
jae    1254 <md5_check+0xc4>
jmp    1212 <md5_check+0x82>
movsbl -0x460(%rbp),%eax
cmp    $0x20,%eax
jne    1274 <md5_check+0xe4>
movsbl -0x45f(%rbp),%eax
cmp    $0x20,%eax
je     1279 <md5_check+0xe9>
jmp    1212 <md5_check+0x82>
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
movsbl -0x480(%rbp,%rax,1),%eax
ff
cmp    $0xa,%eax
jne    12aa <md5_check+0x11a>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,-0x480(%rbp,%rax,1)
mov    -0x20(%rbp),%rax
sub    $0x1,%rax
movsbl -0x480(%rbp,%rax,1),%eax
ff
cmp    $0xd,%eax
jne    12db <md5_check+0x14b>
mov    -0x20(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movb   $0x0,-0x480(%rbp,%rax,1)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
lea    -0x480(%rbp),%rdi
add    $0x22,%rdi
lea    -0x50(%rbp),%rsi
call   1090 <md5_wrapper@plt>
cmp    $0x0,%rax
je     1310 <md5_check+0x180>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1212 <md5_check+0x82>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jge    135c <md5_check+0x1cc>
lea    -0x80(%rbp),%rdi
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
cltq
add    %rax,%rdi
movslq -0x14(%rbp),%rax
lea    0xcd3(%rip),%rsi
movzbl -0x50(%rbp,%rax,1),%edx
call   10b0 <sprintf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1320 <md5_check+0x190>
lea    -0x480(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x20,%edx
call   1060 <memcmp@plt>
cmp    $0x0,%rax
je     13a4 <md5_check+0x214>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    0x2c55(%rip),%rax
mov    (%rax),%edi
lea    -0x480(%rbp),%rdx
add    $0x22,%rdx
lea    0xc7d(%rip),%rsi
call   1080 <fprintf@plt>
movq   $0x400,-0x20(%rbp)
jmp    1212 <md5_check+0x82>
cmpl   $0x0,-0x2c(%rbp)
je     13cf <md5_check+0x23f>
mov    -0x2c(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xc68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x0,-0x30(%rbp)
je     13ed <md5_check+0x25d>
mov    -0x30(%rbp),%esi
mov    -0x38(%rbp),%edx
lea    0xc81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x2c(%rbp)
mov    %al,-0x481(%rbp)
jne    140c <md5_check+0x27c>
cmpl   $0x0,-0x30(%rbp)
setne  %al
mov    %al,-0x481(%rbp)
mov    -0x481(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<md5_check>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x458,%rsp
mov    %rdi,%rbx
lea    0xe55(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1474 <md5_check+0x2e4>
mov    %rax,%rbp
lea    0x50(%rsp),%rbx
xor    %r15d,%r15d
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
mov    $0x3ff,%esi
mov    %rbx,%rdi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
je     148c <md5_check+0x2fc>
lea    0x50(%rsp),%r13
lea    0xe1f(%rip),%r12
xor    %ebx,%ebx
xor    %r14d,%r14d
xor    %esi,%esi
mov    %esi,0x1c(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
call   1030 <strlen@plt>
cmp    $0x23,%rax
jbe    122c <md5_check+0x9c>
cmpb   $0x20,0x70(%rsp)
jne    122c <md5_check+0x9c>
cmpb   $0x20,0x71(%rsp)
je     1248 <md5_check+0xb8>
add    $0xffffffffffffffff,%rax
mov    %r13,%rdi
mov    %rax,%rsi
mov    %rbp,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    1210 <md5_check+0x80>
jmp    143c <md5_check+0x2ac>
mov    %r14d,0x18(%rsp)
lea    -0x1(%rax),%r14
movzbl 0x4f(%rsp,%rax,1),%edx
cmp    $0xa,%dl
jne    1273 <md5_check+0xe3>
movb   $0x0,0x4f(%rsp,%rax,1)
mov    %rax,%rcx
add    $0xfffffffffffffffe,%rcx
movzbl 0x4e(%rsp,%rax,1),%edx
cmp    $0xd,%dl
je     127e <md5_check+0xee>
jmp    1286 <md5_check+0xf6>
mov    %r14,%rcx
mov    %rax,%r14
cmp    $0xd,%dl
jne    1286 <md5_check+0xf6>
movb   $0x0,0x50(%rsp,%rcx,1)
mov    %rcx,%r14
add    $0x1,%ebx
lea    0x72(%rsp),%rdi
mov    %rsp,%rsi
call   1090 <md5_wrapper@plt>
test   %rax,%rax
jne    1411 <md5_check+0x281>
movzbl (%rsp),%edx
lea    0x20(%rsp),%r14
mov    %r14,%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x1(%rsp),%edx
lea    0x22(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x2(%rsp),%edx
lea    0x24(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x3(%rsp),%edx
lea    0x26(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x4(%rsp),%edx
lea    0x28(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x5(%rsp),%edx
lea    0x2a(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x6(%rsp),%edx
lea    0x2c(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x7(%rsp),%edx
lea    0x2e(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x8(%rsp),%edx
lea    0x30(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0x9(%rsp),%edx
lea    0x32(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0xa(%rsp),%edx
lea    0x34(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0xb(%rsp),%edx
lea    0x36(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0xc(%rsp),%edx
lea    0x38(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0xd(%rsp),%edx
lea    0x3a(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0xe(%rsp),%edx
lea    0x3c(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
movzbl 0xf(%rsp),%edx
lea    0x3e(%rsp),%rdi
mov    %r12,%rsi
call   10b0 <sprintf@plt>
mov    %r13,%rdi
mov    %r14,%rsi
mov    $0x20,%edx
call   1060 <memcmp@plt>
test   %rax,%rax
je     13fb <md5_check+0x26b>
mov    0x18(%rsp),%r14d
add    $0x1,%r14d
mov    0x2bfa(%rip),%rax
mov    (%rax),%edi
lea    0xc2d(%rip),%rsi
lea    0x72(%rsp),%rdx
call   1080 <fprintf@plt>
jmp    1400 <md5_check+0x270>
mov    0x18(%rsp),%r14d
add    $0x1,%r15d
mov    $0x3ff,%esi
mov    %r13,%rdi
jmp    1236 <md5_check+0xa6>
addl   $0x1,0x1c(%rsp)
add    $0xffffffffffffffff,%r14
mov    %r13,%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1070 <fgets@plt>
mov    0x1c(%rsp),%esi
test   %rax,%rax
mov    0x18(%rsp),%r14d
jne    11ff <md5_check+0x6f>
jmp    1444 <md5_check+0x2b4>
mov    0x1c(%rsp),%esi
test   %esi,%esi
je     1490 <md5_check+0x300>
lea    0xbe5(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%bl
test   %r14d,%r14d
je     1497 <md5_check+0x307>
lea    0xc05(%rip),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%r15b
jmp    149a <md5_check+0x30a>
lea    0xb88(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
jmp    14a1 <md5_check+0x311>
xor    %ebx,%ebx
jmp    149a <md5_check+0x30a>
xor    %ebx,%ebx
test   %r14d,%r14d
jne    145b <md5_check+0x2cb>
xor    %r15d,%r15d
or     %bl,%r15b
movzbl %r15b,%eax
add    $0x458,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [20 x i8] c"failed to open: %s\0A\00"
@.str.2 = [5 x i8] c"%02x\00"
@stderr = global i32 0
@.str.3 = [20 x i8] c"wrong checksum: %s\0A\00"
@.str.4 = [55 x i8] c"WARNING: %d (out of %d) input files could not be read\0A\00"
@.str.5 = [58 x i8] c"WARNING: %d (out of %d) computed checksums did not match\0A\00"
define i32 @md5_check(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [16 x i8]
%12 = alloca [33 x i8]
%13 = alloca [1024 x i8]
store i8* %0, i8** %3
%14 = load i8*, i8** %3
%15 = call i32* @fopen(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %15, i32** %6
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %1
%18 = load i8*, i8** %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %18)
store i32 1, i32* %2
br label %138
20: ; preds = %1
store i32 0, i32* %8
store i32 0, i32* %7
store i32 0, i32* %10
store i32 0, i32* %9
%21 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%22 = call i32 @memset(i8* %21, i32 0, i32 1024)
store i64 1024, i64* %5
br label %23
23: ; preds = %114, %79, %46, %35, %20
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%25 = load i64, i64* %5
%26 = sub i64 %25, 1
%27 = load i32*, i32** %6
%28 = call i32* @fgets(i8* %24, i64 %26, i32* %27)
%29 = icmp ne i32* %28, null
br i1 %29, label %30, label %115
30: ; preds = %23
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%32 = call i64 @strlen(i8* %31)
store i64 %32, i64* %5
%33 = load i64, i64* %5
%34 = icmp ult i64 %33, 36
br i1 %34, label %35, label %36
35: ; preds = %30
br label %23
36: ; preds = %30
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 32
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp ne i32 %39, 32
br i1 %40, label %46, label %41
41: ; preds = %36
%42 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 33
%43 = load i8, i8* %42
%44 = sext i8 %43 to i32
%45 = icmp ne i32 %44, 32
br i1 %45, label %46, label %47
46: ; preds = %41, %36
br label %23
47: ; preds = %41
%48 = load i64, i64* %5
%49 = sub i64 %48, 1
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp eq i32 %52, 10
br i1 %53, label %54, label %59
54: ; preds = %47
%55 = load i64, i64* %5
%56 = add i64 %55, -1
store i64 %56, i64* %5
%57 = load i64, i64* %5
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %57
store i8 0, i8* %58
br label %59
59: ; preds = %54, %47
%60 = load i64, i64* %5
%61 = sub i64 %60, 1
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = sext i8 %63 to i32
%65 = icmp eq i32 %64, 13
br i1 %65, label %66, label %71
66: ; preds = %59
%67 = load i64, i64* %5
%68 = add i64 %67, -1
store i64 %68, i64* %5
%69 = load i64, i64* %5
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 %69
store i8 0, i8* %70
br label %71
71: ; preds = %66, %59
%72 = load i32, i32* %9
%73 = add nsw i32 %72, 1
store i32 %73, i32* %9
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%75 = getelementptr inbounds i8, i8* %74, i64 34
%76 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 0
%77 = call i64 @md5_wrapper(i8* %75, i8* %76)
%78 = icmp ne i64 %77, 0
br i1 %78, label %79, label %82
79: ; preds = %71
%80 = load i32, i32* %7
%81 = add nsw i32 %80, 1
store i32 %81, i32* %7
br label %23
82: ; preds = %71
%83 = load i32, i32* %10
%84 = add nsw i32 %83, 1
store i32 %84, i32* %10
store i32 0, i32* %4
br label %85
85: ; preds = %99, %82
%86 = load i32, i32* %4
%87 = icmp slt i32 %86, 16
br i1 %87, label %88, label %102
88: ; preds = %85
%89 = getelementptr inbounds [33 x i8], [33 x i8]* %12, i64 0, i64 0
%90 = load i32, i32* %4
%91 = mul nsw i32 %90, 2
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds i8, i8* %89, i64 %92
%94 = load i32, i32* %4
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [16 x i8], [16 x i8]* %11, i64 0, i64 %95
%97 = load i8, i8* %96
%98 = call i32 @sprintf(i8* %93, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %97)
br label %99
99: ; preds = %88
%100 = load i32, i32* %4
%101 = add nsw i32 %100, 1
store i32 %101, i32* %4
br label %85
102: ; preds = %85
%103 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%104 = getelementptr inbounds [33 x i8], [33 x i8]* %12, i64 0, i64 0
%105 = call i64 @memcmp(i8* %103, i8* %104, i32 32)
%106 = icmp ne i64 %105, 0
br i1 %106, label %107, label %114
107: ; preds = %102
%108 = load i32, i32* %8
%109 = add nsw i32 %108, 1
store i32 %109, i32* %8
%110 = load i32, i32* @stderr
%111 = getelementptr inbounds [1024 x i8], [1024 x i8]* %13, i64 0, i64 0
%112 = getelementptr inbounds i8, i8* %111, i64 34
%113 = call i32 @fprintf(i32 %110, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %112)
br label %114
114: ; preds = %107, %102
store i64 1024, i64* %5
br label %23
115: ; preds = %23
%116 = load i32, i32* %7
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %122
118: ; preds = %115
%119 = load i32, i32* %7
%120 = load i32, i32* %9
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0), i32 %119, i32 %120)
br label %122
122: ; preds = %118, %115
%123 = load i32, i32* %8
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %129
125: ; preds = %122
%126 = load i32, i32* %8
%127 = load i32, i32* %10
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i32 %126, i32 %127)
br label %129
129: ; preds = %125, %122
%130 = load i32, i32* %7
%131 = icmp ne i32 %130, 0
br i1 %131, label %135, label %132
132: ; preds = %129
%133 = load i32, i32* %8
%134 = icmp ne i32 %133, 0
br label %135
135: ; preds = %132, %129
%136 = phi i1 [ true, %129 ], [ %134, %132 ]
%137 = zext i1 %136 to i32
store i32 %137, i32* %2
br label %138
138: ; preds = %135, %17
%139 = load i32, i32* %2
ret i32 %139
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [20 x i8] c"failed to open: %s\0A\00"
@.str.2 = [5 x i8] c"%02x\00"
@stderr = global i32 0
@.str.3 = [20 x i8] c"wrong checksum: %s\0A\00"
@.str.4 = [55 x i8] c"WARNING: %d (out of %d) input files could not be read\0A\00"
@.str.5 = [58 x i8] c"WARNING: %d (out of %d) computed checksums did not match\0A\00"
define i32 @md5_check(i8* %0) {
%2 = alloca [16 x i8]
%3 = alloca [33 x i8]
%4 = alloca [1024 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%8 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %12
10: ; preds = %1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
br label %165
12: ; preds = %1
%13 = call i32 @memset(i8* %7, i32 0, i32 1024)
%14 = call i32* @fgets(i8* %7, i64 1023, i32* %8)
%15 = icmp eq i32* %14, null
br i1 %15, label %160, label %16
16: ; preds = %12
%17 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 32
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 33
%19 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 34
%20 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 2
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 1
%22 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 4
%23 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 2
%24 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 6
%25 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 3
%26 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 8
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 4
%28 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 10
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 5
%30 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 12
%31 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 6
%32 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 14
%33 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 7
%34 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 16
%35 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 8
%36 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 18
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 9
%38 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 20
%39 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 10
%40 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 22
%41 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 11
%42 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 24
%43 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 12
%44 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 26
%45 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 13
%46 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 28
%47 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 14
%48 = getelementptr inbounds [33 x i8], [33 x i8]* %3, i64 0, i64 30
%49 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 15
br label %50
50: ; preds = %16, %93
%51 = phi i32 [ 0, %16 ], [ %56, %93 ]
%52 = phi i32 [ 0, %16 ], [ %90, %93 ]
%53 = phi i32 [ 0, %16 ], [ %58, %93 ]
%54 = phi i32 [ 0, %16 ], [ %94, %93 ]
br label %55
55: ; preds = %50, %138
%56 = phi i32 [ %51, %50 ], [ %131, %138 ]
%57 = phi i32 [ %52, %50 ], [ %90, %138 ]
%58 = phi i32 [ %53, %50 ], [ %139, %138 ]
br label %59
59: ; preds = %55, %62
%60 = call i64 @strlen(i8* %7)
%61 = icmp ult i64 %60, 36
br i1 %61, label %62, label %66
62: ; preds = %59, %66
%63 = add i64 %60, -1
%64 = call i32* @fgets(i8* %7, i64 %63, i32* %8)
%65 = icmp eq i32* %64, null
br i1 %65, label %142, label %59
66: ; preds = %59
%67 = load i8, i8* %17
%68 = icmp ne i8 %67, 32
%69 = load i8, i8* %18
%70 = icmp ne i8 %69, 32
%71 = select i1 %68, i1 true, i1 %70
br i1 %71, label %62, label %72
72: ; preds = %66
%73 = add i64 %60, -1
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %73
%75 = load i8, i8* %74
%76 = icmp eq i8 %75, 10
br i1 %76, label %77, label %81
77: ; preds = %72
store i8 0, i8* %74
%78 = add i64 %60, -2
%79 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %78
%80 = load i8, i8* %79
br label %81
81: ; preds = %77, %72
%82 = phi i8 [ %80, %77 ], [ %75, %72 ]
%83 = phi i64 [ %78, %77 ], [ %73, %72 ]
%84 = phi i64 [ %73, %77 ], [ %60, %72 ]
%85 = icmp eq i8 %82, 13
br i1 %85, label %86, label %88
86: ; preds = %81
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %83
store i8 0, i8* %87
br label %88
88: ; preds = %86, %81
%89 = phi i64 [ %83, %86 ], [ %84, %81 ]
%90 = add nsw i32 %57, 1
%91 = call i64 @md5_wrapper(i8* %19, i8* %5)
%92 = icmp eq i64 %91, 0
br i1 %92, label %98, label %93
93: ; preds = %88
%94 = add nuw nsw i32 %54, 1
%95 = add i64 %89, -1
%96 = call i32* @fgets(i8* %7, i64 %95, i32* %8)
%97 = icmp eq i32* %96, null
br i1 %97, label %147, label %50
98: ; preds = %88
%99 = load i8, i8* %5
%100 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %99)
%101 = load i8, i8* %21
%102 = call i32 @sprintf(i8* %20, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %101)
%103 = load i8, i8* %23
%104 = call i32 @sprintf(i8* %22, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %103)
%105 = load i8, i8* %25
%106 = call i32 @sprintf(i8* %24, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %105)
%107 = load i8, i8* %27
%108 = call i32 @sprintf(i8* %26, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %107)
%109 = load i8, i8* %29
%110 = call i32 @sprintf(i8* %28, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %109)
%111 = load i8, i8* %31
%112 = call i32 @sprintf(i8* %30, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %111)
%113 = load i8, i8* %33
%114 = call i32 @sprintf(i8* %32, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %113)
%115 = load i8, i8* %35
%116 = call i32 @sprintf(i8* %34, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %115)
%117 = load i8, i8* %37
%118 = call i32 @sprintf(i8* %36, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %117)
%119 = load i8, i8* %39
%120 = call i32 @sprintf(i8* %38, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %119)
%121 = load i8, i8* %41
%122 = call i32 @sprintf(i8* %40, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %121)
%123 = load i8, i8* %43
%124 = call i32 @sprintf(i8* %42, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %123)
%125 = load i8, i8* %45
%126 = call i32 @sprintf(i8* %44, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %125)
%127 = load i8, i8* %47
%128 = call i32 @sprintf(i8* %46, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %127)
%129 = load i8, i8* %49
%130 = call i32 @sprintf(i8* %48, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8 zeroext %129)
%131 = add nsw i32 %56, 1
%132 = call i64 @memcmp(i8* %7, i8* %6, i32 32)
%133 = icmp eq i64 %132, 0
br i1 %133, label %138, label %134
134: ; preds = %98
%135 = add nsw i32 %58, 1
%136 = load i32, i32* @stderr
%137 = call i32 @fprintf(i32 %136, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %19)
br label %138
138: ; preds = %134, %98
%139 = phi i32 [ %135, %134 ], [ %58, %98 ]
%140 = call i32* @fgets(i8* %7, i64 1023, i32* %8)
%141 = icmp eq i32* %140, null
br i1 %141, label %142, label %55
142: ; preds = %138, %62
%143 = phi i32 [ %58, %62 ], [ %139, %138 ]
%144 = phi i32 [ %57, %62 ], [ %90, %138 ]
%145 = phi i32 [ %56, %62 ], [ %131, %138 ]
%146 = icmp eq i32 %54, 0
br i1 %146, label %153, label %147
147: ; preds = %93, %142
%148 = phi i32 [ %145, %142 ], [ %56, %93 ]
%149 = phi i32 [ %144, %142 ], [ %90, %93 ]
%150 = phi i32 [ %143, %142 ], [ %58, %93 ]
%151 = phi i32 [ %54, %142 ], [ %94, %93 ]
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.4, i64 0, i64 0), i32 %151, i32 %149)
br label %153
153: ; preds = %147, %142
%154 = phi i1 [ true, %147 ], [ false, %142 ]
%155 = phi i32 [ %148, %147 ], [ %145, %142 ]
%156 = phi i32 [ %150, %147 ], [ %143, %142 ]
%157 = icmp eq i32 %156, 0
br i1 %157, label %160, label %158
158: ; preds = %153
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.5, i64 0, i64 0), i32 %156, i32 %155)
br label %160
160: ; preds = %12, %158, %153
%161 = phi i1 [ true, %158 ], [ false, %153 ], [ false, %12 ]
%162 = phi i1 [ %154, %158 ], [ %154, %153 ], [ false, %12 ]
%163 = or i1 %162, %161
%164 = zext i1 %163 to i32
br label %165
165: ; preds = %160, %10
%166 = phi i32 [ 1, %10 ], [ %164, %160 ]
ret i32 %166
}