	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_define_sqp                ## -- Begin function ehca_define_sqp
	.p2align	4, 0x90
_ehca_define_sqp:                       ## @ehca_define_sqp
	.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
	movq	%rdi, %r12
	movslq	(%rdx), %r14
	movq	_IB_PORT_DOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rdi), %rcx
	movq	%r14, %r13
	decq	%r13
	shlq	$4, %r13
	movq	%rax, (%rcx,%r13)
	movl	4(%rdx), %edx
	cmpl	$128, %edx
	je	LBB0_6
## %bb.1:
	cmpl	$129, %edx
	jne	LBB0_4
## %bb.2:
	movl	16(%r12), %edi
	movl	(%rsi), %edx
	movl	4(%rsi), %esi
	leaq	-44(%rbp), %r8
	leaq	-48(%rbp), %r9
	movl	%r14d, %ecx
	callq	_hipz_h_define_aqp1
	movl	%eax, %r15d
	movq	_H_SUCCESS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	jne	LBB0_3
## %bb.5:
	movl	-44(%rbp), %eax
	movq	8(%r12), %rcx
	movl	%eax, 8(%rcx,%r13)
	movl	-44(%rbp), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_ehca_dbg
LBB0_6:
	movq	_ehca_nr_ports@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	js	LBB0_14
## %bb.7:
	movq	8(%r12), %rax
	movq	(%rax,%r13), %rcx
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rdx
	xorl	%ebx, %ebx
	movq	_ehca_port_act_time@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpq	(%rdx), %rcx
	je	LBB0_12
## %bb.8:
	testl	%eax, %eax
	jle	LBB0_12
## %bb.9:
	leaq	L_.str.3(%rip), %r15
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_ehca_dbg
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msleep_interruptible
	incl	%ebx
	movq	8(%r12), %rax
	movq	(%rax,%r13), %rcx
	movq	_ehca_port_act_time@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_IB_PORT_ACTIVE@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	%eax, %ebx
	jl	LBB0_10
LBB0_12:
	cmpl	%eax, %ebx
	jne	LBB0_14
## %bb.13:
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_ehca_err
	movq	_H_HARDWARE@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_4:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_ehca_err
	movq	_H_PARAMETER@GOTPCREL(%rip), %rax
	jmp	LBB0_15
LBB0_14:
	movq	_H_SUCCESS@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %r15d
LBB0_16:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_ehca_err
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_IB_PORT_DOWN,8,3               ## @IB_PORT_DOWN
	.comm	_H_SUCCESS,4,2                  ## @H_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't define AQP1 for port %x. h_ret=%lli"

L_.str.1:                               ## @.str.1
	.asciz	"port=%x pma_qp_nr=%x"

L_.str.2:                               ## @.str.2
	.asciz	"invalid qp_type=%x"

	.comm	_H_PARAMETER,4,2                ## @H_PARAMETER
	.comm	_ehca_nr_ports,8,3              ## @ehca_nr_ports
	.comm	_IB_PORT_ACTIVE,8,3             ## @IB_PORT_ACTIVE
	.comm	_ehca_port_act_time,4,2         ## @ehca_port_act_time
L_.str.3:                               ## @.str.3
	.asciz	"... wait until port %x is active"

L_.str.4:                               ## @.str.4
	.asciz	"Port %x is not active."

	.comm	_H_HARDWARE,4,2                 ## @H_HARDWARE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ehca_define_sqp                ; -- Begin function ehca_define_sqp
	.p2align	2
_ehca_define_sqp:                       ; @ehca_define_sqp
	.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	x19, x0
Lloh0:
	adrp	x8, _IB_PORT_DOWN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IB_PORT_DOWN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldr	x9, [x0, #8]
	ldp	w20, w2, [x2]
	sub	w10, w20, #1
	sxtw	x22, w10
	sbfiz	x10, x10, #4, #32
	str	x8, [x9, x10]
	cmp	w2, #128
	b.eq	LBB0_4
; %bb.1:
	cmp	w2, #129
	b.ne	LBB0_10
; %bb.2:
	ldr	w0, [x19, #16]
	ldp	w2, w8, [x1]
	add	x4, sp, #12
	add	x5, sp, #8
	mov	x1, x8
	mov	x3, x20
	bl	_hipz_h_define_aqp1
Lloh3:
	adrp	x8, _H_SUCCESS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _H_SUCCESS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_14
; %bb.3:
	ldr	w8, [sp, #12]
	ldr	x9, [x19, #8]
	add	x9, x9, x22, lsl #4
	str	w8, [x9, #8]
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_ehca_dbg
LBB0_4:
Lloh8:
	adrp	x8, _ehca_nr_ports@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ehca_nr_ports@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	tbnz	x8, #63, LBB0_11
; %bb.5:
	ldr	x8, [x19, #8]
	lsl	x23, x22, #4
	ldr	x9, [x8, x23]
Lloh11:
	adrp	x24, _IB_PORT_ACTIVE@GOTPAGE
Lloh12:
	ldr	x24, [x24, _IB_PORT_ACTIVE@GOTPAGEOFF]
	ldr	x10, [x24]
Lloh13:
	adrp	x25, _ehca_port_act_time@GOTPAGE
Lloh14:
	ldr	x25, [x25, _ehca_port_act_time@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	x9, x10
	mov	w22, #0
	ccmp	w8, #1, #8, ne
	b.lt	LBB0_8
; %bb.6:
Lloh15:
	adrp	x21, l_.str.3@PAGE
Lloh16:
	add	x21, x21, l_.str.3@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_ehca_dbg
	mov	w0, #1000
	bl	_msleep_interruptible
	add	w22, w22, #1
	ldr	x8, [x19, #8]
	ldr	x9, [x8, x23]
	ldr	x10, [x24]
	ldr	w8, [x25]
	cmp	x9, x10
	ccmp	w22, w8, #0, ne
	b.lt	LBB0_7
LBB0_8:
	cmp	w22, w8
	b.ne	LBB0_11
; %bb.9:
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_ehca_err
Lloh19:
	adrp	x8, _H_HARDWARE@GOTPAGE
Lloh20:
	ldr	x8, [x8, _H_HARDWARE@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_ehca_err
Lloh23:
	adrp	x8, _H_PARAMETER@GOTPAGE
Lloh24:
	ldr	x8, [x8, _H_PARAMETER@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh25:
	adrp	x8, _H_SUCCESS@GOTPAGE
Lloh26:
	ldr	x8, [x8, _H_SUCCESS@GOTPAGEOFF]
LBB0_12:
	ldr	w21, [x8]
LBB0_13:
	mov	x0, x21
	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_14:
	mov	x21, x0
	str	x21, [sp]
Lloh27:
	adrp	x1, l_.str@PAGE
Lloh28:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_ehca_err
	b	LBB0_13
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_IB_PORT_DOWN,8,3               ; @IB_PORT_DOWN
	.comm	_H_SUCCESS,4,2                  ; @H_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't define AQP1 for port %x. h_ret=%lli"

l_.str.1:                               ; @.str.1
	.asciz	"port=%x pma_qp_nr=%x"

l_.str.2:                               ; @.str.2
	.asciz	"invalid qp_type=%x"

	.comm	_H_PARAMETER,4,2                ; @H_PARAMETER
	.comm	_ehca_nr_ports,8,3              ; @ehca_nr_ports
	.comm	_IB_PORT_ACTIVE,8,3             ; @IB_PORT_ACTIVE
	.comm	_ehca_port_act_time,4,2         ; @ehca_port_act_time
l_.str.3:                               ; @.str.3
	.asciz	"... wait until port %x is active"

l_.str.4:                               ; @.str.4
	.asciz	"Port %x is not active."

	.comm	_H_HARDWARE,4,2                 ; @H_HARDWARE
.subsections_via_symbols
