	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fman_sp_build_buffer_struct    ## -- Begin function fman_sp_build_buffer_struct
	.p2align	4, 0x90
_fman_sp_build_buffer_struct:           ## @fman_sp_build_buffer_struct
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	.cfi_offset %rbx, -24
	movq	%rdx, %r8
	movl	(%rsi), %r9d
	movq	_OFFSET_UNITS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leal	-1(%rax), %edx
	leal	(%rax,%r9), %ebx
	negl	%eax
	andl	%ebx, %eax
	testl	%r9d, %edx
	cmovel	%r9d, %eax
	movl	%eax, (%rdi)
	movq	_ILLEGAL_BASE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, (%rcx)
	movl	%edx, 4(%rcx)
	movl	%edx, 8(%rcx)
	movq	8(%rsi), %rbx
	xorl	%edx, %edx
	testq	%rbx, %rbx
	setne	%dl
	shll	$5, %edx
	cmpq	$0, 24(%rsi)
	je	LBB0_1
## %bb.3:
	orl	$16, %edx
	movl	%edx, 4(%rdi)
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.6:
	movq	$32, 8(%rdi)
	movl	%eax, (%rcx)
	leal	4(%rax), %edi
	movl	%edi, 4(%rcx)
	movl	$12, %edi
	jmp	LBB0_5
LBB0_1:
	movq	16(%rsi), %r11
	xorl	%r10d, %r10d
	testq	%r11, %r11
	setne	%r10b
	shll	$4, %r10d
	orl	%edx, %r10d
	movl	%r10d, 4(%rdi)
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.7:
	movq	$32, 8(%rdi)
	movl	%eax, (%rcx)
	movl	$12, %edi
	jmp	LBB0_8
LBB0_4:
	movq	$64, 8(%rdi)
	movl	%eax, 4(%rcx)
	movl	$8, %edi
LBB0_5:
	cmpq	$0, 16(%rsi)
	jne	LBB0_9
	jmp	LBB0_11
LBB0_2:
	xorl	%edx, %edx
	testq	%r11, %r11
	setne	%dl
	shlq	$6, %rdx
	movq	%rdx, 8(%rdi)
	movl	$8, %edi
LBB0_8:
	movl	%r10d, %edx
	testq	%r11, %r11
	je	LBB0_10
LBB0_9:
	addl	%eax, %edi
	movl	%edi, 8(%rcx)
	movl	%edx, %r10d
LBB0_10:
	movl	%r10d, %edx
	testl	%r10d, %r10d
	je	LBB0_12
LBB0_11:
	addl	%eax, %edx
	movl	%edx, %r9d
LBB0_12:
	movl	%r9d, (%r8)
	movl	4(%rsi), %esi
	movl	%r9d, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	je	LBB0_14
## %bb.13:
	addl	%r9d, %esi
	subl	%edx, %esi
	movl	%esi, (%r8)
	movl	%esi, %r9d
LBB0_14:
	movl	%r9d, 12(%rcx)
	xorl	%eax, %eax
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OFFSET_UNITS,4,2               ## @OFFSET_UNITS
	.comm	_ILLEGAL_BASE,8,3               ## @ILLEGAL_BASE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fman_sp_build_buffer_struct    ; -- Begin function fman_sp_build_buffer_struct
	.p2align	2
_fman_sp_build_buffer_struct:           ; @fman_sp_build_buffer_struct
	.cfi_startproc
; %bb.0:
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _OFFSET_UNITS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OFFSET_UNITS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w10, w9, #1
	add	w11, w9, w8
	neg	w9, w9
	and	w9, w11, w9
	tst	w10, w8
	csel	w9, w8, w9, eq
	str	w9, [x0]
Lloh3:
	adrp	x10, _ILLEGAL_BASE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _ILLEGAL_BASE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	stp	w10, w10, [x3]
	str	w10, [x3, #8]
	ldr	x11, [x1, #8]
	cmp	x11, #0
	cset	w10, ne
	lsl	w10, w10, #5
	ldr	x12, [x1, #24]
	cbz	x12, LBB0_3
; %bb.1:
	orr	w10, w10, #0x10
	str	w10, [x0, #4]
	cbz	x11, LBB0_6
; %bb.2:
	mov	w11, #32
	str	x11, [x0, #8]
	add	w11, w9, #4
	stp	w9, w11, [x3]
	ldr	x11, [x1, #16]
	cbnz	x11, LBB0_5
	b	LBB0_11
LBB0_3:
	ldr	x12, [x1, #16]
	cmp	x12, #0
	cset	w13, ne
	orr	w10, w10, w13, lsl #4
	str	w10, [x0, #4]
	cbz	x11, LBB0_7
; %bb.4:
	mov	w11, #32
	str	x11, [x0, #8]
	str	w9, [x3]
	cbz	x12, LBB0_10
LBB0_5:
	mov	w11, #12
	b	LBB0_9
LBB0_6:
	mov	w11, #64
	str	x11, [x0, #8]
	str	w9, [x3, #4]
	ldr	x11, [x1, #16]
	cbnz	x11, LBB0_8
	b	LBB0_11
LBB0_7:
	cmp	x12, #0
	cset	w11, ne
	lsl	x11, x11, #6
	str	x11, [x0, #8]
	cbz	x12, LBB0_10
LBB0_8:
	mov	w11, #8
LBB0_9:
	add	w11, w9, w11
	str	w11, [x3, #8]
LBB0_10:
	cbz	w10, LBB0_12
LBB0_11:
	add	w8, w10, w9
LBB0_12:
	str	w8, [x2]
	ldr	w9, [x1, #4]
	sdiv	w10, w8, w9
	msub	w10, w10, w9, w8
	cbz	w10, LBB0_14
; %bb.13:
	add	w8, w9, w8
	sub	w8, w8, w10
	str	w8, [x2]
LBB0_14:
	str	w8, [x3, #12]
	mov	w0, #0
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_OFFSET_UNITS,4,2               ; @OFFSET_UNITS
	.comm	_ILLEGAL_BASE,8,3               ; @ILLEGAL_BASE
.subsections_via_symbols
