	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_and_test
_write_and_test:                        ## @write_and_test
	.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
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	8(%rdi), %rax
	movl	(%rax), %r12d
	movl	(%rdi), %edi
	callq	_PCI_SLOT
	movl	%eax, %ebx
	movl	(%r13), %edi
	callq	_PCI_FUNC
	subq	$8, %rsp
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	movl	%r12d, %edx
	movl	%ebx, %ecx
	movl	%eax, %r8d
	movl	%r15d, %r9d
	pushq	%r14
	callq	_edac_dbg
	addq	$16, %rsp
	movl	$10, %ebx
	leaq	-56(%rbp), %r12
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$10, %ebx
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$100, %edi
	callq	_msleep
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r13, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_pci_write_config_dword
	movq	%r13, %rdi
	movl	%r15d, %esi
	movq	%r12, %rdx
	callq	_pci_read_config_dword
	cmpq	%r14, -56(%rbp)
	je	LBB0_5
## %bb.1:                               ##   in Loop: Header=BB0_2 Depth=1
	decl	%ebx
	jne	LBB0_2
## %bb.6:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	8(%r13), %rax
	movl	(%rax), %ebx
	movl	(%r13), %edi
	callq	_PCI_SLOT
	movl	%eax, %r12d
	movl	(%r13), %edi
	callq	_PCI_FUNC
	leaq	L_.str.1(%rip), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%ebx, %edx
	movl	%r12d, %ecx
	movl	%eax, %r8d
	movl	%r15d, %r9d
	pushq	-56(%rbp)
	pushq	%r14
	callq	_i7core_printk
	addq	$16, %rsp
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_7
LBB0_5:
	xorl	%eax, %eax
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"setting pci %02x:%02x.%x reg=%02x value=%08x\n"

	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
L_.str.1:                               ## @.str.1
	.asciz	"Error during set pci %02x:%02x.%x reg=%02x write=%08x. Read=%08x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_write_and_test
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_and_test
_write_and_test:                        ; @write_and_test
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x8, [x0, #8]
	ldr	w22, [x8]
	ldr	w0, [x0]
	bl	_PCI_SLOT
	mov	x23, x0
	ldr	w0, [x21]
	bl	_PCI_FUNC
	mov	x4, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #0
	mov	x2, x22
	mov	x3, x23
	mov	x5, x20
	mov	x6, x19
	bl	_edac_dbg
	mov	w22, #10
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, #10
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #100
	bl	_msleep
LBB0_3:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_pci_write_config_dword
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x20
	bl	_pci_read_config_dword
	ldr	x8, [sp, #8]
	cmp	x8, x19
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	subs	w22, w22, #1
	b.ne	LBB0_1
; %bb.5:
Lloh2:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh4:
	ldr	w22, [x8]
	ldr	x8, [x21, #8]
	ldr	w23, [x8]
	ldr	w0, [x21]
	bl	_PCI_SLOT
	mov	x24, x0
	ldr	w0, [x21]
	bl	_PCI_FUNC
	mov	x4, x0
	ldr	x7, [sp, #8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	mov	x2, x23
	mov	x3, x24
	mov	x5, x20
	mov	x6, x19
	bl	_i7core_printk
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_6:
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"setting pci %02x:%02x.%x reg=%02x value=%08x\n"

	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
l_.str.1:                               ; @.str.1
	.asciz	"Error during set pci %02x:%02x.%x reg=%02x write=%08x. Read=%08x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_write_and_test
.subsections_via_symbols
