	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cudbg_get_mem_region
_cudbg_get_mem_region:                  ## @cudbg_get_mem_region
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movq	%rcx, %r13
	movq	%rsi, %r15
	leaq	-56(%rbp), %rcx
	callq	_cudbg_meminfo_get_mem_index
	testl	%eax, %eax
	jne	LBB0_19
## %bb.1:
	movq	_cudbg_region@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testq	%rax, %rax
	je	LBB0_18
## %bb.2:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movq	%r13, %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_4
## %bb.16:                              ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cmpq	%rax, %rbx
	jb	LBB0_3
	jmp	LBB0_18
LBB0_4:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%r15)
	je	LBB0_18
## %bb.5:
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_6
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rax, 8(%rsi,%r13)
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	cmpq	%rbx, (%rsi,%r13)
	je	LBB0_12
LBB0_17:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r14
	addq	$24, %r13
	cmpq	(%r15), %r14
	jae	LBB0_18
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rax
	movq	(%rax,%r13), %r12
	movq	_cudbg_region@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_ARRAY_SIZE
	cmpq	%rax, %r12
	jae	LBB0_17
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	8(%r15), %rsi
	movq	8(%rsi,%r13), %rax
	testq	%rax, %rax
	jne	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r15), %rcx
	decq	%rcx
	movq	$-1, %rax
	cmpq	%rcx, %r14
	jae	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	40(%rsi,%r13), %rax
	decq	%rax
	jmp	LBB0_10
LBB0_12:
	movq	16(%rsi,%r13), %rcx
	movq	16(%r15), %rdx
	movq	-56(%rbp), %rdi
	shlq	$4, %rdi
	movq	(%rdx,%rdi), %rbx
	cmpq	%rbx, %rcx
	jge	LBB0_14
## %bb.13:
	cmpq	%rbx, %rax
	jl	LBB0_18
LBB0_14:
	cmpq	8(%rdx,%rdi), %rcx
	jle	LBB0_15
LBB0_18:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_19:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	addq	%r13, %rsi
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	$4, %edx
	callq	_memcpy
	xorl	%eax, %eax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_cudbg_region,8,3               ## @cudbg_region
	.comm	_EINVAL,4,2                     ## @EINVAL
	.no_dead_strip	_cudbg_get_mem_region
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cudbg_get_mem_region
_cudbg_get_mem_region:                  ; @cudbg_get_mem_region
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x20, x1
	add	x3, sp, #8
	bl	_cudbg_meminfo_get_mem_index
	cbnz	w0, LBB0_18
; %bb.1:
Lloh0:
	adrp	x22, _cudbg_region@GOTPAGE
Lloh1:
	ldr	x22, [x22, _cudbg_region@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cbz	x0, LBB0_17
; %bb.2:
	mov	x23, #0
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	w0, [x8, x23, lsl #2]
	mov	x1, x21
	bl	_strcmp
	cbz	w0, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x23, x0
	b.lo	LBB0_3
	b	LBB0_17
LBB0_5:
	ldr	x8, [x20]
	cbz	x8, LBB0_17
; %bb.6:
	mov	x21, #0
	mov	x24, #0
	b	LBB0_11
LBB0_7:                                 ;   in Loop: Header=BB0_11 Depth=1
	add	x9, x8, x21
	ldr	x9, [x9, #40]
	sub	x9, x9, #1
LBB0_8:                                 ;   in Loop: Header=BB0_11 Depth=1
	str	x9, [x10, #8]
LBB0_9:                                 ;   in Loop: Header=BB0_11 Depth=1
	ldr	x10, [x8, x21]
	cmp	x10, x23
	b.eq	LBB0_15
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	x24, x24, #1
	ldr	x8, [x20]
	add	x21, x21, #24
	cmp	x24, x8
	b.hs	LBB0_17
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x25, [x8, x21]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x25, x0
	b.hs	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x8, [x20, #8]
	add	x10, x8, x21
	ldr	x9, [x10, #8]
	cbnz	x9, LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_11 Depth=1
	ldr	x9, [x20]
	sub	x9, x9, #1
	cmp	x24, x9
	b.lo	LBB0_7
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x9, #-1
	b	LBB0_8
LBB0_15:
	add	x10, x8, x21
	ldr	x10, [x10, #16]
	ldr	x11, [x20, #16]
	ldr	x12, [sp, #8]
	lsl	x13, x12, #4
	ldr	x13, [x11, x13]
	cmp	x10, x13
	ccmp	x9, x13, #0, lt
	b.lt	LBB0_17
; %bb.16:
	add	x9, x11, x12, lsl #4
	ldr	x9, [x9, #8]
	cmp	x10, x9
	b.le	LBB0_19
LBB0_17:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_19:
	add	x1, x8, x21
	mov	x0, x19
	mov	w2, #4
	bl	_memcpy
	mov	w0, #0
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_cudbg_region,8,3               ; @cudbg_region
	.comm	_EINVAL,4,2                     ; @EINVAL
	.no_dead_strip	_cudbg_get_mem_region
.subsections_via_symbols
