	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_reassigndev_resource_alignment ## -- Begin function pci_reassigndev_resource_alignment
	.p2align	4, 0x90
_pci_reassigndev_resource_alignment:    ## @pci_reassigndev_resource_alignment
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$0, -44(%rbp)
	cmpq	$0, 24(%rdi)
	je	LBB0_1
LBB0_15:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %r15
	leaq	-44(%rbp), %rsi
	callq	_pci_specified_resource_alignment
	testl	%eax, %eax
	je	LBB0_15
## %bb.2:
	movl	%eax, %r14d
	movq	(%r15), %rax
	movq	_PCI_HEADER_TYPE_NORMAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.3:
	movl	8(%r15), %eax
	sarl	$8, %eax
	movq	_PCI_CLASS_BRIDGE_HOST@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_pci_warn
	jmp	LBB0_15
LBB0_5:
	movq	_PCI_COMMAND@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_pci_read_config_word
	movq	_PCI_COMMAND_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-48(%rbp), %edx
	movl	%edx, -48(%rbp)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_pci_write_config_word
	movq	_PCI_ROM_RESOURCE@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	js	LBB0_8
## %bb.6:
	movl	$-1, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	incl	%ebx
	movl	-44(%rbp), %ecx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	callq	_pci_request_resource_alignment
	cmpl	(%r12), %ebx
	jl	LBB0_7
LBB0_8:
	movq	(%r15), %rax
	movq	_PCI_HEADER_TYPE_BRIDGE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_15
## %bb.9:
	movq	_PCI_BRIDGE_RESOURCES@GOTPCREL(%rip), %rax
	movslq	(%rax), %r12
	movq	_PCI_NUM_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %r12d
	jge	LBB0_14
## %bb.10:
	leaq	(,%r12,8), %rcx
	leaq	(%rcx,%rcx,2), %rbx
	movq	_IORESOURCE_MEM@GOTPCREL(%rip), %r13
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r12
	movslq	%eax, %rcx
	addq	$24, %rbx
	cmpq	%rcx, %r12
	jge	LBB0_14
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %r14
	movl	(%r14,%rbx), %ecx
	testl	%ecx, (%r13)
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	leaq	(%r14,%rbx), %rdi
	movq	_IORESOURCE_UNSET@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, (%r14,%rbx)
	callq	_resource_size
	decq	%rax
	movq	%rax, 16(%r14,%rbx)
	movq	$0, 8(%r14,%rbx)
	movq	_PCI_NUM_RESOURCES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_13
LBB0_14:
	movq	%r15, %rdi
	callq	_pci_disable_bridge_window
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_HEADER_TYPE_NORMAL,8,3     ## @PCI_HEADER_TYPE_NORMAL
	.comm	_PCI_CLASS_BRIDGE_HOST,4,2      ## @PCI_CLASS_BRIDGE_HOST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't reassign resources to host bridge\n"

	.comm	_PCI_COMMAND,4,2                ## @PCI_COMMAND
	.comm	_PCI_COMMAND_MEMORY,4,2         ## @PCI_COMMAND_MEMORY
	.comm	_PCI_ROM_RESOURCE,4,2           ## @PCI_ROM_RESOURCE
	.comm	_PCI_HEADER_TYPE_BRIDGE,8,3     ## @PCI_HEADER_TYPE_BRIDGE
	.comm	_PCI_BRIDGE_RESOURCES,4,2       ## @PCI_BRIDGE_RESOURCES
	.comm	_PCI_NUM_RESOURCES,4,2          ## @PCI_NUM_RESOURCES
	.comm	_IORESOURCE_MEM,4,2             ## @IORESOURCE_MEM
	.comm	_IORESOURCE_UNSET,4,2           ## @IORESOURCE_UNSET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pci_reassigndev_resource_alignment ; -- Begin function pci_reassigndev_resource_alignment
	.p2align	2
_pci_reassigndev_resource_alignment:    ; @pci_reassigndev_resource_alignment
	.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
	str	wzr, [sp, #8]
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_2
LBB0_1:
	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_2:
	mov	x19, x0
	add	x1, sp, #8
	bl	_pci_specified_resource_alignment
	cbz	w0, LBB0_1
; %bb.3:
	mov	x20, x0
	ldr	x8, [x19]
Lloh0:
	adrp	x9, _PCI_HEADER_TYPE_NORMAL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCI_HEADER_TYPE_NORMAL@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.4:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _PCI_CLASS_BRIDGE_HOST@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PCI_CLASS_BRIDGE_HOST@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w9, w8, asr #8
	b.ne	LBB0_6
; %bb.5:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_pci_warn
	b	LBB0_1
LBB0_6:
Lloh8:
	adrp	x21, _PCI_COMMAND@GOTPAGE
Lloh9:
	ldr	x21, [x21, _PCI_COMMAND@GOTPAGEOFF]
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_pci_read_config_word
Lloh10:
	adrp	x8, _PCI_COMMAND_MEMORY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _PCI_COMMAND_MEMORY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_pci_write_config_word
Lloh13:
	adrp	x22, _PCI_ROM_RESOURCE@GOTPAGE
Lloh14:
	ldr	x22, [x22, _PCI_ROM_RESOURCE@GOTPAGEOFF]
	ldr	w8, [x22]
	tbnz	w8, #31, LBB0_9
; %bb.7:
	mov	w21, #-1
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	add	w21, w21, #1
	ldr	w3, [sp, #8]
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_pci_request_resource_alignment
	ldr	w8, [x22]
	cmp	w21, w8
	b.lt	LBB0_8
LBB0_9:
	ldr	x8, [x19]
Lloh15:
	adrp	x9, _PCI_HEADER_TYPE_BRIDGE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _PCI_HEADER_TYPE_BRIDGE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_1
; %bb.10:
Lloh18:
	adrp	x8, _PCI_BRIDGE_RESOURCES@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PCI_BRIDGE_RESOURCES@GOTPAGEOFF]
Lloh20:
	ldrsw	x21, [x8]
Lloh21:
	adrp	x22, _PCI_NUM_RESOURCES@GOTPAGE
Lloh22:
	ldr	x22, [x22, _PCI_NUM_RESOURCES@GOTPAGEOFF]
	ldr	w8, [x22]
	cmp	w21, w8
	b.ge	LBB0_15
; %bb.11:
	add	x9, x21, x21, lsl #1
	lsl	x23, x9, #3
Lloh23:
	adrp	x24, _IORESOURCE_MEM@GOTPAGE
Lloh24:
	ldr	x24, [x24, _IORESOURCE_MEM@GOTPAGEOFF]
Lloh25:
	adrp	x25, _IORESOURCE_UNSET@GOTPAGE
Lloh26:
	ldr	x25, [x25, _IORESOURCE_UNSET@GOTPAGEOFF]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x21, x21, #1
	add	x23, x23, #24
	cmp	x21, w8, sxtw
	b.ge	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x19, #16]
	add	x20, x9, x23
	ldr	w9, [x20]
	ldr	w10, [x24]
	tst	w10, w9
	b.eq	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x25]
	orr	w8, w8, w9
	str	w8, [x20]
	mov	x0, x20
	bl	_resource_size
	sub	x8, x0, #1
	stp	xzr, x8, [x20, #8]
	ldr	w8, [x22]
	b	LBB0_12
LBB0_15:
	mov	x0, x19
	bl	_pci_disable_bridge_window
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_PCI_HEADER_TYPE_NORMAL,8,3     ; @PCI_HEADER_TYPE_NORMAL
	.comm	_PCI_CLASS_BRIDGE_HOST,4,2      ; @PCI_CLASS_BRIDGE_HOST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't reassign resources to host bridge\n"

	.comm	_PCI_COMMAND,4,2                ; @PCI_COMMAND
	.comm	_PCI_COMMAND_MEMORY,4,2         ; @PCI_COMMAND_MEMORY
	.comm	_PCI_ROM_RESOURCE,4,2           ; @PCI_ROM_RESOURCE
	.comm	_PCI_HEADER_TYPE_BRIDGE,8,3     ; @PCI_HEADER_TYPE_BRIDGE
	.comm	_PCI_BRIDGE_RESOURCES,4,2       ; @PCI_BRIDGE_RESOURCES
	.comm	_PCI_NUM_RESOURCES,4,2          ; @PCI_NUM_RESOURCES
	.comm	_IORESOURCE_MEM,4,2             ; @IORESOURCE_MEM
	.comm	_IORESOURCE_UNSET,4,2           ; @IORESOURCE_UNSET
.subsections_via_symbols
