// File: /workspace/github_c_makefile_star2_O3/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
movl $0x3, %r15d
sbbl $0x0, %r15d
movl %esi, -0x2c(%rbp)
movl %esi, %edi
movl %r15d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x1920c
movq (%r12), %rdi
movq %rdi, %rax
shrq $0x2f, %rax
cmpl $0x1fffe, %eax          # imm = 0x1FFFE
jne 0x3b336
callq 0x4ebc4
movq -0x10(%rax), %rax
movq (%r12), %rdi
cmpq 0x49c80(%rip), %rax     # 0x84fb0
je 0x3b456
callq 0x3b123
movq %rax, -0x40(%rbp)
movq %rax, (%rbx)
testl %r13d, %r13d
je 0x3b35a
movq 0x8(%r12), %rax
movq %rax, 0x88(%rbx)
movl $0x2, %esi
jmp 0x3b35f
movl $0x1, %esi
movq %r12, %rdi
callq 0x19909
movq %rax, %r13
movl %edx, %r14d
movq %rax, 0x78(%rbx)
movl %edx, 0x80(%rbx)
movl -0x2c(%rbp), %eax
cmpl %eax, %r15d
jge 0x3b3b8
leaq 0x1cfef(%rip), %rcx     # 0x58375
movq %r12, %rdi
movl %r15d, %esi
movl %r14d, %edx
callq 0x19bc6
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 0x47fef
movq -0x38(%rbp), %rcx
jmp 0x3b3bf
xorl %ecx, %ecx
xorl %r15d, %r15d
xorl %eax, %eax
movl %ecx, 0x90(%rbx)
movl %r15d, 0x60(%rbx)
movq %rax, 0x50(%rbx)
movl $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 0x14690
movq %rax, 0x30(%rbx)
xorl %edi, %edi
callq 0x14690
movq %rax, 0x48(%rbx)
movl $0xa, %edi
callq 0x176f7
movq %rax, 0x38(%rbx)
movl $0xa, %edi
callq 0x176f7
movq %rax, 0x40(%rbx)
movq -0x40(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, 0x28(%rbx)
movq (%rcx), %rax
movq %rax, 0x20(%rbx)
movq $0x0, 0x58(%rbx)
movl $0xffffffff, 0x68(%rbx) # imm = 0xFFFFFFFF
movl 0x1c(%rcx), %eax
movl %eax, 0x6c(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4ebc4
jmp 0x3b33b