	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tmc_etr_setup_caps
_tmc_etr_setup_caps:                    ## @tmc_etr_setup_caps
	.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
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r14
	callq	_dev_get_drvdata
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_tmc_etr_has_non_secure_access
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	_tmc_etr_init_caps
	movq	_TMC_DEVID_NOSCAT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	jne	LBB0_5
## %bb.3:
	movq	%r14, %rdi
	callq	_tmc_etr_can_use_sg
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_TMC_ETR_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_tmc_etr_set_cap
LBB0_5:
	movq	_TMC_DEVID_AXIAW_VALID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%ebx, %eax
	movq	_TMC_DEVID_AXIAW_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %ebx
	movq	_TMC_DEVID_AXIAW_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %ebx
	testl	%eax, %eax
	cmovel	%eax, %ebx
	leal	-32(%rbx), %eax
	roll	$30, %eax
	leal	-2(%rax), %ecx
	cmpl	$4, %ecx
	jae	LBB0_6
LBB0_7:
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_dev_info
	movl	%ebx, %edi
LBB0_8:
	callq	_DMA_BIT_MASK
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_dma_set_mask_and_coherent
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_dev_err
	jmp	LBB0_11
LBB0_1:
	movq	_EACCES@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_9:
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	$40, %edi
	testl	%eax, %eax
	je	LBB0_7
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_TMC_DEVID_NOSCAT,4,2           ## @TMC_DEVID_NOSCAT
	.comm	_TMC_ETR_SG,4,2                 ## @TMC_ETR_SG
	.comm	_TMC_DEVID_AXIAW_VALID,4,2      ## @TMC_DEVID_AXIAW_VALID
	.comm	_TMC_DEVID_AXIAW_SHIFT,4,2      ## @TMC_DEVID_AXIAW_SHIFT
	.comm	_TMC_DEVID_AXIAW_MASK,4,2       ## @TMC_DEVID_AXIAW_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Detected dma mask %dbits\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to setup DMA mask: %d\n"

	.no_dead_strip	_tmc_etr_setup_caps
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tmc_etr_setup_caps
_tmc_etr_setup_caps:                    ; @tmc_etr_setup_caps
	.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	x22, x2
	mov	x20, x1
	mov	x19, x0
	bl	_dev_get_drvdata
	mov	x21, x0
	bl	_tmc_etr_has_non_secure_access
	cbz	w0, LBB0_8
; %bb.1:
	mov	x0, x21
	mov	x1, x22
	bl	_tmc_etr_init_caps
Lloh0:
	adrp	x8, _TMC_DEVID_NOSCAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TMC_DEVID_NOSCAT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w8, w20
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_tmc_etr_can_use_sg
	cbz	x0, LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _TMC_ETR_SG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TMC_ETR_SG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_tmc_etr_set_cap
LBB0_4:
Lloh6:
	adrp	x8, _TMC_DEVID_AXIAW_VALID@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TMC_DEVID_AXIAW_VALID@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _TMC_DEVID_AXIAW_SHIFT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _TMC_DEVID_AXIAW_SHIFT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	asr	w9, w20, w9
Lloh12:
	adrp	x10, _TMC_DEVID_AXIAW_MASK@GOTPAGE
Lloh13:
	ldr	x10, [x10, _TMC_DEVID_AXIAW_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	and	w9, w9, w10
	tst	w8, w20
	csel	w20, wzr, w9, eq
	sub	w8, w20, #32
	ror	w8, w8, #2
	sub	w9, w8, #2
	cmp	w9, #4
	ccmp	w8, #0, #4, hs
	b.ne	LBB0_10
; %bb.5:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_info
LBB0_6:
	mov	x0, x20
	bl	_DMA_BIT_MASK
	mov	x1, x0
	mov	x0, x19
	bl	_dma_set_mask_and_coherent
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.7:
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_dev_err
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x8, _EACCES@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	mov	x0, x20
	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
	ret
LBB0_10:
	mov	w20, #40
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_TMC_DEVID_NOSCAT,4,2           ; @TMC_DEVID_NOSCAT
	.comm	_TMC_ETR_SG,4,2                 ; @TMC_ETR_SG
	.comm	_TMC_DEVID_AXIAW_VALID,4,2      ; @TMC_DEVID_AXIAW_VALID
	.comm	_TMC_DEVID_AXIAW_SHIFT,4,2      ; @TMC_DEVID_AXIAW_SHIFT
	.comm	_TMC_DEVID_AXIAW_MASK,4,2       ; @TMC_DEVID_AXIAW_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Detected dma mask %dbits\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to setup DMA mask: %d\n"

	.no_dead_strip	_tmc_etr_setup_caps
.subsections_via_symbols
