	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mach_setup
_mach_setup:                            ## @mach_setup
	.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	%edi, %r15d
	xorl	%eax, %eax
	callq	_mach_task_self
	movq	_MACH_PORT_RIGHT_PORT_SET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_port_set@GOTPCREL(%rip), %r14
	movl	%eax, %edi
	movq	%r14, %rdx
	callq	_mach_port_allocate
	movq	_KERN_SUCCESS@GOTPCREL(%rip), %r12
	cmpq	(%r12), %rax
	jne	LBB0_1
## %bb.3:
	xorl	%eax, %eax
	callq	_mach_task_self
	movq	_MACH_PORT_RIGHT_RECEIVE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_signal_port@GOTPCREL(%rip), %rbx
	movl	%eax, %edi
	movq	%rbx, %rdx
	callq	_mach_port_allocate
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.4:
	xorl	%eax, %eax
	callq	_mach_task_self
	movl	(%rbx), %esi
	movl	(%r14), %edx
	movl	%eax, %edi
	callq	_mach_port_move_member
	cmpq	(%r12), %rax
	jne	LBB0_5
## %bb.6:
	testl	%r15d, %r15d
	je	LBB0_11
## %bb.7:
	movq	___AUDIT_LAUNCHD_LABEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_lookup_machport
	movq	_control_port@GOTPCREL(%rip), %r15
	movl	%eax, (%r15)
	movq	_MACH_PORT_NULL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_9
## %bb.8:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mach_task_self
	movl	(%r15), %esi
	movl	(%r14), %edx
	movl	%eax, %edi
	callq	_mach_port_move_member
	cmpq	(%r12), %rax
	jne	LBB0_9
## %bb.10:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_17
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
LBB0_2:
	callq	_auditd_log_err
	movl	$-1, %ebx
LBB0_18:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_11:
	xorl	%eax, %eax
	callq	_mach_task_self
	movl	(%r13), %esi
	movq	_control_port@GOTPCREL(%rip), %r15
	movl	%eax, %edi
	movq	%r15, %rdx
	callq	_mach_port_allocate
	cmpq	(%r12), %rax
	jne	LBB0_13
## %bb.12:
	xorl	%eax, %eax
	callq	_mach_task_self
	movl	(%r15), %esi
	movl	(%r14), %edx
	movl	%eax, %edi
	callq	_mach_port_move_member
	cmpq	(%r12), %rax
	je	LBB0_14
LBB0_13:
	leaq	L_.str.4(%rip), %rdi
	callq	_auditd_log_err
LBB0_14:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_mach_task_self
	movl	(%r15), %esi
	movq	_MACH_MSG_TYPE_MAKE_SEND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-44(%rbp), %r8
	movl	%eax, %edi
	movq	%r15, %rcx
	callq	_mach_port_extract_right
	xorl	%eax, %eax
	callq	_mach_host_self
	movl	(%r15), %esi
	movl	%eax, %edi
	callq	_host_set_audit_control_port
	cmpq	(%r12), %rax
	jne	LBB0_15
## %bb.16:
	leaq	L_.str.6(%rip), %rdi
LBB0_17:
	callq	_auditd_log_debug
	jmp	LBB0_18
LBB0_15:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_MACH_PORT_RIGHT_PORT_SET,4,2   ## @MACH_PORT_RIGHT_PORT_SET
	.comm	_port_set,4,2                   ## @port_set
	.comm	_KERN_SUCCESS,8,3               ## @KERN_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Allocation of port set failed"

	.comm	_MACH_PORT_RIGHT_RECEIVE,4,2    ## @MACH_PORT_RIGHT_RECEIVE
	.comm	_signal_port,4,2                ## @signal_port
L_.str.1:                               ## @.str.1
	.asciz	"Allocation of signal port failed"

	.comm	___AUDIT_LAUNCHD_LABEL,4,2      ## @__AUDIT_LAUNCHD_LABEL
	.comm	_control_port,4,2               ## @control_port
	.comm	_MACH_PORT_NULL,4,2             ## @MACH_PORT_NULL
L_.str.2:                               ## @.str.2
	.asciz	"Cannot get Mach control port via launchd"

L_.str.3:                               ## @.str.3
	.asciz	"Mach control port registered via launchd"

L_.str.4:                               ## @.str.4
	.asciz	"Allocation of trigger port failed"

	.comm	_MACH_MSG_TYPE_MAKE_SEND,4,2    ## @MACH_MSG_TYPE_MAKE_SEND
L_.str.5:                               ## @.str.5
	.asciz	"Cannot set Mach control port"

L_.str.6:                               ## @.str.6
	.asciz	"Mach control port registered"

	.no_dead_strip	_mach_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mach_setup
_mach_setup:                            ; @mach_setup
	.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
	mov	x20, x0
	bl	_mach_task_self
Lloh0:
	adrp	x8, _MACH_PORT_RIGHT_PORT_SET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MACH_PORT_RIGHT_PORT_SET@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x19, _port_set@GOTPAGE
Lloh4:
	ldr	x19, [x19, _port_set@GOTPAGEOFF]
	mov	x2, x19
	bl	_mach_port_allocate
Lloh5:
	adrp	x22, _KERN_SUCCESS@GOTPAGE
Lloh6:
	ldr	x22, [x22, _KERN_SUCCESS@GOTPAGEOFF]
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.1:
	bl	_mach_task_self
Lloh7:
	adrp	x23, _MACH_PORT_RIGHT_RECEIVE@GOTPAGE
Lloh8:
	ldr	x23, [x23, _MACH_PORT_RIGHT_RECEIVE@GOTPAGEOFF]
	ldr	w1, [x23]
Lloh9:
	adrp	x21, _signal_port@GOTPAGE
Lloh10:
	ldr	x21, [x21, _signal_port@GOTPAGEOFF]
	mov	x2, x21
	bl	_mach_port_allocate
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.2:
	bl	_mach_task_self
	ldr	w1, [x21]
	ldr	w2, [x19]
	bl	_mach_port_move_member
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.3:
	cbz	w20, LBB0_12
; %bb.4:
Lloh11:
	adrp	x8, ___AUDIT_LAUNCHD_LABEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, ___AUDIT_LAUNCHD_LABEL@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	bl	_lookup_machport
Lloh14:
	adrp	x20, _control_port@GOTPAGE
Lloh15:
	ldr	x20, [x20, _control_port@GOTPAGEOFF]
	str	w0, [x20]
Lloh16:
	adrp	x8, _MACH_PORT_NULL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MACH_PORT_NULL@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_11
; %bb.5:
	bl	_mach_task_self
	ldr	w1, [x20]
	ldr	w2, [x19]
	bl	_mach_port_move_member
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_11
; %bb.6:
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_17
LBB0_7:
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh23:
	adrp	x0, l_.str.1@PAGE
Lloh24:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_auditd_log_err
	mov	w0, #-1
LBB0_10:
	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
LBB0_11:
Lloh25:
	adrp	x0, l_.str.2@PAGE
Lloh26:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_12:
	bl	_mach_task_self
	ldr	w1, [x23]
Lloh27:
	adrp	x20, _control_port@GOTPAGE
Lloh28:
	ldr	x20, [x20, _control_port@GOTPAGEOFF]
	mov	x2, x20
	bl	_mach_port_allocate
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.13:
	bl	_mach_task_self
	ldr	w1, [x20]
	ldr	w2, [x19]
	bl	_mach_port_move_member
	ldr	x8, [x22]
	cmp	x0, x8
	b.eq	LBB0_15
LBB0_14:
Lloh29:
	adrp	x0, l_.str.4@PAGE
Lloh30:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_auditd_log_err
LBB0_15:
	bl	_mach_task_self
	ldr	w1, [x20]
Lloh31:
	adrp	x8, _MACH_MSG_TYPE_MAKE_SEND@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MACH_MSG_TYPE_MAKE_SEND@GOTPAGEOFF]
Lloh33:
	ldr	w2, [x8]
	add	x4, sp, #12
	mov	x3, x20
	bl	_mach_port_extract_right
	bl	_mach_host_self
	ldr	w1, [x20]
	bl	_host_set_audit_control_port
	ldr	x8, [x22]
	cmp	x0, x8
	b.ne	LBB0_18
; %bb.16:
Lloh34:
	adrp	x0, l_.str.6@PAGE
Lloh35:
	add	x0, x0, l_.str.6@PAGEOFF
LBB0_17:
	bl	_auditd_log_debug
	mov	w0, #0
	b	LBB0_10
LBB0_18:
Lloh36:
	adrp	x0, l_.str.5@PAGE
Lloh37:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_MACH_PORT_RIGHT_PORT_SET,4,2   ; @MACH_PORT_RIGHT_PORT_SET
	.comm	_port_set,4,2                   ; @port_set
	.comm	_KERN_SUCCESS,8,3               ; @KERN_SUCCESS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Allocation of port set failed"

	.comm	_MACH_PORT_RIGHT_RECEIVE,4,2    ; @MACH_PORT_RIGHT_RECEIVE
	.comm	_signal_port,4,2                ; @signal_port
l_.str.1:                               ; @.str.1
	.asciz	"Allocation of signal port failed"

	.comm	___AUDIT_LAUNCHD_LABEL,4,2      ; @__AUDIT_LAUNCHD_LABEL
	.comm	_control_port,4,2               ; @control_port
	.comm	_MACH_PORT_NULL,4,2             ; @MACH_PORT_NULL
l_.str.2:                               ; @.str.2
	.asciz	"Cannot get Mach control port via launchd"

l_.str.3:                               ; @.str.3
	.asciz	"Mach control port registered via launchd"

l_.str.4:                               ; @.str.4
	.asciz	"Allocation of trigger port failed"

	.comm	_MACH_MSG_TYPE_MAKE_SEND,4,2    ; @MACH_MSG_TYPE_MAKE_SEND
l_.str.5:                               ; @.str.5
	.asciz	"Cannot set Mach control port"

l_.str.6:                               ; @.str.6
	.asciz	"Mach control port registered"

	.no_dead_strip	_mach_setup
.subsections_via_symbols
