// File: /workspace/github_c_makefile_star2_O3/blakemcbride[P]LISP9/ls9.c
// Function: bitop
cell bitop(cell x, cell y, cell o) {
	uint	op, a, b;
	int	i;

	if (!fixp(o)) expect("bitop", "fixnum", o);
	if (!fixp(x)) expect("bitop", "fixnum", x);
	if (!fixp(y)) expect("bitop", "fixnum", y);
	op = fixval(o);
	b = fixval(x);
	a = i = fixval(y);
	switch (op) {
	case  0: a =  0;        break;
	case  1: a =   a &  b;  break;
	case  2: a =   a & ~b;  break;
	case  3: /* a =   a; */ break;
	case  4: a =  ~a &  b;  break;
	case  5: a =        b;  break;
	case  6: a =   a ^  b;  break;
	case  7: a =   a |  b;  break;
	case  8: a = ~(a |  b); break;
	case  9: a = ~(a ^  b); break;
	case 10: a =       ~b;  break;
	case 11: a =   a | ~b;  break;
	case 12: a =  ~a;       break;
	case 13: a =  ~a |  b;  break;
	case 14: a = ~(a &  b); break;
	case 15: a = ~0;        break;
	case 16: a = a  <<  b;  break;
	case 17: a = i  >>  b;  break;
	case 18: a = a  >>  b;  break;
	default: error("bitop: invalid opcode", o);
		 break;
	}
	return mkfix(a);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x70, %rsp
movl %edx, %ebx
testl %edx, %edx
js 0xa6ef
movq 0xed66(%rip), %rdx      # 0x19350
movl %ebx, %ecx
testb $0x1, (%rdx,%rcx)
je 0xa6ef
movq 0xed43(%rip), %rax      # 0x19340
cmpl $-0xe, (%rax,%rcx,4)
jne 0xa6ef
movl %edi, %r14d
testl %edi, %edi
js 0xa71b
movl %esi, %ebp
movl %r14d, %esi
testb $0x1, (%rdx,%rsi)
je 0xa71b
cmpl $-0xe, (%rax,%rsi,4)
jne 0xa71b
testl %ebp, %ebp
js 0xa748
movl %ebp, %r8d
testb $0x1, (%rdx,%r8)
je 0xa748
cmpl $-0xe, (%rax,%r8,4)
jne 0xa748
movq 0xecf5(%rip), %rdx      # 0x19348
movslq (%rdx,%rcx,4), %rcx
movl (%rax,%rcx,4), %ecx
cmpq $0x12, %rcx
ja 0xa774
movslq (%rdx,%rsi,4), %rsi
movl (%rax,%rsi,4), %edi
movslq (%rdx,%r8,4), %rdx
movl (%rax,%rdx,4), %eax
leaq 0x89bb(%rip), %rdx      # 0x13034
movslq (%rdx,%rcx,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
xorl %edi, %edi
jmp 0xa6c7
movl %edi, %ecx
shll %cl, %eax
jmp 0xa6c5
andl %edi, %eax
jmp 0xa69c
xorl %eax, %edi
notl %edi
jmp 0xa6c7
notl %edi
jmp 0xa6b9
orl %edi, %eax
notl %eax
jmp 0xa6c5
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
jmp 0xa6c7
notl %edi
jmp 0xa6b3
movl %edi, %ecx
sarl %cl, %eax
jmp 0xa6c5
notl %eax
andl %eax, %edi
jmp 0xa6c7
notl %eax
orl %eax, %edi
jmp 0xa6c7
xorl %eax, %edi
jmp 0xa6c7
movl %edi, %ecx
shrl %cl, %eax
movl %eax, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0x30e7
movl $0xfffffff2, %edi       # imm = 0xFFFFFFF2
movl %eax, %esi
movl $0x1, %edx
addq $0x70, %rsp
popq %rbx
popq %r14
popq %rbp
jmp 0x30e7
leaq 0x8c55(%rip), %rsi      # 0x1334b
leaq 0x91eb(%rip), %rdx      # 0x138e8
leaq 0x91ab(%rip), %rcx      # 0x138af
movq %rsp, %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x21e0
movq %r14, %rdi
movl %ebx, %esi
callq 0x2643
leaq 0x8c29(%rip), %rsi      # 0x1334b
leaq 0x91bf(%rip), %rdx      # 0x138e8
leaq 0x917f(%rip), %rcx      # 0x138af
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21e0
movq %rbx, %rdi
movl %r14d, %esi
callq 0x2643
leaq 0x8bfc(%rip), %rsi      # 0x1334b
leaq 0x9192(%rip), %rdx      # 0x138e8
leaq 0x9152(%rip), %rcx      # 0x138af
movq %rsp, %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x21e0
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2643
leaq 0x9173(%rip), %rdi      # 0x138ee
jmp 0xa714