#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 */

/* Variables and functions */
scalar_t__ strtol(char *, int /*<<< orphan*/ *, int);
unsigned char *get_md5_bin(const char *asciisum) {
  static unsigned char buf[16];
  char str[3] = "xx";
  int i, j;
  for (i = 0, j = 0; i < 16; ++i) {
    str[0] = asciisum[j++];
    str[1] = asciisum[j++];
    buf[i] = (unsigned char)strtol(str, NULL, 16);
  }
  return buf;
}


x86 assembly (clang, -O0):
<get_md5_bin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0xedd(%rip),%ax
mov    %ax,-0xb(%rbp)
mov    0xed5(%rip),%al
mov    %al,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x10(%rbp)
jge    11a8 <get_md5_bin+0x98>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0xa(%rbp)
lea    -0xb(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %al,%dl
movslq -0x10(%rbp),%rcx
lea    0x2ea9(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113e <get_md5_bin+0x2e>
lea    0x2e91(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_md5_bin>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r15
movb   $0x0,0x6(%rsp)
movw   $0x7878,0x4(%rsp)
xor    %ebx,%ebx
lea    0x4(%rsp),%r14
lea    0x2f0b(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%r15,%rbx,2),%eax
mov    %al,0x4(%rsp)
movzbl 0x1(%r15,%rbx,2),%eax
mov    %al,0x5(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <strtol@plt>
mov    %al,(%rbx,%r12,1)
add    $0x1,%rbx
cmp    $0x10,%rbx
jne    1140 <get_md5_bin+0x30>
lea    0x2ec9(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@get_md5_bin.buf = internal global [16 x i8] zeroinitializer
@__const.get_md5_bin.str = [3 x i8] c"xx\00"
define i8* @get_md5_bin(i8* %0) {
%2 = alloca i8*
%3 = alloca [3 x i8]
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %2
%6 = bitcast [3 x i8]* %3 to i8*
store i32 0, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %31, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 16
br i1 %9, label %10, label %34
10: ; preds = %7
%11 = load i8*, i8** %2
%12 = load i32, i32* %5
%13 = add nsw i32 %12, 1
store i32 %13, i32* %5
%14 = sext i32 %12 to i64
%15 = getelementptr inbounds i8, i8* %11, i64 %14
%16 = load i8, i8* %15
%17 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
store i8 %16, i8* %17
%18 = load i8*, i8** %2
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds i8, i8* %18, i64 %21
%23 = load i8, i8* %22
%24 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 1
store i8 %23, i8* %24
%25 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%26 = call i64 @strtol(i8* %25, i32* null, i32 16)
%27 = trunc i64 %26 to i8
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [16 x i8], [16 x i8]* @get_md5_bin.buf, i64 0, i64 %29
store i8 %27, i8* %30
br label %31
31: ; preds = %10
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %7
34: ; preds = %7
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @get_md5_bin.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@get_md5_bin.buf = internal global [16 x i8] zeroinitializer
@__const.get_md5_bin.str = [3 x i8] c"xx\00"
define i8* @get_md5_bin(i8* nocapture %0) {
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 1
br label %5
5: ; preds = %1, %5
%6 = phi i64 [ 0, %1 ], [ %17, %5 ]
%7 = phi i64 [ 0, %1 ], [ %11, %5 ]
%8 = or i64 %7, 1
%9 = getelementptr inbounds i8, i8* %0, i64 %7
%10 = load i8, i8* %9
store i8 %10, i8* %3
%11 = add nuw nsw i64 %7, 2
%12 = getelementptr inbounds i8, i8* %0, i64 %8
%13 = load i8, i8* %12
store i8 %13, i8* %4
%14 = call i64 @strtol(i8* nocapture %3, i32* null, i32 16)
%15 = trunc i64 %14 to i8
%16 = getelementptr inbounds [16 x i8], [16 x i8]* @get_md5_bin.buf, i64 0, i64 %6
store i8 %15, i8* %16
%17 = add nuw nsw i64 %6, 1
%18 = icmp eq i64 %17, 16
br i1 %18, label %19, label %5
19: ; preds = %5
ret i8* getelementptr inbounds ([16 x i8], [16 x i8]* @get_md5_bin.buf, i64 0, i64 0)
}