	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_sc_init_iw_hmc           ## -- Begin function i40iw_sc_init_iw_hmc
	.p2align	4, 0x90
_i40iw_sc_init_iw_hmc:                  ## @i40iw_sc_init_iw_hmc
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_I40IW_MAX_VF_FPM_ID@GOTPCREL(%rip), %rax
	cmpl	%esi, (%rax)
	jle	LBB0_3
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movslq	4(%rdi), %r8
	cmpl	%esi, %r8d
	je	LBB0_6
## %bb.2:
	movq	_I40IW_FIRST_VF_FPM_ID@GOTPCREL(%rip), %rax
	cmpl	%ebx, (%rax)
	jle	LBB0_6
LBB0_3:
	movq	_I40IW_ERR_INVALID_HMCFN_ID@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
LBB0_5:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_I40IW_DEBUG_HMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movslq	%ebx, %rcx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_i40iw_debug
	movl	4(%r14), %r13d
	cmpl	%ebx, %r13d
	jne	LBB0_8
## %bb.7:
	movq	40(%r14), %rcx
	movl	32(%r14), %eax
	movl	%eax, -56(%rbp)
	movq	24(%r14), %rax
	movq	%rax, -64(%rbp)
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	%ebx, 16(%rcx)
	jmp	LBB0_15
LBB0_8:
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_i40iw_vfdev_from_fpm
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	%rax, %r12
	movq	%rax, %r8
	addq	$20, %r8
	movq	(%rax), %r15
	movq	_I40IW_DEBUG_HMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	32(%r12), %r9d
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movq	%r12, %rcx
	movq	%r8, -48(%rbp)                  ## 8-byte Spill
	xorl	%eax, %eax
	callq	_i40iw_debug
	movq	8(%r12), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	movl	16(%r12), %ecx
	jmp	LBB0_14
LBB0_11:
	movq	_I40IW_ERR_INVALID_VF_ID@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_12:
	movq	16(%r14), %rsi
	shlq	$4, %r15
	movq	8(%rsi,%r15), %rax
	testq	%rax, %rax
	je	LBB0_24
LBB0_13:
	movq	%rax, 8(%r12)
	movl	(%rsi,%r15), %ecx
	movl	%ecx, 16(%r12)
LBB0_14:
	movl	%ecx, -56(%rbp)
	movq	%rax, -64(%rbp)
	movl	4(%r14), %eax
	movl	%ebx, 36(%r12)
	cmpl	%ebx, %eax
	jne	LBB0_23
LBB0_15:
	cmpl	%ebx, %r13d
	jne	LBB0_17
## %bb.16:
	movq	_I40IW_CQP_WAIT_POLL_REGS@GOTPCREL(%rip), %rax
	jmp	LBB0_18
LBB0_17:
	movq	_I40IW_CQP_WAIT_POLL_CQ@GOTPCREL(%rip), %rax
LBB0_18:
	movl	(%rax), %r9d
	movl	12(%r14), %edi
	leaq	-64(%rbp), %rcx
	xorl	%esi, %esi
	movl	%ebx, %edx
	movl	$1, %r8d
	callq	_i40iw_sc_query_fpm_values
	testl	%eax, %eax
	jne	LBB0_5
LBB0_19:
	movq	-64(%rbp), %rdi
	leaq	8(%r14), %rdx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_i40iw_sc_parse_fpm_query_buf
	testl	%eax, %eax
	jne	LBB0_5
## %bb.20:
	movq	_I40IW_DEBUG_HMC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rcx
	movq	_I40IW_QUERY_FPM_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	leaq	L_.str.2(%rip), %rdx
	movq	%r14, %rdi
	callq	_i40iw_debug_buf
	xorl	%eax, %eax
	cmpl	%ebx, 4(%r14)
	je	LBB0_5
## %bb.21:
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_i40iw_cqp_commit_fpm_values_cmd
	movq	-64(%rbp), %rdi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	12(%rbx), %esi
	leaq	4(%rbx), %rdx
	callq	_i40iw_sc_parse_fpm_commit_buf
	movl	(%rbx), %edx
	addl	4(%rbx), %edx
	shll	$2, %edx
	movl	(%r14), %edi
	leaq	-72(%rbp), %rsi
	callq	_i40iw_allocate_virt_mem
	testl	%eax, %eax
	jne	LBB0_5
## %bb.22:
	movl	-72(%rbp), %eax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 8(%rcx)
	xorl	%eax, %eax
	jmp	LBB0_5
LBB0_23:
	leaq	-64(%rbp), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_i40iw_cqp_query_fpm_values_cmd
	testl	%eax, %eax
	jne	LBB0_5
	jmp	LBB0_19
LBB0_24:
	addq	%r15, %rsi
	movq	%r14, %rdi
	callq	_i40iw_alloc_query_fpm_buf
	testl	%eax, %eax
	jne	LBB0_5
## %bb.25:
	movq	16(%r14), %rsi
	movq	8(%rsi,%r15), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_I40IW_MAX_VF_FPM_ID,4,2        ## @I40IW_MAX_VF_FPM_ID
	.comm	_I40IW_FIRST_VF_FPM_ID,4,2      ## @I40IW_FIRST_VF_FPM_ID
	.comm	_I40IW_ERR_INVALID_HMCFN_ID,4,2 ## @I40IW_ERR_INVALID_HMCFN_ID
	.comm	_I40IW_DEBUG_HMC,4,2            ## @I40IW_DEBUG_HMC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hmc_fn_id %u, dev->hmc_fn_id %u\n"

	.comm	_I40IW_ERR_INVALID_VF_ID,4,2    ## @I40IW_ERR_INVALID_VF_ID
L_.str.1:                               ## @.str.1
	.asciz	"vf_dev %p, hmc_info %p, hmc_obj %p\n"

	.comm	_I40IW_CQP_WAIT_POLL_REGS,8,3   ## @I40IW_CQP_WAIT_POLL_REGS
	.comm	_I40IW_CQP_WAIT_POLL_CQ,8,3     ## @I40IW_CQP_WAIT_POLL_CQ
L_.str.2:                               ## @.str.2
	.asciz	"QUERY FPM BUFFER"

	.comm	_I40IW_QUERY_FPM_BUF_SIZE,4,2   ## @I40IW_QUERY_FPM_BUF_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i40iw_sc_init_iw_hmc           ; -- Begin function i40iw_sc_init_iw_hmc
	.p2align	2
_i40iw_sc_init_iw_hmc:                  ; @i40iw_sc_init_iw_hmc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
Lloh0:
	adrp	x8, _I40IW_MAX_VF_FPM_ID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I40IW_MAX_VF_FPM_ID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w1
	b.le	LBB0_4
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	ldrsw	x4, [x0, #4]
Lloh3:
	adrp	x8, _I40IW_FIRST_VF_FPM_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I40IW_FIRST_VF_FPM_ID@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w4, w1
	ccmp	w8, w1, #4, ne
	b.gt	LBB0_4
; %bb.2:
Lloh6:
	adrp	x23, _I40IW_DEBUG_HMC@GOTPAGE
Lloh7:
	ldr	x23, [x23, _I40IW_DEBUG_HMC@GOTPAGEOFF]
	ldr	w1, [x23]
	sxtw	x3, w20
Lloh8:
	adrp	x2, l_.str@PAGE
Lloh9:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_i40iw_debug
	ldr	w24, [x19, #4]
	cmp	w24, w20
	b.ne	LBB0_7
; %bb.3:
	ldr	x21, [x19, #40]
	ldr	w8, [x19, #32]
	str	w8, [sp, #24]
	ldr	x8, [x19, #24]
	str	x8, [sp, #16]
	str	w20, [x21, #16]
	b	LBB0_14
LBB0_4:
Lloh10:
	adrp	x8, _I40IW_ERR_INVALID_HMCFN_ID@GOTPAGE
Lloh11:
	ldr	x8, [x8, _I40IW_ERR_INVALID_HMCFN_ID@GOTPAGEOFF]
LBB0_5:
	ldr	w0, [x8]
LBB0_6:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	mov	x0, x19
	mov	x1, x20
	bl	_i40iw_vfdev_from_fpm
	cbz	x0, LBB0_10
; %bb.8:
	mov	x22, x0
	add	x21, x0, #20
	ldr	x25, [x0]
	ldr	w1, [x23]
	ldr	w8, [x0, #32]
Lloh12:
	adrp	x2, l_.str.1@PAGE
Lloh13:
	add	x2, x2, l_.str.1@PAGEOFF
	str	x8, [sp]
	mov	x0, x19
	mov	x3, x22
	mov	x4, x21
	bl	_i40iw_debug
	ldr	x8, [x22, #8]
	cbz	x8, LBB0_11
; %bb.9:
	ldr	w9, [x22, #16]
	b	LBB0_13
LBB0_10:
Lloh14:
	adrp	x8, _I40IW_ERR_INVALID_VF_ID@GOTPAGE
Lloh15:
	ldr	x8, [x8, _I40IW_ERR_INVALID_VF_ID@GOTPAGEOFF]
	b	LBB0_5
LBB0_11:
	ldr	x9, [x19, #16]
	add	x1, x9, x25, lsl #4
	ldr	x8, [x1, #8]
	cbz	x8, LBB0_21
LBB0_12:
	str	x8, [x22, #8]
	lsl	x10, x25, #4
	ldr	w9, [x9, x10]
	str	w9, [x22, #16]
LBB0_13:
	str	w9, [sp, #24]
	str	x8, [sp, #16]
	ldr	w8, [x19, #4]
	str	w20, [x22, #36]
	cmp	w8, w20
	b.ne	LBB0_18
LBB0_14:
Lloh16:
	adrp	x8, _I40IW_CQP_WAIT_POLL_REGS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _I40IW_CQP_WAIT_POLL_REGS@GOTPAGEOFF]
Lloh18:
	adrp	x9, _I40IW_CQP_WAIT_POLL_CQ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _I40IW_CQP_WAIT_POLL_CQ@GOTPAGEOFF]
	cmp	w24, w20
	csel	x8, x8, x9, eq
	ldr	w5, [x8]
	ldr	w0, [x19, #12]
	add	x3, sp, #16
	mov	w1, #0
	mov	x2, x20
	mov	w4, #1
	bl	_i40iw_sc_query_fpm_values
	cbnz	w0, LBB0_6
LBB0_15:
	ldr	x0, [sp, #16]
	add	x2, x19, #8
	mov	x1, x21
	bl	_i40iw_sc_parse_fpm_query_buf
	cbnz	w0, LBB0_6
; %bb.16:
	ldr	w1, [x23]
	ldr	x3, [sp, #16]
Lloh20:
	adrp	x8, _I40IW_QUERY_FPM_BUF_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _I40IW_QUERY_FPM_BUF_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	w4, [x8]
Lloh23:
	adrp	x2, l_.str.2@PAGE
Lloh24:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	x0, x19
	bl	_i40iw_debug_buf
	ldr	w8, [x19, #4]
	cmp	w8, w20
	b.ne	LBB0_19
; %bb.17:
	mov	w0, #0
	b	LBB0_6
LBB0_18:
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, x20
	bl	_i40iw_cqp_query_fpm_values_cmd
	cbnz	w0, LBB0_6
	b	LBB0_15
LBB0_19:
	add	x1, sp, #16
	mov	x0, x19
	mov	x2, x20
	bl	_i40iw_cqp_commit_fpm_values_cmd
	ldr	x0, [sp, #16]
	ldr	w1, [x21, #12]
	add	x2, x21, #4
	bl	_i40iw_sc_parse_fpm_commit_buf
	ldp	w9, w8, [x21]
	add	w8, w9, w8
	lsl	w2, w8, #2
	ldr	w0, [x19]
	add	x1, sp, #8
	bl	_i40iw_allocate_virt_mem
	cbnz	w0, LBB0_6
; %bb.20:
	ldr	w8, [sp, #8]
	str	w8, [x21, #8]
	b	LBB0_6
LBB0_21:
	mov	x0, x19
	bl	_i40iw_alloc_query_fpm_buf
	cbnz	w0, LBB0_6
; %bb.22:
	ldr	x9, [x19, #16]
	add	x8, x9, x25, lsl #4
	ldr	x8, [x8, #8]
	b	LBB0_12
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_I40IW_MAX_VF_FPM_ID,4,2        ; @I40IW_MAX_VF_FPM_ID
	.comm	_I40IW_FIRST_VF_FPM_ID,4,2      ; @I40IW_FIRST_VF_FPM_ID
	.comm	_I40IW_ERR_INVALID_HMCFN_ID,4,2 ; @I40IW_ERR_INVALID_HMCFN_ID
	.comm	_I40IW_DEBUG_HMC,4,2            ; @I40IW_DEBUG_HMC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hmc_fn_id %u, dev->hmc_fn_id %u\n"

	.comm	_I40IW_ERR_INVALID_VF_ID,4,2    ; @I40IW_ERR_INVALID_VF_ID
l_.str.1:                               ; @.str.1
	.asciz	"vf_dev %p, hmc_info %p, hmc_obj %p\n"

	.comm	_I40IW_CQP_WAIT_POLL_REGS,8,3   ; @I40IW_CQP_WAIT_POLL_REGS
	.comm	_I40IW_CQP_WAIT_POLL_CQ,8,3     ; @I40IW_CQP_WAIT_POLL_CQ
l_.str.2:                               ; @.str.2
	.asciz	"QUERY FPM BUFFER"

	.comm	_I40IW_QUERY_FPM_BUF_SIZE,4,2   ; @I40IW_QUERY_FPM_BUF_SIZE
.subsections_via_symbols
