	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_buffer_alloc               ## -- Begin function drm_buffer_alloc
	.p2align	4, 0x90
_drm_buffer_alloc:                      ## @drm_buffer_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
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	%esi, %eax
	cltd
	idivl	(%rcx)
	movl	%eax, %ebx
	leal	1(%rbx), %r12d
	leal	24(,%rbx,8), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	callq	_kzalloc
	movq	%rax, (%r15)
	testq	%rax, %rax
	je	LBB0_6
## %bb.1:
	movl	%r14d, (%rax)
	xorl	%eax, %eax
	testl	%ebx, %ebx
	js	LBB0_13
## %bb.2:
	movl	%r12d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, %r12d
	negq	%r12
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leal	-1(%rbx), %eax
	imull	%edi, %eax
	movl	%r14d, %esi
	subl	%eax, %esi
	callq	_min
	movl	(%r13), %esi
	movl	%eax, %edi
	callq	_kmalloc
	movq	(%r15), %rcx
	movq	8(%rcx), %rcx
	movq	%rax, -8(%rcx,%rbx,8)
	movq	(%r15), %rax
	movq	8(%rax), %rax
	cmpq	$0, -8(%rax,%rbx,8)
	je	LBB0_7
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	(%r12,%rbx), %rax
	incq	%rax
	incq	%rbx
	cmpq	$1, %rax
	jne	LBB0_3
## %bb.5:
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_6:
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_DRM_ERROR
	xorl	%eax, %eax
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	(%r15), %rax
	movq	8(%rax), %rax
	movq	-8(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_9
## %bb.8:
	callq	_kfree
LBB0_9:
	cmpl	$1, %ebx
	je	LBB0_11
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rax
	movq	8(%rax), %rax
	movq	-16(%rax,%rbx,8), %rdi
	callq	_kfree
	decq	%rbx
	cmpq	$1, %rbx
	jg	LBB0_10
LBB0_11:
	movq	(%r15), %rdi
	callq	_kfree
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
LBB0_12:
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to allocate drm buffer object to hold %d bytes in %d pages.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Failed to allocate %dth page for drm buffer with %d bytes and %d pages.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_buffer_alloc               ; -- Begin function drm_buffer_alloc
	.p2align	2
_drm_buffer_alloc:                      ; @drm_buffer_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w8, [x23]
	sdiv	w22, w1, w8
	add	w21, w22, #1
	lsl	w8, w21, #3
	add	w0, w8, #16
Lloh2:
	adrp	x24, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x24, [x24, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x24]
	bl	_kzalloc
	str	x0, [x19]
	cbz	x0, LBB0_6
; %bb.1:
	str	w20, [x0]
	tbnz	w22, #31, LBB0_5
; %bb.2:
	mov	x22, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	msub	w1, w0, w22, w20
	bl	_min
	ldr	w1, [x24]
	bl	_kmalloc
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	lsl	x9, x22, #3
	str	x0, [x8, x9]
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	cmp	x21, x22
	b.ne	LBB0_3
LBB0_5:
	mov	w0, #0
	b	LBB0_14
LBB0_6:
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	mov	x2, x21
	bl	_DRM_ERROR
	b	LBB0_13
LBB0_7:
	add	w1, w22, #1
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	str	x21, [sp]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_DRM_ERROR
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	ldr	x0, [x8, x22, lsl #3]
	cbz	x0, LBB0_9
; %bb.8:
	bl	_kfree
LBB0_9:
	cbz	w22, LBB0_12
; %bb.10:
	sub	x20, x22, #1
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	ldr	x0, [x8, x20, lsl #3]
	bl	_kfree
	add	x8, x20, #1
	sub	x20, x20, #1
	cmp	x8, #1
	b.gt	LBB0_11
LBB0_12:
	ldr	x0, [x19]
	bl	_kfree
LBB0_13:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to allocate drm buffer object to hold %d bytes in %d pages.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Failed to allocate %dth page for drm buffer with %d bytes and %d pages.\n"

.subsections_via_symbols
