
atapi.nostrip.sys:     file format pei-i386

Disassembly of section .text:

00011000 <_IDESwapBytePairs>:

void
IDESwapBytePairs(char *Buf,
                 int Cnt)
{
   11000:	55                   	push   %ebp
  char  t;
  int   i;

  for (i = 0; i < Cnt; i += 2)
   11001:	31 c9                	xor    %ecx,%ecx
   11003:	89 e5                	mov    %esp,%ebp
   11005:	56                   	push   %esi
   11006:	53                   	push   %ebx
   11007:	8b 75 0c             	mov    0xc(%ebp),%esi
   1100a:	8b 5d 08             	mov    0x8(%ebp),%ebx
   1100d:	eb 12                	jmp    11021 <_IDESwapBytePairs+0x21>
   1100f:	90                   	nop    
    {
      t = Buf[i];
   11010:	8a 14 19             	mov    (%ecx,%ebx,1),%dl
      Buf[i] = Buf[i+1];
   11013:	8a 44 0b 01          	mov    0x1(%ebx,%ecx,1),%al
   11017:	88 04 19             	mov    %al,(%ecx,%ebx,1)
      Buf[i+1] = t;
   1101a:	88 54 0b 01          	mov    %dl,0x1(%ebx,%ecx,1)
   1101e:	83 c1 02             	add    $0x2,%ecx
   11021:	39 f1                	cmp    %esi,%ecx
   11023:	7c eb                	jl     11010 <_IDESwapBytePairs+0x10>
   11025:	5b                   	pop    %ebx
   11026:	5e                   	pop    %esi
   11027:	5d                   	pop    %ebp
   11028:	c3                   	ret    
   11029:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00011030 <_DriverEntry@8>:
    }
}


//  -------------------------------------------------------  Public Interface

//    DriverEntry
//
//  DESCRIPTION:
//    This function initializes the driver, locates and claims 
//    hardware resources, and creates various NT objects needed
//    to process I/O requests.
//
//  RUN LEVEL:
//    PASSIVE_LEVEL
//
//  ARGUMENTS:
//    IN  PDRIVER_OBJECT   DriverObject  System allocated Driver Object
//                                       for this driver
//    IN  PUNICODE_STRING  RegistryPath  Name of registry driver service 
//                                       key
//
//  RETURNS:
//    NTSTATUS

STDCALL NTSTATUS
DriverEntry(IN PDRIVER_OBJECT DriverObject,
            IN PUNICODE_STRING RegistryPath)
{
   11030:	55                   	push   %ebp
   11031:	89 e5                	mov    %esp,%ebp
   11033:	57                   	push   %edi
   11034:	56                   	push   %esi
   11035:	53                   	push   %ebx
   11036:	83 ec 64             	sub    $0x64,%esp
  HW_INITIALIZATION_DATA InitData;
  NTSTATUS Status;

  DPRINT("ATAPI Driver %s\n", VERSION);
  DPRINT("RegistryPath: '%wZ'\n", RegistryPath);

  /* Initialize data structure */
  RtlZeroMemory(&InitData,
   11039:	8d 5d 98             	lea    0xffffff98(%ebp),%ebx
   1103c:	8b 7d 08             	mov    0x8(%ebp),%edi
   1103f:	8b 75 0c             	mov    0xc(%ebp),%esi
   11042:	6a 4c                	push   $0x4c
   11044:	53                   	push   %ebx
   11045:	e8 76 2c 00 00       	call   13cc0 <_RtlZeroMemory@8>
		sizeof(HW_INITIALIZATION_DATA));
  InitData.HwInitializationDataSize = sizeof(HW_INITIALIZATION_DATA);
   1104a:	c7 45 98 4c 00 00 00 	movl   $0x4c,0xffffff98(%ebp)
  InitData.HwInitialize = AtapiInitialize;
  InitData.HwResetBus = AtapiResetBus;
  InitData.HwStartIo = AtapiStartIo;
  InitData.HwInterrupt = AtapiInterrupt;

  InitData.DeviceExtensionSize = sizeof(ATAPI_MINIPORT_EXTENSION);
  InitData.SpecificLuExtensionSize = sizeof(UNIT_EXTENSION);

  InitData.MapBuffers = TRUE;

  /* Search the PCI bus for compatibility mode ide controllers */
#ifdef ENABLE_PCI
  InitData.NeedPhysicalAddresses = TRUE;

  InitData.HwFindAdapter = AtapiFindCompatiblePciController;
  InitData.NumberOfAccessRanges = 3;
  InitData.AdapterInterfaceType = PCIBus;

  InitData.VendorId = NULL;
  InitData.VendorIdLength = 0;
  InitData.DeviceId = NULL;
  InitData.DeviceIdLength = 0;

  Status = ScsiPortInitialize(DriverObject,
   11051:	58                   	pop    %eax
   11052:	5a                   	pop    %edx
   11053:	6a 00                	push   $0x0
   11055:	c7 45 a0 10 14 01 00 	movl   $0x11410,0xffffffa0(%ebp)
   1105c:	53                   	push   %ebx
   1105d:	c7 45 b0 20 14 01 00 	movl   $0x11420,0xffffffb0(%ebp)
   11064:	56                   	push   %esi
   11065:	c7 45 a4 80 2c 01 00 	movl   $0x12c80,0xffffffa4(%ebp)
   1106c:	c7 45 a8 30 14 01 00 	movl   $0x11430,0xffffffa8(%ebp)
   11073:	c7 45 bc 48 04 00 00 	movl   $0x448,0xffffffbc(%ebp)
   1107a:	c7 45 c0 04 00 00 00 	movl   $0x4,0xffffffc0(%ebp)
   11081:	c6 45 d0 01          	movb   $0x1,0xffffffd0(%ebp)
   11085:	c6 45 d1 01          	movb   $0x1,0xffffffd1(%ebp)
   11089:	c7 45 ac 20 20 01 00 	movl   $0x12020,0xffffffac(%ebp)
   11090:	c7 45 c8 03 00 00 00 	movl   $0x3,0xffffffc8(%ebp)
   11097:	c7 45 9c 05 00 00 00 	movl   $0x5,0xffffff9c(%ebp)
   1109e:	c7 45 d8 00 00 00 00 	movl   $0x0,0xffffffd8(%ebp)
   110a5:	66 c7 45 d6 00 00    	movw   $0x0,0xffffffd6(%ebp)
   110ab:	c7 45 e0 00 00 00 00 	movl   $0x0,0xffffffe0(%ebp)
   110b2:	66 c7 45 de 00 00    	movw   $0x0,0xffffffde(%ebp)
   110b8:	57                   	push   %edi
   110b9:	e8 e2 2a 00 00       	call   13ba0 <_ScsiPortInitialize@16>
			      RegistryPath,
			      &InitData,
			      NULL);
//  if (newStatus < statusToReturn)
//    statusToReturn = newStatus;
#endif

  /* Search the PCI bus for all ide controllers */
#ifdef ENABLE_NATIVE_PCI
  InitData.NeedPhysicalAddresses = TRUE;
   110be:	c6 45 d1 01          	movb   $0x1,0xffffffd1(%ebp)

  InitData.HwFindAdapter = AtapiFindNativePciController;
   110c2:	c7 45 ac 00 1e 01 00 	movl   $0x11e00,0xffffffac(%ebp)
  InitData.NumberOfAccessRanges = 3;
  InitData.AdapterInterfaceType = PCIBus;

  InitData.VendorId = 0;
  InitData.VendorIdLength = 0;
  InitData.DeviceId = 0;
  InitData.DeviceIdLength = 0;

  LastSlotNumber.u.AsULONG = 0xFFFFFFFF;

  Status = ScsiPortInitialize(DriverObject,
   110c9:	6a 00                	push   $0x0
   110cb:	c7 45 c8 03 00 00 00 	movl   $0x3,0xffffffc8(%ebp)
   110d2:	53                   	push   %ebx
   110d3:	c7 45 9c 05 00 00 00 	movl   $0x5,0xffffff9c(%ebp)
   110da:	56                   	push   %esi
   110db:	c7 45 d8 00 00 00 00 	movl   $0x0,0xffffffd8(%ebp)
   110e2:	66 c7 45 d6 00 00    	movw   $0x0,0xffffffd6(%ebp)
   110e8:	c7 45 e0 00 00 00 00 	movl   $0x0,0xffffffe0(%ebp)
   110ef:	66 c7 45 de 00 00    	movw   $0x0,0xffffffde(%ebp)
   110f5:	57                   	push   %edi
   110f6:	c7 05 10 50 01 00 ff 	movl   $0xffffffff,0x15010
   110fd:	ff ff ff 
   11100:	e8 9b 2a 00 00       	call   13ba0 <_ScsiPortInitialize@16>
			      RegistryPath,
			      &InitData,
			      NULL);
//  if (newStatus < statusToReturn)
//    statusToReturn = newStatus;
#endif

  /* Search the ISA bus for ide controllers */
#ifdef ENABLE_ISA
  InitData.HwFindAdapter = AtapiFindIsaBusController;
   11105:	c7 45 ac 60 1d 01 00 	movl   $0x11d60,0xffffffac(%ebp)
  InitData.NumberOfAccessRanges = 2;
   1110c:	c7 45 c8 02 00 00 00 	movl   $0x2,0xffffffc8(%ebp)
  InitData.AdapterInterfaceType = Isa;

  InitData.VendorId = NULL;
  InitData.VendorIdLength = 0;
  InitData.DeviceId = NULL;
  InitData.DeviceIdLength = 0;

  Status = ScsiPortInitialize(DriverObject,
   11113:	6a 00                	push   $0x0
   11115:	c7 45 9c 01 00 00 00 	movl   $0x1,0xffffff9c(%ebp)
   1111c:	53                   	push   %ebx
   1111d:	c7 45 d8 00 00 00 00 	movl   $0x0,0xffffffd8(%ebp)
   11124:	56                   	push   %esi
   11125:	66 c7 45 d6 00 00    	movw   $0x0,0xffffffd6(%ebp)
   1112b:	c7 45 e0 00 00 00 00 	movl   $0x0,0xffffffe0(%ebp)
   11132:	66 c7 45 de 00 00    	movw   $0x0,0xffffffde(%ebp)
   11138:	57                   	push   %edi
   11139:	e8 62 2a 00 00       	call   13ba0 <_ScsiPortInitialize@16>
			      RegistryPath,
			      &InitData,
			      NULL);
//      if (newStatus < statusToReturn)
//        statusToReturn = newStatus;
#endif

  DPRINT("Returning from DriverEntry\n");

  return(Status);
}
   1113e:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11141:	5b                   	pop    %ebx
   11142:	5e                   	pop    %esi
   11143:	5f                   	pop    %edi
   11144:	5d                   	pop    %ebp
   11145:	c2 08 00             	ret    $0x8
   11148:	90                   	nop    
   11149:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi

00011150 <_AtapiClaimHwResources>:


BOOLEAN
AtapiClaimHwResources(PATAPI_MINIPORT_EXTENSION DevExt,
		      PPORT_CONFIGURATION_INFORMATION ConfigInfo,
		      INTERFACE_TYPE InterfaceType,
		      ULONG CommandPortBase,
		      ULONG ControlPortBase,
		      ULONG BusMasterPortBase,
		      ULONG InterruptVector)
{
   11150:	55                   	push   %ebp
   11151:	89 e5                	mov    %esp,%ebp
   11153:	57                   	push   %edi
   11154:	56                   	push   %esi
   11155:	53                   	push   %ebx
   11156:	83 ec 18             	sub    $0x18,%esp
   SCSI_PHYSICAL_ADDRESS IoAddress;
   PVOID IoBase;
#ifdef ENABLE_DMA
   ULONG Length;
#endif
   IoAddress = ScsiPortConvertUlongToPhysicalAddress(CommandPortBase);
   11159:	8b 4d 14             	mov    0x14(%ebp),%ecx
   1115c:	8b 7d 0c             	mov    0xc(%ebp),%edi
   1115f:	51                   	push   %ecx
   11160:	e8 4b 2a 00 00       	call   13bb0 <_ScsiPortConvertUlongToPhysicalAddress@4>
   11165:	89 c3                	mov    %eax,%ebx
   11167:	89 d6                	mov    %edx,%esi
   IoBase = ScsiPortGetDeviceBase((PVOID)DevExt,
   11169:	58                   	pop    %eax
   1116a:	5a                   	pop    %edx
   1116b:	6a 01                	push   $0x1
   1116d:	6a 08                	push   $0x8
   1116f:	56                   	push   %esi
   11170:	53                   	push   %ebx
   11171:	8b 47 04             	mov    0x4(%edi),%eax
   11174:	50                   	push   %eax
   11175:	8b 45 10             	mov    0x10(%ebp),%eax
   11178:	50                   	push   %eax
   11179:	8b 4d 08             	mov    0x8(%ebp),%ecx
   1117c:	51                   	push   %ecx
   1117d:	e8 3e 2a 00 00       	call   13bc0 <_ScsiPortGetDeviceBase@28>
                                  InterfaceType,
				  ConfigInfo->SystemIoBusNumber,
				  IoAddress,
				  8,
				  TRUE);
   if (IoBase == NULL)
   11182:	5a                   	pop    %edx
   {
      return FALSE;
   11183:	31 d2                	xor    %edx,%edx
   11185:	85 c0                	test   %eax,%eax
   11187:	0f 84 98 00 00 00    	je     11225 <_AtapiClaimHwResources+0xd5>
   }
   DevExt->Handler = NULL;
   1118d:	8b 55 08             	mov    0x8(%ebp),%edx
   DevExt->CommandPortBase = (ULONG)IoBase;
   11190:	89 82 10 04 00 00    	mov    %eax,0x410(%edx)
   ConfigInfo->AccessRanges[0].RangeStart = IoAddress;
   11196:	8b 47 38             	mov    0x38(%edi),%eax
   11199:	c7 82 28 04 00 00 00 	movl   $0x0,0x428(%edx)
   111a0:	00 00 00 
   ConfigInfo->AccessRanges[0].RangeLength = 8;
   ConfigInfo->AccessRanges[0].RangeInMemory = FALSE;
   111a3:	c6 40 0c 00          	movb   $0x0,0xc(%eax)
   111a7:	89 18                	mov    %ebx,(%eax)

   if (ControlPortBase)
   111a9:	8b 4d 18             	mov    0x18(%ebp),%ecx
   111ac:	89 70 04             	mov    %esi,0x4(%eax)
   111af:	c7 40 08 08 00 00 00 	movl   $0x8,0x8(%eax)
   111b6:	85 c9                	test   %ecx,%ecx
   111b8:	0f 85 82 00 00 00    	jne    11240 <_AtapiClaimHwResources+0xf0>
   {
      IoAddress = ScsiPortConvertUlongToPhysicalAddress(ControlPortBase + 2);
      IoBase = ScsiPortGetDeviceBase((PVOID)DevExt,
                                     InterfaceType,
				     ConfigInfo->SystemIoBusNumber,
				     IoAddress,
				     1,
				     TRUE);
      if (IoBase == NULL)
      {
         ScsiPortFreeDeviceBase((PVOID)DevExt,
	                        (PVOID)DevExt->CommandPortBase);
         return FALSE;
      }
      DevExt->ControlPortBase = (ULONG)IoBase;
      ConfigInfo->AccessRanges[1].RangeStart = IoAddress;
      ConfigInfo->AccessRanges[1].RangeLength = 1;
      ConfigInfo->AccessRanges[1].RangeInMemory = FALSE;
   }
   if (BusMasterPortBase)
   111be:	8b 5d 1c             	mov    0x1c(%ebp),%ebx
   111c1:	85 db                	test   %ebx,%ebx
   111c3:	0f 85 d7 00 00 00    	jne    112a0 <_AtapiClaimHwResources+0x150>
   {
      IoAddress = ScsiPortConvertUlongToPhysicalAddress(BusMasterPortBase);
      IoBase = ScsiPortGetDeviceBase((PVOID)DevExt,
                                     InterfaceType,
				     ConfigInfo->SystemIoBusNumber,
				     IoAddress,
				     8,
				     TRUE);
      if (IoBase == NULL)
      {
         ScsiPortFreeDeviceBase((PVOID)DevExt, (PVOID)DevExt->CommandPortBase);
         ScsiPortFreeDeviceBase((PVOID)DevExt, (PVOID)DevExt->ControlPortBase);
         return FALSE;
      }
      DevExt->BusMasterRegisterBase = (ULONG)IoBase;
      ConfigInfo->AccessRanges[2].RangeStart = IoAddress;
      ConfigInfo->AccessRanges[2].RangeLength = 8;
      ConfigInfo->AccessRanges[2].RangeInMemory = FALSE;
#ifdef ENABLE_DMA
//      ConfigInfo->DmaChannel = SP_UNINITIALIZED_VALUE;
//      ConfigInfo->DmaPort = SP_UNINITIALIZED_VALUE;
      ConfigInfo->DmaWidth = Width32Bits;
//      ConfigInfo->DmaSpeed = Compatible;
      ConfigInfo->ScatterGather = TRUE;
      ConfigInfo->Master = TRUE;
      ConfigInfo->NumberOfPhysicalBreaks = 0x10000 / PAGE_SIZE + 1;
      ConfigInfo->Dma32BitAddresses = TRUE;
      ConfigInfo->NeedPhysicalAddresses = TRUE;
      ConfigInfo->MapBuffers = TRUE;

      DevExt->PRDMaxCount = PAGE_SIZE / sizeof(PRD);  
      DevExt->PRDTable = ScsiPortGetUncachedExtension(DevExt, ConfigInfo, sizeof(PRD) * DevExt->PRDMaxCount);
      if (DevExt->PRDTable != NULL)
        {
	  DevExt->PRDTablePhysicalAddress = ScsiPortGetPhysicalAddress(DevExt, NULL, DevExt->PRDTable, &Length);
	}
      if (DevExt->PRDTable == NULL ||
	  DevExt->PRDTablePhysicalAddress.QuadPart == 0LL ||
	  Length < sizeof(PRD) * DevExt->PRDMaxCount)
      {
         ScsiPortFreeDeviceBase((PVOID)DevExt, (PVOID)DevExt->CommandPortBase);
         ScsiPortFreeDeviceBase((PVOID)DevExt, (PVOID)DevExt->ControlPortBase);
         ScsiPortFreeDeviceBase((PVOID)DevExt, (PVOID)DevExt->BusMasterRegisterBase);
	 return FALSE;
      }
#endif
   }
   ConfigInfo->BusInterruptLevel = InterruptVector;
   ConfigInfo->BusInterruptVector = InterruptVector;
   ConfigInfo->InterruptMode = (InterfaceType == Isa) ? Latched : LevelSensitive;
   111c9:	83 7d 10 01          	cmpl   $0x1,0x10(%ebp)
   111cd:	0f 94 c0             	sete   %al
   111d0:	25 ff 00 00 00       	and    $0xff,%eax
   111d5:	8b 4d 20             	mov    0x20(%ebp),%ecx

   if ((CommandPortBase == 0x1F0 || ControlPortBase == 0x3F4) && !ConfigInfo->AtdiskPrimaryClaimed)
   111d8:	81 7d 14 f0 01 00 00 	cmpl   $0x1f0,0x14(%ebp)
   111df:	89 47 14             	mov    %eax,0x14(%edi)
   111e2:	89 4f 0c             	mov    %ecx,0xc(%edi)
   111e5:	0f 94 c2             	sete   %dl
   111e8:	81 7d 18 f4 03 00 00 	cmpl   $0x3f4,0x18(%ebp)
   111ef:	0f 94 c0             	sete   %al
   111f2:	09 d0                	or     %edx,%eax
   111f4:	89 4f 10             	mov    %ecx,0x10(%edi)
   111f7:	a8 01                	test   $0x1,%al
   111f9:	75 35                	jne    11230 <_AtapiClaimHwResources+0xe0>
   {
      ConfigInfo->AtdiskPrimaryClaimed = TRUE;
   }
   if ((CommandPortBase == 0x170 || ControlPortBase == 0x374) && !ConfigInfo->AtdiskSecondaryClaimed)
   111fb:	81 7d 14 70 01 00 00 	cmpl   $0x170,0x14(%ebp)
   11202:	0f 94 c2             	sete   %dl
   11205:	81 7d 18 74 03 00 00 	cmpl   $0x374,0x18(%ebp)
   1120c:	0f 94 c0             	sete   %al
   1120f:	09 d0                	or     %edx,%eax
   11211:	a8 01                	test   $0x1,%al
   11213:	74 0b                	je     11220 <_AtapiClaimHwResources+0xd0>
   11215:	80 7f 4e 00          	cmpb   $0x0,0x4e(%edi)
   11219:	0f 84 a1 01 00 00    	je     113c0 <_AtapiClaimHwResources+0x270>
   1121f:	90                   	nop    
   {
      ConfigInfo->AtdiskSecondaryClaimed = TRUE;
   }
   return TRUE;
   11220:	ba 01 00 00 00       	mov    $0x1,%edx
}
   11225:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11228:	89 d0                	mov    %edx,%eax
   1122a:	5b                   	pop    %ebx
   1122b:	5e                   	pop    %esi
   1122c:	5f                   	pop    %edi
   1122d:	5d                   	pop    %ebp
   1122e:	c3                   	ret    
   1122f:	90                   	nop    
   11230:	80 7f 4d 00          	cmpb   $0x0,0x4d(%edi)
   11234:	75 c5                	jne    111fb <_AtapiClaimHwResources+0xab>
   11236:	c6 47 4d 01          	movb   $0x1,0x4d(%edi)
   1123a:	eb bf                	jmp    111fb <_AtapiClaimHwResources+0xab>
   1123c:	8d 74 26 00          	lea    0x0(%esi),%esi
   11240:	83 ec 0c             	sub    $0xc,%esp
   11243:	8b 45 18             	mov    0x18(%ebp),%eax
   11246:	83 c0 02             	add    $0x2,%eax
   11249:	50                   	push   %eax
   1124a:	e8 61 29 00 00       	call   13bb0 <_ScsiPortConvertUlongToPhysicalAddress@4>
   1124f:	89 c3                	mov    %eax,%ebx
   11251:	89 d6                	mov    %edx,%esi
   11253:	58                   	pop    %eax
   11254:	5a                   	pop    %edx
   11255:	6a 01                	push   $0x1
   11257:	6a 01                	push   $0x1
   11259:	56                   	push   %esi
   1125a:	53                   	push   %ebx
   1125b:	8b 47 04             	mov    0x4(%edi),%eax
   1125e:	50                   	push   %eax
   1125f:	8b 45 10             	mov    0x10(%ebp),%eax
   11262:	50                   	push   %eax
   11263:	8b 4d 08             	mov    0x8(%ebp),%ecx
   11266:	51                   	push   %ecx
   11267:	e8 54 29 00 00       	call   13bc0 <_ScsiPortGetDeviceBase@28>
   1126c:	5a                   	pop    %edx
   1126d:	85 c0                	test   %eax,%eax
   1126f:	0f 84 78 01 00 00    	je     113ed <_AtapiClaimHwResources+0x29d>
   11275:	8b 55 08             	mov    0x8(%ebp),%edx
   11278:	89 82 14 04 00 00    	mov    %eax,0x414(%edx)
   1127e:	8b 47 38             	mov    0x38(%edi),%eax
   11281:	c6 40 1c 00          	movb   $0x0,0x1c(%eax)
   11285:	89 58 10             	mov    %ebx,0x10(%eax)
   11288:	8b 5d 1c             	mov    0x1c(%ebp),%ebx
   1128b:	89 70 14             	mov    %esi,0x14(%eax)
   1128e:	c7 40 18 01 00 00 00 	movl   $0x1,0x18(%eax)
   11295:	85 db                	test   %ebx,%ebx
   11297:	0f 84 2c ff ff ff    	je     111c9 <_AtapiClaimHwResources+0x79>
   1129d:	8d 76 00             	lea    0x0(%esi),%esi
   112a0:	83 ec 0c             	sub    $0xc,%esp
   112a3:	8b 4d 1c             	mov    0x1c(%ebp),%ecx
   112a6:	51                   	push   %ecx
   112a7:	e8 04 29 00 00       	call   13bb0 <_ScsiPortConvertUlongToPhysicalAddress@4>
   112ac:	89 c3                	mov    %eax,%ebx
   112ae:	89 d6                	mov    %edx,%esi
   112b0:	58                   	pop    %eax
   112b1:	5a                   	pop    %edx
   112b2:	6a 01                	push   $0x1
   112b4:	6a 08                	push   $0x8
   112b6:	56                   	push   %esi
   112b7:	53                   	push   %ebx
   112b8:	8b 47 04             	mov    0x4(%edi),%eax
   112bb:	50                   	push   %eax
   112bc:	8b 45 10             	mov    0x10(%ebp),%eax
   112bf:	50                   	push   %eax
   112c0:	8b 4d 08             	mov    0x8(%ebp),%ecx
   112c3:	51                   	push   %ecx
   112c4:	e8 f7 28 00 00       	call   13bc0 <_ScsiPortGetDeviceBase@28>
   112c9:	5a                   	pop    %edx
   112ca:	85 c0                	test   %eax,%eax
   112cc:	0f 84 f7 00 00 00    	je     113c9 <_AtapiClaimHwResources+0x279>
   112d2:	8b 55 08             	mov    0x8(%ebp),%edx
   112d5:	89 82 18 04 00 00    	mov    %eax,0x418(%edx)
   112db:	8b 47 38             	mov    0x38(%edi),%eax
   112de:	89 58 20             	mov    %ebx,0x20(%eax)
   112e1:	89 70 24             	mov    %esi,0x24(%eax)
   112e4:	c6 40 2c 00          	movb   $0x0,0x2c(%eax)
   112e8:	c7 40 28 08 00 00 00 	movl   $0x8,0x28(%eax)
   112ef:	c7 47 28 02 00 00 00 	movl   $0x2,0x28(%edi)
   112f6:	c6 47 49 01          	movb   $0x1,0x49(%edi)
   112fa:	c6 47 4a 01          	movb   $0x1,0x4a(%edi)
   112fe:	c7 47 1c 11 00 00 00 	movl   $0x11,0x1c(%edi)
   11305:	c6 47 4f 01          	movb   $0x1,0x4f(%edi)
   11309:	c6 47 52 01          	movb   $0x1,0x52(%edi)
   1130d:	c6 47 51 01          	movb   $0x1,0x51(%edi)
   11311:	c7 82 34 04 00 00 00 	movl   $0x200,0x434(%edx)
   11318:	02 00 00 
   1131b:	56                   	push   %esi
   1131c:	68 00 10 00 00       	push   $0x1000
   11321:	57                   	push   %edi
   11322:	52                   	push   %edx
   11323:	e8 a8 28 00 00       	call   13bd0 <_ScsiPortGetUncachedExtension@12>
   11328:	8b 4d 08             	mov    0x8(%ebp),%ecx
   1132b:	89 c2                	mov    %eax,%edx
   1132d:	85 c0                	test   %eax,%eax
   1132f:	89 81 38 04 00 00    	mov    %eax,0x438(%ecx)
   11335:	5b                   	pop    %ebx
   11336:	74 48                	je     11380 <_AtapiClaimHwResources+0x230>
   11338:	8d 45 f0             	lea    0xfffffff0(%ebp),%eax
   1133b:	50                   	push   %eax
   1133c:	52                   	push   %edx
   1133d:	6a 00                	push   $0x0
   1133f:	51                   	push   %ecx
   11340:	e8 9b 28 00 00       	call   13be0 <_ScsiPortGetPhysicalAddress@16>
   11345:	8b 4d 08             	mov    0x8(%ebp),%ecx
   11348:	89 81 40 04 00 00    	mov    %eax,0x440(%ecx)
   1134e:	89 91 44 04 00 00    	mov    %edx,0x444(%ecx)
   11354:	8b 89 38 04 00 00    	mov    0x438(%ecx),%ecx
   1135a:	85 c9                	test   %ecx,%ecx
   1135c:	74 22                	je     11380 <_AtapiClaimHwResources+0x230>
   1135e:	89 d1                	mov    %edx,%ecx
   11360:	09 c1                	or     %eax,%ecx
   11362:	74 1c                	je     11380 <_AtapiClaimHwResources+0x230>
   11364:	8b 55 08             	mov    0x8(%ebp),%edx
   11367:	8b 82 34 04 00 00    	mov    0x434(%edx),%eax
   1136d:	c1 e0 03             	shl    $0x3,%eax
   11370:	3b 45 f0             	cmp    0xfffffff0(%ebp),%eax
   11373:	0f 86 50 fe ff ff    	jbe    111c9 <_AtapiClaimHwResources+0x79>
   11379:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   11380:	57                   	push   %edi
   11381:	57                   	push   %edi
   11382:	8b 4d 08             	mov    0x8(%ebp),%ecx
   11385:	8b b1 10 04 00 00    	mov    0x410(%ecx),%esi
   1138b:	56                   	push   %esi
   1138c:	51                   	push   %ecx
   1138d:	e8 5e 28 00 00       	call   13bf0 <_ScsiPortFreeDeviceBase@8>
   11392:	8b 45 08             	mov    0x8(%ebp),%eax
   11395:	8b 98 14 04 00 00    	mov    0x414(%eax),%ebx
   1139b:	53                   	push   %ebx
   1139c:	50                   	push   %eax
   1139d:	e8 4e 28 00 00       	call   13bf0 <_ScsiPortFreeDeviceBase@8>
   113a2:	8b 55 08             	mov    0x8(%ebp),%edx
   113a5:	8b 8a 18 04 00 00    	mov    0x418(%edx),%ecx
   113ab:	51                   	push   %ecx
   113ac:	52                   	push   %edx
   113ad:	e8 3e 28 00 00       	call   13bf0 <_ScsiPortFreeDeviceBase@8>
   113b2:	31 d2                	xor    %edx,%edx
   113b4:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   113b7:	89 d0                	mov    %edx,%eax
   113b9:	5b                   	pop    %ebx
   113ba:	5e                   	pop    %esi
   113bb:	5f                   	pop    %edi
   113bc:	5d                   	pop    %ebp
   113bd:	c3                   	ret    
   113be:	89 f6                	mov    %esi,%esi
   113c0:	c6 47 4e 01          	movb   $0x1,0x4e(%edi)
   113c4:	e9 57 fe ff ff       	jmp    11220 <_AtapiClaimHwResources+0xd0>
   113c9:	50                   	push   %eax
   113ca:	50                   	push   %eax
   113cb:	8b 4d 08             	mov    0x8(%ebp),%ecx
   113ce:	8b 81 10 04 00 00    	mov    0x410(%ecx),%eax
   113d4:	50                   	push   %eax
   113d5:	51                   	push   %ecx
   113d6:	e8 15 28 00 00       	call   13bf0 <_ScsiPortFreeDeviceBase@8>
   113db:	8b 45 08             	mov    0x8(%ebp),%eax
   113de:	8b b8 14 04 00 00    	mov    0x414(%eax),%edi
   113e4:	57                   	push   %edi
   113e5:	50                   	push   %eax
   113e6:	e8 05 28 00 00       	call   13bf0 <_ScsiPortFreeDeviceBase@8>
   113eb:	eb c5                	jmp    113b2 <_AtapiClaimHwResources+0x262>
   113ed:	57                   	push   %edi
   113ee:	57                   	push   %edi
   113ef:	8b 4d 08             	mov    0x8(%ebp),%ecx
   113f2:	8b b1 10 04 00 00    	mov    0x410(%ecx),%esi
   113f8:	56                   	push   %esi
   113f9:	51                   	push   %ecx
   113fa:	e8 f1 27 00 00       	call   13bf0 <_ScsiPortFreeDeviceBase@8>
   113ff:	31 d2                	xor    %edx,%edx
   11401:	eb b1                	jmp    113b4 <_AtapiClaimHwResources+0x264>
   11403:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11409:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011410 <_AtapiInitialize@4>:


#ifdef ENABLE_PCI
static ULONG STDCALL
AtapiFindCompatiblePciController(PVOID DeviceExtension,
				 PVOID HwContext,
				 PVOID BusInformation,
				 PCHAR ArgumentString,
				 PPORT_CONFIGURATION_INFORMATION ConfigInfo,
				 PBOOLEAN Again)
{
  PATAPI_MINIPORT_EXTENSION DevExt = (PATAPI_MINIPORT_EXTENSION)DeviceExtension;
  PCI_SLOT_NUMBER SlotNumber;
  PCI_COMMON_CONFIG PciConfig;
  ULONG DataSize;
  ULONG StartDeviceNumber;
  ULONG DeviceNumber;
  ULONG StartFunctionNumber;
  ULONG FunctionNumber;
  BOOLEAN ChannelFound;
  BOOLEAN DeviceFound;
  ULONG BusMasterBasePort = 0;

  DPRINT("AtapiFindCompatiblePciController() Bus: %lu  Slot: %lu\n",
	  ConfigInfo->SystemIoBusNumber,
	  ConfigInfo->SlotNumber);

  *Again = FALSE;

  /* both channels were claimed: exit */
  if (ConfigInfo->AtdiskPrimaryClaimed == TRUE &&
      ConfigInfo->AtdiskSecondaryClaimed == TRUE)
    return(SP_RETURN_NOT_FOUND);

  SlotNumber.u.AsULONG = ConfigInfo->SlotNumber;
  StartDeviceNumber = SlotNumber.u.bits.DeviceNumber;
  StartFunctionNumber = SlotNumber.u.bits.FunctionNumber;
  for (DeviceNumber = StartDeviceNumber; DeviceNumber < PCI_MAX_DEVICES; DeviceNumber++)
  {
     SlotNumber.u.bits.DeviceNumber = DeviceNumber;
     for (FunctionNumber = StartFunctionNumber; FunctionNumber < PCI_MAX_FUNCTION; FunctionNumber++)
     {
	SlotNumber.u.bits.FunctionNumber = FunctionNumber;
	ChannelFound = FALSE;
	DeviceFound = FALSE;

        DataSize = ScsiPortGetBusData(DeviceExtension,
				      PCIConfiguration,
				      ConfigInfo->SystemIoBusNumber,
				      SlotNumber.u.AsULONG,
				      &PciConfig,
				      PCI_COMMON_HDR_LENGTH);
        if (DataSize != PCI_COMMON_HDR_LENGTH)
	{
	   if (FunctionNumber == 0)
	   {
	      break;
	   }
	   else
	   {
	      continue;
	   }
	}
	  
	DPRINT("%x %x\n", PciConfig.BaseClass, PciConfig.SubClass);
	if (PciConfig.BaseClass == 0x01 &&
	    PciConfig.SubClass == 0x01) // &&
//	    (PciConfig.ProgIf & 0x05) == 0)
	{
	   /* both channels are in compatibility mode */
	   DPRINT("Bus %1lu  Device %2lu  Func %1lu  VenID 0x%04hx  DevID 0x%04hx\n",
		  ConfigInfo->SystemIoBusNumber,
		  SlotNumber.u.bits.DeviceNumber,
		  SlotNumber.u.bits.FunctionNumber,
		  PciConfig.VendorID,
		  PciConfig.DeviceID);
	   DPRINT("ProgIF 0x%02hx\n", PciConfig.ProgIf);

	   DPRINT("Found IDE controller in compatibility mode!\n");

	   ConfigInfo->NumberOfBuses = 1;
	   ConfigInfo->MaximumNumberOfTargets = 2;
	   ConfigInfo->MaximumTransferLength = 0x10000; /* max 64Kbyte */

	   if (PciConfig.ProgIf & 0x80)
	   {
	      DPRINT("Found IDE Bus Master controller!\n");
	      if (PciConfig.u.type0.BaseAddresses[4] & PCI_ADDRESS_IO_SPACE)
	      {
		  BusMasterBasePort = PciConfig.u.type0.BaseAddresses[4] & PCI_ADDRESS_IO_ADDRESS_MASK;
		  DPRINT("  IDE Bus Master Registers at IO %lx\n", BusMasterBasePort);
	      }
	   }
	   if (ConfigInfo->AtdiskPrimaryClaimed == FALSE)
	   {
	      /* Both channels unclaimed: Claim primary channel */
	      DPRINT("Primary channel!\n");
              ChannelFound = AtapiClaimHwResources(DevExt,
		                                   ConfigInfo,
		                                   PCIBus,
		                                   0x1F0,
			                           0x3F4,
			                           BusMasterBasePort,
			                           14);
              *Again = TRUE;
	   }
	   else if (ConfigInfo->AtdiskSecondaryClaimed == FALSE)
	   {
	      /* Primary channel already claimed: claim secondary channel */
	      DPRINT("Secondary channel!\n");

              ChannelFound = AtapiClaimHwResources(DevExt,
		                                   ConfigInfo,
		                                   PCIBus,
		                                   0x170,
			                           0x374,
						   BusMasterBasePort ? BusMasterBasePort + 8 : 0,
			                           15);
	      *Again = FALSE;
	   }
	   /* Find attached devices */
	   if (ChannelFound)
	   {
	      DeviceFound = AtapiFindDevices(DevExt, ConfigInfo);
	      ConfigInfo->SlotNumber = SlotNumber.u.AsULONG;
	      DPRINT("AtapiFindCompatiblePciController() returns: SP_RETURN_FOUND\n");
	      return(SP_RETURN_FOUND);
	   }
	}
	if (FunctionNumber == 0 && !(PciConfig.HeaderType & PCI_MULTIFUNCTION))
	{
	   break;
	}
     }	
     StartFunctionNumber = 0;
  }
  DPRINT("AtapiFindCompatiblePciController() returns: SP_RETURN_NOT_FOUND\n");

  return(SP_RETURN_NOT_FOUND);
}
#endif


#ifdef ENABLE_ISA
static ULONG STDCALL
AtapiFindIsaBusController(PVOID DeviceExtension,
			  PVOID HwContext,
			  PVOID BusInformation,
			  PCHAR ArgumentString,
			  PPORT_CONFIGURATION_INFORMATION ConfigInfo,
			  PBOOLEAN Again)
{
  PATAPI_MINIPORT_EXTENSION DevExt = (PATAPI_MINIPORT_EXTENSION)DeviceExtension;
  BOOLEAN ChannelFound = FALSE;
  BOOLEAN DeviceFound = FALSE;

  DPRINT("AtapiFindIsaBusController() called!\n");

  *Again = FALSE;

  ConfigInfo->NumberOfBuses = 1;
  ConfigInfo->MaximumNumberOfTargets = 2;
  ConfigInfo->MaximumTransferLength = 0x10000; /* max 64Kbyte */

  if (ConfigInfo->AtdiskPrimaryClaimed == FALSE)
    {
      /* Both channels unclaimed: Claim primary channel */
      DPRINT("Primary channel!\n");

      ChannelFound = AtapiClaimHwResources(DevExt,
		                           ConfigInfo,
		                           Isa,
		                           0x1F0,
			                   0x3F4,
			                   0,
			                   14);
      *Again = TRUE;
    }
  else if (ConfigInfo->AtdiskSecondaryClaimed == FALSE)
    {
      /* Primary channel already claimed: claim secondary channel */
      DPRINT("Secondary channel!\n");

      ChannelFound = AtapiClaimHwResources(DevExt,
		                           ConfigInfo,
		                           Isa,
		                           0x170,
			                   0x374,
			                   0,
			                   15);
      *Again = FALSE;
    }
  else
    {
      DPRINT("AtapiFindIsaBusController() both channels claimed. Returns: SP_RETURN_NOT_FOUND\n");
      *Again = FALSE;
      return(SP_RETURN_NOT_FOUND);
    }

  /* Find attached devices */
  if (ChannelFound)
    {
      DeviceFound = AtapiFindDevices(DevExt,
				     ConfigInfo);
      DPRINT("AtapiFindIsaBusController() returns: SP_RETURN_FOUND\n");
      return(SP_RETURN_FOUND);
    }
  *Again = FALSE;
  return SP_RETURN_NOT_FOUND;
}
#endif


#ifdef ENABLE_NATIVE_PCI
static ULONG STDCALL
AtapiFindNativePciController(PVOID DeviceExtension,
			     PVOID HwContext,
			     PVOID BusInformation,
			     PCHAR ArgumentString,
			     PPORT_CONFIGURATION_INFORMATION ConfigInfo,
			     PBOOLEAN Again)
{
  PATAPI_MINIPORT_EXTENSION DevExt = (PATAPI_MINIPORT_EXTENSION)DeviceExtension;
  PCI_COMMON_CONFIG PciConfig;
  PCI_SLOT_NUMBER SlotNumber;
  ULONG DataSize;
  ULONG DeviceNumber;
  ULONG StartDeviceNumber;
  ULONG FunctionNumber;
  ULONG StartFunctionNumber;
  ULONG BusMasterBasePort;
  ULONG Count;
  BOOLEAN ChannelFound;

  DPRINT("AtapiFindNativePciController() called!\n");

  SlotNumber.u.AsULONG = ConfigInfo->SlotNumber;
  StartDeviceNumber = SlotNumber.u.bits.DeviceNumber;
  StartFunctionNumber = SlotNumber.u.bits.FunctionNumber;
  for (DeviceNumber = StartDeviceNumber; DeviceNumber < PCI_MAX_DEVICES; DeviceNumber++)
  {
     SlotNumber.u.bits.DeviceNumber = DeviceNumber;
     for (FunctionNumber = StartFunctionNumber; FunctionNumber < PCI_MAX_FUNCTION; FunctionNumber++)
     {
	SlotNumber.u.bits.FunctionNumber = FunctionNumber;
	DataSize = ScsiPortGetBusData(DeviceExtension,
				      PCIConfiguration,
				      ConfigInfo->SystemIoBusNumber,
				      SlotNumber.u.AsULONG,
				      &PciConfig,
				      PCI_COMMON_HDR_LENGTH);
	if (DataSize != PCI_COMMON_HDR_LENGTH)
	{
	   break;
	}
	for (Count = 0; Count < sizeof(PciNativeController)/sizeof(PCI_NATIVE_CONTROLLER); Count++)
	{
	   if (PciConfig.VendorID == PciNativeController[Count].VendorID &&
	       PciConfig.DeviceID == PciNativeController[Count].DeviceID)
	   {
	      break;
	   }
	}
	if (Count < sizeof(PciNativeController)/sizeof(PCI_NATIVE_CONTROLLER)) 
	{
	   /* We have found a known native pci ide controller */
	   if ((PciConfig.ProgIf & 0x80) && (PciConfig.u.type0.BaseAddresses[4] & PCI_ADDRESS_IO_SPACE))
	   {
	      DPRINT("Found IDE Bus Master controller!\n");
	      BusMasterBasePort = PciConfig.u.type0.BaseAddresses[4] & PCI_ADDRESS_IO_ADDRESS_MASK;
	      DPRINT("  IDE Bus Master Registers at IO %lx\n", BusMasterBasePort);
	   }
	   else
	   {
	      BusMasterBasePort = 0;
	   }

	   DPRINT("VendorID: %04x, DeviceID: %04x\n", PciConfig.VendorID, PciConfig.DeviceID);
	   ConfigInfo->NumberOfBuses = 1;
	   ConfigInfo->MaximumNumberOfTargets = 2;
	   ConfigInfo->MaximumTransferLength = 0x10000; /* max 64Kbyte */

	   /* FIXME:
	        We must not store and use the last tested slot number. If there is a recall
		to the some device and we will claim the primary channel again than the call
		to ScsiPortGetDeviceBase in AtapiClaimHwResource will fail and we can try to
		claim the secondary channel. 
	    */
	   ChannelFound = FALSE;
	   if (LastSlotNumber.u.AsULONG != SlotNumber.u.AsULONG)
	   {
	      /* try to claim primary channel */
	      if ((PciConfig.u.type0.BaseAddresses[0] & PCI_ADDRESS_IO_SPACE) &&
		  (PciConfig.u.type0.BaseAddresses[1] & PCI_ADDRESS_IO_SPACE))
	      {
		 /* primary channel is enabled */
		 ChannelFound = AtapiClaimHwResources(DevExt,
		                                      ConfigInfo,
		                                      PCIBus,
		                                      PciConfig.u.type0.BaseAddresses[0] & PCI_ADDRESS_IO_ADDRESS_MASK,
			                              PciConfig.u.type0.BaseAddresses[1] & PCI_ADDRESS_IO_ADDRESS_MASK,
			                              BusMasterBasePort,
			                              PciConfig.u.type0.InterruptLine);
	         if (ChannelFound)
		 {
                    AtapiFindDevices(DevExt, ConfigInfo);
                    *Again = TRUE;
		    ConfigInfo->SlotNumber = LastSlotNumber.u.AsULONG = SlotNumber.u.AsULONG;
                    return SP_RETURN_FOUND;
		 }
	      }
	   }
	   if (!ChannelFound)
	   {
	      /* try to claim secondary channel */
	      if ((PciConfig.u.type0.BaseAddresses[2] & PCI_ADDRESS_IO_SPACE) &&
		  (PciConfig.u.type0.BaseAddresses[3] & PCI_ADDRESS_IO_SPACE))
	      {
	         /* secondary channel is enabled */
	         ChannelFound = AtapiClaimHwResources(DevExt,
		                                      ConfigInfo,
		                                      PCIBus,
		                                      PciConfig.u.type0.BaseAddresses[2] & PCI_ADDRESS_IO_ADDRESS_MASK,
			                              PciConfig.u.type0.BaseAddresses[3] & PCI_ADDRESS_IO_ADDRESS_MASK,
						      BusMasterBasePort ? BusMasterBasePort + 8 : 0,
			                              PciConfig.u.type0.InterruptLine);
		 if (ChannelFound)
		 {
		    AtapiFindDevices(DevExt, ConfigInfo);
                    *Again = FALSE;
		    LastSlotNumber.u.AsULONG = 0xFFFFFFFF;
                    return SP_RETURN_FOUND;
		 }
	      }
	   }
	}
     }
     StartFunctionNumber = 0;
  }
  *Again = FALSE;
  LastSlotNumber.u.AsULONG = 0xFFFFFFFF;
  DPRINT("AtapiFindNativePciController() done!\n");

  return(SP_RETURN_NOT_FOUND);
}
#endif


static BOOLEAN STDCALL
AtapiInitialize(IN PVOID DeviceExtension)
{
   11410:	55                   	push   %ebp
  return(TRUE);
}
   11411:	b8 01 00 00 00       	mov    $0x1,%eax
   11416:	89 e5                	mov    %esp,%ebp
   11418:	5d                   	pop    %ebp
   11419:	c2 04 00             	ret    $0x4
   1141c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011420 <_AtapiResetBus@8>:


static BOOLEAN STDCALL
AtapiResetBus(IN PVOID DeviceExtension,
	      IN ULONG PathId)
{
   11420:	55                   	push   %ebp
  return(TRUE);
}
   11421:	b8 01 00 00 00       	mov    $0x1,%eax
   11426:	89 e5                	mov    %esp,%ebp
   11428:	5d                   	pop    %ebp
   11429:	c2 08 00             	ret    $0x8
   1142c:	8d 74 26 00          	lea    0x0(%esi),%esi

00011430 <_AtapiInterrupt@4>:


static BOOLEAN STDCALL
AtapiStartIo(IN PVOID DeviceExtension,
	     IN PSCSI_REQUEST_BLOCK Srb)
{
  PATAPI_MINIPORT_EXTENSION DevExt;
  ULONG Result;

  DPRINT("AtapiStartIo() called\n");

  DevExt = (PATAPI_MINIPORT_EXTENSION)DeviceExtension;

  switch (Srb->Function)
    {
      case SRB_FUNCTION_EXECUTE_SCSI:
	DevExt->CurrentSrb = Srb;
	if (DevExt->DeviceFlags[Srb->TargetId] & DEVICE_ATAPI)
	  {
	    Result = AtapiSendAtapiCommand(DevExt,
					   Srb);
	  }
	else
	  {
	    Result = AtapiSendIdeCommand(DevExt,
					 Srb);
	  }
	break;

      case SRB_FUNCTION_ABORT_COMMAND:
	if (DevExt->CurrentSrb != NULL)
	  {
	    Result = SRB_STATUS_ABORT_FAILED;
	  }
	else
	  {
	    Result = SRB_STATUS_SUCCESS;
	  }
	break;

      default:
	Result = SRB_STATUS_INVALID_REQUEST;
	break;
    }

  Srb->SrbStatus = Result;


  if (Result != SRB_STATUS_PENDING)
    {
      DevExt->CurrentSrb = NULL;
      Srb->SrbStatus = (UCHAR)Result;

      ScsiPortNotification(RequestComplete,
			   DeviceExtension,
			   Srb);
      ScsiPortNotification(NextRequest,
			   DeviceExtension,
			   NULL);
    }
  else
    {
      DPRINT("SrbStatus = SRB_STATUS_PENDING\n");
    }

  DPRINT("AtapiStartIo() done\n");

  return(TRUE);
}

static BOOLEAN STDCALL
AtapiInterrupt(IN PVOID DeviceExtension)
{
   11430:	55                   	push   %ebp
   11431:	89 e5                	mov    %esp,%ebp
   11433:	56                   	push   %esi
   11434:	53                   	push   %ebx
   11435:	8b 5d 08             	mov    0x8(%ebp),%ebx
  PATAPI_MINIPORT_EXTENSION DevExt;
  BYTE Status;
  DevExt = (PATAPI_MINIPORT_EXTENSION)DeviceExtension;

  if (DevExt->Handler == NULL)
   11438:	8b 93 28 04 00 00    	mov    0x428(%ebx),%edx
   1143e:	85 d2                	test   %edx,%edx
   11440:	74 64                	je     114a6 <_AtapiInterrupt@4+0x76>
    {
      Status =  IDEReadAltStatus(DevExt->ControlPortBase);
      if ((Status & (IDE_SR_DRDY|IDE_SR_BUSY|IDE_SR_ERR|IDE_SR_DRQ)) != IDE_SR_DRDY)
        {
	  static ULONG Count = 0;
	  Count++;
	  DPRINT1("Unexpected Interrupt, CommandPort=%04x, Status=%02x, Count=%ld\n", 
	          DevExt->CommandPortBase, Status, Count);
	}
      return FALSE;
    }
#ifdef ENABLE_DMA
  if (DevExt->UseDma)
   11442:	8b 83 2c 04 00 00    	mov    0x42c(%ebx),%eax
   11448:	85 c0                	test   %eax,%eax
   1144a:	75 34                	jne    11480 <_AtapiInterrupt@4+0x50>
    {
      Status = IDEReadDMAStatus(DevExt->BusMasterRegisterBase);
      if (!(Status & 0x04))
        {
	  return FALSE;
	}
    }
  else
#endif
    {
      Status = IDEReadAltStatus(DevExt->ControlPortBase);
   1144c:	83 ec 0c             	sub    $0xc,%esp
   1144f:	8b b3 14 04 00 00    	mov    0x414(%ebx),%esi
   11455:	56                   	push   %esi
   11456:	e8 a5 27 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
      if (Status & IDE_SR_BUSY)
        {
	  return FALSE;
   1145b:	31 d2                	xor    %edx,%edx
   1145d:	83 c4 0c             	add    $0xc,%esp
   11460:	84 c0                	test   %al,%al
   11462:	78 0c                	js     11470 <_AtapiInterrupt@4+0x40>
	}
    }
  return DevExt->Handler(DevExt);
   11464:	89 d9                	mov    %ebx,%ecx
   11466:	ff 93 28 04 00 00    	call   *0x428(%ebx)
   1146c:	31 d2                	xor    %edx,%edx
   1146e:	88 c2                	mov    %al,%dl
}
   11470:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11473:	89 d0                	mov    %edx,%eax
   11475:	5b                   	pop    %ebx
   11476:	5e                   	pop    %esi
   11477:	5d                   	pop    %ebp
   11478:	c2 04 00             	ret    $0x4
   1147b:	90                   	nop    
   1147c:	8d 74 26 00          	lea    0x0(%esi),%esi
   11480:	83 ec 0c             	sub    $0xc,%esp
   11483:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   11489:	83 c0 02             	add    $0x2,%eax
   1148c:	50                   	push   %eax
   1148d:	e8 6e 27 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11492:	31 d2                	xor    %edx,%edx
   11494:	83 c4 0c             	add    $0xc,%esp
   11497:	a8 04                	test   $0x4,%al
   11499:	75 c9                	jne    11464 <_AtapiInterrupt@4+0x34>
   1149b:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1149e:	89 d0                	mov    %edx,%eax
   114a0:	5b                   	pop    %ebx
   114a1:	5e                   	pop    %esi
   114a2:	5d                   	pop    %ebp
   114a3:	c2 04 00             	ret    $0x4
   114a6:	83 ec 0c             	sub    $0xc,%esp
   114a9:	8b 83 14 04 00 00    	mov    0x414(%ebx),%eax
   114af:	50                   	push   %eax
   114b0:	e8 4b 27 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   114b5:	25 ff 00 00 00       	and    $0xff,%eax
   114ba:	83 c4 0c             	add    $0xc,%esp
   114bd:	89 c6                	mov    %eax,%esi
   114bf:	25 c9 00 00 00       	and    $0xc9,%eax
   114c4:	83 f8 40             	cmp    $0x40,%eax
   114c7:	74 3b                	je     11504 <_AtapiInterrupt@4+0xd4>
   114c9:	a1 00 50 01 00       	mov    0x15000,%eax
   114ce:	40                   	inc    %eax
   114cf:	a3 00 50 01 00       	mov    %eax,0x15000
   114d4:	50                   	push   %eax
   114d5:	68 d8 03 00 00       	push   $0x3d8
   114da:	68 08 40 01 00       	push   $0x14008
   114df:	68 10 40 01 00       	push   $0x14010
   114e4:	e8 f7 27 00 00       	call   13ce0 <_DbgPrint>
   114e9:	a1 00 50 01 00       	mov    0x15000,%eax
   114ee:	50                   	push   %eax
   114ef:	56                   	push   %esi
   114f0:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   114f6:	50                   	push   %eax
   114f7:	68 1c 40 01 00       	push   $0x1401c
   114fc:	e8 df 27 00 00       	call   13ce0 <_DbgPrint>
   11501:	83 c4 20             	add    $0x20,%esp
   11504:	31 d2                	xor    %edx,%edx
   11506:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11509:	89 d0                	mov    %edx,%eax
   1150b:	5b                   	pop    %ebx
   1150c:	5e                   	pop    %esi
   1150d:	5d                   	pop    %ebp
   1150e:	c2 04 00             	ret    $0x4
   11511:	eb 0d                	jmp    11520 <_AtapiConfigDma>
   11513:	90                   	nop    
   11514:	90                   	nop    
   11515:	90                   	nop    
   11516:	90                   	nop    
   11517:	90                   	nop    
   11518:	90                   	nop    
   11519:	90                   	nop    
   1151a:	90                   	nop    
   1151b:	90                   	nop    
   1151c:	90                   	nop    
   1151d:	90                   	nop    
   1151e:	90                   	nop    
   1151f:	90                   	nop    

00011520 <_AtapiConfigDma>:

//  ----------------------------------------------------  Discardable statics

#ifdef ENABLE_DMA
static BOOLEAN
AtapiConfigDma(PATAPI_MINIPORT_EXTENSION DeviceExtension, ULONG UnitNumber)
{
   11520:	55                   	push   %ebp
   11521:	89 e5                	mov    %esp,%ebp
   11523:	57                   	push   %edi
   11524:	56                   	push   %esi
   11525:	53                   	push   %ebx
   11526:	83 ec 0c             	sub    $0xc,%esp
  BOOLEAN Result = FALSE;
   11529:	31 ff                	xor    %edi,%edi
   1152b:	89 c6                	mov    %eax,%esi
   1152d:	89 d3                	mov    %edx,%ebx
  BYTE Status;

  if (UnitNumber < 2)
   1152f:	83 fa 01             	cmp    $0x1,%edx
   11532:	77 6e                	ja     115a2 <_AtapiConfigDma+0x82>
    {
      if (DeviceExtension->PRDTable)
   11534:	8b 80 38 04 00 00    	mov    0x438(%eax),%eax
   1153a:	85 c0                	test   %eax,%eax
   1153c:	74 64                	je     115a2 <_AtapiConfigDma+0x82>
        {
          if (DeviceExtension->DeviceParams[UnitNumber].Capabilities & IDE_DRID_DMA_SUPPORTED)
   1153e:	89 d0                	mov    %edx,%eax
   11540:	c1 e0 09             	shl    $0x9,%eax
   11543:	01 f0                	add    %esi,%eax
   11545:	8d 50 60             	lea    0x60(%eax),%edx
   11548:	f6 42 03 01          	testb  $0x1,0x3(%edx)
   1154c:	74 54                	je     115a2 <_AtapiConfigDma+0x82>
            {
              if ((DeviceExtension->DeviceParams[UnitNumber].TMFieldsValid & 0x0004) &&
   1154e:	f6 42 0a 04          	testb  $0x4,0xa(%edx)
   11552:	74 5d                	je     115b1 <_AtapiConfigDma+0x91>
   11554:	66 8b 80 b0 00 00 00 	mov    0xb0(%eax),%ax
   1155b:	f6 c4 7f             	test   $0x7f,%ah
   1155e:	74 51                	je     115b1 <_AtapiConfigDma+0x91>
                  (DeviceExtension->DeviceParams[UnitNumber].UltraDmaModes & 0x7F00))
                {
                  Result = TRUE;
                }
              else if (DeviceExtension->DeviceParams[UnitNumber].TMFieldsValid & 0x0002)
	        {
	          if ((DeviceExtension->DeviceParams[UnitNumber].MultiDmaModes & 0x0404) == 0x0404)
	            {
                      Result = TRUE;	  
   11560:	bf 01 00 00 00       	mov    $0x1,%edi
                    }
#if 0
                  /* FIXME:
	           *   should we support single mode dma ?
	           */
	          else if ((DeviceExtension->DeviceParams[UnitNumber].DmaModes & 0x0404) == 0x0404)
	            {
                      Result = TRUE;		  
	            }
#endif
                }
              Status = IDEReadDMAStatus(DeviceExtension->BusMasterRegisterBase);
   11565:	83 ec 0c             	sub    $0xc,%esp
   11568:	8b 86 18 04 00 00    	mov    0x418(%esi),%eax
   1156e:	83 c0 02             	add    $0x2,%eax
   11571:	50                   	push   %eax
   11572:	e8 89 26 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
              if (Result)
   11577:	89 fa                	mov    %edi,%edx
   11579:	83 c4 0c             	add    $0xc,%esp
   1157c:	84 d2                	test   %dl,%dl
   1157e:	74 55                	je     115d5 <_AtapiConfigDma+0xb5>
                {
                  IDEWriteDMAStatus(DeviceExtension->BusMasterRegisterBase, Status | (UnitNumber ? 0x40 : 0x20));
   11580:	25 ff 00 00 00       	and    $0xff,%eax
   11585:	51                   	push   %ecx
   11586:	85 db                	test   %ebx,%ebx
   11588:	51                   	push   %ecx
   11589:	74 5c                	je     115e7 <_AtapiConfigDma+0xc7>
   1158b:	83 c8 40             	or     $0x40,%eax
   1158e:	89 f6                	mov    %esi,%esi
	        }
              else
                {
                  IDEWriteDMAStatus(DeviceExtension->BusMasterRegisterBase, Status & (UnitNumber ? ~0x40 : ~0x20));
   11590:	50                   	push   %eax
   11591:	8b 86 18 04 00 00    	mov    0x418(%esi),%eax
   11597:	83 c0 02             	add    $0x2,%eax
   1159a:	50                   	push   %eax
   1159b:	e8 70 26 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   115a0:	59                   	pop    %ecx
   115a1:	5b                   	pop    %ebx
                }
	    }
	}
    }
  return Result;
   115a2:	89 f8                	mov    %edi,%eax
}
   115a4:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   115a7:	25 ff 00 00 00       	and    $0xff,%eax
   115ac:	5b                   	pop    %ebx
   115ad:	5e                   	pop    %esi
   115ae:	5f                   	pop    %edi
   115af:	5d                   	pop    %ebp
   115b0:	c3                   	ret    
   115b1:	89 d8                	mov    %ebx,%eax
   115b3:	c1 e0 09             	shl    $0x9,%eax
   115b6:	01 f0                	add    %esi,%eax
   115b8:	f6 40 6a 02          	testb  $0x2,0x6a(%eax)
   115bc:	74 a7                	je     11565 <_AtapiConfigDma+0x45>
   115be:	66 8b 40 7e          	mov    0x7e(%eax),%ax
   115c2:	25 04 04 00 00       	and    $0x404,%eax
   115c7:	3d 04 04 00 00       	cmp    $0x404,%eax
   115cc:	75 97                	jne    11565 <_AtapiConfigDma+0x45>
   115ce:	bf 01 00 00 00       	mov    $0x1,%edi
   115d3:	eb 90                	jmp    11565 <_AtapiConfigDma+0x45>
   115d5:	25 ff 00 00 00       	and    $0xff,%eax
   115da:	52                   	push   %edx
   115db:	85 db                	test   %ebx,%ebx
   115dd:	52                   	push   %edx
   115de:	74 0c                	je     115ec <_AtapiConfigDma+0xcc>
   115e0:	25 bf 00 00 00       	and    $0xbf,%eax
   115e5:	eb a9                	jmp    11590 <_AtapiConfigDma+0x70>
   115e7:	83 c8 20             	or     $0x20,%eax
   115ea:	eb a4                	jmp    11590 <_AtapiConfigDma+0x70>
   115ec:	25 df 00 00 00       	and    $0xdf,%eax
   115f1:	eb 9d                	jmp    11590 <_AtapiConfigDma+0x70>
   115f3:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   115f9:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011600 <_AtapiExecuteCommand>:
#endif

/**********************************************************************
 * NAME							INTERNAL
 *	AtapiFindDevices
 *
 * DESCRIPTION
 *	Searches for devices on the given port.
 *
 * RUN LEVEL
 *	PASSIVE_LEVEL
 *
 * ARGUMENTS
 *	DeviceExtension
 *		Port device specific information.
 *
 *	ConfigInfo
 *		Port configuration information.
 *
 * RETURN VALUE
 *	TRUE: At least one device is attached to the port.
 *	FALSE: No device is attached to the port.
 */

static BOOLEAN
AtapiFindDevices(PATAPI_MINIPORT_EXTENSION DeviceExtension,
		 PPORT_CONFIGURATION_INFORMATION ConfigInfo)
{
  BOOLEAN DeviceFound = FALSE;
  ULONG CommandPortBase;
  ULONG ControlPortBase;
  ULONG UnitNumber;
  ULONG Retries;
  UCHAR High;
  UCHAR Low;

  DPRINT("AtapiFindDevices() called\n");

  CommandPortBase = ScsiPortConvertPhysicalAddressToUlong(ConfigInfo->AccessRanges[0].RangeStart);
  DPRINT("  CommandPortBase: %x\n", CommandPortBase);

  ControlPortBase = ScsiPortConvertPhysicalAddressToUlong(ConfigInfo->AccessRanges[1].RangeStart);
  DPRINT("  ControlPortBase: %x\n", ControlPortBase);

  for (UnitNumber = 0; UnitNumber < 2; UnitNumber++)
    {
      /* Select drive */
      IDEWriteDriveHead(CommandPortBase,
			IDE_DH_FIXED | (UnitNumber ? IDE_DH_DRV1 : 0));
      ScsiPortStallExecution(500);

      /* Disable interrupts */
      IDEWriteDriveControl(ControlPortBase,
			   IDE_DC_nIEN);
      ScsiPortStallExecution(500);

      /* Check if a device is attached to the interface */
      IDEWriteCylinderHigh(CommandPortBase, 0xaa);
      IDEWriteCylinderLow(CommandPortBase, 0x55);

      High = IDEReadCylinderHigh(CommandPortBase);
      Low = IDEReadCylinderLow(CommandPortBase);

      IDEWriteCylinderHigh(CommandPortBase, 0);
      IDEWriteCylinderLow(CommandPortBase, 0);

      if (Low != 0x55 || High != 0xaa)
	{
	  DPRINT("No Drive found. UnitNumber %d CommandPortBase %x\n", UnitNumber, CommandPortBase);
	  continue;
	}

      AtapiExecuteCommand(DeviceExtension, IDE_CMD_RESET, NULL);

      for (Retries = 0; Retries < 20000; Retries++)
	{
	  if (!(IDEReadStatus(CommandPortBase) & IDE_SR_BUSY))
	    {
	      break;
	    }
	  ScsiPortStallExecution(150);
	}
      if (Retries >= 20000)
	{
	  DPRINT("Timeout on drive %lu\n", UnitNumber);
	  DeviceExtension->DeviceFlags[UnitNumber] &= ~DEVICE_PRESENT;
	  continue;
	}

      High = IDEReadCylinderHigh(CommandPortBase);
      Low = IDEReadCylinderLow(CommandPortBase);

      DPRINT("  Check drive %lu: High 0x%x Low 0x%x\n",
	     UnitNumber,
	     High,
	     Low);

      if (High == 0xEB && Low == 0x14)
	{
	  if (AtapiIdentifyDevice(CommandPortBase,
				  ControlPortBase,
				  UnitNumber,
				  TRUE,
				  &DeviceExtension->DeviceParams[UnitNumber]))
	    {
	      DPRINT("  ATAPI drive found!\n");
	      DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_PRESENT;
	      DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_ATAPI;
	      DeviceExtension->TransferSize[UnitNumber] =
		DeviceExtension->DeviceParams[UnitNumber].BytesPerSector;
#ifdef ENABLE_DMA
              if (AtapiConfigDma(DeviceExtension, UnitNumber))
	        {
		  DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_DMA_CMD;		  
		}
#endif
	      DeviceFound = TRUE;
	    }
	  else
	    {
	      DPRINT("  No ATAPI drive found!\n");
	    }
	}
      else
	{
	  if (AtapiIdentifyDevice(CommandPortBase,
				  ControlPortBase,
				  UnitNumber,
				  FALSE,
				  &DeviceExtension->DeviceParams[UnitNumber]))
	    {
	      DPRINT("  IDE drive found!\n");
	      DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_PRESENT;
	      DeviceExtension->TransferSize[UnitNumber] = DeviceExtension->DeviceParams[UnitNumber].BytesPerSector;
	      if ((DeviceExtension->DeviceParams[UnitNumber].RWMultImplemented & 0x8000) && 
		  (DeviceExtension->DeviceParams[UnitNumber].RWMultImplemented & 0xff) &&
		  (DeviceExtension->DeviceParams[UnitNumber].RWMultCurrent & 0x100) &&
		  (DeviceExtension->DeviceParams[UnitNumber].RWMultCurrent & 0xff))
		{
		  DeviceExtension->TransferSize[UnitNumber] *= (DeviceExtension->DeviceParams[UnitNumber].RWMultCurrent & 0xff);
		  DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_MULTI_SECTOR_CMD;
		}
	      if (DeviceExtension->DeviceParams[UnitNumber].SupportedFeatures83 & 0x0400 &&
		  DeviceExtension->DeviceParams[UnitNumber].EnabledFeatures86 & 0x0400)
	        {
		  DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_48BIT_ADDRESS;
		}
	      if (DeviceExtension->DeviceParams[UnitNumber].DWordIo)
		{
		  DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_DWORD_IO;
		}
#ifdef ENABLE_DMA
	      if (AtapiConfigDma(DeviceExtension, UnitNumber))
	        {
		  DeviceExtension->DeviceFlags[UnitNumber] |= DEVICE_DMA_CMD;		  
		}
#endif
	      DeviceFound = TRUE;
	    }
	  else
	    {
	      DPRINT("  No IDE drive found!\n");
	    }
	}
    }

  /* Reset pending interrupts */
  IDEReadStatus(CommandPortBase);
  /* Reenable interrupts */
  IDEWriteDriveControl(ControlPortBase, 0);
  ScsiPortStallExecution(500);
  /* Return with drive 0 selected */
  IDEWriteDriveHead(CommandPortBase, IDE_DH_FIXED);
  ScsiPortStallExecution(500);

  DPRINT("AtapiFindDrives() done (DeviceFound %s)\n", (DeviceFound) ? "TRUE" : "FALSE");

  return(DeviceFound);
}


/*
 *  AtapiIdentifyDevice
 *
 *  DESCRIPTION:
 *	Get the identification block from the drive
 *
 *  RUN LEVEL:
 *	PASSIVE_LEVEL
 *
 *  ARGUMENTS:
 *	CommandPort
 *		Address of the command port
 *	ControlPort
 *		Address of the control port
 *	DriveNum
 *		The drive index (0,1)
 *	Atapi
 *		Send an ATA(FALSE) or an ATAPI(TRUE) identify comand
 *	DrvParms
 *		Address to write drive ident block
 *
 *  RETURNS:
 *	TRUE: The drive identification block was retrieved successfully
 *	FALSE: an error ocurred
 */

static BOOLEAN
AtapiIdentifyDevice(IN ULONG CommandPort,
		    IN ULONG ControlPort,
		    IN ULONG DriveNum,
		    IN BOOLEAN Atapi,
		    OUT PIDE_DRIVE_IDENTIFY DrvParms)
{
  LONG i;
  ULONG mode;

  /*  Get the Drive Identify block from drive or die  */
  if (AtapiPolledRead(CommandPort,
		      ControlPort,
		      0,
		      1,
		      0,
		      0,
		      0,
		      (DriveNum ? IDE_DH_DRV1 : 0),
		      (Atapi ? IDE_CMD_IDENT_ATAPI_DRV : IDE_CMD_IDENT_ATA_DRV),
		      (PUCHAR)DrvParms) == FALSE)
    {
      DPRINT("AtapiPolledRead() failed\n");
      return FALSE;
    }

  /*  Report on drive parameters if debug mode  */
  IDESwapBytePairs(DrvParms->SerialNumber, 20);
  IDESwapBytePairs(DrvParms->FirmwareRev, 8);
  IDESwapBytePairs(DrvParms->ModelNumber, 40);
  DPRINT("Config:%04x  Cyls:%5d  Heads:%2d  Sectors/Track:%3d  Gaps:%02d %02d\n",
         DrvParms->ConfigBits,
         DrvParms->LogicalCyls,
         DrvParms->LogicalHeads,
         DrvParms->SectorsPerTrack,
         DrvParms->InterSectorGap,
         DrvParms->InterSectorGapSize);
  DPRINT("Bytes/PLO:%3d  Vendor Cnt:%2d  Serial number:[%.20s]\n",
         DrvParms->BytesInPLO,
         DrvParms->VendorUniqueCnt,
         DrvParms->SerialNumber);
  DPRINT("Cntlr type:%2d  BufSiz:%5d  ECC bytes:%3d  Firmware Rev:[%.8s]\n",
         DrvParms->ControllerType,
         DrvParms->BufferSize * IDE_SECTOR_BUF_SZ,
         DrvParms->ECCByteCnt,
         DrvParms->FirmwareRev);
  DPRINT("Model:[%.40s]\n", DrvParms->ModelNumber);
  DPRINT("RWMultMax?:%04x  RWMult?:%02x  LBA:%d  DMA:%d  MinPIO:%d ns  MinDMA:%d ns\n",
         (DrvParms->RWMultImplemented),
	 (DrvParms->RWMultCurrent) & 0xff,
         (DrvParms->Capabilities & IDE_DRID_LBA_SUPPORTED) ? 1 : 0,
         (DrvParms->Capabilities & IDE_DRID_DMA_SUPPORTED) ? 1 : 0,
         DrvParms->MinPIOTransTime,
         DrvParms->MinDMATransTime);
  DPRINT("TM:Cyls:%d  Heads:%d  Sectors/Trk:%d Capacity:%ld\n",
         DrvParms->TMCylinders,
         DrvParms->TMHeads,
         DrvParms->TMSectorsPerTrk,
         (ULONG)(DrvParms->TMCapacityLo + (DrvParms->TMCapacityHi << 16)));
  DPRINT("TM:SectorCount: 0x%04x%04x = %lu\n",
         DrvParms->TMSectorCountHi,
         DrvParms->TMSectorCountLo,
         (ULONG)((DrvParms->TMSectorCountHi << 16) + DrvParms->TMSectorCountLo));
  DPRINT("SupportedFeatures83: %x, EnabledFeatures86 %x\n", DrvParms->SupportedFeatures83, DrvParms->EnabledFeatures86);
  DPRINT("Max48BitAddress: %I64d\n", *(PULONGLONG)DrvParms->Max48BitAddress);
  if (DrvParms->TMFieldsValid & 0x0004)
    {
      if ((DrvParms->UltraDmaModes >> 8) && (DrvParms->UltraDmaModes & 0xff))
        {
	  mode = 7;
	  while (!(DrvParms->UltraDmaModes & (0x0100 << mode)))
	    {
	      mode--;
	    }
	  DPRINT("Ultra DMA mode %d is selected\n", mode);
	}
      else if ((DrvParms->MultiDmaModes >> 8) & (DrvParms->MultiDmaModes & 0x07))
        {
	  mode = 2;
	  while(!(DrvParms->MultiDmaModes & (0x01 << mode)))
	    {
	      mode--;
	    }
	  DPRINT("Multi DMA mode %d is selected\n", mode);
	}
    }

  if (! Atapi && 0 != (DrvParms->Capabilities & IDE_DRID_LBA_SUPPORTED))
    {
      /* LBA ATA drives always have a sector size of 512 */
      DrvParms->BytesPerSector = 512;
    }
  else
    {
      DPRINT("BytesPerSector %d\n", DrvParms->BytesPerSector);
      if (DrvParms->BytesPerSector == 0)
        {
          DrvParms->BytesPerSector = 512;
        }
      else
        {
          for (i = 15; i >= 0; i--)
            {
              if (DrvParms->BytesPerSector & (1 << i))
                {
                  DrvParms->BytesPerSector = 1 << i;
                  break;
                }
            }
        }
    }
  DPRINT("BytesPerSector %d\n", DrvParms->BytesPerSector);

  return TRUE;
}


//    AtapiPolledRead
//
//  DESCRIPTION:
//    Read a sector of data from the drive in a polled fashion.
//
//  RUN LEVEL:
//    PASSIVE_LEVEL
//
//  ARGUMENTS:
//    IN   ULONG  CommandPort   Address of command port for drive
//    IN   ULONG  ControlPort   Address of control port for drive
//    IN   UCHAR  PreComp       Value to write to precomp register
//    IN   UCHAR  SectorCnt     Value to write to sectorCnt register
//    IN   UCHAR  SectorNum     Value to write to sectorNum register
//    IN   UCHAR  CylinderLow   Value to write to CylinderLow register
//    IN   UCHAR  CylinderHigh  Value to write to CylinderHigh register
//    IN   UCHAR  DrvHead       Value to write to Drive/Head register
//    IN   UCHAR  Command       Value to write to Command register
//    OUT  PUCHAR Buffer        Buffer for output data
//
//  RETURNS:
//    BOOLEAN: TRUE success, FALSE error
//

static BOOLEAN
AtapiPolledRead(IN ULONG CommandPort,
		IN ULONG ControlPort,
		IN UCHAR PreComp,
		IN UCHAR SectorCnt,
		IN UCHAR SectorNum,
		IN UCHAR CylinderLow,
		IN UCHAR CylinderHigh,
		IN UCHAR DrvHead,
		IN UCHAR Command,
		OUT PUCHAR Buffer)
{
  ULONG SectorCount = 0;
  ULONG RetryCount;
  BOOLEAN Junk = FALSE;
  UCHAR Status;

  /* Wait for BUSY to clear */
  for (RetryCount = 0; RetryCount < IDE_MAX_BUSY_RETRIES; RetryCount++)
    {
      Status = IDEReadStatus(CommandPort);
      if (!(Status & IDE_SR_BUSY))
        {
          break;
        }
      ScsiPortStallExecution(10);
    }
  DPRINT("status=%02x\n", Status);
  DPRINT("waited %ld usecs for busy to clear\n", RetryCount * 10);
  if (RetryCount >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT("Drive is BUSY for too long\n");
      return FALSE;
    }

  /*  Write Drive/Head to select drive  */
  IDEWriteDriveHead(CommandPort, IDE_DH_FIXED | DrvHead);
  ScsiPortStallExecution(500);

  /* Disable interrupts */
  IDEWriteDriveControl(ControlPort, IDE_DC_nIEN);
  ScsiPortStallExecution(500);

#if 0
  /*  Wait for STATUS.BUSY and STATUS.DRQ to clear  */
  for (RetryCount = 0; RetryCount < IDE_MAX_BUSY_RETRIES; RetryCount++)
    {
      Status = IDEReadStatus(CommandPort);
      if (!(Status & IDE_SR_BUSY) && !(Status & IDE_SR_DRQ))
	{
	  break;
	}
      ScsiPortStallExecution(10);
    }
  if (RetryCount >= IDE_MAX_BUSY_RETRIES)
    {
      return FALSE;
    }
#endif

  /*  Issue command to drive  */
  if (DrvHead & IDE_DH_LBA)
    {
      DPRINT("READ:DRV=%d:LBA=1:BLK=%08d:SC=%02x:CM=%02x\n",
	     DrvHead & IDE_DH_DRV1 ? 1 : 0,
	     ((DrvHead & 0x0f) << 24) + (CylinderHigh << 16) + (CylinderLow << 8) + SectorNum,
	     SectorCnt,
	     Command);
    }
  else
    {
      DPRINT("READ:DRV=%d:LBA=0:CH=%02x:CL=%02x:HD=%01x:SN=%02x:SC=%02x:CM=%02x\n",
	     DrvHead & IDE_DH_DRV1 ? 1 : 0,
	     CylinderHigh,
	     CylinderLow,
	     DrvHead & 0x0f,
	     SectorNum,
	     SectorCnt,
	     Command);
    }

  /*  Setup command parameters  */
  IDEWritePrecomp(CommandPort, PreComp);
  IDEWriteSectorCount(CommandPort, SectorCnt);
  IDEWriteSectorNum(CommandPort, SectorNum);
  IDEWriteCylinderHigh(CommandPort, CylinderHigh);
  IDEWriteCylinderLow(CommandPort, CylinderLow);
  IDEWriteDriveHead(CommandPort, IDE_DH_FIXED | DrvHead);

  /*  Issue the command  */
  IDEWriteCommand(CommandPort, Command);
  ScsiPortStallExecution(50);

  /*  wait for DRQ or error  */
  for (RetryCount = 0; RetryCount < IDE_MAX_POLL_RETRIES; RetryCount++)
    {
      Status = IDEReadStatus(CommandPort);
      if (!(Status & IDE_SR_BUSY))
	{
	  if (Status & IDE_SR_ERR)
	    {
	      IDEWriteDriveControl(ControlPort, 0);
	      ScsiPortStallExecution(50);
	      IDEReadStatus(CommandPort);

	      return FALSE;
	    }

	  if (Status & IDE_SR_DRQ)
	    {
	      break;
	    }
	  else
	    {
	      IDEWriteDriveControl(ControlPort, 0);
	      ScsiPortStallExecution(50);
	      IDEReadStatus(CommandPort);

	      return FALSE;
	    }
	}
      ScsiPortStallExecution(10);
    }

  /*  timed out  */
  if (RetryCount >= IDE_MAX_POLL_RETRIES)
    {
      IDEWriteDriveControl(ControlPort, 0);
      ScsiPortStallExecution(50);
      IDEReadStatus(CommandPort);

      return FALSE;
    }

  while (1)
    {
      /*  Read data into buffer  */
      if (Junk == FALSE)
	{
	  IDEReadBlock(CommandPort, Buffer, IDE_SECTOR_BUF_SZ);
	  Buffer += IDE_SECTOR_BUF_SZ;
	}
      else
	{
	  UCHAR JunkBuffer[IDE_SECTOR_BUF_SZ];
	  IDEReadBlock(CommandPort, JunkBuffer, IDE_SECTOR_BUF_SZ);
	}
      SectorCount++;

      /*  Check for error or more sectors to read  */
      for (RetryCount = 0; RetryCount < IDE_MAX_BUSY_RETRIES; RetryCount++)
	{
	  Status = IDEReadStatus(CommandPort);
	  if (!(Status & IDE_SR_BUSY))
	    {
	      if (Status & IDE_SR_ERR)
		{
		  IDEWriteDriveControl(ControlPort, 0);
		  ScsiPortStallExecution(50);
		  IDEReadStatus(CommandPort);

		  return FALSE;
		}
	      if (Status & IDE_SR_DRQ)
		{
		  if (SectorCount >= SectorCnt)
		    {
		      DPRINT("Buffer size exceeded!\n");
		      Junk = TRUE;
		    }
		  break;
		}
	      else
		{
		  if (SectorCount > SectorCnt)
		    {
		      DPRINT("Read %lu sectors of junk!\n",
			     SectorCount - SectorCnt);
		    }
		  IDEWriteDriveControl(ControlPort, 0);
		  ScsiPortStallExecution(50);
		  IDEReadStatus(CommandPort);

		  return TRUE;
		}
	    }
	}
    }
}


//  -------------------------------------------  Nondiscardable statics

static ULONG
AtapiSendAtapiCommand(IN PATAPI_MINIPORT_EXTENSION DeviceExtension,
		      IN PSCSI_REQUEST_BLOCK Srb)
{
  UCHAR ByteCountHigh;
  UCHAR ByteCountLow;
  ULONG Retries;
  ULONG CdbSize;
  UCHAR Status;

  DPRINT("AtapiSendAtapiCommand() called!\n");

  if (Srb->PathId != 0)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_PATH_ID;
      return(SRB_STATUS_INVALID_PATH_ID);
    }

  if (Srb->TargetId > 1)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_TARGET_ID;
      return(SRB_STATUS_INVALID_TARGET_ID);
    }

  if (Srb->Lun != 0)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_LUN;
      return(SRB_STATUS_INVALID_LUN);
    }

  if (!(DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_PRESENT))
    {
      Srb->SrbStatus = SRB_STATUS_NO_DEVICE;
      return(SRB_STATUS_NO_DEVICE);
    }

  if (Srb->Cdb[0] == SCSIOP_MODE_SENSE)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_REQUEST;
      return (SRB_STATUS_INVALID_REQUEST);
    }

  DPRINT("AtapiSendAtapiCommand(): TargetId: %lu\n",
	 Srb->TargetId);

  if (Srb->Cdb[0] == SCSIOP_INQUIRY)
    return(AtapiInquiry(DeviceExtension,
			Srb));

  /* Set pointer to data buffer. */
  DeviceExtension->DataBuffer = (PUCHAR)Srb->DataBuffer;
  DeviceExtension->DataTransferLength = Srb->DataTransferLength;
  DeviceExtension->CurrentSrb = Srb;

  DPRINT("BufferAddress %x, BufferLength %d\n", Srb->DataBuffer, Srb->DataTransferLength);

  /* Wait for BUSY to clear */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY))
        {
          break;
        }
      ScsiPortStallExecution(10);
    }
  DPRINT("status=%02x\n", Status);
  DPRINT("waited %ld usecs for busy to clear\n", Retries * 10);
  if (Retries >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT("Drive is BUSY for too long\n");
      return(SRB_STATUS_BUSY);
    }

  /* Select the desired drive */
  IDEWriteDriveHead(DeviceExtension->CommandPortBase,
		    IDE_DH_FIXED | (Srb->TargetId ? IDE_DH_DRV1 : 0));

  /* Wait a little while */
  ScsiPortStallExecution(50);

#if 0
  /* Wait for BUSY to clear and DRDY to assert */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY) && (Status & IDE_SR_DRDY))
	{
	  break;
	}
      ScsiPortStallExecution(10);
    }
  DPRINT("waited %ld usecs for busy to clear after drive select\n", Retries * 10);
  if (Retries >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT("Drive is BUSY for too long after drive select\n");
      return(SRB_STATUS_BUSY);
    }
#endif

#ifdef ENABLE_DMA
  if ((DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_DMA_CMD) &&
      (Srb->Cdb[0] == SCSIOP_READ || Srb->Cdb[0] == SCSIOP_WRITE))
    {
      DeviceExtension->UseDma = AtapiInitDma(DeviceExtension, Srb, Srb->SrbFlags & SRB_FLAGS_DATA_IN ? 1 << 3 : 0);
    }
  else
    {
      DeviceExtension->UseDma = FALSE;
    }
#endif

  if (DeviceExtension->DataTransferLength < 0x10000)
    {
      ByteCountLow = (UCHAR)(DeviceExtension->DataTransferLength & 0xFF);
      ByteCountHigh = (UCHAR)(DeviceExtension->DataTransferLength >> 8);
    }
  else
    {
      ByteCountLow = 0xFF;
      ByteCountHigh = 0xFF;
    }

  /* Set feature register */
#ifdef ENABLE_DMA
  IDEWritePrecomp(DeviceExtension->CommandPortBase, DeviceExtension->UseDma ? 1 : 0);
#else
  IDEWritePrecomp(DeviceExtension->CommandPortBase, 0);
#endif

  /* Set command packet length */
  IDEWriteCylinderHigh(DeviceExtension->CommandPortBase, ByteCountHigh);
  IDEWriteCylinderLow(DeviceExtension->CommandPortBase, ByteCountLow);

  /* Issue command to drive */
#ifdef ENABLE_DMA
  if (DeviceExtension->UseDma)
    {
      AtapiExecuteCommand(DeviceExtension, IDE_CMD_PACKET, AtapiDmaPacketInterrupt);
    }
  else
#endif
    {
      AtapiExecuteCommand(DeviceExtension, IDE_CMD_PACKET, AtapiPacketInterrupt);
    }

  /* Wait for DRQ to assert */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if ((Status & IDE_SR_DRQ))
	{
	  break;
	}
      ScsiPortStallExecution(10);
    }

  /* Convert special SCSI SRBs to ATAPI format */
  switch (Srb->Cdb[0])
    {
      case SCSIOP_FORMAT_UNIT:
      case SCSIOP_MODE_SELECT:
	AtapiScsiSrbToAtapi (Srb);
	break;
    }

  CdbSize = ((DeviceExtension->DeviceParams[Srb->TargetId].ConfigBits & 0x3) == 1) ? 16 : 12;
  DPRINT("CdbSize: %lu\n", CdbSize);

  /* Write command packet */
  IDEWriteBlock(DeviceExtension->CommandPortBase,
		(PUSHORT)Srb->Cdb,
		CdbSize);

#ifdef ENABLE_DMA
  if (DeviceExtension->UseDma)
    {
      BYTE DmaCommand;
      /* start DMA */
      DmaCommand = IDEReadDMACommand(DeviceExtension->BusMasterRegisterBase);
      IDEWriteDMACommand(DeviceExtension->BusMasterRegisterBase, DmaCommand|0x01);
    }
#endif
  DPRINT("AtapiSendAtapiCommand() done\n");

  return(SRB_STATUS_PENDING);
}


static ULONG
AtapiSendIdeCommand(IN PATAPI_MINIPORT_EXTENSION DeviceExtension,
		    IN PSCSI_REQUEST_BLOCK Srb)
{
  ULONG SrbStatus = SRB_STATUS_SUCCESS;

  DPRINT("AtapiSendIdeCommand() called!\n");

  DPRINT("PathId: %lu  TargetId: %lu  Lun: %lu\n",
	 Srb->PathId,
	 Srb->TargetId,
	 Srb->Lun);

  if (Srb->PathId != 0)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_PATH_ID;
      return(SRB_STATUS_INVALID_PATH_ID);
    }

  if (Srb->TargetId > 1)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_TARGET_ID;
      return(SRB_STATUS_INVALID_TARGET_ID);
    }

  if (Srb->Lun != 0)
    {
      Srb->SrbStatus = SRB_STATUS_INVALID_LUN;
      return(SRB_STATUS_INVALID_LUN);
    }

  if (!(DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_PRESENT))
    {
      Srb->SrbStatus = SRB_STATUS_NO_DEVICE;
      return(SRB_STATUS_NO_DEVICE);
    }

  switch (Srb->Cdb[0])
    {
      case SCSIOP_INQUIRY:
	SrbStatus = AtapiInquiry(DeviceExtension,
				 Srb);
	break;

      case SCSIOP_READ_CAPACITY:
	SrbStatus = AtapiReadCapacity(DeviceExtension,
				      Srb);
	break;

      case SCSIOP_READ:
      case SCSIOP_WRITE:
	SrbStatus = AtapiReadWrite(DeviceExtension,
				   Srb);
	break;

      case SCSIOP_SYNCHRONIZE_CACHE:
	SrbStatus = AtapiFlushCache(DeviceExtension,
				    Srb);
	break;

      case SCSIOP_TEST_UNIT_READY:
	SrbStatus = AtapiTestUnitReady(DeviceExtension,
				       Srb);
	break;

      case SCSIOP_MODE_SENSE:

      case SCSIOP_VERIFY:
      case SCSIOP_START_STOP_UNIT:
      case SCSIOP_REQUEST_SENSE:
	break;

     default:
	DbgPrint("AtapiSendIdeCommand():unknown command %x\n",
		 Srb->Cdb[0]);
	SrbStatus = SRB_STATUS_INVALID_REQUEST;
	break;
    }

  DPRINT("AtapiSendIdeCommand() done!\n");

  return(SrbStatus);
}


static ULONG
AtapiInquiry(PATAPI_MINIPORT_EXTENSION DeviceExtension,
	     PSCSI_REQUEST_BLOCK Srb)
{
  PIDE_DRIVE_IDENTIFY DeviceParams;
  PINQUIRYDATA InquiryData;
  ULONG i;

  DPRINT("SCSIOP_INQUIRY: DeviceExtension %p  TargetId: %lu\n",
	 DeviceExtension, Srb->TargetId);

  InquiryData = Srb->DataBuffer;
  DeviceParams = &DeviceExtension->DeviceParams[Srb->TargetId];

  /* clear buffer */
  for (i = 0; i < Srb->DataTransferLength; i++)
    {
      ((PUCHAR)Srb->DataBuffer)[i] = 0;
    }

  /* set device class */
  if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_ATAPI)
    {
      /* get it from the ATAPI configuration word */
      InquiryData->DeviceType = (DeviceParams->ConfigBits >> 8) & 0x1F;
      DPRINT("Device class: %u\n", InquiryData->DeviceType);

      /* Don't flush CD/DVD drives */
      if (InquiryData->DeviceType == READ_ONLY_DIRECT_ACCESS_DEVICE)
	{
	  DeviceExtension->DeviceFlags[Srb->TargetId] |= DEVICE_NO_FLUSH;
	}
    }
  else
    {
      /* hard-disk */
      InquiryData->DeviceType = DIRECT_ACCESS_DEVICE;
    }

  DPRINT("ConfigBits: 0x%x\n", DeviceParams->ConfigBits);
  if (DeviceParams->ConfigBits & 0x80)
    {
      DPRINT("Removable media!\n");
      InquiryData->RemovableMedia = 1;
    }

  for (i = 0; i < 20; i += 2)
    {
      InquiryData->VendorId[i] =
	((PUCHAR)DeviceParams->ModelNumber)[i];
      InquiryData->VendorId[i+1] =
	((PUCHAR)DeviceParams->ModelNumber)[i+1];
    }

  for (i = 0; i < 4; i++)
    {
      InquiryData->ProductId[12+i] = ' ';
    }

  for (i = 0; i < 4; i += 2)
    {
      InquiryData->ProductRevisionLevel[i] =
	((PUCHAR)DeviceParams->FirmwareRev)[i];
      InquiryData->ProductRevisionLevel[i+1] =
	((PUCHAR)DeviceParams->FirmwareRev)[i+1];
    }

  InquiryData->AdditionalLength = 31;

  DPRINT("VendorId: '%.20s'\n", InquiryData->VendorId);

  Srb->SrbStatus = SRB_STATUS_SUCCESS;
  return(SRB_STATUS_SUCCESS);
}


static ULONG
AtapiReadCapacity(PATAPI_MINIPORT_EXTENSION DeviceExtension,
		  PSCSI_REQUEST_BLOCK Srb)
{
  PREAD_CAPACITY_DATA CapacityData;
  PIDE_DRIVE_IDENTIFY DeviceParams;
  LARGE_INTEGER LastSector;

  DPRINT("SCSIOP_READ_CAPACITY: TargetId: %lu\n", Srb->TargetId);
  CapacityData = (PREAD_CAPACITY_DATA)Srb->DataBuffer;
  DeviceParams = &DeviceExtension->DeviceParams[Srb->TargetId];

  /* Set sector (block) size to 512 bytes (big-endian). */
  CapacityData->BytesPerBlock = 0x20000;

  /* Calculate last sector (big-endian). */
  if (DeviceParams->Capabilities & IDE_DRID_LBA_SUPPORTED)
    {
      if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS)
        {
	  ((PUSHORT)&LastSector)[0] = DeviceParams->Max48BitAddress[0]; 
	  ((PUSHORT)&LastSector)[1] = DeviceParams->Max48BitAddress[1]; 
	  ((PUSHORT)&LastSector)[2] = DeviceParams->Max48BitAddress[2]; 
	  ((PUSHORT)&LastSector)[3] = DeviceParams->Max48BitAddress[3]; 
	  LastSector.QuadPart -= 1;

	}
      else
        {
	  LastSector.u.HighPart = 0;
          LastSector.u.LowPart = (ULONG)((DeviceParams->TMSectorCountHi << 16) +
			                 DeviceParams->TMSectorCountLo)-1;
	}
    }
  else
    {
      LastSector.u.HighPart = 0;
      LastSector.u.LowPart = (ULONG)(DeviceParams->LogicalCyls *
			             DeviceParams->LogicalHeads *
			             DeviceParams->SectorsPerTrack)-1;
    }
  if (LastSector.u.HighPart)
    {
      DPRINT1("Disk is too large for our implementation (%I64d sectors\n", LastSector.QuadPart);
      KEBUGCHECK(0);
    }

  CapacityData->LogicalBlockAddress = (((PUCHAR)&LastSector)[0] << 24) |
				      (((PUCHAR)&LastSector)[1] << 16) |
				      (((PUCHAR)&LastSector)[2] << 8) |
				      ((PUCHAR)&LastSector)[3];

  DPRINT("LastCount: %lu (%08lx / %08lx)\n",
	 LastSector,
	 LastSector,
	 CapacityData->LogicalBlockAddress);

  Srb->SrbStatus = SRB_STATUS_SUCCESS;
  return(SRB_STATUS_SUCCESS);
}


static ULONG
AtapiReadWrite(PATAPI_MINIPORT_EXTENSION DeviceExtension,
	       PSCSI_REQUEST_BLOCK Srb)
{
  PIDE_DRIVE_IDENTIFY DeviceParams;
  ULONG StartingSector;
  ULONG SectorCount;
  UCHAR CylinderHigh[2];
  UCHAR CylinderLow[2];
  UCHAR DrvHead;
  UCHAR SectorNumber[2];
  UCHAR Command;
  ULONG Retries;
  UCHAR Status;
  BOOLEAN FASTCALL (*Handler)(PATAPI_MINIPORT_EXTENSION DevExt);

  DPRINT("AtapiReadWrite() called!\n");
  DPRINT("SCSIOP_WRITE: TargetId: %lu\n",
	 Srb->TargetId);

  DeviceParams = &DeviceExtension->DeviceParams[Srb->TargetId];

  /* Get starting sector number from CDB. */
  StartingSector = ((PCDB)Srb->Cdb)->CDB10.LogicalBlockByte3 |
		   ((PCDB)Srb->Cdb)->CDB10.LogicalBlockByte2 << 8 |
		   ((PCDB)Srb->Cdb)->CDB10.LogicalBlockByte1 << 16 |
		   ((PCDB)Srb->Cdb)->CDB10.LogicalBlockByte0 << 24;

  SectorCount = (Srb->DataTransferLength + DeviceParams->BytesPerSector - 1) /
		DeviceParams->BytesPerSector;

  DPRINT("Starting sector %lu  Number of bytes %lu  Sectors %lu\n",
	 StartingSector,
	 Srb->DataTransferLength,
	 SectorCount);

  if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS)
    {
      SectorNumber[0] = StartingSector & 0xff;
      CylinderLow[0] = (StartingSector >> 8) & 0xff;
      CylinderHigh[0] = (StartingSector >> 16) & 0xff;
      SectorNumber[1] = (StartingSector >> 24) & 0xff;
      CylinderLow[1] = 0;
      CylinderHigh[1] = 0;
      DrvHead = (Srb->TargetId ? IDE_DH_DRV1 : 0) | IDE_DH_LBA;

      DPRINT("%s:BUS=%04x:DRV=%d:LBA48=1:BLK=%08d:SC=%02x:CM=%02x\n",
	     (Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? "READ" : "WRITE",
	     DeviceExtension->CommandPortBase,
	     DrvHead & IDE_DH_DRV1 ? 1 : 0,
	     (SectorNumber[1] << 24) +
	     (CylinderHigh[0] << 16) + (CylinderLow[0] << 8) + DectorNumberLow[0],
	     SectorCount,
	     Command);
    }
  else if (DeviceParams->Capabilities & IDE_DRID_LBA_SUPPORTED)
    {
      SectorNumber[0] = StartingSector & 0xff;
      CylinderLow[0] = (StartingSector >> 8) & 0xff;
      CylinderHigh[0] = (StartingSector >> 16) & 0xff;
      DrvHead = ((StartingSector >> 24) & 0x0f) | 
                 (Srb->TargetId ? IDE_DH_DRV1 : 0) |
		 IDE_DH_LBA;

      DPRINT("%s:BUS=%04x:DRV=%d:LBA=1:BLK=%08d:SC=%02x:CM=%02x\n",
	     (Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? "READ" : "WRITE",
	     DeviceExtension->CommandPortBase,
	     DrvHead & IDE_DH_DRV1 ? 1 : 0,
	     ((DrvHead & 0x0f) << 24) +
	     (CylinderHigh[0] << 16) + (CylinderLow[0] << 8) + SectorNumber[0],
	     SectorCount,
	     Command);
    }
  else
    {
      SectorNumber[0] = (StartingSector % DeviceParams->SectorsPerTrack) + 1;
      StartingSector /= DeviceParams->SectorsPerTrack;
      DrvHead = (StartingSector % DeviceParams->LogicalHeads) | 
          (Srb->TargetId ? IDE_DH_DRV1 : 0);
      StartingSector /= DeviceParams->LogicalHeads;
      CylinderLow[0] = StartingSector & 0xff;
      CylinderHigh[0] = StartingSector >> 8;

      DPRINT("%s:BUS=%04x:DRV=%d:LBA=0:CH=%02x:CL=%02x:HD=%01x:SN=%02x:SC=%02x:CM=%02x\n",
             (Srb->SrbFlags & SRB_FLAGS_DATA_IN) ? "READ" : "WRITE",
             DeviceExtension->CommandPortBase,
             DrvHead & IDE_DH_DRV1 ? 1 : 0, 
             CylinderHigh[0],
             CylinderLow[0],
             DrvHead & 0x0f,
             SectorNumber[0],
             SectorCount,
             Command);
    }

  /* Set pointer to data buffer. */
  DeviceExtension->DataBuffer = (PUCHAR)Srb->DataBuffer;
  DeviceExtension->DataTransferLength = Srb->DataTransferLength;

  DeviceExtension->CurrentSrb = Srb;

  /*  wait for BUSY to clear  */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY))
        {
          break;
        }
      ScsiPortStallExecution(10);
    }
  DPRINT("status=%02x\n", Status);
  DPRINT("waited %ld usecs for busy to clear\n", Retries * 10);
  if (Retries >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT ("Drive is BUSY for too long\n");
      return(SRB_STATUS_BUSY);
    }

  /*  Select the desired drive  */
  IDEWriteDriveHead(DeviceExtension->CommandPortBase,
		    IDE_DH_FIXED | DrvHead);

  ScsiPortStallExecution(10);
#if 0
  /*  wait for BUSY to clear and DRDY to assert */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY) && (Status & IDE_SR_DRDY))
	{
	  break;
	}
      ScsiPortStallExecution(10);
    }
  DPRINT("waited %ld usecs for busy to clear after drive select\n", Retries * 10);
  if (Retries >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT("Drive is BUSY for too long after drive select\n");
      return(SRB_STATUS_BUSY);
    }
#endif

  /* Setup command parameters */
  if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS)
    {
      IDEWritePrecomp(DeviceExtension->CommandPortBase, 0);
      IDEWriteSectorCount(DeviceExtension->CommandPortBase, SectorCount >> 8);
      IDEWriteSectorNum(DeviceExtension->CommandPortBase, SectorNumber[1]);
      IDEWriteCylinderLow(DeviceExtension->CommandPortBase, CylinderLow[1]);
      IDEWriteCylinderHigh(DeviceExtension->CommandPortBase, CylinderHigh[1]);
    }

  IDEWritePrecomp(DeviceExtension->CommandPortBase, 0);
  IDEWriteSectorCount(DeviceExtension->CommandPortBase, SectorCount & 0xff);
  IDEWriteSectorNum(DeviceExtension->CommandPortBase, SectorNumber[0]);
  IDEWriteCylinderLow(DeviceExtension->CommandPortBase, CylinderLow[0]);
  IDEWriteCylinderHigh(DeviceExtension->CommandPortBase, CylinderHigh[0]);

  IDEWriteDriveHead(DeviceExtension->CommandPortBase, IDE_DH_FIXED | DrvHead);

#ifdef ENABLE_DMA
  if (DeviceExtension->PRDTable && 
      DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_DMA_CMD)
    {
      DeviceExtension->UseDma = AtapiInitDma(DeviceExtension, Srb, Srb->SrbFlags & SRB_FLAGS_DATA_IN ? 1 << 3 : 0);
    }
  if (DeviceExtension->UseDma)
    {
      Handler = AtapiDmaInterrupt;
      if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS)
        {
	  Command = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? IDE_CMD_READ_DMA_EXT : IDE_CMD_WRITE_DMA_EXT;
	}
      else
        {
          Command = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? IDE_CMD_READ_DMA : IDE_CMD_WRITE_DMA;
	}
    }
  else
#endif
    {
      Handler = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? AtapiReadInterrupt : AtapiWriteInterrupt;
      if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_MULTI_SECTOR_CMD)
        {
          if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS)
	    {
              Command = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? IDE_CMD_READ_MULTIPLE_EXT : IDE_CMD_WRITE_MULTIPLE_EXT;
	    }
	  else
	    {
              Command = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? IDE_CMD_READ_MULTIPLE : IDE_CMD_WRITE_MULTIPLE;
	    }
	}
      else
        {
          if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS)
	    {
	      Command = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? IDE_CMD_READ_EXT : IDE_CMD_WRITE_EXT;
	    }
	  else
	    {
	      Command = Srb->SrbFlags & SRB_FLAGS_DATA_IN ? IDE_CMD_READ : IDE_CMD_WRITE;
	    }
	}
    }

  AtapiExecuteCommand(DeviceExtension, Command, Handler);

#ifdef ENABLE_DMA
  if (DeviceExtension->UseDma)
    {
      BYTE DmaCommand;
      /* start DMA */
      DmaCommand = IDEReadDMACommand(DeviceExtension->BusMasterRegisterBase);
      IDEWriteDMACommand(DeviceExtension->BusMasterRegisterBase, DmaCommand|0x01);
    }
  else 
#endif
    {
      if (Srb->SrbFlags & SRB_FLAGS_DATA_OUT)
        {
          /* Write data block */
          PUCHAR TargetAddress;
          ULONG TransferSize;

          /* Wait for controller ready */
          for (Retries = 0; Retries < IDE_MAX_WRITE_RETRIES; Retries++)
	    {
	      BYTE  Status = IDEReadStatus(DeviceExtension->CommandPortBase);
	      if (!(Status & IDE_SR_BUSY) || (Status & IDE_SR_ERR))
	        {
	          break;
	        }
	      ScsiPortStallExecution(10);
	    }
          if (Retries >= IDE_MAX_WRITE_RETRIES)
	    {
	      DPRINT1("Drive is BUSY for too long after sending write command\n");
	      return(SRB_STATUS_BUSY);
	    }

          /* Update DeviceExtension data */
          TransferSize = DeviceExtension->TransferSize[Srb->TargetId];
          if (DeviceExtension->DataTransferLength < TransferSize)
	    {
	      TransferSize = DeviceExtension->DataTransferLength;
	    }

          TargetAddress = DeviceExtension->DataBuffer;
          DeviceExtension->DataBuffer += TransferSize;
          DeviceExtension->DataTransferLength -= TransferSize;

          /* Write data block */
          if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_DWORD_IO)
	    {
	      IDEWriteBlock32(DeviceExtension->CommandPortBase,
			      TargetAddress,
			      TransferSize);
	    }
          else
	    {
	      IDEWriteBlock(DeviceExtension->CommandPortBase,
			    TargetAddress,
			    TransferSize);
	    }
	}
    }

  DPRINT("AtapiReadWrite() done!\n");

  /* Wait for interrupt. */
  return(SRB_STATUS_PENDING);
}


static ULONG
AtapiFlushCache(PATAPI_MINIPORT_EXTENSION DeviceExtension,
		PSCSI_REQUEST_BLOCK Srb)
{
  ULONG Retries;
  UCHAR Status;

  DPRINT("AtapiFlushCache() called!\n");
  DPRINT("SCSIOP_SYNCRONIZE_CACHE: TargetId: %lu\n",
	 Srb->TargetId);

  if (DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_NO_FLUSH)
    {
      /*
       * NOTE: Don't flush the cache for CD/DVD drives. Although
       * the ATAPI-6 standard allows that, it has been experimentally
       * proved that it can damage some broken LG drives. Afterall
       * it doesn't make sense to flush cache on devices we don't
       * write to.
       */
      return SRB_STATUS_INVALID_REQUEST;
    }

  if (!(DeviceExtension->DeviceParams[Srb->TargetId].SupportedFeatures83 & 0x1000))
    {
      /* The device states it doesn't support the command */
      DPRINT("The drive doesn't support FLUSH_CACHE\n");
      return SRB_STATUS_INVALID_REQUEST;
    }
 
  /* Wait for BUSY to clear */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY))
        {
          break;
        }
      ScsiPortStallExecution(10);
    }
  DPRINT("Status=%02x\n", Status);
  DPRINT("Waited %ld usecs for busy to clear\n", Retries * 10);
  if (Retries >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT1("Drive is BUSY for too long\n");
      return(SRB_STATUS_BUSY);
    }

  /* Select the desired drive */
  IDEWriteDriveHead(DeviceExtension->CommandPortBase,
		    IDE_DH_FIXED | (Srb->TargetId ? IDE_DH_DRV1 : 0));
  ScsiPortStallExecution(10);

  /* Issue command to drive */
  AtapiExecuteCommand(DeviceExtension, 
	              DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_48BIT_ADDRESS ? IDE_CMD_FLUSH_CACHE_EXT : IDE_CMD_FLUSH_CACHE, 
		      AtapiNoDataInterrupt); 

  /* Wait for controller ready */
  for (Retries = 0; Retries < IDE_MAX_WRITE_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY) || (Status & IDE_SR_ERR))
	{
	  break;
	}
      ScsiPortStallExecution(10);
    }
  if (Retries >= IDE_MAX_WRITE_RETRIES)
    {
      DPRINT1("Drive is BUSY for too long after sending write command\n");
      DeviceExtension->Handler = NULL;
      return(SRB_STATUS_BUSY);
    }

  DPRINT("AtapiFlushCache() done!\n");

  /* Wait for interrupt. */
  return(SRB_STATUS_PENDING);
}


static ULONG
AtapiTestUnitReady(PATAPI_MINIPORT_EXTENSION DeviceExtension,
		   PSCSI_REQUEST_BLOCK Srb)
{
  ULONG Retries;
  UCHAR Status;
  UCHAR Error;

  DPRINT1("AtapiTestUnitReady() called!\n");

  DPRINT1("SCSIOP_TEST_UNIT_READY: TargetId: %lu\n",
	 Srb->TargetId);

  /* Return success if media status is not supported */
  if (!(DeviceExtension->DeviceFlags[Srb->TargetId] & DEVICE_MEDIA_STATUS))
    {
      Srb->SrbStatus = SRB_STATUS_SUCCESS;
      return(SRB_STATUS_SUCCESS);
    }

  /* Wait for BUSY to clear */
  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY))
        {
          break;
        }
      ScsiPortStallExecution(10);
    }
  DPRINT1("Status=%02x\n", Status);
  DPRINT1("Waited %ld usecs for busy to clear\n", Retries * 10);
  if (Retries >= IDE_MAX_BUSY_RETRIES)
    {
      DPRINT1("Drive is BUSY for too long\n");
      return(SRB_STATUS_BUSY);
    }

  /* Select the desired drive */
  IDEWriteDriveHead(DeviceExtension->CommandPortBase,
		    IDE_DH_FIXED | (Srb->TargetId ? IDE_DH_DRV1 : 0));
  ScsiPortStallExecution(10);

  /* Issue command to drive */
  AtapiExecuteCommand(DeviceExtension, IDE_CMD_GET_MEDIA_STATUS, AtapiNoDataInterrupt);

  /* Wait for controller ready */
  for (Retries = 0; Retries < IDE_MAX_WRITE_RETRIES; Retries++)
    {
      Status = IDEReadStatus(DeviceExtension->CommandPortBase);
      if (!(Status & IDE_SR_BUSY) || (Status & IDE_SR_ERR))
	{
	  break;
	}
      ScsiPortStallExecution(10);
    }
  if (Retries >= IDE_MAX_WRITE_RETRIES)
    {
      DPRINT1("Drive is BUSY for too long after sending write command\n");
      DeviceExtension->Handler = NULL;
      return(SRB_STATUS_BUSY);
    }

  if (Status & IDE_SR_ERR)
    {
      Error = IDEReadError(DeviceExtension->CommandPortBase);
      if (Error == IDE_ER_UNC)
	{
CHECKPOINT1;
	  /* Handle write protection 'error' */
	  Srb->SrbStatus = SRB_STATUS_SUCCESS;
          DeviceExtension->Handler = NULL;
	  return(SRB_STATUS_SUCCESS);
	}
      else
	{
CHECKPOINT1;
	  /* Indicate expecting an interrupt. */
	  return(SRB_STATUS_PENDING);
	}
    }

  DeviceExtension->Handler = NULL;

  DPRINT1("AtapiTestUnitReady() done!\n");

  Srb->SrbStatus = SRB_STATUS_SUCCESS;
  return(SRB_STATUS_SUCCESS);
}


static UCHAR
AtapiErrorToScsi(PVOID DeviceExtension,
		 PSCSI_REQUEST_BLOCK Srb)
{
  PATAPI_MINIPORT_EXTENSION DevExt;
  ULONG CommandPortBase;
  ULONG ControlPortBase;
  UCHAR ErrorReg;
  UCHAR ScsiStatus;
  UCHAR SrbStatus;

  DPRINT("AtapiErrorToScsi() called\n");

  DevExt = (PATAPI_MINIPORT_EXTENSION)DeviceExtension;

  CommandPortBase = DevExt->CommandPortBase;
  ControlPortBase = DevExt->ControlPortBase;

  ErrorReg = IDEReadError(CommandPortBase);

  if (DevExt->DeviceFlags[Srb->TargetId] & DEVICE_ATAPI)
    {
      switch (ErrorReg >> 4)
	{
	  case SCSI_SENSE_NO_SENSE:
	    DPRINT("ATAPI error: SCSI_SENSE_NO_SENSE\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_RECOVERED_ERROR:
	    DPRINT("ATAPI error: SCSI_SENSE_RECOVERED_SENSE\n");
	    ScsiStatus = 0;
	    SrbStatus = SRB_STATUS_SUCCESS;
	    break;

	  case SCSI_SENSE_NOT_READY:
	    DPRINT("ATAPI error: SCSI_SENSE_NOT_READY\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_MEDIUM_ERROR:
	    DPRINT("ATAPI error: SCSI_SENSE_MEDIUM_ERROR\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_HARDWARE_ERROR:
	    DPRINT("ATAPI error: SCSI_SENSE_HARDWARE_ERROR\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_ILLEGAL_REQUEST:
	    DPRINT("ATAPI error: SCSI_SENSE_ILLEGAL_REQUEST\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_UNIT_ATTENTION:
	    DPRINT("ATAPI error: SCSI_SENSE_UNIT_ATTENTION\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_DATA_PROTECT:
	    DPRINT("ATAPI error: SCSI_SENSE_DATA_PROTECT\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_BLANK_CHECK:
	    DPRINT("ATAPI error: SCSI_SENSE_BLANK_CHECK\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  case SCSI_SENSE_ABORTED_COMMAND:
	    DPRINT("ATAPI error: SCSI_SENSE_ABORTED_COMMAND\n");
	    ScsiStatus = SCSISTAT_CHECK_CONDITION;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;

	  default:
	    DPRINT("ATAPI error: Invalid sense key\n");
	    ScsiStatus = 0;
	    SrbStatus = SRB_STATUS_ERROR;
	    break;
	}
    }
  else
    {
      DPRINT1("IDE error: %02x\n", ErrorReg);

      ScsiStatus = 0;
      SrbStatus = SRB_STATUS_ERROR;

#if 0
      UCHAR SectorCount, SectorNum, CylinderLow, CylinderHigh;
      UCHAR DriveHead;

      CylinderLow = IDEReadCylinderLow(CommandPortBase);
      CylinderHigh = IDEReadCylinderHigh(CommandPortBase);
      DriveHead = IDEReadDriveHead(CommandPortBase);
      SectorCount = IDEReadSectorCount(CommandPortBase);
      SectorNum = IDEReadSectorNum(CommandPortBase);

      DPRINT1("IDE Error: ERR:%02x CYLLO:%02x CYLHI:%02x SCNT:%02x SNUM:%02x\n",
	      ErrorReg,
	      CylinderLow,
	      CylinderHigh,
	      SectorCount,
	      SectorNum);
#endif
    }



  Srb->ScsiStatus = ScsiStatus;

  DPRINT("AtapiErrorToScsi() done\n");

  return(SrbStatus);
}


static VOID
AtapiScsiSrbToAtapi (PSCSI_REQUEST_BLOCK Srb)
{
  DPRINT("AtapiConvertScsiToAtapi() called\n");

  Srb->CdbLength = 12;

  switch (Srb->Cdb[0])
    {
      case SCSIOP_FORMAT_UNIT:
	Srb->Cdb[0] = ATAPI_FORMAT_UNIT;
	break;

      case SCSIOP_MODE_SELECT:
	  {
	    PATAPI_MODE_SELECT12 AtapiModeSelect;
	    UCHAR Length;

	    AtapiModeSelect = (PATAPI_MODE_SELECT12)Srb->Cdb;
	    Length = ((PCDB)Srb->Cdb)->MODE_SELECT.ParameterListLength;

	    RtlZeroMemory (Srb->Cdb,
			   MAXIMUM_CDB_SIZE);
	    AtapiModeSelect->OperationCode = ATAPI_MODE_SELECT;
	    AtapiModeSelect->PFBit = 1;
	    AtapiModeSelect->ParameterListLengthMsb = 0;
	    AtapiModeSelect->ParameterListLengthLsb = Length;
	  }
	break;
    }
}

static VOID FASTCALL
AtapiCompleteRequest(PATAPI_MINIPORT_EXTENSION DevExt, 
		     UCHAR SrbStatus)
{
  PSCSI_REQUEST_BLOCK Srb;
  Srb = DevExt->CurrentSrb;

  DPRINT("AtapiCompleteRequest(DevExt %x, SrbStatus %x)\n", DevExt, SrbStatus);

  Srb->SrbStatus = SrbStatus;
  if (SrbStatus == SRB_STATUS_ERROR)
    {
      Srb->SrbStatus = AtapiErrorToScsi((PVOID)DevExt, Srb);
    }
  else if (SrbStatus == SRB_STATUS_DATA_OVERRUN)
    {
      Srb->DataTransferLength -= DevExt->DataTransferLength;
    }
      
  DevExt->Handler = NULL;
  ScsiPortNotification(RequestComplete, (PVOID)DevExt, Srb);
  ScsiPortNotification(NextRequest, (PVOID)DevExt, NULL);
}

#ifdef ENABLE_DMA
static BOOLEAN FASTCALL
AtapiDmaPacketInterrupt(PATAPI_MINIPORT_EXTENSION DevExt)
{
  BYTE SrbStatus;
  BYTE DmaCommand;
  BYTE DmaStatus;
  BYTE Status;
  BYTE Error;
  BYTE SensKey;

  DPRINT("AtapiPacketDmaInterrupt\n");

  DevExt->UseDma = FALSE;

  /* stop DMA */
  DmaCommand = IDEReadDMACommand(DevExt->BusMasterRegisterBase);
  IDEWriteDMACommand(DevExt->BusMasterRegisterBase, DmaCommand & 0xfe);
  /* get DMA status */
  DmaStatus = IDEReadDMAStatus(DevExt->BusMasterRegisterBase);
  /* clear the INTR & ERROR bits */
  IDEWriteDMAStatus(DevExt->BusMasterRegisterBase, DmaStatus | 0x06);

  Status = IDEReadStatus(DevExt->CommandPortBase);
  DPRINT("DriveStatus: %x\n", Status);

  if (Status & (IDE_SR_BUSY|IDE_SR_ERR))
    {
      if (Status & IDE_SR_ERR)
        {
	  Error = IDEReadError(DevExt->CommandPortBase);
	  SensKey = Error >> 4;
	  DPRINT("DriveError: %x, SenseKey: %x\n", Error, SensKey);
	}
      SrbStatus = SRB_STATUS_ERROR;
    }
  else
    {
      if ((DmaStatus & 0x07) != 0x04)
        {
          DPRINT("DmaStatus: %02x\n", DmaStatus);
          SrbStatus = SRB_STATUS_ERROR;
	}
      else
        {
	  SrbStatus = STATUS_SUCCESS;
	}
    }
  AtapiCompleteRequest(DevExt, SrbStatus);
  DPRINT("AtapiDmaPacketInterrupt() done\n");
  return TRUE;
}
#endif

static BOOLEAN FASTCALL 
AtapiPacketInterrupt(PATAPI_MINIPORT_EXTENSION DevExt)
{
  PSCSI_REQUEST_BLOCK Srb;
  BYTE Status;
  BYTE IntReason;
  ULONG TransferSize;
  ULONG JunkSize = 0;
  BOOL IsLastBlock;
  PBYTE TargetAddress;
  ULONG Retries;
  BYTE SrbStatus;
  BYTE Error;
  BYTE SensKey;

  DPRINT("AtapiPacketInterrupt()\n");

  Srb = DevExt->CurrentSrb;

  Status = IDEReadStatus(DevExt->CommandPortBase);
  DPRINT("DriveStatus: %x\n", Status);

  if (Status & (IDE_SR_BUSY|IDE_SR_ERR))
    {
      if (Status & IDE_SR_ERR)
        {
	  Error = IDEReadError(DevExt->CommandPortBase);
	  SensKey = Error >> 4;
	  DPRINT("DriveError: %x, SenseKey: %x\n", Error, SensKey);
	}

      AtapiCompleteRequest(DevExt, SRB_STATUS_ERROR);
      DPRINT("AtapiPacketInterrupt() done\n");
      return TRUE;
    }
  
  IntReason = IDEReadSectorCount(DevExt->CommandPortBase);
  TransferSize = IDEReadCylinderLow(DevExt->CommandPortBase);
  TransferSize += IDEReadCylinderHigh(DevExt->CommandPortBase) << 8;

  if (!(Status & IDE_SR_DRQ))
    {
      if (DevExt->DataTransferLength > 0)
        {
	  DPRINT1("AtapiPacketInterrupt: data underrun (%d bytes), command was %02x\n", 
	          DevExt->DataTransferLength, Srb->Cdb[0]);
	  SrbStatus = SRB_STATUS_DATA_OVERRUN;
	}
      else
        {
	  SrbStatus = SRB_STATUS_SUCCESS;
	}
      AtapiCompleteRequest(DevExt, SrbStatus);
      DPRINT("AtapiPacketInterrupt() done\n");
      return TRUE;
    }

  TargetAddress = DevExt->DataBuffer;

  if (Srb->SrbFlags & SRB_FLAGS_DATA_IN)
    {
      DPRINT("read data\n");
      if (DevExt->DataTransferLength <= TransferSize)
        {
	  JunkSize = TransferSize - DevExt->DataTransferLength;
	  TransferSize = DevExt->DataTransferLength;

	  DevExt->DataTransferLength = 0;
	  IsLastBlock = TRUE;
	}
      else
	{
	  DevExt->DataTransferLength -= TransferSize;
	  IsLastBlock = FALSE;
	}

      DPRINT("TargetAddress %x, TransferSize %d\n", TargetAddress, TransferSize);

      DevExt->DataBuffer += TransferSize;

      IDEReadBlock(DevExt->CommandPortBase, TargetAddress, TransferSize);

      /* check DRQ */
      if (IsLastBlock)
        {
	  /* Read remaining junk from device */
	  while (JunkSize > 0)
	    {
	      IDEReadWord(DevExt->CommandPortBase);
	      JunkSize -= 2;
	    }

	  for (Retries = 0; Retries < IDE_MAX_BUSY_RETRIES && (IDEReadStatus(DevExt->CommandPortBase) & IDE_SR_BUSY); Retries++)
	    {
	      ScsiPortStallExecution(10);
	    }

	  /* Check for data overrun */
	  while (IDEReadStatus(DevExt->CommandPortBase) & IDE_SR_DRQ)
	    {
	      DPRINT1("AtapiInterrupt(): reading overrun data!\n");
	      IDEReadWord(DevExt->CommandPortBase);
	    }
	}

      SrbStatus = SRB_STATUS_SUCCESS;
    }
  else if (Srb->SrbFlags & SRB_FLAGS_DATA_OUT)
    {
      DPRINT("write data\n");
      if (DevExt->DataTransferLength < TransferSize)
        {
	  TransferSize = DevExt->DataTransferLength;
	}

      TargetAddress = DevExt->DataBuffer;

      DPRINT("TargetAddress %x, TransferSize %x\n", TargetAddress, TransferSize);

      DevExt->DataBuffer += TransferSize;
      DevExt->DataTransferLength -= TransferSize;

      /* Write the sector */
      IDEWriteBlock(DevExt->CommandPortBase, TargetAddress, TransferSize);
      SrbStatus = SRB_STATUS_SUCCESS;
      IsLastBlock = FALSE;
    }
  else
    {
      DPRINT("Unspecified transfer direction!\n");
      SrbStatus = SRB_STATUS_SUCCESS;
      IsLastBlock = TRUE;
    }
  if (IsLastBlock)
    {
      AtapiCompleteRequest(DevExt, SrbStatus);
    }
  DPRINT("AtapiPacketInterrupt() done\n");
  return TRUE;
}

static BOOLEAN FASTCALL 
AtapiNoDataInterrupt(PATAPI_MINIPORT_EXTENSION DevExt)
{
  BYTE Status;

  DPRINT("AtapiNoDataInterrupt()\n");

  Status = IDEReadStatus(DevExt->CommandPortBase);
  AtapiCompleteRequest(DevExt,
                       (Status & (IDE_SR_DRDY|IDE_SR_BUSY|IDE_SR_ERR|IDE_SR_DRQ)) == IDE_SR_DRDY ? SRB_STATUS_SUCCESS : SRB_STATUS_ERROR);

  DPRINT("AtapiNoDatanterrupt() done!\n");
  return TRUE;
}

#ifdef ENABLE_DMA
static BOOLEAN FASTCALL
AtapiDmaInterrupt(PATAPI_MINIPORT_EXTENSION DevExt)
{
  BYTE DmaCommand;
  BYTE DmaStatus;
  BYTE Status;

  DPRINT("AtapiDmaInterrupt()\n");

  DevExt->UseDma = FALSE;
  /* stop DMA */
  DmaCommand = IDEReadDMACommand(DevExt->BusMasterRegisterBase);
  IDEWriteDMACommand(DevExt->BusMasterRegisterBase, DmaCommand & 0xfe);
  /* get DMA status */
  DmaStatus = IDEReadDMAStatus(DevExt->BusMasterRegisterBase);
  /* clear the INTR & ERROR bits */
  IDEWriteDMAStatus(DevExt->BusMasterRegisterBase, DmaStatus | 0x06);

  /* read the drive status */
  Status = IDEReadStatus(DevExt->CommandPortBase);
  if ((Status & (IDE_SR_DRDY|IDE_SR_BUSY|IDE_SR_ERR|IDE_SR_WERR|IDE_SR_DRQ)) == IDE_SR_DRDY &&
      (DmaStatus & 0x07) == 4)
    {
      AtapiCompleteRequest(DevExt, SRB_STATUS_SUCCESS);
      DPRINT("AtapiDmaInterrupt() done\n");
      return TRUE;
    }
  DPRINT1("Status %x\n", Status);
  DPRINT1("%x\n", DmaStatus);
  AtapiCompleteRequest(DevExt, SRB_STATUS_ERROR);
  DPRINT1("AtapiDmaReadInterrupt() done\n");
  return TRUE;
}  
#endif

static BOOLEAN FASTCALL
AtapiReadInterrupt(PATAPI_MINIPORT_EXTENSION DevExt)
{
  PSCSI_REQUEST_BLOCK Srb;
  UCHAR DeviceStatus;
  BOOLEAN IsLastBlock;
  PUCHAR TargetAddress;
  ULONG TransferSize;

  DPRINT("AtapiReadInterrupt() called!\n");

  Srb = DevExt->CurrentSrb;

  DeviceStatus = IDEReadStatus(DevExt->CommandPortBase);
  if ((DeviceStatus & (IDE_SR_DRQ|IDE_SR_BUSY|IDE_SR_ERR)) != IDE_SR_DRQ)
    {
      if (DeviceStatus & (IDE_SR_ERR|IDE_SR_DRQ))
        {
	  AtapiCompleteRequest(DevExt, SRB_STATUS_ERROR);
          DPRINT("AtapiReadInterrupt() done!\n");
	  return TRUE;
        }
      DPRINT("AtapiReadInterrupt() done!\n");
      return FALSE;
    }

  DPRINT("CommandPortBase: %lx  ControlPortBase: %lx\n", DevExt->CommandPortBase, DevExt->ControlPortBase);

  /* Update controller/device state variables */
  TargetAddress = DevExt->DataBuffer;
  TransferSize = DevExt->TransferSize[Srb->TargetId];

  DPRINT("TransferLength: %lu\n", Srb->DataTransferLength);
  DPRINT("TransferSize: %lu\n", TransferSize);

  if (DevExt->DataTransferLength <= TransferSize)
    {
       TransferSize = DevExt->DataTransferLength;
       DevExt->DataTransferLength = 0;
       IsLastBlock = TRUE;
    }
  else
    {
      DevExt->DataTransferLength -= TransferSize;
      IsLastBlock = FALSE;
    }
  DevExt->DataBuffer += TransferSize;
  DPRINT("IsLastBlock == %s\n", (IsLastBlock) ? "TRUE" : "FALSE");

  /* Copy the block of data */
  if (DevExt->DeviceFlags[Srb->TargetId] & DEVICE_DWORD_IO)
    {
      IDEReadBlock32(DevExt->CommandPortBase, TargetAddress, TransferSize);
    }
  else
    {
      IDEReadBlock(DevExt->CommandPortBase, TargetAddress, TransferSize);
    }

  if (IsLastBlock)
    {
      AtapiCompleteRequest(DevExt, SRB_STATUS_SUCCESS);
    }

  DPRINT("AtapiReadInterrupt() done!\n");

  return(TRUE);
}

static BOOLEAN FASTCALL
AtapiWriteInterrupt(IN PATAPI_MINIPORT_EXTENSION DevExt)
{
  PSCSI_REQUEST_BLOCK Srb;
  UCHAR DeviceStatus;
  BOOLEAN IsLastBlock;
  PUCHAR TargetAddress;
  ULONG TransferSize;

  DPRINT("AtapiWriteInterrupt() called!\n");

  DeviceStatus = IDEReadStatus(DevExt->CommandPortBase);
  if ((DeviceStatus & (IDE_SR_DRDY|IDE_SR_BUSY|IDE_SR_ERR|IDE_SR_WERR)) != IDE_SR_DRDY)
    {
      if (DeviceStatus & (IDE_SR_DRDY|IDE_SR_ERR|IDE_SR_WERR))
        {
	  AtapiCompleteRequest(DevExt, SRB_STATUS_ERROR);
          DPRINT("AtapiWriteInterrupt() done!\n");
	  return TRUE;
        }
      DPRINT("AtapiWriteInterrupt() done!\n");
      return FALSE;
    }
  else
    {
     Srb = DevExt->CurrentSrb;
     TransferSize = DevExt->TransferSize[Srb->TargetId];
      if (DevExt->DataTransferLength < TransferSize)
        {
	  TransferSize = DevExt->DataTransferLength;
	}
      if (TransferSize > 0 && (DeviceStatus & IDE_SR_DRQ))
        {
	  IsLastBlock = FALSE;
	  TargetAddress = DevExt->DataBuffer;
          DevExt->DataBuffer += TransferSize;
	  DevExt->DataTransferLength -= TransferSize;

          DPRINT("TransferLength: %lu\n", Srb->DataTransferLength);
          DPRINT("TransferSize: %lu\n", TransferSize);
	  /* Write the sector */
	  if (DevExt->DeviceFlags[Srb->TargetId] & DEVICE_DWORD_IO)
	    {
	      IDEWriteBlock32(DevExt->CommandPortBase, TargetAddress, TransferSize);
	    }
	  else
	    {
	      IDEWriteBlock(DevExt->CommandPortBase, TargetAddress, TransferSize);
	    }
	}
      else if (DeviceStatus & IDE_SR_DRQ)
        {
          DPRINT("AtapiWriteInterrupt(): data overrun error!\n");
          IsLastBlock = TRUE;
	}
      else if (TransferSize > 0 && !(DeviceStatus & IDE_SR_DRQ))
        {
	  DPRINT1("%d !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n", TransferSize);
	  IsLastBlock = TRUE;
        }
      else
        {
	  IsLastBlock = TRUE;
	}
      if (IsLastBlock)
        {
          AtapiCompleteRequest(DevExt, SRB_STATUS_SUCCESS);
        }
      DPRINT("AtapiWriteInterrupt() done!\n");
      return TRUE;
    }
}

static VOID
AtapiExecuteCommand(PATAPI_MINIPORT_EXTENSION DevExt, 
		    BYTE command, 
		    BOOLEAN FASTCALL (*Handler)(PATAPI_MINIPORT_EXTENSION))
{
   11600:	55                   	push   %ebp
   11601:	89 e5                	mov    %esp,%ebp
   11603:	56                   	push   %esi
   11604:	53                   	push   %ebx
   11605:	89 c3                	mov    %eax,%ebx
  if (DevExt->Handler != NULL)
   11607:	8b 80 28 04 00 00    	mov    0x428(%eax),%eax
   1160d:	89 d6                	mov    %edx,%esi
   1160f:	85 c0                	test   %eax,%eax
   11611:	75 31                	jne    11644 <_AtapiExecuteCommand+0x44>
    {
      DPRINT1("DevExt->Handler is already set!!\n");
    }
  DevExt->Handler = Handler;
   11613:	8b 45 08             	mov    0x8(%ebp),%eax
   11616:	89 83 28 04 00 00    	mov    %eax,0x428(%ebx)
  IDEWriteCommand(DevExt->CommandPortBase, command);
   1161c:	50                   	push   %eax
   1161d:	50                   	push   %eax
   1161e:	89 f0                	mov    %esi,%eax
   11620:	25 ff 00 00 00       	and    $0xff,%eax
   11625:	50                   	push   %eax
   11626:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   1162c:	83 c0 07             	add    $0x7,%eax
   1162f:	50                   	push   %eax
   11630:	e8 db 25 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
  ScsiPortStallExecution(1);
   11635:	50                   	push   %eax
   11636:	6a 01                	push   $0x1
   11638:	e8 e3 25 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   1163d:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11640:	5b                   	pop    %ebx
   11641:	5e                   	pop    %esi
   11642:	5d                   	pop    %ebp
   11643:	c3                   	ret    
   11644:	50                   	push   %eax
   11645:	68 e0 0b 00 00       	push   $0xbe0
   1164a:	68 08 40 01 00       	push   $0x14008
   1164f:	68 10 40 01 00       	push   $0x14010
   11654:	e8 87 26 00 00       	call   13ce0 <_DbgPrint>
   11659:	c7 04 24 5c 40 01 00 	movl   $0x1405c,(%esp)
   11660:	e8 7b 26 00 00       	call   13ce0 <_DbgPrint>
   11665:	83 c4 10             	add    $0x10,%esp
   11668:	eb a9                	jmp    11613 <_AtapiExecuteCommand+0x13>
   1166a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

00011670 <_AtapiIdentifyDevice>:
   11670:	55                   	push   %ebp
   11671:	89 e5                	mov    %esp,%ebp
   11673:	57                   	push   %edi
   11674:	56                   	push   %esi
   11675:	53                   	push   %ebx
   11676:	81 ec 2c 02 00 00    	sub    $0x22c,%esp
   1167c:	89 85 e4 fd ff ff    	mov    %eax,0xfffffde4(%ebp)
   11682:	83 7d 08 01          	cmpl   $0x1,0x8(%ebp)
   11686:	8a 45 0c             	mov    0xc(%ebp),%al
   11689:	89 95 e0 fd ff ff    	mov    %edx,0xfffffde0(%ebp)
   1168f:	88 85 df fd ff ff    	mov    %al,0xfffffddf(%ebp)
   11695:	8b 95 e4 fd ff ff    	mov    0xfffffde4(%ebp),%edx
   1169b:	19 c0                	sbb    %eax,%eax
   1169d:	c7 85 d4 fd ff ff 00 	movl   $0x0,0xfffffdd4(%ebp)
   116a4:	00 00 00 
   116a7:	83 f0 ff             	xor    $0xffffffff,%eax
   116aa:	8d 7a 07             	lea    0x7(%edx),%edi
   116ad:	88 c3                	mov    %al,%bl
   116af:	c6 85 d3 fd ff ff 00 	movb   $0x0,0xfffffdd3(%ebp)
   116b6:	83 e3 10             	and    $0x10,%ebx
   116b9:	80 bd df fd ff ff 01 	cmpb   $0x1,0xfffffddf(%ebp)
   116c0:	19 c0                	sbb    %eax,%eax
   116c2:	31 f6                	xor    %esi,%esi
   116c4:	83 e0 4b             	and    $0x4b,%eax
   116c7:	8d 48 a1             	lea    0xffffffa1(%eax),%ecx
   116ca:	8b 45 10             	mov    0x10(%ebp),%eax
   116cd:	88 8d de fd ff ff    	mov    %cl,0xfffffdde(%ebp)
   116d3:	89 85 d8 fd ff ff    	mov    %eax,0xfffffdd8(%ebp)
   116d9:	eb 1b                	jmp    116f6 <_AtapiIdentifyDevice+0x86>
   116db:	90                   	nop    
   116dc:	8d 74 26 00          	lea    0x0(%esi),%esi
   116e0:	83 ec 0c             	sub    $0xc,%esp
   116e3:	46                   	inc    %esi
   116e4:	6a 0a                	push   $0xa
   116e6:	e8 35 25 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   116eb:	83 c4 0c             	add    $0xc,%esp
   116ee:	81 fe 4f c3 00 00    	cmp    $0xc34f,%esi
   116f4:	77 18                	ja     1170e <_AtapiIdentifyDevice+0x9e>
   116f6:	83 ec 0c             	sub    $0xc,%esp
   116f9:	57                   	push   %edi
   116fa:	e8 01 25 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   116ff:	83 c4 0c             	add    $0xc,%esp
   11702:	84 c0                	test   %al,%al
   11704:	78 da                	js     116e0 <_AtapiIdentifyDevice+0x70>
   11706:	81 fe 4f c3 00 00    	cmp    $0xc34f,%esi
   1170c:	76 14                	jbe    11722 <_AtapiIdentifyDevice+0xb2>
   1170e:	31 d2                	xor    %edx,%edx
   11710:	31 c0                	xor    %eax,%eax
   11712:	85 d2                	test   %edx,%edx
   11714:	0f 85 2e 01 00 00    	jne    11848 <_AtapiIdentifyDevice+0x1d8>
   1171a:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1171d:	5b                   	pop    %ebx
   1171e:	5e                   	pop    %esi
   1171f:	5f                   	pop    %edi
   11720:	5d                   	pop    %ebp
   11721:	c3                   	ret    
   11722:	83 cb a0             	or     $0xffffffa0,%ebx
   11725:	81 e3 ff 00 00 00    	and    $0xff,%ebx
   1172b:	50                   	push   %eax
   1172c:	50                   	push   %eax
   1172d:	53                   	push   %ebx
   1172e:	8b b5 e4 fd ff ff    	mov    0xfffffde4(%ebp),%esi
   11734:	83 c6 06             	add    $0x6,%esi
   11737:	56                   	push   %esi
   11738:	e8 d3 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1173d:	50                   	push   %eax
   1173e:	68 f4 01 00 00       	push   $0x1f4
   11743:	e8 d8 24 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11748:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
   1174f:	8b 85 e0 fd ff ff    	mov    0xfffffde0(%ebp),%eax
   11755:	50                   	push   %eax
   11756:	e8 b5 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1175b:	50                   	push   %eax
   1175c:	68 f4 01 00 00       	push   $0x1f4
   11761:	e8 ba 24 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11766:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
   1176d:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   11773:	40                   	inc    %eax
   11774:	50                   	push   %eax
   11775:	e8 96 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1177a:	6a 01                	push   $0x1
   1177c:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   11782:	83 c0 02             	add    $0x2,%eax
   11785:	50                   	push   %eax
   11786:	e8 85 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1178b:	6a 00                	push   $0x0
   1178d:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   11793:	83 c0 03             	add    $0x3,%eax
   11796:	50                   	push   %eax
   11797:	e8 74 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1179c:	6a 00                	push   $0x0
   1179e:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   117a4:	83 c0 05             	add    $0x5,%eax
   117a7:	50                   	push   %eax
   117a8:	e8 63 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   117ad:	6a 00                	push   $0x0
   117af:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   117b5:	83 c0 04             	add    $0x4,%eax
   117b8:	50                   	push   %eax
   117b9:	e8 52 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   117be:	53                   	push   %ebx
   117bf:	56                   	push   %esi
   117c0:	e8 4b 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   117c5:	31 c0                	xor    %eax,%eax
   117c7:	8a 85 de fd ff ff    	mov    0xfffffdde(%ebp),%al
   117cd:	31 f6                	xor    %esi,%esi
   117cf:	50                   	push   %eax
   117d0:	57                   	push   %edi
   117d1:	e8 3a 24 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   117d6:	50                   	push   %eax
   117d7:	6a 32                	push   $0x32
   117d9:	e8 42 24 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   117de:	83 c4 0c             	add    $0xc,%esp
   117e1:	eb 16                	jmp    117f9 <_AtapiIdentifyDevice+0x189>
   117e3:	83 ec 0c             	sub    $0xc,%esp
   117e6:	46                   	inc    %esi
   117e7:	6a 0a                	push   $0xa
   117e9:	e8 32 24 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   117ee:	83 c4 0c             	add    $0xc,%esp
   117f1:	81 fe 9f 86 01 00    	cmp    $0x1869f,%esi
   117f7:	77 29                	ja     11822 <_AtapiIdentifyDevice+0x1b2>
   117f9:	83 ec 0c             	sub    $0xc,%esp
   117fc:	57                   	push   %edi
   117fd:	e8 fe 23 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11802:	83 c4 0c             	add    $0xc,%esp
   11805:	84 c0                	test   %al,%al
   11807:	78 da                	js     117e3 <_AtapiIdentifyDevice+0x173>
   11809:	25 ff 00 00 00       	and    $0xff,%eax
   1180e:	a8 01                	test   $0x1,%al
   11810:	75 10                	jne    11822 <_AtapiIdentifyDevice+0x1b2>
   11812:	a8 08                	test   $0x8,%al
   11814:	74 0c                	je     11822 <_AtapiIdentifyDevice+0x1b2>
   11816:	81 fe 9f 86 01 00    	cmp    $0x1869f,%esi
   1181c:	0f 86 cc 00 00 00    	jbe    118ee <_AtapiIdentifyDevice+0x27e>
   11822:	56                   	push   %esi
   11823:	56                   	push   %esi
   11824:	6a 00                	push   $0x0
   11826:	8b 9d e0 fd ff ff    	mov    0xfffffde0(%ebp),%ebx
   1182c:	53                   	push   %ebx
   1182d:	e8 de 23 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11832:	51                   	push   %ecx
   11833:	6a 32                	push   $0x32
   11835:	e8 e6 23 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   1183a:	57                   	push   %edi
   1183b:	e8 c0 23 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11840:	83 c4 0c             	add    $0xc,%esp
   11843:	e9 c6 fe ff ff       	jmp    1170e <_AtapiIdentifyDevice+0x9e>
   11848:	6a 14                	push   $0x14
   1184a:	8b 45 10             	mov    0x10(%ebp),%eax
   1184d:	83 c0 14             	add    $0x14,%eax
   11850:	50                   	push   %eax
   11851:	e8 aa f7 ff ff       	call   11000 <_IDESwapBytePairs>
   11856:	6a 08                	push   $0x8
   11858:	8b 45 10             	mov    0x10(%ebp),%eax
   1185b:	83 c0 2e             	add    $0x2e,%eax
   1185e:	50                   	push   %eax
   1185f:	e8 9c f7 ff ff       	call   11000 <_IDESwapBytePairs>
   11864:	6a 28                	push   $0x28
   11866:	8b 45 10             	mov    0x10(%ebp),%eax
   11869:	83 c0 36             	add    $0x36,%eax
   1186c:	50                   	push   %eax
   1186d:	e8 8e f7 ff ff       	call   11000 <_IDESwapBytePairs>
   11872:	8b 4d 10             	mov    0x10(%ebp),%ecx
   11875:	83 c4 18             	add    $0x18,%esp
   11878:	f6 41 6a 04          	testb  $0x4,0x6a(%ecx)
   1187c:	75 2d                	jne    118ab <_AtapiIdentifyDevice+0x23b>
   1187e:	80 bd df fd ff ff 00 	cmpb   $0x0,0xfffffddf(%ebp)
   11885:	0f 85 df 00 00 00    	jne    1196a <_AtapiIdentifyDevice+0x2fa>
   1188b:	8b 55 10             	mov    0x10(%ebp),%edx
   1188e:	f6 42 63 02          	testb  $0x2,0x63(%edx)
   11892:	0f 84 d2 00 00 00    	je     1196a <_AtapiIdentifyDevice+0x2fa>
   11898:	66 c7 42 0a 00 02    	movw   $0x200,0xa(%edx)
   1189e:	b8 01 00 00 00       	mov    $0x1,%eax
   118a3:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   118a6:	5b                   	pop    %ebx
   118a7:	5e                   	pop    %esi
   118a8:	5f                   	pop    %edi
   118a9:	5d                   	pop    %ebp
   118aa:	c3                   	ret    
   118ab:	66 8b 81 b0 00 00 00 	mov    0xb0(%ecx),%ax
   118b2:	80 b9 b1 00 00 00 00 	cmpb   $0x0,0xb1(%ecx)
   118b9:	74 08                	je     118c3 <_AtapiIdentifyDevice+0x253>
   118bb:	84 c0                	test   %al,%al
   118bd:	0f 85 15 01 00 00    	jne    119d8 <_AtapiIdentifyDevice+0x368>
   118c3:	8b 45 10             	mov    0x10(%ebp),%eax
   118c6:	66 8b 50 7e          	mov    0x7e(%eax),%dx
   118ca:	0f b6 c6             	movzbl %dh,%eax
   118cd:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   118d3:	21 d0                	and    %edx,%eax
   118d5:	a8 07                	test   $0x7,%al
   118d7:	74 a5                	je     1187e <_AtapiIdentifyDevice+0x20e>
   118d9:	b9 02 00 00 00       	mov    $0x2,%ecx
   118de:	f6 c2 04             	test   $0x4,%dl
   118e1:	eb 07                	jmp    118ea <_AtapiIdentifyDevice+0x27a>
   118e3:	49                   	dec    %ecx
   118e4:	89 d0                	mov    %edx,%eax
   118e6:	d3 f8                	sar    %cl,%eax
   118e8:	a8 01                	test   $0x1,%al
   118ea:	74 f7                	je     118e3 <_AtapiIdentifyDevice+0x273>
   118ec:	eb 90                	jmp    1187e <_AtapiIdentifyDevice+0x20e>
   118ee:	80 bd d3 fd ff ff 00 	cmpb   $0x0,0xfffffdd3(%ebp)
   118f5:	0f 84 ad 00 00 00    	je     119a8 <_AtapiIdentifyDevice+0x338>
   118fb:	50                   	push   %eax
   118fc:	8d 85 e8 fd ff ff    	lea    0xfffffde8(%ebp),%eax
   11902:	68 00 01 00 00       	push   $0x100
   11907:	50                   	push   %eax
   11908:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   1190e:	50                   	push   %eax
   1190f:	e8 1c 23 00 00       	call   13c30 <_ScsiPortReadPortBufferUshort@12>
   11914:	5e                   	pop    %esi
   11915:	8b 9d d4 fd ff ff    	mov    0xfffffdd4(%ebp),%ebx
   1191b:	31 f6                	xor    %esi,%esi
   1191d:	43                   	inc    %ebx
   1191e:	89 9d d4 fd ff ff    	mov    %ebx,0xfffffdd4(%ebp)
   11924:	eb 09                	jmp    1192f <_AtapiIdentifyDevice+0x2bf>
   11926:	46                   	inc    %esi
   11927:	81 fe 4f c3 00 00    	cmp    $0xc34f,%esi
   1192d:	77 bf                	ja     118ee <_AtapiIdentifyDevice+0x27e>
   1192f:	83 ec 0c             	sub    $0xc,%esp
   11932:	57                   	push   %edi
   11933:	e8 c8 22 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11938:	83 c4 0c             	add    $0xc,%esp
   1193b:	84 c0                	test   %al,%al
   1193d:	78 e7                	js     11926 <_AtapiIdentifyDevice+0x2b6>
   1193f:	25 ff 00 00 00       	and    $0xff,%eax
   11944:	a8 01                	test   $0x1,%al
   11946:	0f 85 d6 fe ff ff    	jne    11822 <_AtapiIdentifyDevice+0x1b2>
   1194c:	a8 08                	test   $0x8,%al
   1194e:	0f 84 c8 00 00 00    	je     11a1c <_AtapiIdentifyDevice+0x3ac>
   11954:	b8 01 00 00 00       	mov    $0x1,%eax
   11959:	3b 85 d4 fd ff ff    	cmp    0xfffffdd4(%ebp),%eax
   1195f:	77 8d                	ja     118ee <_AtapiIdentifyDevice+0x27e>
   11961:	c6 85 d3 fd ff ff 01 	movb   $0x1,0xfffffdd3(%ebp)
   11968:	eb 91                	jmp    118fb <_AtapiIdentifyDevice+0x28b>
   1196a:	8b 4d 10             	mov    0x10(%ebp),%ecx
   1196d:	66 8b 41 0a          	mov    0xa(%ecx),%ax
   11971:	66 85 c0             	test   %ax,%ax
   11974:	75 10                	jne    11986 <_AtapiIdentifyDevice+0x316>
   11976:	b8 01 00 00 00       	mov    $0x1,%eax
   1197b:	66 c7 41 0a 00 02    	movw   $0x200,0xa(%ecx)
   11981:	e9 1d ff ff ff       	jmp    118a3 <_AtapiIdentifyDevice+0x233>
   11986:	89 c2                	mov    %eax,%edx
   11988:	b9 0f 00 00 00       	mov    $0xf,%ecx
   1198d:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   11993:	89 d0                	mov    %edx,%eax
   11995:	d3 f8                	sar    %cl,%eax
   11997:	a8 01                	test   $0x1,%al
   11999:	75 69                	jne    11a04 <_AtapiIdentifyDevice+0x394>
   1199b:	49                   	dec    %ecx
   1199c:	79 f5                	jns    11993 <_AtapiIdentifyDevice+0x323>
   1199e:	b8 01 00 00 00       	mov    $0x1,%eax
   119a3:	e9 fb fe ff ff       	jmp    118a3 <_AtapiIdentifyDevice+0x233>
   119a8:	52                   	push   %edx
   119a9:	68 00 01 00 00       	push   $0x100
   119ae:	8b 85 d8 fd ff ff    	mov    0xfffffdd8(%ebp),%eax
   119b4:	50                   	push   %eax
   119b5:	8b 85 e4 fd ff ff    	mov    0xfffffde4(%ebp),%eax
   119bb:	50                   	push   %eax
   119bc:	e8 6f 22 00 00       	call   13c30 <_ScsiPortReadPortBufferUshort@12>
   119c1:	58                   	pop    %eax
   119c2:	8b 85 d8 fd ff ff    	mov    0xfffffdd8(%ebp),%eax
   119c8:	05 00 02 00 00       	add    $0x200,%eax
   119cd:	89 85 d8 fd ff ff    	mov    %eax,0xfffffdd8(%ebp)
   119d3:	e9 3d ff ff ff       	jmp    11915 <_AtapiIdentifyDevice+0x2a5>
   119d8:	89 c2                	mov    %eax,%edx
   119da:	b9 07 00 00 00       	mov    $0x7,%ecx
   119df:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   119e5:	f7 c2 00 80 00 00    	test   $0x8000,%edx
   119eb:	0f 85 8d fe ff ff    	jne    1187e <_AtapiIdentifyDevice+0x20e>
   119f1:	bb 00 01 00 00       	mov    $0x100,%ebx
   119f6:	49                   	dec    %ecx
   119f7:	89 d8                	mov    %ebx,%eax
   119f9:	d3 e0                	shl    %cl,%eax
   119fb:	85 d0                	test   %edx,%eax
   119fd:	74 f7                	je     119f6 <_AtapiIdentifyDevice+0x386>
   119ff:	e9 7a fe ff ff       	jmp    1187e <_AtapiIdentifyDevice+0x20e>
   11a04:	b8 01 00 00 00       	mov    $0x1,%eax
   11a09:	8b 55 10             	mov    0x10(%ebp),%edx
   11a0c:	d3 e0                	shl    %cl,%eax
   11a0e:	66 89 42 0a          	mov    %ax,0xa(%edx)
   11a12:	b8 01 00 00 00       	mov    $0x1,%eax
   11a17:	e9 87 fe ff ff       	jmp    118a3 <_AtapiIdentifyDevice+0x233>
   11a1c:	51                   	push   %ecx
   11a1d:	51                   	push   %ecx
   11a1e:	6a 00                	push   $0x0
   11a20:	8b 95 e0 fd ff ff    	mov    0xfffffde0(%ebp),%edx
   11a26:	52                   	push   %edx
   11a27:	e8 e4 21 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11a2c:	50                   	push   %eax
   11a2d:	6a 32                	push   $0x32
   11a2f:	e8 ec 21 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11a34:	57                   	push   %edi
   11a35:	e8 c6 21 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11a3a:	ba 01 00 00 00       	mov    $0x1,%edx
   11a3f:	83 c4 0c             	add    $0xc,%esp
   11a42:	e9 c9 fc ff ff       	jmp    11710 <_AtapiIdentifyDevice+0xa0>
   11a47:	89 f6                	mov    %esi,%esi
   11a49:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00011a50 <_AtapiFindDevices>:
   11a50:	55                   	push   %ebp
   11a51:	89 e5                	mov    %esp,%ebp
   11a53:	57                   	push   %edi
   11a54:	56                   	push   %esi
   11a55:	53                   	push   %ebx
   11a56:	83 ec 34             	sub    $0x34,%esp
   11a59:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   11a5c:	8b 42 38             	mov    0x38(%edx),%eax
   11a5f:	89 d3                	mov    %edx,%ebx
   11a61:	c6 45 ef 00          	movb   $0x0,0xffffffef(%ebp)
   11a65:	8b 78 04             	mov    0x4(%eax),%edi
   11a68:	57                   	push   %edi
   11a69:	8b 30                	mov    (%eax),%esi
   11a6b:	56                   	push   %esi
   11a6c:	e8 cf 21 00 00       	call   13c40 <_ScsiPortConvertPhysicalAddressToUlong@8>
   11a71:	89 45 e8             	mov    %eax,0xffffffe8(%ebp)
   11a74:	8b 43 38             	mov    0x38(%ebx),%eax
   11a77:	8b 58 14             	mov    0x14(%eax),%ebx
   11a7a:	53                   	push   %ebx
   11a7b:	8b 48 10             	mov    0x10(%eax),%ecx
   11a7e:	51                   	push   %ecx
   11a7f:	e8 bc 21 00 00       	call   13c40 <_ScsiPortConvertPhysicalAddressToUlong@8>
   11a84:	8b 5d e8             	mov    0xffffffe8(%ebp),%ebx
   11a87:	8b 7d f0             	mov    0xfffffff0(%ebp),%edi
   11a8a:	89 45 e4             	mov    %eax,0xffffffe4(%ebp)
   11a8d:	58                   	pop    %eax
   11a8e:	8b 45 e8             	mov    0xffffffe8(%ebp),%eax
   11a91:	5a                   	pop    %edx
   11a92:	83 c0 06             	add    $0x6,%eax
   11a95:	8b 55 e8             	mov    0xffffffe8(%ebp),%edx
   11a98:	83 c2 05             	add    $0x5,%edx
   11a9b:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
   11a9e:	8b 45 e8             	mov    0xffffffe8(%ebp),%eax
   11aa1:	89 55 d8             	mov    %edx,0xffffffd8(%ebp)
   11aa4:	83 c3 04             	add    $0x4,%ebx
   11aa7:	83 c0 07             	add    $0x7,%eax
   11aaa:	8b 55 f0             	mov    0xfffffff0(%ebp),%edx
   11aad:	c7 45 e0 00 00 00 00 	movl   $0x0,0xffffffe0(%ebp)
   11ab4:	89 5d dc             	mov    %ebx,0xffffffdc(%ebp)
   11ab7:	89 45 d0             	mov    %eax,0xffffffd0(%ebp)
   11aba:	81 c7 00 04 00 00    	add    $0x400,%edi
   11ac0:	89 55 c8             	mov    %edx,0xffffffc8(%ebp)
   11ac3:	83 7d e0 01          	cmpl   $0x1,0xffffffe0(%ebp)
   11ac7:	50                   	push   %eax
   11ac8:	50                   	push   %eax
   11ac9:	19 c0                	sbb    %eax,%eax
   11acb:	8b 75 d4             	mov    0xffffffd4(%ebp),%esi
   11ace:	83 e0 f0             	and    $0xfffffff0,%eax
   11ad1:	05 b0 00 00 00       	add    $0xb0,%eax
   11ad6:	50                   	push   %eax
   11ad7:	56                   	push   %esi
   11ad8:	e8 33 21 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11add:	53                   	push   %ebx
   11ade:	68 f4 01 00 00       	push   $0x1f4
   11ae3:	e8 38 21 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11ae8:	8b 4d e4             	mov    0xffffffe4(%ebp),%ecx
   11aeb:	c7 04 24 02 00 00 00 	movl   $0x2,(%esp)
   11af2:	51                   	push   %ecx
   11af3:	e8 18 21 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11af8:	52                   	push   %edx
   11af9:	68 f4 01 00 00       	push   $0x1f4
   11afe:	e8 1d 21 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11b03:	8b 45 d8             	mov    0xffffffd8(%ebp),%eax
   11b06:	c7 04 24 aa 00 00 00 	movl   $0xaa,(%esp)
   11b0d:	50                   	push   %eax
   11b0e:	e8 fd 20 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11b13:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11b16:	6a 55                	push   $0x55
   11b18:	50                   	push   %eax
   11b19:	e8 f2 20 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11b1e:	50                   	push   %eax
   11b1f:	8b 45 d8             	mov    0xffffffd8(%ebp),%eax
   11b22:	50                   	push   %eax
   11b23:	e8 d8 20 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11b28:	89 c6                	mov    %eax,%esi
   11b2a:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11b2d:	50                   	push   %eax
   11b2e:	e8 cd 20 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11b33:	88 c3                	mov    %al,%bl
   11b35:	8b 45 d8             	mov    0xffffffd8(%ebp),%eax
   11b38:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
   11b3f:	50                   	push   %eax
   11b40:	e8 cb 20 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11b45:	8b 4d dc             	mov    0xffffffdc(%ebp),%ecx
   11b48:	6a 00                	push   $0x0
   11b4a:	51                   	push   %ecx
   11b4b:	e8 c0 20 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11b50:	80 fb 55             	cmp    $0x55,%bl
   11b53:	89 f3                	mov    %esi,%ebx
   11b55:	58                   	pop    %eax
   11b56:	5a                   	pop    %edx
   11b57:	0f 95 c2             	setne  %dl
   11b5a:	80 fb aa             	cmp    $0xaa,%bl
   11b5d:	0f 95 c0             	setne  %al
   11b60:	09 d0                	or     %edx,%eax
   11b62:	a8 01                	test   $0x1,%al
   11b64:	74 6e                	je     11bd4 <_AtapiFindDevices+0x184>
   11b66:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
   11b69:	83 c7 04             	add    $0x4,%edi
   11b6c:	40                   	inc    %eax
   11b6d:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
   11b70:	8b 45 c8             	mov    0xffffffc8(%ebp),%eax
   11b73:	05 00 02 00 00       	add    $0x200,%eax
   11b78:	89 45 c8             	mov    %eax,0xffffffc8(%ebp)
   11b7b:	83 7d e0 01          	cmpl   $0x1,0xffffffe0(%ebp)
   11b7f:	0f 86 3e ff ff ff    	jbe    11ac3 <_AtapiFindDevices+0x73>
   11b85:	83 ec 0c             	sub    $0xc,%esp
   11b88:	8b 75 d0             	mov    0xffffffd0(%ebp),%esi
   11b8b:	56                   	push   %esi
   11b8c:	e8 6f 20 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11b91:	8b 5d e4             	mov    0xffffffe4(%ebp),%ebx
   11b94:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
   11b9b:	53                   	push   %ebx
   11b9c:	e8 6f 20 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11ba1:	51                   	push   %ecx
   11ba2:	68 f4 01 00 00       	push   $0x1f4
   11ba7:	e8 74 20 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11bac:	8b 55 d4             	mov    0xffffffd4(%ebp),%edx
   11baf:	c7 04 24 a0 00 00 00 	movl   $0xa0,(%esp)
   11bb6:	52                   	push   %edx
   11bb7:	e8 54 20 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   11bbc:	50                   	push   %eax
   11bbd:	68 f4 01 00 00       	push   $0x1f4
   11bc2:	e8 59 20 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11bc7:	31 c0                	xor    %eax,%eax
   11bc9:	8a 45 ef             	mov    0xffffffef(%ebp),%al
   11bcc:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11bcf:	5b                   	pop    %ebx
   11bd0:	5e                   	pop    %esi
   11bd1:	5f                   	pop    %edi
   11bd2:	5d                   	pop    %ebp
   11bd3:	c3                   	ret    
   11bd4:	83 ec 0c             	sub    $0xc,%esp
   11bd7:	ba 08 00 00 00       	mov    $0x8,%edx
   11bdc:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   11bdf:	31 db                	xor    %ebx,%ebx
   11be1:	6a 00                	push   $0x0
   11be3:	e8 18 fa ff ff       	call   11600 <_AtapiExecuteCommand>
   11be8:	83 c4 10             	add    $0x10,%esp
   11beb:	eb 1c                	jmp    11c09 <_AtapiFindDevices+0x1b9>
   11bed:	8d 76 00             	lea    0x0(%esi),%esi
   11bf0:	83 ec 0c             	sub    $0xc,%esp
   11bf3:	43                   	inc    %ebx
   11bf4:	68 96 00 00 00       	push   $0x96
   11bf9:	e8 22 20 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   11bfe:	83 c4 0c             	add    $0xc,%esp
   11c01:	81 fb 1f 4e 00 00    	cmp    $0x4e1f,%ebx
   11c07:	77 1b                	ja     11c24 <_AtapiFindDevices+0x1d4>
   11c09:	83 ec 0c             	sub    $0xc,%esp
   11c0c:	8b 45 d0             	mov    0xffffffd0(%ebp),%eax
   11c0f:	50                   	push   %eax
   11c10:	e8 eb 1f 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11c15:	83 c4 0c             	add    $0xc,%esp
   11c18:	84 c0                	test   %al,%al
   11c1a:	78 d4                	js     11bf0 <_AtapiFindDevices+0x1a0>
   11c1c:	81 fb 1f 4e 00 00    	cmp    $0x4e1f,%ebx
   11c22:	76 0c                	jbe    11c30 <_AtapiFindDevices+0x1e0>
   11c24:	8b 07                	mov    (%edi),%eax
   11c26:	83 e0 fe             	and    $0xfffffffe,%eax
   11c29:	89 07                	mov    %eax,(%edi)
   11c2b:	e9 36 ff ff ff       	jmp    11b66 <_AtapiFindDevices+0x116>
   11c30:	83 ec 0c             	sub    $0xc,%esp
   11c33:	8b 45 d8             	mov    0xffffffd8(%ebp),%eax
   11c36:	50                   	push   %eax
   11c37:	e8 c4 1f 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11c3c:	89 c6                	mov    %eax,%esi
   11c3e:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   11c41:	50                   	push   %eax
   11c42:	e8 b9 1f 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   11c47:	88 c3                	mov    %al,%bl
   11c49:	89 f0                	mov    %esi,%eax
   11c4b:	83 c4 0c             	add    $0xc,%esp
   11c4e:	3c eb                	cmp    $0xeb,%al
   11c50:	0f 94 c2             	sete   %dl
   11c53:	80 fb 14             	cmp    $0x14,%bl
   11c56:	0f 94 c0             	sete   %al
   11c59:	25 ff 00 00 00       	and    $0xff,%eax
   11c5e:	85 c2                	test   %eax,%edx
   11c60:	74 39                	je     11c9b <_AtapiFindDevices+0x24b>
   11c62:	8b 5d c8             	mov    0xffffffc8(%ebp),%ebx
   11c65:	8b 4d e0             	mov    0xffffffe0(%ebp),%ecx
   11c68:	8b 55 e4             	mov    0xffffffe4(%ebp),%edx
   11c6b:	8b 45 e8             	mov    0xffffffe8(%ebp),%eax
   11c6e:	56                   	push   %esi
   11c6f:	53                   	push   %ebx
   11c70:	6a 01                	push   $0x1
   11c72:	51                   	push   %ecx
   11c73:	e8 f8 f9 ff ff       	call   11670 <_AtapiIdentifyDevice>
   11c78:	83 c4 10             	add    $0x10,%esp
   11c7b:	84 c0                	test   %al,%al
   11c7d:	0f 84 e3 fe ff ff    	je     11b66 <_AtapiFindDevices+0x116>
   11c83:	8b 17                	mov    (%edi),%edx
   11c85:	83 ca 03             	or     $0x3,%edx
   11c88:	89 17                	mov    %edx,(%edi)
   11c8a:	8b 55 c8             	mov    0xffffffc8(%ebp),%edx
   11c8d:	66 8b 42 0a          	mov    0xa(%edx),%ax
   11c91:	25 ff ff 00 00       	and    $0xffff,%eax
   11c96:	89 47 08             	mov    %eax,0x8(%edi)
   11c99:	eb 70                	jmp    11d0b <_AtapiFindDevices+0x2bb>
   11c9b:	50                   	push   %eax
   11c9c:	8b 45 c8             	mov    0xffffffc8(%ebp),%eax
   11c9f:	8b 55 e4             	mov    0xffffffe4(%ebp),%edx
   11ca2:	50                   	push   %eax
   11ca3:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
   11ca6:	6a 00                	push   $0x0
   11ca8:	50                   	push   %eax
   11ca9:	8b 45 e8             	mov    0xffffffe8(%ebp),%eax
   11cac:	e8 bf f9 ff ff       	call   11670 <_AtapiIdentifyDevice>
   11cb1:	83 c4 10             	add    $0x10,%esp
   11cb4:	84 c0                	test   %al,%al
   11cb6:	0f 84 aa fe ff ff    	je     11b66 <_AtapiFindDevices+0x116>
   11cbc:	8b 5d c8             	mov    0xffffffc8(%ebp),%ebx
   11cbf:	8b 37                	mov    (%edi),%esi
   11cc1:	89 f1                	mov    %esi,%ecx
   11cc3:	66 8b 43 0a          	mov    0xa(%ebx),%ax
   11cc7:	83 c9 01             	or     $0x1,%ecx
   11cca:	89 c2                	mov    %eax,%edx
   11ccc:	66 8b 43 5e          	mov    0x5e(%ebx),%ax
   11cd0:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   11cd6:	89 4d cc             	mov    %ecx,0xffffffcc(%ebp)
   11cd9:	66 85 c0             	test   %ax,%ax
   11cdc:	78 4c                	js     11d2a <_AtapiFindDevices+0x2da>
   11cde:	89 57 08             	mov    %edx,0x8(%edi)
   11ce1:	8b 55 c8             	mov    0xffffffc8(%ebp),%edx
   11ce4:	f6 82 a7 00 00 00 04 	testb  $0x4,0xa7(%edx)
   11ceb:	74 0f                	je     11cfc <_AtapiFindDevices+0x2ac>
   11ced:	f6 82 ad 00 00 00 04 	testb  $0x4,0xad(%edx)
   11cf4:	74 06                	je     11cfc <_AtapiFindDevices+0x2ac>
   11cf6:	83 c9 10             	or     $0x10,%ecx
   11cf9:	89 4d cc             	mov    %ecx,0xffffffcc(%ebp)
   11cfc:	8b 5d c8             	mov    0xffffffc8(%ebp),%ebx
   11cff:	66 83 7b 60 00       	cmpw   $0x0,0x60(%ebx)
   11d04:	74 51                	je     11d57 <_AtapiFindDevices+0x307>
   11d06:	83 c9 08             	or     $0x8,%ecx
   11d09:	89 0f                	mov    %ecx,(%edi)
   11d0b:	8b 55 e0             	mov    0xffffffe0(%ebp),%edx
   11d0e:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   11d11:	e8 0a f8 ff ff       	call   11520 <_AtapiConfigDma>
   11d16:	84 c0                	test   %al,%al
   11d18:	74 07                	je     11d21 <_AtapiFindDevices+0x2d1>
   11d1a:	8b 07                	mov    (%edi),%eax
   11d1c:	83 c8 40             	or     $0x40,%eax
   11d1f:	89 07                	mov    %eax,(%edi)
   11d21:	c6 45 ef 01          	movb   $0x1,0xffffffef(%ebp)
   11d25:	e9 3c fe ff ff       	jmp    11b66 <_AtapiFindDevices+0x116>
   11d2a:	84 c0                	test   %al,%al
   11d2c:	74 b0                	je     11cde <_AtapiFindDevices+0x28e>
   11d2e:	66 8b 5b 76          	mov    0x76(%ebx),%bx
   11d32:	89 d8                	mov    %ebx,%eax
   11d34:	25 ff ff 00 00       	and    $0xffff,%eax
   11d39:	f6 c4 01             	test   $0x1,%ah
   11d3c:	74 a0                	je     11cde <_AtapiFindDevices+0x28e>
   11d3e:	84 db                	test   %bl,%bl
   11d40:	74 9c                	je     11cde <_AtapiFindDevices+0x28e>
   11d42:	25 ff 00 00 00       	and    $0xff,%eax
   11d47:	89 f1                	mov    %esi,%ecx
   11d49:	0f af d0             	imul   %eax,%edx
   11d4c:	83 c9 05             	or     $0x5,%ecx
   11d4f:	89 57 08             	mov    %edx,0x8(%edi)
   11d52:	89 4d cc             	mov    %ecx,0xffffffcc(%ebp)
   11d55:	eb 8a                	jmp    11ce1 <_AtapiFindDevices+0x291>
   11d57:	8b 45 cc             	mov    0xffffffcc(%ebp),%eax
   11d5a:	89 07                	mov    %eax,(%edi)
   11d5c:	eb ad                	jmp    11d0b <_AtapiFindDevices+0x2bb>
   11d5e:	89 f6                	mov    %esi,%esi

00011d60 <_AtapiFindIsaBusController@24>:
   11d60:	55                   	push   %ebp
   11d61:	89 e5                	mov    %esp,%ebp
   11d63:	56                   	push   %esi
   11d64:	53                   	push   %ebx
   11d65:	8b 75 1c             	mov    0x1c(%ebp),%esi
   11d68:	8b 5d 18             	mov    0x18(%ebp),%ebx
   11d6b:	c6 06 00             	movb   $0x0,(%esi)
   11d6e:	c6 43 40 01          	movb   $0x1,0x40(%ebx)
   11d72:	c6 43 59 02          	movb   $0x2,0x59(%ebx)
   11d76:	c7 43 18 00 00 01 00 	movl   $0x10000,0x18(%ebx)
   11d7d:	80 7b 4d 00          	cmpb   $0x0,0x4d(%ebx)
   11d81:	74 52                	je     11dd5 <_AtapiFindIsaBusController@24+0x75>
   11d83:	80 7b 4e 00          	cmpb   $0x0,0x4e(%ebx)
   11d87:	74 0e                	je     11d97 <_AtapiFindIsaBusController@24+0x37>
   11d89:	c6 06 00             	movb   $0x0,(%esi)
   11d8c:	31 c0                	xor    %eax,%eax
   11d8e:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11d91:	5b                   	pop    %ebx
   11d92:	5e                   	pop    %esi
   11d93:	5d                   	pop    %ebp
   11d94:	c2 18 00             	ret    $0x18
   11d97:	50                   	push   %eax
   11d98:	6a 0f                	push   $0xf
   11d9a:	6a 00                	push   $0x0
   11d9c:	68 74 03 00 00       	push   $0x374
   11da1:	68 70 01 00 00       	push   $0x170
   11da6:	6a 01                	push   $0x1
   11da8:	53                   	push   %ebx
   11da9:	8b 45 08             	mov    0x8(%ebp),%eax
   11dac:	50                   	push   %eax
   11dad:	e8 9e f3 ff ff       	call   11150 <_AtapiClaimHwResources>
   11db2:	31 d2                	xor    %edx,%edx
   11db4:	83 c4 20             	add    $0x20,%esp
   11db7:	84 c0                	test   %al,%al
   11db9:	74 ce                	je     11d89 <_AtapiFindIsaBusController@24+0x29>
   11dbb:	88 16                	mov    %dl,(%esi)
   11dbd:	89 da                	mov    %ebx,%edx
   11dbf:	8b 45 08             	mov    0x8(%ebp),%eax
   11dc2:	e8 89 fc ff ff       	call   11a50 <_AtapiFindDevices>
   11dc7:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   11dca:	b8 01 00 00 00       	mov    $0x1,%eax
   11dcf:	5b                   	pop    %ebx
   11dd0:	5e                   	pop    %esi
   11dd1:	5d                   	pop    %ebp
   11dd2:	c2 18 00             	ret    $0x18
   11dd5:	50                   	push   %eax
   11dd6:	6a 0e                	push   $0xe
   11dd8:	6a 00                	push   $0x0
   11dda:	68 f4 03 00 00       	push   $0x3f4
   11ddf:	68 f0 01 00 00       	push   $0x1f0
   11de4:	6a 01                	push   $0x1
   11de6:	53                   	push   %ebx
   11de7:	8b 45 08             	mov    0x8(%ebp),%eax
   11dea:	50                   	push   %eax
   11deb:	e8 60 f3 ff ff       	call   11150 <_AtapiClaimHwResources>
   11df0:	b2 01                	mov    $0x1,%dl
   11df2:	eb c0                	jmp    11db4 <_AtapiFindIsaBusController@24+0x54>
   11df4:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
   11dfa:	8d bf 00 00 00 00    	lea    0x0(%edi),%edi

00011e00 <_AtapiFindNativePciController@24>:
   11e00:	55                   	push   %ebp
   11e01:	89 e5                	mov    %esp,%ebp
   11e03:	57                   	push   %edi
   11e04:	56                   	push   %esi
   11e05:	53                   	push   %ebx
   11e06:	81 ec 1c 01 00 00    	sub    $0x11c,%esp
   11e0c:	8b 7d 18             	mov    0x18(%ebp),%edi
   11e0f:	8b 5f 5c             	mov    0x5c(%edi),%ebx
   11e12:	89 da                	mov    %ebx,%edx
   11e14:	89 d8                	mov    %ebx,%eax
   11e16:	c1 ea 05             	shr    $0x5,%edx
   11e19:	83 e0 1f             	and    $0x1f,%eax
   11e1c:	83 e2 07             	and    $0x7,%edx
   11e1f:	89 85 e4 fe ff ff    	mov    %eax,0xfffffee4(%ebp)
   11e25:	83 f8 1f             	cmp    $0x1f,%eax
   11e28:	0f 87 87 00 00 00    	ja     11eb5 <_AtapiFindNativePciController@24+0xb5>
   11e2e:	89 f6                	mov    %esi,%esi
   11e30:	8b 85 e4 fe ff ff    	mov    0xfffffee4(%ebp),%eax
   11e36:	83 e3 e0             	and    $0xffffffe0,%ebx
   11e39:	83 e0 1f             	and    $0x1f,%eax
   11e3c:	89 d6                	mov    %edx,%esi
   11e3e:	09 c3                	or     %eax,%ebx
   11e40:	83 fe 07             	cmp    $0x7,%esi
   11e43:	77 54                	ja     11e99 <_AtapiFindNativePciController@24+0x99>
   11e45:	89 f0                	mov    %esi,%eax
   11e47:	80 e3 1f             	and    $0x1f,%bl
   11e4a:	83 e0 07             	and    $0x7,%eax
   11e4d:	c1 e0 05             	shl    $0x5,%eax
   11e50:	09 c3                	or     %eax,%ebx
   11e52:	50                   	push   %eax
   11e53:	50                   	push   %eax
   11e54:	8d 85 e8 fe ff ff    	lea    0xfffffee8(%ebp),%eax
   11e5a:	6a 40                	push   $0x40
   11e5c:	50                   	push   %eax
   11e5d:	53                   	push   %ebx
   11e5e:	8b 47 04             	mov    0x4(%edi),%eax
   11e61:	50                   	push   %eax
   11e62:	8b 45 08             	mov    0x8(%ebp),%eax
   11e65:	6a 04                	push   $0x4
   11e67:	50                   	push   %eax
   11e68:	e8 e3 1d 00 00       	call   13c50 <_ScsiPortGetBusData@24>
   11e6d:	5a                   	pop    %edx
   11e6e:	83 f8 40             	cmp    $0x40,%eax
   11e71:	59                   	pop    %ecx
   11e72:	75 25                	jne    11e99 <_AtapiFindNativePciController@24+0x99>
   11e74:	30 c0                	xor    %al,%al
   11e76:	8b 95 e8 fe ff ff    	mov    0xfffffee8(%ebp),%edx
   11e7c:	66 8b 8d ea fe ff ff 	mov    0xfffffeea(%ebp),%cx
   11e83:	66 3b 14 85 00 40 01 	cmp    0x14000(,%eax,4),%dx
   11e8a:	00 
   11e8b:	74 44                	je     11ed1 <_AtapiFindNativePciController@24+0xd1>
   11e8d:	40                   	inc    %eax
   11e8e:	83 f8 01             	cmp    $0x1,%eax
   11e91:	76 f0                	jbe    11e83 <_AtapiFindNativePciController@24+0x83>
   11e93:	46                   	inc    %esi
   11e94:	83 fe 07             	cmp    $0x7,%esi
   11e97:	76 ac                	jbe    11e45 <_AtapiFindNativePciController@24+0x45>
   11e99:	8b 85 e4 fe ff ff    	mov    0xfffffee4(%ebp),%eax
   11e9f:	31 d2                	xor    %edx,%edx
   11ea1:	40                   	inc    %eax
   11ea2:	89 85 e4 fe ff ff    	mov    %eax,0xfffffee4(%ebp)
   11ea8:	83 bd e4 fe ff ff 1f 	cmpl   $0x1f,0xfffffee4(%ebp)
   11eaf:	0f 86 7b ff ff ff    	jbe    11e30 <_AtapiFindNativePciController@24+0x30>
   11eb5:	8b 45 1c             	mov    0x1c(%ebp),%eax
   11eb8:	c6 00 00             	movb   $0x0,(%eax)
   11ebb:	c7 05 10 50 01 00 ff 	movl   $0xffffffff,0x15010
   11ec2:	ff ff ff 
   11ec5:	31 c0                	xor    %eax,%eax
   11ec7:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   11eca:	5b                   	pop    %ebx
   11ecb:	5e                   	pop    %esi
   11ecc:	5f                   	pop    %edi
   11ecd:	5d                   	pop    %ebp
   11ece:	c2 18 00             	ret    $0x18
   11ed1:	66 3b 0c 85 02 40 01 	cmp    0x14002(,%eax,4),%cx
   11ed8:	00 
   11ed9:	75 b2                	jne    11e8d <_AtapiFindNativePciController@24+0x8d>
   11edb:	83 f8 01             	cmp    $0x1,%eax
   11ede:	77 b3                	ja     11e93 <_AtapiFindNativePciController@24+0x93>
   11ee0:	80 bd f1 fe ff ff 00 	cmpb   $0x0,0xfffffef1(%ebp)
   11ee7:	0f 88 b3 00 00 00    	js     11fa0 <_AtapiFindNativePciController@24+0x1a0>
   11eed:	c7 85 e0 fe ff ff 00 	movl   $0x0,0xfffffee0(%ebp)
   11ef4:	00 00 00 
   11ef7:	c6 47 40 01          	movb   $0x1,0x40(%edi)
   11efb:	c6 47 59 02          	movb   $0x2,0x59(%edi)
   11eff:	c7 47 18 00 00 01 00 	movl   $0x10000,0x18(%edi)
   11f06:	39 1d 10 50 01 00    	cmp    %ebx,0x15010
   11f0c:	74 1a                	je     11f28 <_AtapiFindNativePciController@24+0x128>
   11f0e:	8b 95 f8 fe ff ff    	mov    0xfffffef8(%ebp),%edx
   11f14:	f6 c2 01             	test   $0x1,%dl
   11f17:	74 0f                	je     11f28 <_AtapiFindNativePciController@24+0x128>
   11f19:	8b 8d fc fe ff ff    	mov    0xfffffefc(%ebp),%ecx
   11f1f:	f6 c1 01             	test   $0x1,%cl
   11f22:	0f 85 9f 00 00 00    	jne    11fc7 <_AtapiFindNativePciController@24+0x1c7>
   11f28:	8b 95 00 ff ff ff    	mov    0xffffff00(%ebp),%edx
   11f2e:	f6 c2 01             	test   $0x1,%dl
   11f31:	0f 84 5c ff ff ff    	je     11e93 <_AtapiFindNativePciController@24+0x93>
   11f37:	8b 8d 04 ff ff ff    	mov    0xffffff04(%ebp),%ecx
   11f3d:	f6 c1 01             	test   $0x1,%cl
   11f40:	0f 84 4d ff ff ff    	je     11e93 <_AtapiFindNativePciController@24+0x93>
   11f46:	50                   	push   %eax
   11f47:	31 c0                	xor    %eax,%eax
   11f49:	8a 85 24 ff ff ff    	mov    0xffffff24(%ebp),%al
   11f4f:	50                   	push   %eax
   11f50:	31 c0                	xor    %eax,%eax
   11f52:	83 bd e0 fe ff ff 00 	cmpl   $0x0,0xfffffee0(%ebp)
   11f59:	75 61                	jne    11fbc <_AtapiFindNativePciController@24+0x1bc>
   11f5b:	50                   	push   %eax
   11f5c:	83 e1 fc             	and    $0xfffffffc,%ecx
   11f5f:	83 e2 fc             	and    $0xfffffffc,%edx
   11f62:	8b 45 08             	mov    0x8(%ebp),%eax
   11f65:	51                   	push   %ecx
   11f66:	52                   	push   %edx
   11f67:	6a 05                	push   $0x5
   11f69:	57                   	push   %edi
   11f6a:	50                   	push   %eax
   11f6b:	e8 e0 f1 ff ff       	call   11150 <_AtapiClaimHwResources>
   11f70:	83 c4 20             	add    $0x20,%esp
   11f73:	84 c0                	test   %al,%al
   11f75:	0f 84 18 ff ff ff    	je     11e93 <_AtapiFindNativePciController@24+0x93>
   11f7b:	89 fa                	mov    %edi,%edx
   11f7d:	8b 45 08             	mov    0x8(%ebp),%eax
   11f80:	e8 cb fa ff ff       	call   11a50 <_AtapiFindDevices>
   11f85:	8b 45 1c             	mov    0x1c(%ebp),%eax
   11f88:	c6 00 00             	movb   $0x0,(%eax)
   11f8b:	c7 05 10 50 01 00 ff 	movl   $0xffffffff,0x15010
   11f92:	ff ff ff 
   11f95:	b8 01 00 00 00       	mov    $0x1,%eax
   11f9a:	e9 28 ff ff ff       	jmp    11ec7 <_AtapiFindNativePciController@24+0xc7>
   11f9f:	90                   	nop    
   11fa0:	8b 85 08 ff ff ff    	mov    0xffffff08(%ebp),%eax
   11fa6:	a8 01                	test   $0x1,%al
   11fa8:	0f 84 3f ff ff ff    	je     11eed <_AtapiFindNativePciController@24+0xed>
   11fae:	83 e0 fc             	and    $0xfffffffc,%eax
   11fb1:	89 85 e0 fe ff ff    	mov    %eax,0xfffffee0(%ebp)
   11fb7:	e9 3b ff ff ff       	jmp    11ef7 <_AtapiFindNativePciController@24+0xf7>
   11fbc:	8b 85 e0 fe ff ff    	mov    0xfffffee0(%ebp),%eax
   11fc2:	83 c0 08             	add    $0x8,%eax
   11fc5:	eb 94                	jmp    11f5b <_AtapiFindNativePciController@24+0x15b>
   11fc7:	50                   	push   %eax
   11fc8:	31 c0                	xor    %eax,%eax
   11fca:	83 e1 fc             	and    $0xfffffffc,%ecx
   11fcd:	8a 85 24 ff ff ff    	mov    0xffffff24(%ebp),%al
   11fd3:	83 e2 fc             	and    $0xfffffffc,%edx
   11fd6:	50                   	push   %eax
   11fd7:	8b 85 e0 fe ff ff    	mov    0xfffffee0(%ebp),%eax
   11fdd:	50                   	push   %eax
   11fde:	51                   	push   %ecx
   11fdf:	52                   	push   %edx
   11fe0:	8b 55 08             	mov    0x8(%ebp),%edx
   11fe3:	6a 05                	push   $0x5
   11fe5:	57                   	push   %edi
   11fe6:	52                   	push   %edx
   11fe7:	e8 64 f1 ff ff       	call   11150 <_AtapiClaimHwResources>
   11fec:	83 c4 20             	add    $0x20,%esp
   11fef:	84 c0                	test   %al,%al
   11ff1:	0f 84 31 ff ff ff    	je     11f28 <_AtapiFindNativePciController@24+0x128>
   11ff7:	89 fa                	mov    %edi,%edx
   11ff9:	8b 45 08             	mov    0x8(%ebp),%eax
   11ffc:	e8 4f fa ff ff       	call   11a50 <_AtapiFindDevices>
   12001:	8b 45 1c             	mov    0x1c(%ebp),%eax
   12004:	c6 00 01             	movb   $0x1,(%eax)
   12007:	89 1d 10 50 01 00    	mov    %ebx,0x15010
   1200d:	89 5f 5c             	mov    %ebx,0x5c(%edi)
   12010:	eb 83                	jmp    11f95 <_AtapiFindNativePciController@24+0x195>
   12012:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   12019:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00012020 <_AtapiFindCompatiblePciController@24>:
   12020:	55                   	push   %ebp
   12021:	89 e5                	mov    %esp,%ebp
   12023:	57                   	push   %edi
   12024:	56                   	push   %esi
   12025:	53                   	push   %ebx
   12026:	81 ec 1c 01 00 00    	sub    $0x11c,%esp
   1202c:	c7 85 e4 fe ff ff 00 	movl   $0x0,0xfffffee4(%ebp)
   12033:	00 00 00 
   12036:	8b 45 1c             	mov    0x1c(%ebp),%eax
   12039:	c6 00 00             	movb   $0x0,(%eax)
   1203c:	8b 55 18             	mov    0x18(%ebp),%edx
   1203f:	8b 42 4c             	mov    0x4c(%edx),%eax
   12042:	31 d2                	xor    %edx,%edx
   12044:	25 00 ff ff 00       	and    $0xffff00,%eax
   12049:	3d 00 01 01 00       	cmp    $0x10100,%eax
   1204e:	74 6f                	je     120bf <_AtapiFindCompatiblePciController@24+0x9f>
   12050:	8b 55 18             	mov    0x18(%ebp),%edx
   12053:	8b 5a 5c             	mov    0x5c(%edx),%ebx
   12056:	89 da                	mov    %ebx,%edx
   12058:	89 df                	mov    %ebx,%edi
   1205a:	c1 ea 05             	shr    $0x5,%edx
   1205d:	83 e7 1f             	and    $0x1f,%edi
   12060:	83 e2 07             	and    $0x7,%edx
   12063:	83 ff 1f             	cmp    $0x1f,%edi
   12066:	77 55                	ja     120bd <_AtapiFindCompatiblePciController@24+0x9d>
   12068:	89 f8                	mov    %edi,%eax
   1206a:	83 e3 e0             	and    $0xffffffe0,%ebx
   1206d:	83 e0 1f             	and    $0x1f,%eax
   12070:	89 d6                	mov    %edx,%esi
   12072:	09 c3                	or     %eax,%ebx
   12074:	83 fe 07             	cmp    $0x7,%esi
   12077:	77 3c                	ja     120b5 <_AtapiFindCompatiblePciController@24+0x95>
   12079:	89 f0                	mov    %esi,%eax
   1207b:	80 e3 1f             	and    $0x1f,%bl
   1207e:	83 e0 07             	and    $0x7,%eax
   12081:	8b 55 18             	mov    0x18(%ebp),%edx
   12084:	c1 e0 05             	shl    $0x5,%eax
   12087:	09 c3                	or     %eax,%ebx
   12089:	50                   	push   %eax
   1208a:	50                   	push   %eax
   1208b:	8d 85 e8 fe ff ff    	lea    0xfffffee8(%ebp),%eax
   12091:	6a 40                	push   $0x40
   12093:	50                   	push   %eax
   12094:	53                   	push   %ebx
   12095:	8b 42 04             	mov    0x4(%edx),%eax
   12098:	50                   	push   %eax
   12099:	8b 45 08             	mov    0x8(%ebp),%eax
   1209c:	6a 04                	push   $0x4
   1209e:	50                   	push   %eax
   1209f:	e8 ac 1b 00 00       	call   13c50 <_ScsiPortGetBusData@24>
   120a4:	5a                   	pop    %edx
   120a5:	83 f8 40             	cmp    $0x40,%eax
   120a8:	59                   	pop    %ecx
   120a9:	74 25                	je     120d0 <_AtapiFindCompatiblePciController@24+0xb0>
   120ab:	85 f6                	test   %esi,%esi
   120ad:	74 06                	je     120b5 <_AtapiFindCompatiblePciController@24+0x95>
   120af:	46                   	inc    %esi
   120b0:	83 fe 07             	cmp    $0x7,%esi
   120b3:	76 c4                	jbe    12079 <_AtapiFindCompatiblePciController@24+0x59>
   120b5:	31 d2                	xor    %edx,%edx
   120b7:	47                   	inc    %edi
   120b8:	83 ff 1f             	cmp    $0x1f,%edi
   120bb:	76 ab                	jbe    12068 <_AtapiFindCompatiblePciController@24+0x48>
   120bd:	31 d2                	xor    %edx,%edx
   120bf:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   120c2:	89 d0                	mov    %edx,%eax
   120c4:	5b                   	pop    %ebx
   120c5:	5e                   	pop    %esi
   120c6:	5f                   	pop    %edi
   120c7:	5d                   	pop    %ebp
   120c8:	c2 18 00             	ret    $0x18
   120cb:	90                   	nop    
   120cc:	8d 74 26 00          	lea    0x0(%esi),%esi
   120d0:	66 81 bd f2 fe ff ff 	cmpw   $0x101,0xfffffef2(%ebp)
   120d7:	01 01 
   120d9:	74 10                	je     120eb <_AtapiFindCompatiblePciController@24+0xcb>
   120db:	85 f6                	test   %esi,%esi
   120dd:	75 d0                	jne    120af <_AtapiFindCompatiblePciController@24+0x8f>
   120df:	80 bd f6 fe ff ff 00 	cmpb   $0x0,0xfffffef6(%ebp)
   120e6:	79 cd                	jns    120b5 <_AtapiFindCompatiblePciController@24+0x95>
   120e8:	46                   	inc    %esi
   120e9:	eb c5                	jmp    120b0 <_AtapiFindCompatiblePciController@24+0x90>
   120eb:	8b 45 18             	mov    0x18(%ebp),%eax
   120ee:	c6 40 40 01          	movb   $0x1,0x40(%eax)
   120f2:	c6 40 59 02          	movb   $0x2,0x59(%eax)
   120f6:	c7 40 18 00 00 01 00 	movl   $0x10000,0x18(%eax)
   120fd:	80 bd f1 fe ff ff 00 	cmpb   $0x0,0xfffffef1(%ebp)
   12104:	0f 88 94 00 00 00    	js     1219e <_AtapiFindCompatiblePciController@24+0x17e>
   1210a:	8b 55 18             	mov    0x18(%ebp),%edx
   1210d:	80 7a 4d 00          	cmpb   $0x0,0x4d(%edx)
   12111:	74 63                	je     12176 <_AtapiFindCompatiblePciController@24+0x156>
   12113:	8b 45 18             	mov    0x18(%ebp),%eax
   12116:	80 78 4e 00          	cmpb   $0x0,0x4e(%eax)
   1211a:	75 bf                	jne    120db <_AtapiFindCompatiblePciController@24+0xbb>
   1211c:	8b 95 e4 fe ff ff    	mov    0xfffffee4(%ebp),%edx
   12122:	31 c0                	xor    %eax,%eax
   12124:	51                   	push   %ecx
   12125:	85 d2                	test   %edx,%edx
   12127:	6a 0f                	push   $0xf
   12129:	74 09                	je     12134 <_AtapiFindCompatiblePciController@24+0x114>
   1212b:	8b 85 e4 fe ff ff    	mov    0xfffffee4(%ebp),%eax
   12131:	83 c0 08             	add    $0x8,%eax
   12134:	50                   	push   %eax
   12135:	8b 45 18             	mov    0x18(%ebp),%eax
   12138:	68 74 03 00 00       	push   $0x374
   1213d:	68 70 01 00 00       	push   $0x170
   12142:	6a 05                	push   $0x5
   12144:	50                   	push   %eax
   12145:	8b 45 08             	mov    0x8(%ebp),%eax
   12148:	50                   	push   %eax
   12149:	e8 02 f0 ff ff       	call   11150 <_AtapiClaimHwResources>
   1214e:	8b 55 1c             	mov    0x1c(%ebp),%edx
   12151:	c6 02 00             	movb   $0x0,(%edx)
   12154:	83 c4 20             	add    $0x20,%esp
   12157:	84 c0                	test   %al,%al
   12159:	74 80                	je     120db <_AtapiFindCompatiblePciController@24+0xbb>
   1215b:	8b 55 18             	mov    0x18(%ebp),%edx
   1215e:	8b 45 08             	mov    0x8(%ebp),%eax
   12161:	e8 ea f8 ff ff       	call   11a50 <_AtapiFindDevices>
   12166:	8b 45 18             	mov    0x18(%ebp),%eax
   12169:	ba 01 00 00 00       	mov    $0x1,%edx
   1216e:	89 58 5c             	mov    %ebx,0x5c(%eax)
   12171:	e9 49 ff ff ff       	jmp    120bf <_AtapiFindCompatiblePciController@24+0x9f>
   12176:	50                   	push   %eax
   12177:	8b 85 e4 fe ff ff    	mov    0xfffffee4(%ebp),%eax
   1217d:	6a 0e                	push   $0xe
   1217f:	50                   	push   %eax
   12180:	8b 45 08             	mov    0x8(%ebp),%eax
   12183:	68 f4 03 00 00       	push   $0x3f4
   12188:	68 f0 01 00 00       	push   $0x1f0
   1218d:	6a 05                	push   $0x5
   1218f:	52                   	push   %edx
   12190:	50                   	push   %eax
   12191:	e8 ba ef ff ff       	call   11150 <_AtapiClaimHwResources>
   12196:	8b 55 1c             	mov    0x1c(%ebp),%edx
   12199:	c6 02 01             	movb   $0x1,(%edx)
   1219c:	eb b6                	jmp    12154 <_AtapiFindCompatiblePciController@24+0x134>
   1219e:	8b 85 08 ff ff ff    	mov    0xffffff08(%ebp),%eax
   121a4:	a8 01                	test   $0x1,%al
   121a6:	0f 84 5e ff ff ff    	je     1210a <_AtapiFindCompatiblePciController@24+0xea>
   121ac:	83 e0 fc             	and    $0xfffffffc,%eax
   121af:	89 85 e4 fe ff ff    	mov    %eax,0xfffffee4(%ebp)
   121b5:	e9 50 ff ff ff       	jmp    1210a <_AtapiFindCompatiblePciController@24+0xea>
   121ba:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

000121c0 <_AtapiInquiry>:
   121c0:	55                   	push   %ebp
   121c1:	89 e5                	mov    %esp,%ebp
   121c3:	57                   	push   %edi
   121c4:	56                   	push   %esi
   121c5:	53                   	push   %ebx
   121c6:	51                   	push   %ecx
   121c7:	51                   	push   %ecx
   121c8:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   121cb:	89 d7                	mov    %edx,%edi
   121cd:	8a 42 06             	mov    0x6(%edx),%al
   121d0:	8b 4a 18             	mov    0x18(%edx),%ecx
   121d3:	88 45 ef             	mov    %al,0xffffffef(%ebp)
   121d6:	31 c0                	xor    %eax,%eax
   121d8:	8a 45 ef             	mov    0xffffffef(%ebp),%al
   121db:	8b 55 f0             	mov    0xfffffff0(%ebp),%edx
   121de:	c1 e0 09             	shl    $0x9,%eax
   121e1:	89 cb                	mov    %ecx,%ebx
   121e3:	8d 34 10             	lea    (%eax,%edx,1),%esi
   121e6:	8b 47 10             	mov    0x10(%edi),%eax
   121e9:	31 d2                	xor    %edx,%edx
   121eb:	85 c0                	test   %eax,%eax
   121ed:	75 05                	jne    121f4 <_AtapiInquiry+0x34>
   121ef:	eb 13                	jmp    12204 <_AtapiInquiry+0x44>
   121f1:	8b 5f 18             	mov    0x18(%edi),%ebx
   121f4:	c6 04 1a 00          	movb   $0x0,(%edx,%ebx,1)
   121f8:	42                   	inc    %edx
   121f9:	39 57 10             	cmp    %edx,0x10(%edi)
   121fc:	77 f3                	ja     121f1 <_AtapiInquiry+0x31>
   121fe:	8a 47 06             	mov    0x6(%edi),%al
   12201:	88 45 ef             	mov    %al,0xffffffef(%ebp)
   12204:	31 c0                	xor    %eax,%eax
   12206:	8b 55 f0             	mov    0xfffffff0(%ebp),%edx
   12209:	8a 45 ef             	mov    0xffffffef(%ebp),%al
   1220c:	f6 84 82 00 04 00 00 	testb  $0x2,0x400(%edx,%eax,4)
   12213:	02 
   12214:	74 74                	je     1228a <_AtapiInquiry+0xca>
   12216:	8a 56 01             	mov    0x1(%esi),%dl
   12219:	8a 01                	mov    (%ecx),%al
   1221b:	83 e2 1f             	and    $0x1f,%edx
   1221e:	83 e0 e0             	and    $0xffffffe0,%eax
   12221:	09 d0                	or     %edx,%eax
   12223:	88 01                	mov    %al,(%ecx)
   12225:	83 e0 1f             	and    $0x1f,%eax
   12228:	3c 05                	cmp    $0x5,%al
   1222a:	74 63                	je     1228f <_AtapiInquiry+0xcf>
   1222c:	f6 06 80             	testb  $0x80,(%esi)
   1222f:	74 04                	je     12235 <_AtapiInquiry+0x75>
   12231:	80 49 01 80          	orb    $0x80,0x1(%ecx)
   12235:	31 d2                	xor    %edx,%edx
   12237:	8a 44 16 36          	mov    0x36(%esi,%edx,1),%al
   1223b:	88 44 0a 08          	mov    %al,0x8(%edx,%ecx,1)
   1223f:	8a 44 16 37          	mov    0x37(%esi,%edx,1),%al
   12243:	88 44 0a 09          	mov    %al,0x9(%edx,%ecx,1)
   12247:	83 c2 02             	add    $0x2,%edx
   1224a:	83 fa 13             	cmp    $0x13,%edx
   1224d:	76 e8                	jbe    12237 <_AtapiInquiry+0x77>
   1224f:	31 d2                	xor    %edx,%edx
   12251:	c6 44 11 1c 20       	movb   $0x20,0x1c(%ecx,%edx,1)
   12256:	42                   	inc    %edx
   12257:	83 fa 03             	cmp    $0x3,%edx
   1225a:	76 f5                	jbe    12251 <_AtapiInquiry+0x91>
   1225c:	31 d2                	xor    %edx,%edx
   1225e:	8a 44 16 2e          	mov    0x2e(%esi,%edx,1),%al
   12262:	88 44 11 20          	mov    %al,0x20(%ecx,%edx,1)
   12266:	8a 44 16 2f          	mov    0x2f(%esi,%edx,1),%al
   1226a:	88 44 11 21          	mov    %al,0x21(%ecx,%edx,1)
   1226e:	83 c2 02             	add    $0x2,%edx
   12271:	83 fa 03             	cmp    $0x3,%edx
   12274:	76 e8                	jbe    1225e <_AtapiInquiry+0x9e>
   12276:	c6 41 04 1f          	movb   $0x1f,0x4(%ecx)
   1227a:	b8 01 00 00 00       	mov    $0x1,%eax
   1227f:	c6 47 03 01          	movb   $0x1,0x3(%edi)
   12283:	5a                   	pop    %edx
   12284:	59                   	pop    %ecx
   12285:	5b                   	pop    %ebx
   12286:	5e                   	pop    %esi
   12287:	5f                   	pop    %edi
   12288:	5d                   	pop    %ebp
   12289:	c3                   	ret    
   1228a:	80 21 e0             	andb   $0xe0,(%ecx)
   1228d:	eb 9d                	jmp    1222c <_AtapiInquiry+0x6c>
   1228f:	31 c0                	xor    %eax,%eax
   12291:	8b 55 f0             	mov    0xfffffff0(%ebp),%edx
   12294:	8a 47 06             	mov    0x6(%edi),%al
   12297:	8b 9c 82 00 04 00 00 	mov    0x400(%edx,%eax,4),%ebx
   1229e:	80 cb 80             	or     $0x80,%bl
   122a1:	89 9c 82 00 04 00 00 	mov    %ebx,0x400(%edx,%eax,4)
   122a8:	eb 82                	jmp    1222c <_AtapiInquiry+0x6c>
   122aa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi

000122b0 <@AtapiCompleteRequest@8>:
   122b0:	55                   	push   %ebp
   122b1:	89 e5                	mov    %esp,%ebp
   122b3:	57                   	push   %edi
   122b4:	56                   	push   %esi
   122b5:	53                   	push   %ebx
   122b6:	83 ec 0c             	sub    $0xc,%esp
   122b9:	89 cb                	mov    %ecx,%ebx
   122bb:	8b b1 1c 04 00 00    	mov    0x41c(%ecx),%esi
   122c1:	80 fa 04             	cmp    $0x4,%dl
   122c4:	88 56 03             	mov    %dl,0x3(%esi)
   122c7:	74 3e                	je     12307 <@AtapiCompleteRequest@8+0x57>
   122c9:	80 fa 12             	cmp    $0x12,%dl
   122cc:	74 29                	je     122f7 <@AtapiCompleteRequest@8+0x47>
   122ce:	c7 83 28 04 00 00 00 	movl   $0x0,0x428(%ebx)
   122d5:	00 00 00 
   122d8:	57                   	push   %edi
   122d9:	56                   	push   %esi
   122da:	53                   	push   %ebx
   122db:	6a 00                	push   $0x0
   122dd:	e8 ce 19 00 00       	call   13cb0 <_ScsiPortNotification>
   122e2:	83 c4 0c             	add    $0xc,%esp
   122e5:	6a 00                	push   $0x0
   122e7:	53                   	push   %ebx
   122e8:	6a 01                	push   $0x1
   122ea:	e8 c1 19 00 00       	call   13cb0 <_ScsiPortNotification>
   122ef:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   122f2:	5b                   	pop    %ebx
   122f3:	5e                   	pop    %esi
   122f4:	5f                   	pop    %edi
   122f5:	5d                   	pop    %ebp
   122f6:	c3                   	ret    
   122f7:	8b 46 10             	mov    0x10(%esi),%eax
   122fa:	8b 91 24 04 00 00    	mov    0x424(%ecx),%edx
   12300:	29 d0                	sub    %edx,%eax
   12302:	89 46 10             	mov    %eax,0x10(%esi)
   12305:	eb c7                	jmp    122ce <@AtapiCompleteRequest@8+0x1e>
   12307:	83 ec 0c             	sub    $0xc,%esp
   1230a:	8b 81 10 04 00 00    	mov    0x410(%ecx),%eax
   12310:	40                   	inc    %eax
   12311:	50                   	push   %eax
   12312:	e8 e9 18 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12317:	89 c7                	mov    %eax,%edi
   12319:	31 c0                	xor    %eax,%eax
   1231b:	8a 46 06             	mov    0x6(%esi),%al
   1231e:	83 c4 0c             	add    $0xc,%esp
   12321:	f6 84 83 00 04 00 00 	testb  $0x2,0x400(%ebx,%eax,4)
   12328:	02 
   12329:	74 16                	je     12341 <@AtapiCompleteRequest@8+0x91>
   1232b:	89 f8                	mov    %edi,%eax
   1232d:	c0 e8 04             	shr    $0x4,%al
   12330:	25 ff 00 00 00       	and    $0xff,%eax
   12335:	83 f8 0b             	cmp    $0xb,%eax
   12338:	77 33                	ja     1236d <@AtapiCompleteRequest@8+0xbd>
   1233a:	ff 24 85 90 40 01 00 	jmp    *0x14090(,%eax,4)
   12341:	50                   	push   %eax
   12342:	68 fb 09 00 00       	push   $0x9fb
   12347:	68 08 40 01 00       	push   $0x14008
   1234c:	68 10 40 01 00       	push   $0x14010
   12351:	e8 8a 19 00 00       	call   13ce0 <_DbgPrint>
   12356:	59                   	pop    %ecx
   12357:	58                   	pop    %eax
   12358:	89 f8                	mov    %edi,%eax
   1235a:	25 ff 00 00 00       	and    $0xff,%eax
   1235f:	50                   	push   %eax
   12360:	68 7e 40 01 00       	push   $0x1407e
   12365:	e8 76 19 00 00       	call   13ce0 <_DbgPrint>
   1236a:	83 c4 10             	add    $0x10,%esp
   1236d:	31 d2                	xor    %edx,%edx
   1236f:	b0 04                	mov    $0x4,%al
   12371:	88 56 04             	mov    %dl,0x4(%esi)
   12374:	88 46 03             	mov    %al,0x3(%esi)
   12377:	e9 52 ff ff ff       	jmp    122ce <@AtapiCompleteRequest@8+0x1e>
   1237c:	b2 02                	mov    $0x2,%dl
   1237e:	eb ef                	jmp    1236f <@AtapiCompleteRequest@8+0xbf>
   12380:	31 d2                	xor    %edx,%edx
   12382:	b0 01                	mov    $0x1,%al
   12384:	eb eb                	jmp    12371 <@AtapiCompleteRequest@8+0xc1>
   12386:	8d 76 00             	lea    0x0(%esi),%esi
   12389:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00012390 <@AtapiDmaPacketInterrupt@4>:
   12390:	55                   	push   %ebp
   12391:	89 e5                	mov    %esp,%ebp
   12393:	56                   	push   %esi
   12394:	53                   	push   %ebx
   12395:	c7 81 2c 04 00 00 00 	movl   $0x0,0x42c(%ecx)
   1239c:	00 00 00 
   1239f:	83 ec 0c             	sub    $0xc,%esp
   123a2:	8b 81 18 04 00 00    	mov    0x418(%ecx),%eax
   123a8:	89 cb                	mov    %ecx,%ebx
   123aa:	50                   	push   %eax
   123ab:	e8 50 18 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   123b0:	25 fe 00 00 00       	and    $0xfe,%eax
   123b5:	89 04 24             	mov    %eax,(%esp)
   123b8:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   123be:	50                   	push   %eax
   123bf:	e8 4c 18 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   123c4:	50                   	push   %eax
   123c5:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   123cb:	83 c0 02             	add    $0x2,%eax
   123ce:	50                   	push   %eax
   123cf:	e8 2c 18 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   123d4:	89 c6                	mov    %eax,%esi
   123d6:	83 c8 06             	or     $0x6,%eax
   123d9:	25 ff 00 00 00       	and    $0xff,%eax
   123de:	89 04 24             	mov    %eax,(%esp)
   123e1:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   123e7:	83 c0 02             	add    $0x2,%eax
   123ea:	50                   	push   %eax
   123eb:	e8 20 18 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   123f0:	50                   	push   %eax
   123f1:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   123f7:	83 c0 07             	add    $0x7,%eax
   123fa:	50                   	push   %eax
   123fb:	e8 00 18 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12400:	83 c4 0c             	add    $0xc,%esp
   12403:	a8 81                	test   $0x81,%al
   12405:	74 1d                	je     12424 <@AtapiDmaPacketInterrupt@4+0x94>
   12407:	a8 01                	test   $0x1,%al
   12409:	75 45                	jne    12450 <@AtapiDmaPacketInterrupt@4+0xc0>
   1240b:	b0 04                	mov    $0x4,%al
   1240d:	31 d2                	xor    %edx,%edx
   1240f:	89 d9                	mov    %ebx,%ecx
   12411:	88 c2                	mov    %al,%dl
   12413:	e8 98 fe ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   12418:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   1241b:	b8 01 00 00 00       	mov    $0x1,%eax
   12420:	5b                   	pop    %ebx
   12421:	5e                   	pop    %esi
   12422:	5d                   	pop    %ebp
   12423:	c3                   	ret    
   12424:	89 f0                	mov    %esi,%eax
   12426:	89 d9                	mov    %ebx,%ecx
   12428:	83 e0 07             	and    $0x7,%eax
   1242b:	83 f8 04             	cmp    $0x4,%eax
   1242e:	0f 95 c0             	setne  %al
   12431:	c1 e0 02             	shl    $0x2,%eax
   12434:	31 d2                	xor    %edx,%edx
   12436:	88 c2                	mov    %al,%dl
   12438:	e8 73 fe ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   1243d:	8d 65 f8             	lea    0xfffffff8(%ebp),%esp
   12440:	b8 01 00 00 00       	mov    $0x1,%eax
   12445:	5b                   	pop    %ebx
   12446:	5e                   	pop    %esi
   12447:	5d                   	pop    %ebp
   12448:	c3                   	ret    
   12449:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   12450:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   12456:	83 ec 0c             	sub    $0xc,%esp
   12459:	40                   	inc    %eax
   1245a:	50                   	push   %eax
   1245b:	e8 a0 17 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12460:	b0 04                	mov    $0x4,%al
   12462:	83 c4 0c             	add    $0xc,%esp
   12465:	eb a6                	jmp    1240d <@AtapiDmaPacketInterrupt@4+0x7d>
   12467:	89 f6                	mov    %esi,%esi
   12469:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00012470 <@AtapiPacketInterrupt@4>:
   12470:	55                   	push   %ebp
   12471:	89 e5                	mov    %esp,%ebp
   12473:	57                   	push   %edi
   12474:	56                   	push   %esi
   12475:	53                   	push   %ebx
   12476:	83 ec 18             	sub    $0x18,%esp
   12479:	89 ce                	mov    %ecx,%esi
   1247b:	8b 81 1c 04 00 00    	mov    0x41c(%ecx),%eax
   12481:	c7 45 ec 00 00 00 00 	movl   $0x0,0xffffffec(%ebp)
   12488:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   1248b:	8b 81 10 04 00 00    	mov    0x410(%ecx),%eax
   12491:	83 c0 07             	add    $0x7,%eax
   12494:	50                   	push   %eax
   12495:	e8 66 17 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1249a:	83 c4 0c             	add    $0xc,%esp
   1249d:	88 c3                	mov    %al,%bl
   1249f:	a8 81                	test   $0x81,%al
   124a1:	74 33                	je     124d6 <@AtapiPacketInterrupt@4+0x66>
   124a3:	83 e3 01             	and    $0x1,%ebx
   124a6:	75 19                	jne    124c1 <@AtapiPacketInterrupt@4+0x51>
   124a8:	ba 04 00 00 00       	mov    $0x4,%edx
   124ad:	89 f1                	mov    %esi,%ecx
   124af:	e8 fc fd ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   124b4:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   124b7:	b8 01 00 00 00       	mov    $0x1,%eax
   124bc:	5b                   	pop    %ebx
   124bd:	5e                   	pop    %esi
   124be:	5f                   	pop    %edi
   124bf:	5d                   	pop    %ebp
   124c0:	c3                   	ret    
   124c1:	83 ec 0c             	sub    $0xc,%esp
   124c4:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   124ca:	40                   	inc    %eax
   124cb:	50                   	push   %eax
   124cc:	e8 2f 17 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   124d1:	83 c4 0c             	add    $0xc,%esp
   124d4:	eb d2                	jmp    124a8 <@AtapiPacketInterrupt@4+0x38>
   124d6:	83 ec 0c             	sub    $0xc,%esp
   124d9:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   124df:	83 c0 02             	add    $0x2,%eax
   124e2:	50                   	push   %eax
   124e3:	e8 18 17 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   124e8:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   124ee:	83 c0 04             	add    $0x4,%eax
   124f1:	50                   	push   %eax
   124f2:	e8 09 17 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   124f7:	25 ff 00 00 00       	and    $0xff,%eax
   124fc:	89 c7                	mov    %eax,%edi
   124fe:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   12504:	83 c0 05             	add    $0x5,%eax
   12507:	50                   	push   %eax
   12508:	e8 f3 16 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1250d:	25 ff 00 00 00       	and    $0xff,%eax
   12512:	83 c4 0c             	add    $0xc,%esp
   12515:	c1 e0 08             	shl    $0x8,%eax
   12518:	01 c7                	add    %eax,%edi
   1251a:	83 e3 08             	and    $0x8,%ebx
   1251d:	0f 84 b5 00 00 00    	je     125d8 <@AtapiPacketInterrupt@4+0x168>
   12523:	8b 55 f0             	mov    0xfffffff0(%ebp),%edx
   12526:	8b 8e 20 04 00 00    	mov    0x420(%esi),%ecx
   1252c:	8b 42 0c             	mov    0xc(%edx),%eax
   1252f:	a8 40                	test   $0x40,%al
   12531:	0f 84 b6 00 00 00    	je     125ed <@AtapiPacketInterrupt@4+0x17d>
   12537:	8b 86 24 04 00 00    	mov    0x424(%esi),%eax
   1253d:	39 f8                	cmp    %edi,%eax
   1253f:	0f 86 8a 01 00 00    	jbe    126cf <@AtapiPacketInterrupt@4+0x25f>
   12545:	29 f8                	sub    %edi,%eax
   12547:	c7 45 e8 00 00 00 00 	movl   $0x0,0xffffffe8(%ebp)
   1254e:	89 86 24 04 00 00    	mov    %eax,0x424(%esi)
   12554:	8d 04 39             	lea    (%ecx,%edi,1),%eax
   12557:	8b 9e 10 04 00 00    	mov    0x410(%esi),%ebx
   1255d:	d1 ef                	shr    %edi
   1255f:	89 86 20 04 00 00    	mov    %eax,0x420(%esi)
   12565:	50                   	push   %eax
   12566:	57                   	push   %edi
   12567:	51                   	push   %ecx
   12568:	53                   	push   %ebx
   12569:	e8 c2 16 00 00       	call   13c30 <_ScsiPortReadPortBufferUshort@12>
   1256e:	8b 55 e8             	mov    0xffffffe8(%ebp),%edx
   12571:	59                   	pop    %ecx
   12572:	85 d2                	test   %edx,%edx
   12574:	0f 84 3a ff ff ff    	je     124b4 <@AtapiPacketInterrupt@4+0x44>
   1257a:	8b 45 ec             	mov    0xffffffec(%ebp),%eax
   1257d:	85 c0                	test   %eax,%eax
   1257f:	74 18                	je     12599 <@AtapiPacketInterrupt@4+0x129>
   12581:	83 ec 0c             	sub    $0xc,%esp
   12584:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   1258a:	50                   	push   %eax
   1258b:	e8 d0 16 00 00       	call   13c60 <_ScsiPortReadPortUshort@4>
   12590:	83 c4 0c             	add    $0xc,%esp
   12593:	83 6d ec 02          	subl   $0x2,0xffffffec(%ebp)
   12597:	75 e8                	jne    12581 <@AtapiPacketInterrupt@4+0x111>
   12599:	31 db                	xor    %ebx,%ebx
   1259b:	eb 11                	jmp    125ae <@AtapiPacketInterrupt@4+0x13e>
   1259d:	8d 76 00             	lea    0x0(%esi),%esi
   125a0:	83 ec 0c             	sub    $0xc,%esp
   125a3:	43                   	inc    %ebx
   125a4:	6a 0a                	push   $0xa
   125a6:	e8 75 16 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   125ab:	83 c4 0c             	add    $0xc,%esp
   125ae:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   125b4:	0f 87 e7 00 00 00    	ja     126a1 <@AtapiPacketInterrupt@4+0x231>
   125ba:	83 ec 0c             	sub    $0xc,%esp
   125bd:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   125c3:	83 c0 07             	add    $0x7,%eax
   125c6:	50                   	push   %eax
   125c7:	e8 34 16 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   125cc:	83 c4 0c             	add    $0xc,%esp
   125cf:	84 c0                	test   %al,%al
   125d1:	78 cd                	js     125a0 <@AtapiPacketInterrupt@4+0x130>
   125d3:	e9 c9 00 00 00       	jmp    126a1 <@AtapiPacketInterrupt@4+0x231>
   125d8:	8b 96 24 04 00 00    	mov    0x424(%esi),%edx
   125de:	b0 01                	mov    $0x1,%al
   125e0:	85 d2                	test   %edx,%edx
   125e2:	75 48                	jne    1262c <@AtapiPacketInterrupt@4+0x1bc>
   125e4:	31 d2                	xor    %edx,%edx
   125e6:	88 c2                	mov    %al,%dl
   125e8:	e9 c0 fe ff ff       	jmp    124ad <@AtapiPacketInterrupt@4+0x3d>
   125ed:	a9 80 00 00 00       	test   $0x80,%eax
   125f2:	0f 84 cd 00 00 00    	je     126c5 <@AtapiPacketInterrupt@4+0x255>
   125f8:	8b 96 24 04 00 00    	mov    0x424(%esi),%edx
   125fe:	39 fa                	cmp    %edi,%edx
   12600:	73 02                	jae    12604 <@AtapiPacketInterrupt@4+0x194>
   12602:	89 d7                	mov    %edx,%edi
   12604:	8d 04 39             	lea    (%ecx,%edi,1),%eax
   12607:	29 fa                	sub    %edi,%edx
   12609:	89 86 20 04 00 00    	mov    %eax,0x420(%esi)
   1260f:	8b 9e 10 04 00 00    	mov    0x410(%esi),%ebx
   12615:	d1 ef                	shr    %edi
   12617:	89 96 24 04 00 00    	mov    %edx,0x424(%esi)
   1261d:	50                   	push   %eax
   1261e:	57                   	push   %edi
   1261f:	51                   	push   %ecx
   12620:	53                   	push   %ebx
   12621:	e8 4a 16 00 00       	call   13c70 <_ScsiPortWritePortBufferUshort@12>
   12626:	59                   	pop    %ecx
   12627:	e9 88 fe ff ff       	jmp    124b4 <@AtapiPacketInterrupt@4+0x44>
   1262c:	50                   	push   %eax
   1262d:	68 b7 0a 00 00       	push   $0xab7
   12632:	68 08 40 01 00       	push   $0x14008
   12637:	68 10 40 01 00       	push   $0x14010
   1263c:	e8 9f 16 00 00       	call   13ce0 <_DbgPrint>
   12641:	8b 55 f0             	mov    0xfffffff0(%ebp),%edx
   12644:	83 c4 0c             	add    $0xc,%esp
   12647:	31 c0                	xor    %eax,%eax
   12649:	8a 42 30             	mov    0x30(%edx),%al
   1264c:	50                   	push   %eax
   1264d:	8b 86 24 04 00 00    	mov    0x424(%esi),%eax
   12653:	50                   	push   %eax
   12654:	68 c0 40 01 00       	push   $0x140c0
   12659:	e8 82 16 00 00       	call   13ce0 <_DbgPrint>
   1265e:	b0 12                	mov    $0x12,%al
   12660:	31 d2                	xor    %edx,%edx
   12662:	83 c4 10             	add    $0x10,%esp
   12665:	88 c2                	mov    %al,%dl
   12667:	e9 41 fe ff ff       	jmp    124ad <@AtapiPacketInterrupt@4+0x3d>
   1266c:	8d 74 26 00          	lea    0x0(%esi),%esi
   12670:	50                   	push   %eax
   12671:	68 ef 0a 00 00       	push   $0xaef
   12676:	68 08 40 01 00       	push   $0x14008
   1267b:	68 10 40 01 00       	push   $0x14010
   12680:	e8 5b 16 00 00       	call   13ce0 <_DbgPrint>
   12685:	c7 04 24 04 41 01 00 	movl   $0x14104,(%esp)
   1268c:	e8 4f 16 00 00       	call   13ce0 <_DbgPrint>
   12691:	58                   	pop    %eax
   12692:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   12698:	50                   	push   %eax
   12699:	e8 c2 15 00 00       	call   13c60 <_ScsiPortReadPortUshort@4>
   1269e:	83 c4 0c             	add    $0xc,%esp
   126a1:	83 ec 0c             	sub    $0xc,%esp
   126a4:	8b 86 10 04 00 00    	mov    0x410(%esi),%eax
   126aa:	83 c0 07             	add    $0x7,%eax
   126ad:	50                   	push   %eax
   126ae:	e8 4d 15 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   126b3:	83 c4 0c             	add    $0xc,%esp
   126b6:	a8 08                	test   $0x8,%al
   126b8:	75 b6                	jne    12670 <@AtapiPacketInterrupt@4+0x200>
   126ba:	8b 55 e8             	mov    0xffffffe8(%ebp),%edx
   126bd:	85 d2                	test   %edx,%edx
   126bf:	0f 84 ef fd ff ff    	je     124b4 <@AtapiPacketInterrupt@4+0x44>
   126c5:	ba 01 00 00 00       	mov    $0x1,%edx
   126ca:	e9 de fd ff ff       	jmp    124ad <@AtapiPacketInterrupt@4+0x3d>
   126cf:	29 c7                	sub    %eax,%edi
   126d1:	c7 86 24 04 00 00 00 	movl   $0x0,0x424(%esi)
   126d8:	00 00 00 
   126db:	89 7d ec             	mov    %edi,0xffffffec(%ebp)
   126de:	89 c7                	mov    %eax,%edi
   126e0:	c7 45 e8 01 00 00 00 	movl   $0x1,0xffffffe8(%ebp)
   126e7:	e9 68 fe ff ff       	jmp    12554 <@AtapiPacketInterrupt@4+0xe4>
   126ec:	8d 74 26 00          	lea    0x0(%esi),%esi

000126f0 <@AtapiNoDataInterrupt@4>:
   126f0:	55                   	push   %ebp
   126f1:	89 e5                	mov    %esp,%ebp
   126f3:	53                   	push   %ebx
   126f4:	83 ec 10             	sub    $0x10,%esp
   126f7:	89 cb                	mov    %ecx,%ebx
   126f9:	8b 81 10 04 00 00    	mov    0x410(%ecx),%eax
   126ff:	83 c0 07             	add    $0x7,%eax
   12702:	50                   	push   %eax
   12703:	e8 f8 14 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12708:	25 c9 00 00 00       	and    $0xc9,%eax
   1270d:	83 c4 0c             	add    $0xc,%esp
   12710:	83 f8 40             	cmp    $0x40,%eax
   12713:	89 d9                	mov    %ebx,%ecx
   12715:	0f 95 c2             	setne  %dl
   12718:	81 e2 ff 00 00 00    	and    $0xff,%edx
   1271e:	8d 54 52 01          	lea    0x1(%edx,%edx,2),%edx
   12722:	e8 89 fb ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   12727:	b8 01 00 00 00       	mov    $0x1,%eax
   1272c:	8b 5d fc             	mov    0xfffffffc(%ebp),%ebx
   1272f:	c9                   	leave  
   12730:	c3                   	ret    
   12731:	eb 0d                	jmp    12740 <@AtapiDmaInterrupt@4>
   12733:	90                   	nop    
   12734:	90                   	nop    
   12735:	90                   	nop    
   12736:	90                   	nop    
   12737:	90                   	nop    
   12738:	90                   	nop    
   12739:	90                   	nop    
   1273a:	90                   	nop    
   1273b:	90                   	nop    
   1273c:	90                   	nop    
   1273d:	90                   	nop    
   1273e:	90                   	nop    
   1273f:	90                   	nop    

00012740 <@AtapiDmaInterrupt@4>:
   12740:	55                   	push   %ebp
   12741:	89 e5                	mov    %esp,%ebp
   12743:	57                   	push   %edi
   12744:	56                   	push   %esi
   12745:	53                   	push   %ebx
   12746:	83 ec 18             	sub    $0x18,%esp
   12749:	c7 81 2c 04 00 00 00 	movl   $0x0,0x42c(%ecx)
   12750:	00 00 00 
   12753:	8b 81 18 04 00 00    	mov    0x418(%ecx),%eax
   12759:	89 cb                	mov    %ecx,%ebx
   1275b:	50                   	push   %eax
   1275c:	e8 9f 14 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12761:	25 fe 00 00 00       	and    $0xfe,%eax
   12766:	89 04 24             	mov    %eax,(%esp)
   12769:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   1276f:	50                   	push   %eax
   12770:	e8 9b 14 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   12775:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   1277b:	83 c0 02             	add    $0x2,%eax
   1277e:	57                   	push   %edi
   1277f:	50                   	push   %eax
   12780:	e8 7b 14 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12785:	89 c7                	mov    %eax,%edi
   12787:	83 c8 06             	or     $0x6,%eax
   1278a:	25 ff 00 00 00       	and    $0xff,%eax
   1278f:	89 04 24             	mov    %eax,(%esp)
   12792:	8b 83 18 04 00 00    	mov    0x418(%ebx),%eax
   12798:	83 c0 02             	add    $0x2,%eax
   1279b:	50                   	push   %eax
   1279c:	e8 6f 14 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   127a1:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   127a7:	83 c0 07             	add    $0x7,%eax
   127aa:	56                   	push   %esi
   127ab:	50                   	push   %eax
   127ac:	e8 4f 14 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   127b1:	89 c6                	mov    %eax,%esi
   127b3:	83 c4 0c             	add    $0xc,%esp
   127b6:	89 f0                	mov    %esi,%eax
   127b8:	25 e9 00 00 00       	and    $0xe9,%eax
   127bd:	83 f8 40             	cmp    $0x40,%eax
   127c0:	0f 84 90 00 00 00    	je     12856 <@AtapiDmaInterrupt@4+0x116>
   127c6:	51                   	push   %ecx
   127c7:	68 43 0b 00 00       	push   $0xb43
   127cc:	68 08 40 01 00       	push   $0x14008
   127d1:	68 10 40 01 00       	push   $0x14010
   127d6:	e8 05 15 00 00       	call   13ce0 <_DbgPrint>
   127db:	58                   	pop    %eax
   127dc:	89 f0                	mov    %esi,%eax
   127de:	5a                   	pop    %edx
   127df:	25 ff 00 00 00       	and    $0xff,%eax
   127e4:	50                   	push   %eax
   127e5:	68 2d 41 01 00       	push   $0x1412d
   127ea:	e8 f1 14 00 00       	call   13ce0 <_DbgPrint>
   127ef:	83 c4 0c             	add    $0xc,%esp
   127f2:	68 44 0b 00 00       	push   $0xb44
   127f7:	68 08 40 01 00       	push   $0x14008
   127fc:	68 10 40 01 00       	push   $0x14010
   12801:	e8 da 14 00 00       	call   13ce0 <_DbgPrint>
   12806:	89 f8                	mov    %edi,%eax
   12808:	59                   	pop    %ecx
   12809:	25 ff 00 00 00       	and    $0xff,%eax
   1280e:	5e                   	pop    %esi
   1280f:	50                   	push   %eax
   12810:	68 38 41 01 00       	push   $0x14138
   12815:	e8 c6 14 00 00       	call   13ce0 <_DbgPrint>
   1281a:	ba 04 00 00 00       	mov    $0x4,%edx
   1281f:	89 d9                	mov    %ebx,%ecx
   12821:	e8 8a fa ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   12826:	83 c4 0c             	add    $0xc,%esp
   12829:	68 46 0b 00 00       	push   $0xb46
   1282e:	68 08 40 01 00       	push   $0x14008
   12833:	68 10 40 01 00       	push   $0x14010
   12838:	e8 a3 14 00 00       	call   13ce0 <_DbgPrint>
   1283d:	c7 04 24 3c 41 01 00 	movl   $0x1413c,(%esp)
   12844:	e8 97 14 00 00       	call   13ce0 <_DbgPrint>
   12849:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   1284c:	b8 01 00 00 00       	mov    $0x1,%eax
   12851:	5b                   	pop    %ebx
   12852:	5e                   	pop    %esi
   12853:	5f                   	pop    %edi
   12854:	5d                   	pop    %ebp
   12855:	c3                   	ret    
   12856:	89 f8                	mov    %edi,%eax
   12858:	83 e0 07             	and    $0x7,%eax
   1285b:	83 f8 04             	cmp    $0x4,%eax
   1285e:	0f 85 62 ff ff ff    	jne    127c6 <@AtapiDmaInterrupt@4+0x86>
   12864:	ba 01 00 00 00       	mov    $0x1,%edx
   12869:	89 d9                	mov    %ebx,%ecx
   1286b:	e8 40 fa ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   12870:	eb d7                	jmp    12849 <@AtapiDmaInterrupt@4+0x109>
   12872:	8d b4 26 00 00 00 00 	lea    0x0(%esi),%esi
   12879:	8d bc 27 00 00 00 00 	lea    0x0(%edi),%edi

00012880 <@AtapiReadInterrupt@4>:
   12880:	55                   	push   %ebp
   12881:	89 e5                	mov    %esp,%ebp
   12883:	57                   	push   %edi
   12884:	56                   	push   %esi
   12885:	53                   	push   %ebx
   12886:	83 ec 18             	sub    $0x18,%esp
   12889:	89 cb                	mov    %ecx,%ebx
   1288b:	8b 81 10 04 00 00    	mov    0x410(%ecx),%eax
   12891:	8b b1 1c 04 00 00    	mov    0x41c(%ecx),%esi
   12897:	83 c0 07             	add    $0x7,%eax
   1289a:	50                   	push   %eax
   1289b:	e8 60 13 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   128a0:	31 d2                	xor    %edx,%edx
   128a2:	83 c4 0c             	add    $0xc,%esp
   128a5:	88 c2                	mov    %al,%dl
   128a7:	89 d0                	mov    %edx,%eax
   128a9:	25 89 00 00 00       	and    $0x89,%eax
   128ae:	83 f8 08             	cmp    $0x8,%eax
   128b1:	74 2d                	je     128e0 <@AtapiReadInterrupt@4+0x60>
   128b3:	31 c0                	xor    %eax,%eax
   128b5:	83 e2 09             	and    $0x9,%edx
   128b8:	75 08                	jne    128c2 <@AtapiReadInterrupt@4+0x42>
   128ba:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   128bd:	5b                   	pop    %ebx
   128be:	5e                   	pop    %esi
   128bf:	5f                   	pop    %edi
   128c0:	5d                   	pop    %ebp
   128c1:	c3                   	ret    
   128c2:	ba 04 00 00 00       	mov    $0x4,%edx
   128c7:	89 d9                	mov    %ebx,%ecx
   128c9:	e8 e2 f9 ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   128ce:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   128d1:	b8 01 00 00 00       	mov    $0x1,%eax
   128d6:	5b                   	pop    %ebx
   128d7:	5e                   	pop    %esi
   128d8:	5f                   	pop    %edi
   128d9:	5d                   	pop    %ebp
   128da:	c3                   	ret    
   128db:	90                   	nop    
   128dc:	8d 74 26 00          	lea    0x0(%esi),%esi
   128e0:	31 c0                	xor    %eax,%eax
   128e2:	8b 8b 20 04 00 00    	mov    0x420(%ebx),%ecx
   128e8:	8a 46 06             	mov    0x6(%esi),%al
   128eb:	8b 94 83 08 04 00 00 	mov    0x408(%ebx,%eax,4),%edx
   128f2:	8b 83 24 04 00 00    	mov    0x424(%ebx),%eax
   128f8:	39 d0                	cmp    %edx,%eax
   128fa:	76 44                	jbe    12940 <@AtapiReadInterrupt@4+0xc0>
   128fc:	29 d0                	sub    %edx,%eax
   128fe:	31 ff                	xor    %edi,%edi
   12900:	89 83 24 04 00 00    	mov    %eax,0x424(%ebx)
   12906:	8d 04 11             	lea    (%ecx,%edx,1),%eax
   12909:	89 83 20 04 00 00    	mov    %eax,0x420(%ebx)
   1290f:	31 c0                	xor    %eax,%eax
   12911:	8a 46 06             	mov    0x6(%esi),%al
   12914:	f6 84 83 00 04 00 00 	testb  $0x8,0x400(%ebx,%eax,4)
   1291b:	08 
   1291c:	74 4b                	je     12969 <@AtapiReadInterrupt@4+0xe9>
   1291e:	c1 ea 02             	shr    $0x2,%edx
   12921:	56                   	push   %esi
   12922:	52                   	push   %edx
   12923:	51                   	push   %ecx
   12924:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   1292a:	50                   	push   %eax
   1292b:	e8 50 13 00 00       	call   13c80 <_ScsiPortReadPortBufferUlong@12>
   12930:	58                   	pop    %eax
   12931:	89 f8                	mov    %edi,%eax
   12933:	84 c0                	test   %al,%al
   12935:	74 97                	je     128ce <@AtapiReadInterrupt@4+0x4e>
   12937:	ba 01 00 00 00       	mov    $0x1,%edx
   1293c:	eb 89                	jmp    128c7 <@AtapiReadInterrupt@4+0x47>
   1293e:	89 f6                	mov    %esi,%esi
   12940:	89 c2                	mov    %eax,%edx
   12942:	c7 83 24 04 00 00 00 	movl   $0x0,0x424(%ebx)
   12949:	00 00 00 
   1294c:	bf 01 00 00 00       	mov    $0x1,%edi
   12951:	8d 04 11             	lea    (%ecx,%edx,1),%eax
   12954:	89 83 20 04 00 00    	mov    %eax,0x420(%ebx)
   1295a:	31 c0                	xor    %eax,%eax
   1295c:	8a 46 06             	mov    0x6(%esi),%al
   1295f:	f6 84 83 00 04 00 00 	testb  $0x8,0x400(%ebx,%eax,4)
   12966:	08 
   12967:	75 b5                	jne    1291e <@AtapiReadInterrupt@4+0x9e>
   12969:	d1 ea                	shr    %edx
   1296b:	50                   	push   %eax
   1296c:	52                   	push   %edx
   1296d:	51                   	push   %ecx
   1296e:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   12974:	50                   	push   %eax
   12975:	e8 b6 12 00 00       	call   13c30 <_ScsiPortReadPortBufferUshort@12>
   1297a:	eb b4                	jmp    12930 <@AtapiReadInterrupt@4+0xb0>
   1297c:	8d 74 26 00          	lea    0x0(%esi),%esi

00012980 <@AtapiWriteInterrupt@4>:
   12980:	55                   	push   %ebp
   12981:	89 e5                	mov    %esp,%ebp
   12983:	57                   	push   %edi
   12984:	56                   	push   %esi
   12985:	53                   	push   %ebx
   12986:	83 ec 18             	sub    $0x18,%esp
   12989:	89 cb                	mov    %ecx,%ebx
   1298b:	8b 81 10 04 00 00    	mov    0x410(%ecx),%eax
   12991:	83 c0 07             	add    $0x7,%eax
   12994:	50                   	push   %eax
   12995:	e8 66 12 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1299a:	88 c2                	mov    %al,%dl
   1299c:	89 c7                	mov    %eax,%edi
   1299e:	81 e2 ff 00 00 00    	and    $0xff,%edx
   129a4:	83 c4 0c             	add    $0xc,%esp
   129a7:	89 d0                	mov    %edx,%eax
   129a9:	25 e1 00 00 00       	and    $0xe1,%eax
   129ae:	83 f8 40             	cmp    $0x40,%eax
   129b1:	74 2d                	je     129e0 <@AtapiWriteInterrupt@4+0x60>
   129b3:	31 c0                	xor    %eax,%eax
   129b5:	83 e2 61             	and    $0x61,%edx
   129b8:	75 08                	jne    129c2 <@AtapiWriteInterrupt@4+0x42>
   129ba:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   129bd:	5b                   	pop    %ebx
   129be:	5e                   	pop    %esi
   129bf:	5f                   	pop    %edi
   129c0:	5d                   	pop    %ebp
   129c1:	c3                   	ret    
   129c2:	ba 04 00 00 00       	mov    $0x4,%edx
   129c7:	89 d9                	mov    %ebx,%ecx
   129c9:	e8 e2 f8 ff ff       	call   122b0 <@AtapiCompleteRequest@8>
   129ce:	b8 01 00 00 00       	mov    $0x1,%eax
   129d3:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   129d6:	5b                   	pop    %ebx
   129d7:	5e                   	pop    %esi
   129d8:	5f                   	pop    %edi
   129d9:	5d                   	pop    %ebp
   129da:	c3                   	ret    
   129db:	90                   	nop    
   129dc:	8d 74 26 00          	lea    0x0(%esi),%esi
   129e0:	8b 83 1c 04 00 00    	mov    0x41c(%ebx),%eax
   129e6:	89 c1                	mov    %eax,%ecx
   129e8:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   129eb:	31 c0                	xor    %eax,%eax
   129ed:	8a 41 06             	mov    0x6(%ecx),%al
   129f0:	8b 8b 24 04 00 00    	mov    0x424(%ebx),%ecx
   129f6:	8b b4 83 08 04 00 00 	mov    0x408(%ebx,%eax,4),%esi
   129fd:	39 f1                	cmp    %esi,%ecx
   129ff:	72 4f                	jb     12a50 <@AtapiWriteInterrupt@4+0xd0>
   12a01:	85 f6                	test   %esi,%esi
   12a03:	74 51                	je     12a56 <@AtapiWriteInterrupt@4+0xd6>
   12a05:	83 e2 08             	and    $0x8,%edx
   12a08:	74 4c                	je     12a56 <@AtapiWriteInterrupt@4+0xd6>
   12a0a:	8b 93 20 04 00 00    	mov    0x420(%ebx),%edx
   12a10:	29 f1                	sub    %esi,%ecx
   12a12:	89 8b 24 04 00 00    	mov    %ecx,0x424(%ebx)
   12a18:	8b 4d f0             	mov    0xfffffff0(%ebp),%ecx
   12a1b:	8d 04 32             	lea    (%edx,%esi,1),%eax
   12a1e:	89 83 20 04 00 00    	mov    %eax,0x420(%ebx)
   12a24:	31 c0                	xor    %eax,%eax
   12a26:	8a 41 06             	mov    0x6(%ecx),%al
   12a29:	f6 84 83 00 04 00 00 	testb  $0x8,0x400(%ebx,%eax,4)
   12a30:	08 
   12a31:	74 36                	je     12a69 <@AtapiWriteInterrupt@4+0xe9>
   12a33:	c1 ee 02             	shr    $0x2,%esi
   12a36:	51                   	push   %ecx
   12a37:	56                   	push   %esi
   12a38:	52                   	push   %edx
   12a39:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   12a3f:	50                   	push   %eax
   12a40:	e8 4b 12 00 00       	call   13c90 <_ScsiPortWritePortBufferUlong@12>
   12a45:	58                   	pop    %eax
   12a46:	b8 01 00 00 00       	mov    $0x1,%eax
   12a4b:	eb 86                	jmp    129d3 <@AtapiWriteInterrupt@4+0x53>
   12a4d:	8d 76 00             	lea    0x0(%esi),%esi
   12a50:	89 ce                	mov    %ecx,%esi
   12a52:	85 f6                	test   %esi,%esi
   12a54:	75 af                	jne    12a05 <@AtapiWriteInterrupt@4+0x85>
   12a56:	83 e7 08             	and    $0x8,%edi
   12a59:	75 04                	jne    12a5f <@AtapiWriteInterrupt@4+0xdf>
   12a5b:	85 f6                	test   %esi,%esi
   12a5d:	75 1e                	jne    12a7d <@AtapiWriteInterrupt@4+0xfd>
   12a5f:	ba 01 00 00 00       	mov    $0x1,%edx
   12a64:	e9 5e ff ff ff       	jmp    129c7 <@AtapiWriteInterrupt@4+0x47>
   12a69:	d1 ee                	shr    %esi
   12a6b:	50                   	push   %eax
   12a6c:	56                   	push   %esi
   12a6d:	52                   	push   %edx
   12a6e:	8b 83 10 04 00 00    	mov    0x410(%ebx),%eax
   12a74:	50                   	push   %eax
   12a75:	e8 f6 11 00 00       	call   13c70 <_ScsiPortWritePortBufferUshort@12>
   12a7a:	58                   	pop    %eax
   12a7b:	eb c9                	jmp    12a46 <@AtapiWriteInterrupt@4+0xc6>
   12a7d:	50                   	push   %eax
   12a7e:	68 c9 0b 00 00       	push   $0xbc9
   12a83:	68 08 40 01 00       	push   $0x14008
   12a88:	68 10 40 01 00       	push   $0x14010
   12a8d:	e8 4e 12 00 00       	call   13ce0 <_DbgPrint>
   12a92:	5f                   	pop    %edi
   12a93:	58                   	pop    %eax
   12a94:	56                   	push   %esi
   12a95:	68 5c 41 01 00       	push   $0x1415c
   12a9a:	e8 41 12 00 00       	call   13ce0 <_DbgPrint>
   12a9f:	83 c4 10             	add    $0x10,%esp
   12aa2:	ba 01 00 00 00       	mov    $0x1,%edx
   12aa7:	e9 1b ff ff ff       	jmp    129c7 <@AtapiWriteInterrupt@4+0x47>
   12aac:	8d 74 26 00          	lea    0x0(%esi),%esi

00012ab0 <_AtapiInitDma>:
}

#ifdef ENABLE_DMA
static BOOLEAN
AtapiInitDma(PATAPI_MINIPORT_EXTENSION DevExt,
	     PSCSI_REQUEST_BLOCK Srb,
	     BYTE cmd)
{
   12ab0:	55                   	push   %ebp
   12ab1:	89 e5                	mov    %esp,%ebp
   12ab3:	57                   	push   %edi
   12ab4:	56                   	push   %esi
   12ab5:	53                   	push   %ebx
   12ab6:	83 ec 2c             	sub    $0x2c,%esp
   12ab9:	89 55 e8             	mov    %edx,0xffffffe8(%ebp)
   12abc:	89 45 ec             	mov    %eax,0xffffffec(%ebp)
   12abf:	8a 45 08             	mov    0x8(%ebp),%al
   12ac2:	88 45 e7             	mov    %al,0xffffffe7(%ebp)
  PVOID StartAddress;
  PVOID EndAddress;
  PPRD PRDEntry = DevExt->PRDTable;
  SCSI_PHYSICAL_ADDRESS PhysicalAddress;
  ULONG Length;
  ULONG tmpLength;
  BYTE Status;

  DPRINT("AtapiInitDma()\n");

  StartAddress = Srb->DataBuffer;
   12ac5:	8b 75 e8             	mov    0xffffffe8(%ebp),%esi
  EndAddress = StartAddress + Srb->DataTransferLength;
   12ac8:	8b 45 e8             	mov    0xffffffe8(%ebp),%eax
   12acb:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   12ace:	8b 76 18             	mov    0x18(%esi),%esi
   12ad1:	8b 48 10             	mov    0x10(%eax),%ecx
   12ad4:	89 75 e0             	mov    %esi,0xffffffe0(%ebp)
   12ad7:	01 ce                	add    %ecx,%esi
   12ad9:	8b ba 38 04 00 00    	mov    0x438(%edx),%edi
   12adf:	89 75 dc             	mov    %esi,0xffffffdc(%ebp)
  DevExt->PRDCount = 0;
   12ae2:	c7 82 30 04 00 00 00 	movl   $0x0,0x430(%edx)
   12ae9:	00 00 00 

  while (StartAddress < EndAddress)
    {
      PhysicalAddress = ScsiPortGetPhysicalAddress(DevExt, Srb, StartAddress, &Length);
      if (PhysicalAddress.QuadPart == 0LL || Length == 0)
        {
	  return FALSE;
	}

      while (Length)
        {
	  /* calculate the length up to the next 64k boundary */ 
	  tmpLength = 0x10000 - (PhysicalAddress.u.LowPart & 0xffff);
	  if (tmpLength > Length)
	    {
	      tmpLength = Length;
	    }
	  DevExt->PRDCount++;
	  if (DevExt->PRDCount > DevExt->PRDMaxCount)
	    {
	      return FALSE;
	    }
	  if (tmpLength == 0x10000)
	    {
	      /* Some dirty controllers cannot handle 64k transfers. We split a 64k transfer in two 32k. */ 
	      tmpLength = 0x8000;
	      DPRINT("PRD Nr. %d VirtualAddress %08x PhysicalAddress %08x, Length %04x\n", 
		     DevExt->PRDCount - 1, StartAddress, PhysicalAddress.u.LowPart, tmpLength);
	      PRDEntry->PhysAddress = PhysicalAddress.u.LowPart;
	      PRDEntry->Length = tmpLength;
	      PRDEntry++;
	      DevExt->PRDCount++;
	      if (DevExt->PRDCount > DevExt->PRDMaxCount)
	        {
	          return FALSE;
	        }
              PhysicalAddress.u.LowPart += tmpLength;
	      StartAddress += tmpLength;
	      Length -= tmpLength;
	      PRDEntry->PhysAddress = PhysicalAddress.u.LowPart;
	    }
	  DPRINT("PRD Nr. %d VirtualAddress %08x PhysicalAddress %08x, Length %04x\n", 
		 DevExt->PRDCount - 1, StartAddress, PhysicalAddress.u.LowPart, tmpLength);
	  PRDEntry->PhysAddress = PhysicalAddress.u.LowPart;
          PRDEntry->Length = tmpLength;
          PRDEntry++;
          StartAddress += tmpLength;
          PhysicalAddress.u.LowPart += tmpLength; 
	  Length -= tmpLength;
   12aec:	39 75 e0             	cmp    %esi,0xffffffe0(%ebp)
   12aef:	0f 83 0f 01 00 00    	jae    12c04 <_AtapiInitDma+0x154>
   12af5:	8d 55 f0             	lea    0xfffffff0(%ebp),%edx
   12af8:	52                   	push   %edx
   12af9:	8b 5d e0             	mov    0xffffffe0(%ebp),%ebx
   12afc:	53                   	push   %ebx
   12afd:	8b 4d e8             	mov    0xffffffe8(%ebp),%ecx
   12b00:	51                   	push   %ecx
   12b01:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   12b04:	52                   	push   %edx
   12b05:	e8 d6 10 00 00       	call   13be0 <_ScsiPortGetPhysicalAddress@16>
   12b0a:	89 d1                	mov    %edx,%ecx
   12b0c:	89 c2                	mov    %eax,%edx
   12b0e:	89 ce                	mov    %ecx,%esi
   12b10:	09 c6                	or     %eax,%esi
   12b12:	0f 84 5e 01 00 00    	je     12c76 <_AtapiInitDma+0x1c6>
   12b18:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   12b1b:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
   12b1e:	85 c0                	test   %eax,%eax
   12b20:	75 2b                	jne    12b4d <_AtapiInitDma+0x9d>
   12b22:	e9 4f 01 00 00       	jmp    12c76 <_AtapiInitDma+0x1c6>
   12b27:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
   12b2a:	89 17                	mov    %edx,(%edi)
   12b2c:	01 d8                	add    %ebx,%eax
   12b2e:	89 5f 04             	mov    %ebx,0x4(%edi)
   12b31:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
   12b34:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   12b37:	29 d8                	sub    %ebx,%eax
   12b39:	83 c7 08             	add    $0x8,%edi
   12b3c:	8d 14 13             	lea    (%ebx,%edx,1),%edx
   12b3f:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   12b42:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
   12b45:	85 c0                	test   %eax,%eax
   12b47:	0f 84 ab 00 00 00    	je     12bf8 <_AtapiInitDma+0x148>
   12b4d:	0f b7 c2             	movzwl %dx,%eax
   12b50:	bb 00 00 01 00       	mov    $0x10000,%ebx
   12b55:	29 c3                	sub    %eax,%ebx
   12b57:	3b 5d d4             	cmp    0xffffffd4(%ebp),%ebx
   12b5a:	76 03                	jbe    12b5f <_AtapiInitDma+0xaf>
   12b5c:	8b 5d d4             	mov    0xffffffd4(%ebp),%ebx
   12b5f:	8b 75 ec             	mov    0xffffffec(%ebp),%esi
   12b62:	8b 86 30 04 00 00    	mov    0x430(%esi),%eax
   12b68:	40                   	inc    %eax
   12b69:	89 86 30 04 00 00    	mov    %eax,0x430(%esi)
   12b6f:	3b 86 34 04 00 00    	cmp    0x434(%esi),%eax
   12b75:	0f 87 fb 00 00 00    	ja     12c76 <_AtapiInitDma+0x1c6>
   12b7b:	81 fb 00 00 01 00    	cmp    $0x10000,%ebx
   12b81:	75 a4                	jne    12b27 <_AtapiInitDma+0x77>
   12b83:	8b 75 ec             	mov    0xffffffec(%ebp),%esi
   12b86:	89 17                	mov    %edx,(%edi)
   12b88:	c7 47 04 00 80 00 00 	movl   $0x8000,0x4(%edi)
   12b8f:	bb 00 80 00 00       	mov    $0x8000,%ebx
   12b94:	8b 86 30 04 00 00    	mov    0x430(%esi),%eax
   12b9a:	83 c7 08             	add    $0x8,%edi
   12b9d:	40                   	inc    %eax
   12b9e:	89 86 30 04 00 00    	mov    %eax,0x430(%esi)
   12ba4:	3b 86 34 04 00 00    	cmp    0x434(%esi),%eax
   12baa:	0f 87 c6 00 00 00    	ja     12c76 <_AtapiInitDma+0x1c6>
   12bb0:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
   12bb3:	81 c2 00 80 00 00    	add    $0x8000,%edx
   12bb9:	05 00 80 00 00       	add    $0x8000,%eax
   12bbe:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
   12bc1:	8b 45 d4             	mov    0xffffffd4(%ebp),%eax
   12bc4:	2d 00 80 00 00       	sub    $0x8000,%eax
   12bc9:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
   12bcc:	8b 45 e0             	mov    0xffffffe0(%ebp),%eax
   12bcf:	8b 75 d4             	mov    0xffffffd4(%ebp),%esi
   12bd2:	01 d8                	add    %ebx,%eax
   12bd4:	89 75 f0             	mov    %esi,0xfffffff0(%ebp)
   12bd7:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
   12bda:	8b 45 f0             	mov    0xfffffff0(%ebp),%eax
   12bdd:	89 17                	mov    %edx,(%edi)
   12bdf:	29 d8                	sub    %ebx,%eax
   12be1:	89 5f 04             	mov    %ebx,0x4(%edi)
   12be4:	8d 14 13             	lea    (%ebx,%edx,1),%edx
   12be7:	83 c7 08             	add    $0x8,%edi
   12bea:	89 45 f0             	mov    %eax,0xfffffff0(%ebp)
   12bed:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
   12bf0:	85 c0                	test   %eax,%eax
   12bf2:	0f 85 55 ff ff ff    	jne    12b4d <_AtapiInitDma+0x9d>
   12bf8:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
   12bfb:	39 45 e0             	cmp    %eax,0xffffffe0(%ebp)
   12bfe:	0f 82 f1 fe ff ff    	jb     12af5 <_AtapiInitDma+0x45>
	}
    }
  /* set the end marker in the last PRD */
  PRDEntry--;
  PRDEntry->Length |= 0x80000000;
   12c04:	8b 47 fc             	mov    0xfffffffc(%edi),%eax
   12c07:	0d 00 00 00 80       	or     $0x80000000,%eax
   12c0c:	89 47 fc             	mov    %eax,0xfffffffc(%edi)
  /* set the PDR table */
  IDEWritePRDTable(DevExt->BusMasterRegisterBase, DevExt->PRDTablePhysicalAddress.u.LowPart);
   12c0f:	50                   	push   %eax
   12c10:	50                   	push   %eax
   12c11:	8b 55 ec             	mov    0xffffffec(%ebp),%edx
   12c14:	8b 82 40 04 00 00    	mov    0x440(%edx),%eax
   12c1a:	50                   	push   %eax
   12c1b:	8b 82 18 04 00 00    	mov    0x418(%edx),%eax
   12c21:	83 c0 04             	add    $0x4,%eax
   12c24:	50                   	push   %eax
   12c25:	e8 76 10 00 00       	call   13ca0 <_ScsiPortWritePortUlong@8>
  /* write the DMA command */
  IDEWriteDMACommand(DevExt->BusMasterRegisterBase, cmd);
   12c2a:	31 c0                	xor    %eax,%eax
   12c2c:	8a 45 e7             	mov    0xffffffe7(%ebp),%al
   12c2f:	50                   	push   %eax
   12c30:	8b 75 ec             	mov    0xffffffec(%ebp),%esi
   12c33:	8b be 18 04 00 00    	mov    0x418(%esi),%edi
   12c39:	57                   	push   %edi
   12c3a:	e8 d1 0f 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
  /* reset the status and interrupt bit */
  Status = IDEReadDMAStatus(DevExt->BusMasterRegisterBase);
   12c3f:	53                   	push   %ebx
   12c40:	8b 86 18 04 00 00    	mov    0x418(%esi),%eax
   12c46:	83 c0 02             	add    $0x2,%eax
   12c49:	50                   	push   %eax
   12c4a:	e8 b1 0f 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
  IDEWriteDMAStatus(DevExt->BusMasterRegisterBase, Status | 0x06);
   12c4f:	83 c8 06             	or     $0x6,%eax
   12c52:	25 ff 00 00 00       	and    $0xff,%eax
   12c57:	89 04 24             	mov    %eax,(%esp)
   12c5a:	8b 86 18 04 00 00    	mov    0x418(%esi),%eax
   12c60:	83 c0 02             	add    $0x2,%eax
   12c63:	50                   	push   %eax
   12c64:	e8 a7 0f 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
  return TRUE;
}
   12c69:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12c6c:	b8 01 00 00 00       	mov    $0x1,%eax
   12c71:	5b                   	pop    %ebx
   12c72:	5e                   	pop    %esi
   12c73:	5f                   	pop    %edi
   12c74:	5d                   	pop    %ebp
   12c75:	c3                   	ret    
   12c76:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12c79:	31 c0                	xor    %eax,%eax
   12c7b:	5b                   	pop    %ebx
   12c7c:	5e                   	pop    %esi
   12c7d:	5f                   	pop    %edi
   12c7e:	5d                   	pop    %ebp
   12c7f:	c3                   	ret    

00012c80 <_AtapiStartIo@8>:
   12c80:	55                   	push   %ebp
   12c81:	31 c0                	xor    %eax,%eax
   12c83:	89 e5                	mov    %esp,%ebp
   12c85:	57                   	push   %edi
   12c86:	56                   	push   %esi
   12c87:	53                   	push   %ebx
   12c88:	81 ec ac 00 00 00    	sub    $0xac,%esp
   12c8e:	66 c7 45 b8 00 00    	movw   $0x0,0xffffffb8(%ebp)
   12c94:	8b 75 0c             	mov    0xc(%ebp),%esi
   12c97:	66 c7 45 a8 00 00    	movw   $0x0,0xffffffa8(%ebp)
   12c9d:	66 c7 45 88 00 00    	movw   $0x0,0xffffff88(%ebp)
   12ca3:	8b 7d 08             	mov    0x8(%ebp),%edi
   12ca6:	8a 46 02             	mov    0x2(%esi),%al
   12ca9:	85 c0                	test   %eax,%eax
   12cab:	74 28                	je     12cd5 <_AtapiStartIo@8+0x55>
   12cad:	83 f8 10             	cmp    $0x10,%eax
   12cb0:	0f 84 00 03 00 00    	je     12fb6 <_AtapiStartIo@8+0x336>
   12cb6:	b8 06 00 00 00       	mov    $0x6,%eax
   12cbb:	88 46 03             	mov    %al,0x3(%esi)
   12cbe:	85 c0                	test   %eax,%eax
   12cc0:	0f 85 ba 02 00 00    	jne    12f80 <_AtapiStartIo@8+0x300>
   12cc6:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12cc9:	b8 01 00 00 00       	mov    $0x1,%eax
   12cce:	5b                   	pop    %ebx
   12ccf:	5e                   	pop    %esi
   12cd0:	5f                   	pop    %edi
   12cd1:	5d                   	pop    %ebp
   12cd2:	c2 08 00             	ret    $0x8
   12cd5:	89 b7 1c 04 00 00    	mov    %esi,0x41c(%edi)
   12cdb:	31 c0                	xor    %eax,%eax
   12cdd:	8a 5e 06             	mov    0x6(%esi),%bl
   12ce0:	88 d8                	mov    %bl,%al
   12ce2:	8b 94 87 00 04 00 00 	mov    0x400(%edi,%eax,4),%edx
   12ce9:	f6 c2 02             	test   $0x2,%dl
   12cec:	0f 84 3e 02 00 00    	je     12f30 <_AtapiStartIo@8+0x2b0>
   12cf2:	b8 07 00 00 00       	mov    $0x7,%eax
   12cf7:	80 7e 05 00          	cmpb   $0x0,0x5(%esi)
   12cfb:	75 be                	jne    12cbb <_AtapiStartIo@8+0x3b>
   12cfd:	b0 21                	mov    $0x21,%al
   12cff:	80 fb 01             	cmp    $0x1,%bl
   12d02:	77 b7                	ja     12cbb <_AtapiStartIo@8+0x3b>
   12d04:	b0 20                	mov    $0x20,%al
   12d06:	80 7e 07 00          	cmpb   $0x0,0x7(%esi)
   12d0a:	75 af                	jne    12cbb <_AtapiStartIo@8+0x3b>
   12d0c:	83 e2 01             	and    $0x1,%edx
   12d0f:	b0 08                	mov    $0x8,%al
   12d11:	74 a8                	je     12cbb <_AtapiStartIo@8+0x3b>
   12d13:	8a 56 30             	mov    0x30(%esi),%dl
   12d16:	b0 06                	mov    $0x6,%al
   12d18:	80 fa 1a             	cmp    $0x1a,%dl
   12d1b:	74 9e                	je     12cbb <_AtapiStartIo@8+0x3b>
   12d1d:	80 fa 12             	cmp    $0x12,%dl
   12d20:	0f 84 c7 09 00 00    	je     136ed <_AtapiStartIo@8+0xa6d>
   12d26:	8b 46 18             	mov    0x18(%esi),%eax
   12d29:	31 db                	xor    %ebx,%ebx
   12d2b:	89 87 20 04 00 00    	mov    %eax,0x420(%edi)
   12d31:	8b 46 10             	mov    0x10(%esi),%eax
   12d34:	89 87 24 04 00 00    	mov    %eax,0x424(%edi)
   12d3a:	89 b7 1c 04 00 00    	mov    %esi,0x41c(%edi)
   12d40:	eb 1a                	jmp    12d5c <_AtapiStartIo@8+0xdc>
   12d42:	83 ec 0c             	sub    $0xc,%esp
   12d45:	43                   	inc    %ebx
   12d46:	6a 0a                	push   $0xa
   12d48:	e8 d3 0e 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   12d4d:	83 c4 0c             	add    $0xc,%esp
   12d50:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   12d56:	0f 87 70 02 00 00    	ja     12fcc <_AtapiStartIo@8+0x34c>
   12d5c:	83 ec 0c             	sub    $0xc,%esp
   12d5f:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12d65:	83 c0 07             	add    $0x7,%eax
   12d68:	50                   	push   %eax
   12d69:	e8 92 0e 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12d6e:	83 c4 0c             	add    $0xc,%esp
   12d71:	84 c0                	test   %al,%al
   12d73:	78 cd                	js     12d42 <_AtapiStartIo@8+0xc2>
   12d75:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   12d7b:	0f 87 4b 02 00 00    	ja     12fcc <_AtapiStartIo@8+0x34c>
   12d81:	50                   	push   %eax
   12d82:	50                   	push   %eax
   12d83:	8a 46 06             	mov    0x6(%esi),%al
   12d86:	3c 01                	cmp    $0x1,%al
   12d88:	19 c0                	sbb    %eax,%eax
   12d8a:	83 e0 f0             	and    $0xfffffff0,%eax
   12d8d:	05 b0 00 00 00       	add    $0xb0,%eax
   12d92:	50                   	push   %eax
   12d93:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12d99:	83 c0 06             	add    $0x6,%eax
   12d9c:	50                   	push   %eax
   12d9d:	e8 6e 0e 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   12da2:	50                   	push   %eax
   12da3:	6a 32                	push   $0x32
   12da5:	e8 76 0e 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   12daa:	31 c0                	xor    %eax,%eax
   12dac:	8a 46 06             	mov    0x6(%esi),%al
   12daf:	83 c4 0c             	add    $0xc,%esp
   12db2:	f6 84 87 00 04 00 00 	testb  $0x40,0x400(%edi,%eax,4)
   12db9:	40 
   12dba:	0f 84 c0 08 00 00    	je     13680 <_AtapiStartIo@8+0xa00>
   12dc0:	8a 46 30             	mov    0x30(%esi),%al
   12dc3:	3c 28                	cmp    $0x28,%al
   12dc5:	0f 94 c2             	sete   %dl
   12dc8:	3c 2a                	cmp    $0x2a,%al
   12dca:	0f 94 c0             	sete   %al
   12dcd:	09 d0                	or     %edx,%eax
   12dcf:	a8 01                	test   $0x1,%al
   12dd1:	0f 84 a9 08 00 00    	je     13680 <_AtapiStartIo@8+0xa00>
   12dd7:	8b 46 0c             	mov    0xc(%esi),%eax
   12dda:	83 ec 0c             	sub    $0xc,%esp
   12ddd:	c1 e8 06             	shr    $0x6,%eax
   12de0:	89 f2                	mov    %esi,%edx
   12de2:	83 e0 01             	and    $0x1,%eax
   12de5:	83 f8 01             	cmp    $0x1,%eax
   12de8:	19 c0                	sbb    %eax,%eax
   12dea:	83 f0 ff             	xor    $0xffffffff,%eax
   12ded:	83 e0 08             	and    $0x8,%eax
   12df0:	50                   	push   %eax
   12df1:	89 f8                	mov    %edi,%eax
   12df3:	e8 b8 fc ff ff       	call   12ab0 <_AtapiInitDma>
   12df8:	83 c4 10             	add    $0x10,%esp
   12dfb:	25 ff 00 00 00       	and    $0xff,%eax
   12e00:	89 87 2c 04 00 00    	mov    %eax,0x42c(%edi)
   12e06:	8b 87 24 04 00 00    	mov    0x424(%edi),%eax
   12e0c:	c6 45 df ff          	movb   $0xff,0xffffffdf(%ebp)
   12e10:	b3 ff                	mov    $0xff,%bl
   12e12:	3d ff ff 00 00       	cmp    $0xffff,%eax
   12e17:	77 08                	ja     12e21 <_AtapiStartIo@8+0x1a1>
   12e19:	89 c3                	mov    %eax,%ebx
   12e1b:	88 45 df             	mov    %al,0xffffffdf(%ebp)
   12e1e:	c1 eb 08             	shr    $0x8,%ebx
   12e21:	50                   	push   %eax
   12e22:	50                   	push   %eax
   12e23:	8b 8f 2c 04 00 00    	mov    0x42c(%edi),%ecx
   12e29:	85 c9                	test   %ecx,%ecx
   12e2b:	0f 95 c0             	setne  %al
   12e2e:	25 ff 00 00 00       	and    $0xff,%eax
   12e33:	50                   	push   %eax
   12e34:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12e3a:	40                   	inc    %eax
   12e3b:	50                   	push   %eax
   12e3c:	e8 cf 0d 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   12e41:	31 c0                	xor    %eax,%eax
   12e43:	88 d8                	mov    %bl,%al
   12e45:	50                   	push   %eax
   12e46:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12e4c:	83 c0 05             	add    $0x5,%eax
   12e4f:	50                   	push   %eax
   12e50:	e8 bb 0d 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   12e55:	31 c0                	xor    %eax,%eax
   12e57:	8a 45 df             	mov    0xffffffdf(%ebp),%al
   12e5a:	50                   	push   %eax
   12e5b:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12e61:	83 c0 04             	add    $0x4,%eax
   12e64:	50                   	push   %eax
   12e65:	e8 a6 0d 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   12e6a:	58                   	pop    %eax
   12e6b:	8b 87 2c 04 00 00    	mov    0x42c(%edi),%eax
   12e71:	5a                   	pop    %edx
   12e72:	85 c0                	test   %eax,%eax
   12e74:	0f 84 15 08 00 00    	je     1368f <_AtapiStartIo@8+0xa0f>
   12e7a:	83 ec 0c             	sub    $0xc,%esp
   12e7d:	68 90 23 01 00       	push   $0x12390
   12e82:	ba a0 00 00 00       	mov    $0xa0,%edx
   12e87:	89 f8                	mov    %edi,%eax
   12e89:	e8 72 e7 ff ff       	call   11600 <_AtapiExecuteCommand>
   12e8e:	31 db                	xor    %ebx,%ebx
   12e90:	83 c4 10             	add    $0x10,%esp
   12e93:	eb 16                	jmp    12eab <_AtapiStartIo@8+0x22b>
   12e95:	83 ec 0c             	sub    $0xc,%esp
   12e98:	43                   	inc    %ebx
   12e99:	6a 0a                	push   $0xa
   12e9b:	e8 80 0d 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   12ea0:	83 c4 0c             	add    $0xc,%esp
   12ea3:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   12ea9:	77 19                	ja     12ec4 <_AtapiStartIo@8+0x244>
   12eab:	83 ec 0c             	sub    $0xc,%esp
   12eae:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12eb4:	83 c0 07             	add    $0x7,%eax
   12eb7:	50                   	push   %eax
   12eb8:	e8 43 0d 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   12ebd:	83 c4 0c             	add    $0xc,%esp
   12ec0:	a8 08                	test   $0x8,%al
   12ec2:	74 d1                	je     12e95 <_AtapiStartIo@8+0x215>
   12ec4:	31 c0                	xor    %eax,%eax
   12ec6:	8a 46 30             	mov    0x30(%esi),%al
   12ec9:	83 f8 04             	cmp    $0x4,%eax
   12ecc:	0f 84 ca 07 00 00    	je     1369c <_AtapiStartIo@8+0xa1c>
   12ed2:	8d 56 30             	lea    0x30(%esi),%edx
   12ed5:	83 f8 15             	cmp    $0x15,%eax
   12ed8:	89 95 78 ff ff ff    	mov    %edx,0xffffff78(%ebp)
   12ede:	0f 84 b8 07 00 00    	je     1369c <_AtapiStartIo@8+0xa1c>
   12ee4:	31 c0                	xor    %eax,%eax
   12ee6:	8a 46 06             	mov    0x6(%esi),%al
   12ee9:	c1 e0 09             	shl    $0x9,%eax
   12eec:	66 8b 04 38          	mov    (%eax,%edi,1),%ax
   12ef0:	52                   	push   %edx
   12ef1:	83 e0 03             	and    $0x3,%eax
   12ef4:	48                   	dec    %eax
   12ef5:	0f 94 c0             	sete   %al
   12ef8:	25 ff 00 00 00       	and    $0xff,%eax
   12efd:	8d 04 85 0c 00 00 00 	lea    0xc(,%eax,4),%eax
   12f04:	d1 e8                	shr    %eax
   12f06:	50                   	push   %eax
   12f07:	8b 85 78 ff ff ff    	mov    0xffffff78(%ebp),%eax
   12f0d:	50                   	push   %eax
   12f0e:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   12f14:	50                   	push   %eax
   12f15:	e8 56 0d 00 00       	call   13c70 <_ScsiPortWritePortBufferUshort@12>
   12f1a:	58                   	pop    %eax
   12f1b:	8b 87 2c 04 00 00    	mov    0x42c(%edi),%eax
   12f21:	85 c0                	test   %eax,%eax
   12f23:	0f 85 57 05 00 00    	jne    13480 <_AtapiStartIo@8+0x800>
   12f29:	31 c0                	xor    %eax,%eax
   12f2b:	e9 8b fd ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   12f30:	b9 01 00 00 00       	mov    $0x1,%ecx
   12f35:	b8 07 00 00 00       	mov    $0x7,%eax
   12f3a:	80 7e 05 00          	cmpb   $0x0,0x5(%esi)
   12f3e:	0f 85 77 fd ff ff    	jne    12cbb <_AtapiStartIo@8+0x3b>
   12f44:	b0 21                	mov    $0x21,%al
   12f46:	80 fb 01             	cmp    $0x1,%bl
   12f49:	0f 87 6c fd ff ff    	ja     12cbb <_AtapiStartIo@8+0x3b>
   12f4f:	b0 20                	mov    $0x20,%al
   12f51:	80 7e 07 00          	cmpb   $0x0,0x7(%esi)
   12f55:	0f 85 60 fd ff ff    	jne    12cbb <_AtapiStartIo@8+0x3b>
   12f5b:	83 e2 01             	and    $0x1,%edx
   12f5e:	b0 08                	mov    $0x8,%al
   12f60:	0f 84 55 fd ff ff    	je     12cbb <_AtapiStartIo@8+0x3b>
   12f66:	31 d2                	xor    %edx,%edx
   12f68:	8a 46 30             	mov    0x30(%esi),%al
   12f6b:	88 c2                	mov    %al,%dl
   12f6d:	83 fa 35             	cmp    $0x35,%edx
   12f70:	0f 87 0d 01 00 00    	ja     13083 <_AtapiStartIo@8+0x403>
   12f76:	ff 24 95 ec 42 01 00 	jmp    *0x142ec(,%edx,4)
   12f7d:	8d 76 00             	lea    0x0(%esi),%esi
   12f80:	c7 87 1c 04 00 00 00 	movl   $0x0,0x41c(%edi)
   12f87:	00 00 00 
   12f8a:	88 46 03             	mov    %al,0x3(%esi)
   12f8d:	53                   	push   %ebx
   12f8e:	56                   	push   %esi
   12f8f:	57                   	push   %edi
   12f90:	6a 00                	push   $0x0
   12f92:	e8 19 0d 00 00       	call   13cb0 <_ScsiPortNotification>
   12f97:	83 c4 0c             	add    $0xc,%esp
   12f9a:	6a 00                	push   $0x0
   12f9c:	57                   	push   %edi
   12f9d:	6a 01                	push   $0x1
   12f9f:	e8 0c 0d 00 00       	call   13cb0 <_ScsiPortNotification>
   12fa4:	83 c4 10             	add    $0x10,%esp
   12fa7:	b8 01 00 00 00       	mov    $0x1,%eax
   12fac:	8d 65 f4             	lea    0xfffffff4(%ebp),%esp
   12faf:	5b                   	pop    %ebx
   12fb0:	5e                   	pop    %esi
   12fb1:	5f                   	pop    %edi
   12fb2:	5d                   	pop    %ebp
   12fb3:	c2 08 00             	ret    $0x8
   12fb6:	8b 87 1c 04 00 00    	mov    0x41c(%edi),%eax
   12fbc:	83 f8 01             	cmp    $0x1,%eax
   12fbf:	19 c0                	sbb    %eax,%eax
   12fc1:	83 e0 fe             	and    $0xfffffffe,%eax
   12fc4:	83 c0 03             	add    $0x3,%eax
   12fc7:	e9 ef fc ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   12fcc:	b8 05 00 00 00       	mov    $0x5,%eax
   12fd1:	e9 e5 fc ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   12fd6:	8b 46 18             	mov    0x18(%esi),%eax
   12fd9:	89 45 d8             	mov    %eax,0xffffffd8(%ebp)
   12fdc:	31 c0                	xor    %eax,%eax
   12fde:	88 d8                	mov    %bl,%al
   12fe0:	8b 55 d8             	mov    0xffffffd8(%ebp),%edx
   12fe3:	c1 e0 09             	shl    $0x9,%eax
   12fe6:	c7 42 04 00 00 02 00 	movl   $0x20000,0x4(%edx)
   12fed:	8d 0c 38             	lea    (%eax,%edi,1),%ecx
   12ff0:	f6 41 63 02          	testb  $0x2,0x63(%ecx)
   12ff4:	0f 84 01 07 00 00    	je     136fb <_AtapiStartIo@8+0xa7b>
   12ffa:	31 c0                	xor    %eax,%eax
   12ffc:	8a 46 06             	mov    0x6(%esi),%al
   12fff:	f6 84 87 00 04 00 00 	testb  $0x10,0x400(%edi,%eax,4)
   13006:	10 
   13007:	0f 84 d8 07 00 00    	je     137e5 <_AtapiStartIo@8+0xb65>
   1300d:	66 8b 81 c8 00 00 00 	mov    0xc8(%ecx),%ax
   13014:	8d 5d e0             	lea    0xffffffe0(%ebp),%ebx
   13017:	66 89 45 e0          	mov    %ax,0xffffffe0(%ebp)
   1301b:	66 8b 81 ca 00 00 00 	mov    0xca(%ecx),%ax
   13022:	66 89 45 e2          	mov    %ax,0xffffffe2(%ebp)
   13026:	66 8b 81 cc 00 00 00 	mov    0xcc(%ecx),%ax
   1302d:	66 89 45 e4          	mov    %ax,0xffffffe4(%ebp)
   13031:	66 8b 81 ce 00 00 00 	mov    0xce(%ecx),%ax
   13038:	83 45 e0 ff          	addl   $0xffffffff,0xffffffe0(%ebp)
   1303c:	66 89 45 e6          	mov    %ax,0xffffffe6(%ebp)
   13040:	83 55 e4 ff          	adcl   $0xffffffff,0xffffffe4(%ebp)
   13044:	8b 43 04             	mov    0x4(%ebx),%eax
   13047:	85 c0                	test   %eax,%eax
   13049:	0f 85 41 07 00 00    	jne    13790 <_AtapiStartIo@8+0xb10>
   1304f:	31 d2                	xor    %edx,%edx
   13051:	31 c0                	xor    %eax,%eax
   13053:	8a 55 e0             	mov    0xffffffe0(%ebp),%dl
   13056:	8a 43 01             	mov    0x1(%ebx),%al
   13059:	c1 e0 10             	shl    $0x10,%eax
   1305c:	8b 4d d8             	mov    0xffffffd8(%ebp),%ecx
   1305f:	c1 e2 18             	shl    $0x18,%edx
   13062:	09 c2                	or     %eax,%edx
   13064:	31 c0                	xor    %eax,%eax
   13066:	8a 43 02             	mov    0x2(%ebx),%al
   13069:	c1 e0 08             	shl    $0x8,%eax
   1306c:	09 c2                	or     %eax,%edx
   1306e:	31 c0                	xor    %eax,%eax
   13070:	8a 43 03             	mov    0x3(%ebx),%al
   13073:	09 c2                	or     %eax,%edx
   13075:	89 11                	mov    %edx,(%ecx)
   13077:	b9 01 00 00 00       	mov    $0x1,%ecx
   1307c:	89 c8                	mov    %ecx,%eax
   1307e:	e9 38 fc ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   13083:	25 ff 00 00 00       	and    $0xff,%eax
   13088:	52                   	push   %edx
   13089:	52                   	push   %edx
   1308a:	50                   	push   %eax
   1308b:	68 84 41 01 00       	push   $0x14184
   13090:	e8 4b 0c 00 00       	call   13ce0 <_DbgPrint>
   13095:	b9 06 00 00 00       	mov    $0x6,%ecx
   1309a:	83 c4 10             	add    $0x10,%esp
   1309d:	89 c8                	mov    %ecx,%eax
   1309f:	e9 17 fc ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   130a4:	31 c0                	xor    %eax,%eax
   130a6:	ba 06 00 00 00       	mov    $0x6,%edx
   130ab:	88 d8                	mov    %bl,%al
   130ad:	f6 84 87 00 04 00 00 	testb  $0x80,0x400(%edi,%eax,4)
   130b4:	80 
   130b5:	75 75                	jne    1312c <_AtapiStartIo@8+0x4ac>
   130b7:	c1 e0 09             	shl    $0x9,%eax
   130ba:	f6 84 07 a7 00 00 00 	testb  $0x10,0xa7(%edi,%eax,1)
   130c1:	10 
   130c2:	74 68                	je     1312c <_AtapiStartIo@8+0x4ac>
   130c4:	31 db                	xor    %ebx,%ebx
   130c6:	eb 16                	jmp    130de <_AtapiStartIo@8+0x45e>
   130c8:	83 ec 0c             	sub    $0xc,%esp
   130cb:	43                   	inc    %ebx
   130cc:	6a 0a                	push   $0xa
   130ce:	e8 4d 0b 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   130d3:	83 c4 0c             	add    $0xc,%esp
   130d6:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   130dc:	77 25                	ja     13103 <_AtapiStartIo@8+0x483>
   130de:	83 ec 0c             	sub    $0xc,%esp
   130e1:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   130e7:	83 c0 07             	add    $0x7,%eax
   130ea:	50                   	push   %eax
   130eb:	e8 10 0b 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   130f0:	83 c4 0c             	add    $0xc,%esp
   130f3:	84 c0                	test   %al,%al
   130f5:	78 d1                	js     130c8 <_AtapiStartIo@8+0x448>
   130f7:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   130fd:	0f 86 23 08 00 00    	jbe    13926 <_AtapiStartIo@8+0xca6>
   13103:	50                   	push   %eax
   13104:	68 1d 09 00 00       	push   $0x91d
   13109:	68 08 40 01 00       	push   $0x14008
   1310e:	68 10 40 01 00       	push   $0x14010
   13113:	e8 c8 0b 00 00       	call   13ce0 <_DbgPrint>
   13118:	c7 04 24 ae 41 01 00 	movl   $0x141ae,(%esp)
   1311f:	e8 bc 0b 00 00       	call   13ce0 <_DbgPrint>
   13124:	83 c4 10             	add    $0x10,%esp
   13127:	ba 05 00 00 00       	mov    $0x5,%edx
   1312c:	89 d1                	mov    %edx,%ecx
   1312e:	89 c8                	mov    %ecx,%eax
   13130:	e9 86 fb ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   13135:	31 c9                	xor    %ecx,%ecx
   13137:	88 d9                	mov    %bl,%cl
   13139:	89 c8                	mov    %ecx,%eax
   1313b:	c1 e0 09             	shl    $0x9,%eax
   1313e:	01 f8                	add    %edi,%eax
   13140:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
   13143:	31 c0                	xor    %eax,%eax
   13145:	8a 46 35             	mov    0x35(%esi),%al
   13148:	89 45 d0             	mov    %eax,0xffffffd0(%ebp)
   1314b:	31 c0                	xor    %eax,%eax
   1314d:	8a 46 34             	mov    0x34(%esi),%al
   13150:	8b 55 d0             	mov    0xffffffd0(%ebp),%edx
   13153:	c1 e0 08             	shl    $0x8,%eax
   13156:	09 c2                	or     %eax,%edx
   13158:	31 c0                	xor    %eax,%eax
   1315a:	89 55 d0             	mov    %edx,0xffffffd0(%ebp)
   1315d:	8a 46 33             	mov    0x33(%esi),%al
   13160:	8b 55 d0             	mov    0xffffffd0(%ebp),%edx
   13163:	c1 e0 10             	shl    $0x10,%eax
   13166:	09 c2                	or     %eax,%edx
   13168:	31 c0                	xor    %eax,%eax
   1316a:	89 55 d0             	mov    %edx,0xffffffd0(%ebp)
   1316d:	8a 46 32             	mov    0x32(%esi),%al
   13170:	8b 55 d0             	mov    0xffffffd0(%ebp),%edx
   13173:	c1 e0 18             	shl    $0x18,%eax
   13176:	09 c2                	or     %eax,%edx
   13178:	89 55 d0             	mov    %edx,0xffffffd0(%ebp)
   1317b:	8b 55 d4             	mov    0xffffffd4(%ebp),%edx
   1317e:	66 8b 42 0a          	mov    0xa(%edx),%ax
   13182:	25 ff ff 00 00       	and    $0xffff,%eax
   13187:	89 85 64 ff ff ff    	mov    %eax,0xffffff64(%ebp)
   1318d:	8b 46 10             	mov    0x10(%esi),%eax
   13190:	8b 95 64 ff ff ff    	mov    0xffffff64(%ebp),%edx
   13196:	89 85 74 ff ff ff    	mov    %eax,0xffffff74(%ebp)
   1319c:	8d 54 10 ff          	lea    0xffffffff(%eax,%edx,1),%edx
   131a0:	89 d0                	mov    %edx,%eax
   131a2:	89 95 60 ff ff ff    	mov    %edx,0xffffff60(%ebp)
   131a8:	31 d2                	xor    %edx,%edx
   131aa:	f7 b5 64 ff ff ff    	divl   0xffffff64(%ebp)
   131b0:	89 45 84             	mov    %eax,0xffffff84(%ebp)
   131b3:	f6 84 8f 00 04 00 00 	testb  $0x10,0x400(%edi,%ecx,4)
   131ba:	10 
   131bb:	0f 84 70 05 00 00    	je     13731 <_AtapiStartIo@8+0xab1>
   131c1:	8b 4d d0             	mov    0xffffffd0(%ebp),%ecx
   131c4:	8a 55 d0             	mov    0xffffffd0(%ebp),%dl
   131c7:	c1 e9 08             	shr    $0x8,%ecx
   131ca:	88 55 88             	mov    %dl,0xffffff88(%ebp)
   131cd:	89 4d d0             	mov    %ecx,0xffffffd0(%ebp)
   131d0:	8b 55 d0             	mov    0xffffffd0(%ebp),%edx
   131d3:	8a 4d d0             	mov    0xffffffd0(%ebp),%cl
   131d6:	c1 ea 08             	shr    $0x8,%edx
   131d9:	88 4d a8             	mov    %cl,0xffffffa8(%ebp)
   131dc:	89 55 d0             	mov    %edx,0xffffffd0(%ebp)
   131df:	8b 55 88             	mov    0xffffff88(%ebp),%edx
   131e2:	8a 45 d0             	mov    0xffffffd0(%ebp),%al
   131e5:	8b 4d a8             	mov    0xffffffa8(%ebp),%ecx
   131e8:	88 45 b8             	mov    %al,0xffffffb8(%ebp)
   131eb:	8b 45 d0             	mov    0xffffffd0(%ebp),%eax
   131ee:	c1 e8 08             	shr    $0x8,%eax
   131f1:	80 fb 01             	cmp    $0x1,%bl
   131f4:	89 45 d0             	mov    %eax,0xffffffd0(%ebp)
   131f7:	8b 45 b8             	mov    0xffffffb8(%ebp),%eax
   131fa:	8a 75 d0             	mov    0xffffffd0(%ebp),%dh
   131fd:	b5 00                	mov    $0x0,%ch
   131ff:	66 89 55 88          	mov    %dx,0xffffff88(%ebp)
   13203:	b4 00                	mov    $0x0,%ah
   13205:	19 d2                	sbb    %edx,%edx
   13207:	66 89 4d a8          	mov    %cx,0xffffffa8(%ebp)
   1320b:	83 e2 f0             	and    $0xfffffff0,%edx
   1320e:	66 89 45 b8          	mov    %ax,0xffffffb8(%ebp)
   13212:	83 c2 50             	add    $0x50,%edx
   13215:	88 55 98             	mov    %dl,0xffffff98(%ebp)
   13218:	8b 46 18             	mov    0x18(%esi),%eax
   1321b:	8b 8d 74 ff ff ff    	mov    0xffffff74(%ebp),%ecx
   13221:	31 db                	xor    %ebx,%ebx
   13223:	89 87 20 04 00 00    	mov    %eax,0x420(%edi)
   13229:	89 8f 24 04 00 00    	mov    %ecx,0x424(%edi)
   1322f:	89 b7 1c 04 00 00    	mov    %esi,0x41c(%edi)
   13235:	eb 16                	jmp    1324d <_AtapiStartIo@8+0x5cd>
   13237:	83 ec 0c             	sub    $0xc,%esp
   1323a:	43                   	inc    %ebx
   1323b:	6a 0a                	push   $0xa
   1323d:	e8 de 09 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   13242:	83 c4 0c             	add    $0xc,%esp
   13245:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   1324b:	77 25                	ja     13272 <_AtapiStartIo@8+0x5f2>
   1324d:	83 ec 0c             	sub    $0xc,%esp
   13250:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13256:	83 c0 07             	add    $0x7,%eax
   13259:	50                   	push   %eax
   1325a:	e8 a1 09 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1325f:	83 c4 0c             	add    $0xc,%esp
   13262:	84 c0                	test   %al,%al
   13264:	78 d1                	js     13237 <_AtapiStartIo@8+0x5b7>
   13266:	81 fb 4f c3 00 00    	cmp    $0xc34f,%ebx
   1326c:	0f 86 3d 02 00 00    	jbe    134af <_AtapiStartIo@8+0x82f>
   13272:	b8 05 00 00 00       	mov    $0x5,%eax
   13277:	89 c1                	mov    %eax,%ecx
   13279:	89 c8                	mov    %ecx,%eax
   1327b:	e9 3b fa ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   13280:	51                   	push   %ecx
   13281:	68 4b 09 00 00       	push   $0x94b
   13286:	68 08 40 01 00       	push   $0x14008
   1328b:	68 10 40 01 00       	push   $0x14010
   13290:	e8 4b 0a 00 00       	call   13ce0 <_DbgPrint>
   13295:	c7 04 24 ca 41 01 00 	movl   $0x141ca,(%esp)
   1329c:	e8 3f 0a 00 00       	call   13ce0 <_DbgPrint>
   132a1:	83 c4 0c             	add    $0xc,%esp
   132a4:	68 4d 09 00 00       	push   $0x94d
   132a9:	68 08 40 01 00       	push   $0x14008
   132ae:	68 10 40 01 00       	push   $0x14010
   132b3:	e8 28 0a 00 00       	call   13ce0 <_DbgPrint>
   132b8:	58                   	pop    %eax
   132b9:	31 c0                	xor    %eax,%eax
   132bb:	5a                   	pop    %edx
   132bc:	8a 46 06             	mov    0x6(%esi),%al
   132bf:	50                   	push   %eax
   132c0:	68 e8 41 01 00       	push   $0x141e8
   132c5:	e8 16 0a 00 00       	call   13ce0 <_DbgPrint>
   132ca:	31 c0                	xor    %eax,%eax
   132cc:	8a 46 06             	mov    0x6(%esi),%al
   132cf:	83 c4 10             	add    $0x10,%esp
   132d2:	ba 01 00 00 00       	mov    $0x1,%edx
   132d7:	f6 84 87 00 04 00 00 	testb  $0x20,0x400(%edi,%eax,4)
   132de:	20 
   132df:	0f 84 47 fe ff ff    	je     1312c <_AtapiStartIo@8+0x4ac>
   132e5:	c7 85 7c ff ff ff 00 	movl   $0x0,0xffffff7c(%ebp)
   132ec:	00 00 00 
   132ef:	eb 26                	jmp    13317 <_AtapiStartIo@8+0x697>
   132f1:	83 ec 0c             	sub    $0xc,%esp
   132f4:	6a 0a                	push   $0xa
   132f6:	e8 25 09 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   132fb:	8b 85 7c ff ff ff    	mov    0xffffff7c(%ebp),%eax
   13301:	83 c4 0c             	add    $0xc,%esp
   13304:	40                   	inc    %eax
   13305:	89 85 7c ff ff ff    	mov    %eax,0xffffff7c(%ebp)
   1330b:	81 bd 7c ff ff ff 4f 	cmpl   $0xc34f,0xffffff7c(%ebp)
   13312:	c3 00 00 
   13315:	77 1b                	ja     13332 <_AtapiStartIo@8+0x6b2>
   13317:	83 ec 0c             	sub    $0xc,%esp
   1331a:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13320:	83 c0 07             	add    $0x7,%eax
   13323:	50                   	push   %eax
   13324:	e8 d7 08 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   13329:	83 c4 0c             	add    $0xc,%esp
   1332c:	88 c3                	mov    %al,%bl
   1332e:	84 c0                	test   %al,%al
   13330:	78 bf                	js     132f1 <_AtapiStartIo@8+0x671>
   13332:	51                   	push   %ecx
   13333:	68 61 09 00 00       	push   $0x961
   13338:	68 08 40 01 00       	push   $0x14008
   1333d:	68 10 40 01 00       	push   $0x14010
   13342:	e8 99 09 00 00       	call   13ce0 <_DbgPrint>
   13347:	58                   	pop    %eax
   13348:	31 c0                	xor    %eax,%eax
   1334a:	5a                   	pop    %edx
   1334b:	88 d8                	mov    %bl,%al
   1334d:	50                   	push   %eax
   1334e:	68 0f 42 01 00       	push   $0x1420f
   13353:	e8 88 09 00 00       	call   13ce0 <_DbgPrint>
   13358:	83 c4 0c             	add    $0xc,%esp
   1335b:	68 62 09 00 00       	push   $0x962
   13360:	68 08 40 01 00       	push   $0x14008
   13365:	68 10 40 01 00       	push   $0x14010
   1336a:	e8 71 09 00 00       	call   13ce0 <_DbgPrint>
   1336f:	5a                   	pop    %edx
   13370:	8b 95 7c ff ff ff    	mov    0xffffff7c(%ebp),%edx
   13376:	59                   	pop    %ecx
   13377:	8d 04 92             	lea    (%edx,%edx,4),%eax
   1337a:	01 c0                	add    %eax,%eax
   1337c:	50                   	push   %eax
   1337d:	68 1c 42 01 00       	push   $0x1421c
   13382:	e8 59 09 00 00       	call   13ce0 <_DbgPrint>
   13387:	83 c4 10             	add    $0x10,%esp
   1338a:	81 bd 7c ff ff ff 4f 	cmpl   $0xc34f,0xffffff7c(%ebp)
   13391:	c3 00 00 
   13394:	0f 87 81 05 00 00    	ja     1391b <_AtapiStartIo@8+0xc9b>
   1339a:	50                   	push   %eax
   1339b:	50                   	push   %eax
   1339c:	8a 46 06             	mov    0x6(%esi),%al
   1339f:	3c 01                	cmp    $0x1,%al
   133a1:	19 c0                	sbb    %eax,%eax
   133a3:	83 e0 f0             	and    $0xfffffff0,%eax
   133a6:	05 b0 00 00 00       	add    $0xb0,%eax
   133ab:	50                   	push   %eax
   133ac:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   133b2:	83 c0 06             	add    $0x6,%eax
   133b5:	50                   	push   %eax
   133b6:	e8 55 08 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   133bb:	50                   	push   %eax
   133bc:	6a 0a                	push   $0xa
   133be:	e8 5d 08 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   133c3:	ba da 00 00 00       	mov    $0xda,%edx
   133c8:	89 f8                	mov    %edi,%eax
   133ca:	68 f0 26 01 00       	push   $0x126f0
   133cf:	e8 2c e2 ff ff       	call   11600 <_AtapiExecuteCommand>
   133d4:	83 c4 10             	add    $0x10,%esp
   133d7:	c7 85 7c ff ff ff 00 	movl   $0x0,0xffffff7c(%ebp)
   133de:	00 00 00 
   133e1:	eb 2a                	jmp    1340d <_AtapiStartIo@8+0x78d>
   133e3:	a8 01                	test   $0x1,%al
   133e5:	75 41                	jne    13428 <_AtapiStartIo@8+0x7a8>
   133e7:	83 ec 0c             	sub    $0xc,%esp
   133ea:	6a 0a                	push   $0xa
   133ec:	e8 2f 08 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   133f1:	8b 85 7c ff ff ff    	mov    0xffffff7c(%ebp),%eax
   133f7:	83 c4 0c             	add    $0xc,%esp
   133fa:	40                   	inc    %eax
   133fb:	89 85 7c ff ff ff    	mov    %eax,0xffffff7c(%ebp)
   13401:	81 bd 7c ff ff ff e7 	cmpl   $0x3e7,0xffffff7c(%ebp)
   13408:	03 00 00 
   1340b:	77 2b                	ja     13438 <_AtapiStartIo@8+0x7b8>
   1340d:	83 ec 0c             	sub    $0xc,%esp
   13410:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13416:	83 c0 07             	add    $0x7,%eax
   13419:	50                   	push   %eax
   1341a:	e8 e1 07 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1341f:	83 c4 0c             	add    $0xc,%esp
   13422:	88 c3                	mov    %al,%bl
   13424:	84 c0                	test   %al,%al
   13426:	78 bb                	js     133e3 <_AtapiStartIo@8+0x763>
   13428:	81 bd 7c ff ff ff e7 	cmpl   $0x3e7,0xffffff7c(%ebp)
   1342f:	03 00 00 
   13432:	0f 86 9e 04 00 00    	jbe    138d6 <_AtapiStartIo@8+0xc56>
   13438:	50                   	push   %eax
   13439:	68 7d 09 00 00       	push   $0x97d
   1343e:	68 08 40 01 00       	push   $0x14008
   13443:	68 10 40 01 00       	push   $0x14010
   13448:	e8 93 08 00 00       	call   13ce0 <_DbgPrint>
   1344d:	c7 04 24 40 42 01 00 	movl   $0x14240,(%esp)
   13454:	e8 87 08 00 00       	call   13ce0 <_DbgPrint>
   13459:	83 c4 10             	add    $0x10,%esp
   1345c:	ba 05 00 00 00       	mov    $0x5,%edx
   13461:	c7 87 28 04 00 00 00 	movl   $0x0,0x428(%edi)
   13468:	00 00 00 
   1346b:	e9 bc fc ff ff       	jmp    1312c <_AtapiStartIo@8+0x4ac>
   13470:	89 f2                	mov    %esi,%edx
   13472:	89 f8                	mov    %edi,%eax
   13474:	e8 47 ed ff ff       	call   121c0 <_AtapiInquiry>
   13479:	89 c1                	mov    %eax,%ecx
   1347b:	e9 f9 fd ff ff       	jmp    13279 <_AtapiStartIo@8+0x5f9>
   13480:	83 ec 0c             	sub    $0xc,%esp
   13483:	8b 9f 18 04 00 00    	mov    0x418(%edi),%ebx
   13489:	53                   	push   %ebx
   1348a:	e8 71 07 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1348f:	83 c8 01             	or     $0x1,%eax
   13492:	25 ff 00 00 00       	and    $0xff,%eax
   13497:	89 04 24             	mov    %eax,(%esp)
   1349a:	8b 8f 18 04 00 00    	mov    0x418(%edi),%ecx
   134a0:	51                   	push   %ecx
   134a1:	e8 6a 07 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   134a6:	58                   	pop    %eax
   134a7:	31 c0                	xor    %eax,%eax
   134a9:	5a                   	pop    %edx
   134aa:	e9 0c f8 ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   134af:	50                   	push   %eax
   134b0:	50                   	push   %eax
   134b1:	31 db                	xor    %ebx,%ebx
   134b3:	80 4d 98 a0          	orb    $0xa0,0xffffff98(%ebp)
   134b7:	8a 5d 98             	mov    0xffffff98(%ebp),%bl
   134ba:	53                   	push   %ebx
   134bb:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   134c1:	83 c0 06             	add    $0x6,%eax
   134c4:	50                   	push   %eax
   134c5:	e8 46 07 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   134ca:	50                   	push   %eax
   134cb:	6a 0a                	push   $0xa
   134cd:	e8 4e 07 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   134d2:	31 c0                	xor    %eax,%eax
   134d4:	8a 46 06             	mov    0x6(%esi),%al
   134d7:	83 c4 0c             	add    $0xc,%esp
   134da:	f6 84 87 00 04 00 00 	testb  $0x10,0x400(%edi,%eax,4)
   134e1:	10 
   134e2:	0f 85 80 05 00 00    	jne    13a68 <_AtapiStartIo@8+0xde8>
   134e8:	51                   	push   %ecx
   134e9:	51                   	push   %ecx
   134ea:	6a 00                	push   $0x0
   134ec:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   134f2:	40                   	inc    %eax
   134f3:	50                   	push   %eax
   134f4:	e8 17 07 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   134f9:	31 c0                	xor    %eax,%eax
   134fb:	8a 45 84             	mov    0xffffff84(%ebp),%al
   134fe:	50                   	push   %eax
   134ff:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13505:	83 c0 02             	add    $0x2,%eax
   13508:	50                   	push   %eax
   13509:	e8 02 07 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1350e:	31 c0                	xor    %eax,%eax
   13510:	8a 45 88             	mov    0xffffff88(%ebp),%al
   13513:	50                   	push   %eax
   13514:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   1351a:	83 c0 03             	add    $0x3,%eax
   1351d:	50                   	push   %eax
   1351e:	e8 ed 06 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13523:	31 c0                	xor    %eax,%eax
   13525:	8a 45 a8             	mov    0xffffffa8(%ebp),%al
   13528:	50                   	push   %eax
   13529:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   1352f:	83 c0 04             	add    $0x4,%eax
   13532:	50                   	push   %eax
   13533:	e8 d8 06 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13538:	31 c0                	xor    %eax,%eax
   1353a:	8a 45 b8             	mov    0xffffffb8(%ebp),%al
   1353d:	50                   	push   %eax
   1353e:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13544:	83 c0 05             	add    $0x5,%eax
   13547:	50                   	push   %eax
   13548:	e8 c3 06 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1354d:	53                   	push   %ebx
   1354e:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13554:	83 c0 06             	add    $0x6,%eax
   13557:	50                   	push   %eax
   13558:	e8 b3 06 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   1355d:	58                   	pop    %eax
   1355e:	8b 87 38 04 00 00    	mov    0x438(%edi),%eax
   13564:	5a                   	pop    %edx
   13565:	85 c0                	test   %eax,%eax
   13567:	74 40                	je     135a9 <_AtapiStartIo@8+0x929>
   13569:	31 c0                	xor    %eax,%eax
   1356b:	8a 5e 06             	mov    0x6(%esi),%bl
   1356e:	88 d8                	mov    %bl,%al
   13570:	f6 84 87 00 04 00 00 	testb  $0x40,0x400(%edi,%eax,4)
   13577:	40 
   13578:	74 32                	je     135ac <_AtapiStartIo@8+0x92c>
   1357a:	8b 46 0c             	mov    0xc(%esi),%eax
   1357d:	83 ec 0c             	sub    $0xc,%esp
   13580:	c1 e8 06             	shr    $0x6,%eax
   13583:	89 f2                	mov    %esi,%edx
   13585:	83 e0 01             	and    $0x1,%eax
   13588:	83 f8 01             	cmp    $0x1,%eax
   1358b:	19 c0                	sbb    %eax,%eax
   1358d:	83 f0 ff             	xor    $0xffffffff,%eax
   13590:	83 e0 08             	and    $0x8,%eax
   13593:	50                   	push   %eax
   13594:	89 f8                	mov    %edi,%eax
   13596:	e8 15 f5 ff ff       	call   12ab0 <_AtapiInitDma>
   1359b:	83 c4 10             	add    $0x10,%esp
   1359e:	25 ff 00 00 00       	and    $0xff,%eax
   135a3:	89 87 2c 04 00 00    	mov    %eax,0x42c(%edi)
   135a9:	8a 5e 06             	mov    0x6(%esi),%bl
   135ac:	8b 87 2c 04 00 00    	mov    0x42c(%edi),%eax
   135b2:	85 c0                	test   %eax,%eax
   135b4:	0f 84 1f 04 00 00    	je     139d9 <_AtapiStartIo@8+0xd59>
   135ba:	31 c0                	xor    %eax,%eax
   135bc:	b9 40 27 01 00       	mov    $0x12740,%ecx
   135c1:	88 d8                	mov    %bl,%al
   135c3:	f6 84 87 00 04 00 00 	testb  $0x10,0x400(%edi,%eax,4)
   135ca:	10 
   135cb:	0f 84 36 05 00 00    	je     13b07 <_AtapiStartIo@8+0xe87>
   135d1:	8b 46 0c             	mov    0xc(%esi),%eax
   135d4:	c1 e8 06             	shr    $0x6,%eax
   135d7:	83 e0 01             	and    $0x1,%eax
   135da:	83 f8 01             	cmp    $0x1,%eax
   135dd:	19 c0                	sbb    %eax,%eax
   135df:	83 e0 10             	and    $0x10,%eax
   135e2:	83 c0 25             	add    $0x25,%eax
   135e5:	83 ec 0c             	sub    $0xc,%esp
   135e8:	31 d2                	xor    %edx,%edx
   135ea:	88 c2                	mov    %al,%dl
   135ec:	89 f8                	mov    %edi,%eax
   135ee:	51                   	push   %ecx
   135ef:	e8 0c e0 ff ff       	call   11600 <_AtapiExecuteCommand>
   135f4:	8b 87 2c 04 00 00    	mov    0x42c(%edi),%eax
   135fa:	83 c4 10             	add    $0x10,%esp
   135fd:	85 c0                	test   %eax,%eax
   135ff:	0f 85 d3 04 00 00    	jne    13ad8 <_AtapiStartIo@8+0xe58>
   13605:	f6 46 0c 80          	testb  $0x80,0xc(%esi)
   13609:	0f 84 51 02 00 00    	je     13860 <_AtapiStartIo@8+0xbe0>
   1360f:	31 db                	xor    %ebx,%ebx
   13611:	eb 1a                	jmp    1362d <_AtapiStartIo@8+0x9ad>
   13613:	a8 01                	test   $0x1,%al
   13615:	75 2f                	jne    13646 <_AtapiStartIo@8+0x9c6>
   13617:	83 ec 0c             	sub    $0xc,%esp
   1361a:	43                   	inc    %ebx
   1361b:	6a 0a                	push   $0xa
   1361d:	e8 fe 05 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   13622:	83 c4 0c             	add    $0xc,%esp
   13625:	81 fb e7 03 00 00    	cmp    $0x3e7,%ebx
   1362b:	77 25                	ja     13652 <_AtapiStartIo@8+0x9d2>
   1362d:	83 ec 0c             	sub    $0xc,%esp
   13630:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13636:	83 c0 07             	add    $0x7,%eax
   13639:	50                   	push   %eax
   1363a:	e8 c1 05 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   1363f:	83 c4 0c             	add    $0xc,%esp
   13642:	84 c0                	test   %al,%al
   13644:	78 cd                	js     13613 <_AtapiStartIo@8+0x993>
   13646:	81 fb e7 03 00 00    	cmp    $0x3e7,%ebx
   1364c:	0f 86 b9 01 00 00    	jbe    1380b <_AtapiStartIo@8+0xb8b>
   13652:	53                   	push   %ebx
   13653:	68 cb 08 00 00       	push   $0x8cb
   13658:	68 08 40 01 00       	push   $0x14008
   1365d:	68 10 40 01 00       	push   $0x14010
   13662:	e8 79 06 00 00       	call   13ce0 <_DbgPrint>
   13667:	c7 04 24 40 42 01 00 	movl   $0x14240,(%esp)
   1366e:	e8 6d 06 00 00       	call   13ce0 <_DbgPrint>
   13673:	83 c4 10             	add    $0x10,%esp
   13676:	b8 05 00 00 00       	mov    $0x5,%eax
   1367b:	e9 f7 fb ff ff       	jmp    13277 <_AtapiStartIo@8+0x5f7>
   13680:	c7 87 2c 04 00 00 00 	movl   $0x0,0x42c(%edi)
   13687:	00 00 00 
   1368a:	e9 77 f7 ff ff       	jmp    12e06 <_AtapiStartIo@8+0x186>
   1368f:	83 ec 0c             	sub    $0xc,%esp
   13692:	68 70 24 01 00       	push   $0x12470
   13697:	e9 e6 f7 ff ff       	jmp    12e82 <_AtapiStartIo@8+0x202>
   1369c:	c6 46 0a 0c          	movb   $0xc,0xa(%esi)
   136a0:	83 f8 04             	cmp    $0x4,%eax
   136a3:	0f 84 d5 00 00 00    	je     1377e <_AtapiStartIo@8+0xafe>
   136a9:	8d 4e 30             	lea    0x30(%esi),%ecx
   136ac:	83 f8 15             	cmp    $0x15,%eax
   136af:	89 8d 78 ff ff ff    	mov    %ecx,0xffffff78(%ebp)
   136b5:	0f 85 29 f8 ff ff    	jne    12ee4 <_AtapiStartIo@8+0x264>
   136bb:	8d 56 30             	lea    0x30(%esi),%edx
   136be:	89 95 78 ff ff ff    	mov    %edx,0xffffff78(%ebp)
   136c4:	8a 5e 34             	mov    0x34(%esi),%bl
   136c7:	50                   	push   %eax
   136c8:	50                   	push   %eax
   136c9:	6a 0c                	push   $0xc
   136cb:	52                   	push   %edx
   136cc:	e8 ef 05 00 00       	call   13cc0 <_RtlZeroMemory@8>
   136d1:	59                   	pop    %ecx
   136d2:	58                   	pop    %eax
   136d3:	c6 46 30 55          	movb   $0x55,0x30(%esi)
   136d7:	8b 8d 78 ff ff ff    	mov    0xffffff78(%ebp),%ecx
   136dd:	80 49 01 10          	orb    $0x10,0x1(%ecx)
   136e1:	c6 41 07 00          	movb   $0x0,0x7(%ecx)
   136e5:	88 59 08             	mov    %bl,0x8(%ecx)
   136e8:	e9 f7 f7 ff ff       	jmp    12ee4 <_AtapiStartIo@8+0x264>
   136ed:	89 f2                	mov    %esi,%edx
   136ef:	89 f8                	mov    %edi,%eax
   136f1:	e8 ca ea ff ff       	call   121c0 <_AtapiInquiry>
   136f6:	e9 c0 f5 ff ff       	jmp    12cbb <_AtapiStartIo@8+0x3b>
   136fb:	c7 45 e4 00 00 00 00 	movl   $0x0,0xffffffe4(%ebp)
   13702:	8d 5d e0             	lea    0xffffffe0(%ebp),%ebx
   13705:	66 8b 41 02          	mov    0x2(%ecx),%ax
   13709:	66 8b 51 06          	mov    0x6(%ecx),%dx
   1370d:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   13713:	25 ff ff 00 00       	and    $0xffff,%eax
   13718:	0f af c2             	imul   %edx,%eax
   1371b:	66 8b 51 0c          	mov    0xc(%ecx),%dx
   1371f:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   13725:	0f af c2             	imul   %edx,%eax
   13728:	48                   	dec    %eax
   13729:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
   1372c:	e9 13 f9 ff ff       	jmp    13044 <_AtapiStartIo@8+0x3c4>
   13731:	8b 4d d4             	mov    0xffffffd4(%ebp),%ecx
   13734:	f6 41 63 02          	testb  $0x2,0x63(%ecx)
   13738:	0f 84 2b 01 00 00    	je     13869 <_AtapiStartIo@8+0xbe9>
   1373e:	8a 45 d0             	mov    0xffffffd0(%ebp),%al
   13741:	88 45 88             	mov    %al,0xffffff88(%ebp)
   13744:	8b 45 d0             	mov    0xffffffd0(%ebp),%eax
   13747:	c1 e8 08             	shr    $0x8,%eax
   1374a:	89 45 d0             	mov    %eax,0xffffffd0(%ebp)
   1374d:	8b 45 d0             	mov    0xffffffd0(%ebp),%eax
   13750:	8a 55 d0             	mov    0xffffffd0(%ebp),%dl
   13753:	c1 e8 08             	shr    $0x8,%eax
   13756:	88 55 a8             	mov    %dl,0xffffffa8(%ebp)
   13759:	89 45 d0             	mov    %eax,0xffffffd0(%ebp)
   1375c:	8b 45 d0             	mov    0xffffffd0(%ebp),%eax
   1375f:	8a 4d d0             	mov    0xffffffd0(%ebp),%cl
   13762:	c1 e8 08             	shr    $0x8,%eax
   13765:	88 4d b8             	mov    %cl,0xffffffb8(%ebp)
   13768:	83 e0 0f             	and    $0xf,%eax
   1376b:	84 db                	test   %bl,%bl
   1376d:	0f 84 5b 02 00 00    	je     139ce <_AtapiStartIo@8+0xd4e>
   13773:	83 c8 50             	or     $0x50,%eax
   13776:	88 45 98             	mov    %al,0xffffff98(%ebp)
   13779:	e9 9a fa ff ff       	jmp    13218 <_AtapiStartIo@8+0x598>
   1377e:	8d 46 30             	lea    0x30(%esi),%eax
   13781:	c6 46 30 24          	movb   $0x24,0x30(%esi)
   13785:	89 85 78 ff ff ff    	mov    %eax,0xffffff78(%ebp)
   1378b:	e9 54 f7 ff ff       	jmp    12ee4 <_AtapiStartIo@8+0x264>
   13790:	50                   	push   %eax
   13791:	68 ca 07 00 00       	push   $0x7ca
   13796:	68 08 40 01 00       	push   $0x14008
   1379b:	68 10 40 01 00       	push   $0x14010
   137a0:	e8 3b 05 00 00       	call   13ce0 <_DbgPrint>
   137a5:	83 c4 0c             	add    $0xc,%esp
   137a8:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
   137ab:	50                   	push   %eax
   137ac:	8b 4d e0             	mov    0xffffffe0(%ebp),%ecx
   137af:	51                   	push   %ecx
   137b0:	68 78 42 01 00       	push   $0x14278
   137b5:	e8 26 05 00 00       	call   13ce0 <_DbgPrint>
   137ba:	83 c4 0c             	add    $0xc,%esp
   137bd:	68 cb 07 00 00       	push   $0x7cb
   137c2:	68 08 40 01 00       	push   $0x14008
   137c7:	68 b1 42 01 00       	push   $0x142b1
   137cc:	e8 0f 05 00 00       	call   13ce0 <_DbgPrint>
   137d1:	c7 04 24 00 00 00 00 	movl   $0x0,(%esp)
   137d8:	e8 f3 04 00 00       	call   13cd0 <_KeBugCheck@4>
   137dd:	83 c4 0c             	add    $0xc,%esp
   137e0:	e9 6a f8 ff ff       	jmp    1304f <_AtapiStartIo@8+0x3cf>
   137e5:	c7 45 e4 00 00 00 00 	movl   $0x0,0xffffffe4(%ebp)
   137ec:	8d 5d e0             	lea    0xffffffe0(%ebp),%ebx
   137ef:	66 8b 51 7a          	mov    0x7a(%ecx),%dx
   137f3:	66 8b 41 78          	mov    0x78(%ecx),%ax
   137f7:	c1 e2 10             	shl    $0x10,%edx
   137fa:	25 ff ff 00 00       	and    $0xffff,%eax
   137ff:	8d 54 02 ff          	lea    0xffffffff(%edx,%eax,1),%edx
   13803:	89 55 e0             	mov    %edx,0xffffffe0(%ebp)
   13806:	e9 39 f8 ff ff       	jmp    13044 <_AtapiStartIo@8+0x3c4>
   1380b:	31 c0                	xor    %eax,%eax
   1380d:	8b 8f 24 04 00 00    	mov    0x424(%edi),%ecx
   13813:	8a 46 06             	mov    0x6(%esi),%al
   13816:	8b 94 87 08 04 00 00 	mov    0x408(%edi,%eax,4),%edx
   1381d:	39 d1                	cmp    %edx,%ecx
   1381f:	73 02                	jae    13823 <_AtapiStartIo@8+0xba3>
   13821:	89 ca                	mov    %ecx,%edx
   13823:	8b 9f 20 04 00 00    	mov    0x420(%edi),%ebx
   13829:	29 d1                	sub    %edx,%ecx
   1382b:	89 8f 24 04 00 00    	mov    %ecx,0x424(%edi)
   13831:	8d 04 13             	lea    (%ebx,%edx,1),%eax
   13834:	89 87 20 04 00 00    	mov    %eax,0x420(%edi)
   1383a:	31 c0                	xor    %eax,%eax
   1383c:	8a 46 06             	mov    0x6(%esi),%al
   1383f:	f6 84 87 00 04 00 00 	testb  $0x8,0x400(%edi,%eax,4)
   13846:	08 
   13847:	0f 84 33 03 00 00    	je     13b80 <_AtapiStartIo@8+0xf00>
   1384d:	c1 ea 02             	shr    $0x2,%edx
   13850:	51                   	push   %ecx
   13851:	52                   	push   %edx
   13852:	53                   	push   %ebx
   13853:	8b 97 10 04 00 00    	mov    0x410(%edi),%edx
   13859:	52                   	push   %edx
   1385a:	e8 31 04 00 00       	call   13c90 <_ScsiPortWritePortBufferUlong@12>
   1385f:	58                   	pop    %eax
   13860:	31 c0                	xor    %eax,%eax
   13862:	89 c1                	mov    %eax,%ecx
   13864:	e9 10 fa ff ff       	jmp    13279 <_AtapiStartIo@8+0x5f9>
   13869:	8b 55 d4             	mov    0xffffffd4(%ebp),%edx
   1386c:	66 8b 42 0c          	mov    0xc(%edx),%ax
   13870:	89 c2                	mov    %eax,%edx
   13872:	8b 45 d0             	mov    0xffffffd0(%ebp),%eax
   13875:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   1387b:	89 d1                	mov    %edx,%ecx
   1387d:	31 d2                	xor    %edx,%edx
   1387f:	f7 f1                	div    %ecx
   13881:	42                   	inc    %edx
   13882:	89 45 80             	mov    %eax,0xffffff80(%ebp)
   13885:	88 55 88             	mov    %dl,0xffffff88(%ebp)
   13888:	8b 55 d4             	mov    0xffffffd4(%ebp),%edx
   1388b:	66 8b 42 06          	mov    0x6(%edx),%ax
   1388f:	89 c2                	mov    %eax,%edx
   13891:	8b 45 80             	mov    0xffffff80(%ebp),%eax
   13894:	81 e2 ff ff 00 00    	and    $0xffff,%edx
   1389a:	89 d1                	mov    %edx,%ecx
   1389c:	31 d2                	xor    %edx,%edx
   1389e:	f7 f1                	div    %ecx
   138a0:	89 85 54 ff ff ff    	mov    %eax,0xffffff54(%ebp)
   138a6:	84 db                	test   %bl,%bl
   138a8:	74 03                	je     138ad <_AtapiStartIo@8+0xc2d>
   138aa:	83 ca 10             	or     $0x10,%edx
   138ad:	8a 85 54 ff ff ff    	mov    0xffffff54(%ebp),%al
   138b3:	88 55 98             	mov    %dl,0xffffff98(%ebp)
   138b6:	88 45 a8             	mov    %al,0xffffffa8(%ebp)
   138b9:	8b 85 54 ff ff ff    	mov    0xffffff54(%ebp),%eax
   138bf:	c1 e8 08             	shr    $0x8,%eax
   138c2:	89 85 54 ff ff ff    	mov    %eax,0xffffff54(%ebp)
   138c8:	8a 95 54 ff ff ff    	mov    0xffffff54(%ebp),%dl
   138ce:	88 55 b8             	mov    %dl,0xffffffb8(%ebp)
   138d1:	e9 42 f9 ff ff       	jmp    13218 <_AtapiStartIo@8+0x598>
   138d6:	83 e3 01             	and    $0x1,%ebx
   138d9:	0f 84 4f 01 00 00    	je     13a2e <_AtapiStartIo@8+0xdae>
   138df:	83 ec 0c             	sub    $0xc,%esp
   138e2:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   138e8:	40                   	inc    %eax
   138e9:	50                   	push   %eax
   138ea:	e8 11 03 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   138ef:	83 c4 0c             	add    $0xc,%esp
   138f2:	3c 40                	cmp    $0x40,%al
   138f4:	0f 84 56 02 00 00    	je     13b50 <_AtapiStartIo@8+0xed0>
   138fa:	53                   	push   %ebx
   138fb:	68 8f 09 00 00       	push   $0x98f
   13900:	68 08 40 01 00       	push   $0x14008
   13905:	68 c6 42 01 00       	push   $0x142c6
   1390a:	e8 d1 03 00 00       	call   13ce0 <_DbgPrint>
   1390f:	31 d2                	xor    %edx,%edx
   13911:	83 c4 10             	add    $0x10,%esp
   13914:	89 d1                	mov    %edx,%ecx
   13916:	e9 13 f8 ff ff       	jmp    1312e <_AtapiStartIo@8+0x4ae>
   1391b:	50                   	push   %eax
   1391c:	68 65 09 00 00       	push   $0x965
   13921:	e9 e3 f7 ff ff       	jmp    13109 <_AtapiStartIo@8+0x489>
   13926:	50                   	push   %eax
   13927:	50                   	push   %eax
   13928:	8a 46 06             	mov    0x6(%esi),%al
   1392b:	3c 01                	cmp    $0x1,%al
   1392d:	19 c0                	sbb    %eax,%eax
   1392f:	83 e0 f0             	and    $0xfffffff0,%eax
   13932:	05 b0 00 00 00       	add    $0xb0,%eax
   13937:	50                   	push   %eax
   13938:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   1393e:	83 c0 06             	add    $0x6,%eax
   13941:	50                   	push   %eax
   13942:	e8 c9 02 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13947:	50                   	push   %eax
   13948:	6a 0a                	push   $0xa
   1394a:	e8 d1 02 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   1394f:	31 c0                	xor    %eax,%eax
   13951:	8a 46 06             	mov    0x6(%esi),%al
   13954:	8b 84 87 00 04 00 00 	mov    0x400(%edi,%eax,4),%eax
   1395b:	68 f0 26 01 00       	push   $0x126f0
   13960:	c1 e8 04             	shr    $0x4,%eax
   13963:	83 e0 01             	and    $0x1,%eax
   13966:	83 f8 01             	cmp    $0x1,%eax
   13969:	89 f8                	mov    %edi,%eax
   1396b:	19 d2                	sbb    %edx,%edx
   1396d:	31 db                	xor    %ebx,%ebx
   1396f:	83 e2 fd             	and    $0xfffffffd,%edx
   13972:	81 c2 ea 00 00 00    	add    $0xea,%edx
   13978:	e8 83 dc ff ff       	call   11600 <_AtapiExecuteCommand>
   1397d:	83 c4 10             	add    $0x10,%esp
   13980:	eb 1a                	jmp    1399c <_AtapiStartIo@8+0xd1c>
   13982:	a8 01                	test   $0x1,%al
   13984:	75 2f                	jne    139b5 <_AtapiStartIo@8+0xd35>
   13986:	83 ec 0c             	sub    $0xc,%esp
   13989:	43                   	inc    %ebx
   1398a:	6a 0a                	push   $0xa
   1398c:	e8 8f 02 00 00       	call   13c20 <_ScsiPortStallExecution@4>
   13991:	83 c4 0c             	add    $0xc,%esp
   13994:	81 fb e7 03 00 00    	cmp    $0x3e7,%ebx
   1399a:	77 27                	ja     139c3 <_AtapiStartIo@8+0xd43>
   1399c:	83 ec 0c             	sub    $0xc,%esp
   1399f:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   139a5:	83 c0 07             	add    $0x7,%eax
   139a8:	50                   	push   %eax
   139a9:	e8 52 02 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   139ae:	83 c4 0c             	add    $0xc,%esp
   139b1:	84 c0                	test   %al,%al
   139b3:	78 cd                	js     13982 <_AtapiStartIo@8+0xd02>
   139b5:	31 d2                	xor    %edx,%edx
   139b7:	81 fb e7 03 00 00    	cmp    $0x3e7,%ebx
   139bd:	0f 86 69 f7 ff ff    	jbe    1312c <_AtapiStartIo@8+0x4ac>
   139c3:	53                   	push   %ebx
   139c4:	68 37 09 00 00       	push   $0x937
   139c9:	e9 70 fa ff ff       	jmp    1343e <_AtapiStartIo@8+0x7be>
   139ce:	83 c8 40             	or     $0x40,%eax
   139d1:	88 45 98             	mov    %al,0xffffff98(%ebp)
   139d4:	e9 3f f8 ff ff       	jmp    13218 <_AtapiStartIo@8+0x598>
   139d9:	8b 56 0c             	mov    0xc(%esi),%edx
   139dc:	b9 80 28 01 00       	mov    $0x12880,%ecx
   139e1:	f6 c2 40             	test   $0x40,%dl
   139e4:	75 05                	jne    139eb <_AtapiStartIo@8+0xd6b>
   139e6:	b9 80 29 01 00       	mov    $0x12980,%ecx
   139eb:	31 c0                	xor    %eax,%eax
   139ed:	88 d8                	mov    %bl,%al
   139ef:	8b 84 87 00 04 00 00 	mov    0x400(%edi,%eax,4),%eax
   139f6:	a8 04                	test   $0x4,%al
   139f8:	0f 84 22 01 00 00    	je     13b20 <_AtapiStartIo@8+0xea0>
   139fe:	a8 10                	test   $0x10,%al
   13a00:	74 16                	je     13a18 <_AtapiStartIo@8+0xd98>
   13a02:	c1 ea 06             	shr    $0x6,%edx
   13a05:	83 e2 01             	and    $0x1,%edx
   13a08:	83 fa 01             	cmp    $0x1,%edx
   13a0b:	19 c0                	sbb    %eax,%eax
   13a0d:	83 e0 10             	and    $0x10,%eax
   13a10:	83 c0 29             	add    $0x29,%eax
   13a13:	e9 cd fb ff ff       	jmp    135e5 <_AtapiStartIo@8+0x965>
   13a18:	c1 ea 06             	shr    $0x6,%edx
   13a1b:	83 e2 01             	and    $0x1,%edx
   13a1e:	83 fa 01             	cmp    $0x1,%edx
   13a21:	19 c0                	sbb    %eax,%eax
   13a23:	83 f0 ff             	xor    $0xffffffff,%eax
   13a26:	83 e8 3b             	sub    $0x3b,%eax
   13a29:	e9 b7 fb ff ff       	jmp    135e5 <_AtapiStartIo@8+0x965>
   13a2e:	c7 87 28 04 00 00 00 	movl   $0x0,0x428(%edi)
   13a35:	00 00 00 
   13a38:	51                   	push   %ecx
   13a39:	68 97 09 00 00       	push   $0x997
   13a3e:	68 08 40 01 00       	push   $0x14008
   13a43:	68 10 40 01 00       	push   $0x14010
   13a48:	e8 93 02 00 00       	call   13ce0 <_DbgPrint>
   13a4d:	c7 04 24 cd 42 01 00 	movl   $0x142cd,(%esp)
   13a54:	e8 87 02 00 00       	call   13ce0 <_DbgPrint>
   13a59:	83 c4 10             	add    $0x10,%esp
   13a5c:	ba 01 00 00 00       	mov    $0x1,%edx
   13a61:	89 d1                	mov    %edx,%ecx
   13a63:	e9 c6 f6 ff ff       	jmp    1312e <_AtapiStartIo@8+0x4ae>
   13a68:	51                   	push   %ecx
   13a69:	51                   	push   %ecx
   13a6a:	6a 00                	push   $0x0
   13a6c:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13a72:	40                   	inc    %eax
   13a73:	50                   	push   %eax
   13a74:	e8 97 01 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13a79:	8b 55 84             	mov    0xffffff84(%ebp),%edx
   13a7c:	0f b6 c6             	movzbl %dh,%eax
   13a7f:	50                   	push   %eax
   13a80:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13a86:	83 c0 02             	add    $0x2,%eax
   13a89:	50                   	push   %eax
   13a8a:	e8 81 01 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13a8f:	8b 4d 88             	mov    0xffffff88(%ebp),%ecx
   13a92:	0f b6 c5             	movzbl %ch,%eax
   13a95:	50                   	push   %eax
   13a96:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13a9c:	83 c0 03             	add    $0x3,%eax
   13a9f:	50                   	push   %eax
   13aa0:	e8 6b 01 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13aa5:	8b 55 a8             	mov    0xffffffa8(%ebp),%edx
   13aa8:	0f b6 c6             	movzbl %dh,%eax
   13aab:	50                   	push   %eax
   13aac:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13ab2:	83 c0 04             	add    $0x4,%eax
   13ab5:	50                   	push   %eax
   13ab6:	e8 55 01 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13abb:	8b 4d b8             	mov    0xffffffb8(%ebp),%ecx
   13abe:	0f b6 c5             	movzbl %ch,%eax
   13ac1:	50                   	push   %eax
   13ac2:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13ac8:	83 c0 05             	add    $0x5,%eax
   13acb:	50                   	push   %eax
   13acc:	e8 3f 01 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13ad1:	58                   	pop    %eax
   13ad2:	5a                   	pop    %edx
   13ad3:	e9 10 fa ff ff       	jmp    134e8 <_AtapiStartIo@8+0x868>
   13ad8:	83 ec 0c             	sub    $0xc,%esp
   13adb:	8b 9f 18 04 00 00    	mov    0x418(%edi),%ebx
   13ae1:	53                   	push   %ebx
   13ae2:	e8 19 01 00 00       	call   13c00 <_ScsiPortReadPortUchar@4>
   13ae7:	83 c8 01             	or     $0x1,%eax
   13aea:	25 ff 00 00 00       	and    $0xff,%eax
   13aef:	89 04 24             	mov    %eax,(%esp)
   13af2:	8b 8f 18 04 00 00    	mov    0x418(%edi),%ecx
   13af8:	51                   	push   %ecx
   13af9:	e8 12 01 00 00       	call   13c10 <_ScsiPortWritePortUchar@8>
   13afe:	58                   	pop    %eax
   13aff:	31 c0                	xor    %eax,%eax
   13b01:	5a                   	pop    %edx
   13b02:	e9 5b fd ff ff       	jmp    13862 <_AtapiStartIo@8+0xbe2>
   13b07:	8b 46 0c             	mov    0xc(%esi),%eax
   13b0a:	c1 e8 06             	shr    $0x6,%eax
   13b0d:	83 e0 01             	and    $0x1,%eax
   13b10:	83 f8 01             	cmp    $0x1,%eax
   13b13:	19 c0                	sbb    %eax,%eax
   13b15:	83 e0 02             	and    $0x2,%eax
   13b18:	83 e8 38             	sub    $0x38,%eax
   13b1b:	e9 c5 fa ff ff       	jmp    135e5 <_AtapiStartIo@8+0x965>
   13b20:	a8 10                	test   $0x10,%al
   13b22:	74 16                	je     13b3a <_AtapiStartIo@8+0xeba>
   13b24:	c1 ea 06             	shr    $0x6,%edx
   13b27:	83 e2 01             	and    $0x1,%edx
   13b2a:	83 fa 01             	cmp    $0x1,%edx
   13b2d:	19 c0                	sbb    %eax,%eax
   13b2f:	83 e0 10             	and    $0x10,%eax
   13b32:	83 c0 24             	add    $0x24,%eax
   13b35:	e9 ab fa ff ff       	jmp    135e5 <_AtapiStartIo@8+0x965>
   13b3a:	c1 ea 06             	shr    $0x6,%edx
   13b3d:	83 e2 01             	and    $0x1,%edx
   13b40:	83 fa 01             	cmp    $0x1,%edx
   13b43:	19 c0                	sbb    %eax,%eax
   13b45:	83 e0 10             	and    $0x10,%eax
   13b48:	83 c0 20             	add    $0x20,%eax
   13b4b:	e9 95 fa ff ff       	jmp    135e5 <_AtapiStartIo@8+0x965>
   13b50:	50                   	push   %eax
   13b51:	68 87 09 00 00       	push   $0x987
   13b56:	68 08 40 01 00       	push   $0x14008
   13b5b:	68 c6 42 01 00       	push   $0x142c6
   13b60:	e8 7b 01 00 00       	call   13ce0 <_DbgPrint>
   13b65:	83 c4 10             	add    $0x10,%esp
   13b68:	ba 01 00 00 00       	mov    $0x1,%edx
   13b6d:	c6 46 03 01          	movb   $0x1,0x3(%esi)
   13b71:	c7 87 28 04 00 00 00 	movl   $0x0,0x428(%edi)
   13b78:	00 00 00 
   13b7b:	e9 e1 fe ff ff       	jmp    13a61 <_AtapiStartIo@8+0xde1>
   13b80:	d1 ea                	shr    %edx
   13b82:	50                   	push   %eax
   13b83:	52                   	push   %edx
   13b84:	53                   	push   %ebx
   13b85:	8b 87 10 04 00 00    	mov    0x410(%edi),%eax
   13b8b:	50                   	push   %eax
   13b8c:	e8 df 00 00 00       	call   13c70 <_ScsiPortWritePortBufferUshort@12>
   13b91:	e9 c9 fc ff ff       	jmp    1385f <_AtapiStartIo@8+0xbdf>
   13b96:	90                   	nop    
   13b97:	90                   	nop    
   13b98:	90                   	nop    
   13b99:	90                   	nop    
   13b9a:	90                   	nop    
   13b9b:	90                   	nop    
   13b9c:	90                   	nop    
   13b9d:	90                   	nop    
   13b9e:	90                   	nop    
   13b9f:	90                   	nop    

00013ba0 <_ScsiPortInitialize@16>:
   13ba0:	ff 25 d4 60 01 00    	jmp    *0x160d4
   13ba6:	90                   	nop    
   13ba7:	90                   	nop    
	...

00013bb0 <_ScsiPortConvertUlongToPhysicalAddress@4>:
   13bb0:	ff 25 bc 60 01 00    	jmp    *0x160bc
   13bb6:	90                   	nop    
   13bb7:	90                   	nop    
	...

00013bc0 <_ScsiPortGetDeviceBase@28>:
   13bc0:	ff 25 c8 60 01 00    	jmp    *0x160c8
   13bc6:	90                   	nop    
   13bc7:	90                   	nop    
	...

00013bd0 <_ScsiPortGetUncachedExtension@12>:
   13bd0:	ff 25 d0 60 01 00    	jmp    *0x160d0
   13bd6:	90                   	nop    
   13bd7:	90                   	nop    
	...

00013be0 <_ScsiPortGetPhysicalAddress@16>:
   13be0:	ff 25 cc 60 01 00    	jmp    *0x160cc
   13be6:	90                   	nop    
   13be7:	90                   	nop    
	...

00013bf0 <_ScsiPortFreeDeviceBase@8>:
   13bf0:	ff 25 c0 60 01 00    	jmp    *0x160c0
   13bf6:	90                   	nop    
   13bf7:	90                   	nop    
	...

00013c00 <_ScsiPortReadPortUchar@4>:
   13c00:	ff 25 e4 60 01 00    	jmp    *0x160e4
   13c06:	90                   	nop    
   13c07:	90                   	nop    
	...

00013c10 <_ScsiPortWritePortUchar@8>:
   13c10:	ff 25 f8 60 01 00    	jmp    *0x160f8
   13c16:	90                   	nop    
   13c17:	90                   	nop    
	...

00013c20 <_ScsiPortStallExecution@4>:
   13c20:	ff 25 ec 60 01 00    	jmp    *0x160ec
   13c26:	90                   	nop    
   13c27:	90                   	nop    
	...

00013c30 <_ScsiPortReadPortBufferUshort@12>:
   13c30:	ff 25 e0 60 01 00    	jmp    *0x160e0
   13c36:	90                   	nop    
   13c37:	90                   	nop    
	...

00013c40 <_ScsiPortConvertPhysicalAddressToUlong@8>:
   13c40:	ff 25 b8 60 01 00    	jmp    *0x160b8
   13c46:	90                   	nop    
   13c47:	90                   	nop    
	...

00013c50 <_ScsiPortGetBusData@24>:
   13c50:	ff 25 c4 60 01 00    	jmp    *0x160c4
   13c56:	90                   	nop    
   13c57:	90                   	nop    
	...

00013c60 <_ScsiPortReadPortUshort@4>:
   13c60:	ff 25 e8 60 01 00    	jmp    *0x160e8
   13c66:	90                   	nop    
   13c67:	90                   	nop    
	...

00013c70 <_ScsiPortWritePortBufferUshort@12>:
   13c70:	ff 25 f4 60 01 00    	jmp    *0x160f4
   13c76:	90                   	nop    
   13c77:	90                   	nop    
	...

00013c80 <_ScsiPortReadPortBufferUlong@12>:
   13c80:	ff 25 dc 60 01 00    	jmp    *0x160dc
   13c86:	90                   	nop    
   13c87:	90                   	nop    
	...

00013c90 <_ScsiPortWritePortBufferUlong@12>:
   13c90:	ff 25 f0 60 01 00    	jmp    *0x160f0
   13c96:	90                   	nop    
   13c97:	90                   	nop    
	...

00013ca0 <_ScsiPortWritePortUlong@8>:
   13ca0:	ff 25 fc 60 01 00    	jmp    *0x160fc
   13ca6:	90                   	nop    
   13ca7:	90                   	nop    
	...

00013cb0 <_ScsiPortNotification>:
   13cb0:	ff 25 d8 60 01 00    	jmp    *0x160d8
   13cb6:	90                   	nop    
   13cb7:	90                   	nop    
	...

00013cc0 <_RtlZeroMemory@8>:
   13cc0:	ff 25 ac 60 01 00    	jmp    *0x160ac
   13cc6:	90                   	nop    
   13cc7:	90                   	nop    
	...

00013cd0 <_KeBugCheck@4>:
   13cd0:	ff 25 a8 60 01 00    	jmp    *0x160a8
   13cd6:	90                   	nop    
   13cd7:	90                   	nop    
	...

00013ce0 <_DbgPrint>:
   13ce0:	ff 25 a4 60 01 00    	jmp    *0x160a4
   13ce6:	90                   	nop    
   13ce7:	90                   	nop    
	...

00013cf0 <__CTOR_LIST__>:
   13cf0:	ff                   	(bad)  
   13cf1:	ff                   	(bad)  
   13cf2:	ff                   	(bad)  
   13cf3:	ff 00                	incl   (%eax)
   13cf5:	00 00                	add    %al,(%eax)
	...

00013cf8 <__DTOR_LIST__>:
   13cf8:	ff                   	(bad)  
   13cf9:	ff                   	(bad)  
   13cfa:	ff                   	(bad)  
   13cfb:	ff 00                	incl   (%eax)
   13cfd:	00 00                	add    %al,(%eax)
	...
