	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	%edi, %ebx
	movq	_STDIN_FILENO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ptsname
	movq	_EX_USAGE@GOTPCREL(%rip), %r12
	testq	%rax, %rax
	je	LBB0_13
## %bb.1:
	movq	%rax, %r15
	movl	%ebx, %eax
	andl	$-2, %eax
	cmpl	$2, %eax
	jne	LBB0_9
## %bb.2:
	movq	8(%r14), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
LBB0_9:
	cmpl	$2, %ebx
	jne	LBB0_13
## %bb.10:
	movq	8(%r14), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_13
## %bb.11:
	movq	%r15, %rdi
	callq	_ulog_logout
	jmp	LBB0_12
LBB0_3:
	xorl	%eax, %eax
	callq	_get_username
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	cmpl	$3, %ebx
	jne	LBB0_6
## %bb.7:
	movq	16(%r14), %rdx
	jmp	LBB0_8
LBB0_4:
	movq	_EX_OSERR@GOTPCREL(%rip), %r12
	jmp	LBB0_13
LBB0_6:
	xorl	%edx, %edx
LBB0_8:
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_ulog_login
LBB0_12:
	movq	_EX_OK@GOTPCREL(%rip), %r12
LBB0_13:
	movl	(%r12), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STDIN_FILENO,4,2               ## @STDIN_FILENO
	.comm	_EX_USAGE,4,2                   ## @EX_USAGE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"login"

	.comm	_EX_OSERR,4,2                   ## @EX_OSERR
	.comm	_EX_OK,4,2                      ## @EX_OK
L_.str.1:                               ## @.str.1
	.asciz	"logout"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _STDIN_FILENO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STDIN_FILENO@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_ptsname
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	and	w8, w21, #0xfffffffe
	cmp	w8, #2
	b.ne	LBB0_3
; %bb.2:
	ldr	x0, [x20, #8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_7
LBB0_3:
	cmp	w21, #2
	b.ne	LBB0_5
; %bb.4:
	ldr	x0, [x20, #8]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_10
LBB0_5:
Lloh7:
	adrp	x8, _EX_USAGE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EX_USAGE@GOTPAGEOFF]
LBB0_6:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	bl	_get_username
	cbz	x0, LBB0_11
; %bb.8:
	mov	x1, x0
	cmp	w21, #3
	b.ne	LBB0_12
; %bb.9:
	ldr	x2, [x20, #16]
	b	LBB0_13
LBB0_10:
	mov	x0, x19
	bl	_ulog_logout
	b	LBB0_14
LBB0_11:
Lloh9:
	adrp	x8, _EX_OSERR@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EX_OSERR@GOTPAGEOFF]
	b	LBB0_6
LBB0_12:
	mov	x2, #0
LBB0_13:
	mov	x0, x19
	bl	_ulog_login
LBB0_14:
Lloh11:
	adrp	x8, _EX_OK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EX_OK@GOTPAGEOFF]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_STDIN_FILENO,4,2               ; @STDIN_FILENO
	.comm	_EX_USAGE,4,2                   ; @EX_USAGE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"login"

	.comm	_EX_OSERR,4,2                   ; @EX_OSERR
	.comm	_EX_OK,4,2                      ; @EX_OK
l_.str.1:                               ; @.str.1
	.asciz	"logout"

.subsections_via_symbols
