// File: /workspace/github_c_makefile_star2_O3/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 0x145ce
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, %rbx
movq %rdi, %r12
leaq 0x81ee(%rip), %rcx      # 0x1c5f4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq (%rsi), %rcx
leaq 0xaa65(%rip), %rdx      # 0x1ee7e
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x61d0
jmp 0x145af
movq (%rsi), %rdx
leaq 0xaa44(%rip), %rsi      # 0x1ee79
movq %r12, %rdi
movq %rbx, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x14346
testl %eax, %eax
jne 0x145bc
jmp 0x145ba
movq (%rsi), %rdx
movl (%r12), %edi
leaq 0xaa21(%rip), %rsi      # 0x1ee82
leaq 0x1c(%rsp), %rcx
movl $0x24, %r8d
callq 0x1412d
testl %eax, %eax
jne 0x145bc
movq %rbx, 0x8(%rsp)
movl 0x38(%rsp), %ebp
movl $0x80, %ebx
cmpl %ebx, %ebp
cmovbl %ebp, %ebx
movl (%r12), %edi
movq 0x2c(%rsp), %rdx
movl %ebx, %r8d
shll $0x5, %r8d
leaq 0xa9e5(%rip), %rsi      # 0x1ee88
leaq 0x140(%rsp), %r13
movq %r13, %rcx
callq 0x1412d
testl %eax, %eax
jne 0x145bc
movq %r14, 0x10(%rsp)
movq 0x8(%rsp), %r14
testl %ebp, %ebp
je 0x14588
movl %ebx, %ebx
movq 0x8(%rsp), %rbp
movq %rbp, %r14
movq 0x18(%r13), %rdx
movq %r15, %rcx
testq %rdx, %rdx
je 0x14549
movl $0x100, %r8d            # imm = 0x100
movq %r12, %rdi
leaq 0xa99d(%rip), %rsi      # 0x1ee90
leaq 0x40(%rsp), %rcx
movq %rsp, %r9
callq 0x14346
testl %eax, %eax
jne 0x145bc
movq (%rsp), %rax
addq $0x2, %rax
movq %r15, %rcx
movq %rbp, %r14
cmpq %r15, %rax
jae 0x14549
movq %rbp, %rdi
movq %r15, %rsi
leaq 0xa972(%rip), %rdx      # 0x1ee9a
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
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
movq %rsp, %r8
callq 0x143d2
testl %eax, %eax
jne 0x145bc
addq (%rsp), %r14
subq %r14, %rbp
addq %rbp, %r15
cmpq $0x2, %r15
jb 0x14578
movb $0x2c, (%r14)
decq %r15
incq %r14
addq $0x20, %r13
movq %r14, %rbp
decq %rbx
jne 0x144d7
subq 0x8(%rsp), %r14
movq 0x10(%rsp), %rax
movq %r14, (%rax)
jmp 0x145ba
movsd (%rsi), %xmm0
leaq 0xae1c(%rip), %rdx      # 0x1f3be
movq %rbx, %rdi
movq %r15, %rsi
movb $0x1, %al
callq 0x61d0
movq %rbx, %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
movl $0x1, %eax
retq