// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_app.c
// Function: build_complete_list
void build_complete_list(CeBuffer_t* buffer, CeComplete_t* complete){
     ce_buffer_empty(buffer);
     buffer->syntax_data = complete;
     char line[256];
     int64_t cursor = 0;
     int max_string_len = 0;
     for(int64_t i = 0; i < complete->count; i++){
          if(complete->elements[i].match){
               int len = strlen(complete->elements[i].string);
               if(len > max_string_len) max_string_len = len;
          }
     }
     for(int64_t i = 0; i < complete->count; i++){
          if(complete->elements[i].match){
               if(i == complete->current) cursor = buffer->line_count;
               if(complete->elements[i].description){
                    snprintf(line, 256, "%-*s : %s", max_string_len, complete->elements[i].string, complete->elements[i].description);
               }else{
                    snprintf(line, 256, "%s", complete->elements[i].string);
               }
               buffer_append_on_new_line(buffer, line);
          }
     }

     // TODO: figure out why we have to account for this case
     if(buffer->line_count == 1 && cursor == 1) cursor = 0;

     buffer->cursor_save = (CePoint_t){0, cursor};
     buffer->status = CE_BUFFER_STATUS_READONLY;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0xe920
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq $0x0, -0x118(%rbp)
movl $0x0, -0x11c(%rbp)
movq $0x0, -0x128(%rbp)
movq -0x128(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x14e43
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x128(%rbp), %rcx
addq %rcx, %rax
testb $0x1, 0x10(%rax)
je 0x14e2d
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x128(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rdi
callq 0xd200
movl %eax, -0x12c(%rbp)
movl -0x12c(%rbp), %eax
cmpl -0x11c(%rbp), %eax
jle 0x14e2b
movl -0x12c(%rbp), %eax
movl %eax, -0x11c(%rbp)
jmp 0x14e2d
jmp 0x14e2f
movq -0x128(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x128(%rbp)
jmp 0x14dc8
movq $0x0, -0x138(%rbp)
movq -0x138(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jge 0x14f5d
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x138(%rbp), %rcx
addq %rcx, %rax
testb $0x1, 0x10(%rax)
je 0x14f44
movq -0x138(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x18(%rcx), %rax
jne 0x14e9f
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x138(%rbp), %rcx
addq %rcx, %rax
cmpq $0x0, 0x8(%rax)
je 0x14f05
leaq -0x110(%rbp), %rdi
movl -0x11c(%rbp), %ecx
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x138(%rbp), %rdx
addq %rdx, %rax
movq (%rax), %r8
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x138(%rbp), %rdx
addq %rdx, %rax
movq 0x8(%rax), %r9
movl $0x100, %esi            # imm = 0x100
leaq 0x2d96b(%rip), %rdx     # 0x42867
movb $0x0, %al
callq 0xd250
jmp 0x14f34
leaq -0x110(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
imulq $0x18, -0x138(%rbp), %rcx
addq %rcx, %rax
movq (%rax), %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x30cad(%rip), %rdx     # 0x45bda
movb $0x0, %al
callq 0xd250
movq -0x8(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0x14fd0
jmp 0x14f46
movq -0x138(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x138(%rbp)
jmp 0x14e4e
movq -0x8(%rbp), %rax
cmpq $0x1, 0x8(%rax)
jne 0x14f7d
cmpq $0x1, -0x118(%rbp)
jne 0x14f7d
movq $0x0, -0x118(%rbp)
movq -0x8(%rbp), %rax
movq $0x0, -0x148(%rbp)
movq -0x118(%rbp), %rcx
movq %rcx, -0x140(%rbp)
movq -0x148(%rbp), %rcx
movq %rcx, 0x20(%rax)
movq -0x140(%rbp), %rcx
movq %rcx, 0x28(%rax)
movq -0x8(%rbp), %rax
movl $0x2, 0x18(%rax)
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
nopw %cs:(%rax,%rax)