// File: eiskalteschatten[P]developersnotebook/src/windows/MainWindow.cpp
// Function: MainWindow::setup_stack()
void MainWindow::setup_stack() {
    // Views for the stack
    dashboard_view                   = new DashboardView(this);
    GtkWidget *dashboard_view_widget = dashboard_view->get_widget();

    projects_view                   = new ProjectsView(window);
    GtkWidget *projects_view_widget = projects_view->get_widget();

    // Stack
    stack = gtk_stack_new();
    gtk_stack_set_homogeneous(GTK_STACK(stack), TRUE);
    gtk_widget_set_hexpand(stack, TRUE);
    gtk_widget_set_vexpand(stack, TRUE);

    // Sidebar
    GtkWidget *sidebar = gtk_stack_sidebar_new();
    gtk_stack_sidebar_set_stack(GTK_STACK_SIDEBAR(sidebar), GTK_STACK(stack));
    gtk_widget_set_vexpand(sidebar, TRUE);
    gtk_widget_set_name(sidebar, "main-sidebar");
    gtk_container_foreach(GTK_CONTAINER(sidebar), (GtkCallback)style_sidebar_children, NULL);

    // Add the elements to the stack
    gtk_stack_add_titled(GTK_STACK(stack), dashboard_view_widget, "dashboard", "Dashboard");
    gtk_stack_add_titled(GTK_STACK(stack), projects_view_widget, "projects", "Projects");

    gtk_grid_attach(GTK_GRID(grid), sidebar, 0, 1, 1, 1);
    gtk_grid_attach(GTK_GRID(grid), stack, 1, 1, 1, 1);

    g_signal_connect(stack, "notify::visible-child", G_CALLBACK(refresh_all_sub_views), this);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movl $0x30, %edi
callq 0xa280
movq -0x40(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x38(%rbp)
callq 0x1bc90
jmp 0x1fc56
movq -0x40(%rbp), %rax
movq -0x38(%rbp), %rcx
movq %rcx, 0x40(%rax)
movq 0x40(%rax), %rdi
callq 0x201a0
movq %rax, -0x20(%rbp)
movl $0xb0, %edi
callq 0xa280
movq %rax, %rdi
movq -0x40(%rbp), %rax
movq %rdi, %rcx
movq %rcx, -0x48(%rbp)
movq 0x20(%rax), %rsi
callq 0x17380
jmp 0x1fc92
movq -0x40(%rbp), %rax
movq -0x48(%rbp), %rcx
movq %rcx, 0x48(%rax)
movq 0x48(%rax), %rdi
callq 0x201a0
movq %rax, -0x28(%rbp)
callq 0xb1c0
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x30(%rax)
movq 0x30(%rax), %rax
movq %rax, -0x90(%rbp)
callq 0xac30
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movl $0x1, %esi
callq 0xa4f0
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x1, %esi
callq 0xae60
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rdi
movl $0x1, %esi
callq 0xb3b0
callq 0xa610
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0xa100
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rcx
movq -0x40(%rbp), %rax
movq %rcx, -0x78(%rbp)
movq 0x30(%rax), %rax
movq %rax, -0x80(%rbp)
callq 0xac30
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0xb0c0
movq -0x30(%rbp), %rdi
movl $0x1, %esi
callq 0xb3b0
movq -0x30(%rbp), %rdi
leaq 0x33b1a(%rip), %rsi     # 0x53896
callq 0xa2f0
movq -0x30(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0xac10
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
leaq 0x25c(%rip), %rsi       # 0x20000
xorl %eax, %eax
movl %eax, %edx
callq 0xacd0
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x68(%rbp)
callq 0xac30
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movq -0x20(%rbp), %rsi
leaq 0x33a98(%rip), %rdx     # 0x53870
leaq 0x33ac4(%rip), %rcx     # 0x538a3
callq 0xaa20
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x60(%rbp)
callq 0xac30
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movq -0x28(%rbp), %rsi
leaq 0x3382b(%rip), %rdx     # 0x5363a
leaq 0x33a97(%rip), %rcx     # 0x538ad
callq 0xaa20
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x58(%rbp)
callq 0xac20
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
movl $0x1, %r9d
movl %r9d, %ecx
movl %r9d, %r8d
callq 0xad40
movq -0x40(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
callq 0xac20
movq -0x50(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movq -0x40(%rbp), %rax
movq 0x30(%rax), %rsi
movl $0x1, %r9d
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
callq 0xad40
movq -0x40(%rbp), %rcx
movq 0x30(%rcx), %rdi
leaq 0x33a19(%rip), %rsi     # 0x538b6
leaq -0xbd4(%rip), %rdx      # 0x1f2d0
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
callq 0xa380
addq $0x90, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0x30, %esi
callq 0xa200
jmp 0x1fef0
movq -0x48(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x10(%rbp)
movl %eax, -0x14(%rbp)
movl $0xb0, %esi
callq 0xa200
movq -0x10(%rbp), %rdi
callq 0xaa00
nopl (%rax)