	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sdma_set_state
_sdma_set_state:                        ## @sdma_set_state
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_sdma_action_table@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_sdma_state_names@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rdi), %rcx
	movl	(%rax,%rcx,4), %esi
	movl	%r14d, %r12d
	movl	(%rax,%r12,4), %edx
	callq	_trace_hfi1_sdma_state
	movq	(%rbx), %rax
	movq	%rax, 8(%rbx)
	movl	20(%rbx), %ecx
	movl	%ecx, 16(%rbx)
	movq	%r12, (%rbx)
	movq	_sdma_state_s99_running@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	cmpl	%r14d, %ecx
	jne	LBB0_3
## %bb.1:
	cmpq	%rcx, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_sdma_flush
LBB0_3:
	leaq	(%r12,%r12,2), %rdi
	shlq	$4, %rdi
	movq	40(%r15,%rdi), %r11
	movq	_SDMA_SENDCTRL_OP_ENABLE@GOTPCREL(%rip), %rax
	movq	32(%r15,%rdi), %r10
	movq	_SDMA_SENDCTRL_OP_INTENABLE@GOTPCREL(%rip), %rcx
	movq	16(%r15,%rdi), %r8
	movq	24(%r15,%rdi), %r9
	movq	_SDMA_SENDCTRL_OP_HALT@GOTPCREL(%rip), %rsi
	movq	_SDMA_SENDCTRL_OP_CLEANUP@GOTPCREL(%rip), %r14
	cmpq	$0, 8(%r15,%rdi)
	je	LBB0_5
## %bb.4:
	movl	$0, 24(%rbx)
LBB0_5:
	movl	(%rax), %eax
	movl	(%rcx), %edx
	movl	(%rsi), %ecx
	movl	(%r14), %esi
	cmpq	$0, (%r15,%rdi)
	je	LBB0_7
## %bb.6:
	movl	$1, 24(%rbx)
LBB0_7:
	xorl	%edi, %edi
	testq	%r11, %r11
	cmovel	%edi, %eax
	testq	%r10, %r10
	cmovel	%edi, %edx
	orl	%eax, %edx
	testq	%r9, %r9
	cmovel	%edi, %ecx
	testq	%r8, %r8
	cmovel	%edi, %esi
	orl	%ecx, %esi
	orl	%edx, %esi
	movl	%esi, 20(%rbx)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_sdma_sendctrl                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_sdma_action_table,8,3          ## @sdma_action_table
	.comm	_sdma_state_names,8,3           ## @sdma_state_names
	.comm	_sdma_state_s99_running,4,2     ## @sdma_state_s99_running
	.comm	_SDMA_SENDCTRL_OP_ENABLE,4,2    ## @SDMA_SENDCTRL_OP_ENABLE
	.comm	_SDMA_SENDCTRL_OP_INTENABLE,4,2 ## @SDMA_SENDCTRL_OP_INTENABLE
	.comm	_SDMA_SENDCTRL_OP_HALT,4,2      ## @SDMA_SENDCTRL_OP_HALT
	.comm	_SDMA_SENDCTRL_OP_CLEANUP,4,2   ## @SDMA_SENDCTRL_OP_CLEANUP
	.no_dead_strip	_sdma_set_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sdma_set_state
_sdma_set_state:                        ; @sdma_set_state
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _sdma_action_table@GOTPAGE
Lloh1:
	ldr	x8, [x8, _sdma_action_table@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
Lloh3:
	adrp	x8, _sdma_state_names@GOTPAGE
Lloh4:
	ldr	x8, [x8, _sdma_state_names@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	x9, [x0]
	ldr	w1, [x8, x9, lsl #2]
	mov	w22, w20
	ldr	w2, [x8, w20, uxtw #2]
	bl	_trace_hfi1_sdma_state
	ldr	x8, [x19]
	ldr	w9, [x19, #20]
	str	w9, [x19, #16]
	stp	x22, x8, [x19]
Lloh6:
	adrp	x9, _sdma_state_s99_running@GOTPAGE
Lloh7:
	ldr	x9, [x9, _sdma_state_s99_running@GOTPAGEOFF]
Lloh8:
	ldrsw	x9, [x9]
	cmp	w9, w20
	ccmp	x8, x9, #4, eq
	b.eq	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_sdma_flush
LBB0_2:
	mov	w8, #48
	madd	x14, x22, x8, x21
	ldp	x11, x10, [x14, #32]
Lloh9:
	adrp	x12, _SDMA_SENDCTRL_OP_ENABLE@GOTPAGE
Lloh10:
	ldr	x12, [x12, _SDMA_SENDCTRL_OP_ENABLE@GOTPAGEOFF]
Lloh11:
	adrp	x13, _SDMA_SENDCTRL_OP_INTENABLE@GOTPAGE
Lloh12:
	ldr	x13, [x13, _SDMA_SENDCTRL_OP_INTENABLE@GOTPAGEOFF]
	ldp	x9, x8, [x14, #16]
Lloh13:
	adrp	x16, _SDMA_SENDCTRL_OP_HALT@GOTPAGE
Lloh14:
	ldr	x16, [x16, _SDMA_SENDCTRL_OP_HALT@GOTPAGEOFF]
Lloh15:
	adrp	x17, _SDMA_SENDCTRL_OP_CLEANUP@GOTPAGE
Lloh16:
	ldr	x17, [x17, _SDMA_SENDCTRL_OP_CLEANUP@GOTPAGEOFF]
	ldr	x14, [x14, #8]
	cbz	x14, LBB0_4
; %bb.3:
	str	wzr, [x19, #24]
LBB0_4:
	ldr	w15, [x12]
	ldr	w14, [x13]
	ldr	w13, [x16]
	ldr	w12, [x17]
	mov	w16, #48
	mul	x16, x22, x16
	ldr	x16, [x21, x16]
	cbz	x16, LBB0_6
; %bb.5:
	mov	w16, #1
	str	w16, [x19, #24]
LBB0_6:
	cmp	x10, #0
	csel	w10, wzr, w15, eq
	cmp	x11, #0
	csel	w11, wzr, w14, eq
	orr	w10, w11, w10
	cmp	x8, #0
	csel	w8, wzr, w13, eq
	orr	w8, w10, w8
	cmp	x9, #0
	csel	w9, wzr, w12, eq
	orr	w1, w8, w9
	str	w1, [x19, #20]
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_sdma_sendctrl
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_sdma_action_table,8,3          ; @sdma_action_table
	.comm	_sdma_state_names,8,3           ; @sdma_state_names
	.comm	_sdma_state_s99_running,4,2     ; @sdma_state_s99_running
	.comm	_SDMA_SENDCTRL_OP_ENABLE,4,2    ; @SDMA_SENDCTRL_OP_ENABLE
	.comm	_SDMA_SENDCTRL_OP_INTENABLE,4,2 ; @SDMA_SENDCTRL_OP_INTENABLE
	.comm	_SDMA_SENDCTRL_OP_HALT,4,2      ; @SDMA_SENDCTRL_OP_HALT
	.comm	_SDMA_SENDCTRL_OP_CLEANUP,4,2   ; @SDMA_SENDCTRL_OP_CLEANUP
	.no_dead_strip	_sdma_set_state
.subsections_via_symbols
