// File: /workspace/github_c_makefile_star2_O0/OnionIoT[P]lv_example/lvgl/src/lv_objx/lv_roller.c
// Function: lv_roller_set_options
void lv_roller_set_options(lv_obj_t * roller, const char * options, lv_roller_mode_t mode)
{
    LV_ASSERT_OBJ(roller, LV_OBJX_NAME);
    LV_ASSERT_STR(options);

    lv_roller_ext_t * ext = lv_obj_get_ext_attr(roller);

    if(mode == LV_ROLLER_MODE_NORMAL) {
        ext->mode = LV_ROLLER_MODE_NORMAL;
        lv_ddlist_set_options(roller, options);

        /* Make sure the roller's height and the scrollable's height is refreshed.
         * They are refreshed in `LV_SIGNAL_COORD_CHG` but if the new options has the same width
         * that signal won't be called. (It called because LV_FIT_TIGHT hor fit)*/
        refr_height(roller);
    } else {
        ext->mode = LV_ROLLER_MODE_INIFINITE;

        size_t opt_len = strlen(options) + 1; /*+1 to add '\n' after option lists*/
        char * opt_extra = lv_mem_alloc(opt_len * LV_ROLLER_INF_PAGES);
        uint8_t i;
        for(i = 0; i < LV_ROLLER_INF_PAGES; i++) {
            strcpy(&opt_extra[opt_len * i], options);
            opt_extra[opt_len * (i + 1) - 1] = '\n';
        }
        opt_extra[opt_len * LV_ROLLER_INF_PAGES - 1] = '\0';
        lv_ddlist_set_options(roller, opt_extra);
        lv_mem_free(opt_extra);

        /* Make sure the roller's height and the scrollable's height is refreshed.
         * They are refreshed in `LV_SIGNAL_COORD_CHG` but if the new options has the same width
         * that signal won't be called. (It called because LV_FIT_TIGHT hor fit)*/
        refr_height(roller);

        uint16_t real_id_cnt = ext->ddlist.option_cnt / LV_ROLLER_INF_PAGES;
        lv_roller_set_selected(roller, ((LV_ROLLER_INF_PAGES / 2) + 1) * real_id_cnt, false); /*Select the middle page*/
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %dl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x190c4
movq -0x8(%rbp), %rsi
leaq 0x4f03f(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x190c2
movq -0x10(%rbp), %rdi
callq 0xd120
testb $0x1, %al
jne 0x190e3
movq -0x10(%rbp), %rsi
leaq 0x4f020(%rip), %rdi     # 0x680fc
callq 0xd410
jmp 0x190e1
movq -0x8(%rbp), %rdi
callq 0xa8f0
movq %rax, -0x20(%rbp)
movzbl -0x11(%rbp), %eax
cmpl $0x0, %eax
jne 0x19124
movq -0x20(%rbp), %rax
movb 0x70(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x70(%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x13c30
movq -0x8(%rbp), %rdi
callq 0x19210
jmp 0x191fd
movq -0x20(%rbp), %rax
movb 0x70(%rax), %cl
andb $-0x2, %cl
orb $0x1, %cl
movb %cl, 0x70(%rax)
movq -0x10(%rbp), %rdi
callq 0x2060
addq $0x1, %rax
movq %rax, -0x28(%rbp)
imulq $0x7, -0x28(%rbp), %rdi
callq 0x44d20
movq %rax, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movzbl -0x31(%rbp), %eax
cmpl $0x7, %eax
jge 0x191a4
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rax
movzbl -0x31(%rbp), %ecx
imulq %rcx, %rax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
callq 0x2040
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movzbl -0x31(%rbp), %edx
addl $0x1, %edx
movslq %edx, %rdx
imulq %rdx, %rcx
subq $0x1, %rcx
movb $0xa, (%rax,%rcx)
movb -0x31(%rbp), %al
addb $0x1, %al
movb %al, -0x31(%rbp)
jmp 0x19157
movq -0x30(%rbp), %rax
imulq $0x7, -0x28(%rbp), %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x13c30
movq -0x30(%rbp), %rdi
callq 0x44ec0
movq -0x8(%rbp), %rdi
callq 0x19210
movq -0x20(%rbp), %rax
movzwl 0x60(%rax), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movw %ax, -0x34(%rbp)
movq -0x8(%rbp), %rdi
movzwl -0x34(%rbp), %eax
shll $0x2, %eax
xorl %edx, %edx
movzwl %ax, %esi
callq 0x19300
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)