// File: /workspace/github_c_makefile_star2_O1/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
pushq %rax
movl %ecx, %r13d
movq %rdx, %r15
movq %rdi, %rbx
cmpl $0x1, %ecx
movl $0x3, %r12d
sbbl $0x0, %r12d
movl %esi, -0x2c(%rbp)
movl %esi, %edi
movl %r12d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x192cc
movq (%r15), %rdi
movq %rdi, %rax
shrq $0x2f, %rax
cmpl $0x1fffe, %eax          # imm = 0x1FFFE
jne 0x3b8c5
callq 0x4f838
movq -0x10(%rax), %rax
cmpq 0x4a6f1(%rip), %rax     # 0x85fb0
je 0x3b9e7
movq (%r15), %rdi
callq 0x3b6ba
movq %rax, %r14
movq %rax, (%rbx)
testl %r13d, %r13d
je 0x3b8ea
movq 0x8(%r15), %rax
movq %rax, 0x88(%rbx)
movl $0x2, %esi
jmp 0x3b8ef
movl $0x1, %esi
movl -0x2c(%rbp), %r13d
movq %r15, %rdi
callq 0x199cf
movq %rax, 0x78(%rbx)
movl %edx, 0x80(%rbx)
cmpl %r13d, %r12d
jge 0x3b947
movl 0x80(%rbx), %edx
leaq 0x1da5e(%rip), %rcx     # 0x59375
movq %r15, %rdi
movl %r12d, %esi
callq 0x19c8c
movl %eax, 0x90(%rbx)
movl %r12d, %eax
notl %r12d
addl %r13d, %r12d
movl %r12d, 0x60(%rbx)
leaq (%r15,%rax,8), %rdi
addq $0x8, %rdi
movl %r12d, %esi
callq 0x48a9f
jmp 0x3b952
xorl %eax, %eax
movl %eax, 0x90(%rbx)
movl %eax, 0x60(%rbx)
movq %rax, 0x50(%rbx)
movl $0x0, 0x70(%rbx)
movq 0x78(%rbx), %rax
movq %rax, 0x8(%rbx)
movslq 0x80(%rbx), %rcx
addq %rax, %rcx
movq %rcx, 0x10(%rbx)
movq %rcx, 0x18(%rbx)
movl $0x400, 0x64(%rbx)      # imm = 0x400
xorl %edi, %edi
callq 0x146a0
movq %rax, 0x30(%rbx)
xorl %edi, %edi
callq 0x146a0
movq %rax, 0x48(%rbx)
movl $0xa, %edi
callq 0x17757
movq %rax, 0x38(%rbx)
movl $0xa, %edi
callq 0x17757
movq %rax, 0x40(%rbx)
movq 0x8(%r14), %rax
movq %rax, 0x28(%rbx)
movq (%r14), %rax
movq %rax, 0x20(%rbx)
movq $0x0, 0x58(%rbx)
movl $0xffffffff, 0x68(%rbx) # imm = 0xFFFFFFFF
movl 0x1c(%r14), %eax
movl %eax, 0x6c(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq (%r15), %rdi
callq 0x4f838
jmp 0x3b8cd