// File: /workspace/github_cpp_makefile_star2_O2/eiskalteschatten[P]developersnotebook/src/views/ProjectsView.cpp
// Function: ProjectsView::fill_in_sidebar(ProjectsModel const*)
void ProjectsView::fill_in_sidebar(const ProjectsModel *row) {
    gtk_entry_set_text(GTK_ENTRY(project_name_input), row->get_name().c_str());
    gtk_entry_set_text(GTK_ENTRY(url_input), row->get_url().c_str());
    gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(is_complete_checkbox), row->get_is_complete());

    if (row->get_start_date() != "") {
        std::string date_str  = row->get_start_date();
        std::tm start_date_tm = get_date_from_string(&date_str);
        guint year            = start_date_tm.tm_year + 1900;

        gtk_calendar_select_month(GTK_CALENDAR(start_date_input), start_date_tm.tm_mon, year);
        gtk_calendar_select_day(GTK_CALENDAR(start_date_input), start_date_tm.tm_mday);
    }
    else {
        reset_calender(start_date_input);
    }

    if (row->get_end_date() != "") {
        std::string date_str = row->get_end_date();
        std::tm end_date_tm  = get_date_from_string(&date_str);
        guint year           = end_date_tm.tm_year + 1900;

        gtk_calendar_select_month(GTK_CALENDAR(end_date_input), end_date_tm.tm_mon, year);
        gtk_calendar_select_day(GTK_CALENDAR(end_date_input), end_date_tm.tm_mday);
    }
    else {
        reset_calender(end_date_input);
    }


    GtkTextIter start;
    GtkTextIter end;
    GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(notes_input));
    gtk_text_buffer_get_bounds(buffer, &start, &end);
    gtk_text_buffer_delete(buffer, &start, &end);

    if (row->get_notes() != "") {
        GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(notes_input));
        gtk_text_buffer_get_start_iter(buffer, &start);
        gtk_text_buffer_insert(buffer, &start, row->get_notes().c_str(), -1);
    }

    gtk_button_set_label(GTK_BUTTON(save_button), "Save Project");
    gtk_widget_set_sensitive(delete_button, TRUE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xc8, %rsp
movq %rsi, %r14
movq %rdi, %rbx
movq 0x60(%rdi), %r12
callq 0x84b0
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %r12
leaq 0x60(%r14), %rsi
leaq 0x8(%rsp), %r13
movq %r13, %rdi
callq 0x86e0
movq (%r13), %rsi
movq %r12, %rdi
callq 0x8c40
leaq 0x8(%rsp), %rdi
callq 0x9120
movq 0x88(%rbx), %rdi
movq %r15, %rsi
callq 0x8150
movq %rax, %r15
leaq 0xc0(%r14), %rsi
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x86e0
movq (%r12), %rsi
movq %r15, %rdi
callq 0x8c40
leaq 0x8(%rsp), %rdi
callq 0x9120
movq 0x98(%rbx), %r15
callq 0x8f50
movq %r15, %rdi
movq %rax, %rsi
callq 0x8150
movzbl 0x100(%r14), %esi
movq %rax, %rdi
callq 0x9100
leaq 0x80(%r14), %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x86e0
leaq 0x15e74(%rip), %rsi     # 0x22965
movq %r12, %rdi
callq 0xe2ea
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x9120
testb %bpl, %bpl
je 0xcb7a
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x86e0
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0xeb0e
movl 0x1c(%rsp), %ebp
movq 0x68(%rbx), %r12
callq 0x8570
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
callq 0x8150
addl $0x76c, %ebp            # imm = 0x76C
movl 0x18(%rsp), %esi
movq %rax, %rdi
movl %ebp, %edx
callq 0x9070
movq 0x68(%rbx), %rdi
movq %r15, %rsi
callq 0x8150
movl 0x14(%rsp), %esi
movq %rax, %rdi
callq 0x8ce0
leaq 0x78(%rsp), %rdi
callq 0x9120
jmp 0xcb86
movq 0x68(%rbx), %rsi
movq %rbx, %rdi
callq 0xec96
leaq 0xa0(%r14), %r15
leaq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x86e0
leaq 0x15dc1(%rip), %rsi     # 0x22965
movq %r12, %rdi
callq 0xe2ea
movl %eax, %ebp
leaq 0x8(%rsp), %rdi
callq 0x9120
testb %bpl, %bpl
je 0xcc2d
leaq 0x78(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x86e0
leaq 0x8(%rsp), %rdi
movq %r12, %rsi
callq 0xeb0e
movl 0x1c(%rsp), %ebp
movq 0x78(%rbx), %r12
callq 0x8570
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
callq 0x8150
addl $0x76c, %ebp            # imm = 0x76C
movl 0x18(%rsp), %esi
movq %rax, %rdi
movl %ebp, %edx
callq 0x9070
movq 0x78(%rbx), %rdi
movq %r15, %rsi
callq 0x8150
movl 0x14(%rsp), %esi
movq %rax, %rdi
callq 0x8ce0
leaq 0x78(%rsp), %rdi
callq 0x9120
jmp 0xcc39
movq 0x78(%rbx), %rsi
movq %rbx, %rdi
callq 0xec96
movq 0x90(%rbx), %r12
callq 0x88d0
movq %rax, %r15
movq %r12, %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
callq 0x8330
movq %rax, %r12
leaq 0x8(%rsp), %r13
leaq 0x78(%rsp), %rbp
movq %rax, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x80b0
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x8c70
addq $0xe0, %r14
leaq 0x58(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x86e0
leaq 0x15cc3(%rip), %rsi     # 0x22965
movq %r12, %rdi
callq 0xe2ea
movl %eax, %ebp
leaq 0x58(%rsp), %rdi
callq 0x9120
testb %bpl, %bpl
je 0xcd11
movq 0x90(%rbx), %rdi
movq %r15, %rsi
callq 0x8150
movq %rax, %rdi
callq 0x8330
movq %rax, %r15
leaq 0x8(%rsp), %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x80d0
leaq 0x58(%rsp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x86e0
movq (%r13), %rdx
pushq $-0x1
popq %rcx
movq %r15, %rdi
movq %r12, %rsi
callq 0x8b70
leaq 0x58(%rsp), %rdi
callq 0x9120
movq 0xa0(%rbx), %r14
callq 0x8700
movq %r14, %rdi
movq %rax, %rsi
callq 0x8150
leaq 0x155f2(%rip), %rsi     # 0x22321
movq %rax, %rdi
callq 0x8740
movq 0xa8(%rbx), %rdi
pushq $0x1
popq %rsi
callq 0x9010
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xcd5e
jmp 0xcd7a
jmp 0xcd7a
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0xcd82
jmp 0xcd6e
jmp 0xcd6e
jmp 0xcd6e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0xcd82
jmp 0xcd7a
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0x9120
movq %rbx, %rdi
callq 0x87f0
nop