// File: /workspace/github_c_makefile_star2_O1/adsr[P]phpspy/./phpspy_trace.c
// Function: sprint_zval_70
static int sprint_zval(trace_context_t *context, zval *lzval, char *buf, size_t buf_size, size_t *buf_len) {
    int rv;
    int type;
    type = (int)lzval->u1.v.type;
    switch (type) {
        case IS_LONG:
            snprintf(buf, buf_size, "%ld", lzval->value.lval);
            *buf_len = strlen(buf);
            break;
        case IS_DOUBLE:
            snprintf(buf, buf_size, "%f", lzval->value.dval);
            *buf_len = strlen(buf);
            break;
        case IS_STRING:
            try(rv, sprint_zstring(context, "zval", lzval->value.str, buf, buf_size, buf_len));
            break;
        case IS_ARRAY:
            try(rv, sprint_zarray(context, lzval->value.arr, buf, buf_size, buf_len));
            break;
        default:
            /* TODO handle other zval types */
            /* fprintf(context->fout, "value not supported, found type: %d\n", type); */
            return PHPSPY_ERR;
    }
    return PHPSPY_OK;
}

// Assembly:
movzbl 0x8(%rsi), %eax
addl $-0x4, %eax
cmpl $0x3, %eax
ja 0x14a79
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1158, %rsp           # imm = 0x1158
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rbx
movq %rdi, %r12
leaq 0x7d54(%rip), %rcx      # 0x1c5f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsi), %rcx
leaq 0xa5cb(%rip), %rdx      # 0x1ee7e
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x61d0
jmp 0x14a5a
movq (%rsi), %rdx
leaq 0xa5aa(%rip), %rsi      # 0x1ee79
movq %r12, %rdi
movq %rbx, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x147e0
jmp 0x14a3c
movq (%rsi), %rdx
movl (%r12), %edi
leaq 0xa58f(%rip), %rsi      # 0x1ee82
leaq 0x2c(%rsp), %rcx
movl $0x24, %r8d
callq 0x1459f
testl %eax, %eax
jne 0x14a3c
movq %rbx, 0x10(%rsp)
movl 0x48(%rsp), %ebp
movl $0x80, %ebx
cmpl %ebx, %ebp
cmovbl %ebp, %ebx
movl (%r12), %edi
movq 0x3c(%rsp), %rdx
movl %ebx, %r8d
shll $0x5, %r8d
leaq 0xa553(%rip), %rsi      # 0x1ee88
leaq 0x150(%rsp), %r13
movq %r13, %rcx
callq 0x1459f
testl %eax, %eax
jne 0x14a3c
movq %r14, 0x18(%rsp)
movq 0x10(%rsp), %r14
testl %ebp, %ebp
je 0x14a2d
movl %ebx, %ebx
movq 0x10(%rsp), %r14
movq 0x18(%r13), %rdx
movq %r15, %rcx
movq %r14, %rbp
testq %rdx, %rdx
je 0x149db
movl $0x100, %r8d            # imm = 0x100
movq %r12, %rdi
leaq 0xa50b(%rip), %rsi      # 0x1ee90
leaq 0x50(%rsp), %rcx
leaq 0x8(%rsp), %r9
callq 0x147e0
testl %eax, %eax
jne 0x14a01
movq 0x8(%rsp), %rax
addq $0x2, %rax
movq %r15, %rcx
movq %r14, %rbp
cmpq %r15, %rax
jae 0x149db
movq %r14, %rdi
movq %r15, %rsi
leaq 0xa4e1(%rip), %rdx      # 0x1ee9a
leaq 0x50(%rsp), %rcx
xorl %eax, %eax
callq 0x61d0
movq 0x8(%rsp), %rax
leaq 0x1(%rax), %rdx
movq %r15, %rcx
subq %rdx, %rcx
leaq (%r14,%rax), %rbp
incq %rbp
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
leaq 0x8(%rsp), %r8
callq 0x1486c
testl %eax, %eax
jne 0x14a01
addq 0x8(%rsp), %rbp
subq %r14, %rbp
xorl %eax, %eax
movq %rbp, 0x20(%rsp)
testl %eax, %eax
jne 0x14a3c
movq 0x20(%rsp), %rax
subq %rax, %r15
addq %rax, %r14
cmpq $0x2, %r15
jb 0x14a20
movb $0x2c, (%r14)
decq %r15
incq %r14
addq $0x20, %r13
decq %rbx
jne 0x14966
subq 0x10(%rsp), %r14
movq 0x18(%rsp), %rax
movq %r14, (%rax)
xorl %eax, %eax
testl %eax, %eax
jne 0x14a67
jmp 0x14a65
movsd (%rsi), %xmm0
leaq 0xa979(%rip), %rdx      # 0x1f3c6
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x61d0
movq %rbx, %rdi
callq 0x6160
movq %rax, (%r14)
xorl %eax, %eax
addq $0x1158, %rsp           # imm = 0x1158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %eax
retq