	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_get_hang_state_ioctl       ## -- Begin function vc4_get_hang_state_ioctl
	.p2align	4, 0x90
_vc4_get_hang_state_ioctl:              ## @vc4_get_hang_state_ioctl
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r13
	movq	%rdi, %r12
	callq	_to_vc4_dev
	cmpl	$0, 16(%rax)
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_spin_lock_irqsave
	movq	8(%rbx), %r15
	testq	%r15, %r15
	je	LBB0_5
## %bb.2:
	movq	8(%r15), %rax
	cmpq	%rax, (%r13)
	jae	LBB0_7
## %bb.3:
	movq	%rax, (%r13)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%r14d, %r14d
	jmp	LBB0_25
LBB0_4:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_5:
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_6:
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_25
LBB0_7:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%r15), %r12
	movq	$0, 8(%rbx)
	movq	%rbx, %rdi
	callq	_spin_unlock_irqrestore
	movl	8(%r13), %eax
	movl	%eax, 16(%r15)
	movq	%r13, %rdi
	movq	%r12, %rsi
	movl	$16, %edx
	callq	_memcpy
	movq	8(%r15), %rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$16, %esi
	callq	_kcalloc
	movq	%rax, %rbx
	testq	%rax, %rax
	je	LBB0_18
## %bb.8:
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%r12)
	je	LBB0_12
## %bb.9:
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	addq	$12, %r12
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	(%r13), %rax
	movl	(%rax,%r15,4), %edi
	callq	_to_vc4_bo
	movq	%rax, %rbx
	movq	(%r13), %rax
	movl	(%rax,%r15,4), %esi
	movq	%r14, %r13
	movq	%r14, %rdi
	leaq	-88(%rbp), %rdx
	callq	_drm_gem_handle_create
	testl	%eax, %eax
	jne	LBB0_20
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	-88(%rbp), %rax
	movq	%rax, -12(%r12)
	movl	4(%rbx), %eax
	movl	%eax, (%r12)
	movl	(%rbx), %eax
	movl	%eax, -4(%r12)
	incq	%r15
	addq	$16, %r12
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	(%rax), %r15
	movq	%r13, %r14
	jb	LBB0_10
LBB0_12:
	movq	%r14, %r13
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	8(%rax), %edi
	callq	_u64_to_user_ptr
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edx
	shll	$4, %edx
	movl	%eax, %edi
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_copy_to_user
	xorl	%r14d, %r14d
	testq	%rax, %rax
	je	LBB0_22
## %bb.13:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	je	LBB0_24
## %bb.14:
	negl	%eax
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx), %r15
	movl	%eax, %r14d
	testq	%r15, %r15
	jne	LBB0_15
	jmp	LBB0_23
LBB0_18:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_19
LBB0_20:
	movl	%eax, %r14d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%r15, (%rax)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	testq	%r15, %r15
	je	LBB0_23
LBB0_15:
	xorl	%r15d, %r15d
	movq	%r13, %r12
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rsi
	movq	%r12, %rdi
	callq	_drm_gem_handle_delete
	incq	%r15
	addq	$16, %rbx
	cmpq	(%r13), %r15
	jb	LBB0_16
## %bb.17:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
LBB0_19:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	jmp	LBB0_24
LBB0_22:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
LBB0_23:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_24:
	movq	%r15, %rsi
	callq	_vc4_free_hang_state
	movq	%rbx, %rdi
	callq	_kfree
LBB0_25:
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VC4_GET_HANG_STATE with no VC4 V3D probed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_get_hang_state_ioctl       ; -- Begin function vc4_get_hang_state_ioctl
	.p2align	2
_vc4_get_hang_state_ioctl:              ; @vc4_get_hang_state_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x2
	mov	x24, x1
	mov	x19, x0
	bl	_to_vc4_dev
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_4
; %bb.1:
	mov	x22, x0
	bl	_spin_lock_irqsave
	ldr	x20, [x22, #8]
	cbz	x20, LBB0_5
; %bb.2:
	mov	x23, x20
	ldr	x8, [x23, #8]!
	ldr	x9, [x24]
	cmp	x9, x8
	b.hs	LBB0_7
; %bb.3:
	str	x8, [x24]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	mov	w25, #0
	b	LBB0_22
LBB0_4:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh2:
	adrp	x8, _ENODEV@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	mov	x0, x22
	bl	_spin_unlock_irqrestore
Lloh4:
	adrp	x8, _ENOENT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_22
LBB0_7:
	str	xzr, [x22, #8]
	mov	x0, x22
	bl	_spin_unlock_irqrestore
	ldr	w8, [x24, #8]
	str	w8, [x20, #16]
	mov	x0, x24
	mov	x1, x23
	mov	w2, #16
	bl	_memcpy
	ldr	x0, [x20, #8]
Lloh6:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	w1, #16
	bl	_kcalloc
	mov	x22, x0
	cbz	x0, LBB0_15
; %bb.8:
	ldr	x8, [x23]
	cbz	x8, LBB0_12
; %bb.9:
	mov	x27, #0
	add	x28, x22, #8
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	lsl	x25, x27, #2
	ldr	w0, [x8, x25]
	bl	_to_vc4_bo
	mov	x26, x0
	ldr	x8, [x20]
	ldr	w1, [x8, x25]
	add	x2, sp, #8
	mov	x0, x21
	bl	_drm_gem_handle_create
	cbnz	w0, LBB0_17
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	ldr	x8, [sp, #8]
	stur	x8, [x28, #-8]
	ldr	d0, [x26]
	str	d0, [x28], #16
	add	x27, x27, #1
	ldr	x8, [x23]
	cmp	x27, x8
	b.lo	LBB0_10
LBB0_12:
	ldr	w0, [x24, #8]
	bl	_u64_to_user_ptr
	ldr	w8, [x23]
	lsl	w2, w8, #4
	mov	x1, x22
	bl	_copy_to_user
	cbz	x0, LBB0_16
; %bb.13:
Lloh9:
	adrp	x8, _EFAULT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cbz	w8, LBB0_16
; %bb.14:
	neg	w25, w8
	ldr	x27, [x23]
	b	LBB0_18
LBB0_15:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w25, w8
	b	LBB0_21
LBB0_16:
	mov	w25, #0
	b	LBB0_21
LBB0_17:
	mov	x25, x0
	str	x27, [x23]
LBB0_18:
	cbz	x27, LBB0_21
; %bb.19:
	mov	x24, #0
	mov	x26, x22
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x26], #16
	mov	x0, x21
	bl	_drm_gem_handle_delete
	add	x24, x24, #1
	ldr	x8, [x23]
	cmp	x24, x8
	b.lo	LBB0_20
LBB0_21:
	mov	x0, x19
	mov	x1, x20
	bl	_vc4_free_hang_state
	mov	x0, x22
	bl	_kfree
LBB0_22:
	mov	x0, x25
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VC4_GET_HANG_STATE with no VC4 V3D probed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
