// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_obj.c
// Function: lv_obj_align_origo
void lv_obj_align_origo(lv_obj_t * obj, const lv_obj_t * base, lv_align_t align, lv_coord_t x_mod, lv_coord_t y_mod)
{
    LV_ASSERT_OBJ(obj, LV_OBJX_NAME);

    lv_coord_t new_x = lv_obj_get_x(obj);
    lv_coord_t new_y = lv_obj_get_y(obj);

    lv_coord_t obj_w_half = lv_obj_get_width(obj) / 2;
    lv_coord_t obj_h_half = lv_obj_get_height(obj) / 2;

    if(base == NULL) {
        base = lv_obj_get_parent(obj);
    }

    LV_ASSERT_OBJ(base, LV_OBJX_NAME);


    switch(align) {
        case LV_ALIGN_CENTER:
            new_x = lv_obj_get_width(base) / 2 - obj_w_half;
            new_y = lv_obj_get_height(base) / 2 - obj_h_half;
            break;

        case LV_ALIGN_IN_TOP_LEFT:
            new_x = -obj_w_half;
            new_y = -obj_h_half;
            break;
        case LV_ALIGN_IN_TOP_MID:
            new_x = lv_obj_get_width(base) / 2 - obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_IN_TOP_RIGHT:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_IN_BOTTOM_LEFT:
            new_x = -obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;
        case LV_ALIGN_IN_BOTTOM_MID:
            new_x = lv_obj_get_width(base) / 2 - obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;

        case LV_ALIGN_IN_BOTTOM_RIGHT:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;

        case LV_ALIGN_IN_LEFT_MID:
            new_x = -obj_w_half;
            new_y = lv_obj_get_height(base) / 2 - obj_h_half;
            break;

        case LV_ALIGN_IN_RIGHT_MID:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = lv_obj_get_height(base) / 2 - obj_h_half;
            break;

        case LV_ALIGN_OUT_TOP_LEFT:
            new_x = -obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_OUT_TOP_MID:
            new_x = lv_obj_get_width(base) / 2 - obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_OUT_TOP_RIGHT:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_OUT_BOTTOM_LEFT:
            new_x = -obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;

        case LV_ALIGN_OUT_BOTTOM_MID:
            new_x = lv_obj_get_width(base) / 2 - obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;

        case LV_ALIGN_OUT_BOTTOM_RIGHT:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;

        case LV_ALIGN_OUT_LEFT_TOP:
            new_x = -obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_OUT_LEFT_MID:
            new_x = -obj_w_half;
            new_y = lv_obj_get_height(base) / 2 - obj_h_half;
            break;

        case LV_ALIGN_OUT_LEFT_BOTTOM:
            new_x = -obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;

        case LV_ALIGN_OUT_RIGHT_TOP:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = -obj_h_half;
            break;

        case LV_ALIGN_OUT_RIGHT_MID:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = lv_obj_get_height(base) / 2 - obj_h_half;
            break;

        case LV_ALIGN_OUT_RIGHT_BOTTOM:
            new_x = lv_obj_get_width(base) - obj_w_half;
            new_y = lv_obj_get_height(base) - obj_h_half;
            break;
    }

    /*Bring together the coordination system of base and obj*/
    lv_obj_t * par        = lv_obj_get_parent(obj);
    lv_coord_t base_abs_x = base->coords.x1;
    lv_coord_t base_abs_y = base->coords.y1;
    lv_coord_t par_abs_x  = par->coords.x1;
    lv_coord_t par_abs_y  = par->coords.y1;
    new_x += x_mod + base_abs_x;
    new_y += y_mod + base_abs_y;
    new_x -= par_abs_x;
    new_y -= par_abs_y;

    lv_obj_set_pos(obj, new_x, new_y);

#if LV_USE_OBJ_REALIGN
    /*Save the last align parameters to use them in `lv_obj_realign`*/
    obj->realign.align       = align;
    obj->realign.xofs        = x_mod;
    obj->realign.yofs        = y_mod;
    obj->realign.base        = base;
    obj->realign.origo_align = 1;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %r8w, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %dl, -0x11(%rbp)
movw %cx, -0x14(%rbp)
movw %ax, -0x16(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x8bae
movq -0x8(%rbp), %rsi
leaq 0x5f555(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x8bac
movq -0x8(%rbp), %rdi
callq 0x7350
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x73c0
movw %ax, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movw %ax, -0x1e(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x8c08
movq -0x8(%rbp), %rdi
callq 0x71b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x8c27
movq -0x10(%rbp), %rsi
leaq 0x5f4dc(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x8c25
movzbl -0x11(%rbp), %eax
movq %rax, -0x38(%rbp)
subq $0x14, %rax
ja 0x8fc0
movq -0x38(%rbp), %rax
leaq 0x5f464(%rip), %rcx     # 0x680a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movswl -0x1c(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x1e(%rbp), %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8fc0
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movswl -0x1c(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movswl -0x1e(%rbp), %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
callq 0x71b0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0x2a(%rbp)
movq -0x10(%rbp), %rax
movw 0x22(%rax), %ax
movw %ax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
movw 0x20(%rax), %ax
movw %ax, -0x2e(%rbp)
movq -0x28(%rbp), %rax
movw 0x22(%rax), %ax
movw %ax, -0x30(%rbp)
movswl -0x14(%rbp), %ecx
movswl -0x2a(%rbp), %eax
addl %eax, %ecx
movswl -0x18(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x16(%rbp), %ecx
movswl -0x2c(%rbp), %eax
addl %eax, %ecx
movswl -0x1a(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x1a(%rbp)
movswl -0x2e(%rbp), %ecx
movswl -0x18(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movswl -0x30(%rbp), %ecx
movswl -0x1a(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
movq -0x8(%rbp), %rdi
movw -0x18(%rbp), %ax
movswl %ax, %esi
movswl -0x1a(%rbp), %edx
callq 0x71f0
movb -0x11(%rbp), %cl
movq -0x8(%rbp), %rax
movb %cl, 0x6c(%rax)
movw -0x14(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x68(%rax)
movw -0x16(%rbp), %cx
movq -0x8(%rbp), %rax
movw %cx, 0x6a(%rax)
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movb 0x6d(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x6d(%rax)
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)