// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x2818(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
cmpl $0x0, (%rax)
je 0x181cc
movb $0x0, -0x1(%rbp)
jmp 0x1843b
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
addq $0x8, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq 0x2748(%rax), %rax
movq (%rax), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x2748(%rax), %rax
movq (%rax), %rax
movq (%rax), %rdi
leaq -0x30(%rbp), %rsi
movl $0xa, %edx
callq 0xd3e0
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x2748(%rcx), %rcx
movq (%rcx), %rcx
cmpq (%rcx), %rax
jbe 0x182a3
cmpq $0x0, -0x38(%rbp)
jl 0x1829e
movq -0x38(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x40(%rcx), %rcx
cmpq 0x8(%rcx), %rax
jge 0x1829e
movq -0x38(%rbp), %rcx
subq $0x1, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x35210
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x1a60(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x1a68(%rax), %rdx
movq -0x10(%rbp), %rax
movq 0x1a58(%rax), %rcx
callq 0x116a0
jmp 0x18437
leaq -0x248(%rbp), %rdi
xorl %esi, %esi
movl $0x210, %edx            # imm = 0x210
callq 0xd290
movq -0x10(%rbp), %rax
movq 0x2748(%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq -0x248(%rbp), %rdi
callq 0x1bcd0
testb $0x1, %al
jne 0x182fb
movq -0x10(%rbp), %rax
movq 0x2748(%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
leaq 0x2b9b9(%rip), %rdi     # 0x43ca8
movb $0x0, %al
callq 0xd8f0
jmp 0x18435
movq $0x0, -0x250(%rbp)
movq $0x0, -0x258(%rbp)
movq $0x0, -0x260(%rbp)
movq -0x260(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x2838(%rcx), %rax
jge 0x18392
movq -0x10(%rbp), %rax
movq 0x2830(%rax), %rax
imulq $0x18, -0x260(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x258(%rbp)
movq -0x258(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x248(%rbp), %rsi
callq 0xd370
cmpl $0x0, %eax
jne 0x1837c
movq -0x258(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x250(%rbp)
jmp 0x18392
jmp 0x1837e
movq -0x260(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x260(%rbp)
jmp 0x1831c
cmpq $0x0, -0x250(%rbp)
je 0x18410
movq -0x250(%rbp), %rax
movq -0x10(%rbp), %rsi
leaq -0x248(%rbp), %rdi
callq *%rax
movl %eax, -0x264(%rbp)
movl -0x264(%rbp), %eax
subl $0x2, %eax
je 0x183c5
jmp 0x183c3
jmp 0x183ed
movq -0x10(%rbp), %rdi
movq -0x258(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0x258(%rbp), %rax
movq 0x10(%rax), %rcx
leaq 0x2b8e1(%rip), %rsi     # 0x43cc7
movb $0x0, %al
callq 0x159f0
movq -0x10(%rbp), %rdi
addq $0x28c0, %rdi           # imm = 0x28C0
movq -0x10(%rbp), %rax
movq 0x2748(%rax), %rax
movq (%rax), %rax
movq (%rax), %rsi
callq 0x12f80
jmp 0x18429
movq -0x10(%rbp), %rdi
leaq -0x248(%rbp), %rdx
leaq 0x2b8ac(%rip), %rsi     # 0x43cce
movb $0x0, %al
callq 0x159f0
leaq -0x248(%rbp), %rdi
callq 0x1c2f0
jmp 0x18437
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
nopl (%rax)