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

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

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_led);
    if(ancestor_design_f == NULL) ancestor_design_f = lv_obj_get_design_cb(new_led);

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

    ext->bright = LV_LED_BRIGHT_ON;

    lv_obj_set_signal_cb(new_led, lv_led_signal);
    lv_obj_set_design_cb(new_led, lv_led_design);

    /*Init the new led object*/
    if(copy == NULL) {
        lv_obj_set_size(new_led, LV_LED_WIDTH_DEF, LV_LED_HEIGHT_DEF);

        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_led_set_style(new_led, LV_LED_STYLE_MAIN, th->style.led);
        } else {
            lv_led_set_style(new_led, LV_LED_STYLE_MAIN, &lv_style_pretty_color);
        }
    }
    /*Copy an existing object*/
    else {
        lv_led_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->bright             = copy_ext->bright;

        /*Refresh the style with new signal function*/
        lv_obj_refresh_style(new_led);
    }

    LV_LOG_INFO("led created");

    return new_led;
}

// 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 0x3afd0
movq -0x20(%rbp), %rsi
leaq 0x2d07b(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x3afce
cmpq $0x0, -0x20(%rbp)
jne 0x3afe4
movq $0x0, -0x8(%rbp)
jmp 0x3b101
cmpq $0x0, 0x4e534(%rip)     # 0x89520
jne 0x3affe
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x4e522(%rip)     # 0x89520
cmpq $0x0, 0x4e522(%rip)     # 0x89528
jne 0x3b018
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x4e510(%rip)     # 0x89528
movq -0x20(%rbp), %rdi
movl $0x1, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x3b049
movq -0x28(%rbp), %rsi
leaq 0x2d002(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0x3b047
cmpq $0x0, -0x28(%rbp)
jne 0x3b05d
movq $0x0, -0x8(%rbp)
jmp 0x3b101
movq -0x28(%rbp), %rax
movb $-0x1, (%rax)
movq -0x20(%rbp), %rdi
leaq 0xa1(%rip), %rsi        # 0x3b110
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x131(%rip), %rsi       # 0x3b1b0
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0x3b0d7
movq -0x20(%rbp), %rdi
movl $0x21, %edx
movl %edx, %esi
callq 0x8180
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x3b0c3
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xa0(%rax), %rdx
xorl %esi, %esi
callq 0x3b400
jmp 0x3b0d5
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x4dff0(%rip), %rdx     # 0x890c0
callq 0x3b400
jmp 0x3b0f9
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movb (%rax), %cl
movq -0x28(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rdi
callq 0x9250
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)