// File: /workspace/github_c_makefile_star2_O0/justy989[P]ce/ce_commands.c
// Function: command_clang_format
CeCommandStatus_t command_clang_format(CeCommand_t* command, void* user_data){
     CeApp_t* app = (CeApp_t*)(user_data);
     CommandContext_t command_context = {};
     if(!get_command_context(app, &command_context)) return CE_COMMAND_NO_ACTION;
     if(strlen(app->config_options.clang_format_path) == 0){
         ce_app_message(app, "clang format binary/executable path not configured");
         return CE_COMMAND_FAILURE;
     }
     // Skip attempting to format non c files.
     CeAppBufferData_t* buffer_data = command_context.view->buffer->app_data;
     if(buffer_data->syntax_function != ce_syntax_highlight_c &&
        buffer_data->syntax_function != ce_syntax_highlight_cpp){
         ce_app_message(app, "Attempted to clang format non c/c++ buffer");
         return CE_COMMAND_FAILURE;
     }
     if(app->vim.mode == CE_VIM_MODE_VISUAL ||
        app->vim.mode == CE_VIM_MODE_VISUAL_LINE ||
        app->vim.mode == CE_VIM_MODE_VISUAL_BLOCK){
         if(!ce_clang_format_selection(app->config_options.clang_format_path, command_context.view,
                                       app->vim.mode, &app->visual)){
             return CE_COMMAND_FAILURE;
         }
         app->vim.mode = CE_VIM_MODE_NORMAL;
     }else{
         if(!ce_clang_format_buffer(app->config_options.clang_format_path, command_context.view->buffer,
                                    command_context.view->cursor)){
             return CE_COMMAND_FAILURE;
         }
     }
     return CE_COMMAND_SUCCESS;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0xd290
movq -0x20(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x1c5d0
testb $0x1, %al
jne 0x21195
movl $0x3, -0x4(%rbp)
jmp 0x212cc
movq -0x20(%rbp), %rdi
addq $0x1a50, %rdi           # imm = 0x1A50
addq $0x8a4, %rdi            # imm = 0x8A4
callq 0xd200
cmpq $0x0, %rax
jne 0x211d0
movq -0x20(%rbp), %rdi
leaq 0x232d3(%rip), %rsi     # 0x44490
movb $0x0, %al
callq 0x159f0
movl $0x1, -0x4(%rbp)
jmp 0x212cc
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rax
movq 0x58(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
leaq 0xa945(%rip), %rcx      # 0x2bb30
cmpq %rcx, 0x600(%rax)
je 0x21226
movq -0x38(%rbp), %rax
leaq 0xbb41(%rip), %rcx      # 0x2cd40
cmpq %rcx, 0x600(%rax)
je 0x21226
movq -0x20(%rbp), %rdi
leaq 0x232b0(%rip), %rsi     # 0x444c3
movb $0x0, %al
callq 0x159f0
movl $0x1, -0x4(%rbp)
jmp 0x212cc
movq -0x20(%rbp), %rax
cmpl $0x2, 0x20(%rax)
je 0x21244
movq -0x20(%rbp), %rax
cmpl $0x3, 0x20(%rax)
je 0x21244
movq -0x20(%rbp), %rax
cmpl $0x4, 0x20(%rax)
jne 0x2128b
movq -0x20(%rbp), %rdi
addq $0x1a50, %rdi           # imm = 0x1A50
addq $0x8a4, %rdi            # imm = 0x8A4
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x20(%rbp), %rcx
addq $0x1a20, %rcx           # imm = 0x1A20
callq 0x198a0
testb $0x1, %al
jne 0x2127e
movl $0x1, -0x4(%rbp)
jmp 0x212cc
movq -0x20(%rbp), %rax
movl $0x0, 0x20(%rax)
jmp 0x212c5
movq -0x20(%rbp), %rdi
addq $0x1a50, %rdi           # imm = 0x1A50
addq $0x8a4, %rdi            # imm = 0x8A4
movq -0x28(%rbp), %rax
movq 0x40(%rax), %rsi
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rdx
movq 0x38(%rax), %rcx
callq 0x19740
testb $0x1, %al
jne 0x212c3
movl $0x1, -0x4(%rbp)
jmp 0x212cc
jmp 0x212c5
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)