// File: /workspace/github_c_makefile_star2_O2/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 0x14404
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1148, %rsp           # imm = 0x1148
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %r13
movq %rdi, %r12
leaq 0x73ae(%rip), %rcx      # 0x1b5f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsi), %rcx
leaq 0x9c25(%rip), %rdx      # 0x1de7e
movq %r13, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x61d0
jmp 0x143e5
movq (%rsi), %rdx
leaq 0x9c04(%rip), %rsi      # 0x1de79
movq %r12, %rdi
movq %r13, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x1418b
testl %eax, %eax
jne 0x143f2
jmp 0x143f0
movq (%rsi), %rdx
movl (%r12), %edi
leaq 0x9be1(%rip), %rsi      # 0x1de82
leaq 0x1c(%rsp), %rcx
pushq $0x24
popq %r8
callq 0x140e4
testl %eax, %eax
jne 0x143f2
movl 0x38(%rsp), %eax
movl $0x80, %ebx
cmpl %ebx, %eax
cmovbl %eax, %ebx
movl (%r12), %edi
movq 0x2c(%rsp), %rdx
movl %ebx, %r8d
shll $0x5, %r8d
leaq 0x9bac(%rip), %rsi      # 0x1de88
leaq 0x140(%rsp), %rcx
callq 0x140e4
testl %eax, %eax
jne 0x143f2
movq %r14, 0x8(%rsp)
movl %ebx, %eax
shlq $0x5, %rax
movq %rax, 0x10(%rsp)
xorl %ebx, %ebx
movq %r13, %rbp
cmpq %rbx, 0x10(%rsp)
je 0x14408
movq 0x158(%rsp,%rbx), %rdx
movq %r15, %rcx
movq %rbp, %r14
testq %rdx, %rdx
je 0x1438a
movl $0x100, %r8d            # imm = 0x100
movq %r12, %rdi
leaq 0x9b5c(%rip), %rsi      # 0x1de90
leaq 0x40(%rsp), %rcx
movq %rsp, %r9
callq 0x1418b
testl %eax, %eax
jne 0x143f2
movq (%rsp), %rax
addq $0x2, %rax
movq %r15, %rcx
movq %rbp, %r14
cmpq %r15, %rax
jae 0x1438a
movq %rbp, %rdi
movq %r15, %rsi
leaq 0x9b31(%rip), %rdx      # 0x1de9a
leaq 0x40(%rsp), %rcx
xorl %eax, %eax
callq 0x61d0
movq (%rsp), %rax
leaq 0x1(%rax), %rdx
movq %r15, %rcx
subq %rdx, %rcx
leaq (%rax,%rbp), %r14
incq %r14
leaq (%rsp,%rbx), %rsi
addq $0x140, %rsi            # imm = 0x140
movq %r12, %rdi
movq %r14, %rdx
movq %rsp, %r8
callq 0x14212
testl %eax, %eax
jne 0x143f2
addq (%rsp), %r14
subq %r14, %rbp
addq %rbp, %r15
cmpq $0x2, %r15
jb 0x143c1
movb $0x2c, (%r14)
decq %r15
incq %r14
addq $0x20, %rbx
movq %r14, %rbp
jmp 0x14306
movsd (%rsi), %xmm0
leaq 0x9fe6(%rip), %rdx      # 0x1e3be
movq %r13, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x61d0
movq %r13, %rdi
callq 0x6160
movq %rax, (%r14)
xorl %eax, %eax
addq $0x1148, %rsp           # imm = 0x1148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rax
retq
subq %r13, %rbp
movq 0x8(%rsp), %rax
movq %rbp, (%rax)
jmp 0x143f0