// File: /workspace/github_c_makefile_star2_O1/lecram[P]congif/mbf2c.c
// Function: main
int
main(int argc, char *argv[])
{
    Font *font;
    int i;

    if (argc != 2) {
        fprintf(stderr, "Usage: %s font.mbf\n", argv[0]);
        return 1;
    }
    font = load_font(argv[1]);
    if (font == NULL) {
        fprintf(stderr, "Failed to load font '%s'.\n", argv[1]);
        return 1;
    }

    printf("static Range "FN"_ranges[%d] = {\n", font->header.nr);
    for(i=0; i<font->header.nr; i++) {
        printf("    { %d, %d }%s\n",
            (int) font->ranges[i].offset,
            (int) font->ranges[i].length,
            i+1 == font->header.nr?"":",");
    }
    printf("};\n\n");

    printf("static uint8_t "FN"_data[] = {\n");
    for (i = 0; i < font->header.ng * font->stride * font->header.h; i++) {
        if (i%12 == 0) {
            if (i) printf(",\n");
            printf("    ");
        } else
            printf(", ");
        printf("0x%02x", font->data[i]);
    }
    printf("\n};\n\n");

    printf("Font "FN"[1] = {{ ");

    printf("{ %d, %d, %d, %d }, ",
        (int) font->header.ng,
        (int) font->header.w,
        (int) font->header.h,
        (int) font->header.nr);

    printf("%d, "FN"_ranges, "FN"_data }};\n",
        (int) font->stride);

    free(font);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
cmpl $0x2, %edi
jne 0x153e
movq 0x8(%r14), %rdi
callq 0x11ec
testq %rax, %rax
je 0x1548
movq %rax, %rbx
movzwl 0x4(%rax), %esi
leaq 0xc64(%rip), %rdi       # 0x2033
xorl %eax, %eax
callq 0x1050
movzwl 0x4(%rbx), %eax
testw %ax, %ax
je 0x1429
leaq 0xc4c(%rip), %r15       # 0x2032
leaq 0xd1a(%rip), %r12       # 0x2107
leaq 0xc69(%rip), %r14       # 0x205d
xorl %r13d, %r13d
movq 0x10(%rbx), %rcx
movzwl (%rcx,%r13,4), %esi
movzwl 0x2(%rcx,%r13,4), %edx
incq %r13
movzwl %ax, %eax
cmpq %rax, %r13
movq %r12, %rcx
cmoveq %r15, %rcx
movq %r14, %rdi
xorl %eax, %eax
callq 0x1050
movzwl 0x4(%rbx), %eax
cmpq %rax, %r13
jb 0x13f7
leaq 0xcd3(%rip), %rdi       # 0x2103
callq 0x1040
leaq 0xc9f(%rip), %rdi       # 0x20db
callq 0x1040
movzwl (%rbx), %eax
imull 0x8(%rbx), %eax
movzbl 0x3(%rbx), %ecx
imull %eax, %ecx
testl %ecx, %ecx
jle 0x14da
movl $0xaaaaaaab, %r12d      # imm = 0xAAAAAAAB
leaq 0xc44(%rip), %r13       # 0x20a8
leaq 0xc04(%rip), %rbp       # 0x206f
leaq 0xc02(%rip), %r15       # 0x2074
xorl %r14d, %r14d
movl %r14d, %eax
imulq %r12, %rax
shrq $0x23, %rax
shll $0x2, %eax
leal (%rax,%rax,2), %eax
movq %r13, %rdi
cmpl %eax, %r14d
jne 0x14a5
movq %rbp, %rdi
testq %r14, %r14
je 0x14a5
leaq 0xc6a(%rip), %rdi       # 0x2107
callq 0x1040
movq %rbp, %rdi
xorl %eax, %eax
callq 0x1050
movq 0x18(%rbx), %rax
movzbl (%rax,%r14), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1050
incq %r14
movzwl (%rbx), %eax
movslq 0x8(%rbx), %rcx
imulq %rax, %rcx
movzbl 0x3(%rbx), %eax
imulq %rcx, %rax
cmpq %rax, %r14
jl 0x1475
leaq 0xc21(%rip), %rdi       # 0x2102
callq 0x1040
leaq 0xb8e(%rip), %rdi       # 0x207b
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x1050
movzwl (%rbx), %esi
movzbl 0x2(%rbx), %edx
movzbl 0x3(%rbx), %ecx
movzwl 0x4(%rbx), %r8d
leaq 0xb89(%rip), %rdi       # 0x2096
xorl %eax, %eax
callq 0x1050
movl 0x8(%rbx), %esi
leaq 0xb8d(%rip), %rdi       # 0x20ab
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x10c0
jmp 0x1554
addq $0x8, %r14
movq %r14, %rdi
callq 0x10de
movl $0x1, %ebp
jmp 0x152d