	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_dialog                    ## -- Begin function init_dialog
	.p2align	4, 0x90
_init_dialog:                           ## @init_dialog
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	$0, -48(%rbp)
	movq	_LC_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_setlocale
	movq	_dialog_state@GOTPCREL(%rip), %r14
	movq	%r15, 48(%r14)
	movq	_TAB_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%r14)
	movq	_DEFAULT_ASPECT_RATIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r14)
	movq	_stdin@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movq	%rax, 32(%r14)
	movq	%r13, %rdi
	callq	_fileno
	movq	%rax, %rbx
	movq	(%r12), %rdi
	callq	_fileno
	cmpq	%rax, %rbx
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jne	LBB0_1
## %bb.7:
	movq	(%r12), %rdi
	callq	_fileno
	movq	%rax, %rdi
	callq	_isatty
	testq	%rax, %rax
	jne	LBB0_16
## %bb.8:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_open_terminal
	testl	%eax, %eax
	js	LBB0_15
## %bb.9:
	movl	%eax, %ebx
	movq	(%r12), %rdi
	callq	_fileno
	movq	%rax, %rdi
	callq	_dup
	testl	%eax, %eax
	js	LBB0_14
## %bb.10:
	leaq	L_.str.1(%rip), %r15
	movl	%eax, %edi
	movq	%r15, %rsi
	callq	_fdopen
	movq	%rax, 32(%r14)
	movq	-48(%rbp), %rdi
	movq	(%r12), %rdx
	movq	%r15, %rsi
	callq	_freopen
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	leaq	L_.str.2(%rip), %rdi
	callq	_dlg_exiterr
LBB0_12:
	movq	(%r12), %rdi
	callq	_fileno
	testq	%rax, %rax
	je	LBB0_14
## %bb.13:
	movq	(%r12), %rdi
	callq	_fileno
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_dup2
LBB0_14:
	movl	%ebx, %edi
	callq	_close
LBB0_15:
	movq	-48(%rbp), %rdi
	callq	_free
	jmp	LBB0_16
LBB0_1:
	movq	%r13, %rdi
	callq	_fileno
	movq	%rax, %rdi
	callq	_dup
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.2:
	movq	_stdin@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_fileno
	movq	%rax, %rdi
	callq	_dup
	testl	%eax, %eax
	js	LBB0_5
## %bb.3:
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_fileno
	movq	%rax, %rbx
	movq	_stdin@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	callq	_fileno
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_dup2
	leaq	L_.str.1(%rip), %rsi
	movl	%r12d, %edi
	movq	%r13, %r12
	callq	_fdopen
	movq	%rax, 32(%r14)
	movq	(%r13), %rdi
	callq	_fileno
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	(%r12), %rdi
	callq	_fileno
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_dup2
	jmp	LBB0_6
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	callq	_dlg_exiterr
	movq	_stdin@GOTPCREL(%rip), %r12
LBB0_6:
	movl	%r15d, %edi
	callq	_close
LBB0_16:
	movq	_stdout@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	callq	_fileno
	movq	%rax, %rdi
	callq	_isatty
	testq	%rax, %rax
	je	LBB0_17
LBB0_25:
	movq	(%r15), %rax
	movq	%rax, 24(%r14)
	xorl	%eax, %eax
	callq	_initscr
	jmp	LBB0_26
LBB0_17:
	movq	(%r15), %rdi
	callq	_fileno
	movq	%rax, %rbx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_fileno
	cmpq	%rax, %rbx
	je	LBB0_19
## %bb.18:
	xorl	%eax, %eax
	callq	_dialog_tty
	testq	%rax, %rax
	je	LBB0_25
LBB0_19:
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdi
	callq	_open_terminal
	testl	%eax, %eax
	js	LBB0_24
## %bb.20:
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edi
	callq	_fdopen
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_24
## %bb.21:
	movq	(%r12), %rdx
	xorl	%edi, %edi
	movq	%rax, %rsi
	callq	_newterm
	testq	%rax, %rax
	jne	LBB0_23
## %bb.22:
	leaq	L_.str.4(%rip), %rdi
	callq	_dlg_exiterr
LBB0_23:
	movq	-48(%rbp), %rdi
	callq	_free
	jmp	LBB0_26
LBB0_24:
	leaq	L_.str.5(%rip), %rdi
	callq	_dlg_exiterr
LBB0_26:
	movq	_stdscr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_keypad
	xorl	%eax, %eax
	callq	_cbreak
	xorl	%eax, %eax
	callq	_noecho
	cmpl	$0, 20(%r14)
	jne	LBB0_28
## %bb.27:
	xorl	%eax, %eax
	callq	_mouse_open
LBB0_28:
	movl	(%rbx), %eax
	movl	%eax, 16(%r14)
	xorl	%eax, %eax
	callq	_dlg_clear
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LC_ALL,4,2                     ## @LC_ALL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_dialog_state,56,3              ## @dialog_state
	.comm	_TAB_LEN,4,2                    ## @TAB_LEN
	.comm	_DEFAULT_ASPECT_RATIO,4,2       ## @DEFAULT_ASPECT_RATIO
	.comm	_stdin,8,3                      ## @stdin
L_.str.1:                               ## @.str.1
	.asciz	"r"

L_.str.2:                               ## @.str.2
	.asciz	"cannot open tty-input"

	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_stdout,8,3                     ## @stdout
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
L_.str.3:                               ## @.str.3
	.asciz	"w"

L_.str.4:                               ## @.str.4
	.asciz	"cannot initialize curses"

L_.str.5:                               ## @.str.5
	.asciz	"cannot open tty-output"

	.comm	_stdscr,4,2                     ## @stdscr
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_USE_COLORS,8,3                 ## @USE_COLORS
	.comm	_USE_SHADOW,8,3                 ## @USE_SHADOW
	.comm	_clear_screen,8,3               ## @clear_screen
	.comm	_dialog_vars,4,2                ## @dialog_vars
	.comm	_enter_ca_mode,8,3              ## @enter_ca_mode
	.comm	_exit_ca_mode,8,3               ## @exit_ca_mode
	.comm	_key_mouse,8,3                  ## @key_mouse
	.comm	_my_putc,4,2                    ## @my_putc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_init_dialog                    ; -- Begin function init_dialog
	.p2align	2
_init_dialog:                           ; @init_dialog
	.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	x19, x1
	mov	x21, x0
	str	xzr, [sp, #8]
Lloh0:
	adrp	x8, _LC_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LC_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_setlocale
Lloh5:
	adrp	x23, _dialog_state@GOTPAGE
Lloh6:
	ldr	x23, [x23, _dialog_state@GOTPAGEOFF]
	str	x19, [x23, #48]
Lloh7:
	adrp	x8, _TAB_LEN@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TAB_LEN@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _DEFAULT_ASPECT_RATIO@GOTPAGE
Lloh11:
	ldr	x9, [x9, _DEFAULT_ASPECT_RATIO@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x23, #40]
Lloh13:
	adrp	x24, _stdin@GOTPAGE
Lloh14:
	ldr	x24, [x24, _stdin@GOTPAGEOFF]
	ldr	x8, [x24]
	str	x8, [x23, #32]
	mov	x0, x21
	bl	_fileno
	mov	x20, x0
	ldr	x0, [x24]
	bl	_fileno
	cmp	x20, x0
	b.ne	LBB0_10
; %bb.1:
	ldr	x0, [x24]
	bl	_fileno
	bl	_isatty
	cbnz	x0, LBB0_16
; %bb.2:
Lloh15:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_open_terminal
	tbnz	w0, #31, LBB0_9
; %bb.3:
	mov	x20, x0
	ldr	x0, [x24]
	bl	_fileno
	bl	_dup
	tbnz	w0, #31, LBB0_8
; %bb.4:
Lloh18:
	adrp	x21, l_.str.1@PAGE
Lloh19:
	add	x21, x21, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_fdopen
	str	x0, [x23, #32]
	ldr	x0, [sp, #8]
	ldr	x2, [x24]
	mov	x1, x21
	bl	_freopen
	cbnz	x0, LBB0_6
; %bb.5:
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dlg_exiterr
LBB0_6:
	ldr	x0, [x24]
	bl	_fileno
	cbz	x0, LBB0_8
; %bb.7:
	ldr	x0, [x24]
	bl	_fileno
	mov	x1, #0
	bl	_dup2
LBB0_8:
	mov	x0, x20
	bl	_close
LBB0_9:
	ldr	x0, [sp, #8]
	bl	_free
	b	LBB0_16
LBB0_10:
	mov	x0, x21
	bl	_fileno
	bl	_dup
	mov	x20, x0
	tbnz	w0, #31, LBB0_14
; %bb.11:
	ldr	x0, [x24]
	bl	_fileno
	bl	_dup
	tbnz	w0, #31, LBB0_14
; %bb.12:
	mov	x22, x0
	mov	x0, x21
	bl	_fileno
	mov	x21, x0
	ldr	x0, [x24]
	bl	_fileno
	mov	x1, x0
	mov	x0, x21
	bl	_dup2
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_fdopen
	str	x0, [x23, #32]
	ldr	x0, [x24]
	bl	_fileno
	cbz	x0, LBB0_15
; %bb.13:
	ldr	x0, [x24]
	bl	_fileno
	mov	x1, #0
	bl	_dup2
	b	LBB0_15
LBB0_14:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dlg_exiterr
LBB0_15:
	mov	x0, x20
	bl	_close
LBB0_16:
Lloh26:
	adrp	x21, _stdout@GOTPAGE
Lloh27:
	ldr	x21, [x21, _stdout@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_fileno
	bl	_isatty
	cbz	x0, LBB0_18
LBB0_17:
	ldr	x8, [x21]
	str	x8, [x23, #24]
	bl	_initscr
	b	LBB0_26
LBB0_18:
	ldr	x0, [x21]
	bl	_fileno
	mov	x20, x0
	mov	x0, x19
	bl	_fileno
	cmp	x20, x0
	b.eq	LBB0_20
; %bb.19:
	bl	_dialog_tty
	cbz	x0, LBB0_17
LBB0_20:
Lloh28:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh29:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	add	x0, sp, #8
	bl	_open_terminal
	tbnz	w0, #31, LBB0_25
; %bb.21:
Lloh31:
	adrp	x1, l_.str.3@PAGE
Lloh32:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fdopen
	str	x0, [x23, #24]
	cbz	x0, LBB0_25
; %bb.22:
	mov	x1, x0
	ldr	x2, [x24]
	mov	x0, #0
	bl	_newterm
	cbnz	x0, LBB0_24
; %bb.23:
Lloh33:
	adrp	x0, l_.str.4@PAGE
Lloh34:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_dlg_exiterr
LBB0_24:
	ldr	x0, [sp, #8]
	bl	_free
	b	LBB0_26
LBB0_25:
Lloh35:
	adrp	x0, l_.str.5@PAGE
Lloh36:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_dlg_exiterr
LBB0_26:
Lloh37:
	adrp	x8, _stdscr@GOTPAGE
Lloh38:
	ldr	x8, [x8, _stdscr@GOTPAGEOFF]
Lloh39:
	ldr	w0, [x8]
Lloh40:
	adrp	x19, _TRUE@GOTPAGE
Lloh41:
	ldr	x19, [x19, _TRUE@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	_keypad
	bl	_cbreak
	bl	_noecho
	ldr	w8, [x23, #20]
	cbnz	w8, LBB0_28
; %bb.27:
	bl	_mouse_open
LBB0_28:
	ldr	w8, [x19]
	str	w8, [x23, #16]
	bl	_dlg_clear
	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
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_LC_ALL,4,2                     ; @LC_ALL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_dialog_state,56,3              ; @dialog_state
	.comm	_TAB_LEN,4,2                    ; @TAB_LEN
	.comm	_DEFAULT_ASPECT_RATIO,4,2       ; @DEFAULT_ASPECT_RATIO
	.comm	_stdin,8,3                      ; @stdin
l_.str.1:                               ; @.str.1
	.asciz	"r"

l_.str.2:                               ; @.str.2
	.asciz	"cannot open tty-input"

	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_stdout,8,3                     ; @stdout
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
l_.str.3:                               ; @.str.3
	.asciz	"w"

l_.str.4:                               ; @.str.4
	.asciz	"cannot initialize curses"

l_.str.5:                               ; @.str.5
	.asciz	"cannot open tty-output"

	.comm	_stdscr,4,2                     ; @stdscr
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_USE_COLORS,8,3                 ; @USE_COLORS
	.comm	_USE_SHADOW,8,3                 ; @USE_SHADOW
	.comm	_clear_screen,8,3               ; @clear_screen
	.comm	_dialog_vars,4,2                ; @dialog_vars
	.comm	_enter_ca_mode,8,3              ; @enter_ca_mode
	.comm	_exit_ca_mode,8,3               ; @exit_ca_mode
	.comm	_key_mouse,8,3                  ; @key_mouse
	.comm	_my_putc,4,2                    ; @my_putc
.subsections_via_symbols
