LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/storage/storage.c
// Function: box_draw
static void box_draw(int pattern, int start_y, int start_x,
  int size_y, int size_x)
{
  int y, x;
  for (y = 0; y < size_y; y++) {
    for (x = 0; x < size_x; x++) {
      if ((pattern % 14) > 6) {
        wattrset(stdscr, A_BOLD | COLOR_PAIR((pattern % 7) + 1));
      } else {
        wattrset(stdscr, COLOR_PAIR((pattern % 7) + 1));
      }
      mvaddch(start_y + y, start_x + x, pattern + 0x41);
    }
  }
  refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl %r8d, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x189b
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x188b
movl -0x4(%rbp), %eax
movl $0xe, %ecx
cltd
idivl %ecx
cmpl $0x6, %edx
jle 0x181e
movq 0x27e3(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
movl -0x4(%rbp), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, %esi
addl $0x1, %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
jmp 0x1846
movq 0x27b3(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
movl -0x4(%rbp), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, %esi
addl $0x1, %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
callq 0x1040
movq 0x278b(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
movl -0x8(%rbp), %esi
addl -0x18(%rbp), %esi
movl -0xc(%rbp), %edx
addl -0x1c(%rbp), %edx
callq 0x1100
cmpl $-0x1, %eax
jne 0x1868
jmp 0x187d
movq 0x2769(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
movl -0x4(%rbp), %esi
addl $0x41, %esi
callq 0x1120
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x17d2
jmp 0x188d
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x17bf
movq 0x2736(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x10a0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/kobolt[P]curses-collection/storage/storage.c
// Function: text_draw
static void text_draw(int pattern, char *text, int y, int x)
{
  if ((pattern % 14) > 6) {
    wattrset(stdscr, A_BOLD | COLOR_PAIR((pattern % 7) + 1));
  } else {
    wattrset(stdscr, COLOR_PAIR((pattern % 7) + 1));
  }
  mvprintw(y, x, "%c:%s", pattern + 0x41, text);
  refresh();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl %ecx, -0x18(%rbp)
movl -0x4(%rbp), %eax
movl $0xe, %ecx
cltd
idivl %ecx
cmpl $0x6, %edx
jle 0x1905
movq 0x26fc(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
movl -0x4(%rbp), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, %esi
addl $0x1, %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
orl $0x200000, %esi         # imm = 0x200000
callq 0x1040
jmp 0x192d
movq 0x26cc(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
movl -0x4(%rbp), %eax
movl $0x7, %ecx
cltd
idivl %ecx
movl %edx, %esi
addl $0x1, %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
callq 0x1040
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
movl -0x4(%rbp), %ecx
addl $0x41, %ecx
movq -0x10(%rbp), %r8
leaq 0x6ca(%rip), %rdx       # 0x200e
movb $0x0, %al
callq 0x10d0
movq 0x2686(%rip), %rax      # 0x3fd8
movq (%rax), %rdi
callq 0x10a0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/diaxen[P]fft-garden/./twiddles.h
// Function: get_twiddle_mr
static inline complex double
get_twiddle_mr(unsigned i, unsigned log2_N)
{
  complex double tw = get_twiddle(i, log2_N);
#if defined(SHORT_TW)
  if (i >> (log2_N - 1))
    tw = -tw;
#endif
  return tw;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x14(%rbp)
movl %esi, -0x18(%rbp)
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
callq 0x2f00
movsd %xmm0, -0x28(%rbp)
movsd %xmm1, -0x20(%rbp)
movl -0x14(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
shrl %cl, %eax
cmpl $0x0, %eax
je 0x3055
movsd -0x28(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm0
movsd %xmm1, -0x28(%rbp)
movsd %xmm0, -0x20(%rbp)
movsd -0x28(%rbp), %xmm1
movsd -0x20(%rbp), %xmm0
movsd %xmm1, -0x10(%rbp)
movsd %xmm0, -0x8(%rbp)
movsd -0x10(%rbp), %xmm0
movsd -0x8(%rbp), %xmm1
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/example/HelloWorld/HelloWorld.cpp
// Function: main
int main()
{
    arduboy2 arduboy;

    arduboy.printString("Hello World\n");

    arduboy << "So Greatgg帆帆帆帆SS!\n";
    arduboy << "So dfdfdff!\n";
    arduboy.drawRect(20, 0, 50, 50, 1);
    arduboy.display();
    usleep(30*1000);
    arduboy.clear(0);
    

    // done
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq -0x20(%rbp), %rdi
callq 0x1460
leaq -0x18(%rbp), %rdi
leaq 0x2c88(%rip), %rsi      # 0x4004
callq 0x15f0
jmp 0x1383
leaq -0x18(%rbp), %rdi
leaq 0x2c83(%rip), %rsi      # 0x4011
callq 0x1980
jmp 0x1395
leaq -0x18(%rbp), %rdi
leaq 0x2c8c(%rip), %rsi      # 0x402c
callq 0x1980
jmp 0x13a7
leaq -0x18(%rbp), %rdi
movl $0x14, %esi
xorl %edx, %edx
movl $0x32, %r8d
movl $0x1, %r9d
movl %r8d, %ecx
callq 0x1b20
jmp 0x13c8
leaq -0x18(%rbp), %rdi
callq 0x3050
jmp 0x13d3
movl $0x7530, %edi           # imm = 0x7530
callq 0x1130
jmp 0x13df
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x3010
jmp 0x13ec
leaq -0x20(%rbp), %rdi
callq 0x1420
xorl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x28(%rbp)
movl %eax, -0x2c(%rbp)
leaq -0x20(%rbp), %rdi
callq 0x1420
movq -0x28(%rbp), %rdi
callq 0x1150
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/arduboy2/graph.cpp
// Function: graph::printChar(int, int, char)
void graph::printChar(int x, int y, char ch)
{
    unsigned char temp = (ch - 32), col;
    for(int i=0; i<6; i++) {
        col = ASCII_6X8[temp][i];
        for(int j=0; j<8; j++)
            drawPixel(x+i,y+j, col & (1<<j));
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movsbl -0x11(%rbp), %eax
subl $0x20, %eax
movb %al, -0x12(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x6, -0x18(%rbp)
jge 0x15e6
movzbl -0x12(%rbp), %eax
movl %eax, %ecx
leaq 0x2abd(%rip), %rax      # 0x4040
imulq $0x6, %rcx, %rcx
addq %rcx, %rax
movslq -0x18(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x13(%rbp)
movl $0x0, -0x1c(%rbp)
cmpl $0x8, -0x1c(%rbp)
jge 0x15d9
movq -0x28(%rbp), %rdi
movl -0xc(%rbp), %esi
addl -0x18(%rbp), %esi
movl -0x10(%rbp), %edx
addl -0x1c(%rbp), %edx
movzbl -0x13(%rbp), %eax
movl -0x1c(%rbp), %ecx
movl $0x1, %r8d
shll %cl, %r8d
movl %r8d, %ecx
andl %ecx, %eax
movzbl %al, %ecx
callq 0x2fc0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x159b
jmp 0x15db
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x1570
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/arduboy2/graph.cpp
// Function: graph::printString(char const*)
void graph::printString(const char* str)
{
    while(*str){
        if(*str == '\r'){ str++; continue; }
        if(*str == '\n'){
            cursor_x = 0; cursor_y += 8;
            str++; continue;
        }
        if(cursor_x > WIDTH-6) { cursor_x = 0; cursor_y += 8; }
        if(cursor_y > HEIGHT-8) { clear(0); cursor_y = cursor_x = 0; }
        printChar(cursor_x, cursor_y, *str++);
        cursor_x += 6;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x16e3
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
jne 0x162f
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1608
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xa, %eax
jne 0x165d
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movl 0x14(%rax), %ecx
addl $0x8, %ecx
movl %ecx, 0x14(%rax)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x1608
movq -0x18(%rbp), %rcx
movl 0x10(%rcx), %eax
movl 0xc(%rcx), %ecx
subl $0x6, %ecx
cmpl %ecx, %eax
jbe 0x1682
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movl 0x14(%rax), %ecx
addl $0x8, %ecx
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rcx
movl 0x14(%rcx), %eax
movl 0x8(%rcx), %ecx
subl $0x8, %ecx
cmpl %ecx, %eax
jbe 0x16b0
movq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x3010
movq -0x18(%rbp), %rax
movl $0x0, 0x10(%rax)
movl $0x0, 0x14(%rax)
movq -0x18(%rbp), %rdi
movl 0x10(%rdi), %esi
movl 0x14(%rdi), %edx
movq -0x10(%rbp), %rax
movq %rax, %rcx
addq $0x1, %rcx
movq %rcx, -0x10(%rbp)
movsbl (%rax), %ecx
callq 0x1540
movq -0x18(%rbp), %rax
movl 0x10(%rax), %ecx
addl $0x6, %ecx
movl %ecx, 0x10(%rax)
jmp 0x1608
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/arduboy2/graph.cpp
// Function: graph::drawRect(short, short, unsigned char, unsigned char, unsigned char)
void graph::drawRect(int16_t x, int16_t y, uint8_t w, uint8_t h, uint8_t color)
{
    drawFastHLine(x, y, w, color);
    drawFastHLine(x, y+h-1, w, color);
    drawFastVLine(x, y, h, color);
    drawFastVLine(x+w-1, y, h, color);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %r8d, -0x28(%rbp)
movl %ecx, %eax
movl -0x28(%rbp), %ecx
movl %eax, -0x24(%rbp)
movl %edx, %eax
movl -0x24(%rbp), %edx
movl %eax, -0x20(%rbp)
movl %esi, %eax
movl -0x20(%rbp), %esi
movl %eax, -0x1c(%rbp)
movq %rdi, %r8
movl -0x1c(%rbp), %edi
movb %r9b, %al
movq %r8, -0x8(%rbp)
movw %di, -0xa(%rbp)
movw %si, -0xc(%rbp)
movb %dl, -0xd(%rbp)
movb %cl, -0xe(%rbp)
movb %al, -0xf(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x18(%rbp)
movw -0xa(%rbp), %dx
movw -0xc(%rbp), %cx
movb -0xd(%rbp), %al
movswl %dx, %esi
movswl %cx, %edx
movzbl %al, %ecx
movzbl -0xf(%rbp), %r8d
callq 0x1a20
movq -0x18(%rbp), %rdi
movw -0xa(%rbp), %dx
movswl -0xc(%rbp), %eax
movzbl -0xe(%rbp), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, %cx
movb -0xd(%rbp), %al
movswl %dx, %esi
movswl %cx, %edx
movzbl %al, %ecx
movzbl -0xf(%rbp), %r8d
callq 0x1a20
movq -0x18(%rbp), %rdi
movw -0xa(%rbp), %dx
movw -0xc(%rbp), %cx
movb -0xe(%rbp), %al
movswl %dx, %esi
movswl %cx, %edx
movzbl %al, %ecx
movzbl -0xf(%rbp), %r8d
callq 0x19b0
movq -0x18(%rbp), %rdi
movswl -0xa(%rbp), %eax
movzbl -0xd(%rbp), %ecx
addl %ecx, %eax
subl $0x1, %eax
movw %ax, %dx
movw -0xc(%rbp), %cx
movb -0xe(%rbp), %al
movswl %dx, %esi
movswl %cx, %edx
movzbl %al, %ecx
movzbl -0xf(%rbp), %r8d
callq 0x19b0
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/hardware/button.cpp
// Function: button::buttonHandler()
void button::buttonHandler()
{
    while(1) {
        buttonChar = getchar_unlocked();
        switch (buttonChar)
        {
        case 'w':
            buttonsState |= UP_BUTTON;
            break;
        case 's':
            buttonsState |= DOWN_BUTTON;
            break;
        case 'a':
            buttonsState |= LEFT_BUTTON;
            break;
        case 'd':
            buttonsState |= RIGHT_BUTTON;
            break;
        case 'j':
            buttonsState |= A_BUTTON;
            break;
        case 'k':
            buttonsState |= B_BUTTON;
            break;
        default:
            break;
        }
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
jmp 0x252a
callq 0x1080
movb %al, 0x4b93(%rip)       # 0x70c8
movsbl 0x4b8c(%rip), %eax      # 0x70c8
addl $-0x61, %eax
movl %eax, %ecx
movq %rcx, -0x8(%rbp)
subl $0x16, %eax
ja 0x25ce
movq -0x8(%rbp), %rax
leaq 0x1d23(%rip), %rcx      # 0x427c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movzbl 0x4b64(%rip), %eax      # 0x70cd
orl $0x10, %eax
movb %al, 0x4b5b(%rip)       # 0x70cd
jmp 0x25d0
movzbl 0x4b52(%rip), %eax      # 0x70cd
orl $0x8, %eax
movb %al, 0x4b49(%rip)       # 0x70cd
jmp 0x25d0
movzbl 0x4b40(%rip), %eax      # 0x70cd
orl $0x40, %eax
movb %al, 0x4b37(%rip)       # 0x70cd
jmp 0x25d0
movzbl 0x4b2e(%rip), %eax      # 0x70cd
orl $0x20, %eax
movb %al, 0x4b25(%rip)       # 0x70cd
jmp 0x25d0
movzbl 0x4b1c(%rip), %eax      # 0x70cd
orl $0x4, %eax
movb %al, 0x4b13(%rip)       # 0x70cd
jmp 0x25d0
movzbl 0x4b0a(%rip), %eax      # 0x70cd
orl $0x2, %eax
movb %al, 0x4b01(%rip)       # 0x70cd
jmp 0x25d0
jmp 0x25d0
jmp 0x252a
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/hardware/button.cpp
// Function: button::button()
button::button()
{
    // unix termios
    struct termios term;
    tcgetattr(0,&term);
    term.c_lflag &= ~(ICANON | ECHO);
    tcsetattr(0, TCSANOW,&term);

    // int flags = fcntl(0, F_GETFL, 0);
    // fcntl(0, F_SETFL, flags | O_NONBLOCK);

    btHandle = new btn;
    btHandle->buttonThread = std::thread(buttonHandler);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
xorl %edi, %edi
leaq -0x44(%rbp), %rsi
callq 0x1100
movl -0x38(%rbp), %eax
andl $-0xb, %eax
movl %eax, -0x38(%rbp)
xorl %esi, %esi
leaq -0x44(%rbp), %rdx
movl %esi, %edi
callq 0x1120
movl $0x8, %edi
callq 0x10d0
movq %rax, %rdi
movq %rdi, -0x60(%rbp)
callq 0x2690
movq -0x60(%rbp), %rcx
movq -0x58(%rbp), %rax
movq %rcx, (%rax)
leaq -0x50(%rbp), %rdi
leaq -0x121(%rip), %rsi      # 0x2520
callq 0x26b0
movq -0x58(%rbp), %rax
movq (%rax), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2770
leaq -0x50(%rbp), %rdi
callq 0x27b0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/wjdready[P]arduboy2/./src/hardware/screen.cpp
// Function: screen::display()
void screen::display() 
{
    using std::cout; using std::endl;

    system("clear");

    cout << '+';
    for(int i=0; i<WIDTH*2; i++)
        cout << '-';
    cout << "+" << endl;

    for(int i=0; i<HEIGHT; i++) {
        cout << '|';
        for(int j=0; j<WIDTH; j++)
            buffer[i*WIDTH+j] ? cout << "O " : cout << "  ";
        cout << "|" << endl;
    }

    cout << '+';
    for(int i=0; i<WIDTH*2; i++)
        cout << '-';
    cout << '+' << endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0x12a8(%rip), %rdi      # 0x4313
callq 0x1090
movq 0x3f61(%rip), %rdi      # 0x6fd8
movl $0x2b, %esi
callq 0x1110
movl $0x0, -0xc(%rbp)
movq -0x20(%rbp), %rcx
movl -0xc(%rbp), %eax
movl 0xc(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jae 0x30b4
movq 0x3f39(%rip), %rdi      # 0x6fd8
movl $0x2d, %esi
callq 0x1110
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3088
movq 0x3f1d(%rip), %rdi      # 0x6fd8
leaq 0x1257(%rip), %rsi      # 0x4319
callq 0x10c0
movq %rax, %rdi
movq 0x3eef(%rip), %rsi      # 0x6fc0
callq 0x10f0
movl $0x0, -0x10(%rbp)
movq -0x20(%rbp), %rcx
movl -0x10(%rbp), %eax
cmpl 0x8(%rcx), %eax
jae 0x318d
movq 0x3ee4(%rip), %rdi      # 0x6fd8
movl $0x7c, %esi
callq 0x1110
movl $0x0, -0x14(%rbp)
movq -0x20(%rbp), %rcx
movl -0x14(%rbp), %eax
cmpl 0xc(%rcx), %eax
jae 0x315d
movq -0x20(%rbp), %rdx
movq (%rdx), %rax
movl -0x10(%rbp), %ecx
imull 0xc(%rdx), %ecx
addl -0x14(%rbp), %ecx
movl %ecx, %ecx
cmpb $0x0, (%rax,%rcx)
je 0x313f
movq 0x3ea7(%rip), %rdi      # 0x6fd8
leaq 0x11e3(%rip), %rsi      # 0x431b
callq 0x10c0
jmp 0x3152
movq 0x3e92(%rip), %rdi      # 0x6fd8
leaq 0x11d1(%rip), %rsi      # 0x431e
callq 0x10c0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3105
movq 0x3e74(%rip), %rdi      # 0x6fd8
leaq 0x11b6(%rip), %rsi      # 0x4321
callq 0x10c0
movq %rax, %rdi
movq 0x3e46(%rip), %rsi      # 0x6fc0
callq 0x10f0
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x30dd
movq 0x3e44(%rip), %rdi      # 0x6fd8
movl $0x2b, %esi
callq 0x1110
movl $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movl -0x18(%rbp), %eax
movl 0xc(%rcx), %ecx
shll %ecx
cmpl %ecx, %eax
jae 0x31d1
movq 0x3e1c(%rip), %rdi      # 0x6fd8
movl $0x2d, %esi
callq 0x1110
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x31a5
movq 0x3e00(%rip), %rdi      # 0x6fd8
movl $0x2b, %esi
callq 0x1110
movq %rax, %rdi
movq 0x3dd4(%rip), %rsi      # 0x6fc0
callq 0x10f0
addq $0x20, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/1120.c
// Function: dati_bus
int
dati_bus(Bus *bus)
{
	Busdev *bd;
	for(bd = bus->devs; bd; bd = bd->next)
		if(bd->dati(bus, bd->dev) == 0)
			return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x23f1
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
cmpl $0x0, %eax
jne 0x23e2
movl $0x0, -0x4(%rbp)
jmp 0x23f8
jmp 0x23e4
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x23b7
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/1120.c
// Function: dato_bus
int
dato_bus(Bus *bus)
{
	Busdev *bd;
	for(bd = bus->devs; bd; bd = bd->next)
		if(bd->dato(bus, bd->dev) == 0)
			return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x2461
movq -0x18(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
cmpl $0x0, %eax
jne 0x2452
movl $0x0, -0x4(%rbp)
jmp 0x2468
jmp 0x2454
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2427
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/1120.c
// Function: datob_bus
int
datob_bus(Bus *bus)
{
	Busdev *bd;
	for(bd = bus->devs; bd; bd = bd->next)
		if(bd->datob(bus, bd->dev) == 0)
			return 0;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x24d1
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
cmpl $0x0, %eax
jne 0x24c2
movl $0x0, -0x4(%rbp)
jmp 0x24d8
jmp 0x24c4
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x2497
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/1120.c
// Function: loadmem
void
loadmem(char *filename)
{
	FILE *f;
	char line[100], *s;
	word w;

	w = 0;
	f = fopen(filename, "r");
	if(f == nil)
		return;
	while(s = fgets(line, 100, f), s != nil){
		while(isspace(*s)) s++;
		if(*s == ':')
			w = strtol(s+1, nil, 8)>>1;
		if(*s >= '0' && *s <= '7')
			memory[w++] = strtol(s, nil, 8);
	}
	fclose(f);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movw $0x0, -0x8a(%rbp)
movq -0x8(%rbp), %rdi
leaq 0x92de(%rip), %rsi      # 0xb8a1
callq 0x21b0
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x25d8
jmp 0x26d5
jmp 0x25da
leaq -0x80(%rbp), %rdi
movq -0x10(%rbp), %rdx
movl $0x64, %esi
callq 0x2110
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x26cc
jmp 0x2603
callq 0x2220
movq (%rax), %rax
movq -0x88(%rbp), %rcx
movsbl (%rcx), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2000, %eax           # imm = 0x2000
cmpl $0x0, %eax
je 0x263a
movq -0x88(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x88(%rbp)
jmp 0x2603
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x3a, %eax
jne 0x266c
movq -0x88(%rbp), %rdi
addq $0x1, %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x8, %edx
callq 0x2130
sarq %rax
movw %ax, -0x8a(%rbp)
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x30, %eax
jl 0x26c7
movq -0x88(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x37, %eax
jg 0x26c7
movq -0x88(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0x8, %edx
callq 0x2130
movw %ax, %dx
movw -0x8a(%rbp), %ax
movw %ax, %cx
addw $0x1, %cx
movw %cx, -0x8a(%rbp)
movzwl %ax, %eax
movl %eax, %ecx
leaq 0xbcfd(%rip), %rax      # 0xe3c0
movw %dx, (%rax,%rcx,2)
jmp 0x25da
movq -0x10(%rbp), %rdi
callq 0x2080
addq $0x90, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/1120.c
// Function: dumpmem
void
dumpmem(int start, int end)
{
	start >>= 1;
	end >>= 1;
	for(; start != end; start++)
		printf("%06o: %06o\n", start<<1, memory[start]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
sarl %eax
movl %eax, -0x4(%rbp)
movl -0x8(%rbp), %eax
sarl %eax
movl %eax, -0x8(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
je 0x2a43
movl -0x4(%rbp), %esi
shll %esi
movslq -0x4(%rbp), %rcx
leaq 0xb99a(%rip), %rax      # 0xe3c0
movzwl (%rax,%rcx,2), %edx
leaq 0x85f7(%rip), %rdi      # 0xb028
movb $0x0, %al
callq 0x20a0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x2a0e
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: tracestate
void
tracestate(KA11 *cpu)
{
	(void)cpu;
	trace(" R0 %06o R1 %06o R2 %06o R3 %06o R4 %06o R5 %06o R6 %06o R7 %06o\n"
		" 10 %06o 11 %06o 12 %06o 13 %06o 14 %06o 15 %06o 16 %06o 17 %06o\n"
		" BA %06o IR %06o PSW %03o\n"
		,
		cpu->r[0], cpu->r[1], cpu->r[2], cpu->r[3],
		cpu->r[4], cpu->r[5], cpu->r[6], cpu->r[7],
		cpu->r[8], cpu->r[9], cpu->r[10], cpu->r[11],
		cpu->r[12], cpu->r[13], cpu->r[14], cpu->r[15],
		cpu->ba, cpu->ir, cpu->psw);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdi, -0x30(%rbp)
cmpl $0x0, 0x14f99(%rip)     # 0x17cd8
je 0x2e53
movq -0x30(%rbp), %rax
movzwl (%rax), %esi
movq -0x30(%rbp), %rax
movzwl 0x2(%rax), %edx
movq -0x30(%rbp), %rax
movzwl 0x4(%rax), %ecx
movq -0x30(%rbp), %rax
movzwl 0x6(%rax), %r8d
movq -0x30(%rbp), %rax
movzwl 0x8(%rax), %r9d
movq -0x30(%rbp), %rax
movzwl 0xa(%rax), %eax
movq -0x30(%rbp), %rdi
movzwl 0xc(%rdi), %edi
movl %edi, -0x48(%rbp)
movq -0x30(%rbp), %rdi
movzwl 0xe(%rdi), %edi
movl %edi, -0x44(%rbp)
movq -0x30(%rbp), %rdi
movzwl 0x10(%rdi), %edi
movl %edi, -0x40(%rbp)
movq -0x30(%rbp), %rdi
movzwl 0x12(%rdi), %edi
movl %edi, -0x3c(%rbp)
movq -0x30(%rbp), %rdi
movzwl 0x14(%rdi), %edi
movl %edi, -0x38(%rbp)
movq -0x30(%rbp), %rdi
movzwl 0x16(%rdi), %r13d
movq -0x30(%rbp), %rdi
movzwl 0x18(%rdi), %r12d
movq -0x30(%rbp), %rdi
movzwl 0x1a(%rdi), %r15d
movq -0x30(%rbp), %rdi
movzwl 0x1c(%rdi), %r14d
movq -0x30(%rbp), %rdi
movzwl 0x1e(%rdi), %ebx
movq -0x30(%rbp), %rdi
movzwl 0x22(%rdi), %r11d
movq -0x30(%rbp), %rdi
movzwl 0x24(%rdi), %r10d
movq -0x30(%rbp), %rdi
movzbl 0x30(%rdi), %edi
movl %edi, -0x34(%rbp)
leaq 0x838f(%rip), %rdi      # 0xb18c
movl %eax, (%rsp)
movl -0x48(%rbp), %eax
movl %eax, 0x8(%rsp)
movl -0x44(%rbp), %eax
movl %eax, 0x10(%rsp)
movl -0x40(%rbp), %eax
movl %eax, 0x18(%rsp)
movl -0x3c(%rbp), %eax
movl %eax, 0x20(%rsp)
movl -0x38(%rbp), %eax
movl %eax, 0x28(%rsp)
movl -0x34(%rbp), %eax
movl %r13d, 0x30(%rsp)
movl %r12d, 0x38(%rsp)
movl %r15d, 0x40(%rsp)
movl %r14d, 0x48(%rsp)
movl %ebx, 0x50(%rsp)
movl %r11d, 0x58(%rsp)
movl %r10d, 0x60(%rsp)
movl %eax, 0x68(%rsp)
movb $0x0, %al
callq 0x20a0
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: reset
void
reset(KA11 *cpu)
{
	Busdev *bd;

	cpu->traps = 0;

	for(bd = cpu->bus->devs; bd; bd = bd->next)
		bd->reset(bd->dev);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl $0x0, 0x34(%rax)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x2ffc
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rdi
callq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
jmp 0x2fd6
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: dati
int
dati(KA11 *cpu, int b)
{
trace("dati %06o: ", cpu->ba);
	if(!b && cpu->ba&1)
		goto be;

	/* internal registers */
	if((cpu->ba&0177400) == 0177400){
		switch(cpu->ba&0377){
		case 0170: case 0171:
			cpu->bus->data = cpu->sw;
			goto ok;
		case 0376: case 0377:
			cpu->bus->data = cpu->psw;
			goto ok;
		}
	}

	cpu->bus->addr = ubxt(cpu->ba)&~1;
	if(dati_bus(cpu->bus))
		goto be;
ok:
	trace("%06o\n", cpu->bus->data);
	cpu->be = 0;
	return 0;
be:
	trace("BE\n");
	cpu->be++;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x0, 0x14cb2(%rip)     # 0x17cd8
je 0x303e
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %esi
leaq 0x81f2(%rip), %rdi      # 0xb229
movb $0x0, %al
callq 0x20a0
cmpl $0x0, -0x14(%rbp)
jne 0x3059
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3059
jmp 0x312f
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0xff00, %eax           # imm = 0xFF00
jne 0x30c5
movq -0x10(%rbp), %rax
movzbl 0x22(%rax), %eax
movl %eax, -0x18(%rbp)
addl $-0x78, %eax
subl $0x2, %eax
jb 0x3091
jmp 0x3082
movl -0x18(%rbp), %eax
addl $0xffffff02, %eax       # imm = 0xFFFFFF02
subl $0x2, %eax
jb 0x30aa
jmp 0x30c3
movq -0x10(%rbp), %rax
movw 0x88(%rax), %cx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movw %cx, 0xc(%rax)
jmp 0x30f8
movq -0x10(%rbp), %rax
movzbl 0x30(%rax), %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movw %cx, 0xc(%rax)
jmp 0x30f8
jmp 0x30c5
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %edi
callq 0x3170
movl %eax, %ecx
andl $-0x2, %ecx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x23a0
cmpl $0x0, %eax
je 0x30f6
jmp 0x312f
jmp 0x30f8
cmpl $0x0, 0x14bd9(%rip)     # 0x17cd8
je 0x311b
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movzwl 0xc(%rax), %esi
leaq 0x7f1a(%rip), %rdi      # 0xb02e
movb $0x0, %al
callq 0x20a0
movq -0x10(%rbp), %rax
movl $0x0, 0x38(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x315a
cmpl $0x0, 0x14ba2(%rip)     # 0x17cd8
je 0x3146
leaq 0x80f6(%rip), %rdi      # 0xb235
movb $0x0, %al
callq 0x20a0
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: dato
int
dato(KA11 *cpu, int b)
{
trace("dato %06o %06o %d\n", cpu->ba, cpu->bus->data, b);
	if(!b && cpu->ba&1)
		goto be;

	/* internal registers */
	if((cpu->ba&0177400) == 0177400){
		switch(cpu->ba&0377){
		case 0170: case 0171:
			/* can't write switches */
			goto ok;
		case 0376: case 0377:
			/* writes 0 for the odd byte.
			   I think this is correct. */
			cpu->psw = cpu->bus->data;
			goto ok;
		}
	}

	if(b){
		cpu->bus->addr = ubxt(cpu->ba);
		if(datob_bus(cpu->bus))
			goto be;
	}else{
		cpu->bus->addr = ubxt(cpu->ba)&~1;
		if(dato_bus(cpu->bus))
			goto be;
	}
ok:
	cpu->be = 0;
	return 0;
be:
	cpu->be++;
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
cmpl $0x0, 0x14b12(%rip)     # 0x17cd8
je 0x31ed
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %esi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movzwl 0xc(%rax), %edx
movl -0x14(%rbp), %ecx
leaq 0x8053(%rip), %rdi      # 0xb239
movb $0x0, %al
callq 0x20a0
cmpl $0x0, -0x14(%rbp)
jne 0x3208
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x3208
jmp 0x32dd
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %eax
andl $0xff00, %eax           # imm = 0xFF00
cmpl $0xff00, %eax           # imm = 0xFF00
jne 0x325e
movq -0x10(%rbp), %rax
movzbl 0x22(%rax), %eax
movl %eax, -0x18(%rbp)
addl $-0x78, %eax
subl $0x2, %eax
jb 0x3240
jmp 0x3231
movl -0x18(%rbp), %eax
addl $0xffffff02, %eax       # imm = 0xFFFFFF02
subl $0x2, %eax
jb 0x3245
jmp 0x325c
jmp 0x32c9
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movw 0xc(%rax), %ax
movb %al, %cl
movq -0x10(%rbp), %rax
movb %cl, 0x30(%rax)
jmp 0x32c9
jmp 0x325e
cmpl $0x0, -0x14(%rbp)
je 0x3294
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %edi
callq 0x3170
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2480
cmpl $0x0, %eax
je 0x3292
jmp 0x32dd
jmp 0x32c7
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %edi
callq 0x3170
movl %eax, %ecx
andl $-0x2, %ecx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x2410
cmpl $0x0, %eax
je 0x32c5
jmp 0x32dd
jmp 0x32c7
jmp 0x32c9
movq -0x10(%rbp), %rax
movl $0x0, 0x38(%rax)
movl $0x0, -0x4(%rbp)
jmp 0x32f1
movq -0x10(%rbp), %rax
movl 0x38(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x38(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: fetchop
static int
fetchop(KA11 *cpu, int t, int m, int b)
{
	int r;
	r = m&7;
	if((m&070) == 0)
		cpu->r[t] = cpu->r[r];
	else{
		if(dati(cpu, b)) return 1;
		cpu->r[t] = cpu->bus->data;
		if(b && cpu->ba&1) cpu->r[t] = cpu->r[t]>>8;
	}
	if(b) cpu->r[t] = sxt(cpu->r[t]);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl -0x18(%rbp), %eax
andl $0x7, %eax
movl %eax, -0x20(%rbp)
movl -0x18(%rbp), %eax
andl $0x38, %eax
cmpl $0x0, %eax
jne 0x5ca3
movq -0x10(%rbp), %rax
movslq -0x20(%rbp), %rcx
movw (%rax,%rcx,2), %dx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x5d0b
movq -0x10(%rbp), %rdi
movl -0x1c(%rbp), %esi
callq 0x3010
cmpl $0x0, %eax
je 0x5cbd
movl $0x1, -0x4(%rbp)
jmp 0x5d3b
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movw 0xc(%rax), %dx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
cmpl $0x0, -0x1c(%rbp)
je 0x5d09
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5d09
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
sarl $0x8, %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x5d0b
cmpl $0x0, -0x1c(%rbp)
je 0x5d34
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw (%rax,%rcx,2), %ax
movzbl %al, %edi
callq 0x2590
movw %ax, %dx
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: writedest
static int
writedest(KA11 *cpu, word v, int b)
{
	int d;
	if((cpu->ir & 070) == 0){
		d = cpu->ir & 7;
		if(b) SETMASK(cpu->r[d], v, 0377);
		else cpu->r[d] = v;
	}else{
		if(cpu->ba&1) v <<= 8;
		cpu->bus->data = v;
		if(dato(cpu, b)) return 1;
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movw %si, %ax
movq %rdi, -0x10(%rbp)
movw %ax, -0x12(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movzwl 0x24(%rax), %eax
andl $0x38, %eax
cmpl $0x0, %eax
jne 0x5e2a
movq -0x10(%rbp), %rax
movzwl 0x24(%rax), %eax
andl $0x7, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x5e18
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0xffffff00, %eax       # imm = 0xFFFFFF00
movzwl -0x12(%rbp), %ecx
andl $0xff, %ecx
orl %ecx, %eax
movw %ax, %dx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x5e28
movw -0x12(%rbp), %dx
movq -0x10(%rbp), %rax
movslq -0x1c(%rbp), %rcx
movw %dx, (%rax,%rcx,2)
jmp 0x5e71
movq -0x10(%rbp), %rax
movzwl 0x22(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x5e45
movzwl -0x12(%rbp), %eax
shll $0x8, %eax
movw %ax, -0x12(%rbp)
movw -0x12(%rbp), %cx
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movw %cx, 0xc(%rax)
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
callq 0x31b0
cmpl $0x0, %eax
je 0x5e6f
movl $0x1, -0x4(%rbp)
jmp 0x5e78
jmp 0x5e71
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: run
void
run(KA11 *cpu)
{
	int count;

	count = 0;
	cpu->state = STATE_RUNNING;
	while(cpu->state != STATE_HALTED){
		svc(cpu, cpu->bus);

#ifdef AUTODIAG
	extern int diagpassed;
	if(diagpassed)
		return;
#endif

		if(cpu->state == STATE_RUNNING ||
		   cpu->state == STATE_WAITING && cpu->traps){
			cpu->state = STATE_RUNNING;
			step(cpu);
		}

		if (count++ == 1000) {
			sleep_ms(cpu->throttle);
			count = 0;
		}
	}

	printstate(cpu);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl $0x1, 0x3c(%rax)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0x6132
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rsi
callq 0x6150
movq -0x8(%rbp), %rax
cmpl $0x1, 0x3c(%rax)
je 0x60f7
movq -0x8(%rbp), %rax
cmpl $0x2, 0x3c(%rax)
jne 0x610b
movq -0x8(%rbp), %rax
cmpl $0x0, 0x34(%rax)
je 0x610b
movq -0x8(%rbp), %rax
movl $0x1, 0x3c(%rax)
movq -0x8(%rbp), %rdi
callq 0x3300
movl -0xc(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0xc(%rbp)
cmpl $0x3e8, %eax            # imm = 0x3E8
jne 0x6130
movq -0x8(%rbp), %rax
movl 0x40(%rax), %edi
callq 0x9f00
movl $0x0, -0xc(%rbp)
jmp 0x60be
movq -0x8(%rbp), %rdi
callq 0x2e70
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/ka11.c
// Function: svc
static void
svc(KA11 *cpu, Bus *bus)
{
	int l;
	Busdev *bd;
	static int brtraps[4] = { TRAP_BR4, TRAP_BR5, TRAP_BR6, TRAP_BR7 };
	for(l = 0; l < 4; l++){
		cpu->br[l].bg = nil;
		cpu->br[l].dev = nil;
	}
	cpu->traps &= ~(TRAP_BR4|TRAP_BR5|TRAP_BR6|TRAP_BR7);
	for(bd = bus->devs; bd; bd = bd->next){
		l = bd->svc(bus, bd->dev);
		if(l >= 4 && l <= 7 && cpu->br[l-4].bg == nil){
			cpu->br[l-4].bg = bd->bg;
			cpu->br[l-4].dev = bd->dev;
			cpu->traps |= brtraps[l-4];
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jge 0x61ad
movq -0x8(%rbp), %rax
addq $0x48, %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, (%rax)
movq -0x8(%rbp), %rax
addq $0x48, %rax
movslq -0x14(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq $0x0, 0x8(%rax)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6167
movq -0x8(%rbp), %rax
movl 0x34(%rax), %ecx
andl $-0x6d, %ecx
movl %ecx, 0x34(%rax)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6291
movq -0x20(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rcx
movq 0x8(%rcx), %rsi
callq *%rax
movl %eax, -0x14(%rbp)
cmpl $0x4, -0x14(%rbp)
jl 0x627f
cmpl $0x7, -0x14(%rbp)
jg 0x627f
movq -0x8(%rbp), %rax
addq $0x48, %rax
movl -0x14(%rbp), %ecx
subl $0x4, %ecx
movslq %ecx, %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
jne 0x627f
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rcx
movq -0x8(%rbp), %rax
addq $0x48, %rax
movl -0x14(%rbp), %edx
subl $0x4, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rcx
movq -0x8(%rbp), %rax
addq $0x48, %rax
movl -0x14(%rbp), %edx
subl $0x4, %edx
movslq %edx, %rdx
shlq $0x4, %rdx
addq %rdx, %rax
movq %rcx, 0x8(%rax)
movl -0x14(%rbp), %eax
subl $0x4, %eax
movslq %eax, %rcx
leaq 0x812e(%rip), %rax      # 0xe3a0
movl (%rax,%rcx,4), %ecx
movq -0x8(%rbp), %rax
orl 0x34(%rax), %ecx
movl %ecx, 0x34(%rax)
jmp 0x6281
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x61c5
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/eae.c
// Function: mult
static void
mult(KE11 *ke)
{
	uint32 sum, md;
	int c;

	sum = 0;
	md = ke->ac<<16 | ke->mq;
	c = 0;
	ke->sc = 16;
	do{
		if((ke->x & 1) != c){
			if(ke->x&1)
				sum += ~md + 1;
			else
				sum += md;
		}
		md <<= 1;
		c = ke->x&1;
		ke->x >>= 1;
		ke->sc--;
	}while(ke->sc);
	ke->ac = sum>>16;
	ke->mq = sum;
	ke->sr &= ~SR_C;
	setflags(ke);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
shll $0x10, %eax
movq -0x8(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
movq -0x8(%rbp), %rax
movb $0x10, 0x6(%rax)
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %eax
andl $0x1, %eax
cmpl -0x14(%rbp), %eax
je 0x6755
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x674a
movl -0x10(%rbp), %eax
xorl $-0x1, %eax
addl $0x1, %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x6753
movl -0x10(%rbp), %eax
addl -0xc(%rbp), %eax
movl %eax, -0xc(%rbp)
jmp 0x6755
movl -0x10(%rbp), %eax
shll %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %eax
andl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x4(%rax), %ecx
sarl %ecx
movw %cx, 0x4(%rax)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rax
cmpb $0x0, 0x6(%rax)
jne 0x6719
movl -0xc(%rbp), %eax
shrl $0x10, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %ecx
andl $-0x2, %ecx
movb %cl, 0x7(%rax)
movq -0x8(%rbp), %rdi
callq 0x6f40
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/eae.c
// Function: norm
static void
norm(KE11 *ke)
{
	uint32 sh;

	sh = ke->ac<<16 | ke->mq;
	ke->sc = 0;
	ke->sr &= ~(SR_OV|SR_C);
	setflag(ke, SR_NEG, sh & B31);
	if(ke->sr & SR_NEG)
		ke->sr |= SR_OV;
loop:
	if((sh>>31 & 1) != (sh>>30 & 1))
		goto done;
	if(sh == (3U<<30))
		goto done;
	if(ke->sc == 31)
		goto done;
	sh <<= 1;
	ke->sc++;
	goto loop;
done:
	ke->ac = sh>>16;
	ke->mq = sh;
	setflags(ke);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
shll $0x10, %eax
movq -0x8(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb $0x0, 0x6(%rax)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %ecx
andl $0xffffff7e, %ecx       # imm = 0xFFFFFF7E
movb %cl, 0x7(%rax)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x80000000, %edx       # imm = 0x80000000
movl $0x40, %esi
callq 0x7070
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x6844
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %ecx
orl $0x80, %ecx
movb %cl, 0x7(%rax)
jmp 0x6846
movl -0xc(%rbp), %eax
shrl $0x1f, %eax
andl $0x1, %eax
movl -0xc(%rbp), %ecx
shrl $0x1e, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
je 0x685e
jmp 0x688f
cmpl $0xc0000000, -0xc(%rbp) # imm = 0xC0000000
jne 0x6869
jmp 0x688f
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
cmpl $0x1f, %eax
jne 0x6878
jmp 0x688f
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
addb $0x1, %cl
movb %cl, 0x6(%rax)
jmp 0x6846
movl -0xc(%rbp), %eax
shrl $0x10, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rdi
callq 0x6f40
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/eae.c
// Function: lsh
static void
lsh(KE11 *ke)
{
	uint32 sh;
	int ov;

	sh = ke->ac<<16 | ke->mq;
	setflag(ke, SR_NEG, sh&B31);
	ov = 0;
loop:
	ke->sc &= 077;
	if(ke->sc == 0)
		goto done;
	if(ke->sc&040){
		/* negative, shift right */
		setflag(ke, SR_C, sh&1);
		sh >>= 1;
		ke->sr &= ~SR_NEG;
		ke->sc++;
	}else{
		/* positive, shift left */
		setflag(ke, SR_C, sh&B31);
		sh <<= 1;
		if((ke->sr>>6 & 1) != (sh>>31 & 1))
			ov = 1;	/* sign changed */
		setflag(ke, SR_NEG, sh&B31);
		ke->sc--;
	}
	goto loop;
done:
	setflag(ke, SR_OV, ov != (ke->sr>>6 & 1));
	ke->ac = sh>>16;
	ke->mq = sh;
	setflags(ke);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
shll $0x10, %eax
movq -0x8(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x80000000, %edx       # imm = 0x80000000
movl $0x40, %esi
callq 0x7070
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %ecx
andl $0x3f, %ecx
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
cmpl $0x0, %eax
jne 0x6921
jmp 0x69d4
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x696a
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x1, %edx
movl $0x1, %esi
callq 0x7070
movl -0xc(%rbp), %eax
shrl %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %ecx
andl $-0x41, %ecx
movb %cl, 0x7(%rax)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
addb $0x1, %cl
movb %cl, 0x6(%rax)
jmp 0x69cf
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x80000000, %edx       # imm = 0x80000000
movl $0x1, %esi
callq 0x7070
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
sarl $0x6, %eax
andl $0x1, %eax
movl -0xc(%rbp), %ecx
shrl $0x1f, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
je 0x69ab
movl $0x1, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x80000000, %edx       # imm = 0x80000000
movl $0x40, %esi
callq 0x7070
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x6(%rax)
jmp 0x6901
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
sarl $0x6, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %edx
movl $0x80, %esi
callq 0x7070
movl -0xc(%rbp), %eax
shrl $0x10, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rdi
callq 0x6f40
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/eae.c
// Function: ash
static void
ash(KE11 *ke)
{
	uint32 sh;
	int ov;

	sh = ke->ac<<16 | ke->mq;
	setflag(ke, SR_NEG, sh&B31);
	ov = 0;
loop:
	ke->sc &= 077;
	if(ke->sc == 0)
		goto done;
	if(ke->sc&040){
		/* negative, shift right */
		setflag(ke, SR_C, sh&1);
		sh >>= 1;
		if(ke->sr & SR_NEG)
			sh |= B31;
		ke->sc++;
	}else{
		/* positive, shift left */
		sh <<= 1;
		setflag(ke, SR_C, sh&B31);
		if(ke->sr & SR_NEG)
			sh |= B31;
		else
			sh &= ~B31;
		if((ke->sr & SR_C) != (ke->sr>>6 & 1))
			ov = 1;	/* sign changed */
		ke->sc--;
	}
	goto loop;
done:
	setflag(ke, SR_OV, ov != (ke->sr>>6 & 1));
	ke->ac = sh>>16;
	ke->mq = sh;
	setflags(ke);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movzwl (%rax), %eax
shll $0x10, %eax
movq -0x8(%rbp), %rcx
movzwl 0x2(%rcx), %ecx
orl %ecx, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x80000000, %edx       # imm = 0x80000000
movl $0x40, %esi
callq 0x7070
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %ecx
andl $0x3f, %ecx
movb %cl, 0x6(%rax)
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
cmpl $0x0, %eax
jne 0x6a91
jmp 0x6b64
movq -0x8(%rbp), %rax
movzbl 0x6(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x6ae7
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x1, %edx
movl $0x1, %esi
callq 0x7070
movl -0xc(%rbp), %eax
shrl %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x6ad8
movl -0xc(%rbp), %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
addb $0x1, %cl
movb %cl, 0x6(%rax)
jmp 0x6b5f
movl -0xc(%rbp), %eax
shll %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %edx
andl $0x80000000, %edx       # imm = 0x80000000
movl $0x1, %esi
callq 0x7070
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x6b23
movl -0xc(%rbp), %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, -0xc(%rbp)
jmp 0x6b2e
movl -0xc(%rbp), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x7(%rax), %eax
andl $0x1, %eax
movq -0x8(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
sarl $0x6, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
je 0x6b52
movl $0x1, -0x10(%rbp)
movq -0x8(%rbp), %rax
movb 0x6(%rax), %cl
addb $-0x1, %cl
movb %cl, 0x6(%rax)
jmp 0x6a71
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %eax
movq -0x8(%rbp), %rcx
movzbl 0x7(%rcx), %ecx
sarl $0x6, %ecx
andl $0x1, %ecx
cmpl %ecx, %eax
setne %al
andb $0x1, %al
movzbl %al, %edx
movl $0x80, %esi
callq 0x7070
movl -0xc(%rbp), %eax
shrl $0x10, %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, (%rax)
movl -0xc(%rbp), %eax
movw %ax, %cx
movq -0x8(%rbp), %rax
movw %cx, 0x2(%rax)
movq -0x8(%rbp), %rdi
callq 0x6f40
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/eae.c
// Function: dati_ke11
int
dati_ke11(Bus *bus, void *dev)
{
	KE11 *ke = dev;
	if(bus->addr >= 0777300 && bus->addr < 0777320){
//		printf("EAE DATI %o\n", bus->addr);
		switch(bus->addr){
		case KE_DIV:
		case KE_MULT:
		case KE_LSH:
		case KE_ASH:
			bus->data = 0;
			break;
		case KE_AC:
			bus->data = ke->ac;
			break;
		case KE_MQ:
			bus->data = ke->mq;
			break;
		case KE_SCSR:
			bus->data = WD(ke->sr, ke->sc);
			break;
		case KE_NORM:
			bus->data = ke->sc & 077;
			break;

		default: assert(0);	/* can't happen */
		}
		return 0;
	}
	return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x3fec0, 0x8(%rax)     # imm = 0x3FEC0
jb 0x6ed6
movq -0x10(%rbp), %rax
cmpl $0x3fed0, 0x8(%rax)     # imm = 0x3FED0
jae 0x6ed6
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
addl $0xfffc0140, %eax       # imm = 0xFFFC0140
movl %eax, %ecx
movq %rcx, -0x28(%rbp)
subl $0xe, %eax
ja 0x6eae
movq -0x28(%rbp), %rax
leaq 0x4708(%rip), %rcx      # 0xb544
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movw $0x0, 0xc(%rax)
jmp 0x6ecd
movq -0x20(%rbp), %rax
movw (%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
jmp 0x6ecd
movq -0x20(%rbp), %rax
movw 0x2(%rax), %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
jmp 0x6ecd
movq -0x20(%rbp), %rax
movzbl 0x7(%rax), %eax
shll $0x8, %eax
movq -0x20(%rbp), %rcx
movzbl 0x6(%rcx), %ecx
orl %ecx, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
jmp 0x6ecd
movq -0x20(%rbp), %rax
movzbl 0x6(%rax), %eax
andl $0x3f, %eax
movw %ax, %cx
movq -0x10(%rbp), %rax
movw %cx, 0xc(%rax)
jmp 0x6ecd
leaq 0x4556(%rip), %rdi      # 0xb40b
leaq 0x46c4(%rip), %rsi      # 0xb580
movl $0x18c, %edx            # imm = 0x18C
leaq 0x46f9(%rip), %rcx      # 0xb5c1
callq 0x20d0
movl $0x0, -0x4(%rbp)
jmp 0x6edd
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/aap[P]pdp11/eae.c
// Function: reset_ke11
void
reset_ke11(void *dev)
{
	KE11 *ke = dev;
	ke->ac = 0;
	ke->mq = 0;
	ke->x = 0;
	ke->sc = 0;
	ke->sr = 0;
	setflags(ke);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movw $0x0, (%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x2(%rax)
movq -0x10(%rbp), %rax
movw $0x0, 0x4(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x6(%rax)
movq -0x10(%rbp), %rax
movb $0x0, 0x7(%rax)
movq -0x10(%rbp), %rdi
callq 0x6f40
addq $0x10, %rsp
popq %rbp
retq