LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_math.c
// Function: lv_trigo_sin
int16_t lv_trigo_sin(int16_t angle)
{
    int16_t ret = 0;
    angle       = angle % 360;

    if(angle < 0) angle = 360 + angle;

    if(angle < 90) {
        ret = sin0_90_table[angle];
    } else if(angle >= 90 && angle < 180) {
        angle = 180 - angle;
        ret   = sin0_90_table[angle];
    } else if(angle >= 180 && angle < 270) {
        angle = angle - 180;
        ret   = -sin0_90_table[angle];
    } else { /*angle >=270*/
        angle = 360 - angle;
        ret   = -sin0_90_table[angle];
    }

    return ret;
}

// Assembly:
movl %edi, %eax
cwtd
movw $0x168, %cx             # imm = 0x168
idivw %cx
leal 0x168(%rdx), %eax
testw %dx, %dx
cmovnsl %edx, %eax
cmpw $0x59, %ax
ja 0x28dae
movzwl %ax, %eax
jmp 0x28dbe
cmpw $0xb3, %ax
ja 0x28dca
movl $0xb4, %ecx
subl %eax, %ecx
movzwl %cx, %eax
leaq 0x161db(%rip), %rcx     # 0x3efa0
movzwl (%rcx,%rax,2), %eax
retq
cmpw $0x10d, %ax             # imm = 0x10D
ja 0x28dda
addl $0xffffff4c, %eax       # imm = 0xFFFFFF4C
movzwl %ax, %ecx
jmp 0x28de4
movl $0x168, %ecx            # imm = 0x168
subl %eax, %ecx
movzwl %cx, %ecx
leaq 0x161b5(%rip), %rdx     # 0x3efa0
xorl %eax, %eax
subw (%rdx,%rcx,2), %ax
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_math.c
// Function: lv_sqrt
uint32_t lv_sqrt(uint32_t num)
{
    // http://www.codecodex.com/wiki/Calculate_an_integer_square_root#C
    uint32_t root  = 0;
    uint32_t place = 0x40000000;

    while(place > num) place >>= 2;
    while(place) {
        if(num >= root + place) {
            num -= root + place;
            root += (place << 1);
        }
        root >>= 1;
        place >>= 2;
    }
    return root;
}

// Assembly:
movl $0x40000000, %eax       # imm = 0x40000000
movl %eax, %ecx
shrl $0x2, %eax
cmpl %edi, %ecx
ja 0x28f18
xorl %edx, %edx
xorl %eax, %eax
testl %ecx, %ecx
je 0x28f49
leal (%rcx,%rax), %esi
cmpl %esi, %edi
cmovbl %edx, %esi
leal (%rcx,%rcx), %r8d
cmovbl %edx, %r8d
subl %esi, %edi
addl %eax, %r8d
shrl %r8d
shrl $0x2, %ecx
movl %r8d, %eax
jmp 0x28f25
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_utils.c
// Function: lv_utils_num_to_str
char * lv_utils_num_to_str(int32_t num, char * buf)
{
    if(num == 0) {
        buf[0] = '0';
        buf[1] = '\0';
        return buf;
    }
    int8_t digitCount = 0;
    int8_t i          = 0;
    if(num < 0) {
        buf[digitCount++] = '-';
        num               = LV_MATH_ABS(num);
        ++i;
    }
    while(num) {
        char digit        = num % 10;
        buf[digitCount++] = digit + 48;
        num /= 10;
    }
    buf[digitCount] = '\0';
    digitCount--;
    while(digitCount > i) {
        char temp       = buf[i];
        buf[i]          = buf[digitCount];
        buf[digitCount] = temp;
        digitCount--;
        i++;
    }
    return buf;
}

// Assembly:
testl %edi, %edi
je 0x28f58
movl %edi, %eax
js 0x28f61
xorl %edi, %edi
jmp 0x28f69
movw $0x30, (%rsi)
movq %rsi, %rax
retq
movb $0x2d, (%rsi)
negl %eax
movb $0x1, %dil
pushq $0xa
popq %r8
movl %edi, %r9d
movsbq %r9b, %rcx
testl %eax, %eax
je 0x28f89
xorl %edx, %edx
divl %r8d
orb $0x30, %dl
leal 0x1(%rcx), %r9d
movb %dl, (%rsi,%rcx)
jmp 0x28f70
movb $0x0, (%rsi,%rcx)
movzbl %dil, %eax
decb %cl
movsbq %cl, %rcx
cmpq %rcx, %rax
jge 0x28f5d
movb (%rsi,%rax), %dl
movb (%rsi,%rcx), %dil
movb %dil, (%rsi,%rax)
movb %dl, (%rsi,%rcx)
incq %rax
jmp 0x28f91
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_utils.c
// Function: lv_utils_bsearch
void * lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size,
                        int32_t (*cmp)(const void * pRef, const void * pElement))
{
    const char * middle;
    int32_t c;

    for(middle = base; n != 0;) {
        middle += (n / 2) * size;
        if((c = (*cmp)(key, middle)) > 0) {
            n    = (n / 2) - ((n & 1) == 0);
            base = (middle += size);
        } else if(c < 0) {
            n /= 2;
            middle = base;
        } else {
            return (char *)middle;
        }
    }
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r8, 0x10(%rsp)
movl %ecx, %ebp
movl %edx, %ebx
movq %rsi, %r12
movq %rdi, %r14
movl %ecx, %eax
movq %rax, 0x8(%rsp)
testl %ebx, %ebx
je 0x29011
movl %ebx, %r15d
shrl %r15d
movl %r15d, %r13d
imull %ebp, %r13d
addq %r12, %r13
movq %r14, %rdi
movq %r13, %rsi
callq *0x10(%rsp)
testl %eax, %eax
jg 0x28ffc
movl %r15d, %ebx
js 0x28fd3
jmp 0x29014
notl %ebx
andl $0x1, %ebx
subl %ebx, %r15d
addq 0x8(%rsp), %r13
movl %r15d, %ebx
movq %r13, %r12
jmp 0x28fd3
xorl %r13d, %r13d
movq %r13, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_async.c
// Function: lv_async_call
lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data)
{
    /*Allocate an info structure */
    lv_async_info_t *info = lv_mem_alloc(sizeof(lv_async_info_t));
    
    if(info == NULL)
        return LV_RES_INV;
    
    /* Create a new task */
    /* Use highest priority so that it will run before a refresh */
    lv_task_t *task = lv_task_create(lv_async_task_cb, 0, LV_TASK_PRIO_HIGHEST, info);
    
    if(task == NULL) {
        lv_mem_free(info);
        return LV_RES_INV;
    }
    
    info->cb = async_xcb;
    info->user_data = user_data;

    /* Set the task's user data */
    task->user_data = info;
    lv_task_once(task);
    return LV_RES_OK;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
pushq $0x10
popq %rdi
callq 0x279f9
testq %rax, %rax
je 0x2907b
movq %rax, %r15
leaq 0x39(%rip), %rdi        # 0x29083
pushq $0x5
popq %rdx
xorl %esi, %esi
movq %rax, %rcx
callq 0x26c3b
testq %rax, %rax
je 0x29073
movq %r14, (%r15)
movq %rbx, 0x8(%r15)
movq %r15, 0x10(%rax)
movq %rax, %rdi
callq 0x26d5f
movb $0x1, %al
jmp 0x2907d
movq %r15, %rdi
callq 0x27a7a
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_printf.c
// Function: atoi
static unsigned int _atoi(const char** str)
{
  unsigned int i = 0U;
  while (_is_digit(**str)) {
    i = i * 10U + (unsigned int)(*((*str)++) - '0');
  }
  return i;
}

// Assembly:
movq (%rdi), %rcx
xorl %eax, %eax
movb (%rcx), %dl
addb $-0x30, %dl
cmpb $0x9, %dl
ja 0x29ada
imull $0xa, %eax, %eax
leaq 0x1(%rcx), %rdx
movq %rdx, (%rdi)
movsbl (%rcx), %ecx
addl %ecx, %eax
addl $-0x30, %eax
movq %rdx, %rcx
jmp 0x29ab9
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_printf.c
// Function: ntoa_long_long
static size_t _ntoa_long_long(out_fct_type out, char* buffer, size_t idx, size_t maxlen, unsigned long long value, bool negative, unsigned long long base, unsigned int prec, unsigned int width, unsigned int flags)
{
  char buf[PRINTF_NTOA_BUFFER_SIZE];
  size_t len = 0U;

  // no hash for 0 values
  if (!value) {
    flags &= ~FLAGS_HASH;
  }

  // write if precision != 0 and value is != 0
  if (!(flags & FLAGS_PRECISION) || value) {
    do {
      const char digit = (char)(value % base);
      buf[len++] = digit < 10 ? '0' + digit : (flags & FLAGS_UPPERCASE ? 'A' : 'a') + digit - 10;
      value /= base;
    } while (value && (len < PRINTF_NTOA_BUFFER_SIZE));
  }

  return _ntoa_format(out, buffer, idx, maxlen, buf, len, negative, (unsigned int)base, prec, width, flags);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %rbx
movl 0x70(%rsp), %r12d
movq 0x60(%rsp), %r14
movl 0x78(%rsp), %eax
movl %eax, %r13d
andl $-0x11, %r13d
testq %r8, %r8
sete %dl
cmovnel %eax, %r13d
movl %r13d, %eax
shrl $0xa, %eax
andl $0x1, %eax
testb %al, %dl
jne 0x29b6d
movq %r8, %r10
movl %r13d, %r8d
andl $0x20, %r8d
xorl $0x61, %r8d
addl $0xf6, %r8d
xorl %ebp, %ebp
movq %r10, %rax
xorl %edx, %edx
divq %r14
leal (%r8,%rdx), %r11d
movl %edx, %r15d
andl $0xfe, %r15d
orb $0x30, %dl
cmpl $0xa, %r15d
movzbl %dl, %edx
cmovael %r11d, %edx
leaq 0x1(%rbp), %r11
movb %dl, (%rsp,%rbp)
cmpq %r14, %r10
jb 0x29b70
movq %rax, %r10
cmpq $0x1f, %rbp
movq %r11, %rbp
jb 0x29b2f
jmp 0x29b70
xorl %r11d, %r11d
subq $0x8, %rsp
movzbl %r9b, %eax
leaq 0x8(%rsp), %r8
movq %rbx, %rdx
movq %r11, %r9
pushq %r13
pushq %r12
movl 0x80(%rsp), %r10d
pushq %r10
pushq %r14
pushq %rax
callq 0x2a2ca
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_misc/lv_printf.c
// Function: out_rev
static size_t _out_rev(out_fct_type out, char* buffer, size_t idx, size_t maxlen, const char* buf, size_t len, unsigned int width, unsigned int flags)
{
  const size_t start_idx = idx;

  // pad spaces up to given width
  if (!(flags & FLAGS_LEFT) && !(flags & FLAGS_ZEROPAD)) {
      size_t i;
      for (i = len; i < width; i++) {
      out(' ', buffer, idx++, maxlen);
    }
  }

  // reverse string
  while (len) {
    out(buf[--len], buffer, idx++, maxlen);
  }

  // append pad spaces up to given width
  if (flags & FLAGS_LEFT) {
    while (idx - start_idx < width) {
      out(' ', buffer, idx++, maxlen);
    }
  }

  return idx;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r14
movq %r8, 0x10(%rsp)
movq %rcx, %rbx
movq %rsi, %r15
movq %rdi, %r12
movl 0x58(%rsp), %ecx
movl 0x50(%rsp), %eax
movq %rdx, 0x8(%rsp)
testb $0x3, %cl
je 0x2a4aa
movq %r14, %rbp
subq $0x1, %rbp
jb 0x2a462
movq 0x10(%rsp), %rax
movsbl -0x1(%rax,%r14), %edi
leaq 0x1(%rdx), %r13
movq %r15, %rsi
movq %rbx, %rcx
callq *%r12
movq %rbp, %r14
movq %r13, %rdx
jmp 0x2a43c
movl 0x58(%rsp), %eax
testb $0x2, %al
movl 0x50(%rsp), %r13d
jne 0x2a481
movq %rdx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
negq 0x8(%rsp)
pushq $0x20
popq %rbp
movq 0x8(%rsp), %rax
addq %rdx, %rax
cmpq %r13, %rax
jae 0x2a46f
leaq 0x1(%rdx), %r14
movl %ebp, %edi
movq %r15, %rsi
movq %rbx, %rcx
callq *%r12
movq %r14, %rdx
jmp 0x2a489
movq 0x8(%rsp), %rdx
movq %r14, %rbp
cmpq %rax, %rbp
jae 0x2a439
leaq 0x1(%rdx), %r13
pushq $0x20
popq %rdi
movq %r15, %rsi
movq %rbx, %rcx
callq *%r12
incq %rbp
movq %r13, %rdx
movl 0x50(%rsp), %eax
jmp 0x2a4b2
nop
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_themes/lv_theme_alien.c
// Function: style_mod_edit
static void style_mod_edit(lv_group_t * group, lv_style_t * style)
{
    (void)group; /*Unused*/
#if LV_COLOR_DEPTH != 1
    /*Make the style to be a little bit orange*/
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_GREEN;

    /*If not empty or has border then emphasis the border*/
    if(style->body.opa != LV_OPA_TRANSP || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;

    style->body.main_color   = lv_color_mix(style->body.main_color, LV_COLOR_GREEN, LV_OPA_70);
    style->body.grad_color   = lv_color_mix(style->body.grad_color, LV_COLOR_GREEN, LV_OPA_70);
    style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_GREEN, LV_OPA_60);

    style->text.color = lv_color_mix(style->text.color, LV_COLOR_GREEN, LV_OPA_70);
#else
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_BLACK;
    style->body.border.width = 3;
#endif
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movb $-0x1, 0xf(%rsi)
movw $0x400, 0xa(%rsi)       # imm = 0x400
cmpb $0x0, 0x8(%rsi)
jne 0x2bd37
cmpw $0x0, 0xc(%rbx)
je 0x2bd3d
movw $0x5, 0xc(%rbx)
movzwl 0x2(%rbx), %edi
movl $0xb2, %esi
callq 0x2bd8e
movw %ax, 0x2(%rbx)
movzwl 0x4(%rbx), %edi
movl $0xb2, %esi
callq 0x2bd8e
movw %ax, 0x4(%rbx)
movzwl 0x10(%rbx), %edi
movl $0x99, %esi
callq 0x2bd8e
movw %ax, 0x10(%rbx)
movl 0x20(%rbx), %edi
movl $0xb2, %esi
callq 0x2bd8e
movw %ax, 0x20(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_themes/lv_theme_default.c
// Function: style_mod
static void style_mod(lv_group_t * group, lv_style_t * style)
{
    (void)group; /*Unused*/
#if LV_COLOR_DEPTH != 1
    /*Make the style to be a little bit orange*/
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_ORANGE;

    /*If not empty or has border then emphasis the border*/
    if(style->body.opa != LV_OPA_TRANSP || style->body.border.width != 0) style->body.border.width = LV_DPI / 20;

    style->body.main_color   = lv_color_mix(style->body.main_color, LV_COLOR_ORANGE, LV_OPA_70);
    style->body.grad_color   = lv_color_mix(style->body.grad_color, LV_COLOR_ORANGE, LV_OPA_70);
    style->body.shadow.color = lv_color_mix(style->body.shadow.color, LV_COLOR_ORANGE, LV_OPA_60);

    style->text.color = lv_color_mix(style->text.color, LV_COLOR_ORANGE, LV_OPA_70);
#else
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_BLACK;
    style->body.border.width = 2;
#endif
}

// Assembly:
pushq %rbx
movq %rsi, %rbx
movb $-0x1, 0xf(%rsi)
movw $0xfd20, 0xa(%rsi)      # imm = 0xFD20
cmpb $0x0, 0x8(%rsi)
jne 0x2c3f6
cmpw $0x0, 0xc(%rbx)
je 0x2c3fc
movw $0x5, 0xc(%rbx)
movzwl 0x2(%rbx), %edi
movl $0xfd20, %esi           # imm = 0xFD20
movl $0xb2, %edx
callq 0x2c4df
movw %ax, 0x2(%rbx)
movzwl 0x4(%rbx), %edi
movl $0xfd20, %esi           # imm = 0xFD20
movl $0xb2, %edx
callq 0x2c4df
movw %ax, 0x4(%rbx)
movzwl 0x10(%rbx), %edi
movl $0xfd20, %esi           # imm = 0xFD20
movl $0x99, %edx
callq 0x2c4df
movw %ax, 0x10(%rbx)
movl 0x20(%rbx), %edi
movl $0xfd20, %esi           # imm = 0xFD20
movl $0xb2, %edx
callq 0x2c4df
movw %ax, 0x20(%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_themes/lv_theme_material.c
// Function: style_mod
static void style_mod(lv_group_t * group, lv_style_t * style)
{
    (void)group; /*Unused*/
#if LV_COLOR_DEPTH != 1
    uint16_t hue2 = (_hue + 60) % 360;

    /*Make the style to be a little bit orange*/
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = lv_color_hsv_to_rgb(hue2, 90, 70);

    /*If not empty or has border then emphasis the border*/
    if(style->body.opa != LV_OPA_TRANSP || style->body.border.width != 0) style->body.border.width = LV_DPI / 30;

    style->body.main_color   = lv_color_mix(style->body.main_color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_70);
    style->body.grad_color   = lv_color_mix(style->body.grad_color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_70);
    style->body.shadow.color = lv_color_mix(style->body.shadow.color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_60);

    style->text.color = lv_color_mix(style->text.color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_70);
#else
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_BLACK;
    style->body.border.width = 2;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzwl 0x3c3ae(%rip), %eax     # 0x6c990
addl $0x3c, %eax
movl $0x168, %ecx            # imm = 0x168
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
movb $-0x1, 0xf(%rsi)
pushq $0x5a
popq %rsi
pushq $0x46
popq %rdx
movl %ebp, %edi
callq 0x28074
movw %ax, 0xa(%rbx)
cmpb $0x0, 0x8(%rbx)
jne 0x30612
cmpw $0x0, 0xc(%rbx)
je 0x30618
movw $0x3, 0xc(%rbx)
movzwl %bp, %ebp
pushq $0x5a
popq %r14
pushq $0x46
popq %r15
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movzwl 0x2(%rbx), %edi
movl %eax, %esi
movl $0xb2, %edx
callq 0x307f6
movw %ax, 0x2(%rbx)
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movzwl 0x4(%rbx), %edi
movl %eax, %esi
movl $0xb2, %edx
callq 0x307f6
movw %ax, 0x4(%rbx)
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movzwl 0x10(%rbx), %edi
movl %eax, %esi
movl $0x99, %edx
callq 0x307f6
movw %ax, 0x10(%rbx)
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movl 0x20(%rbx), %edi
movl %eax, %esi
movl $0xb2, %edx
callq 0x307f6
movw %ax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_themes/lv_theme_material.c
// Function: style_mod_edit
static void style_mod_edit(lv_group_t * group, lv_style_t * style)
{
    (void)group; /*Unused*/
#if LV_COLOR_DEPTH != 1
    uint16_t hue2 = (_hue + 300) % 360;

    /*Make the style to be a little bit orange*/
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_GREEN;

    /*If not empty or has border then emphasis the border*/
    if(style->body.opa != LV_OPA_TRANSP || style->body.border.width != 0) style->body.border.width = LV_DPI / 30;


    style->body.main_color   = lv_color_mix(style->body.main_color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_70);
    style->body.grad_color   = lv_color_mix(style->body.grad_color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_70);
    style->body.shadow.color = lv_color_mix(style->body.shadow.color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_60);

    style->text.color = lv_color_mix(style->text.color, lv_color_hsv_to_rgb(hue2, 90, 70), LV_OPA_70);
#else
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_BLACK;
    style->body.border.width = 3;
#endif
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movzwl 0x3c2ce(%rip), %eax     # 0x6c990
movb $-0x1, 0xf(%rsi)
movw $0x400, 0xa(%rsi)       # imm = 0x400
cmpb $0x0, 0x8(%rsi)
jne 0x306d9
cmpw $0x0, 0xc(%rbx)
je 0x306df
movw $0x3, 0xc(%rbx)
addl $0x12c, %eax            # imm = 0x12C
movl $0x168, %ecx            # imm = 0x168
xorl %edx, %edx
divl %ecx
movl %edx, %ebp
pushq $0x5a
popq %r14
pushq $0x46
popq %r15
movl %edx, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movzwl 0x2(%rbx), %edi
movl %eax, %esi
movl $0xb2, %edx
callq 0x307f6
movw %ax, 0x2(%rbx)
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movzwl 0x4(%rbx), %edi
movl %eax, %esi
movl $0xb2, %edx
callq 0x307f6
movw %ax, 0x4(%rbx)
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movzwl 0x10(%rbx), %edi
movl %eax, %esi
movl $0x99, %edx
callq 0x307f6
movw %ax, 0x10(%rbx)
movl %ebp, %edi
movl %r14d, %esi
movl %r15d, %edx
callq 0x28074
movl 0x20(%rbx), %edi
movl %eax, %esi
movl $0xb2, %edx
callq 0x307f6
movw %ax, 0x20(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_themes/lv_theme_nemo.c
// Function: style_mod
static void style_mod(lv_group_t * group, lv_style_t * style)
{
    (void)group; /*Unused*/
#if LV_COLOR_DEPTH != 1
    style->body.border.width = 2;
    style->body.border.color = LV_COLOR_SILVER;
    style->body.border.opa   = LV_OPA_70;
    style->body.shadow.width = LV_DPI / 20;
    style->body.shadow.color = lv_color_hsv_to_rgb(_hue, 20, 90);
    style->body.main_color   = lv_color_hsv_to_rgb(_hue, 40, 80);
    style->body.grad_color   = lv_color_hsv_to_rgb(_hue, 40, 80);
#else
    style->body.border.opa   = LV_OPA_COVER;
    style->body.border.color = LV_COLOR_BLACK;
    style->body.border.width = 2;
#endif
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl $0x2c618, 0xa(%rsi)     # imm = 0x2C618
movb $-0x4e, 0xf(%rsi)
movw $0x5, 0x12(%rsi)
movzwl 0x3bfe7(%rip), %edi     # 0x6df00
pushq $0x14
popq %rsi
pushq $0x5a
popq %rdx
callq 0x28074
movw %ax, 0x10(%rbx)
movzwl 0x3bfd1(%rip), %edi     # 0x6df00
pushq $0x28
popq %rbp
pushq $0x50
popq %r14
movl %ebp, %esi
movl %r14d, %edx
callq 0x28074
movw %ax, 0x2(%rbx)
movzwl 0x3bfb5(%rip), %edi     # 0x6df00
movl %ebp, %esi
movl %r14d, %edx
callq 0x28074
movw %ax, 0x4(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_basic.c
// Function: lv_draw_px
void lv_draw_px(lv_coord_t x, lv_coord_t y, const lv_area_t * mask_p, lv_color_t color, lv_opa_t opa)
{

    if(opa < LV_OPA_MIN) return;
    if(opa > LV_OPA_MAX) opa = LV_OPA_COVER;

    /*Pixel out of the mask*/
    if(x < mask_p->x1 || x > mask_p->x2 || y < mask_p->y1 || y > mask_p->y2) {
        return;
    }

    lv_disp_t * disp    = lv_refr_get_disp_refreshing();
    lv_disp_buf_t * vdb = lv_disp_get_buf(disp);
    uint32_t vdb_width  = lv_area_get_width(&vdb->area);

    /*Make the coordinates relative to VDB*/
    x -= vdb->area.x1;
    y -= vdb->area.y1;

    if(disp->driver.set_px_cb) {
        disp->driver.set_px_cb(&disp->driver, (uint8_t *)vdb->buf_act, vdb_width, x, y, color, opa);
    } else {
        bool scr_transp = false;
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
        scr_transp = disp->driver.screen_transp;
#endif

        lv_color_t * vdb_px_p = vdb->buf_act;
        vdb_px_p += y * vdb_width + x;

        if(scr_transp == false) {
            if(opa == LV_OPA_COVER) {
                *vdb_px_p = color;
            } else {
                *vdb_px_p = lv_color_mix(color, *vdb_px_p, opa);
            }
        } else {
#if LV_COLOR_DEPTH == 32 && LV_COLOR_SCREEN_TRANSP
            *vdb_px_p = color_mix_2_alpha(*vdb_px_p, (*vdb_px_p).ch.alpha, color, opa);
#endif
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, %r15d
cmpb $0x10, %r15b
jb 0x326dc
movl %edi, %ebp
cmpb $-0x4, %r15b
movzbl %r15b, %r12d
movl $0xff, %r13d
cmovbl %r12d, %r13d
cmpw %bp, (%rdx)
jg 0x326dc
cmpw %bp, 0x4(%rdx)
jl 0x326dc
movl %esi, %r14d
cmpw %r14w, 0x2(%rdx)
jg 0x326dc
cmpw %r14w, 0x6(%rdx)
jl 0x326dc
movl %ecx, %ebx
callq 0x6e0e
movq %rax, 0x10(%rsp)
movq %rax, %rdi
callq 0x7e45
movq 0x10(%rsp), %rdi
movzwl 0x20(%rax), %ecx
movzwl 0x1c(%rax), %edx
subl %edx, %ecx
incl %ecx
subl %edx, %ebp
subw 0x1e(%rax), %r14w
movq 0x28(%rdi), %r10
testq %r10, %r10
je 0x326a9
movq 0x10(%rax), %rsi
movzbl %r13b, %eax
movl %eax, (%rsp)
movswl %cx, %edx
movswl %bp, %ecx
movswl %r14w, %r8d
movl %ebx, %r9d
callq *%r10
jmp 0x326dc
movswl %cx, %ecx
movswl %r14w, %edx
imull %ecx, %edx
movswl %bp, %r14d
addl %edx, %r14d
movq 0x10(%rax), %r13
cmpb $-0x5, %r15b
ja 0x326d6
movzwl (%r13,%r14,2), %esi
movl %ebx, %edi
movl %r12d, %edx
callq 0x326eb
movl %eax, %ebx
movw %bx, (%r13,%r14,2)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw.c
// Function: lv_draw_get_buf
void * lv_draw_get_buf(uint32_t size)
{
    if(size <= draw_buf_size) return LV_GC_ROOT(_lv_draw_buf);

    LV_LOG_TRACE("lv_draw_get_buf: allocate");

    draw_buf_size = size;

    if(LV_GC_ROOT(_lv_draw_buf) == NULL) {
        LV_GC_ROOT(_lv_draw_buf) = lv_mem_alloc(size);
        LV_ASSERT_MEM(LV_GC_ROOT(_lv_draw_buf));
        return LV_GC_ROOT(_lv_draw_buf);
    }

    LV_GC_ROOT(_lv_draw_buf) = lv_mem_realloc(LV_GC_ROOT(_lv_draw_buf), size);
    LV_ASSERT_MEM(LV_GC_ROOT(_lv_draw_buf));
    return LV_GC_ROOT(_lv_draw_buf);
}

// Assembly:
pushq %rbx
cmpl %edi, 0x3c621(%rip)     # 0x6faf0
jae 0x33526
movl %edi, %eax
movl %edi, 0x3c617(%rip)     # 0x6faf0
leaq 0x330d0(%rip), %rbx     # 0x665b0
movq (%rbx), %rdi
movl %eax, %esi
testq %rdi, %rdi
je 0x3350f
callq 0x27ad9
movq %rax, (%rbx)
movq %rax, %rdi
callq 0x7994
testb %al, %al
jne 0x33526
movq (%rbx), %rsi
leaq 0x7b38(%rip), %rdi      # 0x3b040
callq 0x7b01
jmp 0x3350d
movq %rsi, %rdi
callq 0x279f9
movq %rax, (%rbx)
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x33532
leaq 0x33083(%rip), %rax     # 0x665b0
movq (%rax), %rax
popq %rbx
retq
movq (%rbx), %rsi
leaq 0x7b04(%rip), %rdi      # 0x3b040
callq 0x7b01
jmp 0x33541
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw.c
// Function: lv_draw_free_buf
void lv_draw_free_buf(void)
{
    if(LV_GC_ROOT(_lv_draw_buf)) {
        lv_mem_free(LV_GC_ROOT(_lv_draw_buf));
        LV_GC_ROOT(_lv_draw_buf) = NULL;
        draw_buf_size = 0;
    }
}

// Assembly:
pushq %rbx
leaq 0x33065(%rip), %rbx     # 0x665b0
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x33563
callq 0x27a7a
andq $0x0, (%rbx)
andl $0x0, 0x3c58d(%rip)     # 0x6faf0
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw.c
// Function: lv_draw_aa_ver_seg
void lv_draw_aa_ver_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_area_t * mask, lv_color_t color,
                        lv_opa_t opa)
{
    bool aa_inv = false;
    if(length < 0) {
        aa_inv = true;
        length = -length;
    }

    lv_coord_t i;
    for(i = 0; i < length; i++) {
        lv_opa_t px_opa = lv_draw_aa_get_opa(length, i, opa);
        if(aa_inv) px_opa = opa - px_opa;
        lv_draw_px(x, y + i, mask, color, px_opa);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0x4(%rsp)
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movq %rsi, 0x8(%rsp)
movl %ebp, %r14d
negw %r14w
cmovsw %bp, %r14w
xorl %r15d, %r15d
movswl %r14w, %r12d
movzbl %r9b, %r13d
movswl %di, %ebx
cmpw %r14w, %r15w
jge 0x33630
movswl %r15w, %esi
movl %r12d, %edi
movl %r13d, %edx
callq 0x33565
movl %r13d, %ecx
subb %al, %cl
testw %bp, %bp
movzbl %al, %eax
movzbl %cl, %ecx
cmovnsl %eax, %ecx
movq 0x8(%rsp), %rax
addl %r15d, %eax
movzbl %cl, %r8d
movswl %ax, %esi
movl %ebx, %edi
movq 0x10(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0x325fc
incl %r15d
jmp 0x335e6
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw.c
// Function: lv_draw_aa_hor_seg
void lv_draw_aa_hor_seg(lv_coord_t x, lv_coord_t y, lv_coord_t length, const lv_area_t * mask, lv_color_t color,
                        lv_opa_t opa)
{
    bool aa_inv = false;
    if(length < 0) {
        aa_inv = true;
        length = -length;
    }

    lv_coord_t i;
    for(i = 0; i < length; i++) {
        lv_opa_t px_opa = lv_draw_aa_get_opa(length, i, opa);
        if(aa_inv) px_opa = opa - px_opa;
        lv_draw_px(x + i, y, mask, color, px_opa);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r8d, 0x4(%rsp)
movq %rcx, 0x10(%rsp)
movl %edx, %ebp
movq %rdi, 0x8(%rsp)
movl %ebp, %r14d
negw %r14w
cmovsw %bp, %r14w
xorl %r15d, %r15d
movswl %r14w, %r12d
movzbl %r9b, %r13d
movswl %si, %ebx
cmpw %r14w, %r15w
jge 0x336c2
movswl %r15w, %esi
movl %r12d, %edi
movl %r13d, %edx
callq 0x33565
movl %r13d, %ecx
subb %al, %cl
testw %bp, %bp
movzbl %al, %eax
movzbl %cl, %ecx
cmovnsl %eax, %ecx
movq 0x8(%rsp), %rax
addl %r15d, %eax
movzbl %cl, %r8d
movswl %ax, %edi
movl %ebx, %esi
movq 0x10(%rsp), %rdx
movl 0x4(%rsp), %ecx
callq 0x325fc
incl %r15d
jmp 0x33678
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_rect.c
// Function: lv_draw_cont_radius_corr
static uint16_t lv_draw_cont_radius_corr(uint16_t r, lv_coord_t w, lv_coord_t h)
{
    bool aa = lv_disp_get_antialiasing(lv_refr_get_disp_refreshing());

    if(r >= (w >> 1)) {
        r = (w >> 1);
        if(r != 0) r--;
    }
    if(r >= (h >> 1)) {
        r = (h >> 1);
        if(r != 0) r--;
    }

    if(r > 0) r -= aa;

    return r;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebx
movl %esi, %ebp
movl %edi, %r14d
callq 0x6e0e
movq %rax, %rdi
callq 0x7e02
movl %ebp, %ecx
shrl %ecx
movl %ebp, %edx
sarl %edx
cmpw $0x2, %bp
adcw $-0x1, %cx
cmpl %edx, %r14d
cmovll %r14d, %ecx
movl %ebx, %edx
shrl %edx
movl %ebx, %esi
sarl %esi
cmpw $0x2, %bx
adcw $-0x1, %dx
movzwl %cx, %edi
cmpl %esi, %edi
cmovll %ecx, %edx
movzbl %al, %eax
movl %edx, %ecx
subl %eax, %ecx
xorl %eax, %eax
testw %dx, %dx
cmovnel %ecx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_rect.c
// Function: antialias_get_opa_circ
static lv_opa_t antialias_get_opa_circ(lv_coord_t seg, lv_coord_t px_id, lv_opa_t opa)
{
    /*Empirical non-linear values anti-aliasing values*/
    static const lv_opa_t opa_map2[2] = {210, 80};
    static const lv_opa_t opa_map3[3] = {230, 150, 60};
    static const lv_opa_t opa_map4[4] = {235, 185, 125, 50};
    static const lv_opa_t opa_map8[8] = {250, 242, 219, 191, 158, 117, 76, 40};

#if CIRCLE_AA_NON_LINEAR_OPA_THRESHOLD < 1
    if(seg == 1) return 170;
#endif

#if CIRCLE_AA_NON_LINEAR_OPA_THRESHOLD < 2
    if(seg == 2) return (opa_map2[px_id] * opa) >> 8;
#endif

#if CIRCLE_AA_NON_LINEAR_OPA_THRESHOLD < 3
    if(seg == 3) return (opa_map3[px_id] * opa) >> 8;
#endif

#if CIRCLE_AA_NON_LINEAR_OPA_THRESHOLD < 4
    if(seg == 4) return (opa_map4[px_id] * opa) >> 8;
#endif

    uint8_t id = (uint32_t)((uint32_t)px_id * (sizeof(opa_map8) - 1)) / (seg - 1);
    return (uint32_t)((uint32_t)opa_map8[id] * opa) >> 8;
}

// Assembly:
movl %edx, %ecx
cmpl $0x4, %edi
je 0x36964
cmpl $0x3, %edi
je 0x36957
cmpl $0x2, %edi
jne 0x36971
movswq %si, %rdx
leaq 0x895f(%rip), %rax      # 0x3f2b4
jmp 0x3698a
movswq %si, %rdx
leaq 0x8954(%rip), %rax      # 0x3f2b6
jmp 0x3698a
movswq %si, %rdx
leaq 0x894a(%rip), %rax      # 0x3f2b9
jmp 0x3698a
movswl %di, %edi
movswl %si, %eax
imull $0x7, %eax, %eax
decl %edi
xorl %edx, %edx
divl %edi
movzbl %al, %edx
leaq 0x8933(%rip), %rax      # 0x3f2bd
addq %rdx, %rax
movzbl (%rax), %edx
movzbl %cl, %eax
imull %edx, %eax
shrl $0x8, %eax
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_line.c
// Function: line_init
static void line_init(line_draw_t * line, const lv_point_t * p1, const lv_point_t * p2)
{
    line->p1.x = p1->x;
    line->p1.y = p1->y;
    line->p2.x = p2->x;
    line->p2.y = p2->y;

    line->dx  = LV_MATH_ABS(line->p2.x - line->p1.x);
    line->sx  = line->p1.x < line->p2.x ? 1 : -1;
    line->dy  = LV_MATH_ABS(line->p2.y - line->p1.y);
    line->sy  = line->p1.y < line->p2.y ? 1 : -1;
    line->err = (line->dx > line->dy ? line->dx : -line->dy) / 2;
    line->e2  = 0;
    line->hor = line->dx > line->dy ? true : false; /*Rather horizontal or vertical*/

    line->p_act.x = line->p1.x;
    line->p_act.y = line->p1.y;
}

// Assembly:
movswl (%rsi), %ecx
movw %cx, (%rdi)
movswl 0x2(%rsi), %esi
movw %si, 0x2(%rdi)
movswl (%rdx), %r8d
movw %r8w, 0x4(%rdi)
movswl 0x2(%rdx), %edx
movw %dx, 0x6(%rdi)
movl %r8d, %r9d
subl %ecx, %r9d
movl %r9d, %eax
negl %eax
cmovsl %r9d, %eax
movw %ax, 0xc(%rdi)
xorl %r9d, %r9d
cmpw %r8w, %cx
setl %r9b
leal -0x1(,%r9,2), %r8d
movw %r8w, 0xe(%rdi)
movl %edx, %r8d
subl %esi, %r8d
movl %r8d, %r9d
negl %r9d
cmovsl %r8d, %r9d
movw %r9w, 0x10(%rdi)
xorl %r8d, %r8d
cmpw %dx, %si
setl %r8b
leal -0x1(,%r8,2), %edx
movw %dx, 0x12(%rdi)
movswl %r9w, %edx
movl %edx, %r8d
negl %r8d
cmpw %dx, %ax
cwtl
cmovlel %r8d, %eax
setg 0x18(%rdi)
pushq $0x2
popq %r8
cltd
idivl %r8d
movw %ax, 0x14(%rdi)
andw $0x0, 0x16(%rdi)
movw %cx, 0x8(%rdi)
movw %si, 0xa(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_line.c
// Function: line_next
static bool line_next(line_draw_t * line)
{
    if(line->p_act.x == line->p2.x && line->p_act.y == line->p2.y) return false;
    line->e2 = line->err;
    if(line->e2 > -line->dx) {
        line->err -= line->dy;
        line->p_act.x += line->sx;
    }
    if(line->e2 < line->dy) {
        line->err += line->dx;
        line->p_act.y += line->sy;
    }
    return true;
}

// Assembly:
movzwl 0x8(%rdi), %eax
cmpw 0x4(%rdi), %ax
jne 0x38146
movzwl 0xa(%rdi), %ecx
cmpw 0x6(%rdi), %cx
jne 0x38146
xorl %eax, %eax
retq
movswl 0x14(%rdi), %edx
movw %dx, 0x16(%rdi)
movswl 0xc(%rdi), %ecx
movl %ecx, %r9d
negl %r9d
movzwl 0x10(%rdi), %r8d
movl %edx, %esi
cmpl %r9d, %edx
jle 0x38175
movl %edx, %esi
subl %r8d, %esi
movw %si, 0x14(%rdi)
addw 0xe(%rdi), %ax
movw %ax, 0x8(%rdi)
movb $0x1, %al
cmpw %r8w, %dx
jge 0x38145
addl %ecx, %esi
movw %si, 0x14(%rdi)
movzwl 0x12(%rdi), %ecx
addw %cx, 0xa(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_img.c
// Function: lv_img_buf_set_palette
void lv_img_buf_set_palette(lv_img_dsc_t * dsc, uint8_t id, lv_color_t c)
{
    if((dsc->header.cf == LV_IMG_CF_ALPHA_1BIT && id > 1) || (dsc->header.cf == LV_IMG_CF_ALPHA_2BIT && id > 3) ||
       (dsc->header.cf == LV_IMG_CF_ALPHA_4BIT && id > 15) || (dsc->header.cf == LV_IMG_CF_ALPHA_8BIT)) {
        LV_LOG_WARN("lv_img_buf_set_px_alpha: invalid 'id'");
        return;
    }

    lv_color32_t c32;
    c32.full      = lv_color_to32(c);
    uint8_t * buf = (uint8_t *)dsc->data;
    memcpy(&buf[id * sizeof(c32)], &c32, sizeof(c32));
}

// Assembly:
movl (%rdi), %eax
andl $0x1f, %eax
cmpl $0xb, %eax
sete %cl
cmpb $0x2, %sil
setae %r8b
testb %cl, %r8b
jne 0x389a8
cmpl $0xc, %eax
sete %cl
cmpb $0x4, %sil
setae %r8b
testb %cl, %r8b
jne 0x389a8
cmpl $0xd, %eax
sete %cl
cmpb $0x10, %sil
setae %r8b
cmpl $0xe, %eax
je 0x389a8
andb %cl, %r8b
jne 0x389a8
movzwl %dx, %eax
movl %eax, %ecx
shrl $0xb, %ecx
imull $0x83800, %ecx, %ecx    # imm = 0x83800
shrl $0x5, %eax
andl $0x3f, %eax
andl $0x1f, %edx
imull $0x107, %edx, %edx      # imm = 0x107
addl $0x7, %edx
shrl $0x5, %edx
addl $0x3800, %ecx           # imm = 0x3800
andl $0x1ff0000, %ecx        # imm = 0x1FF0000
addl %edx, %ecx
imull $0x40c, %eax, %eax      # imm = 0x40C
addl $0xc, %eax
andl $0xff00, %eax           # imm = 0xFF00
addl %ecx, %eax
orl $0xff000000, %eax       # imm = 0xFF000000
movq 0x8(%rdi), %rcx
movzbl %sil, %edx
movl %eax, (%rcx,%rdx,4)
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_img.c
// Function: lv_img_buf_alloc
lv_img_dsc_t *lv_img_buf_alloc(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
{
    /* Allocate image descriptor */
    lv_img_dsc_t *dsc = lv_mem_alloc(sizeof(lv_img_dsc_t));
    if(dsc == NULL)
        return NULL;
    
    memset(dsc, 0, sizeof(lv_img_dsc_t));
    
    /* Get image data size */
    dsc->data_size = lv_img_buf_get_img_size(w, h, cf);
    if(dsc->data_size == 0) {
        lv_mem_free(dsc);
        return NULL;
    }
    
    /* Allocate raw buffer */
    dsc->data = lv_mem_alloc(dsc->data_size);
    if(dsc->data == NULL) {
        lv_mem_free(dsc);
        return NULL;
    }
    memset((uint8_t *)dsc->data, 0, dsc->data_size);
    
    /* Fill in header */
    dsc->header.always_zero = 0;
    dsc->header.w = w;
    dsc->header.h = h;
    dsc->header.cf = cf;
    return dsc;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movl %esi, %r15d
movl %edi, %r14d
pushq $0x10
popq %rdi
callq 0x279f9
testq %rax, %rax
je 0x38a74
movq %rax, %rbx
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movswl %r14w, %edi
movswl %r15w, %esi
movzbl %bpl, %edx
callq 0x38a84
movl %eax, 0x4(%rbx)
testl %eax, %eax
je 0x38a6c
movl %eax, %edi
callq 0x279f9
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x38a6c
movl 0x4(%rbx), %edx
movq %rax, %rdi
xorl %esi, %esi
callq 0x20a0
shll $0xa, %r14d
movl $0x300, %eax            # imm = 0x300
andl (%rbx), %eax
shll $0x15, %r15d
andl $0x1ffc00, %r14d        # imm = 0x1FFC00
orl %eax, %r14d
orl %r15d, %r14d
andb $0x1f, %bpl
movzbl %bpl, %eax
orl %r14d, %eax
movl %eax, (%rbx)
jmp 0x38a76
movq %rbx, %rdi
callq 0x27a7a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_img.c
// Function: lv_img_buf_get_img_size
uint32_t lv_img_buf_get_img_size(lv_coord_t w, lv_coord_t h, lv_img_cf_t cf)
{
    switch(cf) {
        case LV_IMG_CF_TRUE_COLOR: return LV_IMG_BUF_SIZE_TRUE_COLOR(w, h);
        case LV_IMG_CF_TRUE_COLOR_ALPHA: return LV_IMG_BUF_SIZE_TRUE_COLOR_ALPHA(w, h);
        case LV_IMG_CF_TRUE_COLOR_CHROMA_KEYED: return LV_IMG_BUF_SIZE_TRUE_COLOR_CHROMA_KEYED(w, h);
        case LV_IMG_CF_ALPHA_1BIT: return LV_IMG_BUF_SIZE_ALPHA_1BIT(w, h);
        case LV_IMG_CF_ALPHA_2BIT: return LV_IMG_BUF_SIZE_ALPHA_2BIT(w, h);
        case LV_IMG_CF_ALPHA_4BIT: return LV_IMG_BUF_SIZE_ALPHA_4BIT(w, h);
        case LV_IMG_CF_ALPHA_8BIT: return LV_IMG_BUF_SIZE_ALPHA_8BIT(w, h);
        case LV_IMG_CF_INDEXED_1BIT: return LV_IMG_BUF_SIZE_INDEXED_1BIT(w, h);
        case LV_IMG_CF_INDEXED_2BIT: return LV_IMG_BUF_SIZE_INDEXED_2BIT(w, h);
        case LV_IMG_CF_INDEXED_4BIT: return LV_IMG_BUF_SIZE_INDEXED_4BIT(w, h);
        case LV_IMG_CF_INDEXED_8BIT: return LV_IMG_BUF_SIZE_INDEXED_8BIT(w, h);
        default: return 0;
    }
}

// Assembly:
addl $-0x4, %edx
cmpl $0xa, %edx
ja 0x38b3e
leaq 0x68c9(%rip), %rax      # 0x3f360
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movswl %di, %ecx
movswl %si, %eax
imull %ecx, %eax
addl %eax, %eax
retq
movl %edi, %eax
cwtd
movw $0x4, %cx
idivw %cx
incl %eax
movswl %ax, %ecx
movswl %si, %eax
imull %ecx, %eax
addl $0x10, %eax
retq
movw $0x2, %cx
jmp 0x38b2b
movswl %di, %eax
movswl %si, %ecx
imull %eax, %ecx
leal (%rcx,%rcx,2), %eax
retq
movl %edi, %eax
cwtd
movw $0x8, %cx
idivw %cx
incl %eax
movswl %ax, %ecx
movswl %si, %eax
imull %ecx, %eax
addl $0x8, %eax
retq
movw $0x8, %cx
jmp 0x38b2b
movl %edi, %eax
cwtd
movw $0x2, %cx
idivw %cx
incl %eax
movswl %ax, %ecx
movswl %si, %eax
imull %ecx, %eax
addl $0x40, %eax
retq
movswl %di, %ecx
movswl %si, %eax
imull %ecx, %eax
addl $0x400, %eax            # imm = 0x400
retq
movswl %di, %ecx
jmp 0x38b37
movw $0x4, %cx
movl %edi, %eax
cwtd
idivw %cx
incl %eax
movswl %ax, %ecx
movswl %si, %eax
imull %ecx, %eax
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_img.c
// Function: lv_img_buf_free
void lv_img_buf_free(lv_img_dsc_t *dsc)
{
    if(dsc != NULL) {
        if(dsc->data != NULL)
            lv_mem_free(dsc->data);
        
        lv_mem_free(dsc);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x38b61
pushq %rbx
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
testq %rdi, %rdi
je 0x38b58
callq 0x27a7a
movq %rbx, %rdi
popq %rbx
jmp 0x27a7a
retq
nop
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_triangle.c
// Function: lv_draw_triangle
void lv_draw_triangle(const lv_point_t * points, const lv_area_t * mask, const lv_style_t * style, lv_opa_t opa_scale)
{
    /*Return if the triangle is degenerated*/
    if(points[0].x == points[1].x && points[0].y == points[1].y) return;
    if(points[1].x == points[2].x && points[1].y == points[2].y) return;
    if(points[0].x == points[2].x && points[0].y == points[2].y) return;

    if(points[0].x == points[1].x && points[1].x == points[2].x) return;
    if(points[0].y == points[1].y && points[1].y == points[2].y) return;

    lv_opa_t opa = opa_scale == LV_OPA_COVER ? style->body.opa : (uint16_t)((uint16_t)style->body.opa * opa_scale) >> 8;

    /*Is the triangle flat or tall?*/
    lv_coord_t x_min = LV_MATH_MIN(LV_MATH_MIN(points[0].x, points[1].x), points[2].x);
    lv_coord_t x_max = LV_MATH_MAX(LV_MATH_MAX(points[0].x, points[1].x), points[2].x);
    lv_coord_t y_min = LV_MATH_MIN(LV_MATH_MIN(points[0].y, points[1].y), points[2].y);
    lv_coord_t y_max = LV_MATH_MAX(LV_MATH_MAX(points[0].y, points[1].y), points[2].y);

    /* Draw the tall rectangles from vertical lines
     * and from the flat triangles from horizontal lines
     * to minimize the number of lines.
     * Some pixels are overdrawn on the common edges of the triangles
     * so use it only if the triangle has no opacity*/

    /* Draw from horizontal lines*/
    if(x_max - x_min < y_max - y_min) {
        tri_draw_tall(points, mask, style, opa);
    }
    /*Else flat so draw from vertical lines*/
    else {
        tri_draw_flat(points, mask, style, opa);
    }
}

// Assembly:
movzwl (%rdi), %r8d
movzwl 0x4(%rdi), %eax
cmpw %ax, %r8w
jne 0x39302
movzwl 0x2(%rdi), %r9d
cmpw 0x6(%rdi), %r9w
je 0x39343
movzwl 0x8(%rdi), %r10d
cmpw %r10w, %ax
jne 0x39319
movzwl 0x6(%rdi), %r9d
cmpw 0xa(%rdi), %r9w
je 0x39343
movzwl 0x2(%rdi), %r11d
cmpw %r10w, %r8w
jne 0x39331
cmpw %r10w, %ax
je 0x39343
cmpw 0xa(%rdi), %r11w
je 0x39343
movzwl 0x6(%rdi), %r9d
cmpw %r9w, %r11w
jne 0x39344
cmpw 0xa(%rdi), %r11w
jne 0x39344
retq
pushq %rbx
cmpb $-0x1, %cl
je 0x39359
movzbl %cl, %ebx
movzbl 0x8(%rdx), %ecx
imull %ebx, %ecx
shrl $0x8, %ecx
jmp 0x3935c
movb 0x8(%rdx), %cl
cmpw %ax, %r8w
movl %eax, %ebx
cmovll %r8d, %ebx
cmovgl %r8d, %eax
cmpw %r10w, %bx
cmovgel %r10d, %ebx
cmpw %r10w, %ax
cmovlel %r10d, %eax
cmpw %r9w, %r11w
movl %r9d, %r8d
cmovll %r11d, %r8d
cmovgl %r11d, %r9d
movzwl 0xa(%rdi), %r10d
cmpw %r10w, %r8w
cmovgel %r10d, %r8d
cmpw %r10w, %r9w
cmovlel %r10d, %r9d
cwtl
movswl %bx, %r10d
subl %r10d, %eax
movswl %r9w, %r9d
movswl %r8w, %r8d
subl %r8d, %r9d
cmpl %r9d, %eax
popq %rbx
movzbl %cl, %ecx
jl 0x393c3
jmp 0x3975a
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_draw_triangle.c
// Function: lv_draw_polygon
void lv_draw_polygon(const lv_point_t * points, uint32_t point_cnt, const lv_area_t * mask, const lv_style_t * style,
                     lv_opa_t opa_scale)
{
    if(point_cnt < 3) return;
    if(points == NULL) return;

    uint32_t i;
    lv_point_t tri[3];
    tri[0].x = points[0].x;
    tri[0].y = points[0].y;
    for(i = 0; i < point_cnt - 1; i++) {
        tri[1].x = points[i].x;
        tri[1].y = points[i].y;
        tri[2].x = points[i + 1].x;
        tri[2].y = points[i + 1].y;
        lv_draw_triangle(tri, mask, style, opa_scale);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %rbx
cmpl $0x3, %esi
setb %al
testq %rdi, %rdi
sete %cl
orb %al, %cl
je 0x39b99
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %r12
movl (%rdi), %eax
leaq 0xc(%rsp), %rcx
movl %eax, (%rcx)
decl %r15d
xorl %r13d, %r13d
movzbl %r8b, %ebp
cmpq %r13, %r15
je 0x39b8a
movq (%r12,%r13,4), %rax
incq %r13
movq %rax, 0x10(%rsp)
leaq 0xc(%rsp), %rdi
movq %r14, %rsi
movq %rbx, %rdx
movl %ebp, %ecx
callq 0x392e8
jmp 0x39bb5
nop
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_img_decoder.c
// Function: lv_img_decoder_init
void lv_img_decoder_init(void)
{
    lv_ll_init(&LV_GC_ROOT(_lv_img_defoder_ll), sizeof(lv_img_decoder_t));

    lv_img_decoder_t * decoder;

    /*Create a decoder for the built in color format*/
    decoder = lv_img_decoder_create();
    if(decoder == NULL) {
        LV_LOG_WARN("lv_img_decoder_init: out of memory");
        LV_ASSERT_MEM(decoder);
        return;
    }

    lv_img_decoder_set_info_cb(decoder, lv_img_decoder_built_in_info);
    lv_img_decoder_set_open_cb(decoder, lv_img_decoder_built_in_open);
    lv_img_decoder_set_read_line_cb(decoder, lv_img_decoder_built_in_read_line);
    lv_img_decoder_set_close_cb(decoder, lv_img_decoder_built_in_close);
}

// Assembly:
pushq %rax
leaq 0x2c9a4(%rip), %rdi     # 0x66588
pushq $0x20
popq %rsi
callq 0x27cf0
callq 0x39c40
testq %rax, %rax
je 0x39c23
leaq 0x88(%rip), %rcx        # 0x39c85
movq %rcx, (%rax)
leaq 0x14d(%rip), %rcx       # 0x39d54
movq %rcx, 0x8(%rax)
leaq 0x3ee(%rip), %rcx       # 0x3a000
movq %rcx, 0x10(%rax)
leaq 0x8bc(%rip), %rcx       # 0x3a4d9
movq %rcx, 0x18(%rax)
jmp 0x39c2e
xorl %edi, %edi
callq 0x7994
testb %al, %al
je 0x39c30
popq %rax
retq
leaq 0x1409(%rip), %rdi      # 0x3b040
xorl %esi, %esi
callq 0x7b01
jmp 0x39c3e
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_img_decoder.c
// Function: lv_img_decoder_create
lv_img_decoder_t * lv_img_decoder_create(void)
{
    lv_img_decoder_t * decoder;
    decoder = lv_ll_ins_head(&LV_GC_ROOT(_lv_img_defoder_ll));
    LV_ASSERT_MEM(decoder);
    if(decoder == NULL) return NULL;

    memset(decoder, 0, sizeof(lv_img_decoder_t));

    return decoder;
}

// Assembly:
pushq %rbx
leaq 0x2c940(%rip), %rdi     # 0x66588
callq 0x27d00
movq %rax, %rbx
movq %rax, %rdi
callq 0x7994
testb %al, %al
je 0x39c70
testq %rbx, %rbx
je 0x39c6b
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rbx)
movups %xmm0, (%rbx)
movq %rbx, %rax
popq %rbx
retq
leaq 0x13c9(%rip), %rdi      # 0x3b040
movq %rbx, %rsi
callq 0x7b01
jmp 0x39c7f
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_img_decoder.c
// Function: lv_img_decoder_built_in_info
lv_res_t lv_img_decoder_built_in_info(lv_img_decoder_t * decoder, const void * src, lv_img_header_t * header)
{
    (void)decoder; /*Unused*/

    lv_img_src_t src_type = lv_img_src_get_type(src);
    if(src_type == LV_IMG_SRC_VARIABLE) {
        lv_img_cf_t cf = ((lv_img_dsc_t *)src)->header.cf;
        if(cf < CF_BUILT_IN_FIRST || cf > CF_BUILT_IN_LAST) return LV_RES_INV;

        header->w  = ((lv_img_dsc_t *)src)->header.w;
        header->h  = ((lv_img_dsc_t *)src)->header.h;
        header->cf = ((lv_img_dsc_t *)src)->header.cf;
    }
#if LV_USE_FILESYSTEM
    else if(src_type == LV_IMG_SRC_FILE) {
        lv_fs_file_t file;
        lv_fs_res_t res;
        uint32_t rn;
        res = lv_fs_open(&file, src, LV_FS_MODE_RD);
        if(res == LV_FS_RES_OK) {
            res = lv_fs_read(&file, header, sizeof(lv_img_header_t), &rn);
            lv_fs_close(&file);
        }

        if(header->cf < CF_BUILT_IN_FIRST || header->cf > CF_BUILT_IN_LAST) return LV_RES_INV;

    }
#endif
    else if(src_type == LV_IMG_SRC_SYMBOL) {
        /*The size depend on the font but it is unknown here. It should be handled outside of the
         * function*/
        header->w = 1;
        header->h = 1;
        /* Symbols always have transparent parts. Important because of cover check in the design
         * function. The actual value doesn't matter because lv_draw_label will draw it*/
        header->cf = LV_IMG_CF_ALPHA_1BIT;
    } else {
        LV_LOG_WARN("Image get info found unknown src type");
        return LV_RES_INV;
    }
    return LV_RES_OK;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movq %rsi, %r14
movq %rsi, %rdi
callq 0x389cd
cmpb $0x2, %al
je 0x39d37
movzbl %al, %eax
cmpl $0x1, %eax
je 0x39cf3
testl %eax, %eax
jne 0x39cef
movl (%r14), %eax
movl %eax, %ecx
andl $0x1f, %ecx
addl $-0x4, %ecx
cmpl $0xa, %ecx
ja 0x39cef
andl $0x1ffc00, %eax         # imm = 0x1FFC00
movl $0xffe003ff, %ecx       # imm = 0xFFE003FF
andl (%rbx), %ecx
orl %eax, %ecx
movl %ecx, (%rbx)
movl $0xffe00000, %eax       # imm = 0xFFE00000
andl (%r14), %eax
andl $0x1fffff, %ecx         # imm = 0x1FFFFF
orl %eax, %ecx
movl %ecx, (%rbx)
movl (%r14), %eax
andl $0x1f, %eax
andl $-0x20, %ecx
orl %eax, %ecx
movl %ecx, (%rbx)
jmp 0x39d45
xorl %eax, %eax
jmp 0x39d47
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rdx
movq %r14, %rsi
callq 0x26de2
testb %al, %al
jne 0x39d27
leaq 0x8(%rsp), %r14
pushq $0x4
popq %rdx
leaq 0x4(%rsp), %rcx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x26fa2
movq %r14, %rdi
callq 0x26efa
movl (%rbx), %eax
andl $0x1f, %eax
addl $-0x4, %eax
cmpl $0xb, %eax
setb %al
jmp 0x39d47
movl $0x3e0, %eax            # imm = 0x3E0
andl (%rbx), %eax
orl $0x20040b, %eax         # imm = 0x20040B
movl %eax, (%rbx)
movb $0x1, %al
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O2/OnionIoT[P]lv_example/lvgl/src/lv_draw/lv_img_decoder.c
// Function: lv_img_decoder_built_in_close
void lv_img_decoder_built_in_close(lv_img_decoder_t * decoder, lv_img_decoder_dsc_t * dsc)
{
    (void)decoder; /*Unused*/

    lv_img_decoder_built_in_data_t * user_data = dsc->user_data;
    if(user_data) {
#if LV_USE_FILESYSTEM
        if(user_data->f) {
            lv_fs_close(user_data->f);
            lv_mem_free(user_data->f);
        }
#endif
        if(user_data->palette) lv_mem_free(user_data->palette);

        lv_mem_free(user_data);

        dsc->user_data = NULL;
    }
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x38(%rsi), %r14
testq %r14, %r14
je 0x3a519
movq %rsi, %rbx
movq (%r14), %rdi
testq %rdi, %rdi
je 0x3a4fe
callq 0x26efa
movq (%r14), %rdi
callq 0x27a7a
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x3a50c
callq 0x27a7a
movq %r14, %rdi
callq 0x27a7a
andq $0x0, 0x38(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq