	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_twsi_blk_wr                ## -- Begin function qib_twsi_blk_wr
	.p2align	4, 0x90
_qib_twsi_blk_wr:                       ## @qib_twsi_blk_wr
	.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
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	testl	%r8d, %r8d
	jle	LBB0_1
## %bb.2:
	movq	%rcx, %r15
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	_QIB_TWSI_NO_DEV@GOTPCREL(%rip), %rcx
	movq	_WRITE_CMD@GOTPCREL(%rip), %rdx
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_7 Depth 2
                                        ##     Child Loop BB0_10 Depth 2
	cmpl	%r13d, (%rcx)
	jne	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(%rax,%rax), %esi
	orl	(%rdx), %esi
	movq	_QIB_TWSI_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_qib_twsi_wr
	testl	%eax, %eax
	je	LBB0_5
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	(%rdx), %esi
	orl	%r13d, %esi
	movq	_QIB_TWSI_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_qib_twsi_wr
	testl	%eax, %eax
	jne	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%edx, %edx
	callq	_qib_twsi_wr
	testl	%eax, %eax
	jne	LBB0_14
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	$4, %esi
	callq	_min
	movl	%eax, %r14d
	testl	%eax, %eax
	jle	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r15), %esi
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_qib_twsi_wr
	testl	%eax, %eax
	jne	LBB0_15
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=2
	addq	$4, %r15
	decl	%ebx
	jne	LBB0_7
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%r14d, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	subl	%r14d, -44(%rbp)                ## 4-byte Folded Spill
	movq	%r12, %rdi
	callq	_stop_cmd
	movl	$-100, %ebx
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_READ_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	%r13d, %esi
	movq	_QIB_TWSI_START@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_qib_twsi_wr
	movq	%r12, %rdi
	testl	%eax, %eax
	je	LBB0_17
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	callq	_stop_cmd
	incl	%ebx
	jne	LBB0_10
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %esi
	callq	_rd_byte
	xorl	%eax, %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	movq	_QIB_TWSI_NO_DEV@GOTPCREL(%rip), %rcx
	movq	_WRITE_CMD@GOTPCREL(%rip), %rdx
	jg	LBB0_3
	jmp	LBB0_16
LBB0_1:
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_14:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_qib_dev_err
LBB0_15:
	movq	%r12, %rdi
	callq	_stop_cmd
	movl	$1, %eax
LBB0_16:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QIB_TWSI_NO_DEV,4,2            ## @QIB_TWSI_NO_DEV
	.comm	_WRITE_CMD,4,2                  ## @WRITE_CMD
	.comm	_QIB_TWSI_START,4,2             ## @QIB_TWSI_START
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to write interface write addr %02X\n"

	.comm	_READ_CMD,4,2                   ## @READ_CMD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_twsi_blk_wr                ; -- Begin function qib_twsi_blk_wr
	.p2align	2
_qib_twsi_blk_wr:                       ; @qib_twsi_blk_wr
	.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
	cmp	w4, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x21, x4
	mov	x22, x3
	mov	x20, x2
	mov	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _QIB_TWSI_NO_DEV@GOTPAGE
Lloh1:
	ldr	x8, [x8, _QIB_TWSI_NO_DEV@GOTPAGEOFF]
Lloh2:
	adrp	x9, _WRITE_CMD@GOTPAGE
Lloh3:
	ldr	x9, [x9, _WRITE_CMD@GOTPAGEOFF]
Lloh4:
	adrp	x27, _QIB_TWSI_START@GOTPAGE
Lloh5:
	ldr	x27, [x27, _QIB_TWSI_START@GOTPAGEOFF]
Lloh6:
	adrp	x28, _READ_CMD@GOTPAGE
Lloh7:
	ldr	x28, [x28, _READ_CMD@GOTPAGEOFF]
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
                                        ;     Child Loop BB0_11 Depth 2
	ldr	w8, [x8]
	mov	x26, x9
	cmp	w8, w23
	b.ne	LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x9]
	orr	w1, w8, w20, lsl #1
	ldr	w2, [x27]
	mov	x0, x19
	bl	_qib_twsi_wr
	cbz	w0, LBB0_6
	b	LBB0_16
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w8, [x9]
	orr	w1, w8, w23
	ldr	w2, [x27]
	mov	x0, x19
	bl	_qib_twsi_wr
	cbnz	w0, LBB0_16
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_qib_twsi_wr
	cbnz	w0, LBB0_15
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x21
	mov	w1, #4
	bl	_min
	mov	x25, x0
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x24, x25
LBB0_8:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #0
	bl	_qib_twsi_wr
	cbnz	w0, LBB0_16
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	add	x22, x22, #4
	subs	w24, w24, #1
	b.ne	LBB0_8
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w20, w25, w20
	sub	w21, w21, w25
	mov	x0, x19
	bl	_stop_cmd
	mov	w24, #-100
LBB0_11:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w8, [x28]
	orr	w1, w8, w23
	ldr	w2, [x27]
	mov	x0, x19
	bl	_qib_twsi_wr
	cbz	w0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=2
	mov	x0, x19
	bl	_stop_cmd
	adds	w24, w24, #1
	b.lo	LBB0_11
	b	LBB0_16
LBB0_13:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x19
	mov	w1, #1
	bl	_rd_byte
	mov	w0, #0
	cmp	w21, #0
Lloh8:
	adrp	x8, _QIB_TWSI_NO_DEV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _QIB_TWSI_NO_DEV@GOTPAGEOFF]
	mov	x9, x26
	b.gt	LBB0_2
	b	LBB0_17
LBB0_14:
	mov	w0, #0
	b	LBB0_17
LBB0_15:
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	mov	x2, x20
	bl	_qib_dev_err
LBB0_16:
	mov	x0, x19
	bl	_stop_cmd
	mov	w0, #1
LBB0_17:
	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
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_QIB_TWSI_NO_DEV,4,2            ; @QIB_TWSI_NO_DEV
	.comm	_WRITE_CMD,4,2                  ; @WRITE_CMD
	.comm	_QIB_TWSI_START,4,2             ; @QIB_TWSI_START
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to write interface write addr %02X\n"

	.comm	_READ_CMD,4,2                   ; @READ_CMD
.subsections_via_symbols
