	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function trace_write_gather
_trace_write_gather:                    ## @trace_write_gather
	.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	%ecx, %r15d
	movl	%edx, %r13d
	movq	%rsi, %r12
	callq	_cdma_to_channel
	movq	_host1x_debug_trace_cmdbuf@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_6
## %bb.1:
	movq	(%rax), %r14
	movq	%r12, %rdi
	callq	_host1x_bo_mmap
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %rbx
	testl	%r15d, %r15d
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_5
## %bb.3:
	movq	_TRACE_MAX_LENGTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %edi
	subl	%r14d, %edi
	callq	_min
	movl	%eax, %r12d
	leal	(%r13,%r14,4), %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_name
	movl	%eax, %edi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %edx
	movl	%r13d, %ecx
	movq	%rbx, %r8
	callq	_trace_host1x_cdma_push_gather
	movq	_TRACE_MAX_LENGTH@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addl	%esi, %r14d
	cmpl	%r15d, %r14d
	jl	LBB0_4
LBB0_5:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_host1x_bo_munmap               ## TAILCALL
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_host1x_debug_trace_cmdbuf,8,3  ## @host1x_debug_trace_cmdbuf
	.comm	_TRACE_MAX_LENGTH,8,3           ## @TRACE_MAX_LENGTH
	.no_dead_strip	_trace_write_gather
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function trace_write_gather
_trace_write_gather:                    ; @trace_write_gather
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x3
	mov	x21, x2
	mov	x20, x1
	bl	_cdma_to_channel
Lloh0:
	adrp	x8, _host1x_debug_trace_cmdbuf@GOTPAGE
Lloh1:
	ldr	x8, [x8, _host1x_debug_trace_cmdbuf@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.1:
	ldr	x22, [x0]
	mov	x0, x20
	bl	_host1x_bo_mmap
	cbz	x0, LBB0_6
; %bb.2:
	mov	x23, x0
	cmp	w19, #1
	b.lt	LBB0_5
; %bb.3:
	mov	w25, #0
Lloh3:
	adrp	x26, _TRACE_MAX_LENGTH@GOTPAGE
Lloh4:
	ldr	x26, [x26, _TRACE_MAX_LENGTH@GOTPAGEOFF]
	ldr	x1, [x26]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	sub	w0, w19, w25
	bl	_min
	mov	x24, x0
	add	w21, w21, w25, lsl #2
	mov	x0, x22
	bl	_dev_name
	mov	x1, x20
	mov	x2, x24
	mov	x3, x21
	mov	x4, x23
	bl	_trace_host1x_cdma_push_gather
	ldr	x1, [x26]
	add	w25, w25, w1
	cmp	w25, w19
	b.lt	LBB0_4
LBB0_5:
	mov	x0, x20
	mov	x1, x23
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_host1x_bo_munmap
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_host1x_debug_trace_cmdbuf,8,3  ; @host1x_debug_trace_cmdbuf
	.comm	_TRACE_MAX_LENGTH,8,3           ; @TRACE_MAX_LENGTH
	.no_dead_strip	_trace_write_gather
.subsections_via_symbols
