// File: /workspace/github_c_makefile_star2_O0/mijallen[P]SimpleHTTPServer/lib/libyaml/tests/example-reformatter-alt.c
// Function: main
int
main(int argc, char *argv[])
{
    int help = 0;
    int canonical = 0;
    int unicode = 0;
    int k;
    int done = 0;

    yaml_parser_t parser;
    yaml_emitter_t emitter;
    yaml_document_t document;

    /* Clear the objects. */

    memset(&parser, 0, sizeof(parser));
    memset(&emitter, 0, sizeof(emitter));
    memset(&document, 0, sizeof(document));

    /* Analyze command line options. */

    for (k = 1; k < argc; k ++)
    {
        if (strcmp(argv[k], "-h") == 0
                || strcmp(argv[k], "--help") == 0) {
            help = 1;
        }

        else if (strcmp(argv[k], "-c") == 0
                || strcmp(argv[k], "--canonical") == 0) {
            canonical = 1;
        }

        else if (strcmp(argv[k], "-u") == 0
                || strcmp(argv[k], "--unicode") == 0) {
            unicode = 1;
        }

        else {
            fprintf(stderr, "Unrecognized option: %s\n"
                    "Try `%s --help` for more information.\n",
                    argv[k], argv[0]);
            return 1;
        }
    }

    /* Display the help string. */

    if (help)
    {
        printf("%s [--canonical] [--unicode] <input >output\n"
                "or\n%s -h | --help\nReformat a YAML stream\n\nOptions:\n"
                "-h, --help\t\tdisplay this help and exit\n"
                "-c, --canonical\t\toutput in the canonical YAML format\n"
                "-u, --unicode\t\toutput unescaped non-ASCII characters\n",
                argv[0], argv[0]);
        return 0;
    }

    /* Initialize the parser and emitter objects. */

    if (!yaml_parser_initialize(&parser))
        goto parser_error;

    if (!yaml_emitter_initialize(&emitter))
        goto emitter_error;

    /* Set the parser parameters. */

    yaml_parser_set_input_file(&parser, stdin);

    /* Set the emitter parameters. */

    yaml_emitter_set_output_file(&emitter, stdout);

    yaml_emitter_set_canonical(&emitter, canonical);
    yaml_emitter_set_unicode(&emitter, unicode);

    /* The main loop. */

    while (!done)
    {
        /* Get the next event. */

        if (!yaml_parser_load(&parser, &document))
            goto parser_error;

        /* Check if this is the stream end. */

        if (!yaml_document_get_root_node(&document)) {
            done = 1;
        }

        /* Emit the event. */

        if (!yaml_emitter_dump(&emitter, &document))
            goto emitter_error;
    }

    yaml_parser_delete(&parser);
    yaml_emitter_delete(&emitter);

    return 0;

parser_error:

    /* Display a parser error message. */

    switch (parser.error)
    {
        case YAML_MEMORY_ERROR:
            fprintf(stderr, "Memory error: Not enough memory for parsing\n");
            break;

        case YAML_READER_ERROR:
            if (parser.problem_value != -1) {
                fprintf(stderr, "Reader error: %s: #%X at %d\n", parser.problem,
                        parser.problem_value, parser.problem_offset);
            }
            else {
                fprintf(stderr, "Reader error: %s at %d\n", parser.problem,
                        parser.problem_offset);
            }
            break;

        case YAML_SCANNER_ERROR:
            if (parser.context) {
                fprintf(stderr, "Scanner error: %s at line %d, column %d\n"
                        "%s at line %d, column %d\n", parser.context,
                        parser.context_mark.line+1, parser.context_mark.column+1,
                        parser.problem, parser.problem_mark.line+1,
                        parser.problem_mark.column+1);
            }
            else {
                fprintf(stderr, "Scanner error: %s at line %d, column %d\n",
                        parser.problem, parser.problem_mark.line+1,
                        parser.problem_mark.column+1);
            }
            break;

        case YAML_PARSER_ERROR:
            if (parser.context) {
                fprintf(stderr, "Parser error: %s at line %d, column %d\n"
                        "%s at line %d, column %d\n", parser.context,
                        parser.context_mark.line+1, parser.context_mark.column+1,
                        parser.problem, parser.problem_mark.line+1,
                        parser.problem_mark.column+1);
            }
            else {
                fprintf(stderr, "Parser error: %s at line %d, column %d\n",
                        parser.problem, parser.problem_mark.line+1,
                        parser.problem_mark.column+1);
            }
            break;

        case YAML_COMPOSER_ERROR:
            if (parser.context) {
                fprintf(stderr, "Composer error: %s at line %d, column %d\n"
                        "%s at line %d, column %d\n", parser.context,
                        parser.context_mark.line+1, parser.context_mark.column+1,
                        parser.problem, parser.problem_mark.line+1,
                        parser.problem_mark.column+1);
            }
            else {
                fprintf(stderr, "Composer error: %s at line %d, column %d\n",
                        parser.problem, parser.problem_mark.line+1,
                        parser.problem_mark.column+1);
            }
            break;

        default:
            /* Couldn't happen. */
            fprintf(stderr, "Internal error\n");
            break;
    }

    yaml_parser_delete(&parser);
    yaml_emitter_delete(&emitter);

    return 1;

emitter_error:

    /* Display an emitter error message. */

    switch (emitter.error)
    {
        case YAML_MEMORY_ERROR:
            fprintf(stderr, "Memory error: Not enough memory for emitting\n");
            break;

        case YAML_WRITER_ERROR:
            fprintf(stderr, "Writer error: %s\n", emitter.problem);
            break;

        case YAML_EMITTER_ERROR:
            fprintf(stderr, "Emitter error: %s\n", emitter.problem);
            break;

        default:
            /* Couldn't happen. */
            fprintf(stderr, "Internal error\n");
            break;
    }

    yaml_parser_delete(&parser);
    yaml_emitter_delete(&emitter);

    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x440, %rsp            # imm = 0x440
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x24(%rbp)
leaq -0x208(%rbp), %rdi
xorl %esi, %esi
movl $0x1e0, %edx            # imm = 0x1E0
callq 0x10b0
leaq -0x3b8(%rbp), %rdi
xorl %esi, %esi
movl $0x1b0, %edx            # imm = 0x1B0
callq 0x10b0
leaq -0x420(%rbp), %rdi
xorl %esi, %esi
movl $0x68, %edx
callq 0x10b0
movl $0x1, -0x20(%rbp)
movl -0x20(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x13b8
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd64(%rip), %rsi       # 0x2018
callq 0x10c0
cmpl $0x0, %eax
je 0x12db
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd4a(%rip), %rsi       # 0x201b
callq 0x10c0
cmpl $0x0, %eax
jne 0x12e7
movl $0x1, -0x14(%rbp)
jmp 0x13a8
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd28(%rip), %rsi       # 0x2022
callq 0x10c0
cmpl $0x0, %eax
je 0x1321
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xd0e(%rip), %rsi       # 0x2025
callq 0x10c0
cmpl $0x0, %eax
jne 0x132a
movl $0x1, -0x18(%rbp)
jmp 0x13a6
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcf4(%rip), %rsi       # 0x2031
callq 0x10c0
cmpl $0x0, %eax
je 0x1364
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xcda(%rip), %rsi       # 0x2034
callq 0x10c0
cmpl $0x0, %eax
jne 0x136d
movl $0x1, -0x1c(%rbp)
jmp 0x13a4
movq 0x2c84(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rcx
leaq 0xcad(%rip), %rsi       # 0x203e
movb $0x0, %al
callq 0x10d0
movl $0x1, -0x4(%rbp)
jmp 0x186d
jmp 0x13a6
jmp 0x13a8
jmp 0x13aa
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x1295
cmpl $0x0, -0x14(%rbp)
je 0x13e6
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xcaa(%rip), %rdi       # 0x207d
movb $0x0, %al
callq 0x10a0
movl $0x0, -0x4(%rbp)
jmp 0x186d
leaq -0x208(%rbp), %rdi
callq 0x10f0
cmpl $0x0, %eax
jne 0x13fc
jmp 0x14e1
leaq -0x3b8(%rbp), %rdi
callq 0x1070
cmpl $0x0, %eax
jne 0x1412
jmp 0x17ad
movq 0x2bbf(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
leaq -0x208(%rbp), %rdi
callq 0x1030
movq 0x2ba1(%rip), %rax      # 0x3fd0
movq (%rax), %rsi
leaq -0x3b8(%rbp), %rdi
callq 0x1060
movl -0x18(%rbp), %esi
leaq -0x3b8(%rbp), %rdi
callq 0x1100
movl -0x1c(%rbp), %esi
leaq -0x3b8(%rbp), %rdi
callq 0x1110
cmpl $0x0, -0x24(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x146b
jmp 0x14bd
leaq -0x208(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x1090
cmpl $0x0, %eax
jne 0x1485
jmp 0x14e1
leaq -0x420(%rbp), %rdi
callq 0x1040
cmpq $0x0, %rax
jne 0x149e
movl $0x1, -0x24(%rbp)
leaq -0x3b8(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x1050
cmpl $0x0, %eax
jne 0x14bb
jmp 0x17ad
jmp 0x145c
leaq -0x208(%rbp), %rdi
callq 0x10e0
leaq -0x3b8(%rbp), %rdi
callq 0x1080
movl $0x0, -0x4(%rbp)
jmp 0x186d
movl -0x208(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x428(%rbp)
subl $0x4, %eax
ja 0x1771
movq -0x428(%rbp), %rax
leaq 0xafb(%rip), %rcx       # 0x2004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x2adf(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xc4b(%rip), %rsi       # 0x216e
movb $0x0, %al
callq 0x10d0
jmp 0x1789
cmpl $-0x1, -0x1f0(%rbp)
je 0x1566
movq 0x2ab9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x200(%rbp), %rdx
movl -0x1f0(%rbp), %ecx
movq -0x1f8(%rbp), %r8
leaq 0xc3e(%rip), %rsi       # 0x219b
movb $0x0, %al
callq 0x10d0
jmp 0x158c
movq 0x2a8b(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x200(%rbp), %rdx
movq -0x1f8(%rbp), %rcx
leaq 0xc33(%rip), %rsi       # 0x21b8
movb $0x0, %al
callq 0x10d0
jmp 0x1789
cmpq $0x0, -0x1d0(%rbp)
je 0x15f8
movq 0x2a56(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x1d0(%rbp), %rdx
movq -0x1c0(%rbp), %rcx
addq $0x1, %rcx
movq -0x1b8(%rbp), %r8
addq $0x1, %r8
movq -0x200(%rbp), %r9
movq -0x1e0(%rbp), %r10
addq $0x1, %r10
movq -0x1d8(%rbp), %rax
addq $0x1, %rax
leaq 0xbea(%rip), %rsi       # 0x21d0
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x10d0
jmp 0x162d
movq 0x29f9(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x200(%rbp), %rdx
movq -0x1e0(%rbp), %rcx
addq $0x1, %rcx
movq -0x1d8(%rbp), %r8
addq $0x1, %r8
leaq 0xbec(%rip), %rsi       # 0x2212
movb $0x0, %al
callq 0x10d0
jmp 0x1789
cmpq $0x0, -0x1d0(%rbp)
je 0x1699
movq 0x29b5(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x1d0(%rbp), %rdx
movq -0x1c0(%rbp), %rcx
addq $0x1, %rcx
movq -0x1b8(%rbp), %r8
addq $0x1, %r8
movq -0x200(%rbp), %r9
movq -0x1e0(%rbp), %r10
addq $0x1, %r10
movq -0x1d8(%rbp), %rax
addq $0x1, %rax
leaq 0xbb4(%rip), %rsi       # 0x223b
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x10d0
jmp 0x16ce
movq 0x2958(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x200(%rbp), %rdx
movq -0x1e0(%rbp), %rcx
addq $0x1, %rcx
movq -0x1d8(%rbp), %r8
addq $0x1, %r8
leaq 0xbb5(%rip), %rsi       # 0x227c
movb $0x0, %al
callq 0x10d0
jmp 0x1789
cmpq $0x0, -0x1d0(%rbp)
je 0x173a
movq 0x2914(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x1d0(%rbp), %rdx
movq -0x1c0(%rbp), %rcx
addq $0x1, %rcx
movq -0x1b8(%rbp), %r8
addq $0x1, %r8
movq -0x200(%rbp), %r9
movq -0x1e0(%rbp), %r10
addq $0x1, %r10
movq -0x1d8(%rbp), %rax
addq $0x1, %rax
leaq 0xb7c(%rip), %rsi       # 0x22a4
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x10d0
jmp 0x176f
movq 0x28b7(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x200(%rbp), %rdx
movq -0x1e0(%rbp), %rcx
addq $0x1, %rcx
movq -0x1d8(%rbp), %r8
addq $0x1, %r8
leaq 0xb7f(%rip), %rsi       # 0x22e7
movb $0x0, %al
callq 0x10d0
jmp 0x1789
movq 0x2880(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xb8f(%rip), %rsi       # 0x2311
movb $0x0, %al
callq 0x10d0
leaq -0x208(%rbp), %rdi
callq 0x10e0
leaq -0x3b8(%rbp), %rdi
callq 0x1080
movl $0x1, -0x4(%rbp)
jmp 0x186d
movl -0x3b8(%rbp), %eax
movl %eax, -0x42c(%rbp)
subl $0x1, %eax
je 0x17da
jmp 0x17c0
movl -0x42c(%rbp), %eax
subl $0x6, %eax
je 0x17f4
jmp 0x17cd
movl -0x42c(%rbp), %eax
subl $0x7, %eax
je 0x1815
jmp 0x1836
movq 0x2817(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xb36(%rip), %rsi       # 0x2321
movb $0x0, %al
callq 0x10d0
jmp 0x184e
movq 0x27fd(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x3b0(%rbp), %rdx
leaq 0xb43(%rip), %rsi       # 0x234f
movb $0x0, %al
callq 0x10d0
jmp 0x184e
movq 0x27dc(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x3b0(%rbp), %rdx
leaq 0xb34(%rip), %rsi       # 0x2361
movb $0x0, %al
callq 0x10d0
jmp 0x184e
movq 0x27bb(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
leaq 0xaca(%rip), %rsi       # 0x2311
movb $0x0, %al
callq 0x10d0
leaq -0x208(%rbp), %rdi
callq 0x10e0
leaq -0x3b8(%rbp), %rdi
callq 0x1080
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x440, %rsp            # imm = 0x440
popq %rbp
retq