	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetSystemModules               ## -- Begin function GetSystemModules
	.p2align	4, 0x90
_GetSystemModules:                      ## @GetSystemModules
	.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	$0, -44(%rbp)
	movq	_gHandleDriver@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_7
## %bb.1:
	movq	%rdi, %r14
	movl	$1048576, %edi                  ## imm = 0x100000
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r13
	movq	(%rbx), %rdi
	movq	_IOCTL_GET_SYSTEM_MODULES@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rax
	movq	%r13, %rdx
	movl	$1048576, %ecx                  ## imm = 0x100000
	movq	%r13, %r8
	movl	$1048576, %r9d                  ## imm = 0x100000
	pushq	$0
	pushq	%rax
	callq	_DeviceIoControl
	addq	$16, %rsp
	movl	$1, %ecx
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	cmpl	$0, (%r13)
	jle	LBB0_9
## %bb.5:
	movq	8(%r13), %rbx
	addq	$8, %rbx
	xorl	%r15d, %r15d
	leaq	L_.str.1(%rip), %r12
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	callq	_GetFileName
	movl	-8(%rbx), %ecx
	movl	-4(%rbx), %edx
	movq	%r12, %rdi
	movq	%rax, %rsi
	callq	*(%r14)
	incq	%r15
	movslq	(%r13), %rax
	addq	$16, %rbx
	cmpq	%rax, %r15
	jl	LBB0_6
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_eprintf
LBB0_8:
	movl	$1, %ecx
	jmp	LBB0_9
LBB0_2:
	leaq	L_.str(%rip), %rdi
	movl	$1048576, %esi                  ## imm = 0x100000
	xorl	%eax, %eax
	callq	_eprintf
	movl	$-1, %ecx
LBB0_9:
	movl	%ecx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_gHandleDriver,8,3              ## @gHandleDriver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[r2k] GetSystemModules: Error can't allocate %i bytes of memory.\n"

	.comm	_IOCTL_GET_SYSTEM_MODULES,4,2   ## @IOCTL_GET_SYSTEM_MODULES
L_.str.1:                               ## @.str.1
	.asciz	"f nt.%s 0x%x @ 0x%p\n"

L_.str.2:                               ## @.str.2
	.asciz	"Driver not initialized.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_GetSystemModules               ; -- Begin function GetSystemModules
	.p2align	2
_GetSystemModules:                      ; @GetSystemModules
	.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
	str	wzr, [sp, #12]
Lloh0:
	adrp	x21, _gHandleDriver@GOTPAGE
Lloh1:
	ldr	x21, [x21, _gHandleDriver@GOTPAGEOFF]
	ldr	x8, [x21]
	cbz	x8, LBB0_6
; %bb.1:
	mov	x19, x0
	mov	w0, #1048576
	bl	_malloc
	cbz	x0, LBB0_8
; %bb.2:
	mov	x20, x0
	ldr	x0, [x21]
Lloh2:
	adrp	x8, _IOCTL_GET_SYSTEM_MODULES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IOCTL_GET_SYSTEM_MODULES@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x6, sp, #12
	mov	x2, x20
	mov	w3, #1048576
	mov	x4, x20
	mov	w5, #1048576
	mov	x7, #0
	bl	_DeviceIoControl
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.4:
	mov	x22, #0
	ldr	x8, [x20, #8]
	add	x23, x8, #8
Lloh5:
	adrp	x21, l_.str.1@PAGE
Lloh6:
	add	x21, x21, l_.str.1@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x23]
	bl	_GetFileName
	mov	x1, x0
	ldr	x8, [x19]
	ldp	w3, w2, [x23, #-8]
	mov	x0, x21
	blr	x8
	add	x22, x22, #1
	ldrsw	x8, [x20]
	add	x23, x23, #16
	cmp	x22, x8
	b.lt	LBB0_5
	b	LBB0_7
LBB0_6:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_eprintf
LBB0_7:
	mov	w0, #1
	b	LBB0_9
LBB0_8:
	mov	w8, #1048576
	str	x8, [sp]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
	mov	w0, #-1
LBB0_9:
	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	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_gHandleDriver,8,3              ; @gHandleDriver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[r2k] GetSystemModules: Error can't allocate %i bytes of memory.\n"

	.comm	_IOCTL_GET_SYSTEM_MODULES,4,2   ; @IOCTL_GET_SYSTEM_MODULES
l_.str.1:                               ; @.str.1
	.asciz	"f nt.%s 0x%x @ 0x%p\n"

l_.str.2:                               ; @.str.2
	.asciz	"Driver not initialized.\n"

.subsections_via_symbols
