	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function show_dialog
_show_dialog:                           ## @show_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	$136, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movaps	L___const.show_dialog.tmp_name(%rip), %xmm0
	movaps	%xmm0, -80(%rbp)
	movl	$5789784, -64(%rbp)             ## imm = 0x585858
	leaq	-80(%rbp), %rdi
	callq	_mkstemp
	cmpl	$-1, %eax
	je	LBB0_28
## %bb.1:
	movl	%eax, %ebx
	movq	_menu@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	leaq	-168(%rbp), %rdi
	callq	_asprintf
	movq	_font@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.2:
	movq	_font_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%r14), %rdi
	callq	_vidcontrol
LBB0_4:
	movl	%ebx, -172(%rbp)                ## 4-byte Spill
	testl	%r13d, %r13d
	movq	%r12, -160(%rbp)                ## 8-byte Spill
	jle	LBB0_5
## %bb.6:
	movl	%r13d, %r14d
	xorl	%ebx, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12,%rbx,8), %rax
	movq	(%rax), %rdi
	callq	_strlen
	addl	%r15d, %eax
	addl	$6, %eax
	incq	%rbx
	movslq	%eax, %r15
	cmpq	%rbx, %r14
	jne	LBB0_7
## %bb.8:
	addq	$3, %r15
	jmp	LBB0_9
LBB0_5:
	movl	$3, %r15d
LBB0_9:
	leaq	-80(%rbp), %rdi
	callq	_strlen
	movq	%rax, %r14
	addl	%r15d, %r14d
	movq	-168(%rbp), %rdi
	callq	_strlen
	movslq	%r14d, %rcx
	leaq	(%rax,%rcx), %rdi
	incq	%rdi
	callq	_malloc
	movq	%rax, %r14
	movq	-168(%rbp), %rsi
	movq	%rax, %rdi
	callq	_strcpy
	movl	%r13d, -148(%rbp)               ## 4-byte Spill
	testl	%r13d, %r13d
	movq	-160(%rbp), %rbx                ## 8-byte Reload
	jle	LBB0_12
## %bb.10:
	movl	-148(%rbp), %r12d               ## 4-byte Reload
	xorl	%r13d, %r13d
	leaq	L_.str.4(%rip), %r15
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcat
	movq	(%rbx,%r13,8), %rax
	movq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_strcat
	movq	%r14, %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_strcat
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_strcat
	incq	%r13
	cmpq	%r13, %r12
	jne	LBB0_11
LBB0_12:
	leaq	L_.str.5(%rip), %rsi
	movq	%r14, %rdi
	callq	_strcat
	leaq	-80(%rbp), %rbx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_strcat
	movq	%r14, %rdi
	callq	_system
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_25
## %bb.13:
	movq	%rax, %r13
	leaq	-144(%rbp), %rdi
	movl	$64, %esi
	movq	%rax, %rdx
	callq	_fgets
	testq	%rax, %rax
	je	LBB0_21
## %bb.14:
	movl	-148(%rbp), %eax                ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_24
## %bb.15:
	movl	%eax, %r12d
	xorl	%ebx, %ebx
	leaq	-144(%rbp), %r15
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	-160(%rbp), %rax                ## 8-byte Reload
	movq	(%rax,%rbx,8), %rax
	movq	(%rax), %rsi
	movq	%r15, %rdi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_17
## %bb.20:                              ##   in Loop: Header=BB0_16 Depth=1
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_16
	jmp	LBB0_24
LBB0_25:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.8(%rip), %rsi
	xorl	%eax, %eax
	callq	_fprintf
	jmp	LBB0_26
LBB0_21:
	movq	_font@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.22:
	movq	_font_current@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_24
## %bb.23:
	movq	(%rbx), %rdi
	callq	_vidcontrol
	jmp	LBB0_24
LBB0_17:
	movq	_program@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.7(%rip), %rsi
	callq	_strcmp
	movq	-160(%rbp), %rcx                ## 8-byte Reload
	movq	(%rcx,%rbx,8), %rdi
	testq	%rax, %rax
	je	LBB0_18
## %bb.19:
	callq	_do_vidfont
	jmp	LBB0_24
LBB0_18:
	callq	_do_kbdcontrol
LBB0_24:
	movq	%r13, %rdi
	callq	_fclose
LBB0_26:
	leaq	-80(%rbp), %rdi
	callq	_remove
	movq	%r14, %rdi
	callq	_free
	movq	-168(%rbp), %rdi
	callq	_free
	movl	-172(%rbp), %edi                ## 4-byte Reload
	callq	_close
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_29
## %bb.27:
	addq	$136, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	leaq	-80(%rbp), %rdx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
LBB0_29:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
	.p2align	4                               ## @__const.show_dialog.tmp_name
L___const.show_dialog.tmp_name:
	.asciz	"/tmp/_kbd_lang.XXXX"

	.comm	_stderr,4,2                     ## @stderr
L_.str:                                 ## @.str
	.asciz	"Could not open temporary file \"%s\"\n"

L_.str.1:                               ## @.str.1
	.asciz	"/usr/bin/dialog --clear --title \"Keyboard Menu\" --menu \"%s\" 0 0 0"

	.comm	_menu,4,2                       ## @menu
	.comm	_font,8,3                       ## @font
	.comm	_font_current,8,3               ## @font_current
L_.str.2:                               ## @.str.2
	.asciz	" \""

L_.str.3:                               ## @.str.3
	.asciz	"\""

L_.str.4:                               ## @.str.4
	.asciz	" \"\""

L_.str.5:                               ## @.str.5
	.asciz	" 2>"

L_.str.6:                               ## @.str.6
	.asciz	"r"

	.comm	_program,8,3                    ## @program
L_.str.7:                               ## @.str.7
	.asciz	"kbdmap"

L_.str.8:                               ## @.str.8
	.asciz	"Failed to open temporary file"

	.no_dead_strip	_show_dialog
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function show_dialog
_show_dialog:                           ; @show_dialog
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, l___const.show_dialog.tmp_name@PAGE
Lloh4:
	add	x8, x8, l___const.show_dialog.tmp_name@PAGEOFF
Lloh5:
	ldr	q0, [x8]
	str	q0, [sp, #80]
	mov	w8, #22616
	movk	w8, #88, lsl #16
	str	w8, [sp, #96]
	add	x22, sp, #80
	add	x0, sp, #80
	bl	_mkstemp
	cmn	w0, #1
	b.eq	LBB0_28
; %bb.1:
	mov	x19, x0
Lloh6:
	adrp	x8, _menu@GOTPAGE
Lloh7:
	ldr	x8, [x8, _menu@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_asprintf
Lloh11:
	adrp	x26, _font@GOTPAGE
Lloh12:
	ldr	x26, [x26, _font@GOTPAGEOFF]
	ldr	x0, [x26]
	cbz	x0, LBB0_4
; %bb.2:
Lloh13:
	adrp	x8, _font_current@GOTPAGE
Lloh14:
	ldr	x8, [x8, _font_current@GOTPAGEOFF]
Lloh15:
	ldr	x1, [x8]
	bl	_strcmp
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x0, [x26]
	bl	_vidcontrol
LBB0_4:
	cmp	w21, #1
	b.lt	LBB0_8
; %bb.5:
	mov	x23, #0
	mov	w22, w21
	mov	x24, x20
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24], #8
	ldr	x0, [x8]
	bl	_strlen
	add	w8, w23, w0
	add	w8, w8, #6
	sxtw	x23, w8
	subs	x22, x22, #1
	b.ne	LBB0_6
; %bb.7:
	add	x22, x23, #3
	b	LBB0_9
LBB0_8:
	mov	w22, #3
LBB0_9:
	add	x0, sp, #80
	bl	_strlen
	add	w22, w22, w0
	ldr	x0, [sp, #8]
	bl	_strlen
	add	x8, x0, w22, sxtw
	add	x0, x8, #1
	bl	_malloc
	mov	x22, x0
	ldr	x1, [sp, #8]
	bl	_strcpy
	cmp	w21, #1
	b.lt	LBB0_12
; %bb.10:
Lloh16:
	adrp	x23, l_.str.2@PAGE
Lloh17:
	add	x23, x23, l_.str.2@PAGEOFF
	mov	w27, w21
Lloh18:
	adrp	x24, l_.str.3@PAGE
Lloh19:
	add	x24, x24, l_.str.3@PAGEOFF
	mov	x28, x20
Lloh20:
	adrp	x25, l_.str.4@PAGE
Lloh21:
	add	x25, x25, l_.str.4@PAGEOFF
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x23
	bl	_strcat
	ldr	x8, [x28], #8
	ldr	x1, [x8]
	mov	x0, x22
	bl	_strcat
	mov	x0, x22
	mov	x1, x24
	bl	_strcat
	mov	x0, x22
	mov	x1, x25
	bl	_strcat
	subs	x27, x27, #1
	b.ne	LBB0_11
LBB0_12:
Lloh22:
	adrp	x1, l_.str.5@PAGE
Lloh23:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x22
	bl	_strcat
	add	x1, sp, #80
	mov	x0, x22
	bl	_strcat
	mov	x0, x22
	bl	_system
Lloh24:
	adrp	x1, l_.str.6@PAGE
Lloh25:
	add	x1, x1, l_.str.6@PAGEOFF
	add	x0, sp, #80
	bl	_fopen
	cbz	x0, LBB0_18
; %bb.13:
	mov	x23, x0
	add	x0, sp, #16
	mov	w1, #64
	mov	x2, x23
	bl	_fgets
	cbz	x0, LBB0_19
; %bb.14:
	cmp	w21, #1
	b.lt	LBB0_25
; %bb.15:
	mov	w21, w21
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x1, [x8]
	add	x0, sp, #16
	bl	_strcmp
	cbz	x0, LBB0_22
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	add	x20, x20, #8
	subs	x21, x21, #1
	b.ne	LBB0_16
	b	LBB0_25
LBB0_18:
Lloh26:
	adrp	x8, _stderr@GOTPAGE
Lloh27:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
Lloh29:
	adrp	x1, l_.str.8@PAGE
Lloh30:
	add	x1, x1, l_.str.8@PAGEOFF
	bl	_fprintf
	b	LBB0_26
LBB0_19:
	ldr	x0, [x26]
	cbz	x0, LBB0_25
; %bb.20:
Lloh31:
	adrp	x20, _font_current@GOTPAGE
Lloh32:
	ldr	x20, [x20, _font_current@GOTPAGEOFF]
	ldr	x1, [x20]
	bl	_strcmp
	cbz	x0, LBB0_25
; %bb.21:
	ldr	x0, [x20]
	bl	_vidcontrol
	b	LBB0_25
LBB0_22:
Lloh33:
	adrp	x8, _program@GOTPAGE
Lloh34:
	ldr	x8, [x8, _program@GOTPAGEOFF]
Lloh35:
	ldr	x0, [x8]
Lloh36:
	adrp	x1, l_.str.7@PAGE
Lloh37:
	add	x1, x1, l_.str.7@PAGEOFF
	bl	_strcmp
	mov	x8, x0
	ldr	x0, [x20]
	cbz	x8, LBB0_24
; %bb.23:
	bl	_do_vidfont
	b	LBB0_25
LBB0_24:
	bl	_do_kbdcontrol
LBB0_25:
	mov	x0, x23
	bl	_fclose
LBB0_26:
	add	x0, sp, #80
	bl	_remove
	mov	x0, x22
	bl	_free
	ldr	x0, [sp, #8]
	bl	_free
	mov	x0, x19
	bl	_close
	ldur	x8, [x29, #-88]
Lloh38:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh39:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_29
; %bb.27:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_28:
Lloh41:
	adrp	x8, _stderr@GOTPAGE
Lloh42:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	str	x22, [sp]
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	bl	_exit
LBB0_29:
	bl	___stack_chk_fail
	.loh AdrpAddLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l___const.show_dialog.tmp_name:         ; @__const.show_dialog.tmp_name
	.asciz	"/tmp/_kbd_lang.XXXX"

	.comm	_stderr,4,2                     ; @stderr
l_.str:                                 ; @.str
	.asciz	"Could not open temporary file \"%s\"\n"

l_.str.1:                               ; @.str.1
	.asciz	"/usr/bin/dialog --clear --title \"Keyboard Menu\" --menu \"%s\" 0 0 0"

	.comm	_menu,4,2                       ; @menu
	.comm	_font,8,3                       ; @font
	.comm	_font_current,8,3               ; @font_current
l_.str.2:                               ; @.str.2
	.asciz	" \""

l_.str.3:                               ; @.str.3
	.asciz	"\""

l_.str.4:                               ; @.str.4
	.asciz	" \"\""

l_.str.5:                               ; @.str.5
	.asciz	" 2>"

l_.str.6:                               ; @.str.6
	.asciz	"r"

	.comm	_program,8,3                    ; @program
l_.str.7:                               ; @.str.7
	.asciz	"kbdmap"

l_.str.8:                               ; @.str.8
	.asciz	"Failed to open temporary file"

	.no_dead_strip	_show_dialog
.subsections_via_symbols
