// File: /workspace/github_c_makefile_star2_O3/morozov312[P]documentary/./src/processing.c
// Function: Generate_html
int Generate_html(comment* list, char* path, int qty_structs, char* dest_dir)
{
    FILE *documentary, *styles;
    char* ptrFile;
    char* name = Generate_filename(path, dest_dir);
    documentary = fopen(name, "w");
    if (documentary == NULL) {
        printf("%s\n", "Error create html page!");
        return 0;
    }
    /// header
    styles = fopen("/usr/share/documentary/styles/styles.html", "r");
    if (styles == NULL) {
        /// in case when app not installed
        styles = fopen("./styles/styles.html", "r");
        if (styles == NULL) {
            printf("%s\n", "Error, stylesheet not found!");
            return 0;
        }
    }
    while (1) {
        char* temp = (char*)calloc(MAX_LEN_INP_STR, sizeof(char));
        ptrFile = fgets(temp, MAX_LEN_INP_STR, styles);
        if (ptrFile == NULL) {
            if (feof(styles) != 0) {
                break;
            } else {
                continue;
            }
        }
        fputs(temp, documentary);
        free(temp);
    }
    fclose(styles);
    char* filename = Get_filename_without_extension(path);
    fputs(filename, documentary);
    fputs("</h2>", documentary);
    /// document programming language definition
    fputs(Get_document_type(path), documentary);
    // main content
    for (int i = 0; i < qty_structs; i++) {
        if (list[i].comment_data) {
            fputs("<p class=\"comment\">", documentary);
            fputs(list[i].comment_data, documentary);
            fputs("</br></p>", documentary);
            if (strlen(list[i].code_string)) {
                fputs("<code>", documentary);
                fputs(list[i].code_string, documentary);
                fputs("</code></br></br>", documentary);
            }
        }
    }
    /// footer
    fputs("</div></body></html>", documentary);
    fclose(documentary);
    free(name);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %edx, %ebx
movq %rsi, %r13
movq %rdi, %r14
movq %rsi, %rdi
movq %rcx, %rsi
callq 0x4464
movq %rax, %r12
leaq 0x16c1(%rip), %rsi      # 0x5c73
movq %rax, %rdi
callq 0x21f0
testq %rax, %rax
je 0x4732
movq %rax, %r15
movl %ebx, -0x2c(%rbp)
leaq 0x16bd(%rip), %rdi      # 0x5c8d
leaq 0x1589(%rip), %rsi      # 0x5b60
callq 0x21f0
testq %rax, %rax
jne 0x45fd
leaq 0x16cf(%rip), %rdi      # 0x5cb7
leaq 0x1571(%rip), %rsi      # 0x5b60
callq 0x21f0
testq %rax, %rax
je 0x474f
movq %rax, %rbx
movq %r12, -0x38(%rbp)
movl $0x1f4, %edi            # imm = 0x1F4
movl $0x1, %esi
callq 0x2180
movq %rax, %r12
movq %rax, %rdi
movl $0x1f4, %esi            # imm = 0x1F4
movq %rbx, %rdx
callq 0x2160
testq %rax, %rax
je 0x4640
movq %r12, %rdi
movq %r15, %rsi
callq 0x2140
movq %r12, %rdi
callq 0x2030
jmp 0x4604
movq %rbx, %rdi
callq 0x21a0
testl %eax, %eax
je 0x4604
movq %rbx, %rdi
callq 0x20b0
movq %r13, %rdi
callq 0x3ced
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x167b(%rip), %rdi      # 0x5ce9
movq %r15, %rsi
callq 0x2140
movq %r13, %rdi
callq 0x4528
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
movl -0x2c(%rbp), %eax
testl %eax, %eax
jle 0x470b
movl %eax, %r13d
shlq $0x4, %r13
xorl %ebx, %ebx
leaq 0x1663(%rip), %r12      # 0x5d03
cmpq $0x0, (%r14,%rbx)
je 0x4702
leaq 0x1641(%rip), %rdi      # 0x5cef
movq %r15, %rsi
callq 0x2140
movq (%r14,%rbx), %rdi
movq %r15, %rsi
callq 0x2140
movq %r12, %rdi
movq %r15, %rsi
callq 0x2140
movq 0x8(%r14,%rbx), %rax
cmpb $0x0, (%rax)
je 0x4702
leaq 0x162f(%rip), %rdi      # 0x5d0d
movq %r15, %rsi
callq 0x2140
movq 0x8(%r14,%rbx), %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x161a(%rip), %rdi      # 0x5d14
movq %r15, %rsi
callq 0x2140
addq $0x10, %rbx
cmpq %rbx, %r13
jne 0x46a0
leaq 0x1614(%rip), %rdi      # 0x5d26
movq %r15, %rsi
callq 0x2140
movq %r15, %rdi
callq 0x20b0
movq -0x38(%rbp), %rdi
callq 0x2030
movl $0x1, %eax
jmp 0x4740
leaq 0x153c(%rip), %rdi      # 0x5c75
callq 0x2080
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1576(%rip), %rdi      # 0x5ccc
jmp 0x4739