	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_roccat_connect                 ## -- Begin function roccat_connect
	.p2align	4, 0x90
_roccat_connect:                        ## @roccat_connect
	.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, %r14d
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$56, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rax, %r12
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	_ROCCAT_MAX_DEVICES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	_devices@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edx
	cmpq	$0, (%rcx,%rdx,8)
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	cmpl	%ebx, %eax
	jne	LBB0_5
LBB0_7:
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_kfree
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movl	%ebx, %eax
LBB0_12:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	%r12, (%rcx,%rbx,8)
	leaq	8(%r15), %r14
	movq	_roccat_major@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_MKDEV
	movq	(%r15), %rcx
	movl	(%rcx), %r10d
	leaq	L_.str(%rip), %r8
	leaq	L_.str.1(%rip), %r9
	movq	%r13, %rdi
	movq	%r14, %rsi
	movl	%eax, %edx
	xorl	%ecx, %ecx
	pushq	%rbx
	pushq	%r10
	callq	_device_create
	addq	$16, %rsp
	movl	%eax, 48(%r12)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	_devices@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%rbx,8)
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	48(%r12), %edi
	callq	_PTR_ERR
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	movl	%ebx, %eax
	jmp	LBB0_12
LBB0_10:
	movq	_devices_lock@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	leaq	44(%r12), %rdi
	callq	_init_waitqueue_head
	leaq	40(%r12), %rdi
	callq	_INIT_LIST_HEAD
	leaq	36(%r12), %rdi
	callq	_mutex_init
	movq	%r12, %rdi
	addq	$32, %rdi
	callq	_mutex_init
	movl	%ebx, (%r12)
	movq	%r15, 24(%r12)
	movl	$1, 4(%r12)
	movq	$0, 16(%r12)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 8(%r12)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_devices_lock,4,2               ## @devices_lock
	.comm	_ROCCAT_MAX_DEVICES,4,2         ## @ROCCAT_MAX_DEVICES
	.comm	_devices,8,3                    ## @devices
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_roccat_major,4,2               ## @roccat_major
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s%s%d"

L_.str.1:                               ## @.str.1
	.asciz	"roccat"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_roccat_connect                 ; -- Begin function roccat_connect
	.p2align	2
_roccat_connect:                        ; @roccat_connect
	.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	x20, x2
	mov	x21, x1
	mov	x23, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #56
	bl	_kzalloc
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x0, _devices_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_lock
Lloh5:
	adrp	x8, _ROCCAT_MAX_DEVICES@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ROCCAT_MAX_DEVICES@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.2:
	mov	x22, #0
Lloh8:
	adrp	x24, _devices@GOTPAGE
Lloh9:
	ldr	x24, [x24, _devices@GOTPAGEOFF]
	ldr	x9, [x24]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, w22, uxtw #3]
	cbz	x10, LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x22, x22, #1
	cmp	w8, w22
	b.ne	LBB0_3
LBB0_5:
Lloh10:
	adrp	x0, _devices_lock@GOTPAGE
Lloh11:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x19
	bl	_kfree
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh14:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	mov	x0, x22
LBB0_9:
	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
LBB0_10:
	str	x19, [x9, x22, lsl #3]
Lloh16:
	adrp	x8, _roccat_major@GOTPAGE
Lloh17:
	ldr	x8, [x8, _roccat_major@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x22
	bl	_MKDEV
	mov	x2, x0
	mov	x1, x21
	ldr	x8, [x1], #8
	ldr	w6, [x8]
Lloh19:
	adrp	x4, l_.str@PAGE
Lloh20:
	add	x4, x4, l_.str@PAGEOFF
Lloh21:
	adrp	x5, l_.str.1@PAGE
Lloh22:
	add	x5, x5, l_.str.1@PAGEOFF
	mov	x0, x23
	mov	x3, #0
	mov	x7, x22
	bl	_device_create
	str	w0, [x19, #48]
	bl	_IS_ERR
	cbz	x0, LBB0_12
; %bb.11:
	ldr	x8, [x24]
	str	xzr, [x8, x22, lsl #3]
Lloh23:
	adrp	x0, _devices_lock@GOTPAGE
Lloh24:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	ldr	w0, [x19, #48]
	bl	_PTR_ERR
	mov	x20, x0
	mov	x0, x19
	bl	_kfree
	mov	x0, x20
	b	LBB0_9
LBB0_12:
Lloh25:
	adrp	x0, _devices_lock@GOTPAGE
Lloh26:
	ldr	x0, [x0, _devices_lock@GOTPAGEOFF]
	bl	_mutex_unlock
	add	x0, x19, #44
	bl	_init_waitqueue_head
	add	x0, x19, #40
	bl	_INIT_LIST_HEAD
	add	x0, x19, #36
	bl	_mutex_init
	add	x0, x19, #32
	bl	_mutex_init
	mov	w8, #1
	stp	w22, w8, [x19]
	stp	xzr, x21, [x19, #16]
	str	w20, [x19, #8]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_devices_lock,4,2               ; @devices_lock
	.comm	_ROCCAT_MAX_DEVICES,4,2         ; @ROCCAT_MAX_DEVICES
	.comm	_devices,8,3                    ; @devices
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_roccat_major,4,2               ; @roccat_major
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s%s%d"

l_.str.1:                               ; @.str.1
	.asciz	"roccat"

.subsections_via_symbols
