	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwmbt_load_ddc                 ## -- Begin function iwmbt_load_ddc
	.p2align	4, 0x90
_iwmbt_load_ddc:                        ## @iwmbt_load_ddc
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_IWMBT_HCI_MAX_CMD_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	%r14, %rax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movl	(%r15), %ebx
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %esi
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_iwmbt_debug
	leal	(,%r14,4), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	testl	%ebx, %ebx
	jle	LBB0_2
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_memset
	movl	$64651, %edi                    ## imm = 0xFC8B
	callq	_htole16
	movl	%eax, 12(%r13)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rax
	movslq	%r14d, %r14
	leaq	(%rax,%r14,8), %r12
	movq	(%rax,%r14,8), %rcx
	incq	%rcx
	movq	%rcx, (%r13)
	movl	8(%r13), %r15d
	movq	(%rax,%r14,8), %rdi
	movl	%ebx, %esi
	callq	_XMIN
	movl	%r15d, %edi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_memcpy
	movl	(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_iwmbt_debug
	movl	(%r13), %eax
	subl	%eax, %ebx
	addl	%eax, %r14d
	movq	_IWMBT_HCI_CMD_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r13, %rdx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	leaq	-84(%rbp), %r8
	callq	_iwmbt_hci_command
	testl	%eax, %eax
	jns	LBB0_1
## %bb.4:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_iwmbt_debug
	movl	$-1, %eax
	jmp	LBB0_5
LBB0_2:
	xorl	%eax, %eax
LBB0_5:
	movq	-64(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_7
## %bb.6:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IWMBT_HCI_MAX_CMD_SIZE,4,2     ## @IWMBT_HCI_MAX_CMD_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"file=%s, size=%d"

L_.str.1:                               ## @.str.1
	.asciz	"transferring %d bytes, offset %d"

	.comm	_IWMBT_HCI_CMD_TIMEOUT,4,2      ## @IWMBT_HCI_CMD_TIMEOUT
L_.str.2:                               ## @.str.2
	.asciz	"Intel Write DDC failed: code=%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_iwmbt_load_ddc                 ; -- Begin function iwmbt_load_ddc
	.p2align	2
_iwmbt_load_ddc:                        ; @iwmbt_load_ddc
	.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, #32
	mov	x19, x1
	mov	x20, x0
	mov	x8, sp
	stur	x8, [x29, #-104]                ; 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, #-88]
Lloh3:
	adrp	x8, _IWMBT_HCI_MAX_CMD_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IWMBT_HCI_MAX_CMD_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	lsl	x8, x23, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	ldr	w22, [x1]
	ldr	w1, [x1, #16]
	str	x22, [sp, #-16]!
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_iwmbt_debug
	add	sp, sp, #16
	mov	w28, #0
	lsl	w23, w23, #2
Lloh10:
	adrp	x27, _IWMBT_HCI_CMD_TIMEOUT@GOTPAGE
Lloh11:
	ldr	x27, [x27, _IWMBT_HCI_CMD_TIMEOUT@GOTPAGEOFF]
Lloh12:
	adrp	x24, l_.str.1@PAGE
Lloh13:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w22, #1
	b.lt	LBB0_4
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	w1, #0
	mov	x2, x23
	bl	_memset
	mov	w0, #64651
	bl	_htole16
	str	w0, [x21, #12]
	ldr	x8, [x19, #8]
	add	x25, x8, w28, sxtw #3
	ldr	x8, [x25]
	add	x8, x8, #1
	str	x8, [x21]
	ldr	w26, [x21, #8]
	ldr	x0, [x25]
	mov	x1, x22
	bl	_XMIN
	mov	x2, x0
	mov	x0, x26
	mov	x1, x25
	bl	_memcpy
	ldr	w1, [x21]
	str	x28, [sp, #-16]!
	mov	x0, x24
	bl	_iwmbt_debug
	add	sp, sp, #16
	ldr	w8, [x21]
	sub	w22, w22, w8
	add	w28, w28, w8
	ldr	w5, [x27]
	sub	x4, x29, #92
	mov	x0, x20
	mov	x1, x21
	mov	x2, x21
	mov	x3, x23
	bl	_iwmbt_hci_command
	tbz	w0, #31, LBB0_1
; %bb.3:
	mov	x1, x0
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_iwmbt_debug
	mov	w0, #-1
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	ldur	x8, [x29, #-104]                ; 8-byte Folded Reload
	mov	sp, x8
	ldur	x8, [x29, #-88]
Lloh16:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh17:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh18:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	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_7:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_IWMBT_HCI_MAX_CMD_SIZE,4,2     ; @IWMBT_HCI_MAX_CMD_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"file=%s, size=%d"

l_.str.1:                               ; @.str.1
	.asciz	"transferring %d bytes, offset %d"

	.comm	_IWMBT_HCI_CMD_TIMEOUT,4,2      ; @IWMBT_HCI_CMD_TIMEOUT
l_.str.2:                               ; @.str.2
	.asciz	"Intel Write DDC failed: code=%d"

.subsections_via_symbols
