// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_vim.c
// Function: ce_vim_parse_action
CeVimParseResult_t ce_vim_parse_action(CeVimAction_t* action, const CeVim_t* vim){
     CeVimParseResult_t result = CE_VIM_PARSE_INVALID;
     CeVimAction_t build_action = {};

     // setup default multipliers
     build_action.multiplier = 1;
     build_action.motion.multiplier = 1;

     // parse multiplier if it exists
     const CeRune_t* end_of_multiplier = NULL;
     const CeRune_t* keys = vim->current_command;
     int64_t multiplier = istrtol(keys, &end_of_multiplier);
     if(end_of_multiplier && multiplier != 0){
          build_action.multiplier = multiplier;
          keys = end_of_multiplier;
          result = CE_VIM_PARSE_IN_PROGRESS;
     }

     // parse verb
VIM_PARSE_CONTINUE:
     for(int64_t i = 0; i < vim->key_bind_count; ++i){
          const CeVimKeyBind_t* key_bind = vim->key_binds + i;
          if(*keys == key_bind->key){
               result = key_bind->function(&build_action, vim, *keys);
               if(result != CE_VIM_PARSE_KEY_NOT_HANDLED){
                    keys++;

                    int64_t loops = 0;
                    while(result == CE_VIM_PARSE_CONSUME_ADDITIONAL_KEY){
                         if(*keys == 0) return result;
                         result = key_bind->function(&build_action, vim, *keys);
                         keys++;
                         if(result == CE_VIM_PARSE_CONTINUE) goto VIM_PARSE_CONTINUE;
                         loops++;
                         if(loops >= 10) return CE_VIM_PARSE_INVALID;
                    }

                    break;
               }
          }
     }

     // parse multiplier
     if(result != CE_VIM_PARSE_COMPLETE){
          if(vim_mode_is_visual(vim->mode) && multiplier == 0){
               build_action.motion.function = &ce_vim_motion_visual;
               result = CE_VIM_PARSE_COMPLETE;
          }else{
               multiplier = istrtol(keys, &end_of_multiplier);
               if(end_of_multiplier && multiplier != 0){
                    build_action.motion.multiplier = multiplier;
                    keys = end_of_multiplier;
               }

               // parse motion
               for(int64_t i = 0; i < vim->key_bind_count; ++i){
                    const CeVimKeyBind_t* key_bind = vim->key_binds + i;
                    if(*keys == key_bind->key){
                         result = key_bind->function(&build_action, vim, *keys);
                         if(result != CE_VIM_PARSE_KEY_NOT_HANDLED){
                              keys++;

                              int64_t loops = 0;
                              while(result == CE_VIM_PARSE_CONSUME_ADDITIONAL_KEY){
                                   if(*keys == 0) return result;
                                   result = key_bind->function(&build_action, vim, *keys);
                                   keys++;
                                   if(result == CE_VIM_PARSE_CONTINUE) goto VIM_PARSE_CONTINUE;
                                   loops++;
                                   if(loops >= 10) return CE_VIM_PARSE_INVALID;
                              }

                              break;
                         }
                    }
               }
          }
     }else if(vim_mode_is_visual(vim->mode) && !build_action.motion.function){
          build_action.motion.function = &ce_vim_motion_visual;
     }

     if(result == CE_VIM_PARSE_COMPLETE) *action = build_action;
     return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
leaq -0x68(%rbp), %rdi
xorl %esi, %esi
movl $0x48, %edx
callq 0xd290
movq $0x1, -0x68(%rbp)
movq $0x1, -0x60(%rbp)
movq $0x0, -0x70(%rbp)
movq -0x18(%rbp), %rax
addq $0x1010, %rax           # imm = 0x1010
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x156d0
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x33df6
cmpq $0x0, -0x80(%rbp)
je 0x33df6
movq -0x80(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movl $0x4, -0x1c(%rbp)
jmp 0x33df8
movq $0x0, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x1008(%rcx), %rax
jge 0x33f22
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq -0x88(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x90(%rbp)
movq -0x78(%rbp), %rax
movl (%rax), %eax
movq -0x90(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x33f09
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rsi
movq -0x78(%rbp), %rcx
movl (%rcx), %edx
leaq -0x68(%rbp), %rdi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
je 0x33f07
movq -0x78(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0x98(%rbp)
cmpl $0x2, -0x1c(%rbp)
jne 0x33f05
movq -0x78(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x33ea6
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x340f8
movq -0x90(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rsi
movq -0x78(%rbp), %rcx
movl (%rcx), %edx
leaq -0x68(%rbp), %rdi
callq *%rax
movl %eax, -0x1c(%rbp)
movq -0x78(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x78(%rbp)
cmpl $0x3, -0x1c(%rbp)
jne 0x33edb
jmp 0x33df8
movq -0x98(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x98(%rbp)
cmpq $0xa, -0x98(%rbp)
jl 0x33f03
movl $0x0, -0x4(%rbp)
jmp 0x340f8
jmp 0x33e8c
jmp 0x33f22
jmp 0x33f09
jmp 0x33f0b
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x33e03
cmpl $0x5, -0x1c(%rbp)
je 0x340b5
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x2fe10
testb $0x1, %al
jne 0x33f3d
jmp 0x33f5b
cmpq $0x0, -0x80(%rbp)
jne 0x33f5b
leaq 0x915(%rip), %rax       # 0x34860
movq %rax, -0x58(%rbp)
movl $0x5, -0x1c(%rbp)
jmp 0x340b3
movq -0x78(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x156d0
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x70(%rbp)
je 0x33f8a
cmpq $0x0, -0x80(%rbp)
je 0x33f8a
movq -0x80(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x70(%rbp), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq -0x18(%rbp), %rcx
cmpq 0x1008(%rcx), %rax
jge 0x340b1
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq -0xa0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0x78(%rbp), %rax
movl (%rax), %eax
movq -0xa8(%rbp), %rcx
cmpl (%rcx), %eax
jne 0x34098
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rsi
movq -0x78(%rbp), %rcx
movl (%rcx), %edx
leaq -0x68(%rbp), %rdi
callq *%rax
movl %eax, -0x1c(%rbp)
cmpl $0x1, -0x1c(%rbp)
je 0x34096
movq -0x78(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0xb0(%rbp)
cmpl $0x2, -0x1c(%rbp)
jne 0x34094
movq -0x78(%rbp), %rax
cmpl $0x0, (%rax)
jne 0x34038
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x340f8
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x18(%rbp), %rsi
movq -0x78(%rbp), %rcx
movl (%rcx), %edx
leaq -0x68(%rbp), %rdi
callq *%rax
movl %eax, -0x1c(%rbp)
movq -0x78(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x78(%rbp)
cmpl $0x3, -0x1c(%rbp)
jne 0x3406d
jmp 0x33df8
movq -0xb0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xb0(%rbp)
cmpq $0xa, -0xb0(%rbp)
jl 0x34092
movl $0x0, -0x4(%rbp)
jmp 0x340f8
jmp 0x3401e
jmp 0x340b1
jmp 0x34098
jmp 0x3409a
movq -0xa0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xa0(%rbp)
jmp 0x33f95
jmp 0x340b3
jmp 0x340da
movq -0x18(%rbp), %rax
movl (%rax), %edi
callq 0x2fe10
testb $0x1, %al
jne 0x340c6
jmp 0x340d8
cmpq $0x0, -0x58(%rbp)
jne 0x340d8
leaq 0x78c(%rip), %rax       # 0x34860
movq %rax, -0x58(%rbp)
jmp 0x340da
cmpl $0x5, -0x1c(%rbp)
jne 0x340f2
movq -0x10(%rbp), %rdi
leaq -0x68(%rbp), %rsi
movl $0x48, %edx
callq 0xd400
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)