	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_emul_diow
_pci_emul_diow:                         ## @pci_emul_diow
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r12d
	movl	%r8d, %r15d
	movl	%ecx, %r13d
	movl	16(%rbp), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	(%rdx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	je	LBB0_1
LBB0_20:
	leal	-1(%r13), %eax
	cmpl	$1, %eax
	ja	LBB0_27
## %bb.21:
	leal	(%r12,%r15), %ecx
	movq	_DMEMSZ@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jle	LBB0_23
## %bb.22:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_3
LBB0_1:
	leal	(%r12,%r15), %eax
	movq	_DIOSZ@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %rdi
LBB0_3:
	movl	%r15d, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf                         ## TAILCALL
LBB0_27:
	cmpl	$3, %r13d
	jb	LBB0_30
## %bb.28:
	leaq	L_.str.4(%rip), %rdi
	movl	%r13d, %esi
LBB0_26:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_printf                         ## TAILCALL
LBB0_4:
	movq	%rdx, %rbx
	cmpl	$4, %r12d
	je	LBB0_10
## %bb.5:
	cmpl	$2, %r12d
	je	LBB0_9
## %bb.6:
	cmpl	$1, %r12d
	jne	LBB0_11
## %bb.7:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movzbl	%r14b, %eax
	jmp	LBB0_8
LBB0_23:
	leal	-1(%r12), %ecx
	cmpl	$7, %ecx
	ja	LBB0_25
## %bb.24:
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rcx
	addq	%rdx, %rcx
	jmpq	*%rcx
LBB0_29:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	8(%rcx), %rcx
	movl	%eax, %eax
	movq	(%rcx,%rax,8), %rax
	movslq	%r15d, %rcx
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movl	%edx, (%rax,%rcx,4)
	jmp	LBB0_30
LBB0_10:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movslq	%r15d, %rcx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, (%rax,%rcx,4)
	jmp	LBB0_12
LBB0_9:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movzwl	%r14w, %eax
LBB0_8:
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %rcx
	movslq	%r15d, %rdx
	movl	%eax, (%rcx,%rdx,4)
	jmp	LBB0_16
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_printf
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_12:
	cmpl	$4, %r15d
	jne	LBB0_16
## %bb.13:
	cmpl	$4, %r12d
	jne	LBB0_16
## %bb.14:
	movq	%rbx, %rdi
	callq	_pci_msi_enabled
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	%rbx, %rdi
	callq	_pci_msi_maxmsgnum
	movl	%eax, %ecx
	movl	%r14d, %eax
	cltd
	idivl	%ecx
	movq	%rbx, %rdi
	movl	%edx, %esi
	callq	_pci_generate_msi
LBB0_16:
	cmpl	$11259375, %r14d                ## imm = 0xABCDEF
	jne	LBB0_30
## %bb.17:
	movq	%rbx, %rdi
	callq	_pci_msi_maxmsgnum
	testl	%eax, %eax
	jle	LBB0_30
## %bb.18:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_pci_generate_msi
	incl	%r14d
	movq	%rbx, %rdi
	callq	_pci_msi_maxmsgnum
	cmpl	%eax, %r14d
	jl	LBB0_19
	jmp	LBB0_20
LBB0_30:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	jmp	LBB0_26
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_29, LBB0_29-LJTI0_0
.set L0_0_set_25, LBB0_25-LJTI0_0
LJTI0_0:
	.long	L0_0_set_29
	.long	L0_0_set_29
	.long	L0_0_set_25
	.long	L0_0_set_29
	.long	L0_0_set_25
	.long	L0_0_set_25
	.long	L0_0_set_25
	.long	L0_0_set_29
	.end_data_region
                                        ## -- End function
	.comm	_DIOSZ,4,2                      ## @DIOSZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"diow: iow too large, offset %ld size %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"diow: iow unknown size %d\n"

	.comm	_DMEMSZ,4,2                     ## @DMEMSZ
L_.str.2:                               ## @.str.2
	.asciz	"diow: memw too large, offset %ld size %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"diow: memw unknown size %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"diow: unknown bar idx %d\n"

	.no_dead_strip	_pci_emul_diow
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_emul_diow
_pci_emul_diow:                         ; @pci_emul_diow
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x6
	mov	x21, x5
	mov	x19, x4
	mov	x22, x3
	ldr	x25, [x2]
	cbz	w3, LBB0_4
LBB0_1:
	sub	w8, w22, #1
	cmp	w8, #1
	b.hi	LBB0_7
; %bb.2:
Lloh0:
	adrp	x9, _DMEMSZ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMEMSZ@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	add	w10, w21, w19
	cmp	w10, w9
	b.le	LBB0_14
; %bb.3:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	str	x21, [sp]
Lloh3:
	adrp	x0, l_.str.2@PAGE
Lloh4:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_6
LBB0_4:
Lloh5:
	adrp	x8, _DIOSZ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DIOSZ@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	add	w9, w21, w19
	cmp	w9, w8
	b.le	LBB0_10
; %bb.5:
	str	x21, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
LBB0_6:
	mov	x1, x19
	bl	_printf
	b	LBB0_29
LBB0_7:
	cmp	w22, #3
	b.lo	LBB0_29
; %bb.8:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x22
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_printf
LBB0_10:
	mov	x23, x2
	cmp	w21, #4
	b.eq	LBB0_17
; %bb.11:
	cmp	w21, #2
	b.eq	LBB0_18
; %bb.12:
	cmp	w21, #1
	b.ne	LBB0_20
; %bb.13:
	and	w8, w20, #0xff
	b	LBB0_19
LBB0_14:
	sub	w9, w21, #1
	cmp	w9, #7
	b.hi	LBB0_30
; %bb.15:
Lloh12:
	adrp	x10, lJTI0_0@PAGE
Lloh13:
	add	x10, x10, lJTI0_0@PAGEOFF
	adr	x11, LBB0_16
	ldrb	w12, [x10, x9]
	add	x11, x11, x12, lsl #2
	br	x11
LBB0_16:
	ldr	x9, [x25, #8]
	ldr	x8, [x9, w8, uxtw #3]
	str	w20, [x8, w19, sxtw #2]
	b	LBB0_29
LBB0_17:
	ldr	x8, [x25]
	str	w20, [x8, w19, sxtw #2]
	b	LBB0_21
LBB0_18:
	and	w8, w20, #0xffff
LBB0_19:
	ldr	x9, [x25]
	str	w8, [x9, w19, sxtw #2]
	b	LBB0_25
LBB0_20:
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_printf
LBB0_21:
	cmp	w19, #4
	b.ne	LBB0_25
; %bb.22:
	cmp	w21, #4
	b.ne	LBB0_25
; %bb.23:
	mov	x0, x23
	bl	_pci_msi_enabled
	cbz	x0, LBB0_25
; %bb.24:
	mov	x0, x23
	bl	_pci_msi_maxmsgnum
	sdiv	w8, w20, w0
	msub	w1, w8, w0, w20
	mov	x0, x23
	bl	_pci_generate_msi
LBB0_25:
	mov	w8, #52719
	movk	w8, #171, lsl #16
	cmp	w20, w8
	b.ne	LBB0_29
; %bb.26:
	mov	x0, x23
	bl	_pci_msi_maxmsgnum
	cmp	w0, #1
	b.lt	LBB0_29
; %bb.27:
	mov	w24, #0
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	mov	x1, x24
	bl	_pci_generate_msi
	add	w24, w24, #1
	mov	x0, x23
	bl	_pci_msi_maxmsgnum
	cmp	w24, w0
	b.lt	LBB0_28
	b	LBB0_1
LBB0_29:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_30:
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x21
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_16-LBB0_16)>>2
	.byte	(LBB0_16-LBB0_16)>>2
	.byte	(LBB0_30-LBB0_16)>>2
	.byte	(LBB0_16-LBB0_16)>>2
	.byte	(LBB0_30-LBB0_16)>>2
	.byte	(LBB0_30-LBB0_16)>>2
	.byte	(LBB0_30-LBB0_16)>>2
	.byte	(LBB0_16-LBB0_16)>>2
                                        ; -- End function
	.comm	_DIOSZ,4,2                      ; @DIOSZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"diow: iow too large, offset %ld size %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"diow: iow unknown size %d\n"

	.comm	_DMEMSZ,4,2                     ; @DMEMSZ
l_.str.2:                               ; @.str.2
	.asciz	"diow: memw too large, offset %ld size %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"diow: memw unknown size %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"diow: unknown bar idx %d\n"

	.no_dead_strip	_pci_emul_diow
.subsections_via_symbols
