	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_if                       ## -- Begin function setup_if
	.p2align	4, 0x90
_setup_if:                              ## @setup_if
	.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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	_PF_INET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_SOCK_DGRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_socket
	movl	%eax, %ebx
	cmpl	$-1, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_2:
	leaq	-80(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	-60(%rbp), %edi
	leaq	L_.str.1(%rip), %rdx
	movl	$4, %esi
	movq	%r14, %rcx
	callq	_snprintf
	movq	_IEEE80211_IOC_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -64(%rbp)
	movl	%r15d, -80(%rbp)
	movq	_SIOCS80211@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movq	%r12, %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_4:
	leaq	-56(%rbp), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movl	-44(%rbp), %edi
	leaq	L_.str.1(%rip), %rdx
	movl	$4, %esi
	movq	%r14, %rcx
	callq	_snprintf
	movq	_SIOCGIFFLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	movq	%r15, %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_6:
	movzwl	-52(%rbp), %eax
	movq	_IFF_UP@GOTPCREL(%rip), %rcx
	movq	_IFF_PPROMISC@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	-48(%rbp), %ecx
	shll	$16, %ecx
	orl	%eax, %ecx
	orl	%ecx, %edx
	movzwl	%dx, %eax
	movl	%eax, -52(%rbp)
	shrl	$16, %edx
	movl	%edx, -48(%rbp)
	movq	_SIOCSIFFLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movl	%ebx, %edi
	callq	_ioctl
	cmpl	$-1, %eax
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.4(%rip), %rsi
	movl	$1, %edi
	callq	_err
LBB0_8:
	movl	%ebx, %edi
	callq	_close
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PF_INET,4,2                    ## @PF_INET
	.comm	_SOCK_DGRAM,4,2                 ## @SOCK_DGRAM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"socket()"

L_.str.1:                               ## @.str.1
	.asciz	"%s"

	.comm	_IEEE80211_IOC_CHANNEL,4,2      ## @IEEE80211_IOC_CHANNEL
	.comm	_SIOCS80211,4,2                 ## @SIOCS80211
L_.str.2:                               ## @.str.2
	.asciz	"ioctl(SIOCS80211)"

	.comm	_SIOCGIFFLAGS,4,2               ## @SIOCGIFFLAGS
L_.str.3:                               ## @.str.3
	.asciz	"ioctl(SIOCGIFFLAGS)"

	.comm	_IFF_UP,4,2                     ## @IFF_UP
	.comm	_IFF_PPROMISC,4,2               ## @IFF_PPROMISC
	.comm	_SIOCSIFFLAGS,4,2               ## @SIOCSIFFLAGS
L_.str.4:                               ## @.str.4
	.asciz	"ioctl(SIOCSIFFLAGS)"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_if                       ; -- Begin function setup_if
	.p2align	2
_setup_if:                              ; @setup_if
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _PF_INET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PF_INET@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _SOCK_DGRAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SOCK_DGRAM@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_socket
	mov	x19, x0
	cmn	w0, #1
	b.ne	LBB0_2
; %bb.1:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
	mov	x0, sp
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w0, [sp, #20]
Lloh8:
	adrp	x2, l_.str.1@PAGE
Lloh9:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	mov	x3, x20
	bl	_snprintf
Lloh10:
	adrp	x8, _IEEE80211_IOC_CHANNEL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IEEE80211_IOC_CHANNEL@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	str	w8, [sp, #16]
	str	w21, [sp]
Lloh13:
	adrp	x8, _SIOCS80211@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SIOCS80211@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_4
; %bb.3:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_4:
	add	x0, sp, #24
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	w0, [sp, #36]
Lloh18:
	adrp	x2, l_.str.1@PAGE
Lloh19:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	w1, #4
	mov	x3, x20
	bl	_snprintf
Lloh20:
	adrp	x8, _SIOCGIFFLAGS@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SIOCGIFFLAGS@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_6
; %bb.5:
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_6:
	ldrh	w8, [sp, #28]
	ldr	w9, [sp, #32]
	bfi	w8, w9, #16, #16
Lloh25:
	adrp	x9, _IFF_UP@GOTPAGE
Lloh26:
	ldr	x9, [x9, _IFF_UP@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
Lloh28:
	adrp	x10, _IFF_PPROMISC@GOTPAGE
Lloh29:
	ldr	x10, [x10, _IFF_PPROMISC@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
	orr	w9, w10, w9
	orr	w8, w9, w8
	and	w9, w8, #0xffff
	lsr	w8, w8, #16
	stp	w9, w8, [sp, #28]
Lloh31:
	adrp	x8, _SIOCSIFFLAGS@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SIOCSIFFLAGS@GOTPAGEOFF]
Lloh33:
	ldr	w1, [x8]
	add	x2, sp, #24
	mov	x0, x19
	bl	_ioctl
	cmn	w0, #1
	b.ne	LBB0_8
; %bb.7:
Lloh34:
	adrp	x1, l_.str.4@PAGE
Lloh35:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_8:
	mov	x0, x19
	bl	_close
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_PF_INET,4,2                    ; @PF_INET
	.comm	_SOCK_DGRAM,4,2                 ; @SOCK_DGRAM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"socket()"

l_.str.1:                               ; @.str.1
	.asciz	"%s"

	.comm	_IEEE80211_IOC_CHANNEL,4,2      ; @IEEE80211_IOC_CHANNEL
	.comm	_SIOCS80211,4,2                 ; @SIOCS80211
l_.str.2:                               ; @.str.2
	.asciz	"ioctl(SIOCS80211)"

	.comm	_SIOCGIFFLAGS,4,2               ; @SIOCGIFFLAGS
l_.str.3:                               ; @.str.3
	.asciz	"ioctl(SIOCGIFFLAGS)"

	.comm	_IFF_UP,4,2                     ; @IFF_UP
	.comm	_IFF_PPROMISC,4,2               ; @IFF_PPROMISC
	.comm	_SIOCSIFFLAGS,4,2               ; @SIOCSIFFLAGS
l_.str.4:                               ; @.str.4
	.asciz	"ioctl(SIOCSIFFLAGS)"

.subsections_via_symbols
