#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 */
typedef int /*<<< orphan*/ ino_t;

/* Variables and functions */
void *calloc(int, int);
int /*<<< orphan*/ memcpy(void *, void *, int);
int iso_px_ino_xinfo_cloner(void *old_data, void **new_data, int flag) {
  *new_data = NULL;
  if (flag)
    return 0xE830FE89;
  *new_data = calloc(1, sizeof(ino_t));
  if (*new_data == NULL)
    return 0xF030FFFA;
  memcpy(*new_data, old_data, sizeof(ino_t));
  return (int)sizeof(ino_t);
}


x86 assembly (clang, -O0):
<iso_px_ino_xinfo_cloner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
cmpl   $0x0,-0x1c(%rbp)
je     1154 <iso_px_ino_xinfo_cloner+0x34>
movl   $0xe830fe89,-0x4(%rbp)
jmp    11a3 <iso_px_ino_xinfo_cloner+0x83>
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1187 <iso_px_ino_xinfo_cloner+0x67>
movl   $0xf030fffa,-0x4(%rbp)
jmp    11a3 <iso_px_ino_xinfo_cloner+0x83>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
movl   $0x4,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iso_px_ino_xinfo_cloner>:
push   %rbp
push   %r14
push   %rbx
movq   $0x0,(%rsi)
mov    $0xe830fe89,%ebp
test   %edx,%edx
jne    116d <iso_px_ino_xinfo_cloner+0x4d>
mov    %rsi,%rbx
mov    %rdi,%r14
mov    $0x4,%ebp
mov    $0x1,%edi
mov    $0x4,%esi
call   1030 <calloc@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     1168 <iso_px_ino_xinfo_cloner+0x48>
mov    %rax,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
jmp    116d <iso_px_ino_xinfo_cloner+0x4d>
mov    $0xf030fffa,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @iso_px_ino_xinfo_cloner(i8* %0, i8** %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8**
%7 = alloca i32
store i8* %0, i8** %5
store i8** %1, i8*** %6
store i32 %2, i32* %7
%8 = load i8**, i8*** %6
store i8* null, i8** %8
%9 = load i32, i32* %7
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %3
store i32 -399442295, i32* %4
br label %24
12: ; preds = %3
%13 = call i8* @calloc(i32 1, i32 4)
%14 = load i8**, i8*** %6
store i8* %13, i8** %14
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %15
%17 = icmp eq i8* %16, null
br i1 %17, label %18, label %19
18: ; preds = %12
store i32 -265224198, i32* %4
br label %24
19: ; preds = %12
%20 = load i8**, i8*** %6
%21 = load i8*, i8** %20
%22 = load i8*, i8** %5
%23 = call i32 @memcpy(i8* %21, i8* %22, i32 4)
store i32 4, i32* %4
br label %24
24: ; preds = %19, %18, %11
%25 = load i32, i32* %4
ret i32 %25
}

LLVM IR (-O2):
define i32 @iso_px_ino_xinfo_cloner(i8* %0, i8** nocapture writeonly %1, i32 %2) {
store i8* null, i8** %1
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %10
5: ; preds = %3
%6 = tail call dereferenceable_or_null(4) i8* @calloc(i32 1, i32 4)
store i8* %6, i8** %1
%7 = icmp eq i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 @memcpy(i8* %6, i8* %0, i32 4)
br label %10
10: ; preds = %5, %3, %8
%11 = phi i32 [ 4, %8 ], [ -399442295, %3 ], [ -265224198, %5 ]
ret i32 %11
}