	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bfusb_load_firmware
_bfusb_load_firmware:                   ## @bfusb_load_firmware
	.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	%edx, %ebx
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	(%rdi), %rdx
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_BT_DBG
	leaq	L_.str.1(%rip), %rdi
	callq	_BT_INFO
	movq	(%r14), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	(%r14), %rdi
	movq	_USB_REQ_SET_CONFIGURATION@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_USB_CTRL_SET_TIMEOUT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r10d
	subq	$8, %rsp
	movl	%eax, %esi
	xorl	%ecx, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movq	(%rax), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	_BFUSB_MAX_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	$3, %rdi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r15
	movq	(%r14), %rdi
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	8(%r14), %esi
	callq	_usb_sndbulkpipe
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ebx
	je	LBB0_10
## %bb.5:
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_uint@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_BFUSB_MAX_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	addq	$3, %rdx
	movl	%ebx, %esi
	callq	_min_t
	movl	%eax, %r14d
	movslq	%r13d, %rsi
	addq	-64(%rbp), %rsi                 ## 8-byte Folded Reload
	movq	%r15, %rdi
	movl	%eax, %edx
	callq	_memcpy
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	_BFUSB_BLOCK_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%r15, %rdx
	movl	%r14d, %ecx
	leaq	-48(%rbp), %r8
	callq	_usb_bulk_msg
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	%r14d, -48(%rbp)
	jne	LBB0_7
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	addl	%r14d, %r13d
	subl	%r14d, %ebx
	jne	LBB0_6
LBB0_10:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	(%rbx), %rdi
	movq	_BFUSB_BLOCK_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	-48(%rbp), %r8
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_usb_bulk_msg
	testl	%eax, %eax
	js	LBB0_11
## %bb.12:
	movq	(%rbx), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	(%rbx), %rdi
	movq	_USB_REQ_SET_CONFIGURATION@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	movq	_USB_CTRL_SET_TIMEOUT@GOTPCREL(%rip), %r13
	movl	(%r13), %r10d
	subq	$8, %rsp
	movl	%eax, %esi
	xorl	%ecx, %ecx
	movl	$2, %r8d
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_13
## %bb.16:
	movq	(%rbx), %rax
	movq	(%rax), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	leaq	L_.str.7(%rip), %rdi
	callq	_BT_INFO
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str.2(%rip), %rdi
	callq	_BT_ERR
	movq	_EBUSY@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_3:
	leaq	L_.str.3(%rip), %rdi
	callq	_BT_ERR
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	jmp	LBB0_15
LBB0_7:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	_USB_REQ_SET_CONFIGURATION@GOTPCREL(%rip), %r14
	movq	_USB_CTRL_SET_TIMEOUT@GOTPCREL(%rip), %r13
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_14
LBB0_11:
	movl	%eax, %r12d
	leaq	L_.str.5(%rip), %rdi
	movq	_USB_REQ_SET_CONFIGURATION@GOTPCREL(%rip), %r14
	movq	_USB_CTRL_SET_TIMEOUT@GOTPCREL(%rip), %r13
	jmp	LBB0_14
LBB0_13:
	leaq	L_.str.6(%rip), %rdi
	movl	%eax, %r12d
LBB0_14:
	callq	_BT_ERR
	movq	%r15, %rdi
	callq	_kfree
	movq	(%rbx), %rdi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	movq	(%rbx), %rdi
	movl	(%r14), %edx
	movl	(%r13), %ebx
	subq	$8, %rsp
	movl	%eax, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
LBB0_15:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bfusb %p udev %p"

L_.str.1:                               ## @.str.1
	.asciz	"BlueFRITZ! USB loading firmware"

	.comm	_USB_REQ_SET_CONFIGURATION,4,2  ## @USB_REQ_SET_CONFIGURATION
	.comm	_USB_CTRL_SET_TIMEOUT,4,2       ## @USB_CTRL_SET_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"Can't change to loading configuration"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_BFUSB_MAX_BLOCK_SIZE,8,3       ## @BFUSB_MAX_BLOCK_SIZE
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
L_.str.3:                               ## @.str.3
	.asciz	"Can't allocate memory chunk for firmware"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_uint,4,2                       ## @uint
	.comm	_BFUSB_BLOCK_TIMEOUT,4,2        ## @BFUSB_BLOCK_TIMEOUT
L_.str.4:                               ## @.str.4
	.asciz	"Error in firmware loading"

L_.str.5:                               ## @.str.5
	.asciz	"Error in null packet request"

L_.str.6:                               ## @.str.6
	.asciz	"Can't change to running configuration"

L_.str.7:                               ## @.str.7
	.asciz	"BlueFRITZ! USB device ready"

	.no_dead_strip	_bfusb_load_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bfusb_load_firmware
_bfusb_load_firmware:                   ; @bfusb_load_firmware
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x2, [x0]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BT_DBG
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_BT_INFO
	ldr	x0, [x19]
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	x0, [x19]
Lloh4:
	adrp	x8, _USB_REQ_SET_CONFIGURATION@GOTPAGE
Lloh5:
	ldr	x8, [x8, _USB_REQ_SET_CONFIGURATION@GOTPAGEOFF]
Lloh6:
	ldr	w2, [x8]
Lloh7:
	adrp	x8, _USB_CTRL_SET_TIMEOUT@GOTPAGE
Lloh8:
	ldr	x8, [x8, _USB_CTRL_SET_TIMEOUT@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	str	w8, [sp]
	mov	w3, #0
	mov	w4, #1
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_9
; %bb.1:
	ldr	x8, [x19]
	ldr	x8, [x8]
Lloh10:
	adrp	x9, _BFUSB_MAX_BLOCK_SIZE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _BFUSB_MAX_BLOCK_SIZE@GOTPAGEOFF]
	stp	xzr, xzr, [x8]
Lloh12:
	ldr	x8, [x9]
	add	x0, x8, #3
Lloh13:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_10
; %bb.2:
	mov	x20, x0
	ldr	x0, [x19]
	ldr	w1, [x19, #8]
	bl	_usb_sndbulkpipe
	mov	x24, x0
Lloh16:
	adrp	x28, _BFUSB_BLOCK_TIMEOUT@GOTPAGE
Lloh17:
	ldr	x28, [x28, _BFUSB_BLOCK_TIMEOUT@GOTPAGEOFF]
	cbz	w21, LBB0_6
; %bb.3:
	mov	w25, #0
Lloh18:
	adrp	x27, _uint@GOTPAGE
Lloh19:
	ldr	x27, [x27, _uint@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x27]
Lloh20:
	adrp	x8, _BFUSB_MAX_BLOCK_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BFUSB_MAX_BLOCK_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	add	x2, x8, #3
	mov	x1, x21
	bl	_min_t
	mov	x26, x0
	add	x1, x22, w25, sxtw
	mov	x0, x20
	mov	x2, x26
	bl	_memcpy
	ldr	x0, [x19]
	ldr	w5, [x28]
	add	x4, sp, #12
	mov	x1, x24
	mov	x2, x20
	mov	x3, x26
	bl	_usb_bulk_msg
	ldr	w8, [sp, #12]
	cmp	w0, #0
	ccmp	w8, w26, #0, eq
	b.ne	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w25, w26, w25
	subs	w21, w21, w26
	b.ne	LBB0_4
LBB0_6:
	ldr	x0, [x19]
	ldr	w5, [x28]
	add	x4, sp, #12
	mov	x1, x24
	mov	x2, #0
	mov	w3, #0
	bl	_usb_bulk_msg
	tbnz	w0, #31, LBB0_13
; %bb.7:
	ldr	x0, [x19]
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	x0, [x19]
Lloh23:
	adrp	x21, _USB_REQ_SET_CONFIGURATION@GOTPAGE
Lloh24:
	ldr	x21, [x21, _USB_REQ_SET_CONFIGURATION@GOTPAGEOFF]
	ldr	w2, [x21]
Lloh25:
	adrp	x22, _USB_CTRL_SET_TIMEOUT@GOTPAGE
Lloh26:
	ldr	x22, [x22, _USB_CTRL_SET_TIMEOUT@GOTPAGEOFF]
	ldr	w8, [x22]
	str	w8, [sp]
	mov	w3, #0
	mov	w4, #2
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	tbnz	w0, #31, LBB0_14
; %bb.8:
	ldr	x8, [x19]
	ldr	x8, [x8]
	stp	xzr, xzr, [x8]
Lloh27:
	adrp	x0, l_.str.7@PAGE
Lloh28:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_BT_INFO
	mov	x0, x20
	bl	_kfree
	mov	w23, #0
	b	LBB0_16
LBB0_9:
Lloh29:
	adrp	x0, l_.str.2@PAGE
Lloh30:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_BT_ERR
Lloh31:
	adrp	x8, _EBUSY@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh33:
	adrp	x0, l_.str.3@PAGE
Lloh34:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_BT_ERR
Lloh35:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh36:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_16
LBB0_12:
	mov	x23, x0
Lloh37:
	adrp	x21, _USB_REQ_SET_CONFIGURATION@GOTPAGE
Lloh38:
	ldr	x21, [x21, _USB_REQ_SET_CONFIGURATION@GOTPAGEOFF]
Lloh39:
	adrp	x22, _USB_CTRL_SET_TIMEOUT@GOTPAGE
Lloh40:
	ldr	x22, [x22, _USB_CTRL_SET_TIMEOUT@GOTPAGEOFF]
Lloh41:
	adrp	x0, l_.str.4@PAGE
Lloh42:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_15
LBB0_13:
	mov	x23, x0
Lloh43:
	adrp	x0, l_.str.5@PAGE
Lloh44:
	add	x0, x0, l_.str.5@PAGEOFF
Lloh45:
	adrp	x21, _USB_REQ_SET_CONFIGURATION@GOTPAGE
Lloh46:
	ldr	x21, [x21, _USB_REQ_SET_CONFIGURATION@GOTPAGEOFF]
Lloh47:
	adrp	x22, _USB_CTRL_SET_TIMEOUT@GOTPAGE
Lloh48:
	ldr	x22, [x22, _USB_CTRL_SET_TIMEOUT@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
	mov	x23, x0
Lloh49:
	adrp	x0, l_.str.6@PAGE
Lloh50:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_15:
	bl	_BT_ERR
	mov	x0, x20
	bl	_kfree
	ldr	x0, [x19]
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	ldr	x0, [x19]
	ldr	w2, [x21]
	ldr	w8, [x22]
	str	w8, [sp]
	mov	w3, #0
	mov	w4, #0
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
LBB0_16:
	mov	x0, x23
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh47, Lloh48
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpAdd	Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bfusb %p udev %p"

l_.str.1:                               ; @.str.1
	.asciz	"BlueFRITZ! USB loading firmware"

	.comm	_USB_REQ_SET_CONFIGURATION,4,2  ; @USB_REQ_SET_CONFIGURATION
	.comm	_USB_CTRL_SET_TIMEOUT,4,2       ; @USB_CTRL_SET_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"Can't change to loading configuration"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_BFUSB_MAX_BLOCK_SIZE,8,3       ; @BFUSB_MAX_BLOCK_SIZE
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
l_.str.3:                               ; @.str.3
	.asciz	"Can't allocate memory chunk for firmware"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_uint,4,2                       ; @uint
	.comm	_BFUSB_BLOCK_TIMEOUT,4,2        ; @BFUSB_BLOCK_TIMEOUT
l_.str.4:                               ; @.str.4
	.asciz	"Error in firmware loading"

l_.str.5:                               ; @.str.5
	.asciz	"Error in null packet request"

l_.str.6:                               ; @.str.6
	.asciz	"Can't change to running configuration"

l_.str.7:                               ; @.str.7
	.asciz	"BlueFRITZ! USB device ready"

	.no_dead_strip	_bfusb_load_firmware
.subsections_via_symbols
