	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttpci_budget_debiread          ## -- Begin function ttpci_budget_debiread
	.p2align	4, 0x90
_ttpci_budget_debiread:                 ## @ttpci_budget_debiread
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r13d
	leal	-5(%r13), %eax
	xorl	%r15d, %r15d
	cmpl	$-4, %eax
	jb	LBB0_11
## %bb.1:
	movl	%r9d, %r12d
	movl	%edx, %r14d
	movl	%esi, -60(%rbp)                 ## 4-byte Spill
	movq	8(%rdi), %rbx
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	testl	%r8d, %r8d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.4:
	xorl	%esi, %esi
	callq	_spin_lock_irqsave
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_saa7146_wait_for_debi_done
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_2:
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_saa7146_wait_for_debi_done
	testl	%eax, %eax
	js	LBB0_3
LBB0_6:
	movq	_DEBI_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r13d, %eax
	shll	$17, %eax
	movzwl	%r14w, %ecx
	leal	(%rax,%rcx), %edx
	addl	$65536, %edx                    ## imm = 0x10000
	movq	%rbx, %rdi
	callq	_saa7146_write
	movq	_DEBI_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	callq	_saa7146_write
	movq	_DEBI_PAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_saa7146_write
	movq	_MC2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$131074, %edx                   ## imm = 0x20002
	callq	_saa7146_write
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_saa7146_wait_for_debi_done
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	movq	_DEBI_AD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_saa7146_read
	leal	32(,%r13,8), %ecx
	negl	%ecx
	movl	$4294967295, %r15d              ## imm = 0xFFFFFFFF
                                        ## kill: def $cl killed $cl killed $ecx
	shrq	%cl, %r15
	andl	%eax, %r15d
	jmp	LBB0_9
LBB0_7:
	movl	%eax, %r15d
LBB0_9:
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_11
LBB0_10:
	xorl	%esi, %esi
	callq	_spin_unlock_irqrestore
LBB0_11:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movl	%eax, %r15d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_DEBI_COMMAND,4,2               ## @DEBI_COMMAND
	.comm	_DEBI_CONFIG,4,2                ## @DEBI_CONFIG
	.comm	_DEBI_PAGE,4,2                  ## @DEBI_PAGE
	.comm	_MC2,4,2                        ## @MC2
	.comm	_DEBI_AD,4,2                    ## @DEBI_AD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttpci_budget_debiread          ; -- Begin function ttpci_budget_debiread
	.p2align	2
_ttpci_budget_debiread:                 ; @ttpci_budget_debiread
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	w8, w3, #5
	cmn	w8, #4
	b.hs	LBB0_2
; %bb.1:
	mov	w25, #0
	b	LBB0_10
LBB0_2:
	mov	x23, x5
	mov	x20, x4
	mov	x21, x3
	mov	x26, x2
	mov	x24, x1
	mov	x19, x0
	ldr	x22, [x0, #8]
	cbz	w4, LBB0_5
; %bb.3:
	mov	x0, x19
	mov	x1, #0
	bl	_spin_lock_irqsave
	mov	x0, x22
	mov	x1, x23
	bl	_saa7146_wait_for_debi_done
	tbz	w0, #31, LBB0_6
; %bb.4:
	mov	x25, x0
	b	LBB0_9
LBB0_5:
	mov	x0, x22
	mov	x1, x23
	bl	_saa7146_wait_for_debi_done
	tbnz	w0, #31, LBB0_11
LBB0_6:
Lloh0:
	adrp	x8, _DEBI_COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DEBI_COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	and	w8, w26, #0xffff
	bfi	w8, w21, #17, #15
	orr	w2, w8, #0x10000
	mov	x0, x22
	bl	_saa7146_write
Lloh3:
	adrp	x8, _DEBI_CONFIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DEBI_CONFIG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x22
	mov	x2, x24
	bl	_saa7146_write
Lloh6:
	adrp	x8, _DEBI_PAGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DEBI_PAGE@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x22
	mov	w2, #0
	bl	_saa7146_write
Lloh9:
	adrp	x8, _MC2@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MC2@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	mov	w2, #131074
	bl	_saa7146_write
	mov	x0, x22
	mov	x1, x23
	bl	_saa7146_wait_for_debi_done
	tbnz	w0, #31, LBB0_8
; %bb.7:
Lloh12:
	adrp	x8, _DEBI_AD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _DEBI_AD@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_saa7146_read
	mov	w8, #32
	sub	w8, w8, w21, lsl #3
	mov	w9, #-1
	lsr	x8, x9, x8
	and	w25, w0, w8
	cbnz	w20, LBB0_9
	b	LBB0_10
LBB0_8:
	mov	x25, x0
	cbz	w20, LBB0_10
LBB0_9:
	mov	x0, x19
	mov	x1, #0
	bl	_spin_unlock_irqrestore
LBB0_10:
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_11:
	mov	x25, x0
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DEBI_COMMAND,4,2               ; @DEBI_COMMAND
	.comm	_DEBI_CONFIG,4,2                ; @DEBI_CONFIG
	.comm	_DEBI_PAGE,4,2                  ; @DEBI_PAGE
	.comm	_MC2,4,2                        ; @MC2
	.comm	_DEBI_AD,4,2                    ; @DEBI_AD
.subsections_via_symbols
