// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/src/startgtk_game.c
// Function: on_chooseimportbutton_clicked
static void on_chooseimportbutton_clicked(GtkButton *button, gpointer user_data)
{
    GtkWidget *dialog;
    char *filename = NULL;

    (void)button; (void)user_data;

    dialog = gtk_file_chooser_dialog_new("Import game data", startwin,
        GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
        "_Cancel", GTK_RESPONSE_CANCEL,
        "_Import", GTK_RESPONSE_ACCEPT,
        NULL);
    gtk_file_chooser_set_local_only(GTK_FILE_CHOOSER(dialog), TRUE);

    GtkWidget *content = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
    GtkWidget *label = gtk_label_new("Select a folder to search.");
    gtk_widget_show(label);
    gtk_widget_set_margin_top(label, 7);
    gtk_widget_set_margin_bottom(label, 7);
    gtk_container_add(GTK_CONTAINER(content), label);
    gtk_box_reorder_child(GTK_BOX(content), label, 0);

    if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
        GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog);
        filename = gtk_file_chooser_get_filename(chooser);
    }
    gtk_widget_destroy(dialog);

    if (filename) {
        GTask *task = NULL;
        GError *err = NULL;
        GCancellable *cancellable = NULL;
        gulong clickhandlerid;

        cancellable = g_cancellable_new();
        task = g_task_new(NULL, cancellable, NULL, NULL);
        g_task_set_check_cancellable(task, FALSE);

        // Pass the filename as task data.
        g_task_set_task_data(task, (gpointer)filename, NULL);

        // Connect the import status cancel button passing the GCancellable* as user data.
        clickhandlerid = g_signal_connect(controls.importstatuscancelbutton, "clicked",
            G_CALLBACK(on_importstatus_cancelbutton_clicked), (gpointer)cancellable);

        // Show the status window, run the import thread, and while it's running, pump the Gtk queue.
        gtk_widget_show(GTK_WIDGET(controls.importstatuswindow));
        g_task_run_in_thread(task, import_thread_func);
        while (!g_task_get_completed(task)) gtk_main_iteration();

        // Get the return value from the import thread, then hide the status window.
        (void) g_task_propagate_int(task, &err);
        gtk_widget_hide(GTK_WIDGET(controls.importstatuswindow));

        // Disconnect the cancel button and clean up.
        g_signal_handler_disconnect(controls.importstatuscancelbutton, clickhandlerid);
        if (err) g_error_free(err);
        g_object_unref(cancellable);
        g_object_unref(task);

        g_free(filename);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x0, -0x20(%rbp)
movq 0x32d76e(%rip), %rsi    # 0x377e20
leaq 0xa4f55(%rip), %rdi     # 0xef60e
movl $0x2, %edx
leaq 0xa4f5a(%rip), %rcx     # 0xef61f
movl $0xfffffffa, %r8d       # imm = 0xFFFFFFFA
leaq 0xa4f55(%rip), %r9      # 0xef627
xorl %eax, %eax
movl $0xfffffffd, (%rsp)     # imm = 0xFFFFFFFD
movq $0x0, 0x8(%rsp)
movb $0x0, %al
callq 0x8f50
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x80(%rbp)
callq 0x8aa0
movq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
movl $0x1, %esi
callq 0x84b0
movq -0x18(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x8900
movq -0x78(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
callq 0x8060
movq %rax, -0x28(%rbp)
leaq 0xa4eee(%rip), %rdi     # 0xef62f
callq 0x88c0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x8f30
movq -0x30(%rbp), %rdi
movl $0x7, %esi
callq 0x85a0
movq -0x30(%rbp), %rdi
movl $0x7, %esi
callq 0x8ce0
movq -0x28(%rbp), %rax
movq %rax, -0x70(%rbp)
callq 0x8ad0
movq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
movq -0x30(%rbp), %rsi
callq 0x8ff0
movq -0x28(%rbp), %rax
movq %rax, -0x68(%rbp)
callq 0x89c0
movq -0x68(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
movq -0x30(%rbp), %rsi
xorl %edx, %edx
callq 0x81e0
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
callq 0x8900
movq -0x60(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
callq 0x8340
cmpl $-0x3, %eax
jne 0x4a811
movq -0x18(%rbp), %rax
movq %rax, -0x88(%rbp)
callq 0x8aa0
movq -0x88(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
callq 0x8b30
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x81d0
cmpq $0x0, -0x20(%rbp)
je 0x4a96d
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
callq 0x8490
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
movq %rcx, %rdi
movq %rcx, %rdx
callq 0x8bc0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
xorl %esi, %esi
callq 0x8820
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %eax, %eax
movl %eax, %edx
callq 0x9090
movq 0x32d638(%rip), %rdi    # 0x377eb8
movq -0x50(%rbp), %rcx
leaq 0xa4c45(%rip), %rsi     # 0xef4d0
leaq 0x4be(%rip), %rdx       # 0x4ad50
xorl %eax, %eax
movl %eax, %r8d
xorl %r9d, %r9d
callq 0x82c0
movq %rax, -0x58(%rbp)
movq 0x32d5fe(%rip), %rax    # 0x377ea8
movq %rax, -0x90(%rbp)
callq 0x90b0
movq -0x90(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
callq 0x8f30
movq -0x40(%rbp), %rdi
leaq 0x498(%rip), %rsi       # 0x4ad70
callq 0x8700
movq -0x40(%rbp), %rdi
callq 0x8170
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4a8f4
jmp 0x4a8fb
callq 0x8040
jmp 0x4a8dd
movq -0x40(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x8880
movq 0x32d599(%rip), %rax    # 0x377ea8
movq %rax, -0x98(%rbp)
callq 0x90b0
movq -0x98(%rbp), %rdi
movq %rax, %rsi
callq 0x8150
movq %rax, %rdi
callq 0x81f0
movq 0x32d57f(%rip), %rdi    # 0x377eb8
movq -0x58(%rbp), %rsi
callq 0x8ec0
cmpq $0x0, -0x48(%rbp)
je 0x4a952
movq -0x48(%rbp), %rdi
callq 0x8590
movq -0x50(%rbp), %rdi
callq 0x8de0
movq -0x40(%rbp), %rdi
callq 0x8de0
movq -0x20(%rbp), %rdi
callq 0x8310
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)