LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/markpeerdeman[P]mbemm/src/general/points.c
// Function: point_dll
point point_dll( point thedll, const int command, const int label )
{ point thecopy;
  /* make a copy of the incoming point for certain commands: */
  if ( (command==APPEND)||(command==NEW) )
  { thecopy=newpoint(); thecopy->label=-1; thecopy->x=0.0;
    thecopy->y=0.0; thecopy->z=0.0;
  }
  switch(command) {
    case START:  { while(thedll->PREV!=(point)NULL) thedll=thedll->PREV;
                   thedll=thedll->NEXT; /* because first item isn't used */
		   return thedll;
		 }
	case END:    { while((thedll!=(point)NULL)&&
	               (thedll->NEXT!=(point)NULL)) thedll=thedll->NEXT;
		   return thedll;
		 }
    case SEARCH: { thedll=point_dll(thedll,START,0);
		   while((thedll->label!=label)&&(thedll->NEXT!=(point)NULL))
		     thedll=thedll->NEXT;
		   if (thedll->label==label) return thedll;
		   else
		   {   evaluate_level(YELLOW,11);
			   return (point)NULL;
		   }
		 }
    case APPEND: { point_dll(thedll,END,0);
		   thedll->NEXT=thecopy;
		   thecopy->NEXT=(point)NULL;
		   thecopy->PREV=thedll;
		   return thecopy;
		 }
    case NEW:    { thecopy->PREV=(point)NULL;
		   thecopy->NEXT=(point)NULL;
		   return thecopy;
		 }
    case KILL:   { thedll=point_dll(thedll,END,0);
		   while(thedll->PREV!=(point)NULL)
		   { thedll=thedll->PREV;
		     myfree(thedll->NEXT);
		   }
		   myfree(thedll);
		   return (point)NULL;
		 }
    default:     { evaluate_level(YELLOW,12);
		 }
  } /* switch */
return (point)NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leal -0x3(%r14), %ecx
cmpl $0x1, %ecx
ja 0xcc5f
callq 0xcbe8
movl $0xffffffff, 0x10(%rax) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, 0x20(%rax)
movq $0x0, 0x30(%rax)
cmpl $0x5, %r14d
ja 0xcd1a
movl %r14d, %ecx
leaq 0x38fd(%rip), %rdx      # 0x10570
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rbx, %rax
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0xcc7c
movq 0x8(%rax), %rax
jmp 0xcd2b
movq %rbx, %rax
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0xcc90
movq 0x8(%rax), %rax
cmpl %ebp, 0x10(%rax)
je 0xcd2b
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xcc9f
movl $0x1, %edi
movl $0xb, %esi
jmp 0xcd24
testq %rbx, %rbx
je 0xcd29
movq %rbx, %rax
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xccbd
jmp 0xcd2b
movq %rbx, %r14
testq %rbx, %rbx
je 0xccef
movq 0x8(%r14), %rbx
testq %rbx, %rbx
jne 0xccd0
jmp 0xccef
movq %rax, %r14
movq 0x8(%rax), %rdi
callq 0xcbb0
movq (%r14), %rax
testq %rax, %rax
jne 0xcce3
movq %r14, %rdi
callq 0xcbb0
jmp 0xcd29
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
jmp 0xcd2b
movq %rax, 0x8(%rbx)
movq $0x0, 0x8(%rax)
movq %rbx, (%rax)
jmp 0xcd2b
movl $0x1, %edi
movl $0xc, %esi
callq 0xb980
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markpeerdeman[P]mbemm/src/general/restr.c
// Function: newrestraint
restraint newrestraint( void )
{ restraint r;
  if ( (r=(restraint)mymalloc(sizeof(restrainttype))) == (restraint)NULL )
    evaluate_level(RED,80);
  r->PREV=(restraint)NULL; r->NEXT=(restraint)NULL; r->label=0;
  return r;
}

// Assembly:
pushq %rbx
movl $0x48, %edi
callq 0xcb90
movq %rax, %rbx
testq %rax, %rax
jne 0xcd52
movl $0x2, %edi
movl $0x50, %esi
callq 0xb980
movl $0x0, 0x14(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, (%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/markpeerdeman[P]mbemm/src/general/restr.c
// Function: fill_restraints
void fill_restraints(restraint r, FILE *fp)
{ char theKeyword[80];
  int type;
  double x;
  double y;
  double z;
  while(1)
  { read_keyword(fp,theKeyword);
    if (!strcmp(theKeyword,"END_TRACTIONS"))     return;
    if (!strcmp(theKeyword,"END_DISPLACEMENTS")) return;
    if (!strcmp(theKeyword,"END"))               return;
    type=r->type;
    r=(restraint)restraint_dll(r,APPEND,0);
    r->type  = type;
    r->label = atoi(theKeyword);

    read_keyword(fp,theKeyword); 
	  x = strtod(theKeyword,NULL);

    read_keyword(fp,theKeyword); 
	  y = strtod(theKeyword,NULL);
	  
    read_keyword(fp,theKeyword); 
	  z = strtod(theKeyword,NULL);

    /* if (r->type==TRACTION) */
    { r->f1 = x;
      r->f2 = y;
      r->f3 = z;
    }
    /* if (r->type==DISPLACEMENT) */
    { r->u1 = x;
      r->u2 = y;
      r->u3 = z;
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %rbx
movq %rdi, %r12
movabsq $0x434152545f444e45, %r15 # imm = 0x434152545F444E45
movabsq $0x534e4f49544341, %rbp # imm = 0x534E4F49544341
leaq 0x10(%rsp), %r14
movq %rsi, %rdi
movq %r14, %rsi
callq 0x64fc
movq (%r14), %rax
xorq %r15, %rax
movq 0x6(%r14), %rcx
xorq %rbp, %rcx
orq %rax, %rcx
je 0xceda
leaq 0x10(%rsp), %r14
movzwl 0x20(%rsp), %eax
movd %eax, %xmm0
pcmpeqb 0x37d8(%rip), %xmm0     # 0x105a0
movdqa 0x10(%rsp), %xmm1
pcmpeqb 0x37ba(%rip), %xmm1     # 0x10590
pand %xmm0, %xmm1
pmovmskb %xmm1, %eax
cmpl $0xffff, %eax           # imm = 0xFFFF
je 0xceda
cmpl $0x444e45, 0x10(%rsp)   # imm = 0x444E45
je 0xceda
movl 0x10(%r12), %r13d
callq 0xcd30
movq %rax, %r15
movq %r12, %rax
movq 0x8(%r12), %r12
testq %r12, %r12
jne 0xce04
movq %r15, 0x8(%rax)
movq %rax, (%r15)
movq $0x0, 0x8(%r15)
movl %r13d, 0x10(%r15)
movq %r14, %rdi
callq 0x1180
movl %eax, 0x14(%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64fc
movq %r14, %rdi
xorl %esi, %esi
callq 0x1070
movq %xmm0, 0x8(%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64fc
movq %r14, %rdi
xorl %esi, %esi
callq 0x1070
movq %xmm0, (%rsp)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64fc
movq %r14, %rdi
xorl %esi, %esi
callq 0x1070
movq 0x8(%rsp), %xmm1
movq %xmm1, 0x18(%r15)
movsd (%rsp), %xmm2
movsd %xmm2, 0x20(%r15)
movq %xmm0, 0x28(%r15)
movq %xmm1, 0x30(%r15)
movsd %xmm2, 0x38(%r15)
movq %xmm0, 0x40(%r15)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x64fc
movq 0x10(%rsp), %rax
movabsq $0x434152545f444e45, %rcx # imm = 0x434152545F444E45
xorq %rcx, %rax
movq 0x16(%rsp), %rcx
xorq %rbp, %rcx
orq %rax, %rcx
movq %r15, %r12
jne 0xcdb7
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/markpeerdeman[P]mbemm/src/general/restr.c
// Function: restraint_dll
restraint restraint_dll( restraint thedll, const int command, const int label )
{ restraint thecopy;
  /* make a copy of the incoming restraint for certain commands: */
  if ((command==APPEND)||(command==NEW)) thecopy=(restraint)newrestraint();
	switch(command) {
	case START:  { while(thedll->PREV!=(restraint)NULL) thedll=thedll->PREV;
				   thedll=thedll->NEXT;
				   return thedll;
				 }
	case END:    { while((thedll!=(restraint)NULL)&&
	               (thedll->NEXT!=(restraint)NULL)) thedll=thedll->NEXT;
				   return thedll;
				 }
	case SEARCH: { if (thedll->NEXT==NULL) return (restraint)NULL;
				   thedll=restraint_dll(thedll,START,0);
				   while((thedll->label!=label)&&(thedll->NEXT!=(restraint)NULL))
				   { thedll=thedll->NEXT;
				   }
				   if (thedll->label==label) return thedll;
				   else
				   {/*  evaluate_level(YELLOW,81); */
					 return (restraint)NULL;
				   }
				 }
	case APPEND: { thedll = restraint_dll(thedll,END,0);
				   thedll->NEXT=thecopy;
				   thecopy->PREV=thedll;
				   thecopy->NEXT=(restraint)NULL;
				   return thecopy;
				 }
	case NEW:    { thecopy->PREV=(restraint)NULL;
				   thecopy->NEXT=(restraint)NULL;
				   return thecopy;
				 }
	case KILL:   { thedll=restraint_dll(thedll,END,0);
				   while(thedll->PREV!=(restraint)NULL)
				   { thedll=thedll->PREV;
					 myfree(thedll->NEXT);
				   }
				   myfree(thedll);
				   return (restraint)NULL;
				 }
	default:     { evaluate_level(YELLOW,82);
				 }
  } /* switch */
return (restraint)NULL;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leal -0x3(%r14), %ecx
cmpl $0x1, %ecx
ja 0xcf03
callq 0xcd30
cmpl $0x5, %r14d
ja 0xcfcb
movl %r14d, %ecx
leaq 0x3699(%rip), %rdx      # 0x105b0
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movq %rbx, %rax
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0xcf20
movq 0x8(%rax), %rax
jmp 0xcfdc
movq %rbx, %rcx
testq %rbx, %rbx
je 0xcf45
movq 0x8(%rcx), %rbx
testq %rbx, %rbx
jne 0xcf34
movq %rax, 0x8(%rcx)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
jmp 0xcfdc
testq %rbx, %rbx
je 0xcfda
movq %rbx, %rax
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0xcf59
jmp 0xcfdc
movq %rbx, %r14
testq %rbx, %rbx
je 0xcf8b
movq 0x8(%r14), %rbx
testq %rbx, %rbx
jne 0xcf6c
jmp 0xcf8b
movq %rax, %r14
movq 0x8(%rax), %rdi
callq 0xcbb0
movq (%r14), %rax
testq %rax, %rax
jne 0xcf7f
movq %r14, %rdi
callq 0xcbb0
jmp 0xcfda
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
jmp 0xcfdc
cmpq $0x0, 0x8(%rbx)
je 0xcfda
movq %rbx, %rax
movq (%rbx), %rbx
testq %rbx, %rbx
jne 0xcfac
movq 0x8(%rax), %rax
cmpl %ebp, 0x14(%rax)
je 0xcfdc
movq 0x8(%rax), %rax
testq %rax, %rax
jne 0xcfbb
jmp 0xcfda
movl $0x1, %edi
movl $0x52, %esi
callq 0xb980
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O3/markpeerdeman[P]mbemm/src/general/tril.c
// Function: fillTRIL
void fillTRIL(element theElement, FILE *fp)
{ char theKeyword[80];
  while (1)
  { read_keyword(fp,theKeyword);
    if (!strcmp(theKeyword,"END_ELEMENTS")) return;
    theElement=(element)element_dll(theElement,APPEND,0);
    theElement->type =  TRIL;
    theElement->label = atoi(theKeyword); 
    read_keyword(fp,theKeyword); theElement->p1 = atoi(theKeyword);
    read_keyword(fp,theKeyword); theElement->p2 = atoi(theKeyword);
    read_keyword(fp,theKeyword); theElement->p3 = atoi(theKeyword);
  }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x50, %rsp
movq %rsi, %rbx
movq %rdi, %r14
movabsq $0x4d454c455f444e45, %r12 # imm = 0x4D454C455F444E45
movabsq $0x53544e454d454c, %r13 # imm = 0x53544E454D454C
movq %rsp, %r15
movq %rsi, %rdi
movq %r15, %rsi
callq 0x64fc
movq (%r15), %rax
xorq %r12, %rax
movq 0x5(%r15), %rcx
xorq %r13, %rcx
orq %rax, %rcx
je 0xd0bf
movq %rsp, %r15
movq %r14, %rdi
movl $0x3, %esi
xorl %edx, %edx
callq 0xb570
movq %rax, %r14
movl $0x2, 0x10(%rax)
movq %r15, %rdi
callq 0x1180
movl %eax, 0x14(%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64fc
movq %r15, %rdi
callq 0x1180
movl %eax, 0x18(%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64fc
movq %r15, %rdi
callq 0x1180
movl %eax, 0x1c(%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64fc
movq %r15, %rdi
callq 0x1180
movl %eax, 0x20(%r14)
movq %rbx, %rdi
movq %r15, %rsi
callq 0x64fc
movq (%rsp), %rax
xorq %r12, %rax
movq 0x5(%rsp), %rcx
xorq %r13, %rcx
orq %rax, %rcx
jne 0xd032
addq $0x50, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/rrdclient.c
// Function: cleanup
static void
cleanup(int signal)
{
    fprintf(stderr, "caught signal %d, cleaning up\n", signal);
    if (plugin) {
        rrd_close(plugin);
    }
    exit(1);
}

// Assembly:
pushq %rax
movl %edi, %edx
movq 0x7a11(%rip), %rax      # 0x9ff8
movq (%rax), %rdi
leaq 0x4acd(%rip), %rsi      # 0x70be
xorl %eax, %eax
callq 0x21f0
movq 0x7b99(%rip), %rdi      # 0xa198
testq %rdi, %rdi
je 0x2609
callq 0x2c2d
movl $0x1, %edi
callq 0x22b0
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/librrd.c
// Function: rrd_open
RRD_PLUGIN     *
rrd_open(char *name, rrd_domain_t domain, char *path)
{
    assert(name);
    assert(path);

    RRD_PLUGIN     *plugin = malloc(sizeof(RRD_PLUGIN));
    if (!plugin) {
        return NULL;
    }
    plugin->name = name;
    plugin->path = path;
    plugin->domain = domain;
    /*
     * mark all slots for data sources as free
     */
    for (int i = 0; i < RRD_MAX_SOURCES; i++) {
        plugin->sources[i] = (RRD_SOURCE *) NULL;
    }
    plugin->n = 0;
    plugin->buf_size = 0;
    plugin->buf = NULL;
    plugin->meta = NULL;

    if (initialise(plugin) != 0) {
        invalidate(plugin);
        free(plugin);
        return NULL;
    }
    plugin->file = open(path, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
    if (plugin->file == -1) {
        invalidate(plugin);
        free(plugin);
        return NULL;
    }
    if (write_exact(plugin->file, plugin->buf, plugin->buf_size) != 0) {
        invalidate(plugin);
        free(plugin);
        return NULL;
    }
    return plugin;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x275d
movq %rdx, %r14
testq %rdx, %rdx
je 0x277c
movl %esi, %ebp
movq %rdi, %r15
movl $0xb8, %edi
callq 0x2240
testq %rax, %rax
je 0x2710
movq %rax, %rbx
movq %r15, (%rax)
movq %r14, 0x8(%rax)
movl %ebp, 0xa0(%rax)
movq %rax, %rdi
addq $0x10, %rdi
movl $0x0, 0xa4(%rax)
movq $0x0, 0xa8(%rax)
movl $0x90, %edx
xorl %esi, %esi
callq 0x21a0
movq %rbx, %rdi
callq 0x279b
testl %eax, %eax
je 0x2720
movq 0x98(%rbx), %r14
movq %r14, %rdi
callq 0x2030
xorl %eax, %eax
movq %rax, 0x98(%rbx)
movq %rax, 0xa8(%rbx)
movq 0x90(%rbx), %rdi
callq 0x3c53
movq %rbx, %rdi
callq 0x2030
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
movl $0x42, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2280
movl %eax, 0xb0(%rbx)
movq 0x98(%rbx), %r14
cmpl $-0x1, %eax
je 0x26e4
movq 0xa8(%rbx), %rdx
movl %eax, %edi
movq %r14, %rsi
callq 0x2bcd
testl %eax, %eax
jne 0x26e4
jmp 0x2712
leaq 0x499c(%rip), %rdi      # 0x7100
leaq 0x499a(%rip), %rsi      # 0x7105
leaq 0x499c(%rip), %rcx      # 0x710e
movl $0x13e, %edx            # imm = 0x13E
callq 0x2180
leaq 0x49be(%rip), %rdi      # 0x7141
leaq 0x497b(%rip), %rsi      # 0x7105
leaq 0x497d(%rip), %rcx      # 0x710e
movl $0x13f, %edx            # imm = 0x13F
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/librrd.c
// Function: write_exact
static int
write_exact(int fd, const void *data, size_t size)
{
    size_t          offset = 0;
    ssize_t         len;
    while (offset < size) {
        len = write(fd, (const char *)data + offset, size - offset);
        if ((len == -1) && (errno == EINTR))
            continue;
        if (len <= 0)
            return -1;
        offset += len;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r15
movl %edi, %ebp
xorl %ebx, %ebx
movq %r14, %r12
subq %rbx, %r12
jbe 0x2c29
leaq (%r15,%rbx), %r13
movl %ebp, %edi
movq %r13, %rsi
movq %r12, %rdx
callq 0x20e0
cmpq $-0x1, %rax
jne 0x2c0d
callq 0x2050
cmpl $0x4, (%rax)
je 0x2bee
jmp 0x2c15
addq %rax, %rbx
testq %rax, %rax
jg 0x2be2
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %eax, %eax
jmp 0x2c1a
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/librrd.c
// Function: rrd_close
int
rrd_close(RRD_PLUGIN * plugin)
{
    assert(plugin);
    int             rc;


    rc = close(plugin->file);
    if (rc == 0)
        rc = unlink(plugin->path);
    invalidate(plugin);
    free(plugin);
    return (rc == 0 ? RRD_OK : RRD_FILE_ERROR);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2c98
movq %rdi, %rbx
movl 0xb0(%rdi), %edi
callq 0x21b0
movl $0x3, %ebp
testl %eax, %eax
jne 0x2c5f
movq 0x8(%rbx), %rdi
callq 0x2060
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
leal (%rcx,%rcx,2), %ebp
movq 0x98(%rbx), %rdi
callq 0x2030
xorl %eax, %eax
movq %rax, 0x98(%rbx)
movq %rax, 0xa8(%rbx)
movq 0x90(%rbx), %rdi
callq 0x3c53
movq %rbx, %rdi
callq 0x2030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
leaq 0x44a7(%rip), %rdi      # 0x7146
leaq 0x445f(%rip), %rsi      # 0x7105
leaq 0x44a0(%rip), %rcx      # 0x714d
movl $0x16d, %edx            # imm = 0x16D
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/librrd.c
// Function: rrd_add_src
int
rrd_add_src(RRD_PLUGIN * plugin, RRD_SOURCE * source)
{
    assert(plugin);
    assert(source);

    /*
     * find free slot
     */
    size_t          i;
    for (i = 0; i < RRD_MAX_SOURCES; i++) {
        if (plugin->sources[i] == NULL)
            break;
    }
    if (i >= RRD_MAX_SOURCES) {
        return RRD_TOO_MANY_SOURCES;
    }
    plugin->sources[i] = source;
    plugin->n++;
    invalidate(plugin);

    return RRD_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rdi, %rdi
je 0x2d2d
testq %rsi, %rsi
je 0x2d4c
movq %rdi, %rbx
xorl %eax, %eax
cmpq $0x0, 0x10(%rbx,%rax,8)
je 0x2ce7
incq %rax
cmpq $0x10, %rax
jne 0x2cce
movl $0x1, %r14d
jmp 0x2d22
movq %rsi, 0x10(%rbx,%rax,8)
incl 0xa4(%rbx)
movq 0x98(%rbx), %rdi
callq 0x2030
xorl %r14d, %r14d
movq %r14, 0x98(%rbx)
movq %r14, 0xa8(%rbx)
movq 0x90(%rbx), %rdi
callq 0x3c53
movq %r14, 0x90(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x4412(%rip), %rdi      # 0x7146
leaq 0x43ca(%rip), %rsi      # 0x7105
leaq 0x4427(%rip), %rcx      # 0x7169
movl $0x17f, %edx            # imm = 0x17F
callq 0x2180
leaq 0x4442(%rip), %rdi      # 0x7195
leaq 0x43ab(%rip), %rsi      # 0x7105
leaq 0x4408(%rip), %rcx      # 0x7169
movl $0x180, %edx            # imm = 0x180
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/librrd.c
// Function: rrd_del_src
int
rrd_del_src(RRD_PLUGIN * plugin, RRD_SOURCE * source)
{
    assert(source);
    size_t          i;
    /*
     * find slot with source
     */
    for (i = 0; i < RRD_MAX_SOURCES; i++) {
        if (plugin->sources[i] == source)
            break;
    }
    if (i >= RRD_MAX_SOURCES) {
        return RRD_NO_SUCH_SOURCE;
    }
    plugin->sources[i] = NULL;
    plugin->n--;
    invalidate(plugin);

    return RRD_OK;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
testq %rsi, %rsi
je 0x2dd7
movq %rdi, %rbx
xorl %eax, %eax
cmpq %rsi, 0x10(%rbx,%rax,8)
je 0x2d91
incq %rax
cmpq $0x10, %rax
jne 0x2d79
movl $0x2, %r14d
jmp 0x2dcc
xorl %r14d, %r14d
movq %r14, 0x10(%rbx,%rax,8)
decl 0xa4(%rbx)
movq 0x98(%rbx), %rdi
callq 0x2030
movq %r14, 0x98(%rbx)
movq %r14, 0xa8(%rbx)
movq 0x90(%rbx), %rdi
callq 0x3c53
movq %r14, 0x90(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x43b7(%rip), %rdi      # 0x7195
leaq 0x4320(%rip), %rsi      # 0x7105
leaq 0x43b0(%rip), %rcx      # 0x719c
movl $0x19a, %edx            # imm = 0x19A
callq 0x2180
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_parse_file
JSON_Value * json_parse_file(const char *filename) {
    char *file_contents = read_file(filename);
    JSON_Value *output_value = NULL;
    if (file_contents == NULL) {
        return NULL;
    }
    output_value = json_parse_string(file_contents);
    parson_free(file_contents);
    return output_value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x2fb4
testq %rax, %rax
je 0x2faa
movq %rax, %rbx
movq %rax, %rdi
callq 0x3060
movq %rax, %r14
movq %rbx, %rdi
callq *0x71db(%rip)           # 0xa180
movq %r14, %rax
jmp 0x2fac
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: read_file
static char * read_file(const char * filename) {
    FILE *fp = fopen(filename, "r");
    size_t file_size;
    long pos;
    char *file_contents;
    if (!fp) {
        return NULL;
    }
    fseek(fp, 0L, SEEK_END);
    pos = ftell(fp);
    if (pos < 0) {
        fclose(fp);
        return NULL;
    }
    file_size = pos;
    rewind(fp);
    file_contents = (char*)parson_malloc(sizeof(char) * (file_size + 1));
    if (!file_contents) {
        fclose(fp);
        return NULL;
    }
    if (fread(file_contents, file_size, 1, fp) < 1) {
        if (ferror(fp)) {
            fclose(fp);
            parson_free(file_contents);
            return NULL;
        }
    }
    fclose(fp);
    file_contents[file_size] = '\0';
    return file_contents;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
leaq 0x4505(%rip), %rsi      # 0x74c5
callq 0x2290
testq %rax, %rax
je 0x3035
movq %rax, %rbx
movq %rax, %rdi
xorl %esi, %esi
movl $0x2, %edx
callq 0x2250
movq %rbx, %rdi
callq 0x2210
testq %rax, %rax
js 0x302d
movq %rax, %r15
movq %rbx, %rdi
callq 0x2140
leaq 0x1(%r15), %rdi
callq *0x718a(%rip)           # 0xa188
testq %rax, %rax
je 0x302d
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq 0x20b0
testq %rax, %rax
je 0x3041
movq %rbx, %rdi
callq 0x20f0
movb $0x0, (%r14,%r15)
jmp 0x3038
movq %rbx, %rdi
callq 0x20f0
xorl %r14d, %r14d
movq %r14, %rax
popq %rbx
popq %r14
popq %r15
retq
movq %rbx, %rdi
callq 0x2090
testl %eax, %eax
je 0x301e
movq %rbx, %rdi
callq 0x20f0
movq %r14, %rdi
callq *0x7122(%rip)           # 0xa180
jmp 0x3035
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_parse_string
JSON_Value * json_parse_string(const char *string) {
    if (string == NULL) {
        return NULL;
    }
    if (string[0] == '\xEF' && string[1] == '\xBB' && string[2] == '\xBF') {
        string = string + 3; /* Support for UTF-8 BOM */
    }
    return parse_value((const char**)&string, 0);
}

// Assembly:
pushq %rax
movq %rdi, (%rsp)
testq %rdi, %rdi
je 0x308f
cmpb $-0x11, (%rdi)
jne 0x3083
cmpb $-0x45, 0x1(%rdi)
jne 0x3083
cmpb $-0x41, 0x2(%rdi)
jne 0x3083
addq $0x3, %rdi
movq %rdi, (%rsp)
movq %rsp, %rdi
xorl %esi, %esi
callq 0x312d
jmp 0x3091
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_parse_file_with_comments
JSON_Value * json_parse_file_with_comments(const char *filename) {
    char *file_contents = read_file(filename);
    JSON_Value *output_value = NULL;
    if (file_contents == NULL) {
        return NULL;
    }
    output_value = json_parse_string_with_comments(file_contents);
    parson_free(file_contents);
    return output_value;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x2fb4
testq %rax, %rax
je 0x30bd
movq %rax, %rbx
movq %rax, %rdi
callq 0x30c7
movq %rax, %r14
movq %rbx, %rdi
callq *0x70c8(%rip)           # 0xa180
movq %r14, %rax
jmp 0x30bf
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_parse_string_with_comments
JSON_Value * json_parse_string_with_comments(const char *string) {
    JSON_Value *result = NULL;
    char *string_mutable_copy = NULL, *string_mutable_copy_ptr = NULL;
    string_mutable_copy = parson_strdup(string);
    if (string_mutable_copy == NULL) {
        return NULL;
    }
    remove_comments(string_mutable_copy, "/*", "*/");
    remove_comments(string_mutable_copy, "//", "\n");
    string_mutable_copy_ptr = string_mutable_copy;
    result = parse_value((const char**)&string_mutable_copy_ptr, 0);
    parson_free(string_mutable_copy);
    return result;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
callq 0x36dc
testq %rax, %rax
je 0x311f
movq %rax, %rbx
leaq 0x43a9(%rip), %rsi      # 0x7488
leaq 0x43a5(%rip), %rdx      # 0x748b
movq %rax, %rdi
callq 0x371c
leaq 0x4399(%rip), %rsi      # 0x748e
leaq 0x3ff3(%rip), %rdx      # 0x70ef
movq %rbx, %rdi
callq 0x371c
movq %rsp, %rdi
movq %rbx, (%rdi)
xorl %esi, %esi
callq 0x312d
movq %rax, %r14
movq %rbx, %rdi
callq *0x7063(%rip)           # 0xa180
jmp 0x3122
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: remove_comments
static void remove_comments(char *string, const char *start_token, const char *end_token) {
    int in_string = 0, escaped = 0;
    size_t i;
    char *ptr = NULL, current_char;
    size_t start_token_len = strlen(start_token);
    size_t end_token_len = strlen(end_token);
    if (start_token_len == 0 || end_token_len == 0) {
        return;
    }
    while ((current_char = *string) != '\0') {
        if (current_char == '\\' && !escaped) {
            escaped = 1;
            string++;
            continue;
        } else if (current_char == '\"' && !escaped) {
            in_string = !in_string;
        } else if (!in_string && strncmp(string, start_token, start_token_len) == 0) {
            for(i = 0; i < start_token_len; i++) {
                string[i] = ' ';
            }
            string = string + start_token_len;
            ptr = strstr(string, end_token);
            if (!ptr) {
                return;
            }
            for (i = 0; i < (ptr - string) + end_token_len; i++) {
                string[i] = ' ';
            }
            string = ptr + end_token_len - 1;
        }
        escaped = 0;
        string++;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, %rdi
callq 0x2110
movq %rax, %r15
movq %rbx, (%rsp)
movq %rbx, %rdi
callq 0x2110
movq %rax, %r13
testq %r15, %r15
sete %al
testq %r13, %r13
sete %cl
orb %al, %cl
jne 0x3817
movb (%r12), %cl
testb %cl, %cl
je 0x3817
xorl %eax, %eax
cmpb $0x5c, %cl
jne 0x3783
movb 0x1(%r12), %dl
testb %dl, %dl
je 0x3817
incq %r12
jmp 0x3785
movl %ecx, %edx
cmpb $0x5c, %cl
sete %cl
cmpb $0x22, %dl
setne %dl
orb %cl, %dl
je 0x37fe
movl $0x1, %ebx
testl %eax, %eax
jne 0x3805
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x2080
xorl %ebx, %ebx
testl %eax, %eax
jne 0x3805
movq %r12, %rdi
movl $0x20, %esi
movq %r15, %rdx
callq 0x21a0
addq %r15, %r12
movq %r12, %rdi
movq (%rsp), %rsi
callq 0x22c0
testq %rax, %rax
je 0x3817
movq %rax, %rbp
movq %r13, %rdx
subq %r12, %rdx
addq %rax, %rdx
je 0x37f1
movq %r12, %rdi
movl $0x20, %esi
callq 0x21a0
leaq -0x1(,%r13), %r12
addq %rbp, %r12
jmp 0x3805
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
movb 0x1(%r12), %cl
incq %r12
movl %ebx, %eax
testb %cl, %cl
jne 0x376c
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_object_nget_value
static JSON_Value * json_object_nget_value(const JSON_Object *object, const char *name, size_t n) {
    size_t i, name_length;
    for (i = 0; i < json_object_get_count(object); i++) {
        name_length = strlen(object->names[i]);
        if (name_length != n) {
            continue;
        }
        if (strncmp(object->names[i], name, n) == 0) {
            return object->values[i];
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
xorl %ebx, %ebx
xorl %ebp, %ebp
testq %r15, %r15
je 0x3880
movq 0x18(%r15), %rax
jmp 0x3882
xorl %eax, %eax
cmpq %rax, %rbp
jae 0x38bb
movq 0x8(%r15), %rax
movq (%rax,%rbp,8), %r13
movq %r13, %rdi
callq 0x2110
cmpq %r14, %rax
jne 0x38ae
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x2080
testl %eax, %eax
je 0x38b3
incq %rbp
jmp 0x3875
movq 0x10(%r15), %rax
movq (%rax,%rbp,8), %rbx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_object_dotget_value
JSON_Value * json_object_dotget_value(const JSON_Object *object, const char *name) {
    const char *dot_position = strchr(name, '.');
    if (!dot_position) {
        return json_object_get_value(object, name);
    }
    object = json_value_get_object(json_object_nget_value(object, name, dot_position - name));
    return json_object_dotget_value(object, dot_position + 1);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %r15
movq %rdi, %rbx
movq %rsi, %rdi
movl $0x2e, %esi
callq 0x2120
testq %rax, %rax
je 0x3a17
movq %rax, %r14
movq %r14, %rdx
subq %r15, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x385d
testq %rax, %rax
je 0x39fa
cmpl $0x4, 0x8(%rax)
jne 0x39fa
movq 0x10(%rax), %rbx
jmp 0x39fc
xorl %ebx, %ebx
movq %r14, %r15
incq %r15
movq %r15, %rdi
movl $0x2e, %esi
callq 0x2120
movq %rax, %r14
testq %rax, %rax
jne 0x39d8
movq %rbx, %rdi
movq %r15, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x3826
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_free
void json_value_free(JSON_Value *value) {
    switch (json_value_get_type(value)) {
        case JSONObject:
            json_object_free(value->value.object);
            break;
        case JSONString:
            parson_free(value->value.string);
            break;
        case JSONArray:
            json_array_free(value->value.array);
            break;
        default:
            break;
    }
    parson_free(value);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
testq %rdi, %rdi
je 0x3cf5
movl 0x8(%rbx), %eax
cmpl $0x2, %eax
je 0x3ceb
cmpl $0x5, %eax
je 0x3cb8
cmpl $0x4, %eax
jne 0x3cf5
movq 0x10(%rbx), %r14
cmpq $0x0, 0x18(%r14)
je 0x3ca8
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rdi
callq *0x64ee(%rip)           # 0xa180
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3c53
incq %r15
cmpq 0x18(%r14), %r15
jb 0x3c84
movq 0x8(%r14), %rdi
callq *0x64ce(%rip)           # 0xa180
movq 0x10(%r14), %rdi
jmp 0x3ce0
movq 0x10(%rbx), %r14
cmpq $0x0, 0x10(%r14)
je 0x3cdc
xorl %r15d, %r15d
movq 0x8(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3c53
incq %r15
cmpq 0x10(%r14), %r15
jb 0x3cc6
movq 0x8(%r14), %rdi
callq *0x649a(%rip)           # 0xa180
movq %r14, %rdi
jmp 0x3cef
movq 0x10(%rbx), %rdi
callq *0x648b(%rip)           # 0xa180
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmpq *0x647d(%rip)           # 0xa180
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_init_object
JSON_Value * json_value_init_object(void) {
    JSON_Value *new_value = (JSON_Value*)parson_malloc(sizeof(JSON_Value));
    if (!new_value) {
        return NULL;
    }
    new_value->parent = NULL;
    new_value->type = JSONObject;
    new_value->value.object = json_object_init(new_value);
    if (!new_value->value.object) {
        parson_free(new_value);
        return NULL;
    }
    return new_value;
}

// Assembly:
pushq %rbx
movl $0x18, %edi
callq *0x6479(%rip)           # 0xa188
testq %rax, %rax
je 0x3d5a
movq %rax, %rbx
movq $0x0, (%rax)
movl $0x4, 0x8(%rax)
movl $0x28, %edi
callq *0x6458(%rip)           # 0xa188
testq %rax, %rax
je 0x3d49
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movups %xmm0, 0x18(%rax)
movq %rax, 0x10(%rbx)
jmp 0x3d5c
movq $0x0, 0x10(%rbx)
movq %rbx, %rdi
callq *0x6426(%rip)           # 0xa180
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_init_array
JSON_Value * json_value_init_array(void) {
    JSON_Value *new_value = (JSON_Value*)parson_malloc(sizeof(JSON_Value));
    if (!new_value) {
        return NULL;
    }
    new_value->parent = NULL;
    new_value->type = JSONArray;
    new_value->value.array = json_array_init(new_value);
    if (!new_value->value.array) {
        parson_free(new_value);
        return NULL;
    }
    return new_value;
}

// Assembly:
pushq %rbx
movl $0x18, %edi
callq *0x641b(%rip)           # 0xa188
testq %rax, %rax
je 0x3dbc
movq %rax, %rbx
movq $0x0, (%rax)
movl $0x5, 0x8(%rax)
movl $0x20, %edi
callq *0x63fa(%rip)           # 0xa188
testq %rax, %rax
je 0x3dab
movq %rbx, (%rax)
xorps %xmm0, %xmm0
movups %xmm0, 0x8(%rax)
movq $0x0, 0x18(%rax)
movq %rax, 0x10(%rbx)
jmp 0x3dbe
movq $0x0, 0x10(%rbx)
movq %rbx, %rdi
callq *0x63c4(%rip)           # 0xa180
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_init_string
JSON_Value * json_value_init_string(const char *string) {
    char *copy = NULL;
    JSON_Value *value;
    size_t string_len = 0;
    if (string == NULL) {
        return NULL;
    }
    string_len = strlen(string);
    if (!is_valid_utf8(string, string_len)) {
        return NULL;
    }
    copy = parson_strndup(string, string_len);
    if (copy == NULL) {
        return NULL;
    }
    value = json_value_init_string_no_copy(copy);
    if (value == NULL) {
        parson_free(copy);
    }
    return value;
}

// Assembly:
testq %rdi, %rdi
je 0x3fc9
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
callq 0x2110
movq %rax, %r14
testq %rax, %rax
jle 0x3f80
leaq (%rbx,%r14), %rcx
xorl %eax, %eax
movq %rbx, %rdx
movzbl (%rdx), %esi
cmpl $0xf4, %esi
ja 0x3fd7
movl %esi, %edi
andb $-0x2, %dil
cmpb $-0x40, %dil
je 0x3fd7
movl %esi, %edi
andl $-0x40, %edi
cmpl $0x80, %edi
je 0x3fd7
movl $0x1, %r8d
testb %sil, %sil
jns 0x3f74
movl %esi, %edi
andl $-0x20, %edi
cmpl $0xc0, %edi
jne 0x3e59
movb 0x1(%rdx), %r8b
andb $-0x40, %r8b
negb %r8b
jno 0x3fd7
andl $0x1f, %esi
shll $0x6, %esi
movl $0x2, %r8d
jmp 0x3eaa
movl %esi, %r8d
andl $-0x10, %r8d
cmpl $0xe0, %r8d
jne 0x3eaf
movzbl 0x1(%rdx), %r8d
movl %r8d, %r9d
andl $-0x40, %r9d
cmpl $0x80, %r9d
jne 0x3fd7
movb 0x2(%rdx), %r9b
andb $-0x40, %r9b
negb %r9b
jno 0x3fd7
andl $0xf, %esi
shll $0xc, %esi
andl $0x3f, %r8d
shll $0x6, %r8d
orl %r8d, %esi
movl $0x3, %r8d
xorl %r10d, %r10d
jmp 0x3f2e
movl %esi, %r8d
andl $-0x8, %r8d
cmpl $0xf0, %r8d
jne 0x3fd7
movzbl 0x1(%rdx), %r8d
movl %r8d, %r9d
andl $-0x40, %r9d
cmpl $0x80, %r9d
jne 0x3fd7
movzbl 0x2(%rdx), %r9d
movl %r9d, %r10d
andl $-0x40, %r10d
cmpl $0x80, %r10d
jne 0x3fd7
movb 0x3(%rdx), %r10b
andb $-0x40, %r10b
negb %r10b
jno 0x3fd7
andl $0x7, %esi
shll $0xc, %esi
andl $0x3f, %r8d
shll $0x6, %r8d
orl %esi, %r8d
andl $0x3f, %r9d
orl %r8d, %r9d
shll $0x6, %r9d
movb $0x1, %r10b
movl $0x4, %r8d
movl %r9d, %esi
cmpl $0x80, %esi
jb 0x3fd7
cmpl $0x7ff, %esi            # imm = 0x7FF
ja 0x3f4f
cmpl $0xc0, %edi
je 0x3f66
jmp 0x3fd7
cmpl $0xffff, %esi           # imm = 0xFFFF
ja 0x3f5e
testb %r10b, %r10b
je 0x3f66
jmp 0x3fd7
cmpl $0x10ffff, %esi         # imm = 0x10FFFF
ja 0x3fd7
andl $0x1ff800, %esi         # imm = 0x1FF800
cmpl $0xd800, %esi           # imm = 0xD800
je 0x3fd7
addq %r8, %rdx
cmpq %rcx, %rdx
jb 0x3dee
leaq 0x1(%r14), %rdi
callq *0x61fe(%rip)           # 0xa188
testq %rax, %rax
je 0x3fd5
movq %rax, %r15
movb $0x0, (%rax,%r14)
movq %rax, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2070
movl $0x18, %edi
callq *0x61d8(%rip)           # 0xa188
testq %rax, %rax
je 0x3fcc
movq $0x0, (%rax)
movl $0x2, 0x8(%rax)
movq %r15, 0x10(%rax)
jmp 0x3fd7
xorl %eax, %eax
retq
movq %r15, %rdi
callq *0x61ab(%rip)           # 0xa180
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_init_number
JSON_Value * json_value_init_number(double number) {
    JSON_Value *new_value = (JSON_Value*)parson_malloc(sizeof(JSON_Value));
    if (!new_value) {
        return NULL;
    }
    new_value->parent = NULL;
    new_value->type = JSONNumber;
    new_value->value.number = number;
    return new_value;
}

// Assembly:
pushq %rax
movsd %xmm0, (%rsp)
movl $0x18, %edi
callq *0x619a(%rip)           # 0xa188
testq %rax, %rax
je 0x400b
movq $0x0, (%rax)
movl $0x3, 0x8(%rax)
movsd (%rsp), %xmm0
movsd %xmm0, 0x10(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_init_boolean
JSON_Value * json_value_init_boolean(int boolean) {
    JSON_Value *new_value = (JSON_Value*)parson_malloc(sizeof(JSON_Value));
    if (!new_value) {
        return NULL;
    }
    new_value->parent = NULL;
    new_value->type = JSONBoolean;
    new_value->value.boolean = boolean ? 1 : 0;
    return new_value;
}

// Assembly:
pushq %rbx
movl %edi, %ebx
movl $0x18, %edi
callq *0x616d(%rip)           # 0xa188
testq %rax, %rax
je 0x4038
movq $0x0, (%rax)
movl $0x6, 0x8(%rax)
xorl %ecx, %ecx
testl %ebx, %ebx
setne %cl
movl %ecx, 0x10(%rax)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_value_init_null
JSON_Value * json_value_init_null(void) {
    JSON_Value *new_value = (JSON_Value*)parson_malloc(sizeof(JSON_Value));
    if (!new_value) {
        return NULL;
    }
    new_value->parent = NULL;
    new_value->type = JSONNull;
    return new_value;
}

// Assembly:
pushq %rax
movl $0x18, %edi
callq *0x6142(%rip)           # 0xa188
testq %rax, %rax
je 0x4059
movq $0x0, (%rax)
movl $0x1, 0x8(%rax)
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_array_add
static JSON_Status json_array_add(JSON_Array *array, JSON_Value *value) {
    if (array->count >= array->capacity) {
        size_t new_capacity = MAX(array->capacity * 2, STARTING_CAPACITY);
        if (new_capacity > ARRAY_MAX_CAPACITY) {
            return JSONFailure;
        }
        if (json_array_resize(array, new_capacity) == JSONFailure) {
            return JSONFailure;
        }
    }
    value->parent = json_array_get_wrapping_value(array);
    array->items[array->count] = value;
    array->count++;
    return JSONSuccess;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rdi), %rax
movq 0x18(%rdi), %rcx
cmpq %rcx, %rax
jb 0x42f1
addq %rcx, %rcx
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpq $0x1e000, %rcx          # imm = 0x1E000
ja 0x4308
cmpq $0x10, %rcx
movl $0xf, %esi
cmovaeq %rcx, %rsi
movq %rbx, %rdi
callq 0x60cf
cmpl $-0x1, %eax
je 0x4308
movq 0x10(%rbx), %rax
movq (%rbx), %rcx
movq %rcx, (%r14)
movq 0x8(%rbx), %rcx
movq %r14, (%rcx,%rax,8)
incq %rax
movq %rax, 0x10(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_object_add
static JSON_Status json_object_add(JSON_Object *object, const char *name, JSON_Value *value) {
    size_t index = 0;
    if (object == NULL || name == NULL || value == NULL) {
        return JSONFailure;
    }
    if (json_object_get_value(object, name) != NULL) {
        return JSONFailure;
    }
    if (object->count >= object->capacity) {
        size_t new_capacity = MAX(object->capacity * 2, STARTING_CAPACITY);
        if (new_capacity > OBJECT_MAX_CAPACITY) {
            return JSONFailure;
        }
        if (json_object_resize(object, new_capacity) == JSONFailure) {
            return JSONFailure;
        }
    }
    index = object->count;
    object->names[index] = parson_strdup(name);
    if (object->names[index] == NULL) {
        return JSONFailure;
    }
    value->parent = json_object_get_wrapping_value(object);
    object->values[index] = value;
    object->count++;
    return JSONSuccess;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jne 0x4340
movq %rdx, %r14
movq %rsi, %r12
movq %rdi, %r15
callq 0x3826
testq %rax, %rax
je 0x434c
movl %ebx, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq 0x18(%r15), %r13
movq 0x20(%r15), %rax
cmpq %rax, %r13
jb 0x4382
addq %rax, %rax
cmpq $0x3c0, %rax            # imm = 0x3C0
ja 0x4340
cmpq $0x10, %rax
movl $0xf, %esi
cmovaeq %rax, %rsi
movq %r15, %rdi
callq 0x5ea0
cmpl $-0x1, %eax
je 0x4340
movq 0x18(%r15), %r13
movq %r12, %rdi
callq 0x36dc
movq 0x8(%r15), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x8(%r15), %rax
cmpq $0x0, (%rax,%r13,8)
je 0x4340
movq (%r15), %rax
movq %rax, (%r14)
movq 0x10(%r15), %rax
movq %r14, (%rax,%r13,8)
incq 0x18(%r15)
xorl %ebx, %ebx
jmp 0x4340
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_to_buffer
JSON_Status json_serialize_to_buffer(const JSON_Value *value, char *buf, size_t buf_size_in_bytes) {
    int written = -1;
    size_t needed_size_in_bytes = json_serialization_size(value);
    if (needed_size_in_bytes == 0 || buf_size_in_bytes < needed_size_in_bytes) {
        return JSONFailure;
    }
    written = json_serialize_to_buffer_r(value, buf, 0, 0, NULL);
    if (written < 0) {
        return JSONFailure;
    }
    return JSONSuccess;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq %rsp, %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x43df
leal 0x1(%rax), %ecx
testl %eax, %eax
cmovsl %r12d, %ecx
testl %ecx, %ecx
sete %al
cmpq %r15, %rcx
seta %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x4a95
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x43df
sarl $0x1f, %eax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_to_file
JSON_Status json_serialize_to_file(const JSON_Value *value, const char *filename) {
    JSON_Status return_code = JSONSuccess;
    FILE *fp = NULL;
    char *serialized_string = json_serialize_to_string(value);
    if (serialized_string == NULL) {
        return JSONFailure;
    }
    fp = fopen (filename, "w");
    if (fp == NULL) {
        json_free_serialized_string(serialized_string);
        return JSONFailure;
    }
    if (fputs(serialized_string, fp) == EOF) {
        return_code = JSONFailure;
    }
    if (fclose(fp) == EOF) {
        return_code = JSONFailure;
    }
    json_free_serialized_string(serialized_string);
    return return_code;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x4b15
testq %rax, %rax
je 0x4af9
movq %rax, %rbx
leaq 0x29d2(%rip), %rsi      # 0x7491
movq %r14, %rdi
callq 0x2290
testq %rax, %rax
je 0x4b00
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2190
cmpl $-0x1, %eax
sete %bpl
movq %r14, %rdi
callq 0x20f0
cmpl $-0x1, %eax
sete %al
orb %bpl, %al
movzbl %al, %ebp
negl %ebp
jmp 0x4b05
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4b0e
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq *0x5672(%rip)           # 0xa180
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_to_string
char * json_serialize_to_string(const JSON_Value *value) {
    JSON_Status serialization_result = JSONFailure;
    size_t buf_size_bytes = json_serialization_size(value);
    char *buf = NULL;
    if (buf_size_bytes == 0) {
        return NULL;
    }
    buf = (char*)parson_malloc(buf_size_bytes);
    if (buf == NULL) {
        return NULL;
    }
    serialization_result = json_serialize_to_buffer(value, buf, buf_size_bytes);
    if (serialization_result == JSONFailure) {
        json_free_serialized_string(buf);
        return NULL;
    }
    return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x450, %rsp            # imm = 0x450
movq %rdi, %r14
xorl %ebx, %ebx
movq %rsp, %r8
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x43df
leal 0x1(%rax), %r15d
testl %eax, %eax
cmovsl %ebx, %r15d
testl %r15d, %r15d
je 0x4b72
movq %r15, %rdi
callq *0x563c(%rip)           # 0xa188
testq %rax, %rax
je 0x4b70
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4a3b
cmpl $-0x1, %eax
jne 0x4b72
movq %rbx, %rdi
callq *0x5610(%rip)           # 0xa180
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x450, %rsp            # imm = 0x450
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_to_buffer_pretty
JSON_Status json_serialize_to_buffer_pretty(const JSON_Value *value, char *buf, size_t buf_size_in_bytes) {
    int written = -1;
    size_t needed_size_in_bytes = json_serialization_size_pretty(value);
    if (needed_size_in_bytes == 0 || buf_size_in_bytes < needed_size_in_bytes) {
        return JSONFailure;
    }
    written = json_serialize_to_buffer_r(value, buf, 0, 1, NULL);
    if (written < 0) {
        return JSONFailure;
    }
    return JSONSuccess;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
xorl %r12d, %r12d
movq %rsp, %r8
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x43df
leal 0x1(%rax), %ecx
testl %eax, %eax
cmovsl %r12d, %ecx
testl %ecx, %ecx
sete %al
cmpq %r15, %rcx
seta %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x4c17
movq %r14, %rdi
movq %rbx, %rsi
xorl %edx, %edx
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x43df
sarl $0x1f, %eax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_to_file_pretty
JSON_Status json_serialize_to_file_pretty(const JSON_Value *value, const char *filename) {
    JSON_Status return_code = JSONSuccess;
    FILE *fp = NULL;
    char *serialized_string = json_serialize_to_string_pretty(value);
    if (serialized_string == NULL) {
        return JSONFailure;
    }
    fp = fopen (filename, "w");
    if (fp == NULL) {
        json_free_serialized_string(serialized_string);
        return JSONFailure;
    }
    if (fputs(serialized_string, fp) == EOF) {
        return_code = JSONFailure;
    }
    if (fclose(fp) == EOF) {
        return_code = JSONFailure;
    }
    json_free_serialized_string(serialized_string);
    return return_code;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
callq 0x4c97
testq %rax, %rax
je 0x4c7b
movq %rax, %rbx
leaq 0x2850(%rip), %rsi      # 0x7491
movq %r14, %rdi
callq 0x2290
testq %rax, %rax
je 0x4c82
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2190
cmpl $-0x1, %eax
sete %bpl
movq %r14, %rdi
callq 0x20f0
cmpl $-0x1, %eax
sete %al
orb %bpl, %al
movzbl %al, %ebp
negl %ebp
jmp 0x4c87
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
jmp 0x4c90
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq *0x54f0(%rip)           # 0xa180
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_serialize_to_string_pretty
char * json_serialize_to_string_pretty(const JSON_Value *value) {
    JSON_Status serialization_result = JSONFailure;
    size_t buf_size_bytes = json_serialization_size_pretty(value);
    char *buf = NULL;
    if (buf_size_bytes == 0) {
        return NULL;
    }
    buf = (char*)parson_malloc(buf_size_bytes);
    if (buf == NULL) {
        return NULL;
    }
    serialization_result = json_serialize_to_buffer_pretty(value, buf, buf_size_bytes);
    if (serialization_result == JSONFailure) {
        json_free_serialized_string(buf);
        return NULL;
    }
    return buf;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x450, %rsp            # imm = 0x450
movq %rdi, %r14
xorl %ebx, %ebx
movq %rsp, %r8
xorl %esi, %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x43df
leal 0x1(%rax), %r15d
testl %eax, %eax
cmovsl %ebx, %r15d
testl %r15d, %r15d
je 0x4cf7
movq %r15, %rdi
callq *0x54b7(%rip)           # 0xa188
testq %rax, %rax
je 0x4cf5
movq %rax, %rbx
movq %r14, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x4bb7
cmpl $-0x1, %eax
jne 0x4cf7
movq %rbx, %rdi
callq *0x548b(%rip)           # 0xa180
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x450, %rsp            # imm = 0x450
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/xapi-project[P]rrd-client-lib/parson/parson.c
// Function: json_array_remove
JSON_Status json_array_remove(JSON_Array *array, size_t ix) {
    size_t to_move_bytes = 0;
    if (array == NULL || ix >= json_array_get_count(array)) {
        return JSONFailure;
    }
    json_value_free(json_array_get_value(array, ix));
    to_move_bytes = (json_array_get_count(array) - 1 - ix) * sizeof(JSON_Value**);
    memmove(array->items + ix, array->items + ix + 1, to_move_bytes);
    array->count -= 1;
    return JSONSuccess;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x4d5e
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
cmpq %rsi, 0x10(%rdi)
jbe 0x4d57
movq 0x8(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x3c53
movq %r14, %rdx
notq %rdx
addq 0x10(%rbx), %rdx
shlq $0x3, %rdx
movq 0x8(%rbx), %rax
leaq (%rax,%r14,8), %rdi
leaq (%rax,%r14,8), %rsi
addq $0x8, %rsi
callq 0x2260
decq 0x10(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq