// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x220, %rsp            # imm = 0x220
movq 0x2818(%rdi), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %r12
movl (%r12), %ebp
testl %ebp, %ebp
je 0x13d34
testl %ebp, %ebp
sete %al
addq $0x220, %rsp            # imm = 0x220
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %rbx
movq 0x2748(%rdi), %rax
movq (%rax), %rax
movq (%rax), %rdi
leaq 0x8(%rsp), %r15
movq %rdi, (%r15)
movq %r15, %rsi
movl $0xa, %edx
callq 0xd400
movq 0x2748(%rbx), %rcx
movq (%rcx), %rcx
movq (%rcx), %r14
cmpq %r14, (%r15)
jbe 0x13db7
testq %rax, %rax
js 0x13d1f
movq 0x48(%r12), %rdi
cmpq 0x8(%rdi), %rax
jge 0x13d1f
leaq 0x8(%r12), %r14
decq %rax
movq %rax, 0x40(%r12)
movq %rax, %rsi
callq 0x25f8c
movq %rax, 0x38(%r12)
movq 0x1a58(%rbx), %rcx
movq 0x1a60(%rbx), %rsi
movq 0x1a68(%rbx), %rdx
movq %r14, %rdi
callq 0xfdb4
jmp 0x13d1f
leaq 0x10(%rsp), %r15
movl $0x210, %edx            # imm = 0x210
movq %r15, %rdi
xorl %esi, %esi
callq 0xd2a0
movq %r15, %rdi
movq %r14, %rsi
callq 0x160b8
testb %al, %al
je 0x13e15
movq 0x2838(%rbx), %r12
testq %r12, %r12
jle 0x13e90
movq 0x2830(%rbx), %r15
addq $0x10, %r15
leaq 0x10(%rsp), %r14
movq -0x8(%r15), %rdi
movq %r14, %rsi
callq 0xd390
testl %eax, %eax
je 0x13e35
addq $0x18, %r15
decq %r12
jne 0x13dfa
jmp 0x13e90
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq 0x1aecc(%rip), %rdi     # 0x2ecf5
xorl %eax, %eax
callq 0xd954
jmp 0x13d1f
movq -0x10(%r15), %rax
testq %rax, %rax
je 0x13e90
leaq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq *%rax
cmpl $0x2, %eax
jne 0x13e65
movq -0x8(%r15), %rdx
movq (%r15), %rcx
leaq 0x1aeb9(%rip), %rsi     # 0x2ed14
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
leaq 0x28c0(%rbx), %rdi
movq 0x2748(%rbx), %rax
movq (%rax), %rax
movq (%rax), %rsi
callq 0x109e1
testq %rax, %rax
je 0x13ea6
movq $0x0, 0x28c8(%rbx)
jmp 0x13ea6
leaq 0x1ae84(%rip), %rsi     # 0x2ed1b
leaq 0x10(%rsp), %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x122dd
leaq 0x10(%rsp), %rdi
callq 0x16443
jmp 0x13d1f