#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 void *caddr_t;
typedef int /*<<< orphan*/ SHA_CTX;

/* Variables and functions */
int /*<<< orphan*/ MAP_SHARED;
int /*<<< orphan*/ O_RDWR;
int PROT_READ;
int PROT_WRITE;
int /*<<< orphan*/ SHA1_Final(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA1_Init(int /*<<< orphan*/ *);
int /*<<< orphan*/ SHA1_Update(int /*<<< orphan*/ *, void *, int);
int SHA_DIGEST_LENGTH;
int atoi(char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void *mmap(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/, int,
           int /*<<< orphan*/);
int /*<<< orphan*/ munmap(void *, int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
long rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time();
int main(int argc, char **argv) {
  int fd, length = 4 * 1024;
  void *memptr;
  long *long_array;
  int i;
  SHA_CTX context;
  char md[20];
  if (argc != 3) {
    printf("USAGE: test_shmem <filename> <size>\n");
    exit(-1);
  }
  printf("opening file %s\n", argv[1]);
  length = atoi(argv[2]) * 1024 * 1024;
  printf("size is %d\n", length);
  fd = open(argv[1], O_RDWR);
  printf("fd = %d\n", fd);
  if ((memptr = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd,
                     0)) == (caddr_t)-1) {
    printf("mmap failed (0x%x)\n", memptr);
    close(fd);
    exit(-1);
  }
  srand(time());
  long_array = (long *)memptr;
  for (i = 0; i < length / sizeof(long); i++) {
    long_array[i] = rand();
  }
  memset(md, 0, 20);
  SHA1_Init(&context);
  SHA1_Update(&context, memptr, length);
  SHA1_Final(md, &context);
  printf("[DUMP] ");
  for (i = 0; i < SHA_DIGEST_LENGTH; ++i) {
    unsigned char c = md[i];
    printf("%2.2x", c);
  }
  printf("\n");
  printf("munmap is unmapping %x\n", memptr);
  munmap(memptr, length);
  printf("fd is %d\n", fd);
  close(fd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1000,-0x18(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     121f <main+0x3f>
lea    0xdf2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   10d0 <atoi@plt>
shl    $0xa,%eax
shl    $0xa,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    0x2d6d(%rip),%rax
mov    (%rax),%esi
call   10c0 <open@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%esi
mov    0x2d68(%rip),%rax
mov    (%rax),%edx
mov    0x2d27(%rip),%rax
or     (%rax),%edx
mov    0x2d46(%rip),%rax
mov    (%rax),%ecx
mov    -0x14(%rbp),%r8d
xor    %eax,%eax
mov    %eax,%edi
xor    %r9d,%r9d
call   1030 <mmap@plt>
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rcx
cmp    %rcx,%rax
jne    12ec <main+0x10c>
mov    -0x20(%rbp),%rsi
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    $0x0,%al
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
movslq -0x18(%rbp),%rcx
shr    $0x3,%rcx
cmp    %rcx,%rax
jae    1342 <main+0x162>
mov    $0x0,%al
call   1100 <rand@plt>
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1309 <main+0x129>
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1050 <memset@plt>
lea    -0x30(%rbp),%rdi
call   10b0 <SHA1_Init@plt>
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%edx
lea    -0x30(%rbp),%rdi
call   1090 <SHA1_Update@plt>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   10f0 <SHA1_Final@plt>
lea    0xce0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    0x2c39(%rip),%rcx
cmp    (%rcx),%eax
jge    13ca <main+0x1ea>
movslq -0x2c(%rbp),%rax
mov    -0x50(%rbp,%rax,1),%al
mov    %al,-0x51(%rbp)
movzbl -0x51(%rbp),%esi
lea    0xcb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    138d <main+0x1ad>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   10a0 <munmap@plt>
mov    -0x14(%rbp),%esi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x3,%edi
jne    13cb <main+0x1cb>
mov    %rsi,%rbx
mov    0x8(%rsi),%rsi
lea    0xddb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x10(%rbx),%rdi
call   10f0 <atoi@plt>
mov    %eax,%r15d
mov    %eax,%r12d
shl    $0x14,%r12d
lea    0xdcb(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rbx),%rdi
mov    0x2d7d(%rip),%rax
mov    (%rax),%esi
call   10e0 <open@plt>
mov    %eax,%r14d
lea    0xdb1(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2d7c(%rip),%rax
mov    0x2d3d(%rip),%rcx
mov    (%rcx),%edx
or     (%rax),%edx
mov    0x2d5a(%rip),%rax
mov    (%rax),%ecx
xor    %edi,%edi
mov    %r12d,%esi
mov    %r14d,%r8d
xor    %r9d,%r9d
call   1050 <mmap@plt>
cmp    $0xffffffffffffffff,%rax
je     13e1 <main+0x1e1>
mov    %rax,%r13
xor    %eax,%eax
call   10a0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
test   %r15d,%r15d
je     12f5 <main+0xf5>
movslq %r12d,%rax
shr    $0x3,%rax
cmp    $0x2,%rax
mov    $0x1,%ebx
cmovae %rax,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1120 <rand@plt>
mov    %rax,0x0(%r13,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    12e0 <main+0xe0>
lea    0x10(%rsp),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    $0x14,%edx
call   1070 <memset@plt>
lea    0xc(%rsp),%rbp
mov    %rbp,%rdi
call   10d0 <SHA1_Init@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r12d,%edx
call   10b0 <SHA1_Update@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1110 <SHA1_Final@plt>
lea    0xd04(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x2c8c(%rip),%r15
cmpl   $0x0,(%r15)
jle    137b <main+0x17b>
lea    0xcf1(%rip),%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x10(%rsp,%rbx,1),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
movslq (%r15),%rax
cmp    %rax,%rbx
jl     1360 <main+0x160>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcbc(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r12d,%esi
call   10c0 <munmap@plt>
lea    0xcb8(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
call   1080 <close@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc98(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>
lea    0xc3e(%rip),%rdi
mov    $0xffffffffffffffff,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
call   1080 <close@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
@.str = [37 x i8] c"USAGE: test_shmem <filename> <size>\0A\00"
@.str.1 = [17 x i8] c"opening file %s\0A\00"
@.str.2 = [12 x i8] c"size is %d\0A\00"
@O_RDWR = global i32 0
@.str.3 = [9 x i8] c"fd = %d\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.4 = [20 x i8] c"mmap failed (0x%x)\0A\00"
@.str.5 = [8 x i8] c"[DUMP] \00"
@SHA_DIGEST_LENGTH = global i32 0
@.str.6 = [6 x i8] c"%2.2x\00"
@.str.7 = [2 x i8] c"\0A\00"
@.str.8 = [24 x i8] c"munmap is unmapping %x\0A\00"
@.str.9 = [10 x i8] c"fd is %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64*
%10 = alloca i32
%11 = alloca i32
%12 = alloca [20 x i8]
%13 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 4096, i32* %7
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @exit(i32 -1)
unreachable
19: ; preds = %2
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 1
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 2
%26 = load i8*, i8** %25
%27 = call i32 @atoi(i8* %26)
%28 = mul nsw i32 %27, 1024
%29 = mul nsw i32 %28, 1024
store i32 %29, i32* %7
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = load i32, i32* @O_RDWR
%36 = call i32 @open(i8* %34, i32 %35)
store i32 %36, i32* %6
%37 = load i32, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = load i32, i32* %7
%40 = load i32, i32* @PROT_READ
%41 = load i32, i32* @PROT_WRITE
%42 = or i32 %40, %41
%43 = load i32, i32* @MAP_SHARED
%44 = load i32, i32* %6
%45 = call i8* @mmap(i32* null, i32 %39, i32 %42, i32 %43, i32 %44, i32 0)
store i8* %45, i8** %8
%46 = icmp eq i8* %45, inttoptr (i64 -1 to i8*)
br i1 %46, label %47, label %53
47: ; preds = %19
%48 = load i8*, i8** %8
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* %48)
%50 = load i32, i32* %6
%51 = call i32 @close(i32 %50)
%52 = call i32 @exit(i32 -1)
unreachable
53: ; preds = %19
%54 = call i32 (...) @time()
%55 = call i32 @srand(i32 %54)
%56 = load i8*, i8** %8
%57 = bitcast i8* %56 to i64*
store i64* %57, i64** %9
store i32 0, i32* %10
br label %58
58: ; preds = %71, %53
%59 = load i32, i32* %10
%60 = sext i32 %59 to i64
%61 = load i32, i32* %7
%62 = sext i32 %61 to i64
%63 = udiv i64 %62, 8
%64 = icmp ult i64 %60, %63
br i1 %64, label %65, label %74
65: ; preds = %58
%66 = call i64 (...) @rand()
%67 = load i64*, i64** %9
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i64, i64* %67, i64 %69
store i64 %66, i64* %70
br label %71
71: ; preds = %65
%72 = load i32, i32* %10
%73 = add nsw i32 %72, 1
store i32 %73, i32* %10
br label %58
74: ; preds = %58
%75 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%76 = call i32 @memset(i8* %75, i32 0, i32 20)
%77 = call i32 @SHA1_Init(i32* %11)
%78 = load i8*, i8** %8
%79 = load i32, i32* %7
%80 = call i32 @SHA1_Update(i32* %11, i8* %78, i32 %79)
%81 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 0
%82 = call i32 @SHA1_Final(i8* %81, i32* %11)
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %10
br label %84
84: ; preds = %96, %74
%85 = load i32, i32* %10
%86 = load i32, i32* @SHA_DIGEST_LENGTH
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %99
88: ; preds = %84
%89 = load i32, i32* %10
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [20 x i8], [20 x i8]* %12, i64 0, i64 %90
%92 = load i8, i8* %91
store i8 %92, i8* %13
%93 = load i8, i8* %13
%94 = zext i8 %93 to i32
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %94)
br label %96
96: ; preds = %88
%97 = load i32, i32* %10
%98 = add nsw i32 %97, 1
store i32 %98, i32* %10
br label %84
99: ; preds = %84
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%101 = load i8*, i8** %8
%102 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %101)
%103 = load i8*, i8** %8
%104 = load i32, i32* %7
%105 = call i32 @munmap(i8* %103, i32 %104)
%106 = load i32, i32* %6
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %106)
%108 = load i32, i32* %6
%109 = call i32 @close(i32 %108)
%110 = load i32, i32* %3
ret i32 %110
}

LLVM IR (-O2):
@.str.1 = [17 x i8] c"opening file %s\0A\00"
@.str.2 = [12 x i8] c"size is %d\0A\00"
@O_RDWR = global i32 0
@.str.3 = [9 x i8] c"fd = %d\0A\00"
@PROT_READ = global i32 0
@PROT_WRITE = global i32 0
@MAP_SHARED = global i32 0
@.str.4 = [20 x i8] c"mmap failed (0x%x)\0A\00"
@.str.5 = [8 x i8] c"[DUMP] \00"
@SHA_DIGEST_LENGTH = global i32 0
@.str.6 = [6 x i8] c"%2.2x\00"
@.str.8 = [24 x i8] c"munmap is unmapping %x\0A\00"
@.str.9 = [10 x i8] c"fd is %d\0A\00"
@str = [36 x i8] c"USAGE: test_shmem <filename> <size>\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [20 x i8]
%5 = bitcast i32* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = icmp eq i32 %0, 3
br i1 %7, label %11, label %8
8: ; preds = %2
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 -1)
unreachable
11: ; preds = %2
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 2
%16 = load i8*, i8** %15
%17 = tail call i32 @atoi(i8* %16)
%18 = shl nsw i32 %17, 20
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %18)
%20 = load i8*, i8** %12
%21 = load i32, i32* @O_RDWR
%22 = tail call i32 @open(i8* %20, i32 %21)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %22)
%24 = load i32, i32* @PROT_READ
%25 = load i32, i32* @PROT_WRITE
%26 = or i32 %25, %24
%27 = load i32, i32* @MAP_SHARED
%28 = tail call i8* @mmap(i32* null, i32 %18, i32 %26, i32 %27, i32 %22, i32 0)
%29 = icmp eq i8* %28, inttoptr (i64 -1 to i8*)
br i1 %29, label %30, label %34
30: ; preds = %11
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8* inttoptr (i64 -1 to i8*))
%32 = tail call i32 @close(i32 %22)
%33 = tail call i32 @exit(i32 -1)
unreachable
34: ; preds = %11
%35 = tail call i32 (...) @time()
%36 = tail call i32 @srand(i32 %35)
%37 = bitcast i8* %28 to i64*
%38 = icmp eq i32 %17, 0
br i1 %38, label %49, label %39
39: ; preds = %34
%40 = sext i32 %18 to i64
%41 = lshr exact i64 %40, 3
%42 = call i64 @llvm.umax.i64(i64 %41, i64 1)
br label %43
43: ; preds = %39, %43
%44 = phi i64 [ 0, %39 ], [ %47, %43 ]
%45 = tail call i64 (...) @rand()
%46 = getelementptr inbounds i64, i64* %37, i64 %44
store i64 %45, i64* %46
%47 = add nuw nsw i64 %44, 1
%48 = icmp eq i64 %47, %42
br i1 %48, label %49, label %43
49: ; preds = %43, %34
%50 = call i32 @memset(i8* %6, i32 0, i32 20)
%51 = call i32 @SHA1_Init(i32* %3)
%52 = call i32 @SHA1_Update(i32* %3, i8* %28, i32 %18)
%53 = call i32 @SHA1_Final(i8* %6, i32* %3)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%55 = load i32, i32* @SHA_DIGEST_LENGTH
%56 = icmp sgt i32 %55, 0
br i1 %56, label %57, label %67
57: ; preds = %49, %57
%58 = phi i64 [ %63, %57 ], [ 0, %49 ]
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %61)
%63 = add nuw nsw i64 %58, 1
%64 = load i32, i32* @SHA_DIGEST_LENGTH
%65 = sext i32 %64 to i64
%66 = icmp slt i64 %63, %65
br i1 %66, label %57, label %67
67: ; preds = %57, %49
%68 = call i32 @putchar(i32 10)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i8* %28)
%70 = call i32 @munmap(i8* %28, i32 %18)
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), i32 %22)
%72 = call i32 @close(i32 %22)
ret i32 0
}