// File: /workspace/github_c_makefile_star2_O0/darwin-on-arm[P]darwin-sdk/xcode_tools/xcrun/ini.c
// Function: ini_parse_file
int ini_parse_file(FILE* file,
                   int (*handler)(void*, const char*, const char*,
                                  const char*),
                   void* user)
{
    /* Uses a fair bit of stack (use heap instead if you need to) */
#if INI_USE_STACK
    char line[INI_MAX_LINE];
#else
    char* line = NULL;
#endif
    char section[MAX_SECTION] = "";
    char prev_name[MAX_NAME] = "";

    char* start = NULL;
    char* end = NULL;
    char* name = NULL;
    char* value = NULL;
    int lineno = 0;
    int error = 0;

#if !INI_USE_STACK
    line = (char*)malloc(INI_MAX_LINE);
    if (!line) {
        return -2;
    }
#endif

    /* Scan through file line by line */
    while (fgets(line, INI_MAX_LINE, file) != NULL) {
        lineno++;

        start = line;
#if INI_ALLOW_BOM
        if (lineno == 1 && (unsigned char)start[0] == 0xEF &&
                           (unsigned char)start[1] == 0xBB &&
                           (unsigned char)start[2] == 0xBF) {
            start += 3;
        }
#endif
        start = lskip(rstrip(start));

        if (*start == ';' || *start == '#') {
            /* Per Python ConfigParser, allow '#' comments at start of line */
        }
#if INI_ALLOW_MULTILINE
        else if (*prev_name && *start && start > line) {
            /* Non-black line with leading whitespace, treat as continuation
               of previous name's value (as per Python ConfigParser). */
            if (!handler(user, section, prev_name, start) && !error)
                error = lineno;
        }
#endif
        else if (*start == '[') {
            /* A "[section]" line */
            end = find_char_or_comment(start + 1, ']');
            if (*end == ']') {
                *end = '\0';
                strncpy0(section, start + 1, sizeof(section));
                *prev_name = '\0';
            }
            else if (!error) {
                /* No ']' found on section line */
                error = lineno;
            }
        }
        else if (*start && *start != ';') {
            /* Not a comment, must be a name[=:]value pair */
            end = find_char_or_comment(start, '=');
            if (*end != '=') {
                end = find_char_or_comment(start, ':');
            }
            if (*end == '=' || *end == ':') {
                *end = '\0';
                name = rstrip(start);
                value = lskip(end + 1);
                end = find_char_or_comment(value, '\0');
                if (*end == ';')
                    *end = '\0';
                rstrip(value);

                /* Valid name[=:]value pair found, call handler */
                strncpy0(prev_name, name, sizeof(prev_name));
                if (!handler(user, section, name, value) && !error)
                    error = lineno;
            }
            else if (!error) {
                /* No '=' or ':' found on name[=:]value line */
                error = lineno;
            }
        }
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x190, %rsp            # imm = 0x190
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x120(%rbp), %rdi
xorl %esi, %esi
movl $0x32, %edx
callq 0x20c0
leaq -0x160(%rbp), %rdi
xorl %esi, %esi
movl $0x32, %edx
callq 0x20c0
movq $0x0, -0x168(%rbp)
movq $0x0, -0x170(%rbp)
movq $0x0, -0x178(%rbp)
movq $0x0, -0x180(%rbp)
movl $0x0, -0x184(%rbp)
movl $0x0, -0x188(%rbp)
leaq -0xe0(%rbp), %rdi
movq -0x8(%rbp), %rdx
movl $0xc8, %esi
callq 0x20d0
cmpq $0x0, %rax
je 0x26b4
movl -0x184(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x184(%rbp)
leaq -0xe0(%rbp), %rax
movq %rax, -0x168(%rbp)
cmpl $0x1, -0x184(%rbp)
jne 0x2419
movq -0x168(%rbp), %rax
movzbl (%rax), %eax
cmpl $0xef, %eax
jne 0x2419
movq -0x168(%rbp), %rax
movzbl 0x1(%rax), %eax
cmpl $0xbb, %eax
jne 0x2419
movq -0x168(%rbp), %rax
movzbl 0x2(%rax), %eax
cmpl $0xbf, %eax
jne 0x2419
movq -0x168(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rdi
callq 0x2740
movq %rax, %rdi
callq 0x26d0
movq %rax, -0x168(%rbp)
movq -0x168(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
je 0x2452
movq -0x168(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x23, %eax
jne 0x2457
jmp 0x26af
movsbl -0x160(%rbp), %eax
cmpl $0x0, %eax
je 0x24c3
movq -0x168(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x24c3
movq -0x168(%rbp), %rax
leaq -0xe0(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x24c3
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdi
leaq -0x120(%rbp), %rsi
leaq -0x160(%rbp), %rdx
movq -0x168(%rbp), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x24be
cmpl $0x0, -0x188(%rbp)
jne 0x24be
movl -0x184(%rbp), %eax
movl %eax, -0x188(%rbp)
jmp 0x26ad
movq -0x168(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5b, %eax
jne 0x2548
movq -0x168(%rbp), %rdi
addq $0x1, %rdi
movl $0x5d, %esi
callq 0x27d0
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x5d, %eax
jne 0x252c
movq -0x170(%rbp), %rax
movb $0x0, (%rax)
leaq -0x120(%rbp), %rdi
movq -0x168(%rbp), %rsi
addq $0x1, %rsi
movl $0x32, %edx
callq 0x2870
movb $0x0, -0x160(%rbp)
jmp 0x2543
cmpl $0x0, -0x188(%rbp)
jne 0x2541
movl -0x184(%rbp), %eax
movl %eax, -0x188(%rbp)
jmp 0x2543
jmp 0x26ab
movq -0x168(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x26a9
movq -0x168(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
je 0x26a9
movq -0x168(%rbp), %rdi
movl $0x3d, %esi
callq 0x27d0
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
je 0x25ad
movq -0x168(%rbp), %rdi
movl $0x3a, %esi
callq 0x27d0
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3d, %eax
je 0x25cf
movq -0x170(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x2690
movq -0x170(%rbp), %rax
movb $0x0, (%rax)
movq -0x168(%rbp), %rdi
callq 0x2740
movq %rax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
addq $0x1, %rdi
callq 0x26d0
movq %rax, -0x180(%rbp)
movq -0x180(%rbp), %rdi
xorl %esi, %esi
callq 0x27d0
movq %rax, -0x170(%rbp)
movq -0x170(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3b, %eax
jne 0x2631
movq -0x170(%rbp), %rax
movb $0x0, (%rax)
movq -0x180(%rbp), %rdi
callq 0x2740
leaq -0x160(%rbp), %rdi
movq -0x178(%rbp), %rsi
movl $0x32, %edx
callq 0x2870
movq -0x10(%rbp), %rax
movq -0x18(%rbp), %rdi
leaq -0x120(%rbp), %rsi
movq -0x178(%rbp), %rdx
movq -0x180(%rbp), %rcx
callq *%rax
cmpl $0x0, %eax
jne 0x268e
cmpl $0x0, -0x188(%rbp)
jne 0x268e
movl -0x184(%rbp), %eax
movl %eax, -0x188(%rbp)
jmp 0x26a7
cmpl $0x0, -0x188(%rbp)
jne 0x26a5
movl -0x184(%rbp), %eax
movl %eax, -0x188(%rbp)
jmp 0x26a7
jmp 0x26a9
jmp 0x26ab
jmp 0x26ad
jmp 0x26af
jmp 0x238d
movl -0x188(%rbp), %eax
addq $0x190, %rsp            # imm = 0x190
popq %rbp
retq
nopw %cs:(%rax,%rax)