// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_btnm.c
// Function: lv_btnm_create
lv_obj_t * lv_btnm_create(lv_obj_t * par, const lv_obj_t * copy)
{
    LV_LOG_TRACE("button matrix create started");

    /*Create the ancestor object*/
    lv_obj_t * new_btnm = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_btnm);
    if(new_btnm == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_btnm);

    /*Allocate the object type specific extended data*/
    lv_btnm_ext_t * ext = lv_obj_allocate_ext_attr(new_btnm, sizeof(lv_btnm_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    ext->btn_cnt                          = 0;
    ext->btn_id_pr                        = LV_BTNM_BTN_NONE;
    ext->btn_id_act                       = LV_BTNM_BTN_NONE;
    ext->button_areas                     = NULL;
    ext->ctrl_bits                        = NULL;
    ext->map_p                            = NULL;
    ext->recolor                          = 0;
    ext->one_toggle                       = 0;
    ext->styles_btn[LV_BTN_STATE_REL]     = &lv_style_btn_rel;
    ext->styles_btn[LV_BTN_STATE_PR]      = &lv_style_btn_pr;
    ext->styles_btn[LV_BTN_STATE_TGL_REL] = &lv_style_btn_tgl_rel;
    ext->styles_btn[LV_BTN_STATE_TGL_PR]  = &lv_style_btn_tgl_pr;
    ext->styles_btn[LV_BTN_STATE_INA]     = &lv_style_btn_ina;

    if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_cb(new_btnm);

    lv_obj_set_signal_cb(new_btnm, lv_btnm_signal);
    lv_obj_set_design_cb(new_btnm, lv_btnm_design);

    /*Init the new button matrix object*/
    if(copy == NULL) {
        lv_btnm_set_map(new_btnm, lv_btnm_def_map);
        lv_obj_set_size(new_btnm, LV_DPI * 3, LV_DPI * 2);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BG, th->style.btnm.bg);
            lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_REL, th->style.btnm.btn.rel);
            lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_PR, th->style.btnm.btn.pr);
            lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_TGL_REL, th->style.btnm.btn.tgl_rel);
            lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_TGL_PR, th->style.btnm.btn.tgl_pr);
            lv_btnm_set_style(new_btnm, LV_BTNM_STYLE_BTN_INA, th->style.btnm.btn.ina);
        } else {
            lv_obj_set_style(new_btnm, &lv_style_pretty);
        }
    }
    /*Copy an existing object*/
    else {
        lv_btnm_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        memcpy((void*)ext->styles_btn, copy_ext->styles_btn, sizeof(ext->styles_btn));
        lv_btnm_set_map(new_btnm, lv_btnm_get_map_array(copy));
    }

    LV_LOG_INFO("button matrix created");

    return new_btnm;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x66b0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x359c0
movq -0x20(%rbp), %rsi
leaq 0x3268b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x359be
cmpq $0x0, -0x20(%rbp)
jne 0x359d4
movq $0x0, -0x8(%rbp)
jmp 0x35c4e
cmpq $0x0, 0x53b14(%rip)     # 0x894f0
jne 0x359ee
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x53b02(%rip)     # 0x894f0
movq -0x20(%rbp), %rdi
movl $0x48, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x35a1f
movq -0x28(%rbp), %rsi
leaq 0x3262c(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x35a1d
cmpq $0x0, -0x28(%rbp)
jne 0x35a33
movq $0x0, -0x8(%rbp)
jmp 0x35c4e
movq -0x28(%rbp), %rax
movw $0x0, 0x40(%rax)
movq -0x28(%rbp), %rax
movw $0xffff, 0x42(%rax)     # imm = 0xFFFF
movq -0x28(%rbp), %rax
movw $0xffff, 0x44(%rax)     # imm = 0xFFFF
movq -0x28(%rbp), %rax
movq $0x0, 0x8(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x10(%rax)
movq -0x28(%rbp), %rax
movq $0x0, (%rax)
movq -0x28(%rbp), %rax
movb 0x46(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x46(%rax)
movq -0x28(%rbp), %rax
movb 0x46(%rax), %cl
andb $-0x3, %cl
orb $0x0, %cl
movb %cl, 0x46(%rax)
movq -0x28(%rbp), %rax
leaq 0x53741(%rip), %rcx     # 0x891e0
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
leaq 0x5377a(%rip), %rcx     # 0x89228
movq %rcx, 0x20(%rax)
movq -0x28(%rbp), %rax
leaq 0x537b3(%rip), %rcx     # 0x89270
movq %rcx, 0x28(%rax)
movq -0x28(%rbp), %rax
leaq 0x537ec(%rip), %rcx     # 0x892b8
movq %rcx, 0x30(%rax)
movq -0x28(%rbp), %rax
leaq 0x53825(%rip), %rcx     # 0x89300
movq %rcx, 0x38(%rax)
cmpq $0x0, 0x53a11(%rip)     # 0x894f8
jne 0x35af9
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x539ff(%rip)     # 0x894f8
movq -0x20(%rbp), %rdi
leaq 0x15c(%rip), %rsi       # 0x35c60
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0xb7c(%rip), %rsi       # 0x36690
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x35c02
movq -0x20(%rbp), %rdi
leaq 0x46af1(%rip), %rsi     # 0x7c620
callq 0x36c80
movq -0x20(%rbp), %rdi
movl $0x12c, %esi            # imm = 0x12C
movl $0xc8, %edx
callq 0x8180
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x35bf0
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x188(%rax), %rdx
xorl %esi, %esi
callq 0x37160
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x190(%rax), %rdx
movl $0x1, %esi
callq 0x37160
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x198(%rax), %rdx
movl $0x2, %esi
callq 0x37160
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x1a0(%rax), %rdx
movl $0x3, %esi
callq 0x37160
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x1a8(%rax), %rdx
movl $0x4, %esi
callq 0x37160
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x1b0(%rax), %rdx
movl $0x5, %esi
callq 0x37160
jmp 0x35c00
movq -0x20(%rbp), %rdi
leaq 0x5347d(%rip), %rsi     # 0x89078
callq 0x9150
jmp 0x35c46
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
addq $0x18, %rdi
movq -0x38(%rbp), %rsi
addq $0x18, %rsi
movl $0x28, %edx
callq 0x20e0
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x18(%rbp), %rdi
callq 0x37250
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0x36c80
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)