	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_http_server_init               ## -- Begin function http_server_init
	.p2align	4, 0x90
_http_server_init:                      ## @http_server_init
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movq	%rdx, %r13
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	$1, -44(%rbp)
	movl	$32, %edi
	callq	_os_zalloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.1:
	movq	%rax, %rbx
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, (%rax)
	movq	%r12, 24(%rax)
	movq	_AF_INET@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_SOCK_STREAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	js	LBB0_15
## %bb.2:
	movq	_SOL_SOCKET@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	_SO_REUSEADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	leaq	-44(%rbp), %rcx
	movq	%rax, %rdi
	movl	$4, %r8d
	callq	_setsockopt
	testq	%rax, %rax
	jns	LBB0_4
## %bb.3:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_strerror
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_wpa_printf
LBB0_4:
	movq	8(%rbx), %rdi
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_fcntl
	testq	%rax, %rax
	js	LBB0_15
## %bb.5:
	testl	%r15d, %r15d
	movl	$49152, %eax                    ## imm = 0xC000
	cmovnsl	%r15d, %eax
	movl	%eax, 16(%rbx)
	leaq	-72(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_os_memset
	movl	(%r13), %eax
	movl	%eax, -64(%rbp)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, -68(%rbp)
	movl	16(%rbx), %edi
	movq	_errno@GOTPCREL(%rip), %r13
	movq	_EADDRINUSE@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	callq	_htons
	movl	%eax, -72(%rbp)
	movq	8(%rbx), %rdi
	movq	%r12, %rsi
	movl	$12, %edx
	callq	_bind
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	(%r13), %rdi
	cmpq	(%r14), %rdi
	jne	LBB0_14
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	16(%rbx), %edi
	incl	%edi
	movl	%edi, 16(%rbx)
	testl	%r15d, %r15d
	jns	LBB0_15
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=1
	cmpl	$65535, %edi                    ## imm = 0xFFFF
	jne	LBB0_6
	jmp	LBB0_15
LBB0_10:
	movq	8(%rbx), %rdi
	movl	$10, %esi
	callq	_listen
	testq	%rax, %rax
	js	LBB0_15
## %bb.11:
	movq	8(%rbx), %rdi
	movq	_F_SETFL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_O_NONBLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_fcntl
	testq	%rax, %rax
	js	LBB0_15
## %bb.12:
	movq	8(%rbx), %rdi
	movq	_EVENT_TYPE_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_http_server_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rcx
	xorl	%r8d, %r8d
	callq	_eloop_register_sock
	testq	%rax, %rax
	jne	LBB0_15
## %bb.13:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_inet_ntoa
	movl	16(%rbx), %ecx
	leaq	L_.str.2(%rip), %rsi
	movl	%r15d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_wpa_printf
	jmp	LBB0_17
LBB0_14:
	movq	_MSG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	16(%rbx), %r15d
	callq	_strerror
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_wpa_printf
LBB0_15:
	movq	%rbx, %rdi
	callq	_http_server_deinit
LBB0_16:
	xorl	%ebx, %ebx
LBB0_17:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AF_INET,4,2                    ## @AF_INET
	.comm	_SOCK_STREAM,4,2                ## @SOCK_STREAM
	.comm	_SOL_SOCKET,4,2                 ## @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ## @SO_REUSEADDR
	.comm	_MSG_DEBUG,4,2                  ## @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"HTTP: setsockopt(SO_REUSEADDR) failed: %s"

	.comm	_errno,8,3                      ## @errno
	.comm	_F_SETFL,4,2                    ## @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ## @O_NONBLOCK
	.comm	_EADDRINUSE,8,3                 ## @EADDRINUSE
L_.str.1:                               ## @.str.1
	.asciz	"HTTP: Failed to bind server port %d: %s"

	.comm	_EVENT_TYPE_READ,4,2            ## @EVENT_TYPE_READ
	.comm	_http_server_cb,4,2             ## @http_server_cb
L_.str.2:                               ## @.str.2
	.asciz	"HTTP: Started server on %s:%d"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_http_server_init               ; -- Begin function http_server_init
	.p2align	2
_http_server_init:                      ; @http_server_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x22, x3
	mov	x23, x2
	mov	x21, x1
	mov	x20, x0
	mov	w8, #1
	str	w8, [sp, #12]
	mov	w0, #32
	bl	_os_zalloc
	mov	x19, x0
	cbz	x0, LBB0_16
; %bb.1:
	str	x23, [x19]
	str	x22, [x19, #24]
Lloh0:
	adrp	x24, _AF_INET@GOTPAGE
Lloh1:
	ldr	x24, [x24, _AF_INET@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh2:
	adrp	x8, _SOCK_STREAM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SOCK_STREAM@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	str	x0, [x19, #8]
	tbnz	x0, #63, LBB0_15
; %bb.2:
Lloh5:
	adrp	x8, _SOL_SOCKET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SOL_SOCKET@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _SO_REUSEADDR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SO_REUSEADDR@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	add	x3, sp, #12
	mov	w4, #4
	bl	_setsockopt
	tbz	x0, #63, LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh13:
	ldr	w22, [x8]
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	x0, [x8]
	bl	_strerror
	mov	x2, x0
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_wpa_printf
LBB0_4:
	ldr	x0, [x19, #8]
Lloh19:
	adrp	x22, _F_SETFL@GOTPAGE
Lloh20:
	ldr	x22, [x22, _F_SETFL@GOTPAGEOFF]
	ldr	w1, [x22]
Lloh21:
	adrp	x23, _O_NONBLOCK@GOTPAGE
Lloh22:
	ldr	x23, [x23, _O_NONBLOCK@GOTPAGEOFF]
	ldr	w2, [x23]
	bl	_fcntl
	tbnz	x0, #63, LBB0_15
; %bb.5:
	mov	w8, #49152
	cmp	w21, #0
	csel	w8, w8, w21, lt
	str	w8, [x19, #16]
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #12
	bl	_os_memset
	ldr	w8, [x24]
	ldr	w9, [x20]
	stp	w9, w8, [sp, #20]
	ldr	w0, [x19, #16]
Lloh23:
	adrp	x24, _errno@GOTPAGE
Lloh24:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
Lloh25:
	adrp	x25, _EADDRINUSE@GOTPAGE
Lloh26:
	ldr	x25, [x25, _EADDRINUSE@GOTPAGEOFF]
	mov	w26, #65535
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	bl	_htons
	str	w0, [sp, #16]
	ldr	x0, [x19, #8]
	add	x1, sp, #16
	mov	w2, #12
	bl	_bind
	cbz	x0, LBB0_10
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x0, [x24]
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	w8, [x19, #16]
	add	w0, w8, #1
	str	w0, [x19, #16]
	tbz	w21, #31, LBB0_15
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w0, w26
	b.ne	LBB0_6
	b	LBB0_15
LBB0_10:
	ldr	x0, [x19, #8]
	mov	w1, #10
	bl	_listen
	tbnz	x0, #63, LBB0_15
; %bb.11:
	ldr	x0, [x19, #8]
	ldr	w1, [x22]
	ldr	w2, [x23]
	bl	_fcntl
	tbnz	x0, #63, LBB0_15
; %bb.12:
	ldr	x0, [x19, #8]
Lloh27:
	adrp	x8, _EVENT_TYPE_READ@GOTPAGE
Lloh28:
	ldr	x8, [x8, _EVENT_TYPE_READ@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
Lloh30:
	adrp	x8, _http_server_cb@GOTPAGE
Lloh31:
	ldr	x8, [x8, _http_server_cb@GOTPAGEOFF]
Lloh32:
	ldr	w2, [x8]
	mov	x3, x19
	mov	x4, #0
	bl	_eloop_register_sock
	cbnz	x0, LBB0_15
; %bb.13:
Lloh33:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh34:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh35:
	ldr	w21, [x8]
	ldr	w0, [x20]
	bl	_inet_ntoa
	mov	x2, x0
	ldr	w8, [x19, #16]
	str	x8, [sp]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_wpa_printf
	b	LBB0_16
LBB0_14:
Lloh38:
	adrp	x8, _MSG_DEBUG@GOTPAGE
Lloh39:
	ldr	x8, [x8, _MSG_DEBUG@GOTPAGEOFF]
Lloh40:
	ldr	w20, [x8]
	ldr	w21, [x19, #16]
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh41:
	adrp	x1, l_.str.1@PAGE
Lloh42:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	mov	x2, x21
	bl	_wpa_printf
LBB0_15:
	mov	x0, x19
	bl	_http_server_deinit
	mov	x19, #0
LBB0_16:
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_AF_INET,4,2                    ; @AF_INET
	.comm	_SOCK_STREAM,4,2                ; @SOCK_STREAM
	.comm	_SOL_SOCKET,4,2                 ; @SOL_SOCKET
	.comm	_SO_REUSEADDR,4,2               ; @SO_REUSEADDR
	.comm	_MSG_DEBUG,4,2                  ; @MSG_DEBUG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"HTTP: setsockopt(SO_REUSEADDR) failed: %s"

	.comm	_errno,8,3                      ; @errno
	.comm	_F_SETFL,4,2                    ; @F_SETFL
	.comm	_O_NONBLOCK,4,2                 ; @O_NONBLOCK
	.comm	_EADDRINUSE,8,3                 ; @EADDRINUSE
l_.str.1:                               ; @.str.1
	.asciz	"HTTP: Failed to bind server port %d: %s"

	.comm	_EVENT_TYPE_READ,4,2            ; @EVENT_TYPE_READ
	.comm	_http_server_cb,4,2             ; @http_server_cb
l_.str.2:                               ; @.str.2
	.asciz	"HTTP: Started server on %s:%d"

.subsections_via_symbols
