
psaux.nostrip.sys:     file format pei-i386

Disassembly of section .text:

00011000 <_MouseSynchronizeRoutine@4>:
static BOOLEAN AlreadyOpened = FALSE;

BOOLEAN STDCALL
MouseSynchronizeRoutine(PVOID Context)
{
   11000:	55                   	push   %ebp
   PIRP Irp = (PIRP)Context;
   PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
   ULONG NrToRead         = stk->Parameters.Read.Length/sizeof(MOUSE_INPUT_DATA);

   if ((stk->Parameters.Read.Length/sizeof(MOUSE_INPUT_DATA))==NrToRead)
   {
      return(TRUE);
   }

   MouseDataRequired=stk->Parameters.Read.Length/sizeof(MOUSE_INPUT_DATA);
   MouseDataRead=NrToRead;
   CurrentIrp=Irp;

   return(FALSE);
}
   11001:	b8 01 00 00 00       	mov    $0x1,%eax
   11006:	89 e5                	mov    %esp,%ebp
   11008:	5d                   	pop    %ebp
   11009:	c2 04 00             	ret    $0x4
   1100c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011010 <_PS2MouseStartIo@8>:

VOID STDCALL
PS2MouseStartIo(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
   11010:	55                   	push   %ebp
   11011:	89 e5                	mov    %esp,%ebp
   11013:	56                   	push   %esi
   11014:	53                   	push   %ebx
   11015:	83 ec 14             	sub    $0x14,%esp
   11018:	8b 75 08             	mov    0x8(%ebp),%esi
   1101b:	8b 5d 0c             	mov    0xc(%ebp),%ebx
   PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
   1101e:	8b 46 28             	mov    0x28(%esi),%eax

   if (KeSynchronizeExecution(DeviceExtension->MouseInterrupt, MouseSynchronizeRoutine, Irp))
   11021:	53                   	push   %ebx
   11022:	68 00 10 01 00       	push   $0x11000
   11027:	8b 88 48 06 00 00    	mov    0x648(%eax),%ecx
   1102d:	51                   	push   %ecx
   1102e:	e8 ed 16 00 00       	call   12720 <_KeSynchronizeExecution@12>
   11033:	5a                   	pop    %edx
   11034:	84 c0                	test   %al,%al
   11036:	75 09                	jne    11041 <_PS2MouseStartIo@8+0x31>
     {
        KIRQL oldIrql;
	Irp->IoStatus.Status = STATUS_SUCCESS;
	Irp->IoStatus.Information = 0;
	IoCompleteRequest(Irp, IO_NO_INCREMENT);
	oldIrql = KeGetCurrentIrql();
        if (oldIrql < DISPATCH_LEVEL)
          {
            KeRaiseIrql (DISPATCH_LEVEL, &oldIrql);
            IoStartNextPacket (DeviceObject, FALSE);
            KeLowerIrql(oldIrql);
	  }
        else
          {
            IoStartNextPacket (DeviceObject, FALSE);
	  }
     }
}
   11038:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1103b:	5b                   	pop    %ebx
   1103c:	5e                   	pop    %esi
   1103d:	5d                   	pop    %ebp
   1103e:	c2 08 00             	ret    $0x8
   11041:	c7 43 18 00 00 00 00 	movl   $0x0,0x18(%ebx)
   11048:	c7 43 1c 00 00 00 00 	movl   $0x0,0x1c(%ebx)
   1104f:	51                   	push   %ecx
   11050:	51                   	push   %ecx
   11051:	6a 00                	push   $0x0
   11053:	53                   	push   %ebx
   11054:	e8 d7 16 00 00       	call   12730 <_IoCompleteRequest@8>
   11059:	58                   	pop    %eax
   1105a:	5a                   	pop    %edx
   1105b:	e8 10 18 00 00       	call   12870 <_KeGetCurrentIrql@0>
   11060:	3c 01                	cmp    $0x1,%al
   11062:	88 45 f7             	mov    %al,0xfffffff7(%ebp)
   11065:	77 2d                	ja     11094 <_PS2MouseStartIo@8+0x84>
   11067:	50                   	push   %eax
   11068:	50                   	push   %eax
   11069:	8d 45 f7             	lea    0xfffffff7(%ebp),%eax
   1106c:	50                   	push   %eax
   1106d:	6a 02                	push   $0x2
   1106f:	e8 0c 18 00 00       	call   12880 <_KeRaiseIrql@8>
   11074:	6a 00                	push   $0x0
   11076:	56                   	push   %esi
   11077:	e8 c4 16 00 00       	call   12740 <_IoStartNextPacket@8>
   1107c:	31 c0                	xor    %eax,%eax
   1107e:	53                   	push   %ebx
   1107f:	8a 45 f7             	mov    0xfffffff7(%ebp),%al
   11082:	50                   	push   %eax
   11083:	e8 08 18 00 00       	call   12890 <_KeLowerIrql@4>
   11088:	83 c4 0c             	add    $0xc,%esp
   1108b:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1108e:	5b                   	pop    %ebx
   1108f:	5e                   	pop    %esi
   11090:	5d                   	pop    %ebp
   11091:	c2 08 00             	ret    $0x8
   11094:	51                   	push   %ecx
   11095:	51                   	push   %ecx
   11096:	6a 00                	push   $0x0
   11098:	56                   	push   %esi
   11099:	e8 a2 16 00 00       	call   12740 <_IoStartNextPacket@8>
   1109e:	58                   	pop    %eax
   1109f:	5a                   	pop    %edx
   110a0:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   110a3:	5b                   	pop    %ebx
   110a4:	5e                   	pop    %esi
   110a5:	5d                   	pop    %ebp
   110a6:	c2 08 00             	ret    $0x8
   110a9:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

000110b0 <_PS2MouseDispatch@8>:

NTSTATUS STDCALL
PS2MouseDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
{
   110b0:	55                   	push   %ebp
   110b1:	89 e5                	mov    %esp,%ebp
   110b3:	56                   	push   %esi
   110b4:	53                   	push   %ebx
   110b5:	8b 5d 0c             	mov    0xc(%ebp),%ebx
   PIO_STACK_LOCATION stk = IoGetCurrentIrpStackLocation(Irp);
   110b8:	8b 43 60             	mov    0x60(%ebx),%eax
   NTSTATUS Status;

   switch (stk->MajorFunction)
   110bb:	8a 00                	mov    (%eax),%al
   110bd:	25 ff 00 00 00       	and    $0xff,%eax
   110c2:	85 c0                	test   %eax,%eax
   110c4:	74 4e                	je     11114 <_PS2MouseDispatch@8+0x64>
     {
      case IRP_MJ_CREATE:
	if (AlreadyOpened == TRUE)
	  {
	     Status = STATUS_SUCCESS;
	  }
	else
	  {
	     Status = STATUS_SUCCESS;
	     AlreadyOpened = TRUE;
	  }
	break;
	
      case IRP_MJ_CLOSE:
        Status = STATUS_SUCCESS;
   110c6:	31 f6                	xor    %esi,%esi
   110c8:	83 f8 02             	cmp    $0x2,%eax
   110cb:	74 59                	je     11126 <_PS2MouseDispatch@8+0x76>
	break;

      default:
        DPRINT1("NOT IMPLEMENTED\n");
   110cd:	50                   	push   %eax
   110ce:	6a 5d                	push   $0x5d
   110d0:	68 00 40 01 00       	push   $0x14000
   110d5:	68 08 40 01 00       	push   $0x14008
   110da:	e8 21 17 00 00       	call   12800 <_DbgPrint>
   110df:	c7 04 24 11 40 01 00 	movl   $0x14011,(%esp)
        Status = STATUS_NOT_IMPLEMENTED;
   110e6:	be 02 00 00 c0       	mov    $0xc0000002,%esi
   110eb:	e8 10 17 00 00       	call   12800 <_DbgPrint>
	break;
   110f0:	83 c4 10             	add    $0x10,%esp
     }

   if (Status==STATUS_PENDING)
     {
	IoMarkIrpPending(Irp);
     }
   else
     {
        Irp->IoStatus.Status = Status;
   110f3:	89 73 18             	mov    %esi,0x18(%ebx)
	Irp->IoStatus.Information = 0;
   110f6:	c7 43 1c 00 00 00 00 	movl   $0x0,0x1c(%ebx)
	IoCompleteRequest(Irp,IO_NO_INCREMENT);
   110fd:	50                   	push   %eax
   110fe:	50                   	push   %eax
   110ff:	6a 00                	push   $0x0
   11101:	53                   	push   %ebx
   11102:	e8 29 16 00 00       	call   12730 <_IoCompleteRequest@8>
   11107:	5b                   	pop    %ebx
   11108:	58                   	pop    %eax
     }
   return(Status);
}
   11109:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1110c:	89 f0                	mov    %esi,%eax
   1110e:	5b                   	pop    %ebx
   1110f:	5e                   	pop    %esi
   11110:	5d                   	pop    %ebp
   11111:	c2 08 00             	ret    $0x8
   11114:	31 f6                	xor    %esi,%esi
   11116:	80 3d 00 50 01 00 01 	cmpb   $0x1,0x15000
   1111d:	74 07                	je     11126 <_PS2MouseDispatch@8+0x76>
   1111f:	c6 05 00 50 01 00 01 	movb   $0x1,0x15000
   11126:	89 73 18             	mov    %esi,0x18(%ebx)
   11129:	c7 43 1c 00 00 00 00 	movl   $0x0,0x1c(%ebx)
   11130:	50                   	push   %eax
   11131:	50                   	push   %eax
   11132:	6a 00                	push   $0x0
   11134:	53                   	push   %ebx
   11135:	e8 f6 15 00 00       	call   12730 <_IoCompleteRequest@8>
   1113a:	5b                   	pop    %ebx
   1113b:	58                   	pop    %eax
   1113c:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1113f:	89 f0                	mov    %esi,%eax
   11141:	5b                   	pop    %ebx
   11142:	5e                   	pop    %esi
   11143:	5d                   	pop    %ebp
   11144:	c2 08 00             	ret    $0x8
   11147:	89 f6                	mov    %esi,%esi
   11149:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011150 <_PS2MouseInitializeDataQueue@4>:

BOOLEAN STDCALL PS2MouseInitializeDataQueue(PVOID Context)
{
   11150:	55                   	push   %ebp
   return(TRUE);
}
   11151:	b8 01 00 00 00       	mov    $0x1,%eax
   11156:	89 e5                	mov    %esp,%ebp
   11158:	5d                   	pop    %ebp
   11159:	c2 04 00             	ret    $0x4
   1115c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011160 <_PS2MouseInternalDeviceControl@8>:

NTSTATUS STDCALL
PS2MouseInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
{
   11160:	55                   	push   %ebp
   11161:	89 e5                	mov    %esp,%ebp
   11163:	57                   	push   %edi
   11164:	56                   	push   %esi
   11165:	53                   	push   %ebx
   11166:	83 ec 0c             	sub    $0xc,%esp
   PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
   PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp);
   NTSTATUS status;

   switch(Stack->Parameters.DeviceIoControl.IoControlCode)
   {
      case IOCTL_INTERNAL_MOUSE_CONNECT:

         DeviceExtension->ClassInformation =
            *((PCLASS_INFORMATION)Stack->Parameters.DeviceIoControl.Type3InputBuffer);

         // Reinitialize the port input data queue synchronously
         KeSynchronizeExecution(DeviceExtension->MouseInterrupt,
            PS2MouseInitializeDataQueue, DeviceExtension);

         status = STATUS_SUCCESS;
         break;

      default:
         status = STATUS_INVALID_DEVICE_REQUEST;
   11169:	bb 10 00 00 c0       	mov    $0xc0000010,%ebx
   1116e:	8b 75 0c             	mov    0xc(%ebp),%esi
   11171:	8b 7d 08             	mov    0x8(%ebp),%edi
   11174:	8b 46 60             	mov    0x60(%esi),%eax
   11177:	8b 4f 28             	mov    0x28(%edi),%ecx
   1117a:	81 78 0c 03 02 0f 00 	cmpl   $0xf0203,0xc(%eax)
   11181:	74 41                	je     111c4 <_PS2MouseInternalDeviceControl@8+0x64>
         break;
   }

   Irp->IoStatus.Status = status;
   11183:	89 5e 18             	mov    %ebx,0x18(%esi)
   if (status == STATUS_PENDING) {
   11186:	81 fb 03 01 00 00    	cmp    $0x103,%ebx
   1118c:	74 18                	je     111a6 <_PS2MouseInternalDeviceControl@8+0x46>
      IoMarkIrpPending(Irp);
      IoStartPacket(DeviceObject, Irp, NULL, NULL);
   } else {
      IoCompleteRequest(Irp, IO_NO_INCREMENT);
   1118e:	51                   	push   %ecx
   1118f:	51                   	push   %ecx
   11190:	6a 00                	push   $0x0
   11192:	56                   	push   %esi
   11193:	e8 98 15 00 00       	call   12730 <_IoCompleteRequest@8>
   11198:	58                   	pop    %eax
   }

   return status;
}
   11199:	89 d8                	mov    %ebx,%eax
   1119b:	5a                   	pop    %edx
   1119c:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1119f:	5b                   	pop    %ebx
   111a0:	5e                   	pop    %esi
   111a1:	5f                   	pop    %edi
   111a2:	5d                   	pop    %ebp
   111a3:	c2 08 00             	ret    $0x8
   111a6:	8b 46 60             	mov    0x60(%esi),%eax
   111a9:	80 48 03 01          	orb    $0x1,0x3(%eax)
   111ad:	6a 00                	push   $0x0
   111af:	6a 00                	push   $0x0
   111b1:	56                   	push   %esi
   111b2:	57                   	push   %edi
   111b3:	e8 98 15 00 00       	call   12750 <_IoStartPacket@16>
   111b8:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   111bb:	89 d8                	mov    %ebx,%eax
   111bd:	5b                   	pop    %ebx
   111be:	5e                   	pop    %esi
   111bf:	5f                   	pop    %edi
   111c0:	5d                   	pop    %ebp
   111c1:	c2 08 00             	ret    $0x8
   111c4:	8b 40 10             	mov    0x10(%eax),%eax
   111c7:	31 db                	xor    %ebx,%ebx
   111c9:	8b 50 04             	mov    0x4(%eax),%edx
   111cc:	8b 00                	mov    (%eax),%eax
   111ce:	89 81 40 06 00 00    	mov    %eax,0x640(%ecx)
   111d4:	89 91 44 06 00 00    	mov    %edx,0x644(%ecx)
   111da:	50                   	push   %eax
   111db:	51                   	push   %ecx
   111dc:	68 50 11 01 00       	push   $0x11150
   111e1:	8b 81 48 06 00 00    	mov    0x648(%ecx),%eax
   111e7:	50                   	push   %eax
   111e8:	e8 33 15 00 00       	call   12720 <_KeSynchronizeExecution@12>
   111ed:	58                   	pop    %eax
   111ee:	eb 93                	jmp    11183 <_PS2MouseInternalDeviceControl@8+0x23>

000111f0 <_PS2MouseIsrDpc>:

VOID PS2MouseIsrDpc(PKDPC Dpc, PDEVICE_OBJECT DeviceObject, PIRP Irp, PVOID Context)
{
   111f0:	55                   	push   %ebp
   111f1:	89 e5                	mov    %esp,%ebp
   111f3:	56                   	push   %esi
   111f4:	53                   	push   %ebx
   PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
   111f5:	8b 45 0c             	mov    0xc(%ebp),%eax
   111f8:	8b 58 28             	mov    0x28(%eax),%ebx
   ULONG Queue;

   Queue = DeviceExtension->ActiveQueue % 2;
   111fb:	8b 73 04             	mov    0x4(%ebx),%esi
   InterlockedIncrement((PLONG)&DeviceExtension->ActiveQueue);
   111fe:	8d 4b 04             	lea    0x4(%ebx),%ecx
   11201:	83 e6 01             	and    $0x1,%esi
   11204:	e8 57 15 00 00       	call   12760 <@InterlockedIncrement@4>
   (*(PSERVICE_CALLBACK_ROUTINE)DeviceExtension->ClassInformation.CallBack)(
   11209:	8d 44 b3 08          	lea    0x8(%ebx,%esi,4),%eax
   1120d:	50                   	push   %eax
   1120e:	8d 04 36             	lea    (%esi,%esi,1),%eax
   11211:	01 f0                	add    %esi,%eax
   11213:	6a 00                	push   $0x0
   11215:	c1 e0 08             	shl    $0x8,%eax
   11218:	8d 44 18 10          	lea    0x10(%eax,%ebx,1),%eax
   1121c:	50                   	push   %eax
   1121d:	8b 83 40 06 00 00    	mov    0x640(%ebx),%eax
   11223:	50                   	push   %eax
   11224:	ff 93 44 06 00 00    	call   *0x644(%ebx)
			DeviceExtension->ClassInformation.DeviceObject,
			DeviceExtension->MouseInputData[Queue],
			NULL,
			&DeviceExtension->InputDataCount[Queue]);
   DeviceExtension->InputDataCount[Queue] = 0;
   1122a:	c7 44 b3 08 00 00 00 	movl   $0x0,0x8(%ebx,%esi,4)
   11231:	00 
   11232:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11235:	5b                   	pop    %ebx
   11236:	5e                   	pop    %esi
   11237:	5d                   	pop    %ebp
   11238:	c3                   	ret    
   11239:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00011240 <_DriverEntry@8>:
}

/* Maximum value plus one for \Device\PointerClass* device name */
#define POINTER_PORTS_MAXIMUM	8
/* Letter count for POINTER_PORTS_MAXIMUM variable * sizeof(WCHAR) */
#define SUFFIX_MAXIMUM_SIZE		(1 * sizeof(WCHAR))

/* This is almost the same routine as in sermouse.c. */
STATIC PDEVICE_OBJECT
AllocatePointerDevice(PDRIVER_OBJECT DriverObject)
{
	PDEVICE_OBJECT DeviceObject;
	UNICODE_STRING DeviceName;
	UNICODE_STRING SuffixString;
	PDEVICE_EXTENSION DeviceExtension;
	ULONG Suffix;
	NTSTATUS Status;

	/* Allocate buffer for full device name */   
	RtlInitUnicodeString(&DeviceName, NULL);
	DeviceName.MaximumLength = sizeof(DD_MOUSE_DEVICE_NAME_U) + SUFFIX_MAXIMUM_SIZE + sizeof(UNICODE_NULL);
	DeviceName.Buffer = ExAllocatePool(PagedPool, DeviceName.MaximumLength);
	RtlAppendUnicodeToString(&DeviceName, DD_MOUSE_DEVICE_NAME_U);

	/* Allocate buffer for device name suffix */
	RtlInitUnicodeString(&SuffixString, NULL);
	SuffixString.MaximumLength = SUFFIX_MAXIMUM_SIZE + sizeof(UNICODE_NULL);
	SuffixString.Buffer = ExAllocatePool(PagedPool, SuffixString.MaximumLength);

	/* Generate full qualified name with suffix */
	for (Suffix = 0; Suffix < POINTER_PORTS_MAXIMUM; ++Suffix)
	{
		ANSI_STRING DebugString;

		RtlIntegerToUnicodeString(Suffix, 10, &SuffixString);
		RtlAppendUnicodeToString(&DeviceName, SuffixString.Buffer);
		// FIXME: this isn't really a serial mouse port driver
		Status = IoCreateDevice(DriverObject, sizeof(DEVICE_EXTENSION),
			&DeviceName, FILE_DEVICE_SERIAL_MOUSE_PORT, 0, TRUE, &DeviceObject);
		RtlUnicodeStringToAnsiString(&DebugString, &DeviceName, TRUE);
		DPRINT("%s", DebugString.Buffer);
		RtlFreeAnsiString(&DebugString);
		/* Device successfully created, leave the cyclus */
		if (NT_SUCCESS(Status))
			break;
		DeviceName.Length -= SuffixString.Length;
	}
 
	ExFreePool(DeviceName.Buffer);
	ExFreePool(SuffixString.Buffer);

	/* Couldn't create device */
	if (!NT_SUCCESS(Status))
	{
		return NULL;
	}

	DeviceObject->Flags = DeviceObject->Flags | DO_BUFFERED_IO;

	DeviceExtension = DeviceObject->DeviceExtension;
	KeInitializeDpc(&DeviceExtension->IsrDpc, (PKDEFERRED_ROUTINE)PS2MouseIsrDpc, DeviceObject);

	return DeviceObject;
}

NTSTATUS STDCALL
DriverEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath)
{
   11240:	55                   	push   %ebp
   11241:	89 e5                	mov    %esp,%ebp
   11243:	57                   	push   %edi
   11244:	56                   	push   %esi
   11245:	53                   	push   %ebx
   11246:	83 ec 2c             	sub    $0x2c,%esp
   PDEVICE_OBJECT DeviceObject;

   if (DetectPS2Port() == TRUE) {
   11249:	e8 f2 0f 00 00       	call   12240 <_DetectPS2Port>
   1124e:	fe c8                	dec    %al
   11250:	0f 85 45 01 00 00    	jne    1139b <_DriverEntry@8+0x15b>
     DPRINT("PS2 Port Driver version 0.0.2\n");
   } else {
     DPRINT1("PS2 port not found.\n");
     return STATUS_UNSUCCESSFUL;
   }

   DriverObject->MajorFunction[IRP_MJ_CREATE] = PS2MouseDispatch;
   11256:	8b 45 08             	mov    0x8(%ebp),%eax
   11259:	8d 75 e8             	lea    0xffffffe8(%ebp),%esi
   1125c:	c7 40 38 b0 10 01 00 	movl   $0x110b0,0x38(%eax)
   DriverObject->MajorFunction[IRP_MJ_CLOSE]  = PS2MouseDispatch;
   11263:	c7 40 40 b0 10 01 00 	movl   $0x110b0,0x40(%eax)
   DriverObject->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = PS2MouseInternalDeviceControl;
   1126a:	c7 40 74 60 11 01 00 	movl   $0x11160,0x74(%eax)
   DriverObject->DriverStartIo                = PS2MouseStartIo;
   11271:	c7 40 30 10 10 01 00 	movl   $0x11010,0x30(%eax)
   11278:	53                   	push   %ebx
   11279:	53                   	push   %ebx
   1127a:	8d 5d e8             	lea    0xffffffe8(%ebp),%ebx
   1127d:	6a 00                	push   $0x0
   1127f:	53                   	push   %ebx
   11280:	e8 eb 14 00 00       	call   12770 <_RtlInitUnicodeString@8>
   11285:	66 c7 45 ea 2e 00    	movw   $0x2e,0xffffffea(%ebp)
   1128b:	6a 2e                	push   $0x2e
   1128d:	6a 01                	push   $0x1
   1128f:	e8 ec 14 00 00       	call   12780 <_ExAllocatePool@8>
   11294:	68 24 40 01 00       	push   $0x14024
   11299:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
   1129c:	53                   	push   %ebx
   1129d:	e8 ee 14 00 00       	call   12790 <_RtlAppendUnicodeToString@8>
   112a2:	8d 5d e0             	lea    0xffffffe0(%ebp),%ebx
   112a5:	6a 00                	push   $0x0
   112a7:	53                   	push   %ebx
   112a8:	e8 c3 14 00 00       	call   12770 <_RtlInitUnicodeString@8>
   112ad:	89 5d c8             	mov    %ebx,0xffffffc8(%ebp)
   112b0:	66 c7 45 e2 04 00    	movw   $0x4,0xffffffe2(%ebp)
   112b6:	31 db                	xor    %ebx,%ebx
   112b8:	6a 04                	push   $0x4
   112ba:	6a 01                	push   $0x1
   112bc:	e8 bf 14 00 00       	call   12780 <_ExAllocatePool@8>
   112c1:	5a                   	pop    %edx
   112c2:	59                   	pop    %ecx
   112c3:	89 45 e4             	mov    %eax,0xffffffe4(%ebp)
   112c6:	8d 45 d0             	lea    0xffffffd0(%ebp),%eax
   112c9:	89 45 cc             	mov    %eax,0xffffffcc(%ebp)
   112cc:	8d 74 26 00          	lea    0x0(%esi),%esi
   112d0:	8b 4d c8             	mov    0xffffffc8(%ebp),%ecx
   112d3:	57                   	push   %edi
   112d4:	51                   	push   %ecx
   112d5:	6a 0a                	push   $0xa
   112d7:	53                   	push   %ebx
   112d8:	e8 c3 14 00 00       	call   127a0 <_RtlIntegerToUnicodeString@12>
   112dd:	8d 45 e0             	lea    0xffffffe0(%ebp),%eax
   112e0:	89 45 c8             	mov    %eax,0xffffffc8(%ebp)
   112e3:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
   112e6:	52                   	push   %edx
   112e7:	50                   	push   %eax
   112e8:	8d 45 e8             	lea    0xffffffe8(%ebp),%eax
   112eb:	50                   	push   %eax
   112ec:	e8 9f 14 00 00       	call   12790 <_RtlAppendUnicodeToString@8>
   112f1:	8d 45 dc             	lea    0xffffffdc(%ebp),%eax
   112f4:	89 04 24             	mov    %eax,(%esp)
   112f7:	8b 45 08             	mov    0x8(%ebp),%eax
   112fa:	6a 01                	push   $0x1
   112fc:	6a 00                	push   $0x0
   112fe:	6a 1a                	push   $0x1a
   11300:	56                   	push   %esi
   11301:	68 6c 06 00 00       	push   $0x66c
   11306:	50                   	push   %eax
   11307:	e8 a4 14 00 00       	call   127b0 <_IoCreateDevice@28>
   1130c:	89 c7                	mov    %eax,%edi
   1130e:	8b 45 cc             	mov    0xffffffcc(%ebp),%eax
   11311:	6a 01                	push   $0x1
   11313:	56                   	push   %esi
   11314:	50                   	push   %eax
   11315:	e8 a6 14 00 00       	call   127c0 <_RtlUnicodeStringToAnsiString@12>
   1131a:	50                   	push   %eax
   1131b:	50                   	push   %eax
   1131c:	8d 45 d0             	lea    0xffffffd0(%ebp),%eax
   1131f:	89 45 cc             	mov    %eax,0xffffffcc(%ebp)
   11322:	50                   	push   %eax
   11323:	e8 a8 14 00 00       	call   127d0 <_RtlFreeAnsiString@4>
   11328:	83 c4 0c             	add    $0xc,%esp
   1132b:	85 ff                	test   %edi,%edi
   1132d:	79 11                	jns    11340 <_DriverEntry@8+0x100>
   1132f:	8b 45 e8             	mov    0xffffffe8(%ebp),%eax
   11332:	43                   	inc    %ebx
   11333:	66 2b 45 e0          	sub    0xffffffe0(%ebp),%ax
   11337:	83 fb 07             	cmp    $0x7,%ebx
   1133a:	66 89 45 e8          	mov    %ax,0xffffffe8(%ebp)
   1133e:	76 90                	jbe    112d0 <_DriverEntry@8+0x90>
   11340:	83 ec 0c             	sub    $0xc,%esp
   11343:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
   11346:	50                   	push   %eax
   11347:	e8 94 14 00 00       	call   127e0 <_ExFreePool@4>
   1134c:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
   1134f:	50                   	push   %eax
   11350:	e8 8b 14 00 00       	call   127e0 <_ExFreePool@4>
   11355:	31 c0                	xor    %eax,%eax
   11357:	83 c4 0c             	add    $0xc,%esp
   1135a:	85 ff                	test   %edi,%edi
   1135c:	78 25                	js     11383 <_DriverEntry@8+0x143>
   1135e:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11361:	8b 78 1c             	mov    0x1c(%eax),%edi
   11364:	83 cf 04             	or     $0x4,%edi
   11367:	89 78 1c             	mov    %edi,0x1c(%eax)
   1136a:	56                   	push   %esi
   1136b:	50                   	push   %eax
   1136c:	68 f0 11 01 00       	push   $0x111f0
   11371:	8b 40 28             	mov    0x28(%eax),%eax
   11374:	05 4c 06 00 00       	add    $0x64c,%eax
   11379:	50                   	push   %eax
   1137a:	e8 71 14 00 00       	call   127f0 <_KeInitializeDpc@12>
   1137f:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11382:	5b                   	pop    %ebx

   DeviceObject = AllocatePointerDevice(DriverObject);

   SetupMouse(DeviceObject, RegistryPath);
   11383:	8b 55 0c             	mov    0xc(%ebp),%edx
   11386:	51                   	push   %ecx
   11387:	51                   	push   %ecx
   11388:	52                   	push   %edx
   11389:	50                   	push   %eax
   1138a:	e8 71 0d 00 00       	call   12100 <_SetupMouse>

   return(STATUS_SUCCESS);
   1138f:	31 c0                	xor    %eax,%eax
}
   11391:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11394:	5b                   	pop    %ebx
   11395:	5e                   	pop    %esi
   11396:	5f                   	pop    %edi
   11397:	5d                   	pop    %ebp
   11398:	c2 08 00             	ret    $0x8
   1139b:	56                   	push   %esi
   1139c:	68 ef 00 00 00       	push   $0xef
   113a1:	68 00 40 01 00       	push   $0x14000
   113a6:	68 08 40 01 00       	push   $0x14008
   113ab:	e8 50 14 00 00       	call   12800 <_DbgPrint>
   113b0:	c7 04 24 4e 40 01 00 	movl   $0x1404e,(%esp)
   113b7:	e8 44 14 00 00       	call   12800 <_DbgPrint>
   113bc:	b8 01 00 00 c0       	mov    $0xc0000001,%eax
   113c1:	eb ce                	jmp    11391 <_DriverEntry@8+0x151>
   113c3:	90                   	nop    
   113c4:	90                   	nop    
   113c5:	90                   	nop    
   113c6:	90                   	nop    
   113c7:	90                   	nop    
   113c8:	90                   	nop    
   113c9:	90                   	nop    
   113ca:	90                   	nop    
   113cb:	90                   	nop    
   113cc:	90                   	nop    
   113cd:	90                   	nop    
   113ce:	90                   	nop    
   113cf:	90                   	nop    

000113d0 <_handle_event>:
   action. It requires that we hold the keyboard controller spinlock. */

int controller_read_data(void);
unsigned handle_event(void)
{
   113d0:	55                   	push   %ebp
   113d1:	89 e5                	mov    %esp,%ebp
   113d3:	56                   	push   %esi
   113d4:	53                   	push   %ebx
  unsigned status = controller_read_status();
   113d5:	31 db                	xor    %ebx,%ebx
   113d7:	83 ec 0c             	sub    $0xc,%esp
  unsigned int work;
  
  for(work = 0; (work < 10000) && ((status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) != 0); work++) 
   113da:	31 f6                	xor    %esi,%esi
   113dc:	6a 64                	push   $0x64
   113de:	e8 bd 14 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   113e3:	88 c3                	mov    %al,%bl
   113e5:	83 c4 0c             	add    $0xc,%esp
   113e8:	f6 c3 01             	test   $0x1,%bl
   113eb:	75 09                	jne    113f6 <_handle_event+0x26>
  {
    unsigned scancode;

    scancode = controller_read_input();
 
#if 0
    /* Ignore error bytes. */

    if((status &(CONTROLLER_STATUS_GENERAL_TIMEOUT |
                   CONTROLLER_STATUS_PARITY_ERROR)) == 0)
#endif
    {
      if((status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) != 0)
      {
//        mouse_handle_event(scancode); we just use the mouse handler directly..
      }
      else
      {
//        keyboard_handle_event(scancode);
      }
    }
    
    status = controller_read_status();
    
  }

  if(work == 10000)
  {
    DbgPrint("PSAUX: Keyboard controller jammed\n");
  }
  
  return status;
}
   113ed:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   113f0:	89 d8                	mov    %ebx,%eax
   113f2:	5b                   	pop    %ebx
   113f3:	5e                   	pop    %esi
   113f4:	5d                   	pop    %ebp
   113f5:	c3                   	ret    
   113f6:	83 ec 0c             	sub    $0xc,%esp
   113f9:	31 db                	xor    %ebx,%ebx
   113fb:	46                   	inc    %esi
   113fc:	6a 60                	push   $0x60
   113fe:	e8 9d 14 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   11403:	6a 64                	push   $0x64
   11405:	e8 96 14 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   1140a:	83 c4 0c             	add    $0xc,%esp
   1140d:	88 c3                	mov    %al,%bl
   1140f:	81 fe 0f 27 00 00    	cmp    $0x270f,%esi
   11415:	77 05                	ja     1141c <_handle_event+0x4c>
   11417:	f6 c3 01             	test   $0x1,%bl
   1141a:	75 da                	jne    113f6 <_handle_event+0x26>
   1141c:	81 fe 10 27 00 00    	cmp    $0x2710,%esi
   11422:	75 c9                	jne    113ed <_handle_event+0x1d>
   11424:	83 ec 0c             	sub    $0xc,%esp
   11427:	68 70 40 01 00       	push   $0x14070
   1142c:	e8 cf 13 00 00       	call   12800 <_DbgPrint>
   11431:	83 c4 10             	add    $0x10,%esp
   11434:	eb b7                	jmp    113ed <_handle_event+0x1d>
   11436:	8d 76 00             	lea    0x0(%esi),%esi
   11439:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011440 <_controller_wait>:

/* Wait for keyboard controller input buffer to drain.
   Quote from PS/2 System Reference Manual:
     "Address hex 0060 and address hex 0064 should be written only
     when the input-buffer-full bit and output-buffer-full bit in the
     Controller Status register are set 0."  */

void controller_wait(void)
{
   11440:	55                   	push   %ebp
   11441:	89 e5                	mov    %esp,%ebp
   11443:	53                   	push   %ebx
   11444:	83 ec 14             	sub    $0x14,%esp
  unsigned long timeout;
  LARGE_INTEGER Millisecond_Timeout;

  Millisecond_Timeout.QuadPart = -10000L;

  for(timeout = 0; timeout < CONTROLLER_TIMEOUT; timeout++)
   11447:	31 db                	xor    %ebx,%ebx
   11449:	c7 45 f0 f0 d8 ff ff 	movl   $0xffffd8f0,0xfffffff0(%ebp)
   11450:	c7 45 f4 ff ff ff ff 	movl   $0xffffffff,0xfffffff4(%ebp)
   11457:	eb 1f                	jmp    11478 <_controller_wait+0x38>
   11459:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
  {
    // "handle_keyboard_event()" will handle any incoming events
    // while we wait -- keypresses or mouse movement

    unsigned char status = handle_event();
                
    if((status & CONTROLLER_STATUS_INPUT_BUFFER_FULL) == 0) return;
    
    // Sleep for one millisecond
    KeDelayExecutionThread (KernelMode, FALSE, &Millisecond_Timeout);
   11460:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
   11463:	52                   	push   %edx
   11464:	50                   	push   %eax
   11465:	6a 00                	push   $0x0
   11467:	6a 00                	push   $0x0
   11469:	e8 a2 13 00 00       	call   12810 <_KeDelayExecutionThread@12>
   1146e:	43                   	inc    %ebx
   1146f:	58                   	pop    %eax
   11470:	81 fb f9 00 00 00    	cmp    $0xf9,%ebx
   11476:	77 0e                	ja     11486 <_controller_wait+0x46>
   11478:	e8 53 ff ff ff       	call   113d0 <_handle_event>
   1147d:	a8 02                	test   $0x2,%al
   1147f:	75 df                	jne    11460 <_controller_wait+0x20>
  }
  
  DbgPrint("PSAUX: Keyboard timed out\n");
}
   11481:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   11484:	c9                   	leave  
   11485:	c3                   	ret    
   11486:	83 ec 0c             	sub    $0xc,%esp
   11489:	68 93 40 01 00       	push   $0x14093
   1148e:	e8 6d 13 00 00       	call   12800 <_DbgPrint>
   11493:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   11496:	c9                   	leave  
   11497:	c3                   	ret    
   11498:	90                   	nop    
   11499:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

000114a0 <_controller_read_data>:

/* Wait for input from the keyboard controller. */

int controller_wait_for_input(void)
{
  int timeout;
  LARGE_INTEGER Millisecond_Timeout;

  Millisecond_Timeout.QuadPart = -10000L;

  for(timeout = KEYBOARD_INIT_TIMEOUT; timeout > 0; timeout--)
  {
    int return_value = controller_read_data();

    if(return_value >= 0) return return_value;

    // Sleep for one millisecond
    KeDelayExecutionThread (KernelMode, FALSE, &Millisecond_Timeout);
  }

  DbgPrint("PSAUX: Timed out on waiting for input from controller\n");
  return -1;
}

/* Write a command word to the keyboard controller. */

void controller_write_command_word(unsigned data)
{
  controller_wait();
  controller_write_command(data);
}

/* Write an output word to the keyboard controller. */

void controller_write_output_word(unsigned data)
{
  controller_wait();
  controller_write_output(data);
}

/* Empty the keyboard input buffer. */

void keyboard_clear_input(void)
{
  int max_read;

  for(max_read = 0; max_read < 100; max_read++)
  {
    if(controller_read_data() == KEYBOARD_NO_DATA)
    {
      break;
    }
  }
}

/* Read data from the keyboard controller. */

int controller_read_data(void)
{
   114a0:	55                   	push   %ebp
   114a1:	89 e5                	mov    %esp,%ebp
   114a3:	56                   	push   %esi
   114a4:	53                   	push   %ebx
  int return_value = KEYBOARD_NO_DATA;
  unsigned status;
  
  status = controller_read_status();
   114a5:	31 db                	xor    %ebx,%ebx
   114a7:	83 ec 0c             	sub    $0xc,%esp
   114aa:	83 ce ff             	or     $0xffffffff,%esi
   114ad:	6a 64                	push   $0x64
   114af:	e8 ec 13 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   114b4:	88 c3                	mov    %al,%bl
  if(status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL)
   114b6:	83 c4 0c             	add    $0xc,%esp
   114b9:	f6 c3 01             	test   $0x1,%bl
   114bc:	75 09                	jne    114c7 <_controller_read_data+0x27>
  {
    unsigned data = controller_read_input();
    
    return_value = data;
    if(status &(CONTROLLER_STATUS_GENERAL_TIMEOUT |
                CONTROLLER_STATUS_PARITY_ERROR))
    {
      return_value = KEYBOARD_BAD_DATA;
    }
  }
  return return_value;
}
   114be:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   114c1:	89 f0                	mov    %esi,%eax
   114c3:	5b                   	pop    %ebx
   114c4:	5e                   	pop    %esi
   114c5:	5d                   	pop    %ebp
   114c6:	c3                   	ret    
   114c7:	83 ec 0c             	sub    $0xc,%esp
   114ca:	6a 60                	push   $0x60
   114cc:	e8 cf 13 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   114d1:	25 ff 00 00 00       	and    $0xff,%eax
   114d6:	83 c4 0c             	add    $0xc,%esp
   114d9:	80 e3 c0             	and    $0xc0,%bl
   114dc:	89 c6                	mov    %eax,%esi
   114de:	74 de                	je     114be <_controller_read_data+0x1e>
   114e0:	be fe ff ff ff       	mov    $0xfffffffe,%esi
   114e5:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   114e8:	89 f0                	mov    %esi,%eax
   114ea:	5b                   	pop    %ebx
   114eb:	5e                   	pop    %esi
   114ec:	5d                   	pop    %ebp
   114ed:	c3                   	ret    
   114ee:	89 f6                	mov    %esi,%esi

000114f0 <_controller_wait_for_input>:
   114f0:	55                   	push   %ebp
   114f1:	89 e5                	mov    %esp,%ebp
   114f3:	56                   	push   %esi
   114f4:	53                   	push   %ebx
   114f5:	bb e8 03 00 00       	mov    $0x3e8,%ebx
   114fa:	83 ec 10             	sub    $0x10,%esp
   114fd:	8d 75 f0             	lea    0xfffffff0(%ebp),%esi
   11500:	c7 45 f0 f0 d8 ff ff 	movl   $0xffffd8f0,0xfffffff0(%ebp)
   11507:	c7 45 f4 ff ff ff ff 	movl   $0xffffffff,0xfffffff4(%ebp)
   1150e:	eb 11                	jmp    11521 <_controller_wait_for_input+0x31>
   11510:	50                   	push   %eax
   11511:	56                   	push   %esi
   11512:	6a 00                	push   $0x0
   11514:	6a 00                	push   $0x0
   11516:	e8 f5 12 00 00       	call   12810 <_KeDelayExecutionThread@12>
   1151b:	4b                   	dec    %ebx
   1151c:	59                   	pop    %ecx
   1151d:	85 db                	test   %ebx,%ebx
   1151f:	7e 10                	jle    11531 <_controller_wait_for_input+0x41>
   11521:	e8 7a ff ff ff       	call   114a0 <_controller_read_data>
   11526:	85 c0                	test   %eax,%eax
   11528:	78 e6                	js     11510 <_controller_wait_for_input+0x20>
   1152a:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1152d:	5b                   	pop    %ebx
   1152e:	5e                   	pop    %esi
   1152f:	5d                   	pop    %ebp
   11530:	c3                   	ret    
   11531:	83 ec 0c             	sub    $0xc,%esp
   11534:	68 b0 40 01 00       	push   $0x140b0
   11539:	e8 c2 12 00 00       	call   12800 <_DbgPrint>
   1153e:	83 c8 ff             	or     $0xffffffff,%eax
   11541:	eb e7                	jmp    1152a <_controller_wait_for_input+0x3a>
   11543:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11549:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011550 <_controller_write_command_word>:
   11550:	55                   	push   %ebp
   11551:	89 e5                	mov    %esp,%ebp
   11553:	50                   	push   %eax
   11554:	50                   	push   %eax
   11555:	e8 e6 fe ff ff       	call   11440 <_controller_wait>
   1155a:	50                   	push   %eax
   1155b:	50                   	push   %eax
   1155c:	31 c0                	xor    %eax,%eax
   1155e:	8a 45 08             	mov    0x8(%ebp),%al
   11561:	50                   	push   %eax
   11562:	6a 64                	push   $0x64
   11564:	e8 47 13 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   11569:	c9                   	leave  
   1156a:	c3                   	ret    
   1156b:	90                   	nop    
   1156c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011570 <_controller_write_output_word>:
   11570:	55                   	push   %ebp
   11571:	89 e5                	mov    %esp,%ebp
   11573:	50                   	push   %eax
   11574:	50                   	push   %eax
   11575:	e8 c6 fe ff ff       	call   11440 <_controller_wait>
   1157a:	50                   	push   %eax
   1157b:	50                   	push   %eax
   1157c:	31 c0                	xor    %eax,%eax
   1157e:	8a 45 08             	mov    0x8(%ebp),%al
   11581:	50                   	push   %eax
   11582:	6a 60                	push   $0x60
   11584:	e8 27 13 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   11589:	c9                   	leave  
   1158a:	c3                   	ret    
   1158b:	90                   	nop    
   1158c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011590 <_keyboard_clear_input>:
   11590:	55                   	push   %ebp
   11591:	89 e5                	mov    %esp,%ebp
   11593:	53                   	push   %ebx
   11594:	31 db                	xor    %ebx,%ebx
   11596:	52                   	push   %edx
   11597:	eb 0d                	jmp    115a6 <_keyboard_clear_input+0x16>
   11599:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   115a0:	43                   	inc    %ebx
   115a1:	83 fb 63             	cmp    $0x63,%ebx
   115a4:	7f 08                	jg     115ae <_keyboard_clear_input+0x1e>
   115a6:	e8 f5 fe ff ff       	call   114a0 <_controller_read_data>
   115ab:	40                   	inc    %eax
   115ac:	75 f2                	jne    115a0 <_keyboard_clear_input+0x10>
   115ae:	58                   	pop    %eax
   115af:	5b                   	pop    %ebx
   115b0:	5d                   	pop    %ebp
   115b1:	c3                   	ret    
   115b2:	90                   	nop    
   115b3:	90                   	nop    
   115b4:	90                   	nop    
   115b5:	90                   	nop    
   115b6:	90                   	nop    
   115b7:	90                   	nop    
   115b8:	90                   	nop    
   115b9:	90                   	nop    
   115ba:	90                   	nop    
   115bb:	90                   	nop    
   115bc:	90                   	nop    
   115bd:	90                   	nop    
   115be:	90                   	nop    
   115bf:	90                   	nop    

000115c0 <@ParsePackets@8>:
   115c0:	55                   	push   %ebp
   115c1:	8d 81 10 06 00 00    	lea    0x610(%ecx),%eax
   115c7:	89 e5                	mov    %esp,%ebp
   115c9:	57                   	push   %edi
   115ca:	56                   	push   %esi
   115cb:	53                   	push   %ebx
   115cc:	83 ec 0c             	sub    $0xc,%esp
   115cf:	31 db                	xor    %ebx,%ebx
   115d1:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
   115d4:	c7 45 f0 00 00 00 00 	movl   $0x0,0xfffffff0(%ebp)
   115db:	8a 99 10 06 00 00    	mov    0x610(%ecx),%bl
   115e1:	89 cf                	mov    %ecx,%edi
   115e3:	83 e3 01             	and    $0x1,%ebx
   115e6:	89 d6                	mov    %edx,%esi
   115e8:	89 5a 08             	mov    %ebx,0x8(%edx)
   115eb:	89 d8                	mov    %ebx,%eax
   115ed:	f6 81 10 06 00 00 02 	testb  $0x2,0x610(%ecx)
   115f4:	74 03                	je     115f9 <@ParsePackets@8+0x39>
   115f6:	83 c8 02             	or     $0x2,%eax
   115f9:	89 46 08             	mov    %eax,0x8(%esi)
   115fc:	f6 87 10 06 00 00 04 	testb  $0x4,0x610(%edi)
   11603:	74 03                	je     11608 <@ParsePackets@8+0x48>
   11605:	83 c8 04             	or     $0x4,%eax
   11608:	89 46 08             	mov    %eax,0x8(%esi)
   1160b:	89 c3                	mov    %eax,%ebx
   1160d:	8a 97 20 06 00 00    	mov    0x620(%edi),%dl
   11613:	8d 42 fe             	lea    0xfffffffe(%edx),%eax
   11616:	3c 01                	cmp    $0x1,%al
   11618:	0f 86 b2 01 00 00    	jbe    117d0 <@ParsePackets@8+0x210>
   1161e:	8d 42 fc             	lea    0xfffffffc(%edx),%eax
   11621:	3c 01                	cmp    $0x1,%al
   11623:	77 0c                	ja     11631 <@ParsePackets@8+0x71>
   11625:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   11628:	0f be 41 03          	movsbl 0x3(%ecx),%eax
   1162c:	f7 d8                	neg    %eax
   1162e:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   11631:	80 fa 06             	cmp    $0x6,%dl
   11634:	0f 84 d8 01 00 00    	je     11812 <@ParsePackets@8+0x252>
   1163a:	80 fa 04             	cmp    $0x4,%dl
   1163d:	0f 84 ad 01 00 00    	je     117f0 <@ParsePackets@8+0x230>
   11643:	66 c7 46 04 00 00    	movw   $0x0,0x4(%esi)
   11649:	8b 97 3c 06 00 00    	mov    0x63c(%edi),%edx
   1164f:	31 da                	xor    %ebx,%edx
   11651:	f6 c2 01             	test   $0x1,%dl
   11654:	74 10                	je     11666 <@ParsePackets@8+0xa6>
   11656:	f6 c3 01             	test   $0x1,%bl
   11659:	0f 94 c0             	sete   %al
   1165c:	25 ff 00 00 00       	and    $0xff,%eax
   11661:	40                   	inc    %eax
   11662:	66 89 46 04          	mov    %ax,0x4(%esi)
   11666:	f6 c2 02             	test   $0x2,%dl
   11669:	74 19                	je     11684 <@ParsePackets@8+0xc4>
   1166b:	66 8b 46 04          	mov    0x4(%esi),%ax
   1166f:	25 ff ff 00 00       	and    $0xffff,%eax
   11674:	f6 c3 02             	test   $0x2,%bl
   11677:	0f 84 43 01 00 00    	je     117c0 <@ParsePackets@8+0x200>
   1167d:	83 c8 04             	or     $0x4,%eax
   11680:	66 89 46 04          	mov    %ax,0x4(%esi)
   11684:	f6 c2 04             	test   $0x4,%dl
   11687:	74 19                	je     116a2 <@ParsePackets@8+0xe2>
   11689:	66 8b 46 04          	mov    0x4(%esi),%ax
   1168d:	25 ff ff 00 00       	and    $0xffff,%eax
   11692:	f6 c3 04             	test   $0x4,%bl
   11695:	0f 84 15 01 00 00    	je     117b0 <@ParsePackets@8+0x1f0>
   1169b:	83 c8 10             	or     $0x10,%eax
   1169e:	66 89 46 04          	mov    %ax,0x4(%esi)
   116a2:	f6 c2 10             	test   $0x10,%dl
   116a5:	74 19                	je     116c0 <@ParsePackets@8+0x100>
   116a7:	66 8b 46 04          	mov    0x4(%esi),%ax
   116ab:	25 ff ff 00 00       	and    $0xffff,%eax
   116b0:	f6 c3 10             	test   $0x10,%bl
   116b3:	0f 84 e7 00 00 00    	je     117a0 <@ParsePackets@8+0x1e0>
   116b9:	83 c8 40             	or     $0x40,%eax
   116bc:	66 89 46 04          	mov    %ax,0x4(%esi)
   116c0:	83 e2 20             	and    $0x20,%edx
   116c3:	74 1b                	je     116e0 <@ParsePackets@8+0x120>
   116c5:	66 8b 46 04          	mov    0x4(%esi),%ax
   116c9:	25 ff ff 00 00       	and    $0xffff,%eax
   116ce:	f6 c3 20             	test   $0x20,%bl
   116d1:	0f 84 b9 00 00 00    	je     11790 <@ParsePackets@8+0x1d0>
   116d7:	80 cc 01             	or     $0x1,%ah
   116da:	66 89 46 04          	mov    %ax,0x4(%esi)
   116de:	89 f6                	mov    %esi,%esi
   116e0:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   116e3:	8a 42 01             	mov    0x1(%edx),%al
   116e6:	84 c0                	test   %al,%al
   116e8:	74 66                	je     11750 <@ParsePackets@8+0x190>
   116ea:	f6 02 10             	testb  $0x10,(%edx)
   116ed:	0f 84 8f 00 00 00    	je     11782 <@ParsePackets@8+0x1c2>
   116f3:	0d 00 ff ff ff       	or     $0xffffff00,%eax
   116f8:	89 46 0c             	mov    %eax,0xc(%esi)
   116fb:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   116fe:	8a 41 02             	mov    0x2(%ecx),%al
   11701:	84 c0                	test   %al,%al
   11703:	75 5c                	jne    11761 <@ParsePackets@8+0x1a1>
   11705:	c7 46 10 00 00 00 00 	movl   $0x0,0x10(%esi)
   1170c:	8b 4d f0             	mov    0xfffffff0(%ebp),%ecx
   1170f:	89 9f 3c 06 00 00    	mov    %ebx,0x63c(%edi)
   11715:	85 c9                	test   %ecx,%ecx
   11717:	0f 95 c2             	setne  %dl
   1171a:	83 f9 f8             	cmp    $0xfffffff8,%ecx
   1171d:	0f 9d c0             	setge  %al
   11720:	25 ff 00 00 00       	and    $0xff,%eax
   11725:	85 c2                	test   %eax,%edx
   11727:	74 19                	je     11742 <@ParsePackets@8+0x182>
   11729:	83 f9 07             	cmp    $0x7,%ecx
   1172c:	7f 14                	jg     11742 <@ParsePackets@8+0x182>
   1172e:	89 c8                	mov    %ecx,%eax
   11730:	c1 e0 04             	shl    $0x4,%eax
   11733:	29 c8                	sub    %ecx,%eax
   11735:	66 81 4e 04 00 04    	orw    $0x400,0x4(%esi)
   1173b:	c1 e0 03             	shl    $0x3,%eax
   1173e:	66 89 46 06          	mov    %ax,0x6(%esi)
   11742:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11745:	b8 01 00 00 00       	mov    $0x1,%eax
   1174a:	5b                   	pop    %ebx
   1174b:	5e                   	pop    %esi
   1174c:	5f                   	pop    %edi
   1174d:	5d                   	pop    %ebp
   1174e:	c3                   	ret    
   1174f:	90                   	nop    
   11750:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   11753:	c7 46 0c 00 00 00 00 	movl   $0x0,0xc(%esi)
   1175a:	8a 41 02             	mov    0x2(%ecx),%al
   1175d:	84 c0                	test   %al,%al
   1175f:	74 a4                	je     11705 <@ParsePackets@8+0x145>
   11761:	f6 01 20             	testb  $0x20,(%ecx)
   11764:	74 11                	je     11777 <@ParsePackets@8+0x1b7>
   11766:	25 ff 00 00 00       	and    $0xff,%eax
   1176b:	ba 00 01 00 00       	mov    $0x100,%edx
   11770:	29 c2                	sub    %eax,%edx
   11772:	89 56 10             	mov    %edx,0x10(%esi)
   11775:	eb 95                	jmp    1170c <@ParsePackets@8+0x14c>
   11777:	31 d2                	xor    %edx,%edx
   11779:	88 c2                	mov    %al,%dl
   1177b:	f7 da                	neg    %edx
   1177d:	89 56 10             	mov    %edx,0x10(%esi)
   11780:	eb 8a                	jmp    1170c <@ParsePackets@8+0x14c>
   11782:	25 ff 00 00 00       	and    $0xff,%eax
   11787:	89 46 0c             	mov    %eax,0xc(%esi)
   1178a:	e9 6c ff ff ff       	jmp    116fb <@ParsePackets@8+0x13b>
   1178f:	90                   	nop    
   11790:	80 cc 02             	or     $0x2,%ah
   11793:	66 89 46 04          	mov    %ax,0x4(%esi)
   11797:	e9 44 ff ff ff       	jmp    116e0 <@ParsePackets@8+0x120>
   1179c:	8d 74 26 00          	lea    0x0(%esi),%esi
   117a0:	0c 80                	or     $0x80,%al
   117a2:	66 89 46 04          	mov    %ax,0x4(%esi)
   117a6:	e9 15 ff ff ff       	jmp    116c0 <@ParsePackets@8+0x100>
   117ab:	90                   	nop    
   117ac:	8d 74 26 00          	lea    0x0(%esi),%esi
   117b0:	83 c8 20             	or     $0x20,%eax
   117b3:	66 89 46 04          	mov    %ax,0x4(%esi)
   117b7:	e9 e6 fe ff ff       	jmp    116a2 <@ParsePackets@8+0xe2>
   117bc:	8d 74 26 00          	lea    0x0(%esi),%esi
   117c0:	83 c8 08             	or     $0x8,%eax
   117c3:	66 89 46 04          	mov    %ax,0x4(%esi)
   117c7:	e9 b8 fe ff ff       	jmp    11684 <@ParsePackets@8+0xc4>
   117cc:	8d 74 26 00          	lea    0x0(%esi),%esi
   117d0:	50                   	push   %eax
   117d1:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
   117d4:	50                   	push   %eax
   117d5:	56                   	push   %esi
   117d6:	57                   	push   %edi
   117d7:	e8 14 0b 00 00       	call   122f0 <_PS2PPProcessPacket>
   117dc:	83 c4 10             	add    $0x10,%esp
   117df:	8b 5e 08             	mov    0x8(%esi),%ebx
   117e2:	8a 97 20 06 00 00    	mov    0x620(%edi),%dl
   117e8:	e9 31 fe ff ff       	jmp    1161e <@ParsePackets@8+0x5e>
   117ed:	8d 76 00             	lea    0x0(%esi),%esi
   117f0:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   117f3:	89 d8                	mov    %ebx,%eax
   117f5:	f6 02 40             	testb  $0x40,(%edx)
   117f8:	75 5b                	jne    11855 <@ParsePackets@8+0x295>
   117fa:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   117fd:	89 46 08             	mov    %eax,0x8(%esi)
   11800:	f6 01 80             	testb  $0x80,(%ecx)
   11803:	74 03                	je     11808 <@ParsePackets@8+0x248>
   11805:	83 c8 20             	or     $0x20,%eax
   11808:	89 c3                	mov    %eax,%ebx
   1180a:	89 46 08             	mov    %eax,0x8(%esi)
   1180d:	e9 31 fe ff ff       	jmp    11643 <@ParsePackets@8+0x83>
   11812:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   11815:	8a 42 03             	mov    0x3(%edx),%al
   11818:	31 d2                	xor    %edx,%edx
   1181a:	88 c2                	mov    %al,%dl
   1181c:	89 d1                	mov    %edx,%ecx
   1181e:	83 e2 07             	and    $0x7,%edx
   11821:	83 e1 08             	and    $0x8,%ecx
   11824:	29 d1                	sub    %edx,%ecx
   11826:	89 da                	mov    %ebx,%edx
   11828:	89 4d f0             	mov    %ecx,0xfffffff0(%ebp)
   1182b:	a8 10                	test   $0x10,%al
   1182d:	75 21                	jne    11850 <@ParsePackets@8+0x290>
   1182f:	8b 4d ec             	mov    0xffffffec(%ebp),%ecx
   11832:	89 56 08             	mov    %edx,0x8(%esi)
   11835:	89 d0                	mov    %edx,%eax
   11837:	f6 41 03 20          	testb  $0x20,0x3(%ecx)
   1183b:	74 03                	je     11840 <@ParsePackets@8+0x280>
   1183d:	83 c8 20             	or     $0x20,%eax
   11840:	89 46 08             	mov    %eax,0x8(%esi)
   11843:	89 c3                	mov    %eax,%ebx
   11845:	8a 97 20 06 00 00    	mov    0x620(%edi),%dl
   1184b:	e9 ea fd ff ff       	jmp    1163a <@ParsePackets@8+0x7a>
   11850:	83 ca 10             	or     $0x10,%edx
   11853:	eb da                	jmp    1182f <@ParsePackets@8+0x26f>
   11855:	83 c8 10             	or     $0x10,%eax
   11858:	eb a0                	jmp    117fa <@ParsePackets@8+0x23a>
   1185a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

00011860 <_MouseHandler@8>:
   11860:	55                   	push   %ebp
   11861:	89 e5                	mov    %esp,%ebp
   11863:	57                   	push   %edi
   11864:	56                   	push   %esi
   11865:	53                   	push   %ebx
   11866:	83 ec 18             	sub    $0x18,%esp
   11869:	31 db                	xor    %ebx,%ebx
   1186b:	8b 45 0c             	mov    0xc(%ebp),%eax
   1186e:	8b 70 28             	mov    0x28(%eax),%esi
   11871:	6a 64                	push   $0x64
   11873:	e8 28 10 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   11878:	88 c3                	mov    %al,%bl
   1187a:	6a 60                	push   $0x60
   1187c:	e8 1f 10 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   11881:	31 d2                	xor    %edx,%edx
   11883:	8b 8e 44 06 00 00    	mov    0x644(%esi),%ecx
   11889:	88 c2                	mov    %al,%dl
   1188b:	83 c4 0c             	add    $0xc,%esp
   1188e:	31 c0                	xor    %eax,%eax
   11890:	85 c9                	test   %ecx,%ecx
   11892:	74 2c                	je     118c0 <_MouseHandler@8+0x60>
   11894:	83 e3 20             	and    $0x20,%ebx
   11897:	74 27                	je     118c0 <_MouseHandler@8+0x60>
   11899:	8b 86 2c 06 00 00    	mov    0x62c(%esi),%eax
   1189f:	88 94 06 10 06 00 00 	mov    %dl,0x610(%esi,%eax,1)
   118a6:	40                   	inc    %eax
   118a7:	3b 86 30 06 00 00    	cmp    0x630(%esi),%eax
   118ad:	74 1b                	je     118ca <_MouseHandler@8+0x6a>
   118af:	89 86 2c 06 00 00    	mov    %eax,0x62c(%esi)
   118b5:	b8 01 00 00 00       	mov    $0x1,%eax
   118ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   118c0:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   118c3:	5b                   	pop    %ebx
   118c4:	5e                   	pop    %esi
   118c5:	5f                   	pop    %edi
   118c6:	5d                   	pop    %ebp
   118c7:	c2 08 00             	ret    $0x8
   118ca:	8b 7e 04             	mov    0x4(%esi),%edi
   118cd:	c7 86 2c 06 00 00 00 	movl   $0x0,0x62c(%esi)
   118d4:	00 00 00 
   118d7:	83 e7 01             	and    $0x1,%edi
   118da:	b8 01 00 00 00       	mov    $0x1,%eax
   118df:	8b 54 be 08          	mov    0x8(%esi,%edi,4),%edx
   118e3:	83 fa 20             	cmp    $0x20,%edx
   118e6:	74 d8                	je     118c0 <_MouseHandler@8+0x60>
   118e8:	8d 04 3f             	lea    (%edi,%edi,1),%eax
   118eb:	8d 14 52             	lea    (%edx,%edx,2),%edx
   118ee:	01 f8                	add    %edi,%eax
   118f0:	89 f1                	mov    %esi,%ecx
   118f2:	c1 e0 08             	shl    $0x8,%eax
   118f5:	01 f0                	add    %esi,%eax
   118f7:	8d 54 d0 10          	lea    0x10(%eax,%edx,8),%edx
   118fb:	e8 c0 fc ff ff       	call   115c0 <@ParsePackets@8>
   11900:	88 c3                	mov    %al,%bl
   11902:	8b 44 be 08          	mov    0x8(%esi,%edi,4),%eax
   11906:	40                   	inc    %eax
   11907:	89 44 be 08          	mov    %eax,0x8(%esi,%edi,4)
   1190b:	8b 45 0c             	mov    0xc(%ebp),%eax
   1190e:	51                   	push   %ecx
   1190f:	6a 00                	push   $0x0
   11911:	8b 50 14             	mov    0x14(%eax),%edx
   11914:	8d 86 4c 06 00 00    	lea    0x64c(%esi),%eax
   1191a:	52                   	push   %edx
   1191b:	50                   	push   %eax
   1191c:	e8 ff 0e 00 00       	call   12820 <_KeInsertQueueDpc@12>
   11921:	31 c0                	xor    %eax,%eax
   11923:	88 d8                	mov    %bl,%al
   11925:	eb 99                	jmp    118c0 <_MouseHandler@8+0x60>
   11927:	89 f6                	mov    %esi,%esi
   11929:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011930 <_SendByte>:
   11930:	55                   	push   %ebp
   11931:	89 e5                	mov    %esp,%ebp
   11933:	56                   	push   %esi
   11934:	53                   	push   %ebx
   11935:	89 c6                	mov    %eax,%esi
   11937:	83 ec 10             	sub    $0x10,%esp
   1193a:	c7 45 f0 f0 d8 ff ff 	movl   $0xffffd8f0,0xfffffff0(%ebp)
   11941:	c7 45 f4 ff ff ff ff 	movl   $0xffffffff,0xfffffff4(%ebp)
   11948:	c6 80 22 06 00 00 00 	movb   $0x0,0x622(%eax)
   1194f:	c6 80 23 06 00 00 01 	movb   $0x1,0x623(%eax)
   11956:	88 d3                	mov    %dl,%bl
   11958:	e8 e3 fa ff ff       	call   11440 <_controller_wait>
   1195d:	51                   	push   %ecx
   1195e:	51                   	push   %ecx
   1195f:	68 d4 00 00 00       	push   $0xd4
   11964:	6a 64                	push   $0x64
   11966:	e8 45 0f 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   1196b:	58                   	pop    %eax
   1196c:	5a                   	pop    %edx
   1196d:	e8 ce fa ff ff       	call   11440 <_controller_wait>
   11972:	31 c0                	xor    %eax,%eax
   11974:	88 d8                	mov    %bl,%al
   11976:	51                   	push   %ecx
   11977:	51                   	push   %ecx
   11978:	50                   	push   %eax
   11979:	6a 60                	push   $0x60
   1197b:	e8 30 0f 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   11980:	80 be 22 06 00 00 00 	cmpb   $0x0,0x622(%esi)
   11987:	58                   	pop    %eax
   11988:	5a                   	pop    %edx
   11989:	0f 85 80 00 00 00    	jne    11a0f <_SendByte+0xdf>
   1198f:	bb 63 00 00 00       	mov    $0x63,%ebx
   11994:	83 ec 0c             	sub    $0xc,%esp
   11997:	6a 64                	push   $0x64
   11999:	e8 02 0f 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   1199e:	83 c4 0c             	add    $0xc,%esp
   119a1:	a8 01                	test   $0x1,%al
   119a3:	74 42                	je     119e7 <_SendByte+0xb7>
   119a5:	83 ec 0c             	sub    $0xc,%esp
   119a8:	6a 60                	push   $0x60
   119aa:	e8 f1 0e 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   119af:	31 d2                	xor    %edx,%edx
   119b1:	83 c4 0c             	add    $0xc,%esp
   119b4:	88 c2                	mov    %al,%dl
   119b6:	81 fa fa 00 00 00    	cmp    $0xfa,%edx
   119bc:	74 5a                	je     11a18 <_SendByte+0xe8>
   119be:	81 fa fe 00 00 00    	cmp    $0xfe,%edx
   119c4:	74 6a                	je     11a30 <_SendByte+0x100>
   119c6:	8b 86 38 06 00 00    	mov    0x638(%esi),%eax
   119cc:	c6 86 22 06 00 00 01 	movb   $0x1,0x622(%esi)
   119d3:	85 c0                	test   %eax,%eax
   119d5:	74 48                	je     11a1f <_SendByte+0xef>
   119d7:	48                   	dec    %eax
   119d8:	89 86 38 06 00 00    	mov    %eax,0x638(%esi)
   119de:	88 94 06 18 06 00 00 	mov    %dl,0x618(%esi,%eax,1)
   119e5:	eb 38                	jmp    11a1f <_SendByte+0xef>
   119e7:	50                   	push   %eax
   119e8:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
   119eb:	50                   	push   %eax
   119ec:	6a 00                	push   $0x0
   119ee:	6a 00                	push   $0x0
   119f0:	e8 1b 0e 00 00       	call   12810 <_KeDelayExecutionThread@12>
   119f5:	80 be 22 06 00 00 00 	cmpb   $0x0,0x622(%esi)
   119fc:	58                   	pop    %eax
   119fd:	75 10                	jne    11a0f <_SendByte+0xdf>
   119ff:	4b                   	dec    %ebx
   11a00:	83 fb ff             	cmp    $0xffffffff,%ebx
   11a03:	75 8f                	jne    11994 <_SendByte+0x64>
   11a05:	83 c8 ff             	or     $0xffffffff,%eax
   11a08:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11a0b:	5b                   	pop    %ebx
   11a0c:	5e                   	pop    %esi
   11a0d:	5d                   	pop    %ebp
   11a0e:	c3                   	ret    
   11a0f:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11a12:	31 c0                	xor    %eax,%eax
   11a14:	5b                   	pop    %ebx
   11a15:	5e                   	pop    %esi
   11a16:	5d                   	pop    %ebp
   11a17:	c3                   	ret    
   11a18:	c6 86 22 06 00 00 01 	movb   $0x1,0x622(%esi)
   11a1f:	8a 86 22 06 00 00    	mov    0x622(%esi),%al
   11a25:	3c 01                	cmp    $0x1,%al
   11a27:	19 c0                	sbb    %eax,%eax
   11a29:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11a2c:	5b                   	pop    %ebx
   11a2d:	5e                   	pop    %esi
   11a2e:	5d                   	pop    %ebp
   11a2f:	c3                   	ret    
   11a30:	c6 86 22 06 00 00 ff 	movb   $0xff,0x622(%esi)
   11a37:	eb e6                	jmp    11a1f <_SendByte+0xef>
   11a39:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00011a40 <_SendCommand>:
   11a40:	55                   	push   %ebp
   11a41:	89 e5                	mov    %esp,%ebp
   11a43:	57                   	push   %edi
   11a44:	56                   	push   %esi
   11a45:	53                   	push   %ebx
   11a46:	83 ec 1c             	sub    $0x1c,%esp
  int timeout = 500; /* 500 msec */
   11a49:	c7 45 e4 f4 01 00 00 	movl   $0x1f4,0xffffffe4(%ebp)
  int send = (command >> 12) & 0xf;
  int receive = (command >> 8) & 0xf;
   11a50:	8b 45 10             	mov    0x10(%ebp),%eax
   11a53:	8b 75 10             	mov    0x10(%ebp),%esi
   11a56:	c1 f8 08             	sar    $0x8,%eax
   11a59:	8b 7d 08             	mov    0x8(%ebp),%edi
   11a5c:	83 e0 0f             	and    $0xf,%eax
  int i;

  Millisecond_Timeout.QuadPart = -10000L;
   11a5f:	c7 45 e8 f0 d8 ff ff 	movl   $0xffffd8f0,0xffffffe8(%ebp)
   11a66:	c1 fe 0c             	sar    $0xc,%esi
   11a69:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
   11a6c:	83 e6 0f             	and    $0xf,%esi
   11a6f:	c7 45 ec ff ff ff ff 	movl   $0xffffffff,0xffffffec(%ebp)

  DeviceExtension->RepliesExpected = receive;
   11a76:	89 87 38 06 00 00    	mov    %eax,0x638(%edi)
  if (command == PSMOUSE_CMD_RESET_BAT)
   11a7c:	81 7d 10 ff 02 00 00 	cmpl   $0x2ff,0x10(%ebp)
   11a83:	0f 84 42 01 00 00    	je     11bcb <_SendCommand+0x18b>
    timeout = 2000; /* 2 sec */

  if (command & 0xff)
   11a89:	80 7d 10 00          	cmpb   $0x0,0x10(%ebp)
   11a8d:	0f 85 dd 00 00 00    	jne    11b70 <_SendCommand+0x130>
    if (SendByte(DeviceExtension, command & 0xff))
    return (int)(DeviceExtension->RepliesExpected = 0) - 1;
	
  for (i = 0; i < send; i++)
   11a93:	31 db                	xor    %ebx,%ebx
   11a95:	39 f3                	cmp    %esi,%ebx
   11a97:	7d 23                	jge    11abc <_SendCommand+0x7c>
   11a99:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
    if (SendByte(DeviceExtension, param[i]))
   11aa0:	8b 45 0c             	mov    0xc(%ebp),%eax
   11aa3:	31 d2                	xor    %edx,%edx
   11aa5:	8a 14 03             	mov    (%ebx,%eax,1),%dl
   11aa8:	89 f8                	mov    %edi,%eax
   11aaa:	e8 81 fe ff ff       	call   11930 <_SendByte>
   11aaf:	85 c0                	test   %eax,%eax
   11ab1:	0f 85 cd 00 00 00    	jne    11b84 <_SendCommand+0x144>
   11ab7:	43                   	inc    %ebx
   11ab8:	39 f3                	cmp    %esi,%ebx
   11aba:	7c e4                	jl     11aa0 <_SendCommand+0x60>
      return (int)(DeviceExtension->RepliesExpected = 0) - 1;

  while (DeviceExtension->RepliesExpected && timeout--)
  {
    if (DeviceExtension->RepliesExpected == 1 && command == PSMOUSE_CMD_RESET_BAT)
      timeout = 100;

    if (DeviceExtension->RepliesExpected == 1 && command == PSMOUSE_CMD_GETID &&
        DeviceExtension->pkt[1] != 0xab && DeviceExtension->pkt[1] != 0xac)
    {
      DeviceExtension->RepliesExpected = 0;
      break;
    }
    
    status = controller_read_status();
    if((status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) != 0)
    {
      scancode = controller_read_input();
      if(scancode >= 0)
      {
        DeviceExtension->pkt[--DeviceExtension->RepliesExpected] = scancode;
      }
    }

    KeDelayExecutionThread (KernelMode, FALSE, &Millisecond_Timeout);
   11abc:	8b 87 38 06 00 00    	mov    0x638(%edi),%eax
   11ac2:	85 c0                	test   %eax,%eax
   11ac4:	74 7a                	je     11b40 <_SendCommand+0x100>
   11ac6:	8b 55 e4             	mov    0xffffffe4(%ebp),%edx
   11ac9:	4a                   	dec    %edx
   11aca:	89 55 e4             	mov    %edx,0xffffffe4(%ebp)
   11acd:	83 7d e4 ff          	cmpl   $0xffffffff,0xffffffe4(%ebp)
   11ad1:	74 6d                	je     11b40 <_SendCommand+0x100>
   11ad3:	48                   	dec    %eax
   11ad4:	0f 94 c0             	sete   %al
   11ad7:	31 d2                	xor    %edx,%edx
   11ad9:	88 c2                	mov    %al,%dl
   11adb:	81 7d 10 ff 02 00 00 	cmpl   $0x2ff,0x10(%ebp)
   11ae2:	0f 94 c0             	sete   %al
   11ae5:	85 d0                	test   %edx,%eax
   11ae7:	74 07                	je     11af0 <_SendCommand+0xb0>
   11ae9:	c7 45 e4 64 00 00 00 	movl   $0x64,0xffffffe4(%ebp)
   11af0:	81 7d 10 f2 02 00 00 	cmpl   $0x2f2,0x10(%ebp)
   11af7:	0f 94 c0             	sete   %al
   11afa:	85 d0                	test   %edx,%eax
   11afc:	74 12                	je     11b10 <_SendCommand+0xd0>
   11afe:	8a 87 19 06 00 00    	mov    0x619(%edi),%al
   11b04:	3c ab                	cmp    $0xab,%al
   11b06:	74 08                	je     11b10 <_SendCommand+0xd0>
   11b08:	3c ac                	cmp    $0xac,%al
   11b0a:	0f 85 c7 00 00 00    	jne    11bd7 <_SendCommand+0x197>
   11b10:	83 ec 0c             	sub    $0xc,%esp
   11b13:	6a 64                	push   $0x64
   11b15:	e8 86 0d 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   11b1a:	83 c4 0c             	add    $0xc,%esp
   11b1d:	a8 01                	test   $0x1,%al
   11b1f:	75 7f                	jne    11ba0 <_SendCommand+0x160>
   11b21:	50                   	push   %eax
   11b22:	8d 45 e8             	lea    0xffffffe8(%ebp),%eax
   11b25:	50                   	push   %eax
   11b26:	6a 00                	push   $0x0
   11b28:	6a 00                	push   $0x0
   11b2a:	e8 e1 0c 00 00       	call   12810 <_KeDelayExecutionThread@12>
   11b2f:	8b 87 38 06 00 00    	mov    0x638(%edi),%eax
   11b35:	5e                   	pop    %esi
   11b36:	85 c0                	test   %eax,%eax
   11b38:	75 8c                	jne    11ac6 <_SendCommand+0x86>
   11b3a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  }

  for (i = 0; i < receive; i++)
   11b40:	31 db                	xor    %ebx,%ebx
   11b42:	eb 13                	jmp    11b57 <_SendCommand+0x117>
    param[i] = DeviceExtension->pkt[(receive - 1) - i];
   11b44:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
   11b47:	8b 55 0c             	mov    0xc(%ebp),%edx
   11b4a:	29 d8                	sub    %ebx,%eax
   11b4c:	8a 84 07 17 06 00 00 	mov    0x617(%edi,%eax,1),%al
   11b53:	88 04 13             	mov    %al,(%ebx,%edx,1)
   11b56:	43                   	inc    %ebx
   11b57:	3b 5d e0             	cmp    0xffffffe0(%ebp),%ebx
   11b5a:	7c e8                	jl     11b44 <_SendCommand+0x104>

  if (DeviceExtension->RepliesExpected)
   11b5c:	8b 9f 38 06 00 00    	mov    0x638(%edi),%ebx
    return (int)(DeviceExtension->RepliesExpected = 0) - 1;

  return 0;
   11b62:	31 c0                	xor    %eax,%eax
   11b64:	85 db                	test   %ebx,%ebx
   11b66:	75 1c                	jne    11b84 <_SendCommand+0x144>
}
   11b68:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11b6b:	5b                   	pop    %ebx
   11b6c:	5e                   	pop    %esi
   11b6d:	5f                   	pop    %edi
   11b6e:	5d                   	pop    %ebp
   11b6f:	c3                   	ret    
   11b70:	31 d2                	xor    %edx,%edx
   11b72:	89 f8                	mov    %edi,%eax
   11b74:	8a 55 10             	mov    0x10(%ebp),%dl
   11b77:	e8 b4 fd ff ff       	call   11930 <_SendByte>
   11b7c:	85 c0                	test   %eax,%eax
   11b7e:	0f 84 0f ff ff ff    	je     11a93 <_SendCommand+0x53>
   11b84:	c7 87 38 06 00 00 00 	movl   $0x0,0x638(%edi)
   11b8b:	00 00 00 
   11b8e:	83 c8 ff             	or     $0xffffffff,%eax
   11b91:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11b94:	5b                   	pop    %ebx
   11b95:	5e                   	pop    %esi
   11b96:	5f                   	pop    %edi
   11b97:	5d                   	pop    %ebp
   11b98:	c3                   	ret    
   11b99:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   11ba0:	83 ec 0c             	sub    $0xc,%esp
   11ba3:	6a 60                	push   $0x60
   11ba5:	e8 f6 0c 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   11baa:	8b 97 38 06 00 00    	mov    0x638(%edi),%edx
   11bb0:	25 ff 00 00 00       	and    $0xff,%eax
   11bb5:	4a                   	dec    %edx
   11bb6:	83 c4 0c             	add    $0xc,%esp
   11bb9:	89 97 38 06 00 00    	mov    %edx,0x638(%edi)
   11bbf:	88 84 17 18 06 00 00 	mov    %al,0x618(%edi,%edx,1)
   11bc6:	e9 56 ff ff ff       	jmp    11b21 <_SendCommand+0xe1>
   11bcb:	c7 45 e4 d0 07 00 00 	movl   $0x7d0,0xffffffe4(%ebp)
   11bd2:	e9 b2 fe ff ff       	jmp    11a89 <_SendCommand+0x49>
   11bd7:	c7 87 38 06 00 00 00 	movl   $0x0,0x638(%edi)
   11bde:	00 00 00 
   11be1:	e9 5a ff ff ff       	jmp    11b40 <_SendCommand+0x100>
   11be6:	8d 76 00             	lea    0x0(%esi),%esi
   11be9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011bf0 <_SetResolution>:


// changes the resolution of the mouse
void SetResolution(PDEVICE_EXTENSION DeviceExtension)
{
   11bf0:	55                   	push   %ebp
   11bf1:	89 e5                	mov    %esp,%ebp
   11bf3:	50                   	push   %eax
   11bf4:	50                   	push   %eax
   11bf5:	8b 4d 08             	mov    0x8(%ebp),%ecx
  unsigned char param[1];
  
  if(DeviceExtension->MouseType == PSMOUSE_PS2PP && DeviceExtension->Resolution > 400)
   11bf8:	80 b9 20 06 00 00 02 	cmpb   $0x2,0x620(%ecx)
   11bff:	74 37                	je     11c38 <_SetResolution+0x48>
   11c01:	8b 91 34 06 00 00    	mov    0x634(%ecx),%edx
  {
    PS2PPSet800dpi(DeviceExtension);
    return;
  }
  
  if(!DeviceExtension->Resolution || DeviceExtension->Resolution >= 200)
   11c07:	8d 42 ff             	lea    0xffffffff(%edx),%eax
   11c0a:	3d c6 00 00 00       	cmp    $0xc6,%eax
   11c0f:	77 21                	ja     11c32 <_SetResolution+0x42>
    param[0] = 3;
  else if(DeviceExtension->Resolution >= 100)
   11c11:	83 fa 63             	cmp    $0x63,%edx
   11c14:	76 3b                	jbe    11c51 <_SetResolution+0x61>
    param[0] = 2;
   11c16:	c6 45 ff 02          	movb   $0x2,0xffffffff(%ebp)
   11c1a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  else if(DeviceExtension->Resolution >= 50)
    param[0] = 1;
  else if(DeviceExtension->Resolution )
    param[0] = 0;
  
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11c20:	50                   	push   %eax
   11c21:	8d 45 ff             	lea    0xffffffff(%ebp),%eax
   11c24:	68 e8 10 00 00       	push   $0x10e8
   11c29:	50                   	push   %eax
   11c2a:	51                   	push   %ecx
   11c2b:	e8 10 fe ff ff       	call   11a40 <_SendCommand>
}
   11c30:	c9                   	leave  
   11c31:	c3                   	ret    
   11c32:	c6 45 ff 03          	movb   $0x3,0xffffffff(%ebp)
   11c36:	eb e8                	jmp    11c20 <_SetResolution+0x30>
   11c38:	8b 91 34 06 00 00    	mov    0x634(%ecx),%edx
   11c3e:	81 fa 90 01 00 00    	cmp    $0x190,%edx
   11c44:	76 c1                	jbe    11c07 <_SetResolution+0x17>
   11c46:	83 ec 0c             	sub    $0xc,%esp
   11c49:	51                   	push   %ecx
   11c4a:	e8 31 08 00 00       	call   12480 <_PS2PPSet800dpi>
   11c4f:	c9                   	leave  
   11c50:	c3                   	ret    
   11c51:	83 fa 31             	cmp    $0x31,%edx
   11c54:	77 0a                	ja     11c60 <_SetResolution+0x70>
   11c56:	85 d2                	test   %edx,%edx
   11c58:	74 c6                	je     11c20 <_SetResolution+0x30>
   11c5a:	c6 45 ff 00          	movb   $0x0,0xffffffff(%ebp)
   11c5e:	eb c0                	jmp    11c20 <_SetResolution+0x30>
   11c60:	c6 45 ff 01          	movb   $0x1,0xffffffff(%ebp)
   11c64:	eb ba                	jmp    11c20 <_SetResolution+0x30>
   11c66:	8d 76 00             	lea    0x0(%esi),%esi
   11c69:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011c70 <_TestMouseExtensions>:


// Detect mouse models
int TestMouseExtensions(PDEVICE_EXTENSION DeviceExtension)
{
   11c70:	55                   	push   %ebp
   11c71:	89 e5                	mov    %esp,%ebp
   11c73:	57                   	push   %edi
   11c74:	56                   	push   %esi
   11c75:	53                   	push   %ebx
   11c76:	83 ec 10             	sub    $0x10,%esp
  unsigned char param[4];
  int type = 0;
  
  param[0] = 0;
  
  // vendor = Generic
  // name = Mouse
  DeviceExtension->MouseModel = 0;
  
  /*
   * Try Synaptics TouchPad magic ID
   */
  param[0] = 0;
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11c79:	8d 75 f0             	lea    0xfffffff0(%ebp),%esi
   11c7c:	8b 5d 08             	mov    0x8(%ebp),%ebx
   11c7f:	c6 83 21 06 00 00 00 	movb   $0x0,0x621(%ebx)
   11c86:	c6 45 f0 00          	movb   $0x0,0xfffffff0(%ebp)
   11c8a:	68 e8 10 00 00       	push   $0x10e8
   11c8f:	56                   	push   %esi
   11c90:	53                   	push   %ebx
   11c91:	e8 aa fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11c96:	83 c4 0c             	add    $0xc,%esp
   11c99:	68 e8 10 00 00       	push   $0x10e8
   11c9e:	56                   	push   %esi
   11c9f:	53                   	push   %ebx
   11ca0:	e8 9b fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11ca5:	83 c4 0c             	add    $0xc,%esp
   11ca8:	68 e8 10 00 00       	push   $0x10e8
   11cad:	56                   	push   %esi
   11cae:	53                   	push   %ebx
   11caf:	e8 8c fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11cb4:	83 c4 0c             	add    $0xc,%esp
   11cb7:	68 e8 10 00 00       	push   $0x10e8
   11cbc:	56                   	push   %esi
   11cbd:	53                   	push   %ebx
   11cbe:	e8 7d fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_GETINFO);
   11cc3:	83 c4 0c             	add    $0xc,%esp
   11cc6:	68 e9 03 00 00       	push   $0x3e9
   11ccb:	56                   	push   %esi
   11ccc:	53                   	push   %ebx
   11ccd:	e8 6e fd ff ff       	call   11a40 <_SendCommand>
  if(param[1] == 0x47)
   11cd2:	83 c4 10             	add    $0x10,%esp
   11cd5:	80 7d f1 47          	cmpb   $0x47,0xfffffff1(%ebp)
   11cd9:	0f 84 32 01 00 00    	je     11e11 <_TestMouseExtensions+0x1a1>
  {
    // vendor = Synaptics
    // name = TouchPad
    if(!InitSynaptics(DeviceExtension))
      return PSMOUSE_SYNAPTICS;
    else
      return PSMOUSE_PS2;
  }
  
  /*
   * Try Genius NetMouse magic init.
   */
  param[0] = 3;
   11cdf:	c6 45 f0 03          	movb   $0x3,0xfffffff0(%ebp)
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11ce3:	52                   	push   %edx
   11ce4:	68 e8 10 00 00       	push   $0x10e8
   11ce9:	56                   	push   %esi
   11cea:	53                   	push   %ebx
   11ceb:	e8 50 fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
   11cf0:	83 c4 0c             	add    $0xc,%esp
   11cf3:	68 e6 00 00 00       	push   $0xe6
   11cf8:	6a 00                	push   $0x0
   11cfa:	53                   	push   %ebx
   11cfb:	e8 40 fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
   11d00:	83 c4 0c             	add    $0xc,%esp
   11d03:	68 e6 00 00 00       	push   $0xe6
   11d08:	6a 00                	push   $0x0
   11d0a:	53                   	push   %ebx
   11d0b:	e8 30 fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
   11d10:	83 c4 0c             	add    $0xc,%esp
   11d13:	68 e6 00 00 00       	push   $0xe6
   11d18:	6a 00                	push   $0x0
   11d1a:	53                   	push   %ebx
   11d1b:	e8 20 fd ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_GETINFO);
   11d20:	83 c4 0c             	add    $0xc,%esp
   11d23:	68 e9 03 00 00       	push   $0x3e9
   11d28:	56                   	push   %esi
   11d29:	53                   	push   %ebx
   11d2a:	e8 11 fd ff ff       	call   11a40 <_SendCommand>
  if(param[0] == 0x00 && param[1] == 0x33 && param[2] == 0x55)
   11d2f:	83 c4 10             	add    $0x10,%esp
   11d32:	80 7d f0 00          	cmpb   $0x0,0xfffffff0(%ebp)
   11d36:	75 0a                	jne    11d42 <_TestMouseExtensions+0xd2>
   11d38:	80 7d f1 33          	cmpb   $0x33,0xfffffff1(%ebp)
   11d3c:	0f 84 ee 00 00 00    	je     11e30 <_TestMouseExtensions+0x1c0>
  {
    // vendor = Genius
    // name = Wheel Mouse
    // Features = 4th, 5th, Wheel
    return PSMOUSE_GENPS;
  }
  
  /*
   * Try Logitech magic ID.
   */
  param[0] = 0;
   11d42:	c6 45 f0 00          	movb   $0x0,0xfffffff0(%ebp)
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRES);
   11d46:	50                   	push   %eax
   11d47:	68 e8 10 00 00       	push   $0x10e8
   11d4c:	56                   	push   %esi
   11d4d:	53                   	push   %ebx
   11d4e:	e8 ed fc ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
   11d53:	83 c4 0c             	add    $0xc,%esp
   11d56:	68 e6 00 00 00       	push   $0xe6
   11d5b:	6a 00                	push   $0x0
   11d5d:	53                   	push   %ebx
   11d5e:	e8 dd fc ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
   11d63:	83 c4 0c             	add    $0xc,%esp
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
  param[1] = 0;
   11d66:	8d 7d f0             	lea    0xfffffff0(%ebp),%edi
   11d69:	68 e6 00 00 00       	push   $0xe6
   11d6e:	6a 00                	push   $0x0
   11d70:	53                   	push   %ebx
   11d71:	e8 ca fc ff ff       	call   11a40 <_SendCommand>
   11d76:	83 c4 0c             	add    $0xc,%esp
   11d79:	68 e6 00 00 00       	push   $0xe6
   11d7e:	6a 00                	push   $0x0
   11d80:	53                   	push   %ebx
   11d81:	e8 ba fc ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_GETINFO);
   11d86:	83 c4 0c             	add    $0xc,%esp
   11d89:	c6 45 f1 00          	movb   $0x0,0xfffffff1(%ebp)
   11d8d:	68 e9 03 00 00       	push   $0x3e9
   11d92:	57                   	push   %edi
   11d93:	53                   	push   %ebx
   11d94:	e8 a7 fc ff ff       	call   11a40 <_SendCommand>
  if(param[1])
   11d99:	83 c4 10             	add    $0x10,%esp
   11d9c:	80 7d f1 00          	cmpb   $0x0,0xfffffff1(%ebp)
   11da0:	74 10                	je     11db2 <_TestMouseExtensions+0x142>
  {
    type = PS2PPDetectModel(DeviceExtension, param);
   11da2:	50                   	push   %eax
   11da3:	50                   	push   %eax
   11da4:	57                   	push   %edi
   11da5:	53                   	push   %ebx
   11da6:	e8 35 07 00 00       	call   124e0 <_PS2PPDetectModel>
    if(type)
   11dab:	83 c4 10             	add    $0x10,%esp
   11dae:	85 c0                	test   %eax,%eax
   11db0:	75 57                	jne    11e09 <_TestMouseExtensions+0x199>
      return type;
  }
  
  /*
   * Try IntelliMouse magic init.
   */
  param[0] = 200;
   11db2:	c6 45 f0 c8          	movb   $0xc8,0xfffffff0(%ebp)
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
   11db6:	50                   	push   %eax
   11db7:	68 f3 10 00 00       	push   $0x10f3
   11dbc:	57                   	push   %edi
   11dbd:	53                   	push   %ebx
   11dbe:	e8 7d fc ff ff       	call   11a40 <_SendCommand>
  param[0] = 100;
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
   11dc3:	83 c4 0c             	add    $0xc,%esp
   11dc6:	8d 75 f0             	lea    0xfffffff0(%ebp),%esi
   11dc9:	c6 45 f0 64          	movb   $0x64,0xfffffff0(%ebp)
   11dcd:	68 f3 10 00 00       	push   $0x10f3
   11dd2:	56                   	push   %esi
   11dd3:	53                   	push   %ebx
   11dd4:	e8 67 fc ff ff       	call   11a40 <_SendCommand>
  param[0] =  80;
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
   11dd9:	83 c4 0c             	add    $0xc,%esp
   11ddc:	c6 45 f0 50          	movb   $0x50,0xfffffff0(%ebp)
   11de0:	68 f3 10 00 00       	push   $0x10f3
   11de5:	56                   	push   %esi
   11de6:	53                   	push   %ebx
   11de7:	e8 54 fc ff ff       	call   11a40 <_SendCommand>
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_GETID);
   11dec:	83 c4 0c             	add    $0xc,%esp
   11def:	68 f2 02 00 00       	push   $0x2f2
   11df4:	56                   	push   %esi
   11df5:	53                   	push   %ebx
   11df6:	e8 45 fc ff ff       	call   11a40 <_SendCommand>
  if(param[0] == 3)
   11dfb:	83 c4 10             	add    $0x10,%esp
  {
    // Features = Wheel
    
    /*
     * Try IntelliMouse/Explorer magic init.
     */
    param[0] = 200;
    SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
    param[0] = 200;
    SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
    param[0] =  80;
    SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
    SendCommand(DeviceExtension, param, PSMOUSE_CMD_GETID);
    if(param[0] == 4)
    {
      // name = Explorer Mouse
      // Features = 4th, 5th, Wheel
      return PSMOUSE_IMEX;
    }
    
    // name = Wheel Mouse
    return PSMOUSE_IMPS;
  }
  
/*
 * Okay, all failed, we have a standard mouse here. The number of the buttons
 * is still a question, though. We assume 3.
 */
  return PSMOUSE_PS2;
   11dfe:	b8 01 00 00 00       	mov    $0x1,%eax
   11e03:	80 7d f0 03          	cmpb   $0x3,0xfffffff0(%ebp)
   11e07:	74 38                	je     11e41 <_TestMouseExtensions+0x1d1>
}
   11e09:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11e0c:	5b                   	pop    %ebx
   11e0d:	5e                   	pop    %esi
   11e0e:	5f                   	pop    %edi
   11e0f:	5d                   	pop    %ebp
   11e10:	c3                   	ret    
   11e11:	83 ec 0c             	sub    $0xc,%esp
   11e14:	53                   	push   %ebx
   11e15:	e8 f6 08 00 00       	call   12710 <_InitSynaptics>
   11e1a:	83 c4 10             	add    $0x10,%esp
   11e1d:	83 f8 01             	cmp    $0x1,%eax
   11e20:	19 c0                	sbb    %eax,%eax
   11e22:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11e25:	83 e0 06             	and    $0x6,%eax
   11e28:	5b                   	pop    %ebx
   11e29:	40                   	inc    %eax
   11e2a:	5e                   	pop    %esi
   11e2b:	5f                   	pop    %edi
   11e2c:	5d                   	pop    %ebp
   11e2d:	c3                   	ret    
   11e2e:	89 f6                	mov    %esi,%esi
   11e30:	b8 04 00 00 00       	mov    $0x4,%eax
   11e35:	80 7d f2 55          	cmpb   $0x55,0xfffffff2(%ebp)
   11e39:	0f 85 03 ff ff ff    	jne    11d42 <_TestMouseExtensions+0xd2>
   11e3f:	eb c8                	jmp    11e09 <_TestMouseExtensions+0x199>
   11e41:	c6 45 f0 c8          	movb   $0xc8,0xfffffff0(%ebp)
   11e45:	50                   	push   %eax
   11e46:	68 f3 10 00 00       	push   $0x10f3
   11e4b:	56                   	push   %esi
   11e4c:	53                   	push   %ebx
   11e4d:	e8 ee fb ff ff       	call   11a40 <_SendCommand>
   11e52:	83 c4 0c             	add    $0xc,%esp
   11e55:	c6 45 f0 c8          	movb   $0xc8,0xfffffff0(%ebp)
   11e59:	68 f3 10 00 00       	push   $0x10f3
   11e5e:	56                   	push   %esi
   11e5f:	53                   	push   %ebx
   11e60:	e8 db fb ff ff       	call   11a40 <_SendCommand>
   11e65:	83 c4 0c             	add    $0xc,%esp
   11e68:	c6 45 f0 50          	movb   $0x50,0xfffffff0(%ebp)
   11e6c:	68 f3 10 00 00       	push   $0x10f3
   11e71:	56                   	push   %esi
   11e72:	53                   	push   %ebx
   11e73:	e8 c8 fb ff ff       	call   11a40 <_SendCommand>
   11e78:	83 c4 0c             	add    $0xc,%esp
   11e7b:	68 f2 02 00 00       	push   $0x2f2
   11e80:	56                   	push   %esi
   11e81:	53                   	push   %ebx
   11e82:	e8 b9 fb ff ff       	call   11a40 <_SendCommand>
   11e87:	83 c4 10             	add    $0x10,%esp
   11e8a:	80 7d f0 04          	cmpb   $0x4,0xfffffff0(%ebp)
   11e8e:	0f 94 c0             	sete   %al
   11e91:	25 ff 00 00 00       	and    $0xff,%eax
   11e96:	83 c0 05             	add    $0x5,%eax
   11e99:	e9 6b ff ff ff       	jmp    11e09 <_TestMouseExtensions+0x199>
   11e9e:	89 f6                	mov    %esi,%esi

00011ea0 <_TestMouse>:


// Detect if mouse is just a standard ps/2 mouse
int TestMouse(PDEVICE_EXTENSION DeviceExtension)
{
   11ea0:	55                   	push   %ebp
   11ea1:	89 e5                	mov    %esp,%ebp
   11ea3:	53                   	push   %ebx
   11ea4:	50                   	push   %eax
   11ea5:	50                   	push   %eax
   11ea6:	8b 5d 08             	mov    0x8(%ebp),%ebx
  unsigned char param[4];
  
  param[0] = param[1] = 0xa5;
   11ea9:	c6 45 f9 a5          	movb   $0xa5,0xfffffff9(%ebp)
   11ead:	c6 45 f8 a5          	movb   $0xa5,0xfffffff8(%ebp)
  
  /*
   * First, we check if it's a mouse. It should send 0x00 or 0x03
   * in case of an IntelliMouse in 4-byte mode or 0x04 for IM Explorer.
   */  
  if(SendCommand(DeviceExtension, param, PSMOUSE_CMD_GETID))
   11eb1:	8d 45 f8             	lea    0xfffffff8(%ebp),%eax
   11eb4:	68 f2 02 00 00       	push   $0x2f2
   11eb9:	50                   	push   %eax
   11eba:	53                   	push   %ebx
   11ebb:	e8 80 fb ff ff       	call   11a40 <_SendCommand>
   11ec0:	83 c4 10             	add    $0x10,%esp
    return -1;
   11ec3:	83 ca ff             	or     $0xffffffff,%edx
   11ec6:	85 c0                	test   %eax,%eax
   11ec8:	75 2d                	jne    11ef7 <_TestMouse+0x57>
  
  if(param[0] != 0x00 && param[0] != 0x03 && param[0] != 0x04)
   11eca:	8a 4d f8             	mov    0xfffffff8(%ebp),%cl
   11ecd:	84 c9                	test   %cl,%cl
   11ecf:	0f 95 c2             	setne  %dl
   11ed2:	80 f9 03             	cmp    $0x3,%cl
   11ed5:	0f 95 c0             	setne  %al
   11ed8:	25 ff 00 00 00       	and    $0xff,%eax
   11edd:	85 c2                	test   %eax,%edx
   11edf:	75 1f                	jne    11f00 <_TestMouse+0x60>
    return -1;
  
  /*
   * Then we reset and disable the mouse so that it doesn't generate events.
   */
  
  if(DeviceExtension->NoExtensions)
   11ee1:	8b 83 28 06 00 00    	mov    0x628(%ebx),%eax
   11ee7:	85 c0                	test   %eax,%eax
   11ee9:	74 27                	je     11f12 <_TestMouse+0x72>
  {
    return DeviceExtension->MouseType = PSMOUSE_PS2;
   11eeb:	c6 83 20 06 00 00 01 	movb   $0x1,0x620(%ebx)
   11ef2:	ba 01 00 00 00       	mov    $0x1,%edx
  }
  
  if(SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_RESET_DIS))
    return -1;

  return DeviceExtension->MouseType = TestMouseExtensions(DeviceExtension);
}
   11ef7:	89 d0                	mov    %edx,%eax
   11ef9:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   11efc:	c9                   	leave  
   11efd:	c3                   	ret    
   11efe:	89 f6                	mov    %esi,%esi
   11f00:	83 ca ff             	or     $0xffffffff,%edx
   11f03:	80 f9 04             	cmp    $0x4,%cl
   11f06:	75 ef                	jne    11ef7 <_TestMouse+0x57>
   11f08:	8b 83 28 06 00 00    	mov    0x628(%ebx),%eax
   11f0e:	85 c0                	test   %eax,%eax
   11f10:	75 d9                	jne    11eeb <_TestMouse+0x4b>
   11f12:	51                   	push   %ecx
   11f13:	68 f6 00 00 00       	push   $0xf6
   11f18:	6a 00                	push   $0x0
   11f1a:	53                   	push   %ebx
   11f1b:	e8 20 fb ff ff       	call   11a40 <_SendCommand>
   11f20:	83 c4 10             	add    $0x10,%esp
   11f23:	83 ca ff             	or     $0xffffffff,%edx
   11f26:	85 c0                	test   %eax,%eax
   11f28:	75 cd                	jne    11ef7 <_TestMouse+0x57>
   11f2a:	83 ec 0c             	sub    $0xc,%esp
   11f2d:	53                   	push   %ebx
   11f2e:	e8 3d fd ff ff       	call   11c70 <_TestMouseExtensions>
   11f33:	31 d2                	xor    %edx,%edx
   11f35:	88 83 20 06 00 00    	mov    %al,0x620(%ebx)
   11f3b:	88 c2                	mov    %al,%dl
   11f3d:	89 d0                	mov    %edx,%eax
   11f3f:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   11f42:	c9                   	leave  
   11f43:	c3                   	ret    
   11f44:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11f4a:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi

00011f50 <_InitializeMouse>:


// Initialize and enable the mouse
void InitializeMouse(PDEVICE_EXTENSION DeviceExtension)
{
   11f50:	55                   	push   %ebp
   11f51:	89 e5                	mov    %esp,%ebp
   11f53:	56                   	push   %esi
   11f54:	53                   	push   %ebx
   11f55:	83 ec 14             	sub    $0x14,%esp
  unsigned char param[4];
  
  /*
   * We set the mouse report rate to a highest possible value.
   * We try 100 first in case mouse fails to set 200.
   */
 
  param[0] = 200;
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
   11f58:	8d 75 f4             	lea    0xfffffff4(%ebp),%esi
   11f5b:	8b 5d 08             	mov    0x8(%ebp),%ebx
   11f5e:	c6 45 f4 c8          	movb   $0xc8,0xfffffff4(%ebp)
   11f62:	68 f3 10 00 00       	push   $0x10f3
   11f67:	56                   	push   %esi
   11f68:	53                   	push   %ebx
   11f69:	e8 d2 fa ff ff       	call   11a40 <_SendCommand>
  
  param[0] = 100;
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETRATE);
   11f6e:	83 c4 0c             	add    $0xc,%esp
   11f71:	c6 45 f4 64          	movb   $0x64,0xfffffff4(%ebp)
   11f75:	68 f3 10 00 00       	push   $0x10f3
   11f7a:	56                   	push   %esi
   11f7b:	53                   	push   %ebx
   11f7c:	e8 bf fa ff ff       	call   11a40 <_SendCommand>
  
  SetResolution(DeviceExtension);
   11f81:	89 1c 24             	mov    %ebx,(%esp)
   11f84:	e8 67 fc ff ff       	call   11bf0 <_SetResolution>
  SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_SETSCALE11);
   11f89:	83 c4 0c             	add    $0xc,%esp
   11f8c:	68 e6 00 00 00       	push   $0xe6
   11f91:	6a 00                	push   $0x0
   11f93:	53                   	push   %ebx
   11f94:	e8 a7 fa ff ff       	call   11a40 <_SendCommand>
  
  /*
   * We set the mouse into streaming mode.
   */
  
  SendCommand(DeviceExtension, param, PSMOUSE_CMD_SETSTREAM);
   11f99:	83 c4 0c             	add    $0xc,%esp
   11f9c:	68 ea 00 00 00       	push   $0xea
   11fa1:	56                   	push   %esi
   11fa2:	53                   	push   %ebx
   11fa3:	e8 98 fa ff ff       	call   11a40 <_SendCommand>
  
  /*
   * Last, we enable the mouse so that we get reports from it.
   */
  
  if(SendCommand(DeviceExtension, NULL, PSMOUSE_CMD_ENABLE))
   11fa8:	83 c4 0c             	add    $0xc,%esp
   11fab:	68 f4 00 00 00       	push   $0xf4
   11fb0:	6a 00                	push   $0x0
   11fb2:	53                   	push   %ebx
   11fb3:	e8 88 fa ff ff       	call   11a40 <_SendCommand>
   11fb8:	83 c4 10             	add    $0x10,%esp
   11fbb:	85 c0                	test   %eax,%eax
   11fbd:	75 07                	jne    11fc6 <_InitializeMouse+0x76>
    DbgPrint("mouse.c: Failed to enable mouse!\n");
}
   11fbf:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11fc2:	5b                   	pop    %ebx
   11fc3:	5e                   	pop    %esi
   11fc4:	5d                   	pop    %ebp
   11fc5:	c3                   	ret    
   11fc6:	83 ec 0c             	sub    $0xc,%esp
   11fc9:	68 f0 40 01 00       	push   $0x140f0
   11fce:	e8 2d 08 00 00       	call   12800 <_DbgPrint>
   11fd3:	83 c4 10             	add    $0x10,%esp
   11fd6:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11fd9:	5b                   	pop    %ebx
   11fda:	5e                   	pop    %esi
   11fdb:	5d                   	pop    %ebp
   11fdc:	c3                   	ret    
   11fdd:	8d 76 00             	lea    0x0(%esi),%esi

00011fe0 <_LoadMouseSettings>:


// Load settings from registry (by Filip Navara)
BOOL LoadMouseSettings(PDEVICE_EXTENSION DeviceExtension, PUNICODE_STRING RegistryPath)
{
   11fe0:	55                   	push   %ebp
   11fe1:	89 e5                	mov    %esp,%ebp
   11fe3:	57                   	push   %edi
   11fe4:	56                   	push   %esi
   11fe5:	53                   	push   %ebx
   11fe6:	81 ec 84 00 00 00    	sub    $0x84,%esp
  /*
   * Get the parameters from registry
   */
  ULONG DefaultMouseResolution = 0;
  ULONG DisableExtensionDetection = 1;
  UNICODE_STRING ParametersPath;
  RTL_QUERY_REGISTRY_TABLE Parameters[3];
  PWSTR ParametersKeyPath = L"\\Parameters";
  NTSTATUS Status;
  
  RtlZeroMemory(Parameters, sizeof(Parameters));
   11fec:	8d 7d 88             	lea    0xffffff88(%ebp),%edi
   11fef:	c7 85 7c ff ff ff 00 	movl   $0x0,0xffffff7c(%ebp)
   11ff6:	00 00 00 
   11ff9:	c7 85 78 ff ff ff 01 	movl   $0x1,0xffffff78(%ebp)
   12000:	00 00 00 
   12003:	8b 75 0c             	mov    0xc(%ebp),%esi
   12006:	6a 54                	push   $0x54
   12008:	57                   	push   %edi
   12009:	e8 22 08 00 00       	call   12830 <_RtlZeroMemory@8>
  
  /*
   * Formulate path to registry
   */
  RtlInitUnicodeString(&ParametersPath, NULL);
   1200e:	8d 5d 80             	lea    0xffffff80(%ebp),%ebx
   12011:	6a 00                	push   $0x0
   12013:	53                   	push   %ebx
   12014:	e8 57 07 00 00       	call   12770 <_RtlInitUnicodeString@8>
  ParametersPath.MaximumLength = RegistryPath->Length +
   12019:	50                   	push   %eax
   1201a:	68 12 41 01 00       	push   $0x14112
   1201f:	e8 3c 08 00 00       	call   12860 <_wcslen>
   12024:	66 8b 16             	mov    (%esi),%dx
   12027:	8d 44 42 02          	lea    0x2(%edx,%eax,2),%eax
   1202b:	66 89 45 82          	mov    %ax,0xffffff82(%ebp)
    (wcslen(ParametersKeyPath) * sizeof(WCHAR)) + sizeof(UNICODE_NULL);
  ParametersPath.Buffer = ExAllocatePool(PagedPool,
   1202f:	25 ff ff 00 00       	and    $0xffff,%eax
   12034:	5a                   	pop    %edx
   12035:	59                   	pop    %ecx
   12036:	50                   	push   %eax
   12037:	6a 01                	push   $0x1
   12039:	e8 42 07 00 00       	call   12780 <_ExAllocatePool@8>
   1203e:	89 c2                	mov    %eax,%edx
   12040:	89 45 84             	mov    %eax,0xffffff84(%ebp)
    ParametersPath.MaximumLength);
  if (!ParametersPath.Buffer)
   12043:	59                   	pop    %ecx
   12044:	58                   	pop    %eax
  {
    DPRINT("Can't allocate buffer for parameters\n");
    return FALSE;
   12045:	31 c0                	xor    %eax,%eax
   12047:	85 d2                	test   %edx,%edx
   12049:	75 08                	jne    12053 <_LoadMouseSettings+0x73>
  }
  RtlZeroMemory(ParametersPath.Buffer, ParametersPath.MaximumLength);
  RtlAppendUnicodeToString(&ParametersPath, RegistryPath->Buffer);
  RtlAppendUnicodeToString(&ParametersPath, ParametersKeyPath);
  DPRINT("Parameters Path: %wZ\n", &ParametersPath);
  
  Parameters[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
  Parameters[0].Name = L"Resolution";
  Parameters[0].EntryContext = &DeviceExtension->Resolution;
  Parameters[0].DefaultType = REG_DWORD;
  Parameters[0].DefaultData = &DefaultMouseResolution;
  Parameters[0].DefaultLength = sizeof(ULONG);
  
  Parameters[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
  Parameters[1].Name = L"DisableExtensionDetection";
  Parameters[1].EntryContext = &DeviceExtension->NoExtensions;
  Parameters[1].DefaultType = REG_DWORD;
  Parameters[1].DefaultData = &DisableExtensionDetection;
  Parameters[1].DefaultLength = sizeof(ULONG);
  
   Status = RtlQueryRegistryValues(
     RTL_REGISTRY_ABSOLUTE | RTL_REGISTRY_OPTIONAL,
     ParametersPath.Buffer,
     Parameters,
     NULL,
     NULL);
  
  if (!NT_SUCCESS(Status))
  {
    DPRINT("RtlQueryRegistryValues failed (0x%x)\n", Status);
    return FALSE;
  }
  return TRUE;
}
   1204b:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1204e:	5b                   	pop    %ebx
   1204f:	5e                   	pop    %esi
   12050:	5f                   	pop    %edi
   12051:	5d                   	pop    %ebp
   12052:	c3                   	ret    
   12053:	50                   	push   %eax
   12054:	50                   	push   %eax
   12055:	66 8b 45 82          	mov    0xffffff82(%ebp),%ax
   12059:	25 ff ff 00 00       	and    $0xffff,%eax
   1205e:	50                   	push   %eax
   1205f:	52                   	push   %edx
   12060:	e8 cb 07 00 00       	call   12830 <_RtlZeroMemory@8>
   12065:	8b 46 04             	mov    0x4(%esi),%eax
   12068:	50                   	push   %eax
   12069:	53                   	push   %ebx
   1206a:	e8 21 07 00 00       	call   12790 <_RtlAppendUnicodeToString@8>
   1206f:	68 12 41 01 00       	push   $0x14112
   12074:	53                   	push   %ebx
   12075:	e8 16 07 00 00       	call   12790 <_RtlAppendUnicodeToString@8>
   1207a:	8b 45 08             	mov    0x8(%ebp),%eax
   1207d:	05 34 06 00 00       	add    $0x634,%eax
   12082:	c7 45 8c 20 00 00 00 	movl   $0x20,0xffffff8c(%ebp)
   12089:	89 45 94             	mov    %eax,0xffffff94(%ebp)
   1208c:	8d 85 7c ff ff ff    	lea    0xffffff7c(%ebp),%eax
   12092:	89 45 9c             	mov    %eax,0xffffff9c(%ebp)
   12095:	8b 45 08             	mov    0x8(%ebp),%eax
   12098:	05 28 06 00 00       	add    $0x628,%eax
   1209d:	c7 45 90 2a 41 01 00 	movl   $0x1412a,0xffffff90(%ebp)
   120a4:	89 45 b0             	mov    %eax,0xffffffb0(%ebp)
   120a7:	8d 85 78 ff ff ff    	lea    0xffffff78(%ebp),%eax
   120ad:	89 45 b8             	mov    %eax,0xffffffb8(%ebp)
   120b0:	c7 45 98 04 00 00 00 	movl   $0x4,0xffffff98(%ebp)
   120b7:	c7 45 a0 04 00 00 00 	movl   $0x4,0xffffffa0(%ebp)
   120be:	c7 45 a8 20 00 00 00 	movl   $0x20,0xffffffa8(%ebp)
   120c5:	c7 45 ac 40 41 01 00 	movl   $0x14140,0xffffffac(%ebp)
   120cc:	c7 45 b4 04 00 00 00 	movl   $0x4,0xffffffb4(%ebp)
   120d3:	c7 45 bc 04 00 00 00 	movl   $0x4,0xffffffbc(%ebp)
   120da:	50                   	push   %eax
   120db:	6a 00                	push   $0x0
   120dd:	6a 00                	push   $0x0
   120df:	57                   	push   %edi
   120e0:	8b 45 84             	mov    0xffffff84(%ebp),%eax
   120e3:	50                   	push   %eax
   120e4:	68 00 00 00 80       	push   $0x80000000
   120e9:	e8 52 07 00 00       	call   12840 <_RtlQueryRegistryValues@20>
   120ee:	83 f0 ff             	xor    $0xffffffff,%eax
   120f1:	83 c4 0c             	add    $0xc,%esp
   120f4:	c1 e8 1f             	shr    $0x1f,%eax
   120f7:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   120fa:	5b                   	pop    %ebx
   120fb:	5e                   	pop    %esi
   120fc:	5f                   	pop    %edi
   120fd:	5d                   	pop    %ebp
   120fe:	c3                   	ret    
   120ff:	90                   	nop    

00012100 <_SetupMouse>:


// Initialize the PS/2 mouse support
BOOLEAN SetupMouse(PDEVICE_OBJECT DeviceObject, PUNICODE_STRING RegistryPath)
{
   12100:	55                   	push   %ebp
   12101:	89 e5                	mov    %esp,%ebp
   12103:	56                   	push   %esi
   12104:	53                   	push   %ebx
   12105:	83 ec 18             	sub    $0x18,%esp
   12108:	8b 75 08             	mov    0x8(%ebp),%esi
  PDEVICE_EXTENSION DeviceExtension = DeviceObject->DeviceExtension;
   1210b:	8b 5e 28             	mov    0x28(%esi),%ebx
  ULONG MappedIrq;
  KIRQL Dirql;
  KAFFINITY Affinity;
  LARGE_INTEGER Millisecond_Timeout;
  
  Millisecond_Timeout.QuadPart = -10000L;

  /* setup */
  DeviceExtension->NoExtensions = 0;
  DeviceExtension->InputDataCount[0] = 0;
  DeviceExtension->InputDataCount[1] = 0;
  DeviceExtension->ActiveQueue = 0;
  DeviceExtension->MouseBufferPosition = 0;
  DeviceExtension->MouseBufferSize = 3;
  DeviceExtension->Resolution = 0;
  DeviceExtension->RepliesExpected = 0;
  DeviceExtension->PreviousButtons = 0;
  DeviceExtension->SmartScroll = 1;
  DeviceExtension->ack = 0;
   1210e:	c6 83 22 06 00 00 00 	movb   $0x0,0x622(%ebx)
  DeviceExtension->acking = 0;
   12115:	c6 83 23 06 00 00 00 	movb   $0x0,0x623(%ebx)
  
  LoadMouseSettings(DeviceExtension, RegistryPath);
   1211c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
   1211f:	c7 83 28 06 00 00 00 	movl   $0x0,0x628(%ebx)
   12126:	00 00 00 
   12129:	c7 43 08 00 00 00 00 	movl   $0x0,0x8(%ebx)
   12130:	c7 43 0c 00 00 00 00 	movl   $0x0,0xc(%ebx)
   12137:	c7 43 04 00 00 00 00 	movl   $0x0,0x4(%ebx)
   1213e:	c7 83 2c 06 00 00 00 	movl   $0x0,0x62c(%ebx)
   12145:	00 00 00 
   12148:	c7 83 30 06 00 00 03 	movl   $0x3,0x630(%ebx)
   1214f:	00 00 00 
   12152:	c7 83 34 06 00 00 00 	movl   $0x0,0x634(%ebx)
   12159:	00 00 00 
   1215c:	c7 83 38 06 00 00 00 	movl   $0x0,0x638(%ebx)
   12163:	00 00 00 
   12166:	c7 83 3c 06 00 00 00 	movl   $0x0,0x63c(%ebx)
   1216d:	00 00 00 
   12170:	c7 83 24 06 00 00 01 	movl   $0x1,0x624(%ebx)
   12177:	00 00 00 
   1217a:	51                   	push   %ecx
   1217b:	53                   	push   %ebx
   1217c:	e8 5f fe ff ff       	call   11fe0 <_LoadMouseSettings>

  // Enable the PS/2 mouse port
  controller_write_command_word (CONTROLLER_COMMAND_MOUSE_ENABLE);
   12181:	c7 04 24 a8 00 00 00 	movl   $0xa8,(%esp)
   12188:	e8 c3 f3 ff ff       	call   11550 <_controller_write_command_word>
  
  //InitializeMouse(DeviceExtension);
  DeviceExtension->MouseType = TestMouse(DeviceExtension);
   1218d:	89 1c 24             	mov    %ebx,(%esp)
   12190:	e8 0b fd ff ff       	call   11ea0 <_TestMouse>
  
  if(DeviceExtension->MouseType > 0)
   12195:	83 c4 10             	add    $0x10,%esp
   12198:	84 c0                	test   %al,%al
   1219a:	88 83 20 06 00 00    	mov    %al,0x620(%ebx)
   121a0:	74 48                	je     121ea <_SetupMouse+0xea>
  {
    /* set the incoming buffer to 4 if needed */
    DeviceExtension->MouseBufferSize += (DeviceExtension->MouseType >= PSMOUSE_GENPS);
   121a2:	3c 03                	cmp    $0x3,%al
   121a4:	8b 93 30 06 00 00    	mov    0x630(%ebx),%edx
   121aa:	0f 97 c0             	seta   %al
   121ad:	25 ff 00 00 00       	and    $0xff,%eax
    
    DPRINT("Detected Mouse: 0x%x\n", DeviceExtension->MouseType);
    
    InitializeMouse(DeviceExtension);
   121b2:	83 ec 0c             	sub    $0xc,%esp
   121b5:	01 c2                	add    %eax,%edx
   121b7:	89 93 30 06 00 00    	mov    %edx,0x630(%ebx)
   121bd:	53                   	push   %ebx
   121be:	e8 8d fd ff ff       	call   11f50 <_InitializeMouse>
   121c3:	83 c4 10             	add    $0x10,%esp
   121c6:	e8 75 f2 ff ff       	call   11440 <_controller_wait>
   121cb:	51                   	push   %ecx
   121cc:	51                   	push   %ecx
   121cd:	6a 60                	push   $0x60
   121cf:	6a 64                	push   $0x64
   121d1:	e8 da 06 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   121d6:	58                   	pop    %eax
   121d7:	5a                   	pop    %edx
   121d8:	e8 63 f2 ff ff       	call   11440 <_controller_wait>
   121dd:	51                   	push   %ecx
   121de:	51                   	push   %ecx
   121df:	6a 47                	push   $0x47
   121e1:	6a 60                	push   $0x60
   121e3:	e8 c8 06 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   121e8:	58                   	pop    %eax
   121e9:	5a                   	pop    %edx
    
    // Enable controller interrupts
    mouse_write_command (MOUSE_INTERRUPTS_ON);
    
    // Connect the interrupt for the mouse irq
    MappedIrq = HalGetInterruptVector(Internal, 0, 0, MOUSE_IRQ, &Dirql, &Affinity);

    IoConnectInterrupt(&DeviceExtension->MouseInterrupt, MouseHandler, DeviceObject, NULL, MappedIrq,
                       Dirql, Dirql, 0, FALSE, Affinity, FALSE);
  }
  else
  {
    /* FIXME - this fixes the crash if no mouse was detected */
    
    // Connect the interrupt for the mouse irq
    MappedIrq = HalGetInterruptVector(Internal, 0, 0, MOUSE_IRQ, &Dirql, &Affinity);
   121ea:	50                   	push   %eax
   121eb:	50                   	push   %eax
   121ec:	8d 45 f4             	lea    0xfffffff4(%ebp),%eax
   121ef:	50                   	push   %eax
   121f0:	8d 45 f3             	lea    0xfffffff3(%ebp),%eax
   121f3:	50                   	push   %eax
   121f4:	6a 0c                	push   $0xc
   121f6:	6a 00                	push   $0x0
   121f8:	6a 00                	push   $0x0
   121fa:	6a 00                	push   $0x0
   121fc:	e8 bf 06 00 00       	call   128c0 <_HalGetInterruptVector@24>
   12201:	89 c2                	mov    %eax,%edx

    IoConnectInterrupt(&DeviceExtension->MouseInterrupt, MouseHandler, DeviceObject, NULL, MappedIrq,
   12203:	8b 45 f4             	mov    0xfffffff4(%ebp),%eax
   12206:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
   1220d:	50                   	push   %eax
   1220e:	31 c0                	xor    %eax,%eax
   12210:	6a 00                	push   $0x0
   12212:	8a 45 f3             	mov    0xfffffff3(%ebp),%al
   12215:	6a 00                	push   $0x0
   12217:	50                   	push   %eax
   12218:	50                   	push   %eax
   12219:	8d 83 48 06 00 00    	lea    0x648(%ebx),%eax
   1221f:	52                   	push   %edx
   12220:	6a 00                	push   $0x0
   12222:	56                   	push   %esi
   12223:	68 60 18 01 00       	push   $0x11860
   12228:	50                   	push   %eax
   12229:	e8 22 06 00 00       	call   12850 <_IoConnectInterrupt@44>
   1222e:	58                   	pop    %eax
                       Dirql, Dirql, 0, FALSE, Affinity, FALSE);
  }

  return TRUE;
}
   1222f:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   12232:	b8 01 00 00 00       	mov    $0x1,%eax
   12237:	5b                   	pop    %ebx
   12238:	5e                   	pop    %esi
   12239:	5d                   	pop    %ebp
   1223a:	c3                   	ret    
   1223b:	90                   	nop    
   1223c:	8d 74 26 00          	lea    0x0(%esi),%esi

00012240 <_DetectPS2Port>:


// Check if this is a dual port controller.
BOOLEAN DetectPS2Port(void)
{
   12240:	55                   	push   %ebp
   12241:	89 e5                	mov    %esp,%ebp
   12243:	57                   	push   %edi
   12244:	56                   	push   %esi
   12245:	53                   	push   %ebx
   12246:	83 ec 0c             	sub    $0xc,%esp
  int loops;
  unsigned scancode;
  BOOLEAN return_value = FALSE;
  LARGE_INTEGER Millisecond_Timeout;
  
  Millisecond_Timeout.QuadPart = -10000L;
   12249:	c7 45 e8 f0 d8 ff ff 	movl   $0xffffd8f0,0xffffffe8(%ebp)
   12250:	c7 45 ec ff ff ff ff 	movl   $0xffffffff,0xffffffec(%ebp)
   12257:	31 ff                	xor    %edi,%edi
  
  //return TRUE; // The rest of this code fails under BOCHs
  
  /* Put the value 0x5A in the output buffer using the "WriteAuxiliary Device Output Buffer" command (0xD3).
     Poll the Status Register for a while to see if the value really turns up in the Data Register. If the
     KEYBOARD_STATUS_MOUSE_OBF bit is also set to 1 in the Status Register, we assume this controller has an
     Auxiliary Port (a.k.a. Mouse Port). */
  
  controller_wait ();
   12259:	e8 e2 f1 ff ff       	call   11440 <_controller_wait>
  controller_write_command(CONTROLLER_COMMAND_WRITE_MOUSE_OUTPUT_BUFFER);
   1225e:	50                   	push   %eax
   1225f:	50                   	push   %eax
   12260:	68 d3 00 00 00       	push   $0xd3
   12265:	6a 64                	push   $0x64
   12267:	e8 44 06 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
  controller_wait ();
   1226c:	5b                   	pop    %ebx
   1226d:	5e                   	pop    %esi
   1226e:	e8 cd f1 ff ff       	call   11440 <_controller_wait>
  
  /* 0x5A is a random dummy value */
  controller_write_output(0x5A);
  
  for (loops = 0; loops < 10; loops++)
   12273:	31 f6                	xor    %esi,%esi
   12275:	51                   	push   %ecx
   12276:	51                   	push   %ecx
   12277:	6a 5a                	push   $0x5a
   12279:	6a 60                	push   $0x60
   1227b:	e8 30 06 00 00       	call   128b0 <_WRITE_PORT_UCHAR@8>
   12280:	58                   	pop    %eax
   12281:	5a                   	pop    %edx
  {
    unsigned char status = controller_read_status();
   12282:	83 ec 0c             	sub    $0xc,%esp
    
    if((status & CONTROLLER_STATUS_OUTPUT_BUFFER_FULL) != 0)
   12285:	31 db                	xor    %ebx,%ebx
   12287:	6a 64                	push   $0x64
   12289:	e8 12 06 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   1228e:	88 c3                	mov    %al,%bl
   12290:	83 c4 0c             	add    $0xc,%esp
   12293:	f6 c3 01             	test   $0x1,%bl
   12296:	75 24                	jne    122bc <_DetectPS2Port+0x7c>
    {
      scancode = controller_read_input();
      if((status & CONTROLLER_STATUS_MOUSE_OUTPUT_BUFFER_FULL) != 0)
      {
        return_value = TRUE;
      }
      break;
    }
    
    KeDelayExecutionThread(KernelMode, FALSE, &Millisecond_Timeout);
   12298:	50                   	push   %eax
   12299:	8d 45 e8             	lea    0xffffffe8(%ebp),%eax
   1229c:	46                   	inc    %esi
   1229d:	50                   	push   %eax
   1229e:	6a 00                	push   $0x0
   122a0:	6a 00                	push   $0x0
   122a2:	e8 69 05 00 00       	call   12810 <_KeDelayExecutionThread@12>
   122a7:	83 fe 09             	cmp    $0x9,%esi
   122aa:	5b                   	pop    %ebx
   122ab:	7e d5                	jle    12282 <_DetectPS2Port+0x42>
  }
  
  return return_value;
   122ad:	89 f8                	mov    %edi,%eax
}
   122af:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   122b2:	25 ff 00 00 00       	and    $0xff,%eax
   122b7:	5b                   	pop    %ebx
   122b8:	5e                   	pop    %esi
   122b9:	5f                   	pop    %edi
   122ba:	5d                   	pop    %ebp
   122bb:	c3                   	ret    
   122bc:	83 ec 0c             	sub    $0xc,%esp
   122bf:	6a 60                	push   $0x60
   122c1:	e8 da 05 00 00       	call   128a0 <_READ_PORT_UCHAR@4>
   122c6:	83 c4 0c             	add    $0xc,%esp
   122c9:	83 e3 20             	and    $0x20,%ebx
   122cc:	74 df                	je     122ad <_DetectPS2Port+0x6d>
   122ce:	bf 01 00 00 00       	mov    $0x1,%edi
   122d3:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   122d6:	89 f8                	mov    %edi,%eax
   122d8:	5b                   	pop    %ebx
   122d9:	25 ff 00 00 00       	and    $0xff,%eax
   122de:	5e                   	pop    %esi
   122df:	5f                   	pop    %edi
   122e0:	5d                   	pop    %ebp
   122e1:	c3                   	ret    
   122e2:	90                   	nop    
   122e3:	90                   	nop    
   122e4:	90                   	nop    
   122e5:	90                   	nop    
   122e6:	90                   	nop    
   122e7:	90                   	nop    
   122e8:	90                   	nop    
   122e9:	90                   	nop    
   122ea:	90                   	nop    
   122eb:	90                   	nop    
   122ec:	90                   	nop    
   122ed:	90                   	nop    
   122ee:	90                   	nop    
   122ef:	90                   	nop    

000122f0 <_PS2PPProcessPacket>:
   122f0:	55                   	push   %ebp
   122f1:	31 c9                	xor    %ecx,%ecx
   122f3:	89 e5                	mov    %esp,%ebp
   122f5:	57                   	push   %edi
   122f6:	56                   	push   %esi
   122f7:	53                   	push   %ebx
   122f8:	83 ec 0c             	sub    $0xc,%esp
   122fb:	8b 5d 08             	mov    0x8(%ebp),%ebx
   122fe:	8b 7d 0c             	mov    0xc(%ebp),%edi
   12301:	8a 8b 10 06 00 00    	mov    0x610(%ebx),%cl
   12307:	8d b3 10 06 00 00    	lea    0x610(%ebx),%esi
   1230d:	89 c8                	mov    %ecx,%eax
   1230f:	83 e0 48             	and    $0x48,%eax
   12312:	83 f8 48             	cmp    $0x48,%eax
   12315:	74 09                	je     12320 <_PS2PPProcessPacket+0x30>
   12317:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1231a:	5b                   	pop    %ebx
   1231b:	5e                   	pop    %esi
   1231c:	5f                   	pop    %edi
   1231d:	5d                   	pop    %ebp
   1231e:	c3                   	ret    
   1231f:	90                   	nop    
   12320:	8a 56 01             	mov    0x1(%esi),%dl
   12323:	f6 c2 02             	test   $0x2,%dl
   12326:	74 ef                	je     12317 <_PS2PPProcessPacket+0x27>
   12328:	88 d0                	mov    %dl,%al
   1232a:	83 e1 30             	and    $0x30,%ecx
   1232d:	c0 e8 04             	shr    $0x4,%al
   12330:	25 ff 00 00 00       	and    $0xff,%eax
   12335:	09 c8                	or     %ecx,%eax
   12337:	83 f8 0e             	cmp    $0xe,%eax
   1233a:	0f 84 9a 00 00 00    	je     123da <_PS2PPProcessPacket+0xea>
   12340:	7f 3a                	jg     1237c <_PS2PPProcessPacket+0x8c>
   12342:	83 f8 0d             	cmp    $0xd,%eax
   12345:	74 62                	je     123a9 <_PS2PPProcessPacket+0xb9>
   12347:	c0 ea 04             	shr    $0x4,%dl
   1234a:	50                   	push   %eax
   1234b:	50                   	push   %eax
   1234c:	31 c0                	xor    %eax,%eax
   1234e:	81 e2 ff 00 00 00    	and    $0xff,%edx
   12354:	8a 06                	mov    (%esi),%al
   12356:	83 e0 30             	and    $0x30,%eax
   12359:	09 c2                	or     %eax,%edx
   1235b:	52                   	push   %edx
   1235c:	68 80 41 01 00       	push   $0x14180
   12361:	e8 9a 04 00 00       	call   12800 <_DbgPrint>
   12366:	83 c4 10             	add    $0x10,%esp
   12369:	80 26 0f             	andb   $0xf,(%esi)
   1236c:	c6 46 01 00          	movb   $0x0,0x1(%esi)
   12370:	c6 46 02 00          	movb   $0x0,0x2(%esi)
   12374:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12377:	5b                   	pop    %ebx
   12378:	5e                   	pop    %esi
   12379:	5f                   	pop    %edi
   1237a:	5d                   	pop    %ebp
   1237b:	c3                   	ret    
   1237c:	83 f8 0f             	cmp    $0xf,%eax
   1237f:	75 c6                	jne    12347 <_PS2PPProcessPacket+0x57>
   12381:	8a 46 02             	mov    0x2(%esi),%al
   12384:	c0 e8 04             	shr    $0x4,%al
   12387:	25 ff 00 00 00       	and    $0xff,%eax
   1238c:	89 c2                	mov    %eax,%edx
   1238e:	83 e0 07             	and    $0x7,%eax
   12391:	83 e2 08             	and    $0x8,%edx
   12394:	29 c2                	sub    %eax,%edx
   12396:	8b 45 10             	mov    0x10(%ebp),%eax
   12399:	89 10                	mov    %edx,(%eax)
   1239b:	8a 46 02             	mov    0x2(%esi),%al
   1239e:	83 c8 08             	or     $0x8,%eax
   123a1:	88 83 10 06 00 00    	mov    %al,0x610(%ebx)
   123a7:	eb c0                	jmp    12369 <_PS2PPProcessPacket+0x79>
   123a9:	31 c0                	xor    %eax,%eax
   123ab:	8a 46 02             	mov    0x2(%esi),%al
   123ae:	89 c2                	mov    %eax,%edx
   123b0:	83 e0 07             	and    $0x7,%eax
   123b3:	83 e2 08             	and    $0x8,%edx
   123b6:	29 c2                	sub    %eax,%edx
   123b8:	8b 45 10             	mov    0x10(%ebp),%eax
   123bb:	89 10                	mov    %edx,(%eax)
   123bd:	8b 47 08             	mov    0x8(%edi),%eax
   123c0:	f6 46 02 10          	testb  $0x10,0x2(%esi)
   123c4:	74 03                	je     123c9 <_PS2PPProcessPacket+0xd9>
   123c6:	83 c8 10             	or     $0x10,%eax
   123c9:	89 47 08             	mov    %eax,0x8(%edi)
   123cc:	f6 46 02 20          	testb  $0x20,0x2(%esi)
   123d0:	74 03                	je     123d5 <_PS2PPProcessPacket+0xe5>
   123d2:	83 c8 20             	or     $0x20,%eax
   123d5:	89 47 08             	mov    %eax,0x8(%edi)
   123d8:	eb 8f                	jmp    12369 <_PS2PPProcessPacket+0x79>
   123da:	8b 47 08             	mov    0x8(%edi),%eax
   123dd:	f6 46 02 01          	testb  $0x1,0x2(%esi)
   123e1:	74 03                	je     123e6 <_PS2PPProcessPacket+0xf6>
   123e3:	83 c8 10             	or     $0x10,%eax
   123e6:	89 47 08             	mov    %eax,0x8(%edi)
   123e9:	f6 46 02 02          	testb  $0x2,0x2(%esi)
   123ed:	eb e1                	jmp    123d0 <_PS2PPProcessPacket+0xe0>
   123ef:	90                   	nop    

000123f0 <_ps2pp_cmd>:
   123f0:	55                   	push   %ebp
   123f1:	89 e5                	mov    %esp,%ebp
   123f3:	57                   	push   %edi
   123f4:	56                   	push   %esi
   123f5:	53                   	push   %ebx
   123f6:	83 ec 10             	sub    $0x10,%esp
   123f9:	89 55 ec             	mov    %edx,0xffffffec(%ebp)
   123fc:	0f b6 7d 08          	movzbl 0x8(%ebp),%edi
   12400:	89 c6                	mov    %eax,%esi
   12402:	68 e6 00 00 00       	push   $0xe6
   12407:	6a 00                	push   $0x0
   12409:	50                   	push   %eax
   1240a:	e8 31 f6 ff ff       	call   11a40 <_SendCommand>
   1240f:	83 c4 10             	add    $0x10,%esp
   12412:	83 ca ff             	or     $0xffffffff,%edx
   12415:	85 c0                	test   %eax,%eax
   12417:	75 4f                	jne    12468 <_ps2pp_cmd+0x78>
   12419:	bb 06 00 00 00       	mov    $0x6,%ebx
   1241e:	81 e7 ff 00 00 00    	and    $0xff,%edi
   12424:	88 d9                	mov    %bl,%cl
   12426:	89 f8                	mov    %edi,%eax
   12428:	d3 f8                	sar    %cl,%eax
   1242a:	83 e0 03             	and    $0x3,%eax
   1242d:	88 45 f3             	mov    %al,0xfffffff3(%ebp)
   12430:	50                   	push   %eax
   12431:	8d 45 f3             	lea    0xfffffff3(%ebp),%eax
   12434:	68 e8 10 00 00       	push   $0x10e8
   12439:	50                   	push   %eax
   1243a:	56                   	push   %esi
   1243b:	e8 00 f6 ff ff       	call   11a40 <_SendCommand>
   12440:	83 c4 10             	add    $0x10,%esp
   12443:	85 c0                	test   %eax,%eax
   12445:	75 2b                	jne    12472 <_ps2pp_cmd+0x82>
   12447:	83 eb 02             	sub    $0x2,%ebx
   1244a:	79 d8                	jns    12424 <_ps2pp_cmd+0x34>
   1244c:	51                   	push   %ecx
   1244d:	68 eb 03 00 00       	push   $0x3eb
   12452:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   12455:	52                   	push   %edx
   12456:	56                   	push   %esi
   12457:	e8 e4 f5 ff ff       	call   11a40 <_SendCommand>
   1245c:	83 c4 10             	add    $0x10,%esp
   1245f:	83 ca ff             	or     $0xffffffff,%edx
   12462:	85 c0                	test   %eax,%eax
   12464:	75 02                	jne    12468 <_ps2pp_cmd+0x78>
   12466:	31 d2                	xor    %edx,%edx
   12468:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1246b:	89 d0                	mov    %edx,%eax
   1246d:	5b                   	pop    %ebx
   1246e:	5e                   	pop    %esi
   1246f:	5f                   	pop    %edi
   12470:	5d                   	pop    %ebp
   12471:	c3                   	ret    
   12472:	83 ca ff             	or     $0xffffffff,%edx
   12475:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12478:	89 d0                	mov    %edx,%eax
   1247a:	5b                   	pop    %ebx
   1247b:	5e                   	pop    %esi
   1247c:	5f                   	pop    %edi
   1247d:	5d                   	pop    %ebp
   1247e:	c3                   	ret    
   1247f:	90                   	nop    

00012480 <_PS2PPSet800dpi>:
   12480:	55                   	push   %ebp
   12481:	89 e5                	mov    %esp,%ebp
   12483:	53                   	push   %ebx
   12484:	50                   	push   %eax
   12485:	50                   	push   %eax
   12486:	8b 5d 08             	mov    0x8(%ebp),%ebx
   12489:	68 e6 00 00 00       	push   $0xe6
   1248e:	6a 00                	push   $0x0
   12490:	53                   	push   %ebx
   12491:	c6 45 fb 03          	movb   $0x3,0xfffffffb(%ebp)
   12495:	e8 a6 f5 ff ff       	call   11a40 <_SendCommand>
   1249a:	83 c4 0c             	add    $0xc,%esp
   1249d:	68 e6 00 00 00       	push   $0xe6
   124a2:	6a 00                	push   $0x0
   124a4:	53                   	push   %ebx
   124a5:	e8 96 f5 ff ff       	call   11a40 <_SendCommand>
   124aa:	83 c4 0c             	add    $0xc,%esp
   124ad:	68 e6 00 00 00       	push   $0xe6
   124b2:	6a 00                	push   $0x0
   124b4:	53                   	push   %ebx
   124b5:	e8 86 f5 ff ff       	call   11a40 <_SendCommand>
   124ba:	83 c4 0c             	add    $0xc,%esp
   124bd:	8d 45 fb             	lea    0xfffffffb(%ebp),%eax
   124c0:	68 e8 10 00 00       	push   $0x10e8
   124c5:	50                   	push   %eax
   124c6:	53                   	push   %ebx
   124c7:	e8 74 f5 ff ff       	call   11a40 <_SendCommand>
   124cc:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   124cf:	c9                   	leave  
   124d0:	c3                   	ret    
   124d1:	eb 0d                	jmp    124e0 <_PS2PPDetectModel>
   124d3:	90                   	nop    
   124d4:	90                   	nop    
   124d5:	90                   	nop    
   124d6:	90                   	nop    
   124d7:	90                   	nop    
   124d8:	90                   	nop    
   124d9:	90                   	nop    
   124da:	90                   	nop    
   124db:	90                   	nop    
   124dc:	90                   	nop    
   124dd:	90                   	nop    
   124de:	90                   	nop    
   124df:	90                   	nop    

000124e0 <_PS2PPDetectModel>:
   124e0:	55                   	push   %ebp
	static int logitech_wheel[] = { 52, 53, 75, 76, 80, 81, 83, 88, 112, -1 };
	static int logitech_ps2pp[] = { 12, 13, 40, 41, 42, 43, 50, 51, 52, 53, 73, 75,
						76, 80, 81, 83, 88, 96, 97, 112, -1 };
	static int logitech_mx[] = { 112, -1 };

	//vendor = "Logitech";
	//DbgPrint("Vendor: %s, name: %s\n", vendor, name);
	DeviceExtension->MouseModel = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);

	/*if (param[1] < 3)
		clear_bit(BTN_MIDDLE, DeviceExtension->dev.keybit);
	if (param[1] < 2)
		clear_bit(BTN_RIGHT, DeviceExtension->dev.keybit);*/

	DeviceExtension->MouseType = PSMOUSE_PS2;

	for (i = 0; logitech_ps2pp[i] != -1; i++)
   124e1:	31 d2                	xor    %edx,%edx
   124e3:	89 e5                	mov    %esp,%ebp
   124e5:	57                   	push   %edi
   124e6:	56                   	push   %esi
   124e7:	53                   	push   %ebx
   124e8:	83 ec 0c             	sub    $0xc,%esp
   124eb:	8b 7d 0c             	mov    0xc(%ebp),%edi
   124ee:	8b 75 08             	mov    0x8(%ebp),%esi
   124f1:	8a 07                	mov    (%edi),%al
   124f3:	c6 86 20 06 00 00 01 	movb   $0x1,0x620(%esi)
   124fa:	88 c3                	mov    %al,%bl
   124fc:	c0 eb 04             	shr    $0x4,%bl
   124ff:	c1 e0 03             	shl    $0x3,%eax
   12502:	83 e3 07             	and    $0x7,%ebx
   12505:	83 e0 78             	and    $0x78,%eax
   12508:	09 c3                	or     %eax,%ebx
   1250a:	88 9e 21 06 00 00    	mov    %bl,0x621(%esi)
   12510:	a1 40 30 01 00       	mov    0x13040,%eax
   12515:	83 f8 ff             	cmp    $0xffffffff,%eax
   12518:	74 2b                	je     12545 <_PS2PPDetectModel+0x65>
   1251a:	31 c9                	xor    %ecx,%ecx
   1251c:	88 d9                	mov    %bl,%cl
   1251e:	eb 0d                	jmp    1252d <_PS2PPDetectModel+0x4d>
   12520:	42                   	inc    %edx
   12521:	8b 04 95 40 30 01 00 	mov    0x13040(,%edx,4),%eax
   12528:	83 f8 ff             	cmp    $0xffffffff,%eax
   1252b:	74 18                	je     12545 <_PS2PPDetectModel+0x65>
		if (logitech_ps2pp[i] == DeviceExtension->MouseModel)
   1252d:	39 c8                	cmp    %ecx,%eax
   1252f:	75 ef                	jne    12520 <_PS2PPDetectModel+0x40>
   12531:	42                   	inc    %edx
			DeviceExtension->MouseType = PSMOUSE_PS2PP;
   12532:	c6 86 20 06 00 00 02 	movb   $0x2,0x620(%esi)
   12539:	8b 04 95 40 30 01 00 	mov    0x13040(,%edx,4),%eax
   12540:	83 f8 ff             	cmp    $0xffffffff,%eax
   12543:	75 e8                	jne    1252d <_PS2PPDetectModel+0x4d>

	if (DeviceExtension->MouseType == PSMOUSE_PS2PP) {
   12545:	80 be 20 06 00 00 02 	cmpb   $0x2,0x620(%esi)
   1254c:	74 0a                	je     12558 <_PS2PPDetectModel+0x78>

	/*	for (i = 0; logitech_4btn[i] != -1; i++)
			if (logitech_4btn[i] == DeviceExtension->MouseModel)
				set_bit(BTN_SIDE, psmouse->dev.keybit);
*/
		for (i = 0; logitech_wheel[i] != -1; i++)
			if (logitech_wheel[i] == DeviceExtension->MouseModel) {
//				set_bit(REL_WHEEL, psmouse->dev.relbit);
				//name = "Wheel Mouse";DbgPrint("Vendor: %s, name: %s\n", vendor, name);
			}

		for (i = 0; logitech_mx[i] != -1; i++)
			if (logitech_mx[i]  == DeviceExtension->MouseModel) {
	/*			set_bit(BTN_SIDE, psmouse->dev.keybit);
				set_bit(BTN_EXTRA, psmouse->dev.keybit);
				set_bit(BTN_BACK, psmouse->dev.keybit);
				set_bit(BTN_FORWARD, psmouse->dev.keybit);
				set_bit(BTN_TASK, psmouse->dev.keybit);
		*/		//name = "MX Mouse";DbgPrint("Vendor: %s, name: %s\n", vendor, name);
			}

/*
 * Do Logitech PS2++ / PS2T++ magic init.
 */

		if (DeviceExtension->MouseModel == 97) { /* TouchPad 3 */

//			set_bit(REL_WHEEL, psmouse->dev.relbit);
//			set_bit(REL_HWHEEL, psmouse->dev.relbit);

			param[0] = 0x11; param[1] = 0x04; param[2] = 0x68; /* Unprotect RAM */
			SendCommand(DeviceExtension, param, 0x30d1);
			param[0] = 0x11; param[1] = 0x05; param[2] = 0x0b; /* Enable features */
			SendCommand(DeviceExtension, param, 0x30d1);
			param[0] = 0x11; param[1] = 0x09; param[2] = 0xc3; /* Enable PS2++ */
			SendCommand(DeviceExtension, param, 0x30d1);

			param[0] = 0;
			if (!SendCommand(DeviceExtension, param, 0x13d1) &&
				param[0] == 0x06 && param[1] == 0x00 && param[2] == 0x14) {
				//name = "TouchPad 3";DbgPrint("Vendor: %s, name: %s\n", vendor, name);
				return PSMOUSE_PS2TPP;
			}

		} else {

			param[0] = param[1] = param[2] = 0;
			ps2pp_cmd(DeviceExtension, param, 0x39); /* Magic knock */
			ps2pp_cmd(DeviceExtension, param, 0xDB);

			if ((param[0] & 0x78) == 0x48 && (param[1] & 0xf3) == 0xc2 &&
				(param[2] & 3) == ((param[1] >> 2) & 3)) {
					ps2pp_set_smartscroll(DeviceExtension);
					return PSMOUSE_PS2PP;
			}
		}
	}

	return 0;
   1254e:	31 c0                	xor    %eax,%eax
}
   12550:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12553:	5b                   	pop    %ebx
   12554:	5e                   	pop    %esi
   12555:	5f                   	pop    %edi
   12556:	5d                   	pop    %ebp
   12557:	c3                   	ret    
   12558:	31 d2                	xor    %edx,%edx
   1255a:	83 3d 00 30 01 00 ff 	cmpl   $0xffffffff,0x13000
   12561:	eb 09                	jmp    1256c <_PS2PPDetectModel+0x8c>
   12563:	42                   	inc    %edx
   12564:	83 3c 95 00 30 01 00 	cmpl   $0xffffffff,0x13000(,%edx,4)
   1256b:	ff 
   1256c:	75 f5                	jne    12563 <_PS2PPDetectModel+0x83>
   1256e:	31 d2                	xor    %edx,%edx
   12570:	83 3d 94 30 01 00 ff 	cmpl   $0xffffffff,0x13094
   12577:	eb 10                	jmp    12589 <_PS2PPDetectModel+0xa9>
   12579:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   12580:	42                   	inc    %edx
   12581:	83 3c 95 94 30 01 00 	cmpl   $0xffffffff,0x13094(,%edx,4)
   12588:	ff 
   12589:	75 f5                	jne    12580 <_PS2PPDetectModel+0xa0>
   1258b:	80 fb 61             	cmp    $0x61,%bl
   1258e:	0f 84 dc 00 00 00    	je     12670 <_PS2PPDetectModel+0x190>
   12594:	83 ec 0c             	sub    $0xc,%esp
   12597:	c6 47 02 00          	movb   $0x0,0x2(%edi)
   1259b:	c6 47 01 00          	movb   $0x0,0x1(%edi)
   1259f:	c6 07 00             	movb   $0x0,(%edi)
   125a2:	89 fa                	mov    %edi,%edx
   125a4:	89 f0                	mov    %esi,%eax
   125a6:	6a 39                	push   $0x39
   125a8:	e8 43 fe ff ff       	call   123f0 <_ps2pp_cmd>
   125ad:	89 fa                	mov    %edi,%edx
   125af:	89 f0                	mov    %esi,%eax
   125b1:	c7 04 24 db 00 00 00 	movl   $0xdb,(%esp)
   125b8:	e8 33 fe ff ff       	call   123f0 <_ps2pp_cmd>
   125bd:	31 c0                	xor    %eax,%eax
   125bf:	83 c4 10             	add    $0x10,%esp
   125c2:	8a 07                	mov    (%edi),%al
   125c4:	83 e0 78             	and    $0x78,%eax
   125c7:	83 f8 48             	cmp    $0x48,%eax
   125ca:	75 82                	jne    1254e <_PS2PPDetectModel+0x6e>
   125cc:	8a 57 01             	mov    0x1(%edi),%dl
   125cf:	89 d0                	mov    %edx,%eax
   125d1:	25 f3 00 00 00       	and    $0xf3,%eax
   125d6:	3d c2 00 00 00       	cmp    $0xc2,%eax
   125db:	0f 85 6d ff ff ff    	jne    1254e <_PS2PPDetectModel+0x6e>
   125e1:	c0 ea 02             	shr    $0x2,%dl
   125e4:	31 c0                	xor    %eax,%eax
   125e6:	8a 47 02             	mov    0x2(%edi),%al
   125e9:	83 e2 03             	and    $0x3,%edx
   125ec:	83 e0 03             	and    $0x3,%eax
   125ef:	39 d0                	cmp    %edx,%eax
   125f1:	0f 85 57 ff ff ff    	jne    1254e <_PS2PPDetectModel+0x6e>
   125f7:	83 ec 0c             	sub    $0xc,%esp
   125fa:	8d 55 f0             	lea    0xfffffff0(%ebp),%edx
   125fd:	89 f0                	mov    %esi,%eax
   125ff:	8d 5d f0             	lea    0xfffffff0(%ebp),%ebx
   12602:	6a 32                	push   $0x32
   12604:	e8 e7 fd ff ff       	call   123f0 <_ps2pp_cmd>
   12609:	83 c4 0c             	add    $0xc,%esp
   1260c:	c6 45 f0 00          	movb   $0x0,0xfffffff0(%ebp)
   12610:	68 e8 10 00 00       	push   $0x10e8
   12615:	53                   	push   %ebx
   12616:	56                   	push   %esi
   12617:	e8 24 f4 ff ff       	call   11a40 <_SendCommand>
   1261c:	83 c4 0c             	add    $0xc,%esp
   1261f:	68 e8 10 00 00       	push   $0x10e8
   12624:	53                   	push   %ebx
   12625:	56                   	push   %esi
   12626:	e8 15 f4 ff ff       	call   11a40 <_SendCommand>
   1262b:	83 c4 0c             	add    $0xc,%esp
   1262e:	68 e8 10 00 00       	push   $0x10e8
   12633:	53                   	push   %ebx
   12634:	56                   	push   %esi
   12635:	e8 06 f4 ff ff       	call   11a40 <_SendCommand>
   1263a:	8b 86 24 06 00 00    	mov    0x624(%esi),%eax
   12640:	83 c4 10             	add    $0x10,%esp
   12643:	83 f8 01             	cmp    $0x1,%eax
   12646:	0f 84 b1 00 00 00    	je     126fd <_PS2PPDetectModel+0x21d>
   1264c:	83 f8 02             	cmp    $0x2,%eax
   1264f:	77 10                	ja     12661 <_PS2PPDetectModel+0x181>
   12651:	50                   	push   %eax
   12652:	68 e8 10 00 00       	push   $0x10e8
   12657:	53                   	push   %ebx
   12658:	56                   	push   %esi
   12659:	e8 e2 f3 ff ff       	call   11a40 <_SendCommand>
   1265e:	83 c4 10             	add    $0x10,%esp
   12661:	b8 02 00 00 00       	mov    $0x2,%eax
   12666:	e9 e5 fe ff ff       	jmp    12550 <_PS2PPDetectModel+0x70>
   1266b:	90                   	nop    
   1266c:	8d 74 26 00          	lea    0x0(%esi),%esi
   12670:	c6 07 11             	movb   $0x11,(%edi)
   12673:	c6 47 01 04          	movb   $0x4,0x1(%edi)
   12677:	c6 47 02 68          	movb   $0x68,0x2(%edi)
   1267b:	50                   	push   %eax
   1267c:	68 d1 30 00 00       	push   $0x30d1
   12681:	57                   	push   %edi
   12682:	56                   	push   %esi
   12683:	e8 b8 f3 ff ff       	call   11a40 <_SendCommand>
   12688:	83 c4 0c             	add    $0xc,%esp
   1268b:	c6 07 11             	movb   $0x11,(%edi)
   1268e:	c6 47 01 05          	movb   $0x5,0x1(%edi)
   12692:	c6 47 02 0b          	movb   $0xb,0x2(%edi)
   12696:	68 d1 30 00 00       	push   $0x30d1
   1269b:	57                   	push   %edi
   1269c:	56                   	push   %esi
   1269d:	e8 9e f3 ff ff       	call   11a40 <_SendCommand>
   126a2:	83 c4 0c             	add    $0xc,%esp
   126a5:	c6 07 11             	movb   $0x11,(%edi)
   126a8:	c6 47 01 09          	movb   $0x9,0x1(%edi)
   126ac:	c6 47 02 c3          	movb   $0xc3,0x2(%edi)
   126b0:	68 d1 30 00 00       	push   $0x30d1
   126b5:	57                   	push   %edi
   126b6:	56                   	push   %esi
   126b7:	e8 84 f3 ff ff       	call   11a40 <_SendCommand>
   126bc:	83 c4 0c             	add    $0xc,%esp
   126bf:	c6 07 00             	movb   $0x0,(%edi)
   126c2:	68 d1 13 00 00       	push   $0x13d1
   126c7:	57                   	push   %edi
   126c8:	56                   	push   %esi
   126c9:	e8 72 f3 ff ff       	call   11a40 <_SendCommand>
   126ce:	83 c4 10             	add    $0x10,%esp
   126d1:	85 c0                	test   %eax,%eax
   126d3:	0f 85 75 fe ff ff    	jne    1254e <_PS2PPDetectModel+0x6e>
   126d9:	80 3f 06             	cmpb   $0x6,(%edi)
   126dc:	0f 85 6c fe ff ff    	jne    1254e <_PS2PPDetectModel+0x6e>
   126e2:	80 7f 01 00          	cmpb   $0x0,0x1(%edi)
   126e6:	0f 85 62 fe ff ff    	jne    1254e <_PS2PPDetectModel+0x6e>
   126ec:	b0 03                	mov    $0x3,%al
   126ee:	80 7f 02 14          	cmpb   $0x14,0x2(%edi)
   126f2:	0f 85 56 fe ff ff    	jne    1254e <_PS2PPDetectModel+0x6e>
   126f8:	e9 53 fe ff ff       	jmp    12550 <_PS2PPDetectModel+0x70>
   126fd:	c6 45 f0 01          	movb   $0x1,0xfffffff0(%ebp)
   12701:	e9 4b ff ff ff       	jmp    12651 <_PS2PPDetectModel+0x171>
   12706:	90                   	nop    
   12707:	90                   	nop    
   12708:	90                   	nop    
   12709:	90                   	nop    
   1270a:	90                   	nop    
   1270b:	90                   	nop    
   1270c:	90                   	nop    
   1270d:	90                   	nop    
   1270e:	90                   	nop    
   1270f:	90                   	nop    

00012710 <_InitSynaptics>:

   12710:	55                   	push   %ebp
   12711:	83 c8 ff             	or     $0xffffffff,%eax
   12714:	89 e5                	mov    %esp,%ebp
   12716:	5d                   	pop    %ebp
   12717:	c3                   	ret    
   12718:	90                   	nop    
   12719:	90                   	nop    
   1271a:	90                   	nop    
   1271b:	90                   	nop    
   1271c:	90                   	nop    
   1271d:	90                   	nop    
   1271e:	90                   	nop    
   1271f:	90                   	nop    

00012720 <_KeSynchronizeExecution@12>:
   12720:	ff 25 0c 61 01 00    	jmp    *0x1610c
   12726:	90                   	nop    
   12727:	90                   	nop    
	...

00012730 <_IoCompleteRequest@8>:
   12730:	ff 25 ec 60 01 00    	jmp    *0x160ec
   12736:	90                   	nop    
   12737:	90                   	nop    
	...

00012740 <_IoStartNextPacket@8>:
   12740:	ff 25 f8 60 01 00    	jmp    *0x160f8
   12746:	90                   	nop    
   12747:	90                   	nop    
	...

00012750 <_IoStartPacket@16>:
   12750:	ff 25 fc 60 01 00    	jmp    *0x160fc
   12756:	90                   	nop    
   12757:	90                   	nop    
	...

00012760 <@InterlockedIncrement@4>:
   12760:	ff 25 dc 60 01 00    	jmp    *0x160dc
   12766:	90                   	nop    
   12767:	90                   	nop    
	...

00012770 <_RtlInitUnicodeString@8>:
   12770:	ff 25 18 61 01 00    	jmp    *0x16118
   12776:	90                   	nop    
   12777:	90                   	nop    
	...

00012780 <_ExAllocatePool@8>:
   12780:	ff 25 e4 60 01 00    	jmp    *0x160e4
   12786:	90                   	nop    
   12787:	90                   	nop    
	...

00012790 <_RtlAppendUnicodeToString@8>:
   12790:	ff 25 10 61 01 00    	jmp    *0x16110
   12796:	90                   	nop    
   12797:	90                   	nop    
	...

000127a0 <_RtlIntegerToUnicodeString@12>:
   127a0:	ff 25 1c 61 01 00    	jmp    *0x1611c
   127a6:	90                   	nop    
   127a7:	90                   	nop    
	...

000127b0 <_IoCreateDevice@28>:
   127b0:	ff 25 f4 60 01 00    	jmp    *0x160f4
   127b6:	90                   	nop    
   127b7:	90                   	nop    
	...

000127c0 <_RtlUnicodeStringToAnsiString@12>:
   127c0:	ff 25 24 61 01 00    	jmp    *0x16124
   127c6:	90                   	nop    
   127c7:	90                   	nop    
	...

000127d0 <_RtlFreeAnsiString@4>:
   127d0:	ff 25 14 61 01 00    	jmp    *0x16114
   127d6:	90                   	nop    
   127d7:	90                   	nop    
	...

000127e0 <_ExFreePool@4>:
   127e0:	ff 25 e8 60 01 00    	jmp    *0x160e8
   127e6:	90                   	nop    
   127e7:	90                   	nop    
	...

000127f0 <_KeInitializeDpc@12>:
   127f0:	ff 25 04 61 01 00    	jmp    *0x16104
   127f6:	90                   	nop    
   127f7:	90                   	nop    
	...

00012800 <_DbgPrint>:
   12800:	ff 25 e0 60 01 00    	jmp    *0x160e0
   12806:	90                   	nop    
   12807:	90                   	nop    
	...

00012810 <_KeDelayExecutionThread@12>:
   12810:	ff 25 00 61 01 00    	jmp    *0x16100
   12816:	90                   	nop    
   12817:	90                   	nop    
	...

00012820 <_KeInsertQueueDpc@12>:
   12820:	ff 25 08 61 01 00    	jmp    *0x16108
   12826:	90                   	nop    
   12827:	90                   	nop    
	...

00012830 <_RtlZeroMemory@8>:
   12830:	ff 25 28 61 01 00    	jmp    *0x16128
   12836:	90                   	nop    
   12837:	90                   	nop    
	...

00012840 <_RtlQueryRegistryValues@20>:
   12840:	ff 25 20 61 01 00    	jmp    *0x16120
   12846:	90                   	nop    
   12847:	90                   	nop    
	...

00012850 <_IoConnectInterrupt@44>:
   12850:	ff 25 f0 60 01 00    	jmp    *0x160f0
   12856:	90                   	nop    
   12857:	90                   	nop    
	...

00012860 <_wcslen>:
   12860:	ff 25 2c 61 01 00    	jmp    *0x1612c
   12866:	90                   	nop    
   12867:	90                   	nop    
	...

00012870 <_KeGetCurrentIrql@0>:
   12870:	ff 25 c0 60 01 00    	jmp    *0x160c0
   12876:	90                   	nop    
   12877:	90                   	nop    
	...

00012880 <_KeRaiseIrql@8>:
   12880:	ff 25 c8 60 01 00    	jmp    *0x160c8
   12886:	90                   	nop    
   12887:	90                   	nop    
	...

00012890 <_KeLowerIrql@4>:
   12890:	ff 25 c4 60 01 00    	jmp    *0x160c4
   12896:	90                   	nop    
   12897:	90                   	nop    
	...

000128a0 <_READ_PORT_UCHAR@4>:
   128a0:	ff 25 cc 60 01 00    	jmp    *0x160cc
   128a6:	90                   	nop    
   128a7:	90                   	nop    
	...

000128b0 <_WRITE_PORT_UCHAR@8>:
   128b0:	ff 25 d0 60 01 00    	jmp    *0x160d0
   128b6:	90                   	nop    
   128b7:	90                   	nop    
	...

000128c0 <_HalGetInterruptVector@24>:
   128c0:	ff 25 bc 60 01 00    	jmp    *0x160bc
   128c6:	90                   	nop    
   128c7:	90                   	nop    
	...

000128d0 <__CTOR_LIST__>:
   128d0:	ff                   	(bad)  
   128d1:	ff                   	(bad)  
   128d2:	ff                   	(bad)  
   128d3:	ff 00                	incl   (%eax)
   128d5:	00 00                	add    %al,(%eax)
	...

000128d8 <__DTOR_LIST__>:
   128d8:	ff                   	(bad)  
   128d9:	ff                   	(bad)  
   128da:	ff                   	(bad)  
   128db:	ff 00                	incl   (%eax)
   128dd:	00 00                	add    %al,(%eax)
	...
