#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 */
char *realloc(char *, size_t);
char *_jsonExtendResp(char **ppcResp, size_t *piSize, char **ppcOffset) {
  char *pcNewResp;
  size_t iRespLen;
  iRespLen = *ppcOffset - *ppcResp;
  *piSize += 256000;
  if ((pcNewResp = realloc(*ppcResp, *piSize))) {
    *ppcOffset = (char *)(pcNewResp + iRespLen);
    *ppcResp = pcNewResp;
  }
  return pcNewResp;
}


x86 assembly (clang, -O0):
<_jsonExtendResp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x3e800,%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1185 <_jsonExtendResp+0x75>
mov    -0x20(%rbp),%rcx
add    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_jsonExtendResp>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%r15
mov    (%rdx),%rbx
mov    (%rdi),%r12
mov    $0x3e800,%eax
add    (%rsi),%rax
mov    %rax,(%rsi)
mov    %r12,%rdi
mov    %rax,%rsi
call   1030 <realloc@plt>
test   %rax,%rax
je     114e <_jsonExtendResp+0x3e>
sub    %r12,%rbx
mov    %rax,%rcx
add    %rbx,%rcx
mov    %rcx,(%r14)
mov    %rax,(%r15)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @_jsonExtendResp(i8** %0, i64* %1, i8** %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i64
store i8** %0, i8*** %4
store i64* %1, i64** %5
store i8** %2, i8*** %6
%9 = load i8**, i8*** %6
%10 = load i8*, i8** %9
%11 = load i8**, i8*** %4
%12 = load i8*, i8** %11
%13 = ptrtoint i8* %10 to i64
%14 = ptrtoint i8* %12 to i64
%15 = sub i64 %13, %14
store i64 %15, i64* %8
%16 = load i64*, i64** %5
%17 = load i64, i64* %16
%18 = add i64 %17, 256000
store i64 %18, i64* %16
%19 = load i8**, i8*** %4
%20 = load i8*, i8** %19
%21 = load i64*, i64** %5
%22 = load i64, i64* %21
%23 = call i8* @realloc(i8* %20, i64 %22)
store i8* %23, i8** %7
%24 = icmp ne i8* %23, null
br i1 %24, label %25, label %32
25: ; preds = %3
%26 = load i8*, i8** %7
%27 = load i64, i64* %8
%28 = getelementptr inbounds i8, i8* %26, i64 %27
%29 = load i8**, i8*** %6
store i8* %28, i8** %29
%30 = load i8*, i8** %7
%31 = load i8**, i8*** %4
store i8* %30, i8** %31
br label %32
32: ; preds = %25, %3
%33 = load i8*, i8** %7
ret i8* %33
}

LLVM IR (-O2):
define i8* @_jsonExtendResp(i8** nocapture %0, i64* nocapture %1, i8** nocapture %2) {
%4 = load i8*, i8** %2
%5 = load i8*, i8** %0
%6 = load i64, i64* %1
%7 = add i64 %6, 256000
store i64 %7, i64* %1
%8 = tail call i8* @realloc(i8* %5, i64 %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %3
%11 = ptrtoint i8* %4 to i64
%12 = ptrtoint i8* %5 to i64
%13 = sub i64 %11, %12
%14 = getelementptr inbounds i8, i8* %8, i64 %13
store i8* %14, i8** %2
store i8* %8, i8** %0
br label %15
15: ; preds = %10, %3
ret i8* %8
}