// File: /workspace/github_c_makefile_star2_O1/janet-lang[P]janet/src/core/cfuns.c
// Function: compreduce
static JanetSlot compreduce(
    JanetFopts opts,
    JanetSlot *args,
    int op,
    int opim,
    int invert) {
    JanetCompiler *c = opts.compiler;
    int32_t i, len;
    int8_t imm = 0;
    len = janet_v_count(args);
    int32_t *labels = NULL;
    JanetSlot t;
    if (len < 2) {
        return invert
               ? janetc_cslot(janet_wrap_false())
               : janetc_cslot(janet_wrap_true());
    }
    t = janetc_gettarget(opts);
    for (i = 1; i < len; i++) {
        if (opim && can_slot_be_imm(args[i], &imm)) {
            janetc_emit_ssi(c, opim, t, args[i - 1], imm, 1);
        } else {
            janetc_emit_sss(c, op, t, args[i - 1], args[i], 1);
        }
        if (i != (len - 1)) {
            int32_t label = janetc_emit_si(c, invert ? JOP_JUMP_IF : JOP_JUMP_IF_NOT, t, 0, 1);
            janet_v_push(labels, label);
        }
    }
    int32_t end = janet_v_count(c->buffer);
    for (i = 0; i < janet_v_count(labels); i++) {
        int32_t label = labels[i];
        c->buffer[label] |= ((end - label) << 16);
    }
    janet_v_free(labels);
    return t;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movl %r8d, %ebx
movl %ecx, -0x30(%rbp)
movq %rsi, %r12
movq %rdi, %r14
testq %rsi, %rsi
je 0x1b98f
movl -0x4(%r12), %r15d
jmp 0x1b992
xorl %r15d, %r15d
cmpl $0x1, %r15d
jg 0x1b9c1
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
testl %ebx, %ebx
jne 0x1b9a9
incq %rdi
callq 0x4f95a
movq %r14, %rdi
movq %rax, %rsi
callq 0x1bc4e
movq %r14, %rax
jmp 0x1bbdc
movq %r14, -0x68(%rbp)
leaq 0x10(%rbp), %rax
movq (%rax), %r13
movq 0x20(%rax), %rcx
movq %rcx, 0x20(%rsp)
movupd (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups %xmm1, 0x10(%rsp)
movupd %xmm0, (%rsp)
leaq -0x60(%rbp), %rdi
movl %edx, -0x2c(%rbp)
callq 0x1c898
xorl %r14d, %r14d
cmpl $0x1, %ebx
movl $0x0, %eax
adcb $0x1d, %al
leal -0x1(%r15), %ecx
movq %rcx, -0x78(%rbp)
movl %r15d, %ecx
movq %rcx, -0x70(%rbp)
addq $0x18, %r12
movl $0x1, %r15d
movzbl -0x2c(%rbp), %ecx
movl %ecx, -0x3c(%rbp)
movzbl %al, %eax
movl %eax, -0x38(%rbp)
movzbl -0x30(%rbp), %eax
movl %eax, -0x34(%rbp)
movl $0x0, -0x2c(%rbp)
movq %r13, -0x48(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x1ba80
movb $0x1, %r13b
testb $0x1, 0x12(%r12)
je 0x1ba77
movq (%r12), %rbx
movq %rbx, %rdi
callq 0x4a41f
testl %eax, %eax
je 0x1ba77
movq %rbx, %xmm0
cvttsd2si %xmm0, %eax
movsbl %al, %ecx
cmpl %eax, %ecx
setne %r13b
movl -0x2c(%rbp), %ecx
movzbl %cl, %ecx
cmovel %eax, %ecx
movl %ecx, -0x2c(%rbp)
testb %r13b, %r13b
je 0x1bace
movq -0x48(%rbp), %r13
movq 0x10(%r12), %rax
movq %rax, 0x40(%rsp)
movups (%r12), %xmm0
movups %xmm0, 0x30(%rsp)
movq -0x8(%r12), %rax
movq %rax, 0x28(%rsp)
movups -0x18(%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd -0x60(%rbp), %xmm0
movupd %xmm0, (%rsp)
movq %r13, %rdi
movl -0x3c(%rbp), %esi
movl $0x1, %edx
callq 0x223bf
jmp 0x1bb0e
movq -0x8(%r12), %rax
movq %rax, 0x28(%rsp)
movups -0x18(%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd -0x60(%rbp), %xmm0
movupd %xmm0, (%rsp)
movsbl -0x2c(%rbp), %edx
movq -0x48(%rbp), %r13
movq %r13, %rdi
movl -0x34(%rbp), %esi
movl $0x1, %ecx
callq 0x22283
cmpq %r15, -0x78(%rbp)
je 0x1bb70
movq -0x50(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd -0x60(%rbp), %xmm0
movupd %xmm0, (%rsp)
movq %r13, %rdi
movl -0x38(%rbp), %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x220f0
movl %eax, %ebx
testq %r14, %r14
je 0x1bb4c
movl -0x4(%r14), %eax
incl %eax
cmpl -0x8(%r14), %eax
jl 0x1bb61
movq %r14, %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x4c0b4
movq %rax, %r14
movslq -0x4(%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r14)
movl %ebx, (%r14,%rax,4)
incq %r15
addq $0x18, %r12
cmpq %r15, -0x70(%rbp)
jne 0x1ba38
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x1bb8f
movl -0x4(%rax), %ecx
jmp 0x1bb91
xorl %ecx, %ecx
xorl %edx, %edx
testq %r14, %r14
je 0x1bb9e
movslq -0x4(%r14), %rsi
jmp 0x1bba0
xorl %esi, %esi
cmpq %rsi, %rdx
jge 0x1bbb8
movslq (%r14,%rdx,4), %rsi
movl %ecx, %edi
subl %esi, %edi
shll $0x10, %edi
orl %edi, (%rax,%rsi,4)
incq %rdx
jmp 0x1bb93
testq %r14, %r14
je 0x1bbc9
addq $-0x8, %r14
movq %r14, %rdi
callq 0x2c187
movq -0x50(%rbp), %rcx
movq -0x68(%rbp), %rax
movq %rcx, 0x10(%rax)
movups -0x60(%rbp), %xmm0
movups %xmm0, (%rax)
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop