	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpi_read_from_buffer           ## -- Begin function mpi_read_from_buffer
	.p2align	4, 0x90
_mpi_read_from_buffer:                  ## @mpi_read_from_buffer
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r13
	movq	_MPI_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	xorl	%ebx, %ebx
	cmpl	$2, (%rsi)
	jb	LBB0_17
## %bb.1:
	movq	%rdi, %r12
	movl	(%rdi), %r14d
	shll	$8, %r14d
	orl	4(%rdi), %r14d
	movq	_MAX_EXTERN_MPI_BITS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jbe	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	xorl	%ebx, %ebx
	movl	%r14d, %esi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_17
LBB0_3:
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	leal	7(%r14), %ebx
	shrl	$3, %ebx
	movq	_BYTES_PER_MPI_LIMB@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	(%rbx,%rcx), %eax
	decl	%eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %r13d
	movl	%eax, %edi
	callq	_mpi_alloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %r15
	movq	_BYTES_PER_MPI_LIMB@GOTPCREL(%rip), %r8
	movl	(%r8), %ecx
	movl	%r14d, (%rax)
	movl	%r13d, 4(%rax)
	movq	$0, 16(%rax)
	testl	%r13d, %r13d
	jle	LBB0_6
## %bb.7:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%ecx, %eax
	subl	%edx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %eax
	addq	$8, %r12
	movl	%r13d, %ecx
	movl	$2, %ebx
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_11 Depth 2
	movl	(%r8), %esi
	cmpl	%esi, %eax
	jae	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %edx
	leal	(%rbx,%rsi), %edi
	subl	%eax, %edi
	incl	%ebx
	subl	%eax, %esi
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_11:                                ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%edx, %ebx
	ja	LBB0_12
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=2
	shll	$8, %eax
	orl	(%r12), %eax
	addq	$4, %r12
	incl	%ebx
	decl	%esi
	jne	LBB0_11
## %bb.14:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%edi, %ebx
	jmp	LBB0_15
LBB0_9:                                 ##   in Loop: Header=BB0_8 Depth=1
	xorl	%eax, %eax
LBB0_15:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	8(%r15), %rdx
	decl	%r13d
	movl	%eax, (%rdx,%r13,4)
	leaq	-1(%rcx), %rdx
	xorl	%eax, %eax
	cmpq	$1, %rcx
	movq	%rdx, %rcx
	jg	LBB0_8
	jmp	LBB0_16
LBB0_4:
	movq	_MPI_NULL@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	jmp	LBB0_18
LBB0_12:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_printk
	jmp	LBB0_16
LBB0_6:
	movl	$2, %ebx
LBB0_16:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
LBB0_17:
	movl	%ebx, (%r13)
LBB0_18:
	movq	%r15, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_MPI_NULL,8,3                   ## @MPI_NULL
	.comm	_MAX_EXTERN_MPI_BITS,4,2        ## @MAX_EXTERN_MPI_BITS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MPI: mpi too large (%u bits)\n"

	.comm	_BYTES_PER_MPI_LIMB,4,2         ## @BYTES_PER_MPI_LIMB
L_.str.1:                               ## @.str.1
	.asciz	"MPI: mpi larger than buffer nread=%d ret_nread=%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mpi_read_from_buffer           ; -- Begin function mpi_read_from_buffer
	.p2align	2
_mpi_read_from_buffer:                  ; @mpi_read_from_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x1
Lloh0:
	adrp	x25, _MPI_NULL@GOTPAGE
Lloh1:
	ldr	x25, [x25, _MPI_NULL@GOTPAGEOFF]
	ldr	x20, [x25]
	ldr	w8, [x1]
	cmp	w8, #2
	b.hs	LBB0_2
; %bb.1:
	mov	w22, #0
	b	LBB0_17
LBB0_2:
	mov	x22, x0
	ldp	w8, w9, [x0]
	orr	w23, w9, w8, lsl #8
Lloh2:
	adrp	x8, _MAX_EXTERN_MPI_BITS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_EXTERN_MPI_BITS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ls	LBB0_4
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x23
	bl	_printk
	mov	w22, #0
	b	LBB0_17
LBB0_4:
	add	w8, w23, #7
	lsr	w26, w8, #3
Lloh7:
	adrp	x24, _BYTES_PER_MPI_LIMB@GOTPAGE
Lloh8:
	ldr	x24, [x24, _BYTES_PER_MPI_LIMB@GOTPAGEOFF]
	ldr	w8, [x24]
	add	w9, w26, w8
	sub	w9, w9, #1
	udiv	w21, w9, w8
	mov	x0, x21
	bl	_mpi_alloc
	cbz	x0, LBB0_14
; %bb.5:
	mov	x20, x0
	ldr	w8, [x24]
	stp	w23, w21, [x0]
	str	xzr, [x0, #16]
	cmp	w21, #1
	b.lt	LBB0_16
; %bb.6:
	udiv	w9, w26, w8
	neg	w10, w26
	madd	w9, w9, w8, w10
	add	w9, w8, w9
	udiv	w10, w9, w8
	msub	w11, w10, w8, w9
	add	x8, x22, #8
	mov	w22, #2
	mov	x9, x21
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	ldr	w14, [x24]
	cmp	w11, w14
	b.hs	LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w10, #0
	ldr	w12, [x19]
	add	w13, w22, w14
	sub	w13, w13, w11
	add	w22, w22, #1
	sub	w11, w14, w11
LBB0_9:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w22, w12
	b.hi	LBB0_15
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w14, [x8], #4
	orr	w10, w14, w10, lsl #8
	add	w22, w22, #1
	subs	w11, w11, #1
	b.ne	LBB0_9
; %bb.11:                               ;   in Loop: Header=BB0_7 Depth=1
	mov	x22, x13
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w10, #0
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w11, #0
	ldr	x12, [x20, #8]
	sub	w21, w21, #1
	str	w10, [x12, w21, uxtw #2]
	subs	x9, x9, #1
	b.gt	LBB0_7
	b	LBB0_17
LBB0_14:
	ldr	x20, [x25]
	b	LBB0_18
LBB0_15:
	str	x12, [sp]
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x22
	bl	_printk
	b	LBB0_17
LBB0_16:
	mov	w22, #2
LBB0_17:
	str	w22, [x19]
LBB0_18:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_MPI_NULL,8,3                   ; @MPI_NULL
	.comm	_MAX_EXTERN_MPI_BITS,4,2        ; @MAX_EXTERN_MPI_BITS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MPI: mpi too large (%u bits)\n"

	.comm	_BYTES_PER_MPI_LIMB,4,2         ; @BYTES_PER_MPI_LIMB
l_.str.1:                               ; @.str.1
	.asciz	"MPI: mpi larger than buffer nread=%d ret_nread=%d\n"

.subsections_via_symbols
