char *Com_MD5FileETCompat(const char *filename) {
  char key[19] = {0};
  char *buffer;
  int len;
  len = FS_ReadFile(filename, (void **)&buffer);
  if (buffer) {
    if (len >= 28) {
      int i;
      for (i = 0; i < 18; i++) {
        key[i] = buffer[i + 10];
      }
      return CalculateGUID(key);
    }
  }
  return ((void *)0);
}


x86 assembly (clang, -O0):
<Com_MD5FileETCompat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x13,%edx
call   1030 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1040 <FS_ReadFile@plt>
mov    %eax,-0x3c(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11c5 <Com_MD5FileETCompat+0x95>
cmpl   $0x1c,-0x3c(%rbp)
jl     11c0 <Com_MD5FileETCompat+0x90>
movl   $0x0,-0x40(%rbp)
cmpl   $0x12,-0x40(%rbp)
jge    11aa <Com_MD5FileETCompat+0x7a>
mov    -0x38(%rbp),%rax
mov    -0x40(%rbp),%ecx
add    $0xa,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x40(%rbp),%rax
mov    %cl,-0x30(%rbp,%rax,1)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    117a <Com_MD5FileETCompat+0x4a>
lea    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1050 <CalculateGUID@plt>
cltq
mov    %rax,-0x8(%rbp)
jmp    11cd <Com_MD5FileETCompat+0x9d>
jmp    11c5 <Com_MD5FileETCompat+0x95>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Com_MD5FileETCompat>:
push   %rbx
sub    $0x20,%rsp
movb   $0x0,0x12(%rsp)
movw   $0x0,0x10(%rsp)
xor    %ebx,%ebx
lea    0x18(%rsp),%rsi
xor    %eax,%eax
call   1030 <FS_ReadFile@plt>
mov    0x18(%rsp),%rcx
test   %rcx,%rcx
je     1171 <Com_MD5FileETCompat+0x51>
cmp    $0x1c,%eax
jl     1171 <Com_MD5FileETCompat+0x51>
movups 0xa(%rcx),%xmm0
movaps %xmm0,(%rsp)
mov    0x1a(%rcx),%al
mov    %al,0x10(%rsp)
mov    0x1b(%rcx),%al
mov    %al,0x11(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1040 <CalculateGUID@plt>
movslq %eax,%rbx
mov    %rbx,%rax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Com_MD5FileETCompat(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [19 x i8]
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
%8 = bitcast [19 x i8]* %4 to i8*
%9 = load i8*, i8** %3
%10 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @FS_ReadFile to i32 (i8*, i8**, ...)*)(i8* %9, i8** %5)
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %39
13: ; preds = %1
%14 = load i32, i32* %6
%15 = icmp sge i32 %14, 28
br i1 %15, label %16, label %38
16: ; preds = %13
store i32 0, i32* %7
br label %17
17: ; preds = %30, %16
%18 = load i32, i32* %7
%19 = icmp slt i32 %18, 18
br i1 %19, label %20, label %33
20: ; preds = %17
%21 = load i8*, i8** %5
%22 = load i32, i32* %7
%23 = add nsw i32 %22, 10
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %21, i64 %24
%26 = load i8, i8* %25
%27 = load i32, i32* %7
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [19 x i8], [19 x i8]* %4, i64 0, i64 %28
store i8 %26, i8* %29
br label %30
30: ; preds = %20
%31 = load i32, i32* %7
%32 = add nsw i32 %31, 1
store i32 %32, i32* %7
br label %17
33: ; preds = %17
%34 = getelementptr inbounds [19 x i8], [19 x i8]* %4, i64 0, i64 0
%35 = call i32 (i8*, ...) bitcast (i32 (...)* @CalculateGUID to i32 (i8*, ...)*)(i8* %34)
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i8*
store i8* %37, i8** %2
br label %40
38: ; preds = %13
br label %39
39: ; preds = %38, %1
store i8* null, i8** %2
br label %40
40: ; preds = %39, %33
%41 = load i8*, i8** %2
ret i8* %41
}

LLVM IR (-O2):
define i8* @Com_MD5FileETCompat(i8* %0) {
%2 = alloca [19 x i8]
%3 = alloca i8*
%4 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 0
%5 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 16
%6 = bitcast i8** %3 to i8*
%7 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @FS_ReadFile to i32 (i8*, i8**, ...)*)(i8* %0, i8** %3)
%8 = load i8*, i8** %3
%9 = icmp ne i8* %8, null
%10 = icmp sgt i32 %7, 27
%11 = select i1 %9, i1 %10, i1 false
br i1 %11, label %12, label %26
12: ; preds = %1
%13 = getelementptr inbounds i8, i8* %8, i64 10
%14 = bitcast i8* %13 to <16 x i8>*
%15 = load <16 x i8>, <16 x i8>* %14
%16 = bitcast [19 x i8]* %2 to <16 x i8>*
store <16 x i8> %15, <16 x i8>* %16
%17 = getelementptr inbounds i8, i8* %8, i64 26
%18 = load i8, i8* %17
%19 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 16
store i8 %18, i8* %19
%20 = getelementptr inbounds i8, i8* %8, i64 27
%21 = load i8, i8* %20
%22 = getelementptr inbounds [19 x i8], [19 x i8]* %2, i64 0, i64 17
store i8 %21, i8* %22
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @CalculateGUID to i32 (i8*, ...)*)(i8* %4)
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
br label %26
26: ; preds = %1, %12
%27 = phi i8* [ %25, %12 ], [ null, %1 ]
ret i8* %27
}