// File: /workspace/github_c_makefile_star2_O0/adelciotto[P]scg/examples/image.c
// Function: draw
static void draw(scg_image_t *draw_target, scg_image_t *image) {
    int w = draw_target->width;
    int h = draw_target->height;
    int img_w = image->width;
    int img_h = image->height;
    int center_image_x = w / 2 - img_w / 2;
    int center_image_y = h / 2 - img_h / 2;
    int image_blend_none_x = center_image_x - img_w - 32;
    int image_blend_alpha_x = center_image_x;
    int image_blend_mask_x = center_image_x + img_w + 32;

    scg_pixel_t clear_color = SCG_COLOR_95_GREEN;
    scg_pixel_t text_color = SCG_COLOR_WHITE;

    scg_image_clear(draw_target, clear_color);

    scg_image_draw_string(draw_target, "NONE", image_blend_none_x + img_w / 2,
                          center_image_y + img_h + 16, 1, text_color);
    scg_image_draw_string(draw_target, "ALPHA", image_blend_alpha_x + img_w / 2,
                          center_image_y + img_h + 16, 1, text_color);
    scg_image_draw_string(draw_target, "MASK", image_blend_mask_x + img_w / 2,
                          center_image_y + img_h + 16, 1, text_color);

    scg_image_set_blend_mode(draw_target, SCG_BLEND_MODE_NONE);
    scg_image_draw_image(draw_target, image, image_blend_none_x,
                         center_image_y);

    scg_image_set_blend_mode(draw_target, SCG_BLEND_MODE_ALPHA);
    scg_image_draw_image(draw_target, image, image_blend_alpha_x,
                         center_image_y);

    scg_image_set_blend_mode(draw_target, SCG_BLEND_MODE_MASK);
    scg_image_draw_image(draw_target, image, image_blend_mask_x,
                         center_image_y);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x50(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x50(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x24(%rbp)
movl -0x18(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x4c(%rbp)
movl -0x20(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl -0x4c(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x28(%rbp)
movl -0x24(%rbp), %eax
subl -0x1c(%rbp), %eax
subl $0x20, %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x24(%rbp), %eax
addl -0x1c(%rbp), %eax
addl $0x20, %eax
movl %eax, -0x34(%rbp)
movl 0x7dc(%rip), %eax       # 0x703c
movl %eax, -0x38(%rbp)
movl 0x7d7(%rip), %eax       # 0x7040
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
movl -0x38(%rbp), %esi
callq 0x3100
movq -0x8(%rbp), %rdi
movl -0x2c(%rbp), %eax
movl %eax, -0x48(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x48(%rbp), %edx
addl %eax, %edx
movl -0x28(%rbp), %ecx
addl -0x20(%rbp), %ecx
addl $0x10, %ecx
movl -0x3c(%rbp), %r9d
leaq 0x190c(%rip), %rsi      # 0x81b2
movl $0x1, %r8d
callq 0x4190
movq -0x8(%rbp), %rdi
movl -0x30(%rbp), %eax
movl %eax, -0x44(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x44(%rbp), %edx
addl %eax, %edx
movl -0x28(%rbp), %ecx
addl -0x20(%rbp), %ecx
addl $0x10, %ecx
movl -0x3c(%rbp), %r9d
leaq 0x18d8(%rip), %rsi      # 0x81b7
movl $0x1, %r8d
callq 0x4190
movq -0x8(%rbp), %rdi
movl -0x34(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x1c(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl -0x40(%rbp), %edx
addl %eax, %edx
movl -0x28(%rbp), %ecx
addl -0x20(%rbp), %ecx
addl $0x10, %ecx
movl -0x3c(%rbp), %r9d
leaq 0x18a5(%rip), %rsi      # 0x81bd
movl $0x1, %r8d
callq 0x4190
movq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0x2ec0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x2c(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x3150
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x2ec0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x30(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x3150
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x2ec0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x34(%rbp), %edx
movl -0x28(%rbp), %ecx
callq 0x3150
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)