// File: cjxgm[P]libgpp/src/libgpp.cpp
// Function: (anonymous namespace)::Preprocessor::find_meta_args(int, int*, int*, int*, int*, int*, int*, int*, int*)
int find_meta_args(int start, int *p1b, int *p1e, int *p2b, int *p2e, int *endm,
                int *argc, int *argb, int *arge) {
            int pos, k;
            int hyp_end1, hyp_end2;

            // look for macro_end or macro_arg_start
            pos = start;
            if (!match_sequence(S->meta.macro_arg_start, &pos)) {
                if (!match_end_sequence(S->meta.macro_end, &pos))
                    return -1;
                *endm = pos;
                return 0;
            }
            *p1b = pos;

            // special syntax for #define : 1st arg is a macro call
            if ((*argc)
                    && splice_possible_user(&pos, p1e, &hyp_end1, &hyp_end2, argb, arge,
                            argc, 0, nullptr, FLAG_META)) {
                *p1b = pos;
                if (hyp_end2 >= 0)
                    pos = hyp_end2;
                else {
                    pos = hyp_end1;
                    *argc = 0;
                }
                if (!match_sequence(S->meta.macro_arg_sep, &pos)) {
                    if (!match_end_sequence(S->meta.macro_arg_end, &pos))
                        bug(
                                "#define/#defeval requires an identifier or a single macro call");
                    *endm = pos;
                    return 1;
                }
            } else {
                *argc = 0;
                k = 0;
                while (1) { // look for macro_arg_end, macro_arg_sep, or comment-start
                    pos = iter_identifier_end(pos);
                    skip_possible_comments(&pos, FLAG_META, 0);
                    if (get_char(pos) != 0 && strchr(S->meta.stackchar, get_char(pos)))
                        k++;
                    if (k) {
                        if (get_char(pos) != 0
                                && strchr(S->meta.unstackchar, get_char(pos)))
                            k--;
                    } else {
                        *p1e = pos;
                        if (match_sequence(S->meta.macro_arg_sep, &pos))
                            break;
                        if (match_end_sequence(S->meta.macro_arg_end, &pos)) {
                            *endm = pos;
                            return 1;
                        }
                    }
                    if (get_char(pos) == 0)
                        bug("unfinished macro argument");
                    pos++; // nothing matched, go forward
                }
            }

            *p2b = pos;
            k = 0;
            while (1) { // look for macro_arg_end or comment-start
                pos = iter_identifier_end(pos);
                skip_possible_comments(&pos, FLAG_META, 0);
                if (get_char(pos) != 0 && strchr(S->meta.stackchar, get_char(pos)))
                    k++;
                if (k) {
                    if (get_char(pos) != 0 && strchr(S->meta.unstackchar, get_char(pos)))
                        k--;
                } else {
                    *p2e = pos;
                    if (match_end_sequence(S->meta.macro_arg_end, &pos))
                        break;
                }
                if (get_char(pos) == 0)
                    bug("unfinished macro");
                pos++; // nothing matched, go forward
            }
            *endm = pos;
            return 2;
        }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq 0x28(%rbp), %rax
movq 0x20(%rbp), %rax
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq %rdi, -0x50(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq (%rdi), %rax
movq 0x58(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x6810
cmpl $0x0, %eax
jne 0x725f
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x50(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x3f80
cmpl $0x0, %eax
jne 0x724a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x75c3
movl -0x3c(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x4(%rbp)
jmp 0x75c3
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq 0x18(%rbp), %rax
cmpl $0x0, (%rax)
je 0x7346
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq 0x20(%rbp), %r9
movq 0x28(%rbp), %r10
movq 0x18(%rbp), %rax
leaq -0x3c(%rbp), %rsi
leaq -0x44(%rbp), %rcx
leaq -0x48(%rbp), %r8
xorl %r11d, %r11d
xorl %r11d, %r11d
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
callq 0x8f00
cmpl $0x0, %eax
je 0x7346
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpl $0x0, -0x48(%rbp)
jl 0x72de
movl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
jmp 0x72ee
movl -0x44(%rbp), %eax
movl %eax, -0x3c(%rbp)
movq 0x18(%rbp), %rax
movl $0x0, (%rax)
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x60(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x6810
cmpl $0x0, %eax
jne 0x7341
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x3f80
cmpl $0x0, %eax
jne 0x732c
leaq 0x48ee(%rip), %rdi      # 0xbc15
callq 0x35e0
movl -0x3c(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x75c3
jmp 0x7495
movq 0x18(%rbp), %rax
movl $0x0, (%rax)
movl $0x0, -0x40(%rbp)
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x91f0
movq -0x50(%rbp), %rdi
movl %eax, -0x3c(%rbp)
leaq -0x3c(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x9230
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6c80
movsbl %al, %eax
cmpl $0x0, %eax
je 0x73c0
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x80(%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x3c(%rbp), %esi
callq 0x6c80
movq -0x58(%rbp), %rdi
movsbl %al, %esi
callq 0x2040
cmpq $0x0, %rax
je 0x73c0
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x7411
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6c80
movsbl %al, %eax
cmpl $0x0, %eax
je 0x740f
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
movq %rax, -0x60(%rbp)
movl -0x3c(%rbp), %esi
callq 0x6c80
movq -0x60(%rbp), %rdi
movsbl %al, %esi
callq 0x2040
cmpq $0x0, %rax
je 0x740f
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7465
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
movq (%rdi), %rax
movq 0x60(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x6810
cmpl $0x0, %eax
je 0x7435
jmp 0x7493
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x68(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x3f80
cmpl $0x0, %eax
je 0x7463
movl -0x3c(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x1, -0x4(%rbp)
jmp 0x75c3
jmp 0x7465
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6c80
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x7485
leaq 0x47d4(%rip), %rdi      # 0xbc54
callq 0x35e0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x7357
jmp 0x7495
movl -0x3c(%rbp), %ecx
movq -0x30(%rbp), %rax
movl %ecx, (%rax)
movl $0x0, -0x40(%rbp)
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x91f0
movq -0x50(%rbp), %rdi
movl %eax, -0x3c(%rbp)
leaq -0x3c(%rbp), %rsi
xorl %ecx, %ecx
movl %ecx, %edx
callq 0x9230
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6c80
movsbl %al, %eax
cmpl $0x0, %eax
je 0x750e
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x80(%rax), %rax
movq %rax, -0x68(%rbp)
movl -0x3c(%rbp), %esi
callq 0x6c80
movq -0x68(%rbp), %rdi
movsbl %al, %esi
callq 0x2040
cmpq $0x0, %rax
je 0x750e
movl -0x40(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40(%rbp)
cmpl $0x0, -0x40(%rbp)
je 0x755f
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6c80
movsbl %al, %eax
cmpl $0x0, %eax
je 0x755d
movq -0x50(%rbp), %rdi
movq (%rdi), %rax
movq 0x88(%rax), %rax
movq %rax, -0x70(%rbp)
movl -0x3c(%rbp), %esi
callq 0x6c80
movq -0x70(%rbp), %rdi
movsbl %al, %esi
callq 0x2040
cmpq $0x0, %rax
je 0x755d
movl -0x40(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x7585
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, (%rax)
movq (%rdi), %rax
movq 0x68(%rax), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x3f80
cmpl $0x0, %eax
je 0x7583
jmp 0x75b3
jmp 0x7585
movq -0x50(%rbp), %rdi
movl -0x3c(%rbp), %esi
callq 0x6c80
movsbl %al, %eax
cmpl $0x0, %eax
jne 0x75a5
leaq 0x46ce(%rip), %rdi      # 0xbc6e
callq 0x35e0
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x74a5
movl -0x3c(%rbp), %ecx
movq 0x10(%rbp), %rax
movl %ecx, (%rax)
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xa0, %rsp
popq %rbp
retq
nop