#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 *);
int /*<<< orphan*/ talloc_log(char *, unsigned int, unsigned int, unsigned int,
                              int, int, int /*<<< orphan*/);
void talloc_abort_magic(unsigned magic) {
  unsigned striped = magic - 0xe814ec70;
  unsigned major = (striped & 0xFFFFF000) >> 12;
  unsigned minor = (striped & 0x00000FF0) >> 4;
  talloc_log("Bad talloc magic[0x%08X/%u/%u] expected[0x%08X/%u/%u]\n", magic,
             major, minor, (0xe814ec70 + (2 << 12) + (0 << 4)), 2, 0);
  talloc_abort("Bad talloc magic value - wrong talloc version used/mixed");
}


x86 assembly (clang, -O0):
<talloc_abort_magic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xe814ec70,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
and    $0xfffff000,%eax
shr    $0xc,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
and    $0xff0,%eax
shr    $0x4,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe9e(%rip),%rdi
mov    $0xe8150c70,%r8d
mov    $0x2,%r9d
xor    %eax,%eax
movl   $0x0,(%rsp)
call   1040 <talloc_log@plt>
lea    0xeb4(%rip),%rdi
call   1030 <talloc_abort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<talloc_abort_magic>:
push   %rax
mov    %edi,%esi
lea    0x17eb1390(%rsi),%eax
mov    %eax,%edx
shr    $0xc,%edx
shr    $0x4,%eax
movzbl %al,%ecx
movl   $0x0,(%rsp)
lea    0xebe(%rip),%rdi
mov    $0xe8150c70,%r8d
mov    $0x2,%r9d
call   1040 <talloc_log@plt>
lea    0xedd(%rip),%rdi
pop    %rax
jmp    1030 <talloc_abort@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"Bad talloc magic[0x%08X/%u/%u] expected[0x%08X/%u/%u]\0A\00"
@.str.1 = [57 x i8] c"Bad talloc magic value - wrong talloc version used/mixed\00"
define void @talloc_abort_magic(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = sub i32 %6, -401281936
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = and i32 %8, -4096
%10 = lshr i32 %9, 12
store i32 %10, i32* %4
%11 = load i32, i32* %3
%12 = and i32 %11, 4080
%13 = lshr i32 %12, 4
store i32 %13, i32* %5
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = call i32 @talloc_log(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16, i32 -401273744, i32 2, i32 0)
%18 = call i32 @talloc_abort(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"Bad talloc magic[0x%08X/%u/%u] expected[0x%08X/%u/%u]\0A\00"
@.str.1 = [57 x i8] c"Bad talloc magic value - wrong talloc version used/mixed\00"
define void @talloc_abort_magic(i32 %0) {
%2 = add i32 %0, 401281936
%3 = lshr i32 %2, 12
%4 = lshr i32 %2, 4
%5 = and i32 %4, 255
%6 = tail call i32 @talloc_log(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i32 %5, i32 -401273744, i32 2, i32 0)
%7 = tail call i32 @talloc_abort(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret void
}