// File: /workspace/github_c_makefile_star2_O0/msteveb[P]autosetup/./jimsh0.c
// Function: Jim_RegsubCmd
int Jim_RegsubCmd(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{
    int regcomp_flags = 0;
    int regexec_flags = 0;
    int opt_all = 0;
    int opt_command = 0;
    int offset = 0;
    regex_t *regex;
    const char *p;
    int result = JIM_OK;
    regmatch_t pmatch[MAX_SUB_MATCHES + 1];
    int num_matches = 0;

    int i, j, n;
    Jim_Obj *varname;
    Jim_Obj *resultObj;
    Jim_Obj *cmd_prefix = NULL;
    Jim_Obj *regcomp_obj = NULL;
    const char *source_str;
    int source_len;
    const char *replace_str = NULL;
    int replace_len;
    const char *pattern;
    int option;
    enum {
        OPT_NOCASE, OPT_LINE, OPT_ALL, OPT_START, OPT_COMMAND, OPT_END
    };
    static const char * const options[] = {
        "-nocase", "-line", "-all", "-start", "-command", "--", NULL
    };

    if (argc < 4) {
      wrongNumArgs:
        Jim_WrongNumArgs(interp, 1, argv,
            "?-switch ...? exp string subSpec ?varName?");
        return JIM_ERR;
    }

    for (i = 1; i < argc; i++) {
        const char *opt = Jim_String(argv[i]);

        if (*opt != '-') {
            break;
        }
        if (Jim_GetEnum(interp, argv[i], options, &option, "switch", JIM_ERRMSG | JIM_ENUM_ABBREV) != JIM_OK) {
            return JIM_ERR;
        }
        if (option == OPT_END) {
            i++;
            break;
        }
        switch (option) {
            case OPT_NOCASE:
                regcomp_flags |= REG_ICASE;
                break;

            case OPT_LINE:
                regcomp_flags |= REG_NEWLINE;
                break;

            case OPT_ALL:
                opt_all = 1;
                break;

            case OPT_START:
                if (++i == argc) {
                    goto wrongNumArgs;
                }
                if (Jim_GetIndex(interp, argv[i], &offset) != JIM_OK) {
                    return JIM_ERR;
                }
                break;

            case OPT_COMMAND:
                opt_command = 1;
                break;
        }
    }
    if (argc - i != 3 && argc - i != 4) {
        goto wrongNumArgs;
    }


    regcomp_obj = Jim_DuplicateObj(interp, argv[i]);
	Jim_IncrRefCount(regcomp_obj);
    regex = SetRegexpFromAny(interp, regcomp_obj, regcomp_flags);
    if (!regex) {
		Jim_DecrRefCount(interp, regcomp_obj);
        return JIM_ERR;
    }
    pattern = Jim_String(argv[i]);

    source_str = Jim_GetString(argv[i + 1], &source_len);
    if (opt_command) {
        cmd_prefix = argv[i + 2];
        if (Jim_ListLength(interp, cmd_prefix) == 0) {
            Jim_SetResultString(interp, "command prefix must be a list of at least one element", -1);
			Jim_DecrRefCount(interp, regcomp_obj);
            return JIM_ERR;
        }
        Jim_IncrRefCount(cmd_prefix);
    }
    else {
        replace_str = Jim_GetString(argv[i + 2], &replace_len);
    }
    varname = argv[i + 3];


    resultObj = Jim_NewStringObj(interp, "", 0);

    if (offset) {
        if (offset < 0) {
            offset += source_len + 1;
        }
        if (offset > source_len) {
            offset = source_len;
        }
        else if (offset < 0) {
            offset = 0;
        }
    }

    offset = utf8_index(source_str, offset);


    Jim_AppendString(interp, resultObj, source_str, offset);


    n = source_len - offset;
    p = source_str + offset;
    do {
        int match = jim_regexec(regex, p, MAX_SUB_MATCHES, pmatch, regexec_flags);

        if (match >= REG_BADPAT) {
            char buf[100];

            jim_regerror(match, regex, buf, sizeof(buf));
            Jim_SetResultFormatted(interp, "error while matching pattern: %s", buf);
            return JIM_ERR;
        }
        if (match == REG_NOMATCH) {
            break;
        }

        num_matches++;

        Jim_AppendString(interp, resultObj, p, pmatch[0].rm_so);

        if (opt_command) {

            Jim_Obj *cmdListObj = Jim_DuplicateObj(interp, cmd_prefix);
            for (j = 0; j < MAX_SUB_MATCHES; j++) {
                if (pmatch[j].rm_so == -1) {
                    break;
                }
                else {
                    Jim_Obj *srcObj = Jim_NewStringObj(interp, p + pmatch[j].rm_so, pmatch[j].rm_eo - pmatch[j].rm_so);
                    Jim_ListAppendElement(interp, cmdListObj, srcObj);
                }
            }
            Jim_IncrRefCount(cmdListObj);

            result = Jim_EvalObj(interp, cmdListObj);
            Jim_DecrRefCount(interp, cmdListObj);
            if (result != JIM_OK) {
                goto cmd_error;
            }
            Jim_AppendString(interp, resultObj, Jim_String(Jim_GetResult(interp)), -1);
        }
        else {

            for (j = 0; j < replace_len; j++) {
                int idx;
                int c = replace_str[j];

                if (c == '&') {
                    idx = 0;
                }
                else if (c == '\\' && j < replace_len) {
                    c = replace_str[++j];
                    if ((c >= '0') && (c <= '9')) {
                        idx = c - '0';
                    }
                    else if ((c == '\\') || (c == '&')) {
                        Jim_AppendString(interp, resultObj, replace_str + j, 1);
                        continue;
                    }
                    else {
                        Jim_AppendString(interp, resultObj, replace_str + j - 1, (j == replace_len) ? 1 : 2);
                        continue;
                    }
                }
                else {
                    Jim_AppendString(interp, resultObj, replace_str + j, 1);
                    continue;
                }
                if ((idx < MAX_SUB_MATCHES) && pmatch[idx].rm_so != -1 && pmatch[idx].rm_eo != -1) {
                    Jim_AppendString(interp, resultObj, p + pmatch[idx].rm_so,
                        pmatch[idx].rm_eo - pmatch[idx].rm_so);
                }
            }
        }

        p += pmatch[0].rm_eo;
        n -= pmatch[0].rm_eo;


        if (!opt_all || n == 0) {
            break;
        }


        if ((regcomp_flags & REG_NEWLINE) == 0 && pattern[0] == '^') {
            break;
        }


        if (pattern[0] == '\0' && n) {

            Jim_AppendString(interp, resultObj, p, 1);
            p++;
            n--;
        }

        if (pmatch[0].rm_eo == pmatch[0].rm_so) {

            regexec_flags = REG_NOTBOL;
        }
        else {
            regexec_flags = 0;
        }

    } while (n);

    Jim_AppendString(interp, resultObj, p, -1);

cmd_error:
    if (result == JIM_OK) {

        if (argc - i == 4) {
            result = Jim_SetVariable(interp, varname, resultObj);

            if (result == JIM_OK) {
                Jim_SetResultInt(interp, num_matches);
            }
            else {
                Jim_FreeObj(interp, resultObj);
            }
        }
        else {
            Jim_SetResult(interp, resultObj);
            result = JIM_OK;
        }
    }
    else {
        Jim_FreeObj(interp, resultObj);
    }

    if (opt_command) {
        Jim_DecrRefCount(interp, cmd_prefix);
    }

	Jim_DecrRefCount(interp, regcomp_obj);

    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x310, %rsp            # imm = 0x310
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x1f4(%rbp)
movq $0x0, -0x218(%rbp)
movq $0x0, -0x220(%rbp)
movq $0x0, -0x238(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x8fb8
jmp 0x8f93
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq 0x31c8f(%rip), %rcx     # 0x3ac36
callq 0x7880
movl $0x1, -0x4(%rbp)
jmp 0x99ed
movl $0x1, -0x1f8(%rbp)
movl -0x1f8(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x9113
movq -0x20(%rbp), %rax
movslq -0x1f8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7960
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x9000
jmp 0x9113
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x1f8(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x3cd86(%rip), %rdx     # 0x45da0
leaq -0x24c(%rbp), %rcx
leaq 0x31ba7(%rip), %r8      # 0x3abcf
movl $0x3, %r9d
callq 0x8590
cmpl $0x0, %eax
je 0x9044
movl $0x1, -0x4(%rbp)
jmp 0x99ed
cmpl $0x5, -0x24c(%rbp)
jne 0x9061
movl -0x1f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f8(%rbp)
jmp 0x9113
movl -0x24c(%rbp), %eax
movq %rax, -0x300(%rbp)
subq $0x4, %rax
ja 0x90fd
movq -0x300(%rbp), %rax
leaq 0x2cfa2(%rip), %rcx     # 0x36028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x24(%rbp), %eax
orl $0x2, %eax
movl %eax, -0x24(%rbp)
jmp 0x90fd
movl -0x24(%rbp), %eax
orl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x90fd
movl $0x1, -0x2c(%rbp)
jmp 0x90fd
movl -0x1f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f8(%rbp)
cmpl -0x14(%rbp), %eax
jne 0x90c7
jmp 0x8f93
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x1f8(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq -0x34(%rbp), %rdx
callq 0x87a0
cmpl $0x0, %eax
je 0x90f4
movl $0x1, -0x4(%rbp)
jmp 0x99ed
jmp 0x90fd
movl $0x1, -0x30(%rbp)
jmp 0x90ff
movl -0x1f8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f8(%rbp)
jmp 0x8fc2
movl -0x14(%rbp), %eax
subl -0x1f8(%rbp), %eax
cmpl $0x3, %eax
je 0x9134
movl -0x14(%rbp), %eax
subl -0x1f8(%rbp), %eax
cmpl $0x4, %eax
je 0x9134
jmp 0x8f93
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rax
movslq -0x1f8(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
callq 0x9a00
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x220(%rbp), %rsi
movl -0x24(%rbp), %edx
callq 0x8860
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x91b2
movq -0x220(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x91a6
movq -0x10(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x7a10
movl $0x1, -0x4(%rbp)
jmp 0x99ed
movq -0x20(%rbp), %rax
movslq -0x1f8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x7960
movq %rax, -0x248(%rbp)
movq -0x20(%rbp), %rax
movl -0x1f8(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x22c(%rbp), %rsi
callq 0x89b0
movq %rax, -0x228(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0x92d6
movq -0x20(%rbp), %rax
movl -0x1f8(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x218(%rbp)
movq -0x10(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x9b50
cmpl $0x0, %eax
jne 0x92c4
jmp 0x9234
movq -0x10(%rbp), %rdi
leaq 0x31a22(%rip), %rsi     # 0x3ac61
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7990
movq %rax, -0x260(%rbp)
movq -0x260(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x9285
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x260(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x220(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x92b8
movq -0x10(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x7a10
movl $0x1, -0x4(%rbp)
jmp 0x99ed
movq -0x218(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
jmp 0x92fd
movq -0x20(%rbp), %rax
movl -0x1f8(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x23c(%rbp), %rsi
callq 0x89b0
movq %rax, -0x238(%rbp)
movq -0x20(%rbp), %rax
movl -0x1f8(%rbp), %ecx
addl $0x3, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x208(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x3468f(%rip), %rsi     # 0x3d9b2
xorl %edx, %edx
callq 0x7990
movq %rax, -0x210(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x9373
cmpl $0x0, -0x34(%rbp)
jge 0x934c
movl -0x22c(%rbp), %eax
addl $0x1, %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x22c(%rbp), %eax
jle 0x9362
movl -0x22c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x9371
cmpl $0x0, -0x34(%rbp)
jge 0x936f
movl $0x0, -0x34(%rbp)
jmp 0x9371
jmp 0x9373
movl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x228(%rbp), %rdx
movl -0x34(%rbp), %ecx
callq 0x8db0
movl -0x22c(%rbp), %eax
subl -0x34(%rbp), %eax
movl %eax, -0x200(%rbp)
movq -0x228(%rbp), %rax
movslq -0x34(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movq -0x40(%rbp), %rdi
movq -0x48(%rbp), %rsi
leaq -0x1f0(%rbp), %rcx
movl -0x28(%rbp), %r8d
movl $0x32, %edx
callq 0x8a00
movl %eax, -0x264(%rbp)
cmpl $0x2, -0x264(%rbp)
jl 0x9420
movl -0x264(%rbp), %edi
movq -0x40(%rbp), %rsi
leaq -0x2d0(%rbp), %rdx
movl $0x64, %ecx
callq 0x8cf0
movq -0x10(%rbp), %rdi
leaq -0x2d0(%rbp), %rdx
leaq 0x317ff(%rip), %rsi     # 0x3ac0c
movb $0x0, %al
callq 0x6b40
movl $0x1, -0x4(%rbp)
jmp 0x99ed
cmpl $0x1, -0x264(%rbp)
jne 0x942e
jmp 0x9864
movl -0x1f4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1f4(%rbp)
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x48(%rbp), %rdx
movl -0x1f0(%rbp), %ecx
callq 0x8db0
cmpl $0x0, -0x30(%rbp)
je 0x95a9
movq -0x10(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x9a00
movq %rax, -0x2d8(%rbp)
movl $0x0, -0x1fc(%rbp)
cmpl $0x32, -0x1fc(%rbp)
jge 0x9511
movslq -0x1fc(%rbp), %rax
cmpl $-0x1, -0x1f0(%rbp,%rax,8)
jne 0x94a2
jmp 0x9511
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movslq -0x1fc(%rbp), %rax
movslq -0x1f0(%rbp,%rax,8), %rax
addq %rax, %rsi
movslq -0x1fc(%rbp), %rax
movl -0x1ec(%rbp,%rax,8), %edx
movslq -0x1fc(%rbp), %rax
subl -0x1f0(%rbp,%rax,8), %edx
callq 0x7990
movq %rax, -0x2e0(%rbp)
movq -0x10(%rbp), %rdi
movq -0x2d8(%rbp), %rsi
movq -0x2e0(%rbp), %rdx
callq 0x7bd0
jmp 0x94fd
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
jmp 0x9482
movq -0x2d8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rdi
movq -0x2d8(%rbp), %rsi
callq 0x9b80
movl %eax, -0x4c(%rbp)
movq -0x2d8(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x9559
movq -0x10(%rbp), %rdi
movq -0x2d8(%rbp), %rsi
callq 0x7a10
cmpl $0x0, -0x4c(%rbp)
je 0x9564
jmp 0x987d
movq -0x10(%rbp), %rax
movq %rax, -0x310(%rbp)
movq -0x210(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7960
movq -0x310(%rbp), %rdi
movq -0x308(%rbp), %rsi
movq %rax, %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x8db0
jmp 0x9793
movl $0x0, -0x1fc(%rbp)
movl -0x1fc(%rbp), %eax
cmpl -0x23c(%rbp), %eax
jge 0x9791
movq -0x238(%rbp), %rax
movslq -0x1fc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2e8(%rbp)
cmpl $0x26, -0x2e8(%rbp)
jne 0x95f5
movl $0x0, -0x2e4(%rbp)
jmp 0x970e
cmpl $0x5c, -0x2e8(%rbp)
jne 0x96e4
movl -0x1fc(%rbp), %eax
cmpl -0x23c(%rbp), %eax
jge 0x96e4
movq -0x238(%rbp), %rax
movl -0x1fc(%rbp), %ecx
addl $0x1, %ecx
movl %ecx, -0x1fc(%rbp)
movslq %ecx, %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2e8(%rbp)
cmpl $0x30, -0x2e8(%rbp)
jl 0x965d
cmpl $0x39, -0x2e8(%rbp)
jg 0x965d
movl -0x2e8(%rbp), %eax
subl $0x30, %eax
movl %eax, -0x2e4(%rbp)
jmp 0x96e2
cmpl $0x5c, -0x2e8(%rbp)
je 0x966f
cmpl $0x26, -0x2e8(%rbp)
jne 0x969a
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x238(%rbp), %rdx
movslq -0x1fc(%rbp), %rax
addq %rax, %rdx
movl $0x1, %ecx
callq 0x8db0
jmp 0x977d
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x238(%rbp), %rdx
movslq -0x1fc(%rbp), %rax
addq %rax, %rdx
addq $-0x1, %rdx
movl -0x1fc(%rbp), %r8d
movl -0x23c(%rbp), %r9d
movl $0x2, %ecx
movl $0x1, %eax
cmpl %r9d, %r8d
cmovel %eax, %ecx
callq 0x8db0
jmp 0x977d
jmp 0x970c
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x238(%rbp), %rdx
movslq -0x1fc(%rbp), %rax
addq %rax, %rdx
movl $0x1, %ecx
callq 0x8db0
jmp 0x977d
jmp 0x970e
cmpl $0x32, -0x2e4(%rbp)
jge 0x977b
movslq -0x2e4(%rbp), %rax
cmpl $-0x1, -0x1f0(%rbp,%rax,8)
je 0x977b
movslq -0x2e4(%rbp), %rax
cmpl $-0x1, -0x1ec(%rbp,%rax,8)
je 0x977b
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x48(%rbp), %rdx
movslq -0x2e4(%rbp), %rax
movslq -0x1f0(%rbp,%rax,8), %rax
addq %rax, %rdx
movslq -0x2e4(%rbp), %rax
movl -0x1ec(%rbp,%rax,8), %ecx
movslq -0x2e4(%rbp), %rax
subl -0x1f0(%rbp,%rax,8), %ecx
callq 0x8db0
jmp 0x977d
movl -0x1fc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1fc(%rbp)
jmp 0x95b3
jmp 0x9793
movl -0x1ec(%rbp), %ecx
movq -0x48(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x48(%rbp)
movl -0x1ec(%rbp), %ecx
movl -0x200(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x200(%rbp)
cmpl $0x0, -0x2c(%rbp)
je 0x97ca
cmpl $0x0, -0x200(%rbp)
jne 0x97cf
jmp 0x9864
movl -0x24(%rbp), %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x97eb
movq -0x248(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5e, %eax
jne 0x97eb
jmp 0x9864
movq -0x248(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x9837
cmpl $0x0, -0x200(%rbp)
je 0x9837
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x48(%rbp), %rdx
movl $0x1, %ecx
callq 0x8db0
movq -0x48(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x48(%rbp)
movl -0x200(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x200(%rbp)
movl -0x1ec(%rbp), %eax
cmpl -0x1f0(%rbp), %eax
jne 0x984e
movl $0x10, -0x28(%rbp)
jmp 0x9855
movl $0x0, -0x28(%rbp)
jmp 0x9857
cmpl $0x0, -0x200(%rbp)
jne 0x93b4
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
movq -0x48(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x8db0
cmpl $0x0, -0x4c(%rbp)
jne 0x9985
movl -0x14(%rbp), %eax
subl -0x1f8(%rbp), %eax
cmpl $0x4, %eax
jne 0x9929
movq -0x10(%rbp), %rdi
movq -0x208(%rbp), %rsi
movq -0x210(%rbp), %rdx
callq 0x8df0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
jne 0x9917
jmp 0x98bb
movq -0x10(%rbp), %rdi
movslq -0x1f4(%rbp), %rsi
callq 0x8d60
movq %rax, -0x2f0(%rbp)
movq -0x2f0(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x9907
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x2f0(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x9927
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
callq 0x7a10
jmp 0x9983
jmp 0x992b
movq -0x210(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq -0x2f8(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x10(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x996e
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x7a10
movq -0x2f8(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4c(%rbp)
jmp 0x9995
movq -0x10(%rbp), %rdi
movq -0x210(%rbp), %rsi
callq 0x7a10
cmpl $0x0, -0x30(%rbp)
je 0x99c2
movq -0x218(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x99c0
movq -0x10(%rbp), %rdi
movq -0x218(%rbp), %rsi
callq 0x7a10
jmp 0x99c2
movq -0x220(%rbp), %rcx
movl 0x10(%rcx), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rcx)
cmpl $0x0, %eax
jg 0x99e7
movq -0x10(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x7a10
movl -0x4c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x310, %rsp            # imm = 0x310
popq %rbp
retq
nopl (%rax)