	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uip_pbuf_alloc                 ## -- Begin function uip_pbuf_alloc
	.p2align	4, 0x90
_uip_pbuf_alloc:                        ## @uip_pbuf_alloc
	.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
                                        ## kill: def $edi killed $edi def $rdi
	addl	$-128, %edi
	cmpl	$7, %edi
	ja	LBB0_16
## %bb.1:
	movl	%edx, %r15d
	movl	%esi, %ebx
	xorl	%r12d, %r12d
	leaq	LJTI0_0(%rip), %rax
	movslq	(%rax,%rdi,4), %rcx
	addq	%rax, %rcx
	jmpq	*%rcx
LBB0_2:
	movq	_UIP_TRANSPORT_HLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_3:
	movq	_UIP_IP_HLEN@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
LBB0_4:
	movq	_UIP_LL_HLEN@GOTPCREL(%rip), %rax
	addl	(%rax), %r12d
LBB0_5:
	leal	-129(%r15), %eax
	cmpl	$2, %eax
	jb	LBB0_13
## %bb.6:
	cmpl	$132, %r15d
	je	LBB0_17
## %bb.7:
	cmpl	$133, %r15d
	jne	LBB0_19
## %bb.8:
	movq	_uip_pool_pbufs@GOTPCREL(%rip), %rdi
	callq	_memb_alloc
	testq	%rax, %rax
	je	LBB0_24
## %bb.9:
	movq	%rax, %r13
	movq	$0, 24(%rax)
	movslq	%r12d, %rax
	leaq	(%rax,%r13), %rdi
	addq	$40, %rdi
	callq	_MEM_ALIGN
	movq	%rax, 32(%r13)
	movl	%ebx, (%r13)
	movq	_UIP_PBUF_POOL_BUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r12d, %eax
	cmpl	%ebx, %eax
	cmovgel	%ebx, %eax
	movl	%eax, 4(%r13)
	movq	_UIP_PBUF_FLAG_POOL@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	%rcx, 16(%r13)
	movl	$1, 8(%r13)
	subl	%eax, %ebx
	jle	LBB0_23
## %bb.10:
	movq	_uip_pool_pbufs@GOTPCREL(%rip), %r15
	movq	%r13, %r14
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_memb_alloc
	testq	%rax, %rax
	je	LBB0_29
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	$0, 24(%rax)
	movq	%rax, 24(%r14)
	movl	%ebx, (%rax)
	movq	_UIP_PBUF_POOL_BUFSIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	%ecx, %ebx
	cmovll	%ebx, %ecx
	movl	%ecx, 4(%rax)
	movq	%rax, %rdx
	addq	$40, %rdx
	movq	%rdx, 32(%rax)
	movq	(%r12), %rdx
	movq	%rdx, 16(%rax)
	movl	$1, 8(%rax)
	movq	%rax, %r14
	subl	%ecx, %ebx
	jg	LBB0_11
	jmp	LBB0_23
LBB0_13:
	movq	_uip_rom_pbufs@GOTPCREL(%rip), %rdi
	callq	_memb_alloc
	testq	%rax, %rax
	je	LBB0_20
## %bb.14:
	movq	%rax, %r13
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rax)
	movl	%ebx, (%rax)
	movl	%ebx, 4(%rax)
	cmpl	$129, %r15d
	jne	LBB0_21
## %bb.15:
	movq	_UIP_PBUF_FLAG_ROM@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_16:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_26
LBB0_17:
	leal	40(%r12), %edi
	callq	_MEM_ALIGN_SIZE
	movq	%rax, %r14
	movl	%ebx, %edi
	callq	_MEM_ALIGN_SIZE
	addq	%rax, %r14
	movq	%r14, %rdi
	callq	_memr_malloc
	testq	%rax, %rax
	je	LBB0_25
## %bb.18:
	movq	%rax, %r13
	movslq	%r12d, %rax
	leaq	(%rax,%r13), %rdi
	addq	$40, %rdi
	callq	_MEM_ALIGN
	movq	%rax, 32(%r13)
	movl	%ebx, (%r13)
	movl	%ebx, 4(%r13)
	movq	$0, 24(%r13)
	movq	_UIP_PBUF_FLAG_RAM@GOTPCREL(%rip), %rax
	jmp	LBB0_22
LBB0_19:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_26
LBB0_20:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_26
LBB0_21:
	movq	_UIP_PBUF_FLAG_REF@GOTPCREL(%rip), %rax
LBB0_22:
	movq	(%rax), %rax
	movq	%rax, 16(%r13)
LBB0_23:
	movl	$1, 8(%r13)
	jmp	LBB0_28
LBB0_24:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_26
LBB0_25:
	leaq	L_.str.3(%rip), %rdi
LBB0_26:
	callq	_UIP_ERROR
LBB0_27:
	xorl	%r13d, %r13d
LBB0_28:
	movq	%r13, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	leaq	L_.str.2(%rip), %rdi
	callq	_UIP_ERROR
	movq	%r13, %rdi
	callq	_uip_pbuf_free
	jmp	LBB0_27
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
.set L0_0_set_3, LBB0_3-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_5
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_4
	.long	L0_0_set_3
	.end_data_region
                                        ## -- End function
	.comm	_UIP_TRANSPORT_HLEN,4,2         ## @UIP_TRANSPORT_HLEN
	.comm	_UIP_IP_HLEN,4,2                ## @UIP_IP_HLEN
	.comm	_UIP_LL_HLEN,4,2                ## @UIP_LL_HLEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"uip_pbuf_alloc: bad pbuf layer.\n"

	.comm	_uip_pool_pbufs,4,2             ## @uip_pool_pbufs
L_.str.1:                               ## @.str.1
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf(p) from pool\n"

	.comm	_UIP_PBUF_POOL_BUFSIZE,4,2      ## @UIP_PBUF_POOL_BUFSIZE
	.comm	_UIP_PBUF_FLAG_POOL,8,3         ## @UIP_PBUF_FLAG_POOL
L_.str.2:                               ## @.str.2
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf(q) from pool\n"

L_.str.3:                               ## @.str.3
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf from ram\n"

	.comm	_UIP_PBUF_FLAG_RAM,8,3          ## @UIP_PBUF_FLAG_RAM
	.comm	_uip_rom_pbufs,4,2              ## @uip_rom_pbufs
L_.str.4:                               ## @.str.4
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf from rom/ref\n"

	.comm	_UIP_PBUF_FLAG_ROM,8,3          ## @UIP_PBUF_FLAG_ROM
	.comm	_UIP_PBUF_FLAG_REF,8,3          ## @UIP_PBUF_FLAG_REF
L_.str.5:                               ## @.str.5
	.asciz	"uip_pbuf_alloc: bad flag value.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_uip_pbuf_alloc                 ; -- Begin function uip_pbuf_alloc
	.p2align	2
_uip_pbuf_alloc:                        ; @uip_pbuf_alloc
	.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
	sub	w10, w0, #128
	cmp	w10, #7
	b.hi	LBB0_15
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	mov	w8, #0
	mov	w9, #0
	mov	w22, #0
Lloh0:
	adrp	x11, lJTI0_0@PAGE
Lloh1:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x12, LBB0_2
	ldrb	w13, [x11, x10]
	add	x12, x12, x13, lsl #2
	br	x12
LBB0_2:
Lloh2:
	adrp	x8, _UIP_TRANSPORT_HLEN@GOTPAGE
Lloh3:
	ldr	x8, [x8, _UIP_TRANSPORT_HLEN@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
LBB0_3:
Lloh5:
	adrp	x9, _UIP_IP_HLEN@GOTPAGE
Lloh6:
	ldr	x9, [x9, _UIP_IP_HLEN@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	add	w9, w9, w8
LBB0_4:
Lloh8:
	adrp	x8, _UIP_LL_HLEN@GOTPAGE
Lloh9:
	ldr	x8, [x8, _UIP_LL_HLEN@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	add	w22, w8, w9
LBB0_5:
	sub	w8, w21, #129
	cmp	w8, #2
	b.lo	LBB0_13
; %bb.6:
	cmp	w21, #132
	b.eq	LBB0_16
; %bb.7:
	cmp	w21, #133
	b.ne	LBB0_20
; %bb.8:
Lloh11:
	adrp	x0, _uip_pool_pbufs@GOTPAGE
Lloh12:
	ldr	x0, [x0, _uip_pool_pbufs@GOTPAGEOFF]
	bl	_memb_alloc
	mov	x19, x0
	cbz	x0, LBB0_24
; %bb.9:
	str	xzr, [x19, #24]
	add	x8, x19, w22, sxtw
	add	x0, x8, #40
	bl	_MEM_ALIGN
	str	x0, [x19, #32]
	str	w20, [x19]
Lloh13:
	adrp	x21, _UIP_PBUF_POOL_BUFSIZE@GOTPAGE
Lloh14:
	ldr	x21, [x21, _UIP_PBUF_POOL_BUFSIZE@GOTPAGEOFF]
	ldr	w8, [x21]
	sub	w8, w8, w22
	cmp	w8, w20
	csel	w8, w8, w20, lt
Lloh15:
	adrp	x22, _UIP_PBUF_FLAG_POOL@GOTPAGE
Lloh16:
	ldr	x22, [x22, _UIP_PBUF_FLAG_POOL@GOTPAGEOFF]
	ldr	x9, [x22]
	str	x9, [x19, #16]
	mov	w23, #1
	stp	w8, w23, [x19, #4]
	sub	w24, w20, w8
	cmp	w24, #1
	b.lt	LBB0_19
; %bb.10:
Lloh17:
	adrp	x20, _uip_pool_pbufs@GOTPAGE
Lloh18:
	ldr	x20, [x20, _uip_pool_pbufs@GOTPAGEOFF]
	mov	x25, x19
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_memb_alloc
	cbz	x0, LBB0_27
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x22]
	str	xzr, [x0, #24]
	str	x0, [x25, #24]
	str	w24, [x0]
	add	x9, x0, #40
	str	x9, [x0, #32]
	ldr	w9, [x21]
	cmp	w24, w9
	csel	w9, w24, w9, lt
	str	x8, [x0, #16]
	stp	w9, w23, [x0, #4]
	sub	w24, w24, w9
	mov	x25, x0
	cmp	w24, #0
	b.gt	LBB0_11
	b	LBB0_19
LBB0_13:
Lloh19:
	adrp	x0, _uip_rom_pbufs@GOTPAGE
Lloh20:
	ldr	x0, [x0, _uip_rom_pbufs@GOTPAGEOFF]
	bl	_memb_alloc
	mov	x19, x0
	cbz	x0, LBB0_23
; %bb.14:
	stp	xzr, xzr, [x19, #24]
Lloh21:
	adrp	x8, _UIP_PBUF_FLAG_ROM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _UIP_PBUF_FLAG_ROM@GOTPAGEOFF]
	stp	w20, w20, [x19]
Lloh23:
	adrp	x9, _UIP_PBUF_FLAG_REF@GOTPAGE
Lloh24:
	ldr	x9, [x9, _UIP_PBUF_FLAG_REF@GOTPAGEOFF]
	cmp	w21, #129
	csel	x8, x8, x9, eq
	b	LBB0_18
LBB0_15:
Lloh25:
	adrp	x0, l_.str@PAGE
Lloh26:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_21
LBB0_16:
	add	w0, w22, #40
	bl	_MEM_ALIGN_SIZE
	mov	x19, x0
	mov	x0, x20
	bl	_MEM_ALIGN_SIZE
	add	x0, x0, x19
	bl	_memr_malloc
	mov	x19, x0
	cbz	x0, LBB0_25
; %bb.17:
	add	x8, x19, w22, sxtw
	add	x0, x8, #40
	bl	_MEM_ALIGN
	stp	w20, w20, [x19]
	stp	xzr, x0, [x19, #24]
Lloh27:
	adrp	x8, _UIP_PBUF_FLAG_RAM@GOTPAGE
Lloh28:
	ldr	x8, [x8, _UIP_PBUF_FLAG_RAM@GOTPAGEOFF]
LBB0_18:
	ldr	x8, [x8]
	str	x8, [x19, #16]
LBB0_19:
	mov	w8, #1
	str	w8, [x19, #8]
	b	LBB0_26
LBB0_20:
Lloh29:
	adrp	x0, l_.str.5@PAGE
Lloh30:
	add	x0, x0, l_.str.5@PAGEOFF
LBB0_21:
	bl	_UIP_ERROR
LBB0_22:
	mov	x19, #0
	b	LBB0_26
LBB0_23:
Lloh31:
	adrp	x0, l_.str.4@PAGE
Lloh32:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_UIP_ERROR
	b	LBB0_26
LBB0_24:
Lloh33:
	adrp	x0, l_.str.1@PAGE
Lloh34:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_UIP_ERROR
	b	LBB0_26
LBB0_25:
Lloh35:
	adrp	x0, l_.str.3@PAGE
Lloh36:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_UIP_ERROR
LBB0_26:
	mov	x0, x19
	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
LBB0_27:
Lloh37:
	adrp	x0, l_.str.2@PAGE
Lloh38:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_UIP_ERROR
	mov	x0, x19
	bl	_uip_pbuf_free
	b	LBB0_22
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
	.byte	(LBB0_15-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
                                        ; -- End function
	.comm	_UIP_TRANSPORT_HLEN,4,2         ; @UIP_TRANSPORT_HLEN
	.comm	_UIP_IP_HLEN,4,2                ; @UIP_IP_HLEN
	.comm	_UIP_LL_HLEN,4,2                ; @UIP_LL_HLEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"uip_pbuf_alloc: bad pbuf layer.\n"

	.comm	_uip_pool_pbufs,4,2             ; @uip_pool_pbufs
l_.str.1:                               ; @.str.1
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf(p) from pool\n"

	.comm	_UIP_PBUF_POOL_BUFSIZE,4,2      ; @UIP_PBUF_POOL_BUFSIZE
	.comm	_UIP_PBUF_FLAG_POOL,8,3         ; @UIP_PBUF_FLAG_POOL
l_.str.2:                               ; @.str.2
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf(q) from pool\n"

l_.str.3:                               ; @.str.3
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf from ram\n"

	.comm	_UIP_PBUF_FLAG_RAM,8,3          ; @UIP_PBUF_FLAG_RAM
	.comm	_uip_rom_pbufs,4,2              ; @uip_rom_pbufs
l_.str.4:                               ; @.str.4
	.asciz	"uip_pbuf_alloc: couldn't allocate pbuf from rom/ref\n"

	.comm	_UIP_PBUF_FLAG_ROM,8,3          ; @UIP_PBUF_FLAG_ROM
	.comm	_UIP_PBUF_FLAG_REF,8,3          ; @UIP_PBUF_FLAG_REF
l_.str.5:                               ; @.str.5
	.asciz	"uip_pbuf_alloc: bad flag value.\n"

.subsections_via_symbols
