// File: /workspace/github_c_makefile_star2_O3/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 $0x88, %rsp
movl %r8d, %ebx
movl %ecx, -0x30(%rbp)
movq %rdi, %r14
testq %rsi, %rsi
je 0x1b864
movq %rsi, %r12
movslq -0x4(%rsi), %r15
cmpq $0x1, %r15
jg 0x1b896
movabsq $-0x7000000000000, %rdi # imm = 0xFFF9000000000000
testl %ebx, %ebx
jne 0x1b875
incq %rdi
callq 0x4ece6
movq %r14, %rdi
movq %rax, %rsi
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1baf6
movq %r14, -0x58(%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 -0x50(%rbp), %rdi
movl %edx, -0x2c(%rbp)
callq 0x1c64f
movq %r15, -0x68(%rbp)
leal -0x1(%r15), %eax
movq %rax, -0x60(%rbp)
xorl %r14d, %r14d
cmpl $0x1, %ebx
movl $0x0, %eax
adcb $0x1d, %al
addq $0x18, %r12
movl $0x1, %r15d
movzbl -0x2c(%rbp), %ecx
movl %ecx, -0x2c(%rbp)
movzbl %al, %eax
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x1b92a
testb $0x1, 0x12(%r12)
je 0x1b92a
movq (%r12), %rbx
movq %rbx, %rdi
callq 0x49912
testl %eax, %eax
je 0x1b92a
movq %rbx, %xmm0
cvttsd2si %xmm0, %eax
movsbl %al, %ecx
cmpl %eax, %ecx
je 0x1b9ed
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 -0x40(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd -0x50(%rbp), %xmm0
movupd %xmm0, (%rsp)
movq %r13, %rdi
movl -0x2c(%rbp), %esi
movl $0x1, %edx
callq 0x22063
cmpq %r15, -0x60(%rbp)
je 0x1b9da
movq -0x40(%rbp), %rax
movq %rax, 0x10(%rsp)
movupd -0x50(%rbp), %xmm0
movupd %xmm0, (%rsp)
movq %r13, %rdi
movl -0x34(%rbp), %esi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x21d94
movl %eax, %ebx
testq %r14, %r14
je 0x1b9b5
movl -0x4(%r14), %eax
leal 0x1(%rax), %ecx
cmpl -0x8(%r14), %ecx
jl 0x1b9d0
movq %r14, %rdi
movl $0x1, %esi
movl $0x4, %edx
callq 0x4b4e8
movq %rax, %r14
movl -0x4(%rax), %eax
leal 0x1(%rax), %ecx
movl %ecx, -0x4(%r14)
cltq
movl %ebx, (%r14,%rax,4)
incq %r15
addq $0x18, %r12
cmpq %r15, -0x68(%rbp)
jne 0x1b8f8
jmp 0x1ba2e
movq -0x8(%r12), %rcx
movq %rcx, 0x28(%rsp)
movups -0x18(%r12), %xmm0
movups %xmm0, 0x18(%rsp)
movq -0x40(%rbp), %rcx
movq %rcx, 0x10(%rsp)
movupd -0x50(%rbp), %xmm0
movupd %xmm0, (%rsp)
movzbl -0x30(%rbp), %esi
movsbl %al, %edx
movq %r13, %rdi
movl $0x1, %ecx
callq 0x21f27
jmp 0x1b976
movq 0x8(%r13), %rax
testq %rax, %rax
je 0x1ba3c
movl -0x4(%rax), %ecx
jmp 0x1ba3e
xorl %ecx, %ecx
testq %r14, %r14
je 0x1ba72
cmpl $0x0, -0x4(%r14)
jle 0x1ba66
xorl %edx, %edx
movslq (%r14,%rdx,4), %rsi
movl %ecx, %edi
subl %esi, %edi
shll $0x10, %edi
orl %edi, (%rax,%rsi,4)
incq %rdx
movslq -0x4(%r14), %rsi
cmpq %rsi, %rdx
jl 0x1ba4c
addq $-0x8, %r14
movq %r14, %rdi
callq 0x2bcd9
movq -0x40(%rbp), %rax
movq -0x58(%rbp), %rcx
movq %rax, 0x10(%rcx)
movups -0x50(%rbp), %xmm0
movups %xmm0, (%rcx)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop