// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_core/lv_obj.c
// Function: lv_obj_align
void lv_obj_align(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);

    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 - lv_obj_get_width(obj) / 2;
            new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
            break;

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

        case LV_ALIGN_IN_TOP_RIGHT:
            new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
            new_y = 0;
            break;

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

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

        case LV_ALIGN_IN_LEFT_MID:
            new_x = 0;
            new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
            break;

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

        case LV_ALIGN_OUT_TOP_LEFT:
            new_x = 0;
            new_y = -lv_obj_get_height(obj);
            break;

        case LV_ALIGN_OUT_TOP_MID:
            new_x = lv_obj_get_width(base) / 2 - lv_obj_get_width(obj) / 2;
            new_y = -lv_obj_get_height(obj);
            break;

        case LV_ALIGN_OUT_TOP_RIGHT:
            new_x = lv_obj_get_width(base) - lv_obj_get_width(obj);
            new_y = -lv_obj_get_height(obj);
            break;

        case LV_ALIGN_OUT_BOTTOM_LEFT:
            new_x = 0;
            new_y = lv_obj_get_height(base);
            break;

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

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

        case LV_ALIGN_OUT_LEFT_TOP:
            new_x = -lv_obj_get_width(obj);
            new_y = 0;
            break;

        case LV_ALIGN_OUT_LEFT_MID:
            new_x = -lv_obj_get_width(obj);
            new_y = lv_obj_get_height(base) / 2 - lv_obj_get_height(obj) / 2;
            break;

        case LV_ALIGN_OUT_LEFT_BOTTOM:
            new_x = -lv_obj_get_width(obj);
            new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
            break;

        case LV_ALIGN_OUT_RIGHT_TOP:
            new_x = lv_obj_get_width(base);
            new_y = 0;
            break;

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

        case LV_ALIGN_OUT_RIGHT_BOTTOM:
            new_x = lv_obj_get_width(base);
            new_y = lv_obj_get_height(base) - lv_obj_get_height(obj);
            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 = 0;
#endif
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %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 0x8541
movq -0x8(%rbp), %rsi
leaq 0x5fbc2(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x853f
movq -0x8(%rbp), %rdi
callq 0x7350
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x73c0
movw %ax, -0x1a(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x856f
movq -0x8(%rbp), %rdi
callq 0x71b0
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x858e
movq -0x10(%rbp), %rsi
leaq 0x5fb75(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x858c
movzbl -0x11(%rbp), %eax
movq %rax, -0x38(%rbp)
subq $0x14, %rax
ja 0x8a86
movq -0x38(%rbp), %rax
leaq 0x5faa9(%rip), %rcx     # 0x68054
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x40(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x40(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x3c(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movw $0x0, -0x18(%rbp)
movw $0x0, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x44(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movw $0x0, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x48(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movw $0x0, -0x1a(%rbp)
jmp 0x8a86
movw $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x4c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x4c(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x54(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x50(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x50(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x5c(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x58(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movw $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x60(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x68(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x68(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x64(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movw $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x6c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x6c(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x70(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movw $0x0, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x74(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x74(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
cwtl
movl %eax, -0x78(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8310
movw %ax, %cx
movl -0x78(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x8(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movw $0x0, -0x1a(%rbp)
jmp 0x8a86
movq -0x8(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x7c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x7c(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x8(%rbp), %rdi
callq 0x8310
movswl %ax, %ecx
xorl %eax, %eax
subl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x80(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x80(%rbp), %eax
movswl %cx, %ecx
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
movw %ax, -0x18(%rbp)
movw $0x0, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x84(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
cwtl
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x84(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x1a(%rbp)
jmp 0x8a86
movq -0x10(%rbp), %rdi
callq 0x8310
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x8350
cwtl
movl %eax, -0x88(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8350
movw %ax, %cx
movl -0x88(%rbp), %eax
movswl %cx, %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 $0x0, %cl
movb %cl, 0x6d(%rax)
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)