// File: /workspace/github_c_makefile_star2_O0/skeeto[P]goblin-com/src/map.c
// Function: base_font
static font_t
base_font(enum map_base base, int x, int y)
{
    font_t font;
    switch (base) {
    case BASE_OCEAN:
        font = FONT(B, b);
        break;
    case BASE_COAST: {
        font = FONT(w, b);
        float dx = (x / (float)MAP_WIDTH) - 0.5;
        float dy = (y / (float)MAP_HEIGHT) - 0.5;
        dx *= 1.3;
        float dist = sqrt(dx * dx + dy * dy) * 100;
        float offset = fmod(device_uepoch() / 500000.0, PI * 2);
        font.fore_bright = sinf(dist + offset) < 0 ? true : false;
    } break;
    case BASE_GRASSLAND:
        font = FONT(G, g);
        break;
    case BASE_FOREST:
        font = FONT(G, g);
        break;
    case BASE_HILL:
        font = FONT(K, g);
        break;
    case BASE_MOUNTAIN:
        font = FONT(w, g);
        break;
    case BASE_SAND:
        font = FONT(Y, Y);
        break;
    }
    return font;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0x8(%rbp), %eax
movl %eax, -0x40(%rbp)
subl $0x20, %eax
je 0x5fa9
jmp 0x5f4e
movl -0x40(%rbp), %eax
subl $0x2e, %eax
je 0x60f5
jmp 0x5f5c
movl -0x40(%rbp), %eax
subl $0x3a, %eax
je 0x6155
jmp 0x5f6a
movl -0x40(%rbp), %eax
subl $0x2229, %eax           # imm = 0x2229
je 0x6125
jmp 0x5f7a
movl -0x40(%rbp), %eax
subl $0x2248, %eax           # imm = 0x2248
je 0x5fc4
jmp 0x5f86
movl -0x40(%rbp), %eax
subl $0x25b2, %eax           # imm = 0x25B2
je 0x613d
jmp 0x5f96
movl -0x40(%rbp), %eax
subl $0x2663, %eax           # imm = 0x2663
je 0x610d
jmp 0x616b
movb $0x4, -0x14(%rbp)
movb $0x4, -0x13(%rbp)
movb $0x1, -0x12(%rbp)
movb $0x0, -0x11(%rbp)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x616b
movb $0x7, -0x18(%rbp)
movb $0x4, -0x17(%rbp)
movb $0x0, -0x16(%rbp)
movb $0x0, -0x15(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0x4(%rbp)
cvtsi2ssl -0xc(%rbp), %xmm0
movss 0x3979(%rip), %xmm1     # 0x9960
divss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x38f9(%rip), %xmm1     # 0x98f0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
cvtsi2ssl -0x10(%rbp), %xmm0
movss 0x3953(%rip), %xmm2     # 0x9964
divss %xmm2, %xmm0
cvtss2sd %xmm0, %xmm0
subsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x20(%rbp)
movss -0x1c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x3901(%rip), %xmm1     # 0x9938
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x1c(%rbp)
movss -0x1c(%rbp), %xmm0
movss -0x20(%rbp), %xmm1
mulss %xmm1, %xmm1
mulss %xmm0, %xmm0
addss %xmm1, %xmm0
cvtss2sd %xmm0, %xmm0
callq 0x1270
movsd 0x38d5(%rip), %xmm1     # 0x9940
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x24(%rbp)
callq 0x8cb0
movq %rax, %xmm0
movaps 0x38e7(%rip), %xmm1     # 0x9970
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x38eb(%rip), %xmm1     # 0x9980
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd 0x3884(%rip), %xmm1     # 0x9930
divsd %xmm1, %xmm0
movsd 0x3870(%rip), %xmm1     # 0x9928
callq 0x1150
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x28(%rbp)
movss -0x24(%rbp), %xmm0
addss -0x28(%rbp), %xmm0
callq 0x1120
movaps %xmm0, %xmm1
xorps %xmm0, %xmm0
xorl %eax, %eax
movl $0x1, %ecx
ucomiss %xmm1, %xmm0
cmoval %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x2(%rbp)
jmp 0x616b
movb $0x2, -0x2c(%rbp)
movb $0x2, -0x2b(%rbp)
movb $0x1, -0x2a(%rbp)
movb $0x0, -0x29(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x616b
movb $0x2, -0x30(%rbp)
movb $0x2, -0x2f(%rbp)
movb $0x1, -0x2e(%rbp)
movb $0x0, -0x2d(%rbp)
movl -0x30(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x616b
movb $0x0, -0x34(%rbp)
movb $0x2, -0x33(%rbp)
movb $0x1, -0x32(%rbp)
movb $0x0, -0x31(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x616b
movb $0x7, -0x38(%rbp)
movb $0x2, -0x37(%rbp)
movb $0x0, -0x36(%rbp)
movb $0x0, -0x35(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x616b
movb $0x3, -0x3c(%rbp)
movb $0x3, -0x3b(%rbp)
movb $0x1, -0x3a(%rbp)
movb $0x1, -0x39(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)