	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function applesmc_create_nodes
_applesmc_create_nodes:                 ## @applesmc_create_nodes
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, 24(%rdi)
	je	LBB0_10
## %bb.1:
	movl	%esi, %ebx
	leaq	24(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	leal	1(%rbx), %r15d
	xorl	%eax, %eax
	testl	%esi, %esi
	cmovlel	%eax, %ebx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$48, %esi
	callq	_kcalloc
	movq	%rax, 32(%r14)
	testq	%rax, %rax
	je	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$16, %r15d
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	cmpq	%r13, %rbx
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	32(%r14), %r12
	leaq	(%r12,%r15), %rbx
	movq	-16(%r12,%r15), %rdi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	leaq	1(%r13), %rcx
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	movl	$8, %esi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_scnprintf
	movl	(%r14), %eax
	shll	$16, %eax
	movzwl	%r13w, %ecx
	orl	%eax, %ecx
	movl	%ecx, -8(%r12,%r15)
	movl	16(%r14), %eax
	movl	%eax, 24(%r12,%r15)
	movq	8(%r14), %rax
	movq	%rax, 16(%r12,%r15)
	movq	%rbx, %rdi
	callq	_sysfs_attr_init
	movq	-16(%r12,%r15), %rax
	movq	%rax, 8(%r12,%r15)
	xorl	%eax, %eax
	cmpq	$0, 8(%r14)
	setne	%al
	shll	$7, %eax
	orl	$292, %eax                      ## imm = 0x124
	movl	%eax, (%r12,%r15)
	movq	_pdev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	%rbx, %rsi
	callq	_sysfs_create_file
	addq	$48, %r15
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	testl	%eax, %eax
	je	LBB0_4
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	leaq	64(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	cmpq	$0, 64(%r14)
	leaq	40(%r14), %r14
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	jne	LBB0_2
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_8:
	movl	%eax, %ebx
	movq	$0, -40(%r12,%r15)
LBB0_9:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_applesmc_destroy_nodes
LBB0_11:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_pdev,8,3                       ## @pdev
	.no_dead_strip	_applesmc_create_nodes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function applesmc_create_nodes
_applesmc_create_nodes:                 ; @applesmc_create_nodes
	.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	x23, x0
	ldr	x8, [x23, #24]!
	cbz	x8, LBB0_7
; %bb.1:
	add	w20, w1, #1
	cmp	w1, #0
	csel	w8, w1, wzr, gt
	mov	w9, #48
Lloh0:
	adrp	x10, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x10, [x10, _GFP_KERNEL@GOTPAGEOFF]
	umull	x25, w8, w9
	mov	w27, #292
Lloh2:
	adrp	x28, _pdev@GOTPAGE
Lloh3:
	ldr	x28, [x28, _pdev@GOTPAGEOFF]
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	mov	x19, x0
	str	w20, [sp, #4]                   ; 4-byte Folded Spill
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	ldr	w2, [x10]
	mov	x0, x20
	mov	w1, #48
	bl	_kcalloc
	str	x0, [x19, #32]
	cbz	x0, LBB0_11
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x20, #0
	mov	w21, #1
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x25, x20
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	x24, [x19, #32]
	add	x26, x24, x20
	ldr	x0, [x26]
	ldr	x2, [x23]
	mov	w1, #8
	mov	x3, x21
	bl	_scnprintf
	ldr	w8, [x19]
	sub	w9, w21, #1
	bfi	w9, w8, #16, #16
	str	w9, [x26, #8]
	ldr	w8, [x19, #16]
	str	w8, [x26, #40]
	ldr	x8, [x19, #8]
	str	x8, [x26, #32]
	add	x22, x26, #16
	mov	x0, x22
	bl	_sysfs_attr_init
	ldr	x8, [x26]
	str	x8, [x26, #24]
	ldr	x8, [x19, #8]
	cmp	x8, #0
	mov	w8, #420
	csel	w8, w27, w8, eq
	str	w8, [x26, #16]
	ldr	x0, [x28]
	mov	x1, x22
	bl	_sysfs_create_file
	add	x20, x20, #48
	add	w21, w21, #1
	cbz	w0, LBB0_4
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	x8, [x19, #64]!
	mov	x23, x19
	sub	x19, x19, #24
	ldr	w20, [sp, #4]                   ; 4-byte Folded Reload
Lloh4:
	adrp	x10, _GFP_KERNEL@GOTPAGE
Lloh5:
	ldr	x10, [x10, _GFP_KERNEL@GOTPAGEOFF]
	cbnz	x8, LBB0_2
LBB0_7:
	mov	w22, #0
	b	LBB0_10
LBB0_8:
	mov	x22, x0
	add	x8, x24, x20
	stur	xzr, [x8, #-24]
LBB0_9:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	bl	_applesmc_destroy_nodes
LBB0_10:
	mov	x0, x22
	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
LBB0_11:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_pdev,8,3                       ; @pdev
	.no_dead_strip	_applesmc_create_nodes
.subsections_via_symbols
