// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/pp.c
// Function: print_jdn_one
static int print_jdn_one(struct pretty *S, Janet x, int depth) {
    if (depth == 0) return 1;
    switch (janet_type(x)) {
        case JANET_NIL:
        case JANET_BOOLEAN:
        case JANET_BUFFER:
        case JANET_STRING:
            janet_description_b(S->buffer, x);
            break;
        case JANET_NUMBER:
            janet_buffer_ensure(S->buffer, S->buffer->count + BUFSIZE, 2);
            double num = janet_unwrap_number(x);
            if (isnan(num)) return 1;
            if (isinf(num)) return 1;
            janet_buffer_dtostr(S->buffer, num);
            break;
        case JANET_SYMBOL:
        case JANET_KEYWORD:
            if (contains_bad_chars(janet_unwrap_keyword(x), janet_type(x) == JANET_SYMBOL)) return 1;
            janet_description_b(S->buffer, x);
            break;
        case JANET_TUPLE: {
            JanetTuple t = janet_unwrap_tuple(x);
            int isb = janet_tuple_flag(t) & JANET_TUPLE_FLAG_BRACKETCTOR;
            janet_buffer_push_u8(S->buffer, isb ? '[' : '(');
            for (int32_t i = 0; i < janet_tuple_length(t); i++) {
                if (i) janet_buffer_push_u8(S->buffer, ' ');
                if (print_jdn_one(S, t[i], depth - 1)) return 1;
            }
            janet_buffer_push_u8(S->buffer, isb ? ']' : ')');
        }
        break;
        case JANET_ARRAY: {
            janet_table_put(&S->seen, x, janet_wrap_true());
            JanetArray *a = janet_unwrap_array(x);
            janet_buffer_push_cstring(S->buffer, "@[");
            for (int32_t i = 0; i < a->count; i++) {
                if (i) janet_buffer_push_u8(S->buffer, ' ');
                if (print_jdn_one(S, a->data[i], depth - 1)) return 1;
            }
            janet_buffer_push_u8(S->buffer, ']');
        }
        break;
        case JANET_TABLE: {
            janet_table_put(&S->seen, x, janet_wrap_true());
            JanetTable *tab = janet_unwrap_table(x);
            janet_buffer_push_cstring(S->buffer, "@{");
            int isFirst = 1;
            for (int32_t i = 0; i < tab->capacity; i++) {
                const JanetKV *kv = tab->data + i;
                if (janet_checktype(kv->key, JANET_NIL)) continue;
                if (!isFirst) janet_buffer_push_u8(S->buffer, ' ');
                isFirst = 0;
                if (print_jdn_one(S, kv->key, depth - 1)) return 1;
                janet_buffer_push_u8(S->buffer, ' ');
                if (print_jdn_one(S, kv->value, depth - 1)) return 1;
            }
            janet_buffer_push_u8(S->buffer, '}');
        }
        break;
        case JANET_STRUCT: {
            JanetStruct st = janet_unwrap_struct(x);
            janet_buffer_push_u8(S->buffer, '{');
            int isFirst = 1;
            for (int32_t i = 0; i < janet_struct_capacity(st); i++) {
                const JanetKV *kv = st + i;
                if (janet_checktype(kv->key, JANET_NIL)) continue;
                if (!isFirst) janet_buffer_push_u8(S->buffer, ' ');
                isFirst = 0;
                if (print_jdn_one(S, kv->key, depth - 1)) return 1;
                janet_buffer_push_u8(S->buffer, ' ');
                if (print_jdn_one(S, kv->value, depth - 1)) return 1;
            }
            janet_buffer_push_u8(S->buffer, '}');
        }
        break;
        default:
            return 1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
pushq $0x1
popq %r15
testl %edx, %edx
je 0x3d28e
movq %rsi, %r12
movq %rsi, %xmm0
movq %rsi, %rax
shrq $0x2f, %rax
andl $0xf, %eax
xorl %ebx, %ebx
ucomisd %xmm0, %xmm0
cmovpl %eax, %ebx
cmpl $0xb, %ebx
ja 0x3d28e
movl %edx, %r13d
movq %rdi, %r14
leaq 0x27650(%rip), %rax     # 0x64520
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
movq %rdi, -0x30(%rbp)
jmpq *%rcx
movq (%r14), %rdi
movq %r12, %rsi
callq 0x3b65f
jmp 0x3d28b
movq %r12, %rdi
callq 0x4b1f1
movq %rax, %r13
cmpl $0x5, %ebx
setne %al
movslq -0x8(%r13), %r15
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x3cf1a
movb (%r13), %al
addb $-0x30, %al
cmpb $0xa, %al
jb 0x3d21e
movq %r13, %rdi
movl %r15d, %esi
callq 0x35a3a
testl %eax, %eax
je 0x3d21e
xorl %ebx, %ebx
testl %r15d, %r15d
cmovgl %r15d, %ebx
movq %rbx, -0x38(%rbp)
negq %rbx
pushq $-0x1
popq %r14
leaq (%rbx,%r14), %rax
cmpq $-0x1, %rax
je 0x3d2a0
movzbl 0x1(%r13,%r14), %edi
callq 0x35a1c
incq %r14
testl %eax, %eax
jne 0x3cf41
jmp 0x3d2a4
movabsq $-0x800000000000, %r15  # imm = 0xFFFF800000000000
movq %r14, %rbx
addq $0x28, %r14
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4b313
movq %r14, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x43e19
movq %r12, %rdi
callq 0x4b1f1
movq %rax, %r12
movq (%rbx), %rdi
leaq 0x27745(%rip), %rsi     # 0x646ee
callq 0x1614c
decl %r13d
movl %r13d, -0x38(%rbp)
pushq $0x1
popq %rcx
xorl %r13d, %r13d
xorl %r14d, %r14d
movq %r12, -0x40(%rbp)
movslq 0x14(%r12), %rax
cmpq %rax, %r14
jge 0x3d1ad
movq 0x20(%r12), %rbx
movq (%rbx,%r13), %rsi
movq %rsi, %rax
andq %r15, %rax
movabsq $-0x7800000000000, %rdx # imm = 0xFFF8800000000000
cmpq %rdx, %rax
je 0x3d053
testl %ecx, %ecx
jne 0x3d005
movq -0x30(%rbp), %rax
movq (%rax), %rdi
pushq $0x20
popq %rsi
callq 0x161be
movq (%rbx,%r13), %rsi
movq -0x30(%rbp), %r15
movq %r15, %rdi
movl -0x38(%rbp), %r12d
movl %r12d, %edx
callq 0x3ce82
testl %eax, %eax
jne 0x3d21e
movq (%r15), %rdi
pushq $0x20
popq %rsi
callq 0x161be
movq 0x8(%rbx,%r13), %rsi
movq %r15, %rdi
movl %r12d, %edx
callq 0x3ce82
xorl %ecx, %ecx
testl %eax, %eax
movabsq $-0x800000000000, %r15  # imm = 0xFFFF800000000000
movq -0x40(%rbp), %r12
jne 0x3d21e
incq %r14
addq $0x10, %r13
jmp 0x3cfc2
movl %r13d, %ebx
leaq 0x28(%r14), %r13
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4b313
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x43e19
movq %r12, %rdi
callq 0x4b1f1
movq %rax, %r12
movq (%r14), %rdi
leaq 0x27607(%rip), %rsi     # 0x6469f
callq 0x1614c
decl %ebx
movl %ebx, %r13d
xorl %ebx, %ebx
pushq $0x20
popq %r15
movslq 0x10(%r12), %rax
cmpq %rax, %rbx
jge 0x3d269
testq %rbx, %rbx
je 0x3d0c6
movq (%r14), %rdi
movl %r15d, %esi
callq 0x161be
movq 0x18(%r12), %rax
movq (%rax,%rbx,8), %rsi
movq %r14, %rdi
movl %r13d, %edx
callq 0x3ce82
incq %rbx
testl %eax, %eax
je 0x3d0a8
jmp 0x3d21e
movabsq $-0x800000000000, %rbx  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %r15 # imm = 0xFFF8800000000000
movq %r12, %rdi
callq 0x4b1f1
movq %rax, %r12
movq (%r14), %rdi
pushq $0x7b
popq %rsi
callq 0x161be
decl %r13d
movl %r13d, -0x38(%rbp)
pushq $0x1
popq %rcx
xorl %r13d, %r13d
movq %r12, %r14
movq %r12, -0x40(%rbp)
movslq -0x10(%r12), %rax
cmpq %rax, %r13
jge 0x3d1ad
movq (%r14), %rsi
movq %rsi, %rax
andq %rbx, %rax
cmpq %r15, %rax
je 0x3d1a1
movq %rbx, %r12
testl %ecx, %ecx
jne 0x3d155
movq -0x30(%rbp), %rax
movq (%rax), %rdi
pushq $0x20
popq %rsi
callq 0x161be
movq (%r14), %rsi
movq -0x30(%rbp), %rbx
movq %rbx, %rdi
movl -0x38(%rbp), %r15d
movl %r15d, %edx
callq 0x3ce82
testl %eax, %eax
jne 0x3d21e
movq (%rbx), %rdi
pushq $0x20
popq %rsi
callq 0x161be
movq 0x8(%r14), %rsi
movq %rbx, %rdi
movl %r15d, %edx
callq 0x3ce82
xorl %ecx, %ecx
testl %eax, %eax
movq %r12, %rbx
movabsq $-0x7800000000000, %r15 # imm = 0xFFF8800000000000
movq -0x40(%rbp), %r12
jne 0x3d21e
incq %r13
addq $0x10, %r14
jmp 0x3d124
movq -0x30(%rbp), %rax
movq (%rax), %rdi
pushq $0x7d
jmp 0x3d26e
movq %r12, %rdi
callq 0x4b1f1
movq %rax, %r12
movl -0x20(%rax), %ecx
movq (%r14), %rdi
movl %ecx, -0x38(%rbp)
btl $0x10, %ecx
pushq $0x28
popq %rax
pushq $0x5b
popq %rsi
cmovael %eax, %esi
callq 0x161be
decl %r13d
xorl %ebx, %ebx
pushq $0x20
popq %r14
movq -0x30(%rbp), %r15
movslq -0x10(%r12), %rax
cmpq %rax, %rbx
jge 0x3d271
testq %rbx, %rbx
je 0x3d208
movq (%r15), %rdi
movl %r14d, %esi
callq 0x161be
movq (%r12,%rbx,8), %rsi
movq %r15, %rdi
movl %r13d, %edx
callq 0x3ce82
incq %rbx
testl %eax, %eax
je 0x3d1ee
pushq $0x1
popq %r15
jmp 0x3d28e
ucomisd %xmm0, %xmm0
setp %bl
movq (%r14), %rdi
movl 0x10(%rdi), %esi
addl $0x40, %esi
pushq $0x2
popq %rdx
movsd %xmm0, -0x30(%rbp)
callq 0x15f9b
btrq $0x3f, %r12
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
cmpq %rax, %r12
sete %al
orb %bl, %al
jne 0x3d28e
movq (%r14), %rdi
movsd -0x30(%rbp), %xmm0
callq 0x42b60
jmp 0x3d28b
movq (%r14), %rdi
pushq $0x5d
popq %rsi
jmp 0x3d286
btl $0x10, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
pushq $0x29
popq %rax
pushq $0x5d
popq %rsi
cmovael %eax, %esi
callq 0x161be
xorl %r15d, %r15d
movl %r15d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x38(%rbp), %r14
cmpq %r15, %r14
movq -0x30(%rbp), %rax
pushq $0x1
popq %r15
jl 0x3d28e
movq (%rax), %rdi
jmp 0x3cee0
nopl (%rax)