#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 */
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int /*<<< orphan*/ *fts_path;
  scalar_t__ fts_pathlen;
};
typedef TYPE_1__ FTS;

/* Variables and functions */
int /*<<< orphan*/ *realloc(int /*<<< orphan*/ *, size_t);
int fts_palloc(FTS *sp, size_t more) {
  sp->fts_pathlen += more + 256;
  sp->fts_path = realloc(sp->fts_path, (size_t)sp->fts_pathlen);
  return (sp->fts_path == NULL);
}


x86 assembly (clang, -O0):
<fts_palloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
add    $0x100,%rcx
mov    -0x8(%rbp),%rax
add    0x8(%rax),%rcx
mov    %rcx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rsi
call   1030 <realloc@plt>
mov    %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fts_palloc>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    0x8(%rbx),%rax
add    %rax,%rsi
add    $0x100,%rsi
mov    %rsi,0x8(%rbx)
call   1030 <realloc@plt>
mov    %rax,(%rbx)
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.TYPE_3__ = type { i32*, i64 }
define i32 @fts_palloc(%struct.TYPE_3__* %0, i64 %1) {
%3 = alloca %struct.TYPE_3__*
%4 = alloca i64
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %3
store i64 %1, i64* %4
%5 = load i64, i64* %4
%6 = add i64 %5, 256
%7 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%8 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %7, i32 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %9, %6
store i64 %10, i64* %8
%11 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%12 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %11, i32 0, i32 0
%13 = load i32*, i32** %12
%14 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%15 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = call i32* @realloc(i32* %13, i64 %16)
%18 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%19 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %18, i32 0, i32 0
store i32* %17, i32** %19
%20 = load %struct.TYPE_3__*, %struct.TYPE_3__** %3
%21 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %20, i32 0, i32 0
%22 = load i32*, i32** %21
%23 = icmp eq i32* %22, null
%24 = zext i1 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i32*, i64 }
define i32 @fts_palloc(%struct.TYPE_3__* nocapture %0, i64 %1) {
%3 = add i64 %1, 256
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%5 = load i64, i64* %4
%6 = add i64 %3, %5
store i64 %6, i64* %4
%7 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%8 = load i32*, i32** %7
%9 = tail call i32* @realloc(i32* %8, i64 %6)
store i32* %9, i32** %7
%10 = icmp eq i32* %9, null
%11 = zext i1 %10 to i32
ret i32 %11
}