	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function trf7970a_init
_trf7970a_init:                         ## @trf7970a_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %edx
	movl	16(%rdi), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_TRF7970A_CMD_SOFT_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_trf7970a_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.1:
	movq	_TRF7970A_CMD_IDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_trf7970a_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	movq	_TRF7970A_REG_IO_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	4(%r14), %ebx
	movl	$1, %edi
	callq	_TRF7970A_REG_IO_CTRL_VRS
	orl	%eax, %ebx
	movq	%r14, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_trf7970a_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	movq	_TRF7970A_NFC_TARGET_LEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_trf7970a_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movl	$1000, %edi                     ## imm = 0x3E8
	movl	$2000, %esi                     ## imm = 0x7D0
	callq	_usleep_range
	movq	_TRF7970A_CHIP_STATUS_RF_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 32(%r14)
	movq	_TRF7970A_MODULATOR_SYS_CLK_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	8(%r14), %edx
	movq	%r14, %rdi
	callq	_trf7970a_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96@GOTPCREL(%rip), %rax
	movq	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	%r14, %rdi
	callq	_trf7970a_write
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_8
## %bb.6:
	movq	_TRF7970A_SPECIAL_FCN_REG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r15d, %r15d
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_trf7970a_write
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
LBB0_8:
	movl	16(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	movl	%ebx, %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	$0, 24(%r14)
	movl	$255, 12(%r14)
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Initializing device - state: %d\n"

	.comm	_TRF7970A_CMD_SOFT_INIT,4,2     ## @TRF7970A_CMD_SOFT_INIT
	.comm	_TRF7970A_CMD_IDLE,4,2          ## @TRF7970A_CMD_IDLE
	.comm	_TRF7970A_REG_IO_CTRL,4,2       ## @TRF7970A_REG_IO_CTRL
	.comm	_TRF7970A_NFC_TARGET_LEVEL,4,2  ## @TRF7970A_NFC_TARGET_LEVEL
	.comm	_TRF7970A_CHIP_STATUS_RF_ON,4,2 ## @TRF7970A_CHIP_STATUS_RF_ON
	.comm	_TRF7970A_MODULATOR_SYS_CLK_CTRL,4,2 ## @TRF7970A_MODULATOR_SYS_CLK_CTRL
	.comm	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS,4,2 ## @TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS
	.comm	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96,4,2 ## @TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96
	.comm	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32,4,2 ## @TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32
	.comm	_TRF7970A_SPECIAL_FCN_REG1,4,2  ## @TRF7970A_SPECIAL_FCN_REG1
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't init device: %d\n"

	.no_dead_strip	_trf7970a_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function trf7970a_init
_trf7970a_init:                         ; @trf7970a_init
	.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	x19, x0
	ldr	w0, [x0, #16]
	ldr	w2, [x19]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh2:
	adrp	x8, _TRF7970A_CMD_SOFT_INIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _TRF7970A_CMD_SOFT_INIT@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_trf7970a_cmd
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.1:
Lloh5:
	adrp	x8, _TRF7970A_CMD_IDLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _TRF7970A_CMD_IDLE@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_trf7970a_cmd
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.2:
Lloh8:
	adrp	x8, _TRF7970A_REG_IO_CTRL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _TRF7970A_REG_IO_CTRL@GOTPAGEOFF]
Lloh10:
	ldr	w20, [x8]
	ldr	w21, [x19, #4]
	mov	w0, #1
	bl	_TRF7970A_REG_IO_CTRL_VRS
	orr	w2, w0, w21
	mov	x0, x19
	mov	x1, x20
	bl	_trf7970a_write
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.3:
Lloh11:
	adrp	x8, _TRF7970A_NFC_TARGET_LEVEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _TRF7970A_NFC_TARGET_LEVEL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_trf7970a_write
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.4:
	mov	w0, #1000
	mov	w1, #2000
	bl	_usleep_range
Lloh14:
	adrp	x8, _TRF7970A_CHIP_STATUS_RF_ON@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TRF7970A_CHIP_STATUS_RF_ON@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x19, #32]
	bic	w8, w9, w8
	str	w8, [x19, #32]
Lloh17:
	adrp	x8, _TRF7970A_MODULATOR_SYS_CLK_CTRL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TRF7970A_MODULATOR_SYS_CLK_CTRL@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w2, [x19, #8]
	mov	x0, x19
	bl	_trf7970a_write
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.5:
Lloh20:
	adrp	x8, _TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS@GOTPAGEOFF]
Lloh22:
	adrp	x9, _TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96@GOTPAGE
Lloh23:
	ldr	x9, [x9, _TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
Lloh25:
	ldr	w8, [x9]
Lloh26:
	adrp	x9, _TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32@GOTPAGE
Lloh27:
	ldr	x9, [x9, _TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_trf7970a_write
	mov	x20, x0
	cbnz	w0, LBB0_7
; %bb.6:
Lloh29:
	adrp	x8, _TRF7970A_SPECIAL_FCN_REG1@GOTPAGE
Lloh30:
	ldr	x8, [x8, _TRF7970A_SPECIAL_FCN_REG1@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_trf7970a_write
	mov	x20, x0
	cbz	w0, LBB0_9
LBB0_7:
	ldr	w0, [x19, #16]
Lloh32:
	adrp	x1, l_.str.1@PAGE
Lloh33:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
LBB0_8:
	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_9:
	str	xzr, [x19, #24]
	mov	w8, #255
	str	w8, [x19, #12]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Initializing device - state: %d\n"

	.comm	_TRF7970A_CMD_SOFT_INIT,4,2     ; @TRF7970A_CMD_SOFT_INIT
	.comm	_TRF7970A_CMD_IDLE,4,2          ; @TRF7970A_CMD_IDLE
	.comm	_TRF7970A_REG_IO_CTRL,4,2       ; @TRF7970A_REG_IO_CTRL
	.comm	_TRF7970A_NFC_TARGET_LEVEL,4,2  ; @TRF7970A_NFC_TARGET_LEVEL
	.comm	_TRF7970A_CHIP_STATUS_RF_ON,4,2 ; @TRF7970A_CHIP_STATUS_RF_ON
	.comm	_TRF7970A_MODULATOR_SYS_CLK_CTRL,4,2 ; @TRF7970A_MODULATOR_SYS_CLK_CTRL
	.comm	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS,4,2 ; @TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS
	.comm	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96,4,2 ; @TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLH_96
	.comm	_TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32,4,2 ; @TRF7970A_ADJUTABLE_FIFO_IRQ_LEVELS_WLL_32
	.comm	_TRF7970A_SPECIAL_FCN_REG1,4,2  ; @TRF7970A_SPECIAL_FCN_REG1
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't init device: %d\n"

	.no_dead_strip	_trf7970a_init
.subsections_via_symbols
