// File: /workspace/github_c_makefile_star2_O1/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 0x44c8
movq %rax, %r12
leaq 0x163d(%rip), %rsi      # 0x5c73
movq %rax, %rdi
callq 0x21f0
testq %rax, %rax
je 0x47b6
movq %rax, %r15
movl %ebx, -0x2c(%rbp)
leaq 0x1639(%rip), %rdi      # 0x5c8d
leaq 0x1506(%rip), %rsi      # 0x5b61
callq 0x21f0
testq %rax, %rax
jne 0x4681
leaq 0x164b(%rip), %rdi      # 0x5cb7
leaq 0x14ee(%rip), %rsi      # 0x5b61
callq 0x21f0
testq %rax, %rax
je 0x47d3
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 0x46c4
movq %r12, %rdi
movq %r15, %rsi
callq 0x2140
movq %r12, %rdi
callq 0x2030
jmp 0x4688
movq %rbx, %rdi
callq 0x21a0
testl %eax, %eax
je 0x4688
movq %rbx, %rdi
callq 0x20b0
movq %r13, %rdi
callq 0x3d05
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x15f7(%rip), %rdi      # 0x5ce9
movq %r15, %rsi
callq 0x2140
movq %r13, %rdi
callq 0x4596
movq %rax, %rdi
movq %r15, %rsi
callq 0x2140
movl -0x2c(%rbp), %eax
testl %eax, %eax
jle 0x478f
movl %eax, %r13d
shlq $0x4, %r13
xorl %ebx, %ebx
leaq 0x15df(%rip), %r12      # 0x5d03
cmpq $0x0, (%r14,%rbx)
je 0x4786
leaq 0x15bd(%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 0x4786
leaq 0x15ab(%rip), %rdi      # 0x5d0d
movq %r15, %rsi
callq 0x2140
movq 0x8(%r14,%rbx), %rdi
movq %r15, %rsi
callq 0x2140
leaq 0x1596(%rip), %rdi      # 0x5d14
movq %r15, %rsi
callq 0x2140
addq $0x10, %rbx
cmpq %rbx, %r13
jne 0x4724
leaq 0x1590(%rip), %rdi      # 0x5d26
movq %r15, %rsi
callq 0x2140
movq %r15, %rdi
callq 0x20b0
movq -0x38(%rbp), %rdi
callq 0x2030
movl $0x1, %eax
jmp 0x47c4
leaq 0x14b8(%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 0x14f2(%rip), %rdi      # 0x5ccc
jmp 0x47bd