	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cmdq_sync_cmd_direct_resp
_cmdq_sync_cmd_direct_resp:             ## @cmdq_sync_cmd_direct_resp
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -80(%rbp)                  ## 8-byte Spill
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
                                        ## kill: def $esi killed $esi def $rsi
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	32(%rdi), %r13
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_spin_lock_bh
	movq	_WQE_LCMD_SIZE@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_hinic_get_wqe
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_spin_unlock_bh
	movq	_EBUSY@GOTPCREL(%rip), %rax
LBB0_14:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -64(%rbp)                 ## 8-byte Spill
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movl	(%rbx), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%r12), %edi
	movl	(%r13), %esi
	callq	_ALIGN
	cltd
	idivl	(%r13)
	movl	%eax, %r14d
	movslq	-44(%rbp), %rax
	addl	%eax, %r14d
	movl	%r14d, %ecx
	subl	4(%r13), %ecx
	jl	LBB0_4
## %bb.3:
	xorl	%edx, %edx
	cmpl	$0, (%rbx)
	sete	%dl
	movl	%edx, (%rbx)
	movl	%ecx, %r14d
LBB0_4:
	movq	8(%rbx), %rcx
	leaq	-48(%rbp), %rdx
	movq	%rdx, (%rcx,%rax,8)
	leaq	-112(%rbp), %r12
	movq	%r12, %rdi
	callq	_init_completion
	movq	24(%rbx), %rax
	movslq	-44(%rbp), %r10
	movq	%r12, (%rax,%r10,8)
	movq	_CMDQ_CMD_SYNC_DIRECT_RESP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_HINIC_CMD_ACK_TYPE_CMDQ@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	subq	$8, %rsp
	leaq	-120(%rbp), %r13
	movq	%r13, %rdi
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	xorl	%ecx, %ecx
	movl	-52(%rbp), %r8d                 ## 4-byte Reload
	pushq	%r10
	pushq	-104(%rbp)                      ## 8-byte Folded Reload
	pushq	%r15
	movq	%r12, %r15
	callq	_cmdq_set_lcmd_wqe
	addq	$32, %rsp
	movq	_WQE_LCMD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_hinic_cpu_to_be32
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_cmdq_wqe_fill
	movq	_HINIC_CMDQ_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_cmdq_set_db
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_unlock_bh
	movq	_CMDQ_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	je	LBB0_5
## %bb.10:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_smp_rmb
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	je	LBB0_12
## %bb.11:
	movl	(%r12), %edi
	callq	_cpu_to_be64
	movl	%eax, (%r14)
LBB0_12:
	cmpl	$0, -48(%rbp)
	je	LBB0_15
## %bb.13:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_5:
	movq	%r14, %rdi
	callq	_spin_lock_bh
	movq	8(%rbx), %rcx
	movslq	-44(%rbp), %rax
	leaq	-48(%rbp), %rdx
	cmpq	%rdx, (%rcx,%rax,8)
	jne	LBB0_7
## %bb.6:
	movq	$0, (%rcx,%rax,8)
LBB0_7:
	movq	24(%rbx), %rcx
	cmpq	%r15, (%rcx,%rax,8)
	jne	LBB0_9
## %bb.8:
	movq	$0, (%rcx,%rax,8)
LBB0_9:
	movq	%r14, %rdi
	callq	_spin_unlock_bh
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_WQE_LCMD_SIZE,4,2              ## @WQE_LCMD_SIZE
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_CMDQ_CMD_SYNC_DIRECT_RESP,4,2  ## @CMDQ_CMD_SYNC_DIRECT_RESP
	.comm	_HINIC_CMD_ACK_TYPE_CMDQ,4,2    ## @HINIC_CMD_ACK_TYPE_CMDQ
	.comm	_HINIC_CMDQ_SYNC,4,2            ## @HINIC_CMDQ_SYNC
	.comm	_CMDQ_TIMEOUT,4,2               ## @CMDQ_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_cmdq_sync_cmd_direct_resp
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cmdq_sync_cmd_direct_resp
_cmdq_sync_cmd_direct_resp:             ; @cmdq_sync_cmd_direct_resp
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x21, x4
	mov	x25, x3
	mov	x23, x2
	mov	x24, x1
	mov	x20, x0
	ldr	x27, [x0, #32]
	add	x19, x0, #16
	mov	x0, x19
	bl	_spin_lock_bh
Lloh0:
	adrp	x28, _WQE_LCMD_SIZE@GOTPAGE
Lloh1:
	ldr	x28, [x28, _WQE_LCMD_SIZE@GOTPAGEOFF]
	ldr	w1, [x28]
	add	x2, sp, #36
	mov	x0, x27
	bl	_hinic_get_wqe
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.1:
	mov	x0, x19
	bl	_spin_unlock_bh
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_4:
	str	x21, [sp, #16]                  ; 8-byte Folded Spill
	ldr	w26, [x20]
	ldr	w0, [x28]
	ldr	w1, [x27]
	bl	_ALIGN
	ldp	w8, w9, [x27]
	sdiv	w10, w0, w8
	ldrsw	x8, [sp, #36]
	add	w27, w8, w10
	subs	w9, w27, w9
	b.lt	LBB0_6
; %bb.5:
	ldr	w10, [x20]
	cmp	w10, #0
	cset	w10, eq
	str	w10, [x20]
	mov	x27, x9
LBB0_6:
	ldr	x9, [x20, #8]
	add	x10, sp, #32
	str	x10, [x9, x8, lsl #3]
	add	x21, sp, #24
	add	x0, sp, #24
	bl	_init_completion
	ldr	x8, [x20, #24]
	ldrsw	x9, [sp, #36]
	str	x21, [x8, x9, lsl #3]
Lloh4:
	adrp	x8, _CMDQ_CMD_SYNC_DIRECT_RESP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _CMDQ_CMD_SYNC_DIRECT_RESP@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
Lloh7:
	adrp	x8, _HINIC_CMD_ACK_TYPE_CMDQ@GOTPAGE
Lloh8:
	ldr	x8, [x8, _HINIC_CMD_ACK_TYPE_CMDQ@GOTPAGEOFF]
Lloh9:
	ldr	w5, [x8]
	str	w9, [sp]
	add	x0, sp, #40
	mov	x2, x25
	mov	x3, #0
	mov	x4, x26
	mov	x6, x24
	mov	x7, x23
	bl	_cmdq_set_lcmd_wqe
	ldr	w1, [x28]
	add	x0, sp, #40
	bl	_hinic_cpu_to_be32
	add	x1, sp, #40
	mov	x0, x22
	bl	_cmdq_wqe_fill
Lloh10:
	adrp	x8, _HINIC_CMDQ_SYNC@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HINIC_CMDQ_SYNC@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x27
	bl	_cmdq_set_db
	mov	x0, x19
	bl	_spin_unlock_bh
Lloh13:
	adrp	x8, _CMDQ_TIMEOUT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CMDQ_TIMEOUT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	add	x0, sp, #24
	bl	_wait_for_completion_timeout
	cbz	w0, LBB0_11
; %bb.7:
	bl	_smp_rmb
	ldr	x19, [sp, #16]                  ; 8-byte Folded Reload
	cbz	x19, LBB0_9
; %bb.8:
	ldr	w0, [x22]
	bl	_cpu_to_be64
	str	w0, [x19]
LBB0_9:
	ldr	w8, [sp, #32]
	cbz	w8, LBB0_16
; %bb.10:
Lloh16:
	adrp	x8, _EFAULT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
	b	LBB0_2
LBB0_11:
	mov	x0, x19
	bl	_spin_lock_bh
	ldr	x9, [x20, #8]
	ldrsw	x8, [sp, #36]
	ldr	x10, [x9, x8, lsl #3]
	add	x11, sp, #32
	cmp	x10, x11
	b.ne	LBB0_13
; %bb.12:
	str	xzr, [x9, x8, lsl #3]
LBB0_13:
	ldr	x9, [x20, #24]
	ldr	x10, [x9, x8, lsl #3]
	add	x11, sp, #24
	cmp	x10, x11
	b.ne	LBB0_15
; %bb.14:
	str	xzr, [x9, x8, lsl #3]
LBB0_15:
	mov	x0, x19
	bl	_spin_unlock_bh
Lloh18:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
	b	LBB0_2
LBB0_16:
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_WQE_LCMD_SIZE,4,2              ; @WQE_LCMD_SIZE
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_CMDQ_CMD_SYNC_DIRECT_RESP,4,2  ; @CMDQ_CMD_SYNC_DIRECT_RESP
	.comm	_HINIC_CMD_ACK_TYPE_CMDQ,4,2    ; @HINIC_CMD_ACK_TYPE_CMDQ
	.comm	_HINIC_CMDQ_SYNC,4,2            ; @HINIC_CMDQ_SYNC
	.comm	_CMDQ_TIMEOUT,4,2               ; @CMDQ_TIMEOUT
	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_cmdq_sync_cmd_direct_resp
.subsections_via_symbols
