// File: /workspace/github_c_makefile_star2_O1/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 $0x228, %rsp            # imm = 0x228
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r15
movl (%r15), %ebp
testl %ebp, %ebp
je 0x13fa1
testl %ebp, %ebp
sete %al
addq $0x228, %rsp            # imm = 0x228
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
leaq 0x10(%rsp), %r14
movq %rdi, (%r14)
movq %r14, %rsi
movl $0xa, %edx
callq 0xd400
movq (%r14), %rcx
movq 0x2748(%rbx), %r12
movq (%r12), %rdx
cmpq (%rdx), %rcx
jbe 0x14021
testq %rax, %rax
js 0x13f8a
movq 0x48(%r15), %rdi
cmpq 0x8(%rdi), %rax
jge 0x13f8a
leaq 0x8(%r15), %r14
decq %rax
movq %rax, 0x40(%r15)
movq %rax, %rsi
callq 0x260e5
movq %rax, 0x38(%r15)
movq 0x1a58(%rbx), %rcx
movq 0x1a60(%rbx), %rsi
movq 0x1a68(%rbx), %rdx
movq %r14, %rdi
callq 0xff34
jmp 0x13f8a
leaq 0x18(%rsp), %r14
movl $0x210, %edx            # imm = 0x210
movq %r14, %rdi
xorl %esi, %esi
callq 0xd2a0
movq (%r12), %rax
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1644c
testb %al, %al
je 0x1409b
movq 0x2838(%rbx), %r13
testq %r13, %r13
jle 0x140bb
movq 0x2830(%rbx), %r15
leaq (,%r13,2), %rax
addq %r13, %rax
leaq (%r15,%rax,8), %rax
addq $-0x18, %rax
movq %rax, 0x8(%rsp)
leaq 0x18(%rsp), %r14
xorl %r12d, %r12d
movq 0x8(%r15), %rdi
movq %r14, %rsi
callq 0xd390
testl %eax, %eax
je 0x140c3
addq $0x18, %r15
decq %r13
jne 0x1407b
movq 0x8(%rsp), %r15
jmp 0x140c6
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq 0x1bc46(%rip), %rdi     # 0x2fcf5
xorl %eax, %eax
callq 0xd954
jmp 0x13f8a
xorl %r12d, %r12d
xorl %r15d, %r15d
jmp 0x140c6
movq (%r15), %r12
testq %r12, %r12
je 0x1411f
leaq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq *%r12
cmpl $0x2, %eax
jne 0x140f4
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rcx
leaq 0x1bc2a(%rip), %rsi     # 0x2fd14
movq %rbx, %rdi
xorl %eax, %eax
callq 0x12502
leaq 0x28c0(%rbx), %rdi
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
callq 0x10b75
testq %rax, %rax
je 0x14135
movq $0x0, 0x28c8(%rbx)
jmp 0x14135
leaq 0x1bbf5(%rip), %rsi     # 0x2fd1b
leaq 0x18(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x12502
leaq 0x18(%rsp), %rdi
callq 0x167e6
jmp 0x13f8a