#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 */
void malloc_assert_failed(char *, char const *, int, char const *, char *);
int slurm_xsize(void *item, const char *file, int line, const char *func) {
  int *p = (int *)item - 2;
  (void)({
    (item != NULL) ? ((void)(0))
                   : malloc_assert_failed("item != NULL", file, line, func, "");
  });
  (void)({
    (p[0] == 0x42) ? ((void)(0))
                   : malloc_assert_failed("p[0] == 0x42", file, line, func, "");
  });
  return p[1];
}


x86 assembly (clang, -O0):
<slurm_xsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1143 <slurm_xsize+0x33>
jmp    1161 <slurm_xsize+0x51>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xeab(%rip),%rdi
lea    0xebd(%rip),%r8
call   1030 <malloc_assert_failed@plt>
mov    -0x28(%rbp),%rax
cmpl   $0x42,(%rax)
jne    1173 <slurm_xsize+0x63>
jmp    1191 <slurm_xsize+0x81>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
lea    0xe88(%rip),%rdi
lea    0xe8d(%rip),%r8
call   1030 <malloc_assert_failed@plt>
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slurm_xsize>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %rdi,%rbx
test   %rdi,%rdi
je     1158 <slurm_xsize+0x48>
cmpl   $0x42,-0x8(%rbx)
je     114a <slurm_xsize+0x3a>
lea    0xed8(%rip),%rdi
lea    0xedd(%rip),%r8
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <malloc_assert_failed@plt>
mov    -0x4(%rbx),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xea1(%rip),%rdi
lea    0xeb3(%rip),%r8
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r14,%rcx
call   1030 <malloc_assert_failed@plt>
cmpl   $0x42,-0x8(%rbx)
jne    112e <slurm_xsize+0x1e>
jmp    114a <slurm_xsize+0x3a>

LLVM IR (-O0):
@.str = [13 x i8] c"item != NULL\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"p[0] == 0x42\00"
define i32 @slurm_xsize(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i32*
%12 = getelementptr inbounds i32, i32* %11, i64 -2
store i32* %12, i32** %9
%13 = load i8*, i8** %5
%14 = icmp ne i8* %13, null
br i1 %14, label %15, label %16
15: ; preds = %4
br label %20
16: ; preds = %4
%17 = load i8*, i8** %6
%18 = load i32, i32* %7
%19 = load i8*, i8** %8
br label %20
20: ; preds = %16, %15
%21 = load i32*, i32** %9
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = icmp eq i32 %23, 66
br i1 %24, label %25, label %26
25: ; preds = %20
br label %30
26: ; preds = %20
%27 = load i8*, i8** %6
%28 = load i32, i32* %7
%29 = load i8*, i8** %8
br label %30
30: ; preds = %26, %25
%31 = load i32*, i32** %9
%32 = getelementptr inbounds i32, i32* %31, i64 1
%33 = load i32, i32* %32
ret i32 %33
}

LLVM IR (-O2):
@.str = [13 x i8] c"item != NULL\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [13 x i8] c"p[0] == 0x42\00"
define i32 @slurm_xsize(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = getelementptr inbounds i8, i8* %0, i64 -8
%6 = bitcast i8* %5 to i32*
%7 = icmp eq i8* %0, null
br i1 %7, label %8, label %9
8: ; preds = %4
tail call void @malloc_assert_failed(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %9
9: ; preds = %4, %8
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 66
br i1 %11, label %13, label %12
12: ; preds = %9
tail call void @malloc_assert_failed(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %1, i32 %2, i8* %3, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %9, %12
%14 = getelementptr inbounds i8, i8* %0, i64 -4
%15 = bitcast i8* %14 to i32*
%16 = load i32, i32* %15
ret i32 %16
}