// File: /workspace/github_c_makefile_star2_O2/janet-lang[P]janet/src/core/peg.c
// Function: peg_cfun_init
static PegCall peg_cfun_init(int32_t argc, Janet *argv, int get_replace) {
    PegCall ret;
    int32_t min = get_replace ? 3 : 2;
    janet_arity(argc, min, -1);
    if (janet_checktype(argv[0], JANET_ABSTRACT) &&
            janet_abstract_type(janet_unwrap_abstract(argv[0])) == &janet_peg_type) {
        ret.peg = janet_unwrap_abstract(argv[0]);
    } else {
        ret.peg = compile_peg(argv[0]);
    }
    if (get_replace) {
        ret.subst = argv[1];
        ret.bytes = janet_getbytes(argv, 2);
    } else {
        ret.bytes = janet_getbytes(argv, 1);
    }
    if (argc > min) {
        ret.start = janet_gethalfrange(argv, min, ret.bytes.len, "offset");
        ret.s.extrac = argc - min - 1;
        ret.s.extrav = janet_tuple_n(argv + min + 1, argc - min - 1);
    } else {
        ret.start = 0;
        ret.s.extrac = 0;
        ret.s.extrav = NULL;
    }
    ret.s.mode = PEG_MODE_NORMAL;
    ret.s.text_start = ret.bytes.bytes;
    ret.s.text_end = ret.bytes.bytes + ret.bytes.len;
    ret.s.outer_text_end = ret.s.text_end;
    ret.s.depth = JANET_RECURSION_GUARD;
    ret.s.captures = janet_array(0);
    ret.s.tagged_captures = janet_array(0);
    ret.s.scratch = janet_buffer(10);
    ret.s.tags = janet_buffer(10);
    ret.s.constants = ret.peg->constants;
    ret.s.bytecode = ret.peg->bytecode;
    ret.s.linemap = NULL;
    ret.s.linemaplen = -1;
    ret.s.has_backref = ret.peg->has_backref;
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
movq %rdx, %r12
movq %rdi, %rbx
cmpl $0x1, %ecx
pushq $0x3
popq %r15
sbbl $0x0, %r15d
pushq $-0x1
popq %rdx
movl %esi, -0x2c(%rbp)
movl %esi, %edi
movl %r15d, %esi
callq 0x1781a
movq (%r12), %rdi
movq %rdi, %rax
shrq $0x2f, %rax
cmpl $0x1fffe, %eax          # imm = 0x1FFFE
jne 0x38124
callq 0x4b1f1
movq -0x10(%rax), %rax
movq (%r12), %rdi
cmpq 0x47e92(%rip), %rax     # 0x7ffb0
je 0x38239
callq 0x37f1b
movq %rax, -0x40(%rbp)
movq %rax, (%rbx)
testl %r13d, %r13d
je 0x38145
movq 0x8(%r12), %rax
movq %rax, 0x88(%rbx)
pushq $0x2
jmp 0x38147
pushq $0x1
popq %rsi
movq %r12, %rdi
callq 0x17ea2
movq %rax, %r13
movl %edx, %r14d
movq %rax, 0x78(%rbx)
movl %edx, 0x80(%rbx)
movl -0x2c(%rbp), %eax
cmpl %eax, %r15d
jge 0x381a1
leaq 0x1c206(%rip), %rcx     # 0x54375
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x1815f
movq %rax, -0x38(%rbp)
movl %r15d, %eax
notl %r15d
addl -0x2c(%rbp), %r15d
leaq (%r12,%rax,8), %rdi
addq $0x8, %rdi
movl %r15d, %esi
callq 0x44692
movq -0x38(%rbp), %rcx
jmp 0x381a8
xorl %ecx, %ecx
xorl %r15d, %r15d
xorl %eax, %eax
movl %ecx, 0x90(%rbx)
movl %r15d, 0x60(%rbx)
movq %rax, 0x50(%rbx)
andl $0x0, 0x70(%rbx)
movq %r13, 0x8(%rbx)
movslq %r14d, %rax
addq %rax, %r13
movq %r13, 0x10(%rbx)
movq %r13, 0x18(%rbx)
movl $0x400, 0x64(%rbx)      # imm = 0x400
xorl %edi, %edi
callq 0x12f68
movq %rax, 0x30(%rbx)
xorl %edi, %edi
callq 0x12f68
movq %rax, 0x48(%rbx)
pushq $0xa
popq %r14
movl %r14d, %edi
callq 0x15f78
movq %rax, 0x38(%rbx)
movl %r14d, %edi
callq 0x15f78
movq %rax, 0x40(%rbx)
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, 0x28(%rbx)
movq (%rcx), %rax
movq %rax, 0x20(%rbx)
andq $0x0, 0x58(%rbx)
orl $-0x1, 0x68(%rbx)
movl 0x1c(%rcx), %eax
movl %eax, 0x6c(%rbx)
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4b1f1
jmp 0x38129