	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mthca_map_eq_regs
_mthca_map_eq_regs:                     ## @mthca_map_eq_regs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	callq	_mthca_is_memfree
	testq	%rax, %rax
	je	LBB0_8
## %bb.1:
	movl	28(%rbx), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_pci_resource_len
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %esi
	andl	16(%rbx), %esi
	movq	_MTHCA_CLR_INT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rcx
	callq	_mthca_map_reg
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mthca_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_8:
	movq	_MTHCA_CLR_INT_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTHCA_CLR_INT_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	%rbx, %rcx
	callq	_mthca_map_reg
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mthca_err
	jmp	LBB0_14
LBB0_4:
	movl	28(%rbx), %edi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_pci_resource_len
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %esi
	andl	20(%rbx), %esi
	addl	$4, %esi
	leaq	8(%rbx), %rcx
	movq	%rbx, %rdi
	movl	$4, %edx
	callq	_mthca_map_reg
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mthca_err
	movl	(%rbx), %edi
	callq	_iounmap
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_10:
	movq	_MTHCA_ECR_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MTHCA_ECR_SIZE@GOTPCREL(%rip), %rax
	movq	_MTHCA_ECR_CLR_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	addl	(%rax), %edx
	leaq	4(%rbx), %rcx
	movq	%rbx, %rdi
	callq	_mthca_map_reg
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mthca_err
	jmp	LBB0_13
LBB0_6:
	movl	28(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_len
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %esi
	andl	24(%rbx), %esi
	movq	_MTHCA_EQ_SET_CI_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	12(%rbx), %rcx
	movq	%rbx, %rdi
	callq	_mthca_map_reg
	testq	%rax, %rax
	je	LBB0_16
## %bb.7:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_mthca_err
	movl	8(%rbx), %edi
	callq	_iounmap
LBB0_13:
	movl	(%rbx), %edi
	callq	_iounmap
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_15:
	subl	(%rax), %r14d
LBB0_16:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_11:
	xorl	%r14d, %r14d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_MTHCA_CLR_INT_SIZE,4,2         ## @MTHCA_CLR_INT_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't map interrupt clear register, aborting.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't map EQ arm register, aborting.\n"

	.comm	_MTHCA_EQ_SET_CI_SIZE,4,2       ## @MTHCA_EQ_SET_CI_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't map EQ CI register, aborting.\n"

	.comm	_MTHCA_CLR_INT_BASE,4,2         ## @MTHCA_CLR_INT_BASE
	.comm	_MTHCA_ECR_BASE,4,2             ## @MTHCA_ECR_BASE
	.comm	_MTHCA_ECR_SIZE,4,2             ## @MTHCA_ECR_SIZE
	.comm	_MTHCA_ECR_CLR_SIZE,4,2         ## @MTHCA_ECR_CLR_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"Couldn't map ecr register, aborting.\n"

	.no_dead_strip	_mthca_map_eq_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mthca_map_eq_regs
_mthca_map_eq_regs:                     ; @mthca_map_eq_regs
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_mthca_is_memfree
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w0, [x19, #28]
	mov	w1, #0
	bl	_pci_resource_len
	sub	w8, w0, #1
	ldr	w9, [x19, #16]
	and	w1, w8, w9
Lloh0:
	adrp	x8, _MTHCA_CLR_INT_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MTHCA_CLR_INT_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x19
	bl	_mthca_map_reg
	cbnz	x0, LBB0_5
; %bb.2:
	ldr	w0, [x19, #28]
	mov	w1, #0
	bl	_pci_resource_len
	sub	w8, w0, #1
	ldr	w9, [x19, #20]
	and	w8, w8, w9
	add	w1, w8, #4
	add	x3, x19, #8
	mov	x0, x19
	mov	w2, #4
	bl	_mthca_map_reg
	cbz	x0, LBB0_9
; %bb.3:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_4:
Lloh5:
	adrp	x8, _MTHCA_CLR_INT_BASE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MTHCA_CLR_INT_BASE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _MTHCA_CLR_INT_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MTHCA_CLR_INT_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x3, x19
	bl	_mthca_map_reg
	cbz	x0, LBB0_6
LBB0_5:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
	b	LBB0_12
LBB0_6:
Lloh13:
	adrp	x8, _MTHCA_ECR_BASE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _MTHCA_ECR_BASE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
Lloh16:
	adrp	x8, _MTHCA_ECR_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MTHCA_ECR_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _MTHCA_ECR_CLR_SIZE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _MTHCA_ECR_CLR_SIZE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	add	w2, w9, w8
	add	x3, x19, #4
	mov	x0, x19
	bl	_mthca_map_reg
	cbz	x0, LBB0_13
; %bb.7:
Lloh22:
	adrp	x1, l_.str.3@PAGE
Lloh23:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_8:
	mov	x0, x19
	bl	_mthca_err
	b	LBB0_11
LBB0_9:
	ldr	w0, [x19, #28]
	mov	w1, #0
	bl	_pci_resource_len
	sub	w8, w0, #1
	ldr	w9, [x19, #24]
	and	w1, w8, w9
Lloh24:
	adrp	x8, _MTHCA_EQ_SET_CI_SIZE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MTHCA_EQ_SET_CI_SIZE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	add	x3, x19, #12
	mov	x0, x19
	bl	_mthca_map_reg
	cbz	x0, LBB0_13
; %bb.10:
Lloh27:
	adrp	x1, l_.str.2@PAGE
Lloh28:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_mthca_err
	ldr	w0, [x19, #8]
	bl	_iounmap
LBB0_11:
	ldr	w0, [x19]
	bl	_iounmap
LBB0_12:
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_MTHCA_CLR_INT_SIZE,4,2         ; @MTHCA_CLR_INT_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't map interrupt clear register, aborting.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't map EQ arm register, aborting.\n"

	.comm	_MTHCA_EQ_SET_CI_SIZE,4,2       ; @MTHCA_EQ_SET_CI_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't map EQ CI register, aborting.\n"

	.comm	_MTHCA_CLR_INT_BASE,4,2         ; @MTHCA_CLR_INT_BASE
	.comm	_MTHCA_ECR_BASE,4,2             ; @MTHCA_ECR_BASE
	.comm	_MTHCA_ECR_SIZE,4,2             ; @MTHCA_ECR_SIZE
	.comm	_MTHCA_ECR_CLR_SIZE,4,2         ; @MTHCA_ECR_CLR_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"Couldn't map ecr register, aborting.\n"

	.no_dead_strip	_mthca_map_eq_regs
.subsections_via_symbols
