// File: /workspace/github_c_makefile_star2_O2/justy989[P]ce/ce_app.c
// Function: command_input_complete_func
bool command_input_complete_func(CeApp_t* app, CeBuffer_t* input_buffer){
     CeLayout_t* tab_layout = app->tab_list_layout->tab_list.current;
     if(tab_layout->tab.current->type != CE_LAYOUT_TYPE_VIEW) return false;
     CeView_t* view = &tab_layout->tab.current->view;

     char* end_of_number = app->input_view.buffer->lines[0];
     int64_t line_number = strtol(app->input_view.buffer->lines[0], &end_of_number, 10);
     if(end_of_number > app->input_view.buffer->lines[0]){
          // if the command entered was a number, go to that line
          if(line_number >= 0 && line_number < view->buffer->line_count){
               view->cursor.y = line_number - 1;
               view->cursor.x = ce_vim_soft_begin_line(view->buffer, view->cursor.y);
               ce_view_follow_cursor(view, app->config_options.horizontal_scroll_off,
                                     app->config_options.vertical_scroll_off,
                                     app->config_options.tab_width);
          }
     }else{
          // convert and run the command
          CeCommand_t command = {};
          if(!ce_command_parse(&command, app->input_view.buffer->lines[0])){
               ce_log("failed to parse command: '%s'\n", app->input_view.buffer->lines[0]);
          }else{
               CeCommandFunc_t* command_func = NULL;
               CeCommandEntry_t* entry = NULL;
               for(int64_t i = 0; i < app->command_entry_count; i++){
                    entry = app->command_entries + i;
                    if(strcmp(entry->name, command.name) == 0){
                         command_func = entry->func;
                         break;
                    }
               }

               if(command_func){
                    CeCommandStatus_t cs = command_func(&command, app);
                    switch(cs){
                    default:
                         break;
                    case CE_COMMAND_PRINT_HELP:
                         ce_app_message(app, "%s: %s", entry->name, entry->description);
                         break;
                    }
                    ce_history_insert(&app->command_history, app->input_view.buffer->lines[0]);
               }else{
                    ce_app_message(app, "unknown command: '%s'", command.name);
               }

               ce_command_free(&command);
          }
     }

     return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x218, %rsp            # imm = 0x218
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r12
movl (%r12), %ebp
testl %ebp, %ebp
je 0x134eb
testl %ebp, %ebp
sete %al
addq $0x218, %rsp            # imm = 0x218
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movq 0x2748(%rdi), %rax
movq (%rax), %rax
movq (%rax), %rdi
movq %rsp, %r15
movq %rdi, (%r15)
pushq $0xa
popq %rdx
movq %r15, %rsi
callq 0xd400
movq 0x2748(%rbx), %rcx
movq (%rcx), %rcx
movq (%rcx), %r14
cmpq %r14, (%r15)
jbe 0x1356a
testq %rax, %rax
js 0x134d4
movq 0x48(%r12), %rdi
cmpq 0x8(%rdi), %rax
jge 0x134d4
leaq 0x8(%r12), %r14
decq %rax
movq %rax, 0x40(%r12)
movq %rax, %rsi
callq 0x23364
movq %rax, 0x38(%r12)
movq 0x1a58(%rbx), %rcx
movq 0x1a60(%rbx), %rsi
movq 0x1a68(%rbx), %rdx
movq %r14, %rdi
callq 0xfa67
jmp 0x134d4
leaq 0x8(%rsp), %r15
movl $0x210, %edx            # imm = 0x210
movq %r15, %rdi
xorl %esi, %esi
callq 0xd2a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x156d8
testb %al, %al
je 0x13625
movq 0x2838(%rbx), %rax
xorl %r12d, %r12d
testq %rax, %rax
cmovgq %rax, %r12
incq %r12
pushq $0x8
popq %r15
leaq 0x8(%rsp), %r14
decq %r12
je 0x13645
movq 0x2830(%rbx), %r13
movq (%r13,%r15), %rdi
addq $0x18, %r15
movq %r14, %rsi
callq 0xd390
testl %eax, %eax
jne 0x135ae
movq -0x20(%r13,%r15), %rax
testq %rax, %rax
je 0x13645
leaq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq *%rax
cmpl $0x2, %eax
jne 0x13607
movq -0x18(%r13,%r15), %rdx
movq -0x10(%r13,%r15), %rcx
leaq 0x18717(%rip), %rsi     # 0x2bd14
movq %rbx, %rdi
xorl %eax, %eax
callq 0x11b97
movq 0x2748(%rbx), %rax
addq $0x28c0, %rbx           # imm = 0x28C0
movq (%rax), %rax
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x1057e
jmp 0x1365b
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq 0x186bc(%rip), %rdi     # 0x2bcf5
xorl %eax, %eax
callq 0xd8e5
jmp 0x134d4
leaq 0x186cf(%rip), %rsi     # 0x2bd1b
leaq 0x8(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x11b97
leaq 0x8(%rsp), %rdi
callq 0x15a3b
jmp 0x134d4