	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_io
_do_io:                                 ## @do_io
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	(%rdi), %eax
	cltd
	idivl	4(%rdi)
	movl	%eax, %r12d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	leaq	56(%rdi), %r13
	xorl	%r15d, %r15d
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	movl	%r15d, %ebx
	movl	%r15d, %edi
	movq	%r13, %rsi
	callq	_ubd_test_bit
	movl	%eax, %r14d
	cmpl	%r12d, %r15d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	jge	LBB0_7
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edi
	movq	%r13, %rsi
	callq	_ubd_test_bit
	movb	$1, %cl
	movq	%rbx, %rdx
	movl	%edx, %r15d
	cmpl	%r14d, %eax
	jne	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	leal	1(%rdx), %r15d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r15d, %ebx
	cmpl	%r15d, %r12d
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	%ebx, %edi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	callq	_ubd_test_bit
	leal	1(%rbx), %r15d
	cmpl	%r14d, %eax
	je	LBB0_4
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	decl	%r15d
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	movq	%rbx, %rdx
	movl	%edx, %r15d
	jmp	LBB0_10
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	%r12d, %r15d
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r12d, %ebx
	setl	%cl
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	40(%r13), %rax
	movslq	%r14d, %r12
	movq	(%rax,%r12,8), %rsi
	addq	48(%r13), %rsi
	movl	4(%r13), %ebx
	movl	%ebx, %eax
	imull	%edx, %eax
	movslq	%eax, %r14
	addq	%r14, %rsi
	addq	8(%r13), %r14
	movq	32(%r13), %rax
	movl	(%rax,%r12,4), %edi
	callq	_os_seek_file
	testl	%eax, %eax
	js	LBB0_25
## %bb.11:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	%r15d, %eax
	subl	-64(%rbp), %eax                 ## 4-byte Folded Reload
	imull	%eax, %ebx
	movslq	%ebx, %rbx
	movq	24(%r13), %rax
	movq	_UBD_READ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_18
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%eax, %eax
	addq	%rax, %r14
	subq	%rax, %rbx
	movq	32(%r13), %rax
	movl	(%rax,%r12,4), %edi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_os_read_file
	testl	%eax, %eax
	js	LBB0_21
## %bb.14:                              ##   in Loop: Header=BB0_13 Depth=2
	movl	%eax, %ecx
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_13 Depth=2
	cmpq	%rcx, %rbx
	ja	LBB0_13
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpq	%rcx, %rbx
	jbe	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	addq	%rcx, %r14
	subq	%rcx, %rbx
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_memset
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	32(%r13), %rax
	movl	(%rax,%r12,4), %edi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_os_write_file
	cmpl	%ebx, %eax
	jne	LBB0_26
LBB0_19:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$0, -48(%rbp)                   ## 1-byte Folded Reload
	movl	-44(%rbp), %r12d                ## 4-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jne	LBB0_1
## %bb.20:
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_update_bitmap
	jmp	LBB0_24
LBB0_21:
	negl	%eax
	movq	32(%r13), %rcx
	movl	(%rcx,%r12,4), %edx
	leaq	L_.str.1(%rip), %rdi
LBB0_22:
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
LBB0_23:
	movl	$1, %eax
LBB0_24:
	movl	%eax, 16(%r13)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	negl	%eax
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_23
LBB0_26:
	negl	%eax
	movq	32(%r13), %rcx
	movl	(%rcx,%r12,4), %edx
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"do_io - lseek failed : err = %d\n"

	.comm	_UBD_READ,8,3                   ## @UBD_READ
L_.str.1:                               ## @.str.1
	.asciz	"do_io - read failed, err = %d fd = %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"do_io - write failed err = %d fd = %d\n"

	.no_dead_strip	_do_io
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_io
_do_io:                                 ; @do_io
	.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	x19, x0
	mov	w26, #0
	ldp	w8, w9, [x0]
	add	x20, x0, #56
	sdiv	w25, w8, w9
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
	mov	x21, x26
	mov	x0, x26
	mov	x1, x20
	bl	_ubd_test_bit
	mov	x22, x0
	cmp	w26, w25
	b.ge	LBB0_7
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_ubd_test_bit
	cmp	w0, w22
	b.ne	LBB0_8
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	add	w8, w21, #1
LBB0_4:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x23, x8
	cmp	w25, w8
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	mov	x0, x23
	mov	x1, x20
	bl	_ubd_test_bit
	add	w8, w23, #1
	cmp	w0, w22
	b.eq	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_1 Depth=1
	sub	w26, w8, #1
	b	LBB0_10
LBB0_7:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w27, #0
	mov	x26, x21
	b	LBB0_11
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w27, #1
	mov	x26, x21
	b	LBB0_11
LBB0_9:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x26, x25
LBB0_10:                                ;   in Loop: Header=BB0_1 Depth=1
	cmp	w23, w25
	cset	w27, lt
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	ldp	x9, x8, [x19, #40]
	ldr	x10, [x19, #32]
	ldr	x9, [x9, w22, sxtw #3]
	ldr	w23, [x19, #4]
	mul	w11, w23, w21
	sxtw	x28, w11
	add	x8, x9, x8
	add	x1, x8, x28
	ldr	x24, [x19, #8]
	ldr	w0, [x10, w22, sxtw #2]
	bl	_os_seek_file
	tbnz	w0, #31, LBB0_24
; %bb.12:                               ;   in Loop: Header=BB0_1 Depth=1
	str	w27, [sp, #12]                  ; 4-byte Folded Spill
	sxtw	x27, w22
	sub	w8, w26, w21
	mul	w8, w23, w8
	sxtw	x21, w8
	add	x22, x24, x28
	ldr	x8, [x19, #24]
Lloh0:
	adrp	x9, _UBD_READ@GOTPAGE
Lloh1:
	ldr	x9, [x9, _UBD_READ@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.13:                               ;   in Loop: Header=BB0_1 Depth=1
	mov	w0, #0
LBB0_14:                                ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w8, w0
	add	x22, x22, x8
	sub	x21, x21, x8
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x27, lsl #2]
	mov	x1, x22
	mov	x2, x21
	bl	_os_read_file
	tbnz	w0, #31, LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_14 Depth=2
	mov	w8, w0
	cmp	w0, #0
	ccmp	x21, x8, #0, ne
	b.hi	LBB0_14
; %bb.16:                               ;   in Loop: Header=BB0_1 Depth=1
	cmp	x21, x8
	b.ls	LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_1 Depth=1
	add	x0, x22, x8
	sub	x2, x21, x8
	mov	w1, #0
	bl	_memset
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x19, #32]
	ldr	w0, [x8, x27, lsl #2]
	mov	x1, x22
	mov	x2, x21
	bl	_os_write_file
	cmp	w0, w21
	b.ne	LBB0_25
LBB0_19:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w8, [sp, #12]                   ; 4-byte Folded Reload
	tbnz	w8, #0, LBB0_1
; %bb.20:
	mov	x0, x19
	bl	_update_bitmap
	b	LBB0_23
LBB0_21:
	neg	w1, w0
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x27, lsl #2]
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_22:
	bl	_printk
	mov	w0, #1
LBB0_23:
	str	w0, [x19, #16]
	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
LBB0_24:
	neg	w1, w0
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_22
LBB0_25:
	neg	w1, w0
	ldr	x8, [x19, #32]
	ldr	w8, [x8, x27, lsl #2]
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"do_io - lseek failed : err = %d\n"

	.comm	_UBD_READ,8,3                   ; @UBD_READ
l_.str.1:                               ; @.str.1
	.asciz	"do_io - read failed, err = %d fd = %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"do_io - write failed err = %d fd = %d\n"

	.no_dead_strip	_do_io
.subsections_via_symbols
