	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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	$152, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	%rsp, -176(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_NG_PATHSIZ@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rdi
	movq	%rdi, -152(%rbp)                ## 8-byte Spill
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movq	_BT3CFW_IDENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_LOG_NDELAY@GOTPCREL(%rip), %rax
	movq	_LOG_PID@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_LOG_PERROR@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	_LOG_USER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_openlog
	leaq	L_.str(%rip), %r12
	movq	_optarg@GOTPCREL(%rip), %r13
	xorl	%eax, %eax
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=2
	movq	(%r13), %rcx
	movq	-152(%rbp), %rdi                ## 8-byte Reload
	movl	%r15d, %esi
	leaq	L_.str.1(%rip), %rdx
	callq	_snprintf
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%ebx, %edi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_getopt
	cmpl	$110, %eax
	je	LBB0_6
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=2
	cmpl	$102, %eax
	je	LBB0_5
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=2
	xorl	%eax, %eax
	callq	_usage
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rax
	jmp	LBB0_1
LBB0_8:
	cmpq	$0, -136(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_10
## %bb.9:
	movq	-152(%rbp), %rax                ## 8-byte Reload
	cmpb	$0, (%rax)
	jne	LBB0_11
LBB0_10:
	xorl	%eax, %eax
	callq	_usage
LBB0_11:
	movq	_BT3CFW_MAX_FIRMWARE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$4, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_39
## %bb.12:
	movq	%rax, %r13
	leaq	L_.str.3(%rip), %rsi
	movq	-136(%rbp), %rdi                ## 8-byte Reload
	callq	_fopen
	movq	%rax, -168(%rbp)                ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_40
## %bb.13:
	xorl	%r15d, %r15d
	movq	%r13, -144(%rbp)                ## 8-byte Spill
	jmp	LBB0_14
LBB0_17:                                ##   in Loop: Header=BB0_14 Depth=1
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_29:                                ##   in Loop: Header=BB0_14 Depth=1
	leal	(%r14,%r12), %eax
	movzbl	%al, %r9d
	cmpl	$255, %r9d
	jne	LBB0_30
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_26 Depth 2
                                        ##     Child Loop BB0_23 Depth 2
	leaq	-128(%rbp), %rdi
	movl	$80, %esi
	movq	-168(%rbp), %rdx                ## 8-byte Reload
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_31
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	leaq	-126(%rbp), %r12
	movq	%r12, %rdi
	callq	_hexa2int8
	movl	%eax, %ebx
	leaq	-124(%rbp), %rdi
	callq	_hexa2int32
	movl	%eax, %r14d
	leal	(%rbx,%rbx), %eax
	movslq	%eax, %rdi
	addq	%r12, %rdi
	callq	_hexa2int8
	movl	%eax, %r12d
	cmpb	$51, -127(%rbp)
	jne	LBB0_16
## %bb.18:                              ##   in Loop: Header=BB0_14 Depth=1
	leal	12(%r15), %ecx
	movq	_BT3CFW_MAX_FIRMWARE_SIZE@GOTPCREL(%rip), %rdi
	cmpl	(%rdi), %ecx
	jge	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_14 Depth=1
	movslq	%r15d, %rax
	leaq	(%r13,%rax,4), %r13
	movl	%r14d, (%r13)
	movl	%ebx, %eax
	addl	$-4, %eax
	shrl	$31, %eax
	addl	%ebx, %eax
	addl	$-4, %eax
	movl	%eax, %edx
	sarl	%edx
	movl	%edx, 4(%r13)
	andl	$-2, %eax
	cltq
	imulq	$1431655766, %rax, %rdx         ## imm = 0x55555556
	movq	%rdx, %rsi
	shrq	$63, %rsi
	shrq	$32, %rdx
	addl	%esi, %edx
	leal	(%rdx,%rdx,2), %edx
	movl	%eax, %esi
	subl	%edx, %esi
	movl	$3, %edx
	subl	%esi, %edx
	testl	%esi, %esi
	cmovel	%esi, %edx
	movl	%edx, 8(%r13)
	addl	%eax, %ecx
	movl	%ecx, %r15d
	addl	%edx, %r15d
	cmpl	(%rdi), %r15d
	jge	LBB0_41
## %bb.21:                              ##   in Loop: Header=BB0_14 Depth=1
	leaq	-126(%rbp), %rdi
	callq	_hexa2int8
	movl	%eax, %r14d
	leaq	-124(%rbp), %rdi
	callq	_hexa2int8
	movl	%eax, %ebx
	addl	%r14d, %ebx
	leaq	-122(%rbp), %rdi
	callq	_hexa2int8
	movl	%eax, %r14d
	addl	%ebx, %r14d
	leaq	-120(%rbp), %rdi
	callq	_hexa2int8
	movl	%eax, %ebx
	addl	%r14d, %ebx
	leaq	-118(%rbp), %rdi
	callq	_hexa2int8
	movl	%eax, %r14d
	addl	%ebx, %r14d
	cmpl	$0, 4(%r13)
	jle	LBB0_28
## %bb.22:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, -184(%rbp)                ## 8-byte Spill
	leaq	-116(%rbp), %rbx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_hexa2int16
	movl	%eax, 12(%r13,%r12,4)
	movzbl	%ah, %ecx
	movzbl	%al, %eax
	addl	%eax, %r14d
	addl	%ecx, %r14d
	incq	%r12
	movslq	4(%r13), %rax
	addq	$4, %rbx
	cmpq	%rax, %r12
	jl	LBB0_23
## %bb.24:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-144(%rbp), %r13                ## 8-byte Reload
	movq	-184(%rbp), %r12                ## 8-byte Reload
	jmp	LBB0_29
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_14 Depth=1
	testl	%ebx, %ebx
	jle	LBB0_17
## %bb.25:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r12, %r13
	movl	%ebx, %r12d
	xorl	%r14d, %r14d
	leaq	-126(%rbp), %rbx
	.p2align	4, 0x90
LBB0_26:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rdi
	callq	_hexa2int8
	addl	%eax, %r14d
	addq	$2, %rbx
	decq	%r12
	jne	LBB0_26
## %bb.27:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	%r13, %r12
LBB0_28:                                ##   in Loop: Header=BB0_14 Depth=1
	movq	-144(%rbp), %r13                ## 8-byte Reload
	jmp	LBB0_29
LBB0_31:
	leaq	-156(%rbp), %rsi
	leaq	-188(%rbp), %rdx
	xorl	%edi, %edi
	callq	_NgMkSockNode
	testq	%rax, %rax
	js	LBB0_32
## %bb.35:
	movl	-156(%rbp), %edi
	movq	_NGM_BT3C_COOKIE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_NGM_BT3C_NODE_DOWNLOAD_FIRMWARE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	-152(%rbp), %rsi                ## 8-byte Reload
	movq	%r13, %r8
	movl	%r15d, %r9d
	callq	_NgSendMsg
	testq	%rax, %rax
	js	LBB0_36
## %bb.37:
	movq	%r13, %rdi
	callq	_free
	movq	-168(%rbp), %rdi                ## 8-byte Reload
	callq	_fclose
	movq	-176(%rbp), %rsp                ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_42
## %bb.38:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_30:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%r14b, %ecx
	leaq	L_.str.7(%rip), %rsi
	movq	-136(%rbp), %rdx                ## 8-byte Reload
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_syslog
	movl	$255, %edi
	callq	_exit
LBB0_41:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.6(%rip), %rsi
	movq	-136(%rbp), %rdx                ## 8-byte Reload
	movl	%r15d, %ecx
	jmp	LBB0_34
LBB0_19:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.5(%rip), %rsi
	movq	-136(%rbp), %rdx                ## 8-byte Reload
LBB0_34:
	xorl	%eax, %eax
	callq	_syslog
	movl	$255, %edi
	callq	_exit
LBB0_39:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_syslog
	movl	$255, %edi
	callq	_exit
LBB0_40:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_strerror
	movl	(%r14), %r8d
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edi
	movq	-136(%rbp), %rdx                ## 8-byte Reload
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_syslog
	movl	$255, %edi
	callq	_exit
LBB0_32:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_strerror
	movl	(%r14), %ecx
	leaq	L_.str.8(%rip), %rsi
	jmp	LBB0_33
LBB0_36:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_errno@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_strerror
	movl	(%r14), %ecx
	leaq	L_.str.9(%rip), %rsi
LBB0_33:
	movl	%ebx, %edi
	movq	%rax, %rdx
	jmp	LBB0_34
LBB0_42:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_NG_PATHSIZ,4,2                 ## @NG_PATHSIZ
	.comm	_BT3CFW_IDENT,4,2               ## @BT3CFW_IDENT
	.comm	_LOG_NDELAY,4,2                 ## @LOG_NDELAY
	.comm	_LOG_PID,4,2                    ## @LOG_PID
	.comm	_LOG_PERROR,4,2                 ## @LOG_PERROR
	.comm	_LOG_USER,4,2                   ## @LOG_USER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"f:hn:"

	.comm	_optarg,8,3                     ## @optarg
L_.str.1:                               ## @.str.1
	.asciz	"%s:"

	.comm	_BT3CFW_MAX_FIRMWARE_SIZE,4,2   ## @BT3CFW_MAX_FIRMWARE_SIZE
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
L_.str.2:                               ## @.str.2
	.asciz	"Could not allocate firmware buffer"

L_.str.3:                               ## @.str.3
	.asciz	"r"

L_.str.4:                               ## @.str.4
	.asciz	"Could not open BT3C firmware file %s. %s (%d)"

	.comm	_errno,4,2                      ## @errno
L_.str.5:                               ## @.str.5
	.asciz	"Could not add new firmware block. Firmware file %s is too big, firmware_size=%d"

L_.str.6:                               ## @.str.6
	.asciz	"Could not add new firmware data. Firmware file %s is too big, firmware_size=%d"

L_.str.7:                               ## @.str.7
	.asciz	"Invalid firmware file %s. Checksum error, cs=%#x, fcs=%#x, checksum=%#x"

L_.str.8:                               ## @.str.8
	.asciz	"Could not create Netgraph socket. %s (%d)"

	.comm	_NGM_BT3C_COOKIE,4,2            ## @NGM_BT3C_COOKIE
	.comm	_NGM_BT3C_NODE_DOWNLOAD_FIRMWARE,4,2 ## @NGM_BT3C_NODE_DOWNLOAD_FIRMWARE
L_.str.9:                               ## @.str.9
	.asciz	"Could not send Netgraph message. %s (%d)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #176
	mov	x20, x1
	mov	x21, x0
	mov	x8, sp
	stur	x8, [x29, #-248]                ; 8-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-96]
Lloh3:
	adrp	x8, _NG_PATHSIZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NG_PATHSIZ@GOTPAGEOFF]
Lloh5:
	ldr	w22, [x8]
	mov	x9, x22
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x22, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
	mov	x0, x19
	mov	w1, #0
	mov	x2, x22
	bl	_memset
Lloh8:
	adrp	x8, _BT3CFW_IDENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BT3CFW_IDENT@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x8, _LOG_NDELAY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _LOG_NDELAY@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _LOG_PID@GOTPAGE
Lloh15:
	ldr	x9, [x9, _LOG_PID@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
Lloh17:
	adrp	x10, _LOG_PERROR@GOTPAGE
Lloh18:
	ldr	x10, [x10, _LOG_PERROR@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh19:
	ldr	w9, [x10]
	orr	w1, w8, w9
Lloh20:
	adrp	x8, _LOG_USER@GOTPAGE
Lloh21:
	ldr	x8, [x8, _LOG_USER@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	bl	_openlog
	mov	x26, #0
Lloh23:
	adrp	x23, l_.str@PAGE
Lloh24:
	add	x23, x23, l_.str@PAGEOFF
Lloh25:
	adrp	x25, _optarg@GOTPAGE
Lloh26:
	ldr	x25, [x25, _optarg@GOTPAGEOFF]
Lloh27:
	adrp	x24, l_.str.1@PAGE
Lloh28:
	add	x24, x24, l_.str.1@PAGEOFF
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x3, [x25]
	mov	x0, x19
	mov	x1, x22
	mov	x2, x24
	bl	_snprintf
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x20
	mov	x2, x23
	bl	_getopt
	cmp	w0, #110
	b.eq	LBB0_1
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w0, #102
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_usage
	b	LBB0_2
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x26, [x25]
	b	LBB0_2
LBB0_7:
	cbz	x26, LBB0_9
; %bb.8:
	ldrb	w8, [x19]
	cbnz	w8, LBB0_10
LBB0_9:
	bl	_usage
LBB0_10:
Lloh29:
	adrp	x25, _BT3CFW_MAX_FIRMWARE_SIZE@GOTPAGE
Lloh30:
	ldr	x25, [x25, _BT3CFW_MAX_FIRMWARE_SIZE@GOTPAGEOFF]
	ldr	w0, [x25]
	mov	w1, #4
	bl	_calloc
	cbz	x0, LBB0_35
; %bb.11:
	stur	x0, [x29, #-192]                ; 8-byte Folded Spill
	stur	x19, [x29, #-240]               ; 8-byte Folded Spill
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	stur	x26, [x29, #-256]               ; 8-byte Folded Spill
	mov	x0, x26
	bl	_fopen
	cbz	x0, LBB0_36
; %bb.12:
	mov	x28, x0
	mov	w23, #0
	sub	x8, x29, #176
	add	x24, x8, #2
	add	x20, x8, #4
	add	x10, x8, #6
	add	x9, x8, #8
	stp	x9, x10, [x29, #-208]           ; 16-byte Folded Spill
	add	x9, x8, #10
	stp	x20, x9, [x29, #-224]           ; 16-byte Folded Spill
	add	x8, x8, #12
	stur	x8, [x29, #-232]                ; 8-byte Folded Spill
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w26, #0
LBB0_14:                                ;   in Loop: Header=BB0_15 Depth=1
	add	w8, w26, w22
	and	w8, w8, #0xff
	cmp	w8, #255
	b.ne	LBB0_30
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_25 Depth 2
                                        ;     Child Loop BB0_21 Depth 2
	sub	x0, x29, #176
	mov	w1, #80
	mov	x2, x28
	bl	_fgets
	cbz	x0, LBB0_26
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x24
	bl	_hexa2int8
	mov	x21, x0
	mov	x0, x20
	bl	_hexa2int32
	mov	x26, x0
	lsl	w8, w21, #1
	add	x0, x24, w8, sxtw
	bl	_hexa2int8
	mov	x22, x0
	ldurb	w8, [x29, #-175]
	cmp	w8, #51
	b.ne	LBB0_23
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	add	w8, w23, #12
	ldr	w9, [x25]
	cmp	w8, w9
	b.ge	LBB0_33
; %bb.18:                               ;   in Loop: Header=BB0_15 Depth=1
	ldur	x9, [x29, #-192]                ; 8-byte Folded Reload
	add	x27, x9, w23, sxtw #2
	sub	w9, w21, #4
	sub	w10, w21, #3
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w10, w9, #1
	stp	w26, w10, [x27]
	and	w9, w9, #0xfffffffe
	mov	w10, #21846
	movk	w10, #21845, lsl #16
	smull	x10, w9, w10
	lsr	x11, x10, #63
	lsr	x10, x10, #32
	add	w10, w10, w11
	add	w10, w10, w10, lsl #1
	subs	w10, w9, w10
	mov	w11, #3
	sub	w10, w11, w10
	csel	w10, wzr, w10, eq
	str	w10, [x27, #8]
	add	w8, w9, w8
	add	w23, w8, w10
	ldr	w8, [x25]
	cmp	w23, w8
	b.ge	LBB0_32
; %bb.19:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x0, x24
	bl	_hexa2int8
	mov	x21, x0
	mov	x0, x20
	bl	_hexa2int8
	add	w19, w0, w21
	ldur	x0, [x29, #-200]                ; 8-byte Folded Reload
	bl	_hexa2int8
	add	w19, w0, w19
	ldur	x0, [x29, #-208]                ; 8-byte Folded Reload
	bl	_hexa2int8
	add	w19, w0, w19
	ldur	x0, [x29, #-216]                ; 8-byte Folded Reload
	bl	_hexa2int8
	add	w26, w0, w19
	ldr	w8, [x27, #4]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.20:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x25, x28
	mov	x28, #0
	add	x19, x27, #12
	ldur	x21, [x29, #-232]               ; 8-byte Folded Reload
LBB0_21:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x21
	bl	_hexa2int16
	str	w0, [x19, x28, lsl #2]
	lsr	w8, w0, #8
	add	w9, w26, w0, uxtb
	add	w26, w9, w8, uxtb
	add	x28, x28, #1
	ldrsw	x8, [x27, #4]
	add	x21, x21, #4
	cmp	x28, x8
	b.lt	LBB0_21
; %bb.22:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	x28, x25
Lloh33:
	adrp	x25, _BT3CFW_MAX_FIRMWARE_SIZE@GOTPAGE
Lloh34:
	ldr	x25, [x25, _BT3CFW_MAX_FIRMWARE_SIZE@GOTPAGEOFF]
	ldur	x20, [x29, #-224]               ; 8-byte Folded Reload
	b	LBB0_14
LBB0_23:                                ;   in Loop: Header=BB0_15 Depth=1
	cmp	w21, #1
	b.lt	LBB0_13
; %bb.24:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w26, #0
	mov	w19, w21
	mov	x21, x24
LBB0_25:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x21
	bl	_hexa2int8
	add	w26, w0, w26
	add	x21, x21, #2
	subs	x19, x19, #1
	b.ne	LBB0_25
	b	LBB0_14
LBB0_26:
	sub	x1, x29, #180
	sub	x2, x29, #184
	bl	_NgMkSockNode
	tbnz	x0, #63, LBB0_37
; %bb.27:
	ldur	w0, [x29, #-180]
Lloh35:
	adrp	x8, _NGM_BT3C_COOKIE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _NGM_BT3C_COOKIE@GOTPAGEOFF]
Lloh37:
	ldr	w2, [x8]
Lloh38:
	adrp	x8, _NGM_BT3C_NODE_DOWNLOAD_FIRMWARE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _NGM_BT3C_NODE_DOWNLOAD_FIRMWARE@GOTPAGEOFF]
Lloh40:
	ldr	w3, [x8]
	ldur	x1, [x29, #-240]                ; 8-byte Folded Reload
	ldur	x19, [x29, #-192]               ; 8-byte Folded Reload
	mov	x4, x19
	mov	x5, x23
	bl	_NgSendMsg
	tbnz	x0, #63, LBB0_38
; %bb.28:
	mov	x0, x19
	bl	_free
	mov	x0, x28
	bl	_fclose
	ldur	x8, [x29, #-248]                ; 8-byte Folded Reload
	mov	sp, x8
	ldur	x8, [x29, #-96]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_40
; %bb.29:
	mov	w0, #0
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_30:
Lloh44:
	adrp	x9, _LOG_ERR@GOTPAGE
Lloh45:
	ldr	x9, [x9, _LOG_ERR@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x9]
	and	w9, w26, #0xff
	sub	sp, sp, #32
	stp	x22, x8, [sp, #16]
	str	x9, [sp, #8]
	ldur	x8, [x29, #-256]                ; 8-byte Folded Reload
	str	x8, [sp]
Lloh47:
	adrp	x1, l_.str.7@PAGE
Lloh48:
	add	x1, x1, l_.str.7@PAGEOFF
LBB0_31:
	bl	_syslog
	add	sp, sp, #32
	mov	w0, #255
	bl	_exit
LBB0_32:
Lloh49:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh50:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh51:
	ldr	w0, [x8]
	sub	sp, sp, #16
	str	x23, [sp, #8]
	ldur	x8, [x29, #-256]                ; 8-byte Folded Reload
	str	x8, [sp]
Lloh52:
	adrp	x1, l_.str.6@PAGE
Lloh53:
	add	x1, x1, l_.str.6@PAGEOFF
	b	LBB0_34
LBB0_33:
Lloh54:
	adrp	x9, _LOG_ERR@GOTPAGE
Lloh55:
	ldr	x9, [x9, _LOG_ERR@GOTPAGEOFF]
Lloh56:
	ldr	w0, [x9]
	sub	sp, sp, #16
	str	x8, [sp, #8]
	ldur	x8, [x29, #-256]                ; 8-byte Folded Reload
	str	x8, [sp]
Lloh57:
	adrp	x1, l_.str.5@PAGE
Lloh58:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_34:
	bl	_syslog
	add	sp, sp, #16
	mov	w0, #255
	bl	_exit
LBB0_35:
Lloh59:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh60:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh61:
	ldr	w0, [x8]
Lloh62:
	adrp	x1, l_.str.2@PAGE
Lloh63:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_syslog
	mov	w0, #255
	bl	_exit
LBB0_36:
Lloh64:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh65:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh66:
	ldr	w19, [x8]
Lloh67:
	adrp	x20, _errno@GOTPAGE
Lloh68:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_strerror
	ldr	w8, [x20]
	sub	sp, sp, #32
	stp	x0, x8, [sp, #8]
	ldur	x8, [x29, #-256]                ; 8-byte Folded Reload
	str	x8, [sp]
Lloh69:
	adrp	x1, l_.str.4@PAGE
Lloh70:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	b	LBB0_31
LBB0_37:
Lloh71:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh72:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh73:
	ldr	w19, [x8]
Lloh74:
	adrp	x20, _errno@GOTPAGE
Lloh75:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_strerror
	ldr	w8, [x20]
	stp	x0, x8, [sp, #-16]!
Lloh76:
	adrp	x1, l_.str.8@PAGE
Lloh77:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_39
LBB0_38:
Lloh78:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh79:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh80:
	ldr	w19, [x8]
Lloh81:
	adrp	x20, _errno@GOTPAGE
Lloh82:
	ldr	x20, [x20, _errno@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_strerror
	ldr	w8, [x20]
	stp	x0, x8, [sp, #-16]!
Lloh83:
	adrp	x1, l_.str.9@PAGE
Lloh84:
	add	x1, x1, l_.str.9@PAGEOFF
LBB0_39:
	mov	x0, x19
	b	LBB0_34
LBB0_40:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpAdd	Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpAdd	Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpAdd	Lloh69, Lloh70
	.loh AdrpLdrGot	Lloh67, Lloh68
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpAdd	Lloh76, Lloh77
	.loh AdrpLdrGot	Lloh74, Lloh75
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpAdd	Lloh83, Lloh84
	.loh AdrpLdrGot	Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh78, Lloh79, Lloh80
	.cfi_endproc
                                        ; -- End function
	.comm	_NG_PATHSIZ,4,2                 ; @NG_PATHSIZ
	.comm	_BT3CFW_IDENT,4,2               ; @BT3CFW_IDENT
	.comm	_LOG_NDELAY,4,2                 ; @LOG_NDELAY
	.comm	_LOG_PID,4,2                    ; @LOG_PID
	.comm	_LOG_PERROR,4,2                 ; @LOG_PERROR
	.comm	_LOG_USER,4,2                   ; @LOG_USER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"f:hn:"

	.comm	_optarg,8,3                     ; @optarg
l_.str.1:                               ; @.str.1
	.asciz	"%s:"

	.comm	_BT3CFW_MAX_FIRMWARE_SIZE,4,2   ; @BT3CFW_MAX_FIRMWARE_SIZE
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
l_.str.2:                               ; @.str.2
	.asciz	"Could not allocate firmware buffer"

l_.str.3:                               ; @.str.3
	.asciz	"r"

l_.str.4:                               ; @.str.4
	.asciz	"Could not open BT3C firmware file %s. %s (%d)"

	.comm	_errno,4,2                      ; @errno
l_.str.5:                               ; @.str.5
	.asciz	"Could not add new firmware block. Firmware file %s is too big, firmware_size=%d"

l_.str.6:                               ; @.str.6
	.asciz	"Could not add new firmware data. Firmware file %s is too big, firmware_size=%d"

l_.str.7:                               ; @.str.7
	.asciz	"Invalid firmware file %s. Checksum error, cs=%#x, fcs=%#x, checksum=%#x"

l_.str.8:                               ; @.str.8
	.asciz	"Could not create Netgraph socket. %s (%d)"

	.comm	_NGM_BT3C_COOKIE,4,2            ; @NGM_BT3C_COOKIE
	.comm	_NGM_BT3C_NODE_DOWNLOAD_FIRMWARE,4,2 ; @NGM_BT3C_NODE_DOWNLOAD_FIRMWARE
l_.str.9:                               ; @.str.9
	.asciz	"Could not send Netgraph message. %s (%d)"

.subsections_via_symbols
