// File: /workspace/github_c_makefile_star2_O0/lecram[P]congif/term.c
// Function: modeswitch
static void
modeswitch(Term *term, int private, int number, int value)
{
    if (private) {
        /* DEC modes */
        switch (number) {
        case 1:
            SWITCH(term, M_CURSORKEY, value);
            break;
        case 3:
            /* TODO: 80/132 columns mode switch */
            logfmt("NYI: DEC mode 3\n");
            break;
        case 5:
            SWITCH(term, M_REVERSE, value);
            break;
        case 6:
            SWITCH(term, M_ORIGIN, value);
            term->row = term->top;
            term->col = 0;
            break;
        case 7:
            SWITCH(term, M_AUTOWRAP, value);
            break;
        case 8:
            SWITCH(term, M_AUTORPT, value);
            break;
        case 9:
            SWITCH(term, M_MOUSEX10, value);
            break;
        case 25:
            SWITCH(term, M_CURSORVIS, value);
            break;
        case 1000:
            SWITCH(term, M_MOUSEX11, value);
            break;
        default:
            logfmt("UNS: DEC mode %d\n", number);
        }
    } else {
        /* ANSI modes */
        switch (number) {
        case 3:
            SWITCH(term, M_DISPCTRL, value);
            break;
        case 4:
            SWITCH(term, M_INSERT, value);
            break;
        case 20:
            SWITCH(term, M_NEWLINE, value);
            break;
        default:
            logfmt("UNS: ANSI mode %d\n", number);
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x3dc9
movl -0x10(%rbp), %eax
movl %eax, -0x18(%rbp)
subl $0x1, %eax
je 0x3bc1
jmp 0x3b4c
movl -0x18(%rbp), %eax
subl $0x3, %eax
je 0x3bf8
jmp 0x3b5a
movl -0x18(%rbp), %eax
subl $0x5, %eax
je 0x3c0b
jmp 0x3b68
movl -0x18(%rbp), %eax
subl $0x6, %eax
je 0x3c42
jmp 0x3b76
movl -0x18(%rbp), %eax
subl $0x7, %eax
je 0x3c92
jmp 0x3b84
movl -0x18(%rbp), %eax
subl $0x8, %eax
je 0x3ccd
jmp 0x3b92
movl -0x18(%rbp), %eax
subl $0x9, %eax
je 0x3d08
jmp 0x3ba0
movl -0x18(%rbp), %eax
subl $0x19, %eax
je 0x3d43
jmp 0x3bae
movl -0x18(%rbp), %eax
subl $0x3e8, %eax            # imm = 0x3E8
je 0x3d7b
jmp 0x3db3
cmpl $0x0, -0x14(%rbp)
je 0x3bd7
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x8, %eax
movl %eax, -0x1c(%rbp)
jmp 0x3be5
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $-0x9, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
leaq 0x3b26(%rip), %rdi      # 0x7725
movb $0x0, %al
callq 0x2220
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3c21
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x20, %eax
movl %eax, -0x20(%rbp)
jmp 0x3c2f
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $-0x21, %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3c58
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x40, %eax
movl %eax, -0x24(%rbp)
jmp 0x3c66
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $-0x41, %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0xc(%rax)
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3caa
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x80, %eax
movl %eax, -0x28(%rbp)
jmp 0x3cba
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $0xffffff7f, %eax       # imm = 0xFFFFFF7F
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3ce5
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x100, %eax            # imm = 0x100
movl %eax, -0x2c(%rbp)
jmp 0x3cf5
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $0xfffffeff, %eax       # imm = 0xFFFFFEFF
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3d20
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x200, %eax            # imm = 0x200
movl %eax, -0x30(%rbp)
jmp 0x3d30
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $0xfffffdff, %eax       # imm = 0xFFFFFDFF
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3d5b
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x400, %eax            # imm = 0x400
movl %eax, -0x34(%rbp)
jmp 0x3d6b
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $0xfffffbff, %eax       # imm = 0xFFFFFBFF
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
cmpl $0x0, -0x14(%rbp)
je 0x3d93
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x800, %eax            # imm = 0x800
movl %eax, -0x38(%rbp)
jmp 0x3da3
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $0xfffff7ff, %eax       # imm = 0xFFFFF7FF
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3dc4
movl -0x10(%rbp), %esi
leaq 0x3979(%rip), %rdi      # 0x7736
movb $0x0, %al
callq 0x2220
jmp 0x3e9c
movl -0x10(%rbp), %eax
movl %eax, -0x3c(%rbp)
subl $0x3, %eax
je 0x3ded
jmp 0x3dd6
movl -0x3c(%rbp), %eax
subl $0x4, %eax
je 0x3e21
jmp 0x3de0
movl -0x3c(%rbp), %eax
subl $0x14, %eax
je 0x3e55
jmp 0x3e89
cmpl $0x0, -0x14(%rbp)
je 0x3e03
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x1, %eax
movl %eax, -0x40(%rbp)
jmp 0x3e11
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $-0x2, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3e9a
cmpl $0x0, -0x14(%rbp)
je 0x3e37
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x2, %eax
movl %eax, -0x44(%rbp)
jmp 0x3e45
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $-0x3, %eax
movl %eax, -0x44(%rbp)
movl -0x44(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3e9a
cmpl $0x0, -0x14(%rbp)
je 0x3e6b
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
orl $0x4, %eax
movl %eax, -0x48(%rbp)
jmp 0x3e79
movq -0x8(%rbp), %rax
movzwl 0x18(%rax), %eax
andl $-0x5, %eax
movl %eax, -0x48(%rbp)
movl -0x48(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x18(%rax)
jmp 0x3e9a
movl -0x10(%rbp), %esi
leaq 0x38b5(%rip), %rdi      # 0x7748
movb $0x0, %al
callq 0x2220
jmp 0x3e9c
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)