// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_arc.c
// Function: lv_arc_create
lv_obj_t * lv_arc_create(lv_obj_t * par, const lv_obj_t * copy)
{

    LV_LOG_TRACE("arc create started");

    /*Create the ancestor of arc*/
    lv_obj_t * new_arc = lv_obj_create(par, copy);
    LV_ASSERT_MEM(new_arc);
    if(new_arc == NULL) return NULL;

    /*Allocate the arc type specific extended data*/
    lv_arc_ext_t * ext = lv_obj_allocate_ext_attr(new_arc, sizeof(lv_arc_ext_t));
    LV_ASSERT_MEM(ext);
    if(ext == NULL) return NULL;

    if(ancestor_signal == NULL) ancestor_signal = lv_obj_get_signal_cb(new_arc);
    if(ancestor_design == NULL) ancestor_design = lv_obj_get_design_cb(new_arc);

    /*Initialize the allocated 'ext' */
    ext->angle_start = 45;
    ext->angle_end   = 315;

    /*The signal and design functions are not copied so set them here*/
    lv_obj_set_signal_cb(new_arc, lv_arc_signal);
    lv_obj_set_design_cb(new_arc, lv_arc_design);

    /*Init the new arc arc*/
    if(copy == NULL) {
        /*Set the default styles*/
        lv_theme_t * th = lv_theme_get_current();
        if(th) {
            lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, th->style.arc);
        } else {
            lv_arc_set_style(new_arc, LV_ARC_STYLE_MAIN, &lv_style_plain_color);
        }

    }
    /*Copy an existing arc*/
    else {
        lv_arc_ext_t * copy_ext = lv_obj_get_ext_attr(copy);
        ext->angle_start        = copy_ext->angle_start;
        ext->angle_end          = copy_ext->angle_end;

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

    LV_LOG_INFO("arc created");

    return new_arc;
}

// 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 0xe0a0
movq -0x20(%rbp), %rsi
leaq 0x59fab(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0xe09e
cmpq $0x0, -0x20(%rbp)
jne 0xe0b4
movq $0x0, -0x8(%rbp)
jmp 0xe1df
movq -0x20(%rbp), %rdi
movl $0x4, %esi
callq 0x9d60
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0xe0e5
movq -0x28(%rbp), %rsi
leaq 0x59f66(%rip), %rdi     # 0x68044
callq 0xd410
jmp 0xe0e3
cmpq $0x0, -0x28(%rbp)
jne 0xe0f9
movq $0x0, -0x8(%rbp)
jmp 0xe1df
cmpq $0x0, 0x7b257(%rip)     # 0x89358
jne 0xe113
movq -0x20(%rbp), %rdi
callq 0xa830
movq %rax, 0x7b245(%rip)     # 0x89358
cmpq $0x0, 0x7b245(%rip)     # 0x89360
jne 0xe12d
movq -0x20(%rbp), %rdi
callq 0xa870
movq %rax, 0x7b233(%rip)     # 0x89360
movq -0x28(%rbp), %rax
movw $0x2d, (%rax)
movq -0x28(%rbp), %rax
movw $0x13b, 0x2(%rax)       # imm = 0x13B
movq -0x20(%rbp), %rdi
leaq 0xa5(%rip), %rsi        # 0xe1f0
callq 0x9cc0
movq -0x20(%rbp), %rdi
leaq 0x115(%rip), %rsi       # 0xe270
callq 0x9d10
cmpq $0x0, -0x18(%rbp)
jne 0xe1a3
callq 0x4cfc0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0xe18f
movq -0x20(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0xe0(%rax), %rdx
xorl %esi, %esi
callq 0xe620
jmp 0xe1a1
movq -0x20(%rbp), %rdi
xorl %esi, %esi
leaq 0x7ae94(%rip), %rdx     # 0x89030
callq 0xe620
jmp 0xe1d7
movq -0x18(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movw (%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, (%rax)
movq -0x38(%rbp), %rax
movw 0x2(%rax), %cx
movq -0x28(%rbp), %rax
movw %cx, 0x2(%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)