// File: /workspace/github_c_makefile_star2_O0/termbox[P]termbox/termbox.c
// Function: init_term_builtin
static int init_term_builtin(void) {
    int i;
    const char *term = getenv("TERM");

    if (term) {
        for (i = 0; terms[i].name; i++) {
            if (!strcmp(terms[i].name, term)) {
                keys = terms[i].keys;
                funcs = terms[i].funcs;
                return 0;
            }
        }

        /* let's do some heuristic, maybe it's a compatible terminal */
        if (try_compatible(term, "xterm", xterm_keys, xterm_funcs) == 0)
            return 0;
        if (try_compatible(term, "rxvt", rxvt_unicode_keys,
                           rxvt_unicode_funcs) == 0)
            return 0;
        if (try_compatible(term, "linux", linux_keys, linux_funcs) == 0)
            return 0;
        if (try_compatible(term, "Eterm", eterm_keys, eterm_funcs) == 0)
            return 0;
        if (try_compatible(term, "screen", screen_keys, screen_funcs) == 0)
            return 0;
        if (try_compatible(term, "tmux", screen_keys, screen_funcs) == 0)
            return 0;
        /* let's assume that 'cygwin' is xterm compatible */
        if (try_compatible(term, "cygwin", xterm_keys, xterm_funcs) == 0)
            return 0;
    }

    return EUNSUPPORTED_TERM;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x202e(%rip), %rdi      # 0x715d
callq 0x3030
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x531d
movl $0x0, -0x8(%rbp)
movslq -0x8(%rbp), %rcx
leaq 0x500b(%rip), %rax      # 0xa160
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x51db
movslq -0x8(%rbp), %rcx
leaq 0x4ff3(%rip), %rax      # 0xa160
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x3150
cmpl $0x0, %eax
jne 0x51cb
movslq -0x8(%rbp), %rcx
leaq 0x4fd0(%rip), %rax      # 0xa160
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rax
movq %rax, 0x583e(%rip)      # 0xa9e0
movslq -0x8(%rbp), %rcx
leaq 0x4fb3(%rip), %rax      # 0xa160
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movq %rax, 0x57e9(%rip)      # 0xa9a8
movl $0x0, -0x4(%rbp)
jmp 0x5324
jmp 0x51cd
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x514a
movq -0x10(%rbp), %rdi
leaq 0x1fd0(%rip), %rsi      # 0x71b6
leaq 0x5023(%rip), %rdx      # 0xa210
leaq 0x50dc(%rip), %rcx      # 0xa2d0
callq 0x5560
cmpl $0x0, %eax
jne 0x520a
movl $0x0, -0x4(%rbp)
jmp 0x5324
movq -0x10(%rbp), %rdi
leaq 0x1fa7(%rip), %rsi      # 0x71bc
leaq 0x5124(%rip), %rdx      # 0xa340
leaq 0x51dd(%rip), %rcx      # 0xa400
callq 0x5560
cmpl $0x0, %eax
jne 0x5239
movl $0x0, -0x4(%rbp)
jmp 0x5324
movq -0x10(%rbp), %rdi
leaq 0x1f7d(%rip), %rsi      # 0x71c1
leaq 0x5225(%rip), %rdx      # 0xa470
leaq 0x52de(%rip), %rcx      # 0xa530
callq 0x5560
cmpl $0x0, %eax
jne 0x5268
movl $0x0, -0x4(%rbp)
jmp 0x5324
movq -0x10(%rbp), %rdi
leaq 0x1f54(%rip), %rsi      # 0x71c7
leaq 0x5326(%rip), %rdx      # 0xa5a0
leaq 0x53df(%rip), %rcx      # 0xa660
callq 0x5560
cmpl $0x0, %eax
jne 0x5297
movl $0x0, -0x4(%rbp)
jmp 0x5324
movq -0x10(%rbp), %rdi
leaq 0x1f2b(%rip), %rsi      # 0x71cd
leaq 0x5427(%rip), %rdx      # 0xa6d0
leaq 0x54e0(%rip), %rcx      # 0xa790
callq 0x5560
cmpl $0x0, %eax
jne 0x52c3
movl $0x0, -0x4(%rbp)
jmp 0x5324
movq -0x10(%rbp), %rdi
leaq 0x1f06(%rip), %rsi      # 0x71d4
leaq 0x53fb(%rip), %rdx      # 0xa6d0
leaq 0x54b4(%rip), %rcx      # 0xa790
callq 0x5560
cmpl $0x0, %eax
jne 0x52ef
movl $0x0, -0x4(%rbp)
jmp 0x5324
movq -0x10(%rbp), %rdi
leaq 0x1edf(%rip), %rsi      # 0x71d9
leaq 0x4f0f(%rip), %rdx      # 0xa210
leaq 0x4fc8(%rip), %rcx      # 0xa2d0
callq 0x5560
cmpl $0x0, %eax
jne 0x531b
movl $0x0, -0x4(%rbp)
jmp 0x5324
jmp 0x531d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)