	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_create_eq                 ## -- Begin function ehca_create_eq
	.p2align	4, 0x90
_ehca_create_eq:                        ## @ehca_create_eq
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movl	%edx, %r12d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	4(%rdi), %r13
	leaq	32(%rsi), %rdi
	callq	_spin_lock_init
	leaq	28(%r14), %rdi
	callq	_spin_lock_init
	movl	$0, (%r14)
	movq	_EHCA_EQ@GOTPCREL(%rip), %rcx
	movq	_EHCA_NEQ@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rcx)
	je	LBB0_3
## %bb.1:
	cmpl	%r12d, (%rax)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	movl	%r12d, %edx
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_ehca_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_3:
	testl	%r15d, %r15d
	je	LBB0_4
## %bb.7:
	movl	(%rbx), %edi
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%r14), %rsi
	leaq	20(%r14), %rbx
	leaq	24(%r14), %r9
	leaq	8(%r14), %rax
	movq	%rax, 8(%rsp)
	leaq	-44(%rbp), %rax
	movq	%rax, (%rsp)
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, %edx
	movl	%r15d, %ecx
	movq	%rbx, %r8
	callq	_hipz_h_alloc_resource_eq
	movq	_H_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.9:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	leaq	4(%r14), %rsi
	movl	-44(%rbp), %edx
	movq	_EHCA_PAGESIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$0, (%rsp)
	xorl	%edi, %edi
	movq	%rsi, %r15
	movl	$4, %r8d
	xorl	%r9d, %r9d
	callq	_ipz_queue_ctor
	testl	%eax, %eax
	je	LBB0_29
## %bb.10:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	cmpl	$0, -44(%rbp)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jle	LBB0_19
## %bb.11:
	xorl	%r13d, %r13d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_12 Depth=1
	movq	_H_PAGE_REGISTERED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rbx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_25
LBB0_18:                                ##   in Loop: Header=BB0_12 Depth=1
	incl	%r13d
	cmpl	%eax, %r13d
	jge	LBB0_19
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_ipz_qpageit_get_inc
	testq	%rax, %rax
	je	LBB0_25
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%rax, %rdi
	callq	_virt_to_abs
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edi
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %esi
	movl	$1, (%rsp)
	movq	%rbx, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	movq	%rax, %r9
	callq	_hipz_h_register_rpage_eq
	movq	%rax, %rbx
	movl	-44(%rbp), %eax
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r13d
	jne	LBB0_17
## %bb.14:                              ##   in Loop: Header=BB0_12 Depth=1
	movq	%r15, %rdi
	callq	_ipz_qpageit_get_inc
	movq	_H_SUCCESS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rbx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_25
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	testq	%rax, %rax
	jne	LBB0_25
## %bb.16:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-44(%rbp), %eax
	jmp	LBB0_18
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_8:
	leaq	L_.str.2(%rip), %rsi
LBB0_5:
	xorl	%ebx, %ebx
	movq	%r13, %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_ehca_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_27
LBB0_29:
	leaq	L_.str.3(%rip), %rsi
	movq	%r13, %rdi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_ehca_err
	jmp	LBB0_26
LBB0_19:
	movq	%r15, %rdi
	callq	_ipz_qeit_reset
	movq	_EHCA_EQ@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	jne	LBB0_21
## %bb.20:
	leaq	12(%r14), %rdi
	movq	_ehca_tasklet_eq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_tasklet_init
	movl	8(%r14), %edi
	movq	_ehca_interrupt_eq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rcx
	movq	%rbx, %r8
	callq	_ibmebus_request_irq
	testl	%eax, %eax
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	jns	LBB0_24
	jmp	LBB0_23
LBB0_25:
	xorl	%edi, %edi
	movq	%r15, %rsi
	callq	_ipz_queue_dtor
LBB0_26:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_hipz_h_destroy_eq
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_27:
	subl	(%rax), %ebx
LBB0_28:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movq	_EHCA_NEQ@GOTPCREL(%rip), %rax
	cmpl	%r12d, (%rax)
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	jne	LBB0_24
## %bb.22:
	leaq	12(%r14), %rdi
	movq	_ehca_tasklet_neq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_tasklet_init
	movl	8(%r14), %edi
	movq	_ehca_interrupt_neq@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_IRQF_DISABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.6(%rip), %rcx
	movq	%rbx, %r8
	callq	_ibmebus_request_irq
	testl	%eax, %eax
	jns	LBB0_24
LBB0_23:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_ehca_err
LBB0_24:
	movl	$1, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_EHCA_EQ,4,2                    ## @EHCA_EQ
	.comm	_EHCA_NEQ,4,2                   ## @EHCA_NEQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid EQ type %x. eq=%p"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"EQ length must not be zero. eq=%p"

	.comm	_H_SUCCESS,8,3                  ## @H_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"Can't allocate EQ/NEQ. eq=%p"

	.comm	_EHCA_PAGESIZE,4,2              ## @EHCA_PAGESIZE
L_.str.3:                               ## @.str.3
	.asciz	"Can't allocate EQ pages eq=%p"

	.comm	_H_PAGE_REGISTERED,8,3          ## @H_PAGE_REGISTERED
	.comm	_ehca_tasklet_eq,4,2            ## @ehca_tasklet_eq
	.comm	_ehca_interrupt_eq,4,2          ## @ehca_interrupt_eq
	.comm	_IRQF_DISABLED,4,2              ## @IRQF_DISABLED
L_.str.4:                               ## @.str.4
	.asciz	"ehca_eq"

L_.str.5:                               ## @.str.5
	.asciz	"Can't map interrupt handler."

	.comm	_ehca_tasklet_neq,4,2           ## @ehca_tasklet_neq
	.comm	_ehca_interrupt_neq,4,2         ## @ehca_interrupt_neq
L_.str.6:                               ## @.str.6
	.asciz	"ehca_neq"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_create_eq                 ; -- Begin function ehca_create_eq
	.p2align	2
_ehca_create_eq:                        ; @ehca_create_eq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x3
	mov	x22, x2
	mov	x19, x1
	mov	x21, x0
	add	x20, x0, #4
	add	x0, x1, #32
	bl	_spin_lock_init
	add	x0, x19, #28
	bl	_spin_lock_init
	str	wzr, [x19]
Lloh0:
	adrp	x28, _EHCA_EQ@GOTPAGE
Lloh1:
	ldr	x28, [x28, _EHCA_EQ@GOTPAGEOFF]
	ldr	w8, [x28]
Lloh2:
	adrp	x9, _EHCA_NEQ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _EHCA_NEQ@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	cmp	w8, w22
	ccmp	w9, w22, #4, ne
	b.ne	LBB0_6
; %bb.1:
	cbz	w25, LBB0_13
; %bb.2:
	ldr	w0, [x21]
	add	x23, x19, #16
	add	x24, x19, #20
	add	x5, x19, #24
	add	x7, x19, #8
	add	x6, sp, #28
	mov	x1, x23
	mov	x2, x22
	mov	x3, x25
	mov	x4, x24
	bl	_hipz_h_alloc_resource_eq
Lloh5:
	adrp	x8, _H_SUCCESS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _H_SUCCESS@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.3:
	add	x25, x19, #4
	ldr	w2, [sp, #28]
Lloh8:
	adrp	x8, _EHCA_PAGESIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EHCA_PAGESIZE@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
	mov	x0, #0
	mov	x1, x25
	mov	w4, #4
	mov	w5, #0
	mov	w6, #0
	bl	_ipz_queue_ctor
	cbz	w0, LBB0_18
; %bb.4:
	ldr	w8, [sp, #28]
	cmp	w8, #1
	b.lt	LBB0_19
; %bb.5:
	mov	w27, #0
	b	LBB0_9
LBB0_6:
	stp	x22, x19, [sp]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_15
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
Lloh13:
	adrp	x9, _H_PAGE_REGISTERED@GOTPAGE
Lloh14:
	ldr	x9, [x9, _H_PAGE_REGISTERED@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x26, x9
	b.ne	LBB0_21
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	w27, w27, #1
	cmp	w27, w8
	b.ge	LBB0_19
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	bl	_ipz_qpageit_get_inc
	cbz	x0, LBB0_21
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	bl	_virt_to_abs
	mov	x5, x0
	ldr	w0, [x21]
	ldr	w1, [x24]
	mov	x2, x23
	mov	w3, #0
	mov	w4, #0
	mov	w6, #1
	bl	_hipz_h_register_rpage_eq
	mov	x26, x0
	ldr	w8, [sp, #28]
	sub	w9, w8, #1
	cmp	w27, w9
	b.ne	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x0, x25
	bl	_ipz_qpageit_get_inc
Lloh16:
	adrp	x8, _H_SUCCESS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _H_SUCCESS@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	cmp	x26, x8
	ccmp	x0, #0, #0, eq
	b.ne	LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #28]
	b	LBB0_8
LBB0_13:
	str	x19, [sp]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_14:
	str	x19, [sp]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_15:
	mov	x0, x20
	bl	_ehca_err
LBB0_16:
Lloh23:
	adrp	x8, _EINVAL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_18:
	str	x19, [sp]
Lloh26:
	adrp	x1, l_.str.3@PAGE
Lloh27:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_ehca_err
	b	LBB0_22
LBB0_19:
	mov	x0, x25
	bl	_ipz_qeit_reset
	ldr	w8, [x28]
	cmp	w8, w22
	b.ne	LBB0_23
; %bb.20:
	add	x0, x19, #12
Lloh28:
	adrp	x8, _ehca_tasklet_eq@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ehca_tasklet_eq@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_tasklet_init
	ldr	w0, [x19, #8]
Lloh31:
	adrp	x8, _ehca_interrupt_eq@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ehca_interrupt_eq@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
Lloh34:
	adrp	x8, _IRQF_DISABLED@GOTPAGE
Lloh35:
	ldr	x8, [x8, _IRQF_DISABLED@GOTPAGEOFF]
Lloh36:
	ldr	w2, [x8]
Lloh37:
	adrp	x3, l_.str.4@PAGE
Lloh38:
	add	x3, x3, l_.str.4@PAGEOFF
	b	LBB0_25
LBB0_21:
	mov	x0, #0
	mov	x1, x25
	bl	_ipz_queue_dtor
LBB0_22:
	ldr	w0, [x21]
	mov	x1, x19
	bl	_hipz_h_destroy_eq
	b	LBB0_16
LBB0_23:
Lloh39:
	adrp	x8, _EHCA_NEQ@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EHCA_NEQ@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	cmp	w8, w22
	b.ne	LBB0_27
; %bb.24:
	add	x0, x19, #12
Lloh42:
	adrp	x8, _ehca_tasklet_neq@GOTPAGE
Lloh43:
	ldr	x8, [x8, _ehca_tasklet_neq@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_tasklet_init
	ldr	w0, [x19, #8]
Lloh45:
	adrp	x8, _ehca_interrupt_neq@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ehca_interrupt_neq@GOTPAGEOFF]
Lloh47:
	ldr	w1, [x8]
Lloh48:
	adrp	x8, _IRQF_DISABLED@GOTPAGE
Lloh49:
	ldr	x8, [x8, _IRQF_DISABLED@GOTPAGEOFF]
Lloh50:
	ldr	w2, [x8]
Lloh51:
	adrp	x3, l_.str.6@PAGE
Lloh52:
	add	x3, x3, l_.str.6@PAGEOFF
LBB0_25:
	mov	x4, x21
	bl	_ibmebus_request_irq
	tbz	w0, #31, LBB0_27
; %bb.26:
Lloh53:
	adrp	x1, l_.str.5@PAGE
Lloh54:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x20
	bl	_ehca_err
LBB0_27:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.comm	_EHCA_EQ,4,2                    ; @EHCA_EQ
	.comm	_EHCA_NEQ,4,2                   ; @EHCA_NEQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid EQ type %x. eq=%p"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"EQ length must not be zero. eq=%p"

	.comm	_H_SUCCESS,8,3                  ; @H_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"Can't allocate EQ/NEQ. eq=%p"

	.comm	_EHCA_PAGESIZE,4,2              ; @EHCA_PAGESIZE
l_.str.3:                               ; @.str.3
	.asciz	"Can't allocate EQ pages eq=%p"

	.comm	_H_PAGE_REGISTERED,8,3          ; @H_PAGE_REGISTERED
	.comm	_ehca_tasklet_eq,4,2            ; @ehca_tasklet_eq
	.comm	_ehca_interrupt_eq,4,2          ; @ehca_interrupt_eq
	.comm	_IRQF_DISABLED,4,2              ; @IRQF_DISABLED
l_.str.4:                               ; @.str.4
	.asciz	"ehca_eq"

l_.str.5:                               ; @.str.5
	.asciz	"Can't map interrupt handler."

	.comm	_ehca_tasklet_neq,4,2           ; @ehca_tasklet_neq
	.comm	_ehca_interrupt_neq,4,2         ; @ehca_interrupt_neq
l_.str.6:                               ; @.str.6
	.asciz	"ehca_neq"

.subsections_via_symbols
