#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 */
int /*<<< orphan*/ hexcdiff(void *, size_t, void *, size_t, char *);
size_t hexcdiff_msg_size(size_t, size_t);
char *malloc(size_t);
size_t strlen(char const *);
char *hexcdiff_str_auto(const char *expect_str, const char *actual_str) {
  size_t expect_len = strlen(expect_str);
  size_t actual_len = strlen(actual_str);
  size_t msg_len = hexcdiff_msg_size(expect_len, actual_len);
  char *msg = malloc(msg_len);
  hexcdiff((void *)expect_str, expect_len, (void *)actual_str, actual_len, msg);
  return msg;
}


x86 assembly (clang, -O0):
<hexcdiff_str_auto>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <hexcdiff_msg_size@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1060 <hexcdiff@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexcdiff_str_auto>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%r15
call   1040 <strlen@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %rax,%r13
mov    %r12,%rdi
mov    %rax,%rsi
call   1030 <hexcdiff_msg_size@plt>
mov    %rax,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %r13,%rcx
mov    %rax,%r8
call   1060 <hexcdiff@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @hexcdiff_str_auto(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = call i64 @strlen(i8* %9)
store i64 %10, i64* %5
%11 = load i8*, i8** %4
%12 = call i64 @strlen(i8* %11)
store i64 %12, i64* %6
%13 = load i64, i64* %5
%14 = load i64, i64* %6
%15 = call i64 @hexcdiff_msg_size(i64 %13, i64 %14)
store i64 %15, i64* %7
%16 = load i64, i64* %7
%17 = call i8* @malloc(i64 %16)
store i8* %17, i8** %8
%18 = load i8*, i8** %3
%19 = load i64, i64* %5
%20 = load i8*, i8** %4
%21 = load i64, i64* %6
%22 = load i8*, i8** %8
%23 = call i32 @hexcdiff(i8* %18, i64 %19, i8* %20, i64 %21, i8* %22)
%24 = load i8*, i8** %8
ret i8* %24
}

LLVM IR (-O2):
define i8* @hexcdiff_str_auto(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = tail call i64 @hexcdiff_msg_size(i64 %3, i64 %4)
%6 = tail call i8* @malloc(i64 %5)
%7 = tail call i32 @hexcdiff(i8* %0, i64 %3, i8* %1, i64 %4, i8* %6)
ret i8* %6
}