	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_agp_create_segment             ## -- Begin function agp_create_segment
	.p2align	4, 0x90
_agp_create_segment:                    ## @agp_create_segment
	.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, %r15
	movq	%rdi, %r14
	movl	(%rsi), %eax
	shll	$2, %eax
	leal	(%rax,%rax,2), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	8(%r15), %rbx
	cmpl	$0, (%r15)
	je	LBB0_6
## %bb.3:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	$8, %r14d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx,%r14), %eax
	movl	%eax, (%r12,%r14)
	movl	-4(%rbx,%r14), %eax
	movl	%eax, -4(%r12,%r14)
	movl	-8(%rbx,%r14), %edi
	callq	_agp_convert_mmap_flags
	movl	%eax, -8(%r12,%r14)
	incq	%r13
	movslq	(%r15), %rax
	addq	$12, %r14
	cmpq	%rax, %r13
	jb	LBB0_4
## %bb.5:
	movq	8(%r15), %rbx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
LBB0_6:
	movq	%rbx, %rdi
	callq	_kfree
	movq	$0, 8(%r15)
	movl	(%r13), %esi
	movl	$8, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.9:
	movq	%r12, (%rax)
	movslq	(%r15), %rdx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_agp_add_seg_to_client
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_1:
	movq	8(%r15), %rdi
	callq	_kfree
	movq	$0, 8(%r15)
	jmp	LBB0_8
LBB0_7:
	movq	%r12, %rdi
	callq	_kfree
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_agp_create_segment             ; -- Begin function agp_create_segment
	.p2align	2
_agp_create_segment:                    ; @agp_create_segment
	.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, x1
	mov	x20, x0
	ldr	w8, [x1]
	add	w8, w8, w8, lsl #1
	lsl	w0, w8, #2
Lloh0:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x22]
	bl	_kzalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x21, x0
	ldr	x0, [x19, #8]
	ldr	w8, [x19]
	cbz	w8, LBB0_5
; %bb.2:
	mov	x23, #0
	add	x24, x0, #4
	add	x25, x21, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	d0, [x24]
	str	d0, [x25]
	ldur	w0, [x24, #-4]
	bl	_agp_convert_mmap_flags
	stur	w0, [x25, #-4]
	add	x23, x23, #1
	ldrsw	x8, [x19]
	add	x24, x24, #12
	add	x25, x25, #12
	cmp	x23, x8
	b.lo	LBB0_3
; %bb.4:
	ldr	x0, [x19, #8]
LBB0_5:
	bl	_kfree
	str	xzr, [x19, #8]
	ldr	w1, [x22]
	mov	w0, #8
	bl	_kmalloc
	cbz	x0, LBB0_8
; %bb.6:
	mov	x1, x0
	str	x21, [x0]
	ldrsw	x2, [x19]
	mov	x0, x20
	bl	_agp_add_seg_to_client
	mov	w0, #0
	b	LBB0_10
LBB0_7:
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
	b	LBB0_9
LBB0_8:
	mov	x0, x21
	bl	_kfree
LBB0_9:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
