// File: /workspace/github_c_makefile_star2_O0/mijallen[P]SimpleHTTPServer/lib/libyaml/tests/run-dumper.c
// Function: main
int
main(int argc, char *argv[])
{
    int number;
    int canonical = 0;
    int unicode = 0;

    number = 1;
    while (number < argc) {
        if (strcmp(argv[number], "-c") == 0) {
            canonical = 1;
        }
        else if (strcmp(argv[number], "-u") == 0) {
            unicode = 1;
        }
        else if (argv[number][0] == '-') {
            printf("Unknown option: '%s'\n", argv[number]);
            return 0;
        }
        if (argv[number][0] == '-') {
            if (number < argc-1) {
                memmove(argv+number, argv+number+1, (argc-number-1)*sizeof(char *));
            }
            argc --;
        }
        else {
            number ++;
        }
    }

    if (argc < 2) {
        printf("Usage: %s [-c] [-u] file1.yaml ...\n", argv[0]);
        return 0;
    }

    for (number = 1; number < argc; number ++)
    {
        FILE *file;
        yaml_parser_t parser;
        yaml_emitter_t emitter;

        yaml_document_t document;
        unsigned char buffer[BUFFER_SIZE];
        size_t written = 0;
        yaml_document_t documents[MAX_DOCUMENTS];
        size_t document_number = 0;
        int done = 0;
        int count = 0;
        int error = 0;
        int k;
        memset(buffer, 0, BUFFER_SIZE);
        memset(documents, 0, MAX_DOCUMENTS*sizeof(yaml_document_t));

        printf("[%d] Loading, dumping, and loading again '%s': ", number, argv[number]);
        fflush(stdout);

        file = fopen(argv[number], "rb");
        assert(file);

        assert(yaml_parser_initialize(&parser));
        yaml_parser_set_input_file(&parser, file);
        assert(yaml_emitter_initialize(&emitter));
        if (canonical) {
            yaml_emitter_set_canonical(&emitter, 1);
        }
        if (unicode) {
            yaml_emitter_set_unicode(&emitter, 1);
        }
        yaml_emitter_set_output_string(&emitter, buffer, BUFFER_SIZE, &written);
        yaml_emitter_open(&emitter);

        while (!done)
        {
            if (!yaml_parser_load(&parser, &document)) {
                error = 1;
                break;
            }

            done = (!yaml_document_get_root_node(&document));
            if (!done) {
                assert(document_number < MAX_DOCUMENTS);
                assert(copy_document(&(documents[document_number++]), &document));
                assert(yaml_emitter_dump(&emitter, &document) || 
                        (yaml_emitter_flush(&emitter) && print_output(argv[number], buffer, written, count)));
                count ++;
            }
            else {
                yaml_document_delete(&document);
            }
        }

        yaml_parser_delete(&parser);
        assert(!fclose(file));
        yaml_emitter_close(&emitter);
        yaml_emitter_delete(&emitter);

        if (!error)
        {
            count = done = 0;
            assert(yaml_parser_initialize(&parser));
            yaml_parser_set_input_string(&parser, buffer, written);

            while (!done)
            {
                assert(yaml_parser_load(&parser, &document) || print_output(argv[number], buffer, written, count));
                done = (!yaml_document_get_root_node(&document));
                if (!done) {
                    assert(compare_documents(documents+count, &document) || print_output(argv[number], buffer, written, count));
                    count ++;
                }
                yaml_document_delete(&document);
            }
            yaml_parser_delete(&parser);
        }

        for (k = 0; k < document_number; k ++) {
            yaml_document_delete(documents+k);
        }

        printf("PASSED (length: %d)\n", written);
        print_output(argv[number], buffer, written, -1);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10ad0, %rsp          # imm = 0x10AD0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1e15
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x142c(%rip), %rsi      # 0x3159
callq 0x1170
cmpl $0x0, %eax
jne 0x1d40
movl $0x1, -0x18(%rbp)
jmp 0x1da4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x1409(%rip), %rsi      # 0x315c
callq 0x1170
cmpl $0x0, %eax
jne 0x1d66
movl $0x1, -0x1c(%rbp)
jmp 0x1da2
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1da0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rsi
leaq 0x13d2(%rip), %rdi      # 0x315f
movb $0x0, %al
callq 0x1110
movl $0x0, -0x4(%rbp)
jmp 0x23fa
jmp 0x1da2
jmp 0x1da4
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1e07
movl -0x14(%rbp), %eax
movl -0x8(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x1dfc
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rsi
addq $0x8, %rsi
movl -0x8(%rbp), %eax
subl -0x14(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rdx
shlq $0x3, %rdx
callq 0x1210
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x1e10
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1d0e
cmpl $0x2, -0x8(%rbp)
jge 0x1e3c
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x134c(%rip), %rdi      # 0x3175
movb $0x0, %al
callq 0x1110
movl $0x0, -0x4(%rbp)
jmp 0x23fa
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x23f3
movq $0x0, -0x10428(%rbp)
movq $0x0, -0x10ab8(%rbp)
movl $0x0, -0x10abc(%rbp)
movl $0x0, -0x10ac0(%rbp)
movl $0x0, -0x10ac4(%rbp)
leaq -0x10420(%rbp), %rdi
xorl %esi, %esi
movl $0x10000, %edx          # imm = 0x10000
callq 0x1150
leaq -0x10ab0(%rbp), %rdi
xorl %esi, %esi
movl $0x680, %edx            # imm = 0x680
callq 0x1150
movl -0x14(%rbp), %esi
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x12da(%rip), %rdi      # 0x3199
movb $0x0, %al
callq 0x1110
movq 0x3113(%rip), %rax      # 0x4fe0
movq (%rax), %rdi
callq 0x11e0
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0x11d7(%rip), %rsi      # 0x30bf
callq 0x1220
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x1efa
jmp 0x1f19
leaq 0x11c1(%rip), %rdi      # 0x30c2
leaq 0x10fe(%rip), %rsi      # 0x3006
movl $0xf4, %edx
leaq 0x12b5(%rip), %rcx      # 0x31c9
callq 0x1120
leaq -0x208(%rbp), %rdi
callq 0x11d0
cmpl $0x0, %eax
je 0x1f2c
jmp 0x1f4b
leaq 0x12ad(%rip), %rdi      # 0x31e0
leaq 0x10cc(%rip), %rsi      # 0x3006
movl $0xf6, %edx
leaq 0x1283(%rip), %rcx      # 0x31c9
callq 0x1120
movq -0x28(%rbp), %rsi
leaq -0x208(%rbp), %rdi
callq 0x1030
leaq -0x3b8(%rbp), %rdi
callq 0x10a0
cmpl $0x0, %eax
je 0x1f6e
jmp 0x1f8d
leaq 0x128b(%rip), %rdi      # 0x3200
leaq 0x108a(%rip), %rsi      # 0x3006
movl $0xf8, %edx
leaq 0x1241(%rip), %rcx      # 0x31c9
callq 0x1120
cmpl $0x0, -0x18(%rbp)
je 0x1fa4
leaq -0x3b8(%rbp), %rdi
movl $0x1, %esi
callq 0x1230
cmpl $0x0, -0x1c(%rbp)
je 0x1fbb
leaq -0x3b8(%rbp), %rdi
movl $0x1, %esi
callq 0x1250
leaq -0x10420(%rbp), %rsi
leaq -0x3b8(%rbp), %rdi
movl $0x10000, %edx          # imm = 0x10000
leaq -0x10428(%rbp), %rcx
callq 0x1260
leaq -0x3b8(%rbp), %rdi
callq 0x10b0
cmpl $0x0, -0x10abc(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1ffb
jmp 0x2165
leaq -0x208(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x1100
cmpl $0x0, %eax
jne 0x2022
movl $0x1, -0x10ac4(%rbp)
jmp 0x2165
leaq -0x420(%rbp), %rdi
callq 0x1050
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x10abc(%rbp)
cmpl $0x0, -0x10abc(%rbp)
jne 0x2154
cmpq $0x10, -0x10ab8(%rbp)
jae 0x205b
jmp 0x207a
leaq 0x11c0(%rip), %rdi      # 0x3222
leaq 0xf9d(%rip), %rsi       # 0x3006
movl $0x10b, %edx            # imm = 0x10B
leaq 0x1154(%rip), %rcx      # 0x31c9
callq 0x1120
movq -0x10ab8(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10ab8(%rbp)
leaq -0x10ab0(%rbp), %rdi
imulq $0x68, %rax, %rax
addq %rax, %rdi
leaq -0x420(%rbp), %rsi
callq 0x1370
cmpl $0x0, %eax
je 0x20b0
jmp 0x20cf
leaq 0x118b(%rip), %rdi      # 0x3242
leaq 0xf48(%rip), %rsi       # 0x3006
movl $0x10c, %edx            # imm = 0x10C
leaq 0x10ff(%rip), %rcx      # 0x31c9
callq 0x1120
leaq -0x3b8(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x1080
cmpl $0x0, %eax
jne 0x2122
leaq -0x3b8(%rbp), %rdi
callq 0x11c0
cmpl $0x0, %eax
je 0x2124
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x10420(%rbp), %rsi
movq -0x10428(%rbp), %rdx
movl -0x10ac0(%rbp), %ecx
callq 0x1b30
cmpl $0x0, %eax
je 0x2124
jmp 0x2143
leaq 0x1151(%rip), %rdi      # 0x327c
leaq 0xed4(%rip), %rsi       # 0x3006
movl $0x10e, %edx            # imm = 0x10E
leaq 0x108b(%rip), %rcx      # 0x31c9
callq 0x1120
movl -0x10ac0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10ac0(%rbp)
jmp 0x2160
leaq -0x420(%rbp), %rdi
callq 0x1130
jmp 0x1fe6
leaq -0x208(%rbp), %rdi
callq 0x11b0
movq -0x28(%rbp), %rdi
callq 0x10c0
cmpl $0x0, %eax
jne 0x2181
jmp 0x21a0
leaq 0x1173(%rip), %rdi      # 0x32fb
leaq 0xe77(%rip), %rsi       # 0x3006
movl $0x117, %edx            # imm = 0x117
leaq 0x102e(%rip), %rcx      # 0x31c9
callq 0x1120
leaq -0x3b8(%rbp), %rdi
callq 0x1190
leaq -0x3b8(%rbp), %rdi
callq 0x10f0
cmpl $0x0, -0x10ac4(%rbp)
jne 0x2367
movl $0x0, -0x10abc(%rbp)
movl $0x0, -0x10ac0(%rbp)
leaq -0x208(%rbp), %rdi
callq 0x11d0
cmpl $0x0, %eax
je 0x21ec
jmp 0x220b
leaq 0xfed(%rip), %rdi       # 0x31e0
leaq 0xe0c(%rip), %rsi       # 0x3006
movl $0x11e, %edx            # imm = 0x11E
leaq 0xfc3(%rip), %rcx       # 0x31c9
callq 0x1120
leaq -0x10420(%rbp), %rsi
movq -0x10428(%rbp), %rdx
leaq -0x208(%rbp), %rdi
callq 0x1090
cmpl $0x0, -0x10abc(%rbp)
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x223a
jmp 0x235b
leaq -0x208(%rbp), %rdi
leaq -0x420(%rbp), %rsi
callq 0x1100
cmpl $0x0, %eax
jne 0x227c
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x10420(%rbp), %rsi
movq -0x10428(%rbp), %rdx
movl -0x10ac0(%rbp), %ecx
callq 0x1b30
cmpl $0x0, %eax
je 0x227e
jmp 0x229d
leaq 0x1084(%rip), %rdi      # 0x3309
leaq 0xd7a(%rip), %rsi       # 0x3006
movl $0x123, %edx            # imm = 0x123
leaq 0xf31(%rip), %rcx       # 0x31c9
callq 0x1120
leaq -0x420(%rbp), %rdi
callq 0x1050
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x10abc(%rbp)
cmpl $0x0, -0x10abc(%rbp)
jne 0x234a
leaq -0x10ab0(%rbp), %rdi
movslq -0x10ac0(%rbp), %rax
imulq $0x68, %rax, %rax
addq %rax, %rdi
leaq -0x420(%rbp), %rsi
callq 0x1910
cmpl $0x0, %eax
jne 0x231a
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x10420(%rbp), %rsi
movq -0x10428(%rbp), %rdx
movl -0x10ac0(%rbp), %ecx
callq 0x1b30
cmpl $0x0, %eax
je 0x231c
jmp 0x233b
leaq 0x1041(%rip), %rdi      # 0x3364
leaq 0xcdc(%rip), %rsi       # 0x3006
movl $0x126, %edx            # imm = 0x126
leaq 0xe93(%rip), %rcx       # 0x31c9
callq 0x1120
movl -0x10ac0(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10ac0(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x1130
jmp 0x2225
leaq -0x208(%rbp), %rdi
callq 0x11b0
movl $0x0, -0x10ac8(%rbp)
movslq -0x10ac8(%rbp), %rax
cmpq -0x10ab8(%rbp), %rax
jae 0x23ac
leaq -0x10ab0(%rbp), %rdi
movslq -0x10ac8(%rbp), %rax
imulq $0x68, %rax, %rax
addq %rax, %rdi
callq 0x1130
movl -0x10ac8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10ac8(%rbp)
jmp 0x2371
movq -0x10428(%rbp), %rsi
leaq 0x100e(%rip), %rdi      # 0x33c8
movb $0x0, %al
callq 0x1110
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
leaq -0x10420(%rbp), %rsi
movq -0x10428(%rbp), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
callq 0x1b30
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1e43
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10ad0, %rsp          # imm = 0x10AD0
popq %rbp
retq