	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g_gatel_serve
_g_gatel_serve:                         ## @g_gatel_serve
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movq	_g_gate_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_3
## %bb.1:
	xorl	%edi, %edi
	xorl	%esi, %esi
	callq	_daemon
	cmpl	$-1, %eax
	jne	LBB0_3
## %bb.2:
	movq	_unit@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	callq	_g_gate_destroy
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_err
LBB0_3:
	movq	_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	xorl	%eax, %eax
	callq	_getpid
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%eax, %edx
	callq	_g_gate_log
	movq	_G_GATE_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movq	_unit@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_sectorsize@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%r13, %rdi
	callq	_malloc
	movq	%rax, -64(%rbp)
	movq	_G_GATE_CMD_START@GOTPCREL(%rip), %r14
	leaq	-88(%rbp), %r15
	jmp	LBB0_4
LBB0_22:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_EOPNOTSUPP@GOTPCREL(%rip), %rax
LBB0_23:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rax), %ecx
LBB0_24:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%ecx, -80(%rbp)
	movq	_G_GATE_CMD_DONE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_g_gate_ioctl
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, -88(%rbp)
	movl	$0, -80(%rbp)
	movl	(%r14), %edi
	movq	%r15, %rsi
	callq	_g_gate_ioctl
	movl	-80(%rbp), %ebx
	testl	%ebx, %ebx
	je	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$129, %ebx
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$130, %ebx
	jne	LBB0_10
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	-76(%rbp), %eax
	movl	$-131, %ecx
	addl	%ecx, %eax
	xorl	%edi, %edi
	testl	$-3, %eax
	sete	%dil
	callq	_assert
	movq	-88(%rbp), %rsi
	movq	-64(%rbp), %rdi
	callq	_realloc
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %r13
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_G_GATE_CTL_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	%ebx, %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rdi
	movl	%r12d, %esi
	movl	%eax, %edx
	callq	_g_gate_xlog
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-76(%rbp), %eax
	cmpl	$131, %eax
	je	LBB0_21
## %bb.12:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$133, %eax
	je	LBB0_21
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$132, %eax
	jne	LBB0_22
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rdx
	movq	-64(%rbp), %rsi
	cmpq	%r13, %rdx
	jbe	LBB0_18
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%rsi, %rdi
	movq	%rdx, %rsi
	callq	_realloc
	movq	%rax, -64(%rbp)
	testq	%rax, %rax
	je	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rsi
	movq	-88(%rbp), %rdx
	movq	%rdx, %r13
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-72(%rbp), %ecx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_pread
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rsi
	movq	-88(%rbp), %rdx
	movl	-72(%rbp), %ecx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_pwrite
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ecx, %ecx
	cmpl	$-1, %eax
	jne	LBB0_24
## %bb.20:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_errno@GOTPCREL(%rip), %rax
	jmp	LBB0_23
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	$129, %ecx
	jmp	LBB0_24
LBB0_7:
	movq	-64(%rbp), %rdi
	callq	_free
	xorl	%eax, %eax
	callq	_g_gate_close_device
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_close
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_g_gate_verbose,8,3             ## @g_gate_verbose
	.comm	_unit,4,2                       ## @unit
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot daemonize"

	.comm	_LOG_DEBUG,4,2                  ## @LOG_DEBUG
L_.str.1:                               ## @.str.1
	.asciz	"Worker created: %u."

	.comm	_G_GATE_VERSION,4,2             ## @G_GATE_VERSION
	.comm	_sectorsize,8,3                 ## @sectorsize
	.comm	_G_GATE_CMD_START,4,2           ## @G_GATE_CMD_START
	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
L_.str.2:                               ## @.str.2
	.asciz	"ioctl(/dev/%s): %s."

	.comm	_G_GATE_CTL_NAME,4,2            ## @G_GATE_CTL_NAME
	.comm	_errno,4,2                      ## @errno
	.comm	_EOPNOTSUPP,4,2                 ## @EOPNOTSUPP
	.comm	_G_GATE_CMD_DONE,4,2            ## @G_GATE_CMD_DONE
	.no_dead_strip	_g_gatel_serve
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g_gatel_serve
_g_gatel_serve:                         ; @g_gatel_serve
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x19, x0
Lloh0:
	adrp	x8, _g_gate_verbose@GOTPAGE
Lloh1:
	ldr	x8, [x8, _g_gate_verbose@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x21, _unit@GOTPAGE
Lloh4:
	ldr	x21, [x21, _unit@GOTPAGEOFF]
	cbnz	x8, LBB0_3
; %bb.1:
	mov	w0, #0
	mov	w1, #0
	bl	_daemon
	cmn	w0, #1
	b.ne	LBB0_3
; %bb.2:
	ldr	w0, [x21]
	mov	w1, #1
	bl	_g_gate_destroy
Lloh5:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_err
LBB0_3:
Lloh10:
	adrp	x8, _LOG_DEBUG@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LOG_DEBUG@GOTPAGEOFF]
Lloh12:
	ldr	w20, [x8]
	bl	_getpid
	mov	x2, x0
Lloh13:
	adrp	x1, l_.str.1@PAGE
Lloh14:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_g_gate_log
Lloh15:
	adrp	x8, _G_GATE_VERSION@GOTPAGE
Lloh16:
	ldr	x8, [x8, _G_GATE_VERSION@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x21]
	stp	w9, w8, [sp, #40]
Lloh18:
	adrp	x8, _sectorsize@GOTPAGE
Lloh19:
	ldr	x8, [x8, _sectorsize@GOTPAGEOFF]
Lloh20:
	ldr	x20, [x8]
	mov	x0, x20
	bl	_malloc
Lloh21:
	adrp	x24, _G_GATE_CMD_START@GOTPAGE
Lloh22:
	ldr	x24, [x24, _G_GATE_CMD_START@GOTPAGEOFF]
	str	x0, [sp, #32]
Lloh23:
	adrp	x25, _errno@GOTPAGE
Lloh24:
	ldr	x25, [x25, _errno@GOTPAGEOFF]
Lloh25:
	adrp	x26, _G_GATE_CMD_DONE@GOTPAGE
Lloh26:
	ldr	x26, [x26, _G_GATE_CMD_DONE@GOTPAGEOFF]
	mov	w27, #131
Lloh27:
	adrp	x21, l_.str.2@PAGE
Lloh28:
	add	x21, x21, l_.str.2@PAGEOFF
Lloh29:
	adrp	x28, _G_GATE_CTL_NAME@GOTPAGE
Lloh30:
	ldr	x28, [x28, _G_GATE_CTL_NAME@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh31:
	adrp	x8, _EOPNOTSUPP@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EOPNOTSUPP@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	w8, [sp, #16]
	ldr	w0, [x26]
	add	x1, sp, #8
	bl	_g_gate_ioctl
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	str	x20, [sp, #8]
	str	wzr, [sp, #16]
	ldr	w0, [x24]
	add	x1, sp, #8
	bl	_g_gate_ioctl
	ldr	w22, [sp, #16]
	cbz	w22, LBB0_12
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w22, #129
	b.eq	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w22, #130
	b.ne	LBB0_11
	b	LBB0_22
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #20]
	cmp	w8, #133
	ccmp	w8, w27, #4, ne
	cset	w0, eq
	bl	_assert
	ldr	x0, [sp, #32]
	ldr	x1, [sp, #8]
	bl	_realloc
	str	x0, [sp, #32]
	cbz	x0, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x20, [sp, #8]
	b	LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w23, [x28]
	mov	x0, x22
	bl	_strerror
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
	bl	_g_gate_xlog
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [sp, #20]
	cmp	w8, #131
	b.eq	LBB0_19
; %bb.13:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w8, #133
	b.eq	LBB0_19
; %bb.14:                               ;   in Loop: Header=BB0_6 Depth=1
	cmp	w8, #132
	b.ne	LBB0_4
; %bb.15:                               ;   in Loop: Header=BB0_6 Depth=1
	ldr	x2, [sp, #8]
	ldr	x1, [sp, #32]
	cmp	x2, x20
	b.ls	LBB0_18
; %bb.16:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x1
	mov	x1, x2
	bl	_realloc
	str	x0, [sp, #32]
	cbz	x0, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_6 Depth=1
	mov	x1, x0
	ldr	x2, [sp, #8]
	mov	x20, x2
LBB0_18:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w3, [sp, #24]
	mov	x0, x19
	bl	_pread
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x1, [sp, #32]
	ldr	x2, [sp, #8]
	ldr	w3, [sp, #24]
	mov	x0, x19
	bl	_pwrite
LBB0_20:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x25]
	cmn	w0, #1
	csel	w8, w8, wzr, eq
	b	LBB0_5
LBB0_21:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	w8, #129
	b	LBB0_5
LBB0_22:
	ldr	x0, [sp, #32]
	bl	_free
	bl	_g_gate_close_device
	mov	x0, x19
	bl	_close
Lloh34:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh35:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	_exit
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_g_gate_verbose,8,3             ; @g_gate_verbose
	.comm	_unit,4,2                       ; @unit
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot daemonize"

	.comm	_LOG_DEBUG,4,2                  ; @LOG_DEBUG
l_.str.1:                               ; @.str.1
	.asciz	"Worker created: %u."

	.comm	_G_GATE_VERSION,4,2             ; @G_GATE_VERSION
	.comm	_sectorsize,8,3                 ; @sectorsize
	.comm	_G_GATE_CMD_START,4,2           ; @G_GATE_CMD_START
	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
l_.str.2:                               ; @.str.2
	.asciz	"ioctl(/dev/%s): %s."

	.comm	_G_GATE_CTL_NAME,4,2            ; @G_GATE_CTL_NAME
	.comm	_errno,4,2                      ; @errno
	.comm	_EOPNOTSUPP,4,2                 ; @EOPNOTSUPP
	.comm	_G_GATE_CMD_DONE,4,2            ; @G_GATE_CMD_DONE
	.no_dead_strip	_g_gatel_serve
.subsections_via_symbols
