// File: eiskalteschatten[P]developersnotebook/src/components/Modal.cpp
// Function: Modal::show_confirm_modal(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int Modal::show_confirm_modal(std::string accept_button, std::string reject_button) {
    #ifdef __APPLE__
        int result = mac_show_confirm_modal(message, sub_message, accept_button, reject_button);
        return result == NSAlertFirstButtonReturn ? MODAL_RESPONSE_ACCEPT : MODAL_RESPONSE_REJECT;
    #else
        GtkWidget *image = gtk_image_new_from_icon_name("dialog-warning", GTK_ICON_SIZE_DIALOG);
        gtk_grid_attach(GTK_GRID(main_grid), image, 0, 0, 1, 2);

        GtkDialogFlags flags = GTK_DIALOG_DESTROY_WITH_PARENT;
        GtkWidget *dialog    = gtk_dialog_new_with_buttons("",
                                                           GTK_WINDOW(parent_window),
                                                           flags,
                                                           reject_button.c_str(),
                                                           GTK_RESPONSE_REJECT,
                                                           accept_button.c_str(),
                                                           GTK_RESPONSE_ACCEPT,
                                                           NULL);

        gtk_container_set_border_width(GTK_CONTAINER(dialog), 10);

        GtkWidget *content_area = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
        gtk_box_pack_start(GTK_BOX(content_area), main_grid, TRUE, FALSE, 0);
        gtk_widget_show_all(dialog);

        int result = gtk_dialog_run(GTK_DIALOG(dialog));

        gtk_widget_destroy(dialog);

        return result == GTK_RESPONSE_ACCEPT ? MODAL_RESPONSE_ACCEPT : MODAL_RESPONSE_REJECT;
    #endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rsi, -0x88(%rbp)
movq %rdx, -0x90(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
leaq 0x2413(%rip), %rdi      # 0x54a57
movl $0x6, %esi
callq 0xac70
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, -0x20(%rbp)
movq 0x8(%rax), %rax
movq %rax, -0xa0(%rbp)
callq 0xac20
movq -0xa0(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movq -0x20(%rbp), %rsi
xorl %ecx, %ecx
movl $0x1, %r8d
movl $0x2, %r9d
movl %ecx, %edx
callq 0xad40
movq -0x50(%rbp), %rax
movl $0x2, -0x24(%rbp)
movq (%rax), %rax
movq %rax, -0x98(%rbp)
callq 0xb270
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq -0x90(%rbp), %rdi
movq %rax, -0x80(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x74(%rbp)
callq 0xa1d0
movq -0x88(%rbp), %rdi
movq %rax, -0x70(%rbp)
callq 0xa1d0
movq -0x80(%rbp), %rsi
movl -0x74(%rbp), %edx
movq -0x70(%rbp), %rcx
movq %rax, %r9
leaq 0x152d(%rip), %rdi      # 0x53c25
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
xorl %eax, %eax
movl $0xfffffffd, (%rsp)     # imm = 0xFFFFFFFD
movq $0x0, 0x8(%rsp)
movb $0x0, %al
callq 0xaa10
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x68(%rbp)
callq 0xac10
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movl $0xa, %esi
callq 0xb350
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0xaac0
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
callq 0xa040
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0xab50
movq -0x58(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
movq -0x50(%rbp), %rax
movq 0x8(%rax), %rsi
movl $0x1, %edx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0xa340
movq -0x30(%rbp), %rdi
callq 0xaf30
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0xaac0
movq -0x48(%rbp), %rdi
movq %rax, %rsi
callq 0xa190
movq %rax, %rdi
callq 0xa480
movl %eax, -0x3c(%rbp)
movq -0x30(%rbp), %rdi
callq 0xa250
movl -0x3c(%rbp), %edx
movl $0x1, %eax
xorl %ecx, %ecx
cmpl $-0x3, %edx
cmovel %ecx, %eax
addq $0xb0, %rsp
popq %rbp
retq