// File: /workspace/github_c_makefile_star2_O0/stetre[P]moonfreetype/src/bitmap.c
// Function: moonfreetype_pushbitmapdata
int pushbitmapdata(lua_State *L, FT_Bitmap bitmap, FT_Int left, FT_Int top, int leftandtop)
/* pushes bitmap contents in a table */
    {
    size_t len; 
    lua_newtable(L);
    if(leftandtop)
        {
        lua_pushinteger(L, left);
        lua_setfield(L, -2, "left");
        lua_pushinteger(L, top);
        lua_setfield(L, -2, "top");
        }
    lua_pushinteger(L, bitmap.rows);
    lua_setfield(L, -2, "rows");
    lua_pushinteger(L, bitmap.width);
    lua_setfield(L, -2, "width");
    lua_pushinteger(L, bitmap.pitch);
    lua_setfield(L, -2, "pitch");
    pushpixelmode(L, bitmap.pixel_mode);
    lua_setfield(L, -2, "pixel_mode");
    if(bitmap.pixel_mode == FT_PIXEL_MODE_GRAY)
        {
        lua_pushinteger(L, bitmap.num_grays); 
        lua_setfield(L, -2, "num_grays");
        }
    len = bitmap.rows * (FT_ULong)bitmap.pitch; /* +/- buffer length */
    if(len)
        {
        len = len > 0 ? len : -len; /* pich may be negative */
        lua_pushlstring(L, (char*)bitmap.buffer, len);
        lua_setfield(L, -2, "buffer");
        }
    /* palette_mode: not used currently 
     * palette:      not used currently 
     */
    return 1;
    }

// Assembly:
subq $0x38, %rsp
leaq 0x40(%rsp), %rax
movq %rax, 0x10(%rsp)
movq %rdi, 0x30(%rsp)
movl %esi, 0x2c(%rsp)
movl %edx, 0x28(%rsp)
movl %ecx, 0x24(%rsp)
movq 0x30(%rsp), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x73d0
cmpl $0x0, 0x24(%rsp)
je 0x829e
movq 0x30(%rsp), %rdi
movslq 0x2c(%rsp), %rsi
callq 0x7540
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x113af(%rip), %rdx     # 0x19623
callq 0x74f0
movq 0x30(%rsp), %rdi
movslq 0x28(%rsp), %rsi
callq 0x7540
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x10de9(%rip), %rdx     # 0x19082
callq 0x74f0
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rdi
movl (%rax), %eax
movl %eax, %esi
callq 0x7540
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x10dc4(%rip), %rdx     # 0x19086
callq 0x74f0
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rdi
movl 0x4(%rax), %eax
movl %eax, %esi
callq 0x7540
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x12d24(%rip), %rdx     # 0x1b010
callq 0x74f0
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rdi
movslq 0x8(%rax), %rsi
callq 0x7540
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x10d76(%rip), %rdx     # 0x1908b
callq 0x74f0
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rdi
movzbl 0x1a(%rax), %edx
movl $0xc, %esi
callq 0x7280
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x10d4e(%rip), %rdx     # 0x19091
callq 0x74f0
movq 0x10(%rsp), %rax
movzbl 0x1a(%rax), %eax
cmpl $0x2, %eax
jne 0x8381
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rdi
movzwl 0x18(%rax), %eax
movl %eax, %esi
callq 0x7540
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x10d20(%rip), %rdx     # 0x1909c
callq 0x74f0
movq 0x10(%rsp), %rcx
movl (%rcx), %eax
movslq 0x8(%rcx), %rcx
imulq %rcx, %rax
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0x83f5
cmpq $0x0, 0x18(%rsp)
jbe 0x83b1
movq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
jmp 0x83bd
xorl %eax, %eax
subq 0x18(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x10(%rsp), %rax
movq 0x8(%rsp), %rcx
movq %rcx, 0x18(%rsp)
movq 0x30(%rsp), %rdi
movq 0x10(%rax), %rsi
movq 0x18(%rsp), %rdx
callq 0x7970
movq 0x30(%rsp), %rdi
movl $0xfffffffe, %esi       # imm = 0xFFFFFFFE
leaq 0x10cb6(%rip), %rdx     # 0x190a6
callq 0x74f0
movl $0x1, %eax
addq $0x38, %rsp
retq
nop