// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %r14d
testl %edx, %edx
je 0x41067
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 0x41067
movl %edx, %r15d
movq %rdi, %r13
leaq 0x28969(%rip), %rax     # 0x69520
movslq (%rax,%rbx,4), %rcx
addq %rax, %rcx
movq %rdi, -0x30(%rbp)
jmpq *%rcx
movq (%r13), %rdi
movq %r12, %rsi
callq 0x3f295
jmp 0x41064
movq %r12, %rdi
callq 0x4f838
movq %rax, %r15
cmpl $0x5, %ebx
setne %al
movl -0x8(%r15), %r13d
testq %r13, %r13
sete %cl
orb %al, %cl
jne 0x40c01
movb (%r15), %al
addb $-0x30, %al
cmpb $0xa, %al
jb 0x41067
movq %r15, %rdi
movl %r13d, %esi
callq 0x38f96
testl %eax, %eax
je 0x41067
testl %r13d, %r13d
setg %al
jle 0x40c52
movzbl (%r15), %edi
callq 0x38f78
testl %eax, %eax
je 0x41067
movl $0x1, %ecx
movq %rcx, %rbx
cmpq %rcx, %r13
je 0x40c4c
movzbl (%r15,%rbx), %edi
callq 0x38f78
leaq 0x1(%rbx), %rcx
testl %eax, %eax
jne 0x40c32
cmpq %r13, %rbx
setb %al
testb %al, %al
jne 0x41067
movq -0x30(%rbp), %rax
movq (%rax), %rdi
jmp 0x40bc8
movq %r13, %rbx
addq $0x28, %r13
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4f95a
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x481b3
movq %r12, %rdi
callq 0x4f838
movq %rax, %r12
movq (%rbx), %rdi
leaq 0x28a4f(%rip), %rsi     # 0x696ee
callq 0x178d8
cmpl $0x0, 0x14(%r12)
jle 0x40d8a
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rsi # imm = 0xFFF8800000000000
decl %r15d
movl $0x1, %edi
xorl %r13d, %r13d
xorl %ebx, %ebx
movq %r12, -0x38(%rbp)
movq 0x20(%r12), %r14
movq (%r14,%r13), %rax
andq %rdx, %rax
movl $0xb, %ecx
cmpq %rsi, %rax
jne 0x40cf3
movl $0x1, %r14d
jmp 0x40d6c
movl %r15d, %r12d
testl %edi, %edi
movq -0x30(%rbp), %r15
jne 0x40d0b
movq (%r15), %rdi
movl $0x20, %esi
callq 0x179a7
movq (%r14,%r13), %rsi
movq %r15, %rdi
movl %r12d, %edx
callq 0x40b67
movl $0x1, %ecx
xorl %edi, %edi
testl %eax, %eax
jne 0x40d4b
movq (%r15), %rdi
movl $0x20, %esi
callq 0x179a7
movq 0x8(%r14,%r13), %rsi
movq %r15, %rdi
movl %r12d, %edx
callq 0x40b67
xorl %edi, %edi
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl $0x1, %r14d
movl %r12d, %r15d
movq -0x38(%rbp), %r12
movabsq $-0x800000000000, %rdx  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rsi # imm = 0xFFF8800000000000
cmpl $0xb, %ecx
je 0x40d75
testl %ecx, %ecx
jne 0x40d8f
incq %rbx
movslq 0x14(%r12), %rax
addq $0x10, %r13
cmpq %rax, %rbx
jl 0x40cd5
movl $0x9, %ecx
cmpl $0x9, %ecx
jne 0x40da7
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl $0x7d, %esi
callq 0x179a7
xorl %ecx, %ecx
testl %ecx, %ecx
jne 0x41067
jmp 0x41064
movq %r13, %rbx
addq $0x28, %r13
movabsq $-0x6ffffffffffff, %rdi # imm = 0xFFF9000000000001
callq 0x4f95a
movq %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x481b3
movq %r12, %rdi
callq 0x4f838
movq %rax, %r12
movq (%rbx), %rdi
leaq 0x288b2(%rip), %rsi     # 0x6969f
callq 0x178d8
cmpl $0x0, 0x10(%r12)
setg %bl
jle 0x4102c
decl %r15d
xorl %r13d, %r13d
movl %r15d, %r14d
testq %r13, %r13
movq -0x30(%rbp), %r15
je 0x40e20
movq (%r15), %rdi
movl $0x20, %esi
callq 0x179a7
movq 0x18(%r12), %rax
movq (%rax,%r13,8), %rsi
movq %r15, %rdi
movl %r14d, %r15d
movl %r14d, %edx
callq 0x40b67
testl %eax, %eax
jne 0x41021
incq %r13
movslq 0x10(%r12), %rax
cmpq %rax, %r13
setl %bl
jl 0x40e07
jmp 0x4102c
movq %r12, %rdi
callq 0x4f838
movq %rax, %r12
movq (%r13), %rdi
movl $0x7b, %esi
callq 0x179a7
cmpl $0x0, -0x10(%r12)
jle 0x40f40
movabsq $-0x800000000000, %rsi  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rdi # imm = 0xFFF8800000000000
decl %r15d
movl $0x1, %r8d
xorl %r13d, %r13d
movq %r12, %rbx
movq (%rbx), %rax
andq %rsi, %rax
movl $0xe, %ecx
cmpq %rdi, %rax
je 0x40f22
movl %r15d, %r14d
testl %r8d, %r8d
movq -0x30(%rbp), %r15
jne 0x40ec5
movq (%r15), %rdi
movl $0x20, %esi
callq 0x179a7
movq (%rbx), %rsi
movq %r15, %rdi
movl %r14d, %edx
callq 0x40b67
xorl %r8d, %r8d
movl $0x1, %ecx
testl %eax, %eax
jne 0x40f05
movq (%r15), %rdi
movl $0x20, %esi
callq 0x179a7
movq 0x8(%rbx), %rsi
movq %r15, %rdi
movl %r14d, %edx
callq 0x40b67
xorl %r8d, %r8d
xorl %ecx, %ecx
testl %eax, %eax
setne %cl
movl %r14d, %r15d
movl $0x1, %r14d
movabsq $-0x800000000000, %rsi  # imm = 0xFFFF800000000000
movabsq $-0x7800000000000, %rdi # imm = 0xFFF8800000000000
cmpl $0xe, %ecx
je 0x40f2b
testl %ecx, %ecx
jne 0x40f45
incq %r13
movslq -0x10(%r12), %rax
addq $0x10, %rbx
cmpq %rax, %r13
jl 0x40e9c
movl $0xc, %ecx
cmpl $0xc, %ecx
je 0x40d94
jmp 0x40da7
movq %r12, %rdi
callq 0x4f838
movq %rax, %r12
movl -0x20(%rax), %eax
movq (%r13), %rdi
movl %eax, -0x38(%rbp)
btl $0x10, %eax
movl $0x28, %eax
movl $0x5b, %esi
cmovael %eax, %esi
callq 0x179a7
cmpl $0x0, -0x10(%r12)
setg %r13b
jle 0x41046
decl %r15d
xorl %ebx, %ebx
movl %r15d, %r14d
testq %rbx, %rbx
movq -0x30(%rbp), %r15
je 0x40fac
movq (%r15), %rdi
movl $0x20, %esi
callq 0x179a7
movq (%r12,%rbx,8), %rsi
movq %r15, %rdi
movl %r14d, %r15d
movl %r14d, %edx
callq 0x40b67
testl %eax, %eax
jne 0x4103a
incq %rbx
movslq -0x10(%r12), %rax
cmpq %rax, %rbx
setl %r13b
jl 0x40f93
jmp 0x41046
ucomisd %xmm0, %xmm0
setp %bl
movq (%r13), %rdi
movl 0x10(%rdi), %esi
addl $0x40, %esi
movl $0x2, %edx
movsd %xmm0, -0x38(%rbp)
callq 0x1777e
btrq $0x3f, %r12
movabsq $0x7ff0000000000000, %rax # imm = 0x7FF0000000000000
cmpq %rax, %r12
sete %al
orb %bl, %al
jne 0x41067
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movsd -0x38(%rbp), %xmm0
callq 0x46dac
jmp 0x41064
testb $0x1, %bl
movl $0x1, %r14d
jne 0x41067
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl $0x5d, %esi
jmp 0x4105f
testb $0x1, %r13b
movl $0x1, %r14d
jne 0x41067
btl $0x10, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rdi
movl $0x29, %eax
movl $0x5d, %esi
cmovael %eax, %esi
callq 0x179a7
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)