	.file	"extr_atm.c_atm_register_trace_memory.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	atm_register_trace_memory
	.type	atm_register_trace_memory, @function
atm_register_trace_memory:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR MACH_PORT_NULL[rip]
	cmp	QWORD PTR disable_atm[rip], 0
	mov	DWORD PTR [rsp], eax
	je	.L2
.L4:
	mov	r12, QWORD PTR KERN_NOT_SUPPORTED[rip]
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L14
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	rax, r12
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	xor	eax, eax
	mov	rbp, rdi
	mov	r12d, esi
	mov	r13d, edx
	call	atm_get_diagnostic_config@PLT
	test	DWORD PTR ATM_TRACE_DISABLE[rip], eax
	jne	.L4
	xor	eax, eax
	call	current_task@PLT
	cmp	rbp, rax
	je	.L5
.L6:
	mov	r12, QWORD PTR KERN_INVALID_ARGUMENT[rip]
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L5:
	cmp	QWORD PTR 0[rbp], 0
	jne	.L6
	test	r12d, r12d
	je	.L6
	test	r13d, r13d
	je	.L6
	test	DWORD PTR PAGE_MASK[rip], r13d
	jne	.L6
	cmp	DWORD PTR MAX_TRACE_BUFFER_SIZE[rip], r13d
	jl	.L6
	xor	eax, eax
	call	current_map@PLT
	xor	r9d, r9d
	mov	edx, r12d
	lea	rsi, 4[rsp]
	mov	ecx, DWORD PTR VM_PROT_READ[rip]
	mov	edi, eax
	mov	r8, rsp
	mov	DWORD PTR 4[rsp], r13d
	call	mach_make_memory_entry_64@PLT
	cmp	QWORD PTR KERN_SUCCESS[rip], rax
	mov	r12, rax
	jne	.L1
	mov	edi, DWORD PTR [rsp]
	mov	esi, r13d
	mov	rdx, rbp
	call	atm_task_descriptor_alloc_init@PLT
	cmp	QWORD PTR ATM_TASK_DESCRIPTOR_NULL[rip], rax
	mov	r13, rax
	je	.L15
	mov	rdi, rbp
	call	task_lock@PLT
	cmp	QWORD PTR 0[rbp], 0
	mov	r12, QWORD PTR KERN_FAILURE[rip]
	je	.L16
.L9:
	mov	rdi, rbp
	call	task_unlock@PLT
	cmp	QWORD PTR KERN_SUCCESS[rip], r12
	je	.L1
	mov	rdi, r13
	call	atm_task_descriptor_dealloc@PLT
	mov	r12, QWORD PTR KERN_SUCCESS[rip]
	jmp	.L1
.L16:
	mov	QWORD PTR 0[rbp], r13
	mov	r12, QWORD PTR KERN_SUCCESS[rip]
	jmp	.L9
.L15:
	mov	edi, DWORD PTR [rsp]
	call	ipc_port_release_send@PLT
	mov	r12, QWORD PTR KERN_NO_SPACE[rip]
	jmp	.L1
.L14:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	atm_register_trace_memory, .-atm_register_trace_memory
	.comm	disable_atm,8,8
	.comm	VM_PROT_READ,4,4
	.comm	PAGE_MASK,4,4
	.comm	MAX_TRACE_BUFFER_SIZE,4,4
	.comm	MACH_PORT_NULL,4,4
	.comm	KERN_SUCCESS,8,8
	.comm	KERN_NO_SPACE,8,8
	.comm	KERN_NOT_SUPPORTED,8,8
	.comm	KERN_INVALID_ARGUMENT,8,8
	.comm	KERN_FAILURE,8,8
	.comm	ATM_TRACE_DISABLE,4,4
	.comm	ATM_TASK_DESCRIPTOR_NULL,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_atm.c_atm_register_trace_memory.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	atm_register_trace_memory
	.syntax unified
	.arm
	.fpu softvfp
	.type	atm_register_trace_memory, %function
atm_register_trace_memory:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	ip, .L16
	ldr	r3, .L16+4
	ldr	ip, [ip]
	mov	r5, r2
	ldr	r3, [r3]
	ldr	r2, .L16+8
	sub	sp, sp, #24
	cmp	ip, #0
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	str	r3, [sp, #12]
	beq	.L2
.L4:
	ldr	r3, .L16+12
	ldr	r4, [r3]
.L1:
	ldr	r3, .L16+8
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L14
	mov	r0, r4
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r6, r0
	mov	r4, r1
	bl	atm_get_diagnostic_config
	ldr	r3, .L16+16
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L4
	bl	current_task
	cmp	r0, r6
	mov	r7, r0
	beq	.L5
.L6:
	ldr	r3, .L16+20
	ldr	r4, [r3]
	b	.L1
.L5:
	ldr	r3, [r0]
	cmp	r3, #0
	bne	.L6
	cmp	r5, #0
	cmpne	r4, #0
	beq	.L6
	ldr	r3, .L16+24
	ldr	r3, [r3]
	ands	r8, r5, r3
	bne	.L6
	ldr	r3, .L16+28
	ldr	r3, [r3]
	cmp	r3, r5
	blt	.L6
	bl	current_map
	ldr	r3, .L16+32
	str	r8, [sp, #4]
	add	r1, sp, #12
	ldr	r3, [r3]
	mov	r2, r4
	str	r1, [sp]
	add	r1, sp, #16
	str	r5, [sp, #16]
	bl	mach_make_memory_entry_64
	ldr	r8, .L16+36
	mov	r4, r0
	ldr	r3, [r8]
	cmp	r3, r0
	bne	.L1
	mov	r1, r5
	mov	r2, r7
	ldr	r0, [sp, #12]
	bl	atm_task_descriptor_alloc_init
	ldr	r3, .L16+40
	mov	r5, r0
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L15
	mov	r0, r6
	bl	task_lock
	ldr	r3, [r6]
	mov	r0, r6
	cmp	r3, #0
	ldrne	r3, .L16+44
	streq	r5, [r6]
	ldrne	r4, [r3]
	ldreq	r4, [r8]
	bl	task_unlock
	ldr	r3, [r8]
	cmp	r3, r4
	beq	.L1
	mov	r0, r5
	bl	atm_task_descriptor_dealloc
	ldr	r4, [r8]
	b	.L1
.L15:
	ldr	r0, [sp, #12]
	bl	ipc_port_release_send
	ldr	r3, .L16+48
	ldr	r4, [r3]
	b	.L1
.L14:
	bl	__stack_chk_fail
.L17:
	.align	2
.L16:
	.word	disable_atm
	.word	MACH_PORT_NULL
	.word	.LC0
	.word	KERN_NOT_SUPPORTED
	.word	ATM_TRACE_DISABLE
	.word	KERN_INVALID_ARGUMENT
	.word	PAGE_MASK
	.word	MAX_TRACE_BUFFER_SIZE
	.word	VM_PROT_READ
	.word	KERN_SUCCESS
	.word	ATM_TASK_DESCRIPTOR_NULL
	.word	KERN_FAILURE
	.word	KERN_NO_SPACE
	.size	atm_register_trace_memory, .-atm_register_trace_memory
	.comm	disable_atm,4,4
	.comm	VM_PROT_READ,4,4
	.comm	PAGE_MASK,4,4
	.comm	MAX_TRACE_BUFFER_SIZE,4,4
	.comm	MACH_PORT_NULL,4,4
	.comm	KERN_SUCCESS,4,4
	.comm	KERN_NO_SPACE,4,4
	.comm	KERN_NOT_SUPPORTED,4,4
	.comm	KERN_INVALID_ARGUMENT,4,4
	.comm	KERN_FAILURE,4,4
	.comm	ATM_TRACE_DISABLE,4,4
	.comm	ATM_TASK_DESCRIPTOR_NULL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
