#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*/ talloc_abort(char const *);
char *talloc_asprintf(int /*<<< orphan*/ *, char *, char const *, char const *,
                      char const *);
void talloc_abort_type_missmatch(const char *location, const char *name,
                                 const char *expected) {
  const char *reason;
  reason = talloc_asprintf(NULL, "%s: Type mismatch: name[%s] expected[%s]",
                           location, name ? name : "NULL", expected);
  if (!reason) {
    reason = "Type mismatch";
  }
  talloc_abort(reason);
}


x86 assembly (clang, -O0):
<talloc_abort_type_missmatch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1154 <talloc_abort_type_missmatch+0x34>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1164 <talloc_abort_type_missmatch+0x44>
lea    0xece(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1164 <talloc_abort_type_missmatch+0x44>
mov    -0x28(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%r8
xor    %eax,%eax
mov    %eax,%edi
lea    0xe85(%rip),%rsi
call   1040 <talloc_asprintf@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    119a <talloc_abort_type_missmatch+0x7a>
lea    0xe98(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <talloc_abort@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_abort_type_missmatch>:
push   %rax
mov    %rdx,%r8
mov    %rdi,%rdx
test   %rsi,%rsi
lea    0xef8(%rip),%rcx
cmovne %rsi,%rcx
lea    0xec4(%rip),%rsi
xor    %edi,%edi
call   1040 <talloc_asprintf@plt>
test   %rax,%rax
lea    0xee1(%rip),%rdi
cmovne %rax,%rdi
pop    %rax
jmp    1030 <talloc_abort@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"%s: Type mismatch: name[%s] expected[%s]\00"
@.str.1 = [5 x i8] c"NULL\00"
@.str.2 = [14 x i8] c"Type mismatch\00"
define void @talloc_abort_type_missmatch(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %13
11: ; preds = %3
%12 = load i8*, i8** %5
br label %14
13: ; preds = %3
br label %14
14: ; preds = %13, %11
%15 = phi i8* [ %12, %11 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), %13 ]
%16 = load i8*, i8** %6
%17 = call i8* @talloc_asprintf(i32* null, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %15, i8* %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %7
%19 = icmp ne i8* %18, null
br i1 %19, label %21, label %20
20: ; preds = %14
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %7
br label %21
21: ; preds = %20, %14
%22 = load i8*, i8** %7
%23 = call i32 @talloc_abort(i8* %22)
ret void
}

LLVM IR (-O2):
@.str = [41 x i8] c"%s: Type mismatch: name[%s] expected[%s]\00"
@.str.1 = [5 x i8] c"NULL\00"
@.str.2 = [14 x i8] c"Type mismatch\00"
define void @talloc_abort_type_missmatch(i8* %0, i8* %1, i8* %2) {
%4 = icmp eq i8* %1, null
%5 = select i1 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %1
%6 = tail call i8* @talloc_asprintf(i32* null, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %5, i8* %2)
%7 = icmp eq i8* %6, null
%8 = select i1 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* %6
%9 = tail call i32 @talloc_abort(i8* %8)
ret void
}