	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fjes_hw_register_buff_addr     ## -- Begin function fjes_hw_register_buff_addr
	.p2align	4, 0x90
_fjes_hw_register_buff_addr:            ## @fjes_hw_register_buff_addr
	.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	%rdx, %r15
	movl	%esi, %r13d
	movq	%rdi, %rbx
	leaq	8(%rdi), %r12
	movq	24(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	32(%rdi), %r14
	movl	%esi, %edi
	movq	%r12, %rsi
	callq	_test_bit
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jne	LBB0_32
## %bb.1:
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movl	16(%rbx), %edx
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_memset
	movl	12(%rbx), %edx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_memset
	movl	(%r15), %esi
	movl	16(%r15), %edi
	callq	_FJES_DEV_COMMAND_SHARE_BUFFER_REQ_LEN
	movq	%rax, (%r14)
	movl	%r13d, 8(%r14)
	movl	16(%r15), %eax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	16(%r14), %rcx
	movl	%eax, (%rcx)
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	16(%r15), %eax
	movq	_EP_BUFFER_INFO_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	cltd
	idivl	%ecx
	testl	%eax, %eax
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movl	%r13d, -68(%rbp)                ## 4-byte Spill
	jle	LBB0_6
## %bb.2:
	movl	%eax, %r15d
	decl	%r15d
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	imull	%r12d, %ecx
	movslq	%ecx, %rbx
	shlq	$2, %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	24(%rax), %rbx
	movq	%rbx, %rdi
	callq	_vmalloc_to_page
	movl	%eax, %edi
	callq	_page_to_phys
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_offset_in_page
	addl	%r13d, %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	16(%rdi), %rcx
	movl	%eax, 4(%rcx,%r12,4)
	cmpl	%r12d, %r15d
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %ecx
	incq	%r12
	jmp	LBB0_3
LBB0_5:
	addq	$2, %r12
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	jmp	LBB0_7
LBB0_6:
	movl	$1, %r12d
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_7:
	movl	(%rdx), %eax
	movq	16(%rdi), %rcx
	movl	%eax, (%rcx,%r12,4)
	movl	(%rdx), %eax
	movl	(%r14), %ecx
	cltd
	idivl	%ecx
	testl	%eax, %eax
	jle	LBB0_11
## %bb.8:
	movl	%eax, %r15d
	leaq	4(,%r12,4), %r12
	decl	%r15d
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	imull	%r14d, %ecx
	movslq	%ecx, %rbx
	shlq	$2, %rbx
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rbx
	movq	%rbx, %rdi
	callq	_vmalloc_to_page
	movl	%eax, %edi
	callq	_page_to_phys
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_offset_in_page
	addl	%r13d, %eax
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	16(%rdi), %rcx
	addq	%r12, %rcx
	movl	%eax, (%rcx,%r14,4)
	cmpl	%r14d, %r15d
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	_EP_BUFFER_INFO_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	incq	%r14
	jmp	LBB0_9
LBB0_11:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	$0, (%r15)
	movl	$0, 24(%r15)
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_trace_fjes_hw_register_buff_addr_req
	movq	_FJES_CMD_REQ_SHARE_BUFFER@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_fjes_hw_issue_request_command
	movq	_FJES_COMMAND_REQ_BUFF_TIMEOUT@GOTPCREL(%rip), %rcx
	imull	$1000, (%rcx), %ebx             ## imm = 0x3E8
	movl	%eax, %r14d
	movq	_FJES_CMD_STATUS_NORMAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_19
## %bb.12:
	movq	(%r15), %rax
	movq	_FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	jne	LBB0_18
## %bb.13:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$133, 24(%r15)
	jne	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	testl	%ebx, %ebx
	jle	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movl	(%r14), %eax
	leal	(%rax,%rax,4), %eax
	leal	200(,%rax,4), %edi
	callq	_msleep
	movl	(%r14), %eax
	shll	$2, %eax
	leal	(%rax,%rax,4), %eax
	subl	%eax, %ebx
	addl	$-200, %ebx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	$0, (%r15)
	movl	$0, 24(%r15)
	movl	(%r12), %esi
	movq	%r14, %rdi
	callq	_fjes_hw_issue_request_command
	movl	%eax, %r14d
	movq	_FJES_CMD_STATUS_NORMAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_19
## %bb.17:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	(%r15), %rax
	cmpq	(%r13), %rax
	je	LBB0_14
	jmp	LBB0_19
LBB0_18:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_19:
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_trace_fjes_hw_register_buff_addr
	movq	(%r15), %rax
	movq	_FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_24
## %bb.20:
	movq	_FJES_CMD_STATUS_NORMAL@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_25
## %bb.21:
	movl	24(%r15), %eax
	cmpl	$133, %eax
	je	LBB0_28
## %bb.22:
	cmpl	$132, %eax
	jne	LBB0_27
## %bb.23:
	movl	-68(%rbp), %edi                 ## 4-byte Reload
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	callq	_set_bit
	xorl	%eax, %eax
	jmp	LBB0_32
LBB0_24:
	leaq	L_.str(%rip), %rdi
	callq	_trace_fjes_hw_register_buff_addr_err
	movq	_ENOMSG@GOTPCREL(%rip), %rcx
	jmp	LBB0_31
LBB0_25:
	cmpl	$129, %r14d
	je	LBB0_29
## %bb.26:
	cmpl	$128, %r14d
LBB0_27:
	movq	_EPERM@GOTPCREL(%rip), %rcx
	jmp	LBB0_31
LBB0_28:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_30
LBB0_29:
	leaq	L_.str.2(%rip), %rdi
LBB0_30:
	callq	_trace_fjes_hw_register_buff_addr_err
	movq	_EBUSY@GOTPCREL(%rip), %rcx
LBB0_31:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_32:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EP_BUFFER_INFO_SIZE,4,2        ## @EP_BUFFER_INFO_SIZE
	.comm	_FJES_CMD_REQ_SHARE_BUFFER,4,2  ## @FJES_CMD_REQ_SHARE_BUFFER
	.comm	_FJES_COMMAND_REQ_BUFF_TIMEOUT,4,2 ## @FJES_COMMAND_REQ_BUFF_TIMEOUT
	.comm	_FJES_CMD_STATUS_NORMAL,4,2     ## @FJES_CMD_STATUS_NORMAL
	.comm	_FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN,8,3 ## @FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid res_buf"

	.comm	_ENOMSG,4,2                     ## @ENOMSG
L_.str.1:                               ## @.str.1
	.asciz	"Busy Timeout"

	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EPERM,4,2                      ## @EPERM
L_.str.2:                               ## @.str.2
	.asciz	"Timeout"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fjes_hw_register_buff_addr     ; -- Begin function fjes_hw_register_buff_addr
	.p2align	2
_fjes_hw_register_buff_addr:            ; @fjes_hw_register_buff_addr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x2
	mov	x20, x1
	mov	x22, x0
	add	x19, x0, #8
	ldp	x21, x24, [x0, #24]
	mov	x0, x1
	mov	x1, x19
	bl	_test_bit
	cbz	x0, LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_31
LBB0_2:
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	ldr	w2, [x22, #16]
	mov	x0, x24
	mov	w1, #0
	bl	_memset
	ldr	w2, [x22, #12]
	mov	x0, x21
	mov	w1, #0
	bl	_memset
	ldr	w0, [x23, #16]
	ldr	w1, [x23]
	bl	_FJES_DEV_COMMAND_SHARE_BUFFER_REQ_LEN
	str	x0, [x24]
	str	w20, [x24, #8]
	ldr	w8, [x23, #16]
	ldr	x9, [x24, #16]
	str	w8, [x9]
	ldr	w8, [x23, #16]
Lloh0:
	adrp	x27, _EP_BUFFER_INFO_SIZE@GOTPAGE
Lloh1:
	ldr	x27, [x27, _EP_BUFFER_INFO_SIZE@GOTPAGEOFF]
	ldr	w9, [x27]
	sdiv	w19, w8, w9
	cmp	w19, #1
	str	w20, [sp, #20]                  ; 4-byte Folded Spill
	str	x21, [sp, #24]                  ; 8-byte Folded Spill
	b.lt	LBB0_5
; %bb.3:
	ldr	x25, [x23, #24]
	mov	x0, x25
	bl	_vmalloc_to_page
	bl	_page_to_phys
	mov	x26, x0
	mov	x0, x25
	bl	_offset_in_page
	add	w8, w0, w26
	ldr	x9, [x24, #16]
	str	w8, [x9, #4]
	cmp	w19, #1
	b.ne	LBB0_6
; %bb.4:
	mov	w28, #2
	b	LBB0_8
LBB0_5:
	mov	w28, #1
	b	LBB0_8
LBB0_6:
	neg	w20, w19
	mov	w19, #2
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	sub	w8, w19, #1
	ldr	w9, [x27]
	ldr	x10, [x23, #24]
	mul	w8, w9, w8
	add	x25, x10, w8, sxtw #2
	mov	x0, x25
	bl	_vmalloc_to_page
	bl	_page_to_phys
	mov	x26, x0
	mov	x0, x25
	bl	_offset_in_page
	add	w8, w0, w26
	ldr	x9, [x24, #16]
	add	x28, x19, #1
	str	w8, [x9, x19, lsl #2]
	add	w8, w20, w28
	mov	x19, x28
	cmp	w8, #1
	b.ne	LBB0_7
LBB0_8:
	ldr	w8, [x23]
	ldr	x9, [x24, #16]
	str	w8, [x9, x28, lsl #2]
	ldr	w8, [x23]
	ldr	w9, [x27]
	sdiv	w19, w8, w9
	cmp	w19, #1
	b.lt	LBB0_12
; %bb.9:
	ldr	x25, [x23, #8]
	mov	x0, x25
	bl	_vmalloc_to_page
	bl	_page_to_phys
	mov	x26, x0
	mov	x0, x25
	bl	_offset_in_page
	add	w8, w0, w26
	ldr	x9, [x24, #16]
	add	x9, x9, x28, lsl #2
	str	w8, [x9, #4]
	subs	w20, w19, #1
	b.eq	LBB0_12
; %bb.10:
	mov	x19, #0
	lsl	x8, x28, #2
	add	x28, x8, #8
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x21, x19, #1
	ldr	w8, [x27]
	ldr	x9, [x23, #8]
	mul	w8, w8, w21
	add	x25, x9, w8, sxtw #2
	mov	x0, x25
	bl	_vmalloc_to_page
	bl	_page_to_phys
	mov	x26, x0
	mov	x0, x25
	bl	_offset_in_page
	add	w8, w0, w26
	ldr	x9, [x24, #16]
	add	x9, x9, x28
	str	w8, [x9, x19, lsl #2]
	mov	x19, x21
	cmp	w20, w21
	b.ne	LBB0_11
LBB0_12:
	ldr	x19, [sp, #24]                  ; 8-byte Folded Reload
	str	xzr, [x19]
	str	wzr, [x19, #24]
	mov	x0, x24
	mov	x1, x23
	bl	_trace_fjes_hw_register_buff_addr_req
Lloh2:
	adrp	x27, _FJES_CMD_REQ_SHARE_BUFFER@GOTPAGE
Lloh3:
	ldr	x27, [x27, _FJES_CMD_REQ_SHARE_BUFFER@GOTPAGEOFF]
	ldr	w1, [x27]
	mov	x0, x22
	bl	_fjes_hw_issue_request_command
	mov	x23, x0
Lloh4:
	adrp	x8, _FJES_COMMAND_REQ_BUFF_TIMEOUT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _FJES_COMMAND_REQ_BUFF_TIMEOUT@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	mov	w9, #1000
	mul	w24, w8, w9
Lloh7:
	adrp	x25, _FJES_CMD_STATUS_NORMAL@GOTPAGE
Lloh8:
	ldr	x25, [x25, _FJES_CMD_STATUS_NORMAL@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh9:
	adrp	x26, _FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN@GOTPAGE
Lloh10:
	ldr	x26, [x26, _FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN@GOTPAGEOFF]
	cmp	w0, w8
	b.ne	LBB0_18
; %bb.13:
	ldr	x8, [x19]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.14:
	mov	w28, #20
	mov	w20, #-20
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x19, #24]
	cmp	w8, #133
	ccmp	w24, #1, #8, eq
	b.lt	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x22]
	mul	w8, w8, w28
	add	w0, w8, #200
	bl	_msleep
	ldr	w8, [x22]
	madd	w8, w8, w20, w24
	sub	w24, w8, #200
	str	xzr, [x19]
	str	wzr, [x19, #24]
	ldr	w1, [x27]
	mov	x0, x22
	bl	_fjes_hw_issue_request_command
	mov	x23, x0
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	x8, [x19]
	ldr	x9, [x26]
	cmp	x8, x9
	b.eq	LBB0_15
LBB0_18:
	mov	x0, x19
	mov	x1, x24
	bl	_trace_fjes_hw_register_buff_addr
	ldr	x8, [x19]
	ldr	x9, [x26]
	cmp	x8, x9
	b.ne	LBB0_23
; %bb.19:
	ldr	w8, [x25]
	cmp	w23, w8
	b.ne	LBB0_24
; %bb.20:
	ldr	w8, [x19, #24]
	cmp	w8, #133
	b.eq	LBB0_27
; %bb.21:
	cmp	w8, #132
	b.ne	LBB0_26
; %bb.22:
	ldr	w0, [sp, #20]                   ; 4-byte Folded Reload
	ldr	x1, [sp, #8]                    ; 8-byte Folded Reload
	bl	_set_bit
	mov	w0, #0
	b	LBB0_31
LBB0_23:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_trace_fjes_hw_register_buff_addr_err
Lloh13:
	adrp	x8, _ENOMSG@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMSG@GOTPAGEOFF]
	b	LBB0_30
LBB0_24:
	cmp	w23, #129
	b.eq	LBB0_28
; %bb.25:
	cmp	w23, #128
LBB0_26:
Lloh15:
	adrp	x8, _EPERM@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
	b	LBB0_30
LBB0_27:
Lloh17:
	adrp	x0, l_.str.1@PAGE
Lloh18:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_29
LBB0_28:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_29:
	bl	_trace_fjes_hw_register_buff_addr_err
Lloh21:
	adrp	x8, _EBUSY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_30:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_31:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EP_BUFFER_INFO_SIZE,4,2        ; @EP_BUFFER_INFO_SIZE
	.comm	_FJES_CMD_REQ_SHARE_BUFFER,4,2  ; @FJES_CMD_REQ_SHARE_BUFFER
	.comm	_FJES_COMMAND_REQ_BUFF_TIMEOUT,4,2 ; @FJES_COMMAND_REQ_BUFF_TIMEOUT
	.comm	_FJES_CMD_STATUS_NORMAL,4,2     ; @FJES_CMD_STATUS_NORMAL
	.comm	_FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN,8,3 ; @FJES_DEV_COMMAND_SHARE_BUFFER_RES_LEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid res_buf"

	.comm	_ENOMSG,4,2                     ; @ENOMSG
l_.str.1:                               ; @.str.1
	.asciz	"Busy Timeout"

	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EPERM,4,2                      ; @EPERM
l_.str.2:                               ; @.str.2
	.asciz	"Timeout"

.subsections_via_symbols
