// File: /workspace/github_c_makefile_star2_O1/loversmile[P]sugarcrm/sugar_stdsoap2.c
// Function: soap_save_block
SOAP_FMAC1
char*
SOAP_FMAC2
soap_save_block(struct soap *soap, struct soap_blist *b, char *p, int flag)
{ register size_t n;
  register char *q, *s;
  if (!b)
    b = soap->blist;
  DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Save all blocks in contiguous memory space of %u bytes (%p->%p)\n", (unsigned int)b->size, b->ptr, p));
  if (b->size)
  { if (!p)
      p = (char*)soap_malloc(soap, b->size);
    if (p)
    { for (s = p, q = soap_first_block(soap, b); q; q = soap_next_block(soap, b))
      { n = soap_block_size(soap, b);
#ifndef WITH_NOIDREF
        if (flag)
          soap_update_ptrs(soap, q, q + n, s, q);
#endif
        DBGLOG(TEST, SOAP_MESSAGE(fdebug, "Copy %u bytes from %p to %p\n", (unsigned int)n, q, s));
        memcpy(s, q, n);
        s += n;
      }
    }
    else
      soap->error = SOAP_EOM;
  }
  soap_end_block(soap, b);
  return p;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r14
testq %rsi, %rsi
jne 0x3aa15
movq 0x90(%r14), %rbx
movq 0x10(%rbx), %rsi
testq %rsi, %rsi
je 0x3abad
testq %r15, %r15
jne 0x3aa32
movq %r14, %rdi
callq 0x39095
movq %rax, %r15
testq %r15, %r15
je 0x3ab9f
movq %rbx, %rcx
testq %rbx, %rbx
jne 0x3aa4a
movq 0x90(%r14), %rcx
movq 0x8(%rcx), %rdx
xorl %eax, %eax
testq %rdx, %rdx
je 0x3aa6e
movq %rax, %rsi
movq %rdx, %rax
movq (%rdx), %rdx
movq %rsi, (%rax)
testq %rdx, %rdx
jne 0x3aa55
movq %rax, 0x8(%rcx)
addq $0x10, %rax
testq %rax, %rax
je 0x3abad
movq %r15, %r12
movq %rbx, %rcx
testq %rbx, %rbx
jne 0x3aa89
movq 0x90(%r14), %rcx
movq 0x8(%rcx), %rcx
movq 0x8(%rcx), %r13
testl %ebp, %ebp
je 0x3ab78
leaq (%rax,%r13), %rcx
movq %r12, %rdx
subq %rax, %rdx
xorl %esi, %esi
movq 0xa8(%r14,%rsi,8), %rdi
testq %rdi, %rdi
je 0x3ab36
movq 0x30(%rdi), %r8
cmpq %rcx, %r8
jae 0x3aacb
cmpq %rax, %r8
jb 0x3aacb
addq %rdx, %r8
movq %r8, 0x30(%rdi)
leaq 0x18(%rdi), %r8
movq %r8, %r9
movq (%r8), %r8
cmpq %rcx, %r8
jae 0x3aae6
cmpq %rax, %r8
jb 0x3aae6
leaq (%r8,%rdx), %r10
movq %r10, (%r9)
testq %r8, %r8
jne 0x3aacf
leaq 0x20(%rdi), %r8
movq %r8, %r9
movq (%r8), %r8
cmpq %rcx, %r8
jae 0x3ab06
cmpq %rax, %r8
jb 0x3ab06
leaq (%r8,%rdx), %r10
movq %r10, (%r9)
testq %r8, %r8
jne 0x3aaef
movq 0x28(%rdi), %r8
testq %r8, %r8
je 0x3ab2e
movq 0x10(%r8), %r9
cmpq %rax, %r9
jb 0x3ab29
cmpq %rcx, %r9
jae 0x3ab29
addq %rdx, %r9
movq %r9, 0x10(%r8)
movq (%r8), %r8
jmp 0x3ab0f
movq (%rdi), %rdi
jmp 0x3aaad
incq %rsi
cmpq $0x7cf, %rsi            # imm = 0x7CF
jne 0x3aaa5
movq 0x192b0(%r14), %rsi
testq %rsi, %rsi
je 0x3ab78
movq 0x8(%rsi), %rdi
cmpq %rcx, %rdi
jae 0x3ab73
cmpq %rax, %rdi
jb 0x3ab73
addq %rdx, %rdi
movq %rdi, 0x8(%rsi)
addq %rdx, 0x10(%rsi)
addq %rdx, 0x20(%rsi)
addq %rdx, 0x28(%rsi)
movq (%rsi), %rsi
jmp 0x3ab4d
movq %r12, %rdi
movq %rax, %rsi
movq %r13, %rdx
callq 0x3230
addq %r13, %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3a931
testq %rax, %rax
jne 0x3aa7a
jmp 0x3abad
movl $0x14, 0x19214(%r14)
xorl %r15d, %r15d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3a980
movq %r15, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq