	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nxt2002_init
_nxt2002_init:                          ## @nxt2002_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	(%rdi), %r14
	movq	_NXT2002_DEFAULT_FIRMWARE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	movl	(%rbx), %esi
	movq	(%r14), %rax
	movl	(%rax), %edx
	leaq	-56(%rbp), %rdi
	callq	_request_firmware
	movl	%eax, %r12d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printk
	testl	%r12d, %r12d
	je	LBB0_3
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_3:
	movq	-56(%rbp), %rsi
	movq	%r15, %rdi
	callq	_nxt2002_load_firmware
	movl	%eax, %r12d
	movq	-56(%rbp), %rdi
	callq	_release_firmware
	testl	%r12d, %r12d
	je	LBB0_5
## %bb.4:
	leaq	L_.str.3(%rip), %rdi
LBB0_2:
	xorl	%eax, %eax
	callq	_printk
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	movl	%r12d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	leaq	L_.str.4(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_printk
	movq	%r14, %rdi
	callq	_nxt200x_microcontroller_stop
	movl	$0, -48(%rbp)
	leaq	-48(%rbp), %r15
	movq	%r14, %rdi
	movl	$43, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_nxt200x_writebytes
	movq	%r14, %rdi
	callq	_nxt200x_microcontroller_stop
	movl	$15, -48(%rbp)
	movq	%r14, %rdi
	movl	$8, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_nxt200x_writebytes
	movl	$0, -48(%rbp)
	movq	%r14, %rdi
	movl	$8, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_nxt200x_writebytes
	movl	$241, -48(%rbp)
	movq	%r14, %rdi
	movl	$87, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_nxt200x_writebytes
	movl	$32, -48(%rbp)
	movq	%r14, %rdi
	movl	$9, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_nxt200x_writebytes
	movq	$126, -48(%rbp)
	movq	%r14, %rdi
	movl	$233, %esi
	movq	%r15, %rdx
	movl	$2, %ecx
	callq	_nxt200x_writebytes
	movl	$0, -48(%rbp)
	movq	%r14, %rdi
	movl	$204, %esi
	movq	%r15, %rdx
	movl	$1, %ecx
	callq	_nxt200x_writebytes
	jmp	LBB0_6
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nxt2002: Waiting for firmware upload (%s)...\n"

	.comm	_NXT2002_DEFAULT_FIRMWARE,4,2   ## @NXT2002_DEFAULT_FIRMWARE
L_.str.1:                               ## @.str.1
	.asciz	"nxt2002: Waiting for firmware upload(2)...\n"

L_.str.2:                               ## @.str.2
	.asciz	"nxt2002: No firmware uploaded (timeout or file not found?)\n"

L_.str.3:                               ## @.str.3
	.asciz	"nxt2002: Writing firmware to device failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"nxt2002: Firmware upload complete\n"

	.no_dead_strip	_nxt2002_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function nxt2002_init
lCPI0_0:
	.long	126                             ; 0x7e
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_nxt2002_init:                          ; @nxt2002_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x0
	ldr	x19, [x0]
Lloh0:
	adrp	x20, _NXT2002_DEFAULT_FIRMWARE@GOTPAGE
Lloh1:
	ldr	x20, [x20, _NXT2002_DEFAULT_FIRMWARE@GOTPAGEOFF]
	ldr	w8, [x20]
	str	x8, [sp]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
	ldr	w1, [x20]
	ldr	x8, [x19]
	ldr	w2, [x8]
	add	x0, sp, #24
	bl	_request_firmware
	mov	x20, x0
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
	cbz	w20, LBB0_2
; %bb.1:
Lloh6:
	adrp	x0, l_.str.2@PAGE
Lloh7:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printk
	b	LBB0_5
LBB0_2:
	ldr	x1, [sp, #24]
	mov	x0, x21
	bl	_nxt2002_load_firmware
	mov	x20, x0
	ldr	x0, [sp, #24]
	bl	_release_firmware
	cbz	w20, LBB0_4
; %bb.3:
Lloh8:
	adrp	x0, l_.str.3@PAGE
Lloh9:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_printk
	b	LBB0_5
LBB0_4:
Lloh10:
	adrp	x0, l_.str.4@PAGE
Lloh11:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printk
	mov	x0, x19
	bl	_nxt200x_microcontroller_stop
	str	wzr, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #43
	mov	w3, #1
	bl	_nxt200x_writebytes
	mov	x0, x19
	bl	_nxt200x_microcontroller_stop
	mov	w8, #15
	str	w8, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #8
	mov	w3, #1
	bl	_nxt200x_writebytes
	str	wzr, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #8
	mov	w3, #1
	bl	_nxt200x_writebytes
	mov	w8, #241
	str	w8, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #87
	mov	w3, #1
	bl	_nxt200x_writebytes
	mov	w8, #32
	str	w8, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #9
	mov	w3, #1
	bl	_nxt200x_writebytes
Lloh12:
	adrp	x8, lCPI0_0@PAGE
Lloh13:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #233
	mov	w3, #2
	bl	_nxt200x_writebytes
	str	wzr, [sp, #16]
	add	x2, sp, #16
	mov	x0, x19
	mov	w1, #204
	mov	w3, #1
	bl	_nxt200x_writebytes
LBB0_5:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nxt2002: Waiting for firmware upload (%s)...\n"

	.comm	_NXT2002_DEFAULT_FIRMWARE,4,2   ; @NXT2002_DEFAULT_FIRMWARE
l_.str.1:                               ; @.str.1
	.asciz	"nxt2002: Waiting for firmware upload(2)...\n"

l_.str.2:                               ; @.str.2
	.asciz	"nxt2002: No firmware uploaded (timeout or file not found?)\n"

l_.str.3:                               ; @.str.3
	.asciz	"nxt2002: Writing firmware to device failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"nxt2002: Firmware upload complete\n"

	.no_dead_strip	_nxt2002_init
.subsections_via_symbols
