	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_create_hdev                    ## -- Begin function create_hdev
	.p2align	4, 0x90
_create_hdev:                           ## @create_hdev
	.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	%edx, %r12d
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	$0, (%rdi)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r13
	testq	%r15, %r15
	je	LBB0_5
## %bb.3:
	movl	4(%r15), %edi
	callq	_get_asic_type
	movq	%rax, (%r13)
	movq	_ASIC_INVALID@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.4:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %r14
	jmp	LBB0_18
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_19
LBB0_5:
	movl	%r12d, %eax
	movq	%rax, (%r13)
LBB0_6:
	movq	_hl_major@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r13)
	movq	_reset_on_lockup@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r13)
	movq	$0, 40(%r13)
	movq	%r13, %rdi
	callq	_set_driver_behavior_per_device
	movq	_timeout_locked@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	imull	$1000, %eax, %edi               ## imm = 0x3E8
	callq	_msecs_to_jiffies
	jmp	LBB0_9
LBB0_8:
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	movl	%eax, 32(%r13)
	movabsq	$137438953473, %rax             ## imm = 0x2000000001
	movq	%rax, 8(%r13)
	movq	%r15, 24(%r13)
	movq	_hl_devs_idr_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_HL_MAX_MINORS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	(%rbx), %r8d
	movq	_hl_devs_idr@GOTPCREL(%rip), %rdi
	xorl	%r12d, %r12d
	movq	%r13, %rsi
	xorl	%edx, %edx
	callq	_idr_alloc
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_11
## %bb.10:
	leal	1(%r15), %edx
	leal	2(%r15), %ecx
	movl	(%rbx), %r8d
	movq	_hl_devs_idr@GOTPCREL(%rip), %rdi
	movq	%r13, %rsi
	callq	_idr_alloc
	movl	%eax, %r12d
LBB0_11:
	movq	_hl_devs_idr_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	testl	%r15d, %r15d
	js	LBB0_13
## %bb.12:
	testl	%r12d, %r12d
	js	LBB0_13
## %bb.20:
	movl	%r15d, 16(%r13)
	movl	%r12d, 20(%r13)
	movq	%r13, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_19
LBB0_13:
	movq	_ENOSPC@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	cmpl	%eax, %r15d
	je	LBB0_15
## %bb.14:
	cmpl	%eax, %r12d
	jne	LBB0_16
LBB0_15:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_err
LBB0_16:
	movq	_EBUSY@GOTPCREL(%rip), %r14
	testl	%r15d, %r15d
	js	LBB0_18
## %bb.17:
	movq	_hl_devs_idr_lock@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_hl_devs_idr@GOTPCREL(%rip), %rdi
	movl	%r15d, %esi
	callq	_idr_remove
	movq	%rbx, %rdi
	callq	_mutex_unlock
LBB0_18:
	xorl	%ebx, %ebx
	subl	(%r14), %ebx
	movq	%r13, %rdi
	callq	_kfree
LBB0_19:
	movl	%ebx, %eax
	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
	.comm	_ASIC_INVALID,8,3               ## @ASIC_INVALID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported ASIC\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_hl_major,4,2                   ## @hl_major
	.comm	_reset_on_lockup,4,2            ## @reset_on_lockup
	.comm	_timeout_locked,4,2             ## @timeout_locked
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ## @MAX_SCHEDULE_TIMEOUT
	.comm	_hl_devs_idr_lock,4,2           ## @hl_devs_idr_lock
	.comm	_hl_devs_idr,4,2                ## @hl_devs_idr
	.comm	_HL_MAX_MINORS,4,2              ## @HL_MAX_MINORS
	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.1:                               ## @.str.1
	.asciz	"too many devices in the system\n"

	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function create_hdev
lCPI0_0:
	.long	1                               ; 0x1
	.long	32                              ; 0x20
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_create_hdev
	.p2align	2
_create_hdev:                           ; @create_hdev
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x22, x2
	mov	x21, x1
	mov	x20, x0
	str	xzr, [x0]
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x19, x0
	cbz	x21, LBB0_5
; %bb.2:
	ldr	w0, [x21, #4]
	bl	_get_asic_type
	str	x0, [x19]
Lloh2:
	adrp	x8, _ASIC_INVALID@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ASIC_INVALID@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_6
; %bb.3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_err
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_21
LBB0_4:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_22
LBB0_5:
	mov	w8, w22
	str	x8, [x19]
LBB0_6:
Lloh12:
	adrp	x8, _hl_major@GOTPAGE
Lloh13:
	ldr	x8, [x8, _hl_major@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, _reset_on_lockup@GOTPAGE
Lloh16:
	ldr	x9, [x9, _reset_on_lockup@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #48]
	str	xzr, [x19, #40]
	mov	x0, x19
	bl	_set_driver_behavior_per_device
Lloh18:
	adrp	x8, _timeout_locked@GOTPAGE
Lloh19:
	ldr	x8, [x8, _timeout_locked@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cbz	w8, LBB0_8
; %bb.7:
	mov	w9, #1000
	mul	w0, w8, w9
	bl	_msecs_to_jiffies
	b	LBB0_9
LBB0_8:
Lloh21:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
LBB0_9:
	str	w0, [x19, #32]
	str	x21, [x19, #24]
Lloh24:
	adrp	x8, lCPI0_0@PAGE
Lloh25:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19, #8]
Lloh26:
	adrp	x0, _hl_devs_idr_lock@GOTPAGE
Lloh27:
	ldr	x0, [x0, _hl_devs_idr_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh28:
	adrp	x8, _HL_MAX_MINORS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _HL_MAX_MINORS@GOTPAGEOFF]
Lloh30:
	ldr	w3, [x8]
	ldr	w4, [x23]
Lloh31:
	adrp	x0, _hl_devs_idr@GOTPAGE
Lloh32:
	ldr	x0, [x0, _hl_devs_idr@GOTPAGEOFF]
	mov	x1, x19
	mov	w2, #0
	bl	_idr_alloc
	mov	x21, x0
	tbnz	w0, #31, LBB0_11
; %bb.10:
	add	w2, w21, #1
	add	w3, w21, #2
	ldr	w4, [x23]
Lloh33:
	adrp	x0, _hl_devs_idr@GOTPAGE
Lloh34:
	ldr	x0, [x0, _hl_devs_idr@GOTPAGEOFF]
	mov	x1, x19
	bl	_idr_alloc
	mov	x22, x0
	b	LBB0_12
LBB0_11:
	mov	w22, #0
LBB0_12:
Lloh35:
	adrp	x0, _hl_devs_idr_lock@GOTPAGE
Lloh36:
	ldr	x0, [x0, _hl_devs_idr_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	tbnz	w21, #31, LBB0_15
; %bb.13:
	tbnz	w22, #31, LBB0_15
; %bb.14:
	mov	w23, #0
	stp	w21, w22, [x19, #16]
	str	x19, [x20]
	b	LBB0_22
LBB0_15:
Lloh37:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	cmn	w21, w8
	b.eq	LBB0_17
; %bb.16:
	neg	w8, w8
	cmp	w22, w8
	b.ne	LBB0_18
LBB0_17:
Lloh40:
	adrp	x0, l_.str.1@PAGE
Lloh41:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_err
LBB0_18:
	tbnz	w21, #31, LBB0_20
; %bb.19:
Lloh42:
	adrp	x20, _hl_devs_idr_lock@GOTPAGE
Lloh43:
	ldr	x20, [x20, _hl_devs_idr_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
Lloh44:
	adrp	x0, _hl_devs_idr@GOTPAGE
Lloh45:
	ldr	x0, [x0, _hl_devs_idr@GOTPAGEOFF]
	mov	x1, x21
	bl	_idr_remove
	mov	x0, x20
	bl	_mutex_unlock
LBB0_20:
Lloh46:
	adrp	x8, _EBUSY@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
LBB0_21:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x19
	bl	_kfree
LBB0_22:
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdr	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh46, Lloh47
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_ASIC_INVALID,8,3               ; @ASIC_INVALID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported ASIC\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_hl_major,4,2                   ; @hl_major
	.comm	_reset_on_lockup,4,2            ; @reset_on_lockup
	.comm	_timeout_locked,4,2             ; @timeout_locked
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ; @MAX_SCHEDULE_TIMEOUT
	.comm	_hl_devs_idr_lock,4,2           ; @hl_devs_idr_lock
	.comm	_hl_devs_idr,4,2                ; @hl_devs_idr
	.comm	_HL_MAX_MINORS,4,2              ; @HL_MAX_MINORS
	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.1:                               ; @.str.1
	.asciz	"too many devices in the system\n"

	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
