	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function g_write
_g_write:                               ## @g_write
	.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
	movl	%edx, %ebx
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r14
	callq	_lua_gettop
	movl	%eax, %r12d
	movl	$1, %eax
	cmpl	%ebx, %r12d
	je	LBB0_13
## %bb.1:
	movl	$1, %r15d
	movq	_LUA_TNUMBER@GOTPCREL(%rip), %r13
	jmp	LBB0_2
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	_LUA_NUMBER_FMT@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_lua_tonumber
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rax, %rdx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r13, %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_fprintf
	testl	%r15d, %r15d
	setne	%cl
	testl	%eax, %eax
	setg	%al
	andb	%cl, %al
	movq	_LUA_TNUMBER@GOTPCREL(%rip), %r13
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movzbl	%al, %r15d
	incl	%ebx
	cmpl	%ebx, %r12d
	je	LBB0_11
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_lua_type
	cmpq	(%r13), %rax
	jne	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_lua_isinteger
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	_LUA_INTEGER_FMT@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_lua_tointeger
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	leaq	-56(%rbp), %rdx
	callq	_luaL_checklstring
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	-56(%rbp), %rdx
	movq	%rax, %rdi
	movl	$1, %esi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_fwrite
	cmpq	-56(%rbp), %rax
	sete	%al
	jmp	LBB0_10
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	jmp	LBB0_10
LBB0_11:
	movl	$1, %eax
	testl	%r15d, %r15d
	jne	LBB0_13
## %bb.12:
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_luaL_fileresult
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LUA_TNUMBER,8,3                ## @LUA_TNUMBER
	.comm	_LUA_INTEGER_FMT,8,3            ## @LUA_INTEGER_FMT
	.comm	_LUA_NUMBER_FMT,8,3             ## @LUA_NUMBER_FMT
	.no_dead_strip	_g_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function g_write
_g_write:                               ; @g_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_lua_gettop
	cmp	w0, w20
	b.eq	LBB0_11
; %bb.1:
	mov	x22, x0
	mov	w27, #1
Lloh0:
	adrp	x24, _LUA_TNUMBER@GOTPAGE
Lloh1:
	ldr	x24, [x24, _LUA_TNUMBER@GOTPAGEOFF]
Lloh2:
	adrp	x25, _LUA_NUMBER_FMT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _LUA_NUMBER_FMT@GOTPAGEOFF]
Lloh4:
	adrp	x26, _LUA_INTEGER_FMT@GOTPAGE
Lloh5:
	ldr	x26, [x26, _LUA_INTEGER_FMT@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x23, [x25]
	mov	x0, x19
	mov	x1, x20
	bl	_lua_tonumber
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x2, x0
	mov	x0, x21
	mov	x1, x23
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_fprintf
	cmp	w27, #0
	ccmp	w0, #0, #4, ne
	cset	w27, gt
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w20, w20, #1
	cmp	w22, w20
	b.eq	LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_lua_type
	ldr	x8, [x24]
	cmp	x0, x8
	b.ne	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_lua_isinteger
	cbz	x0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x23, [x26]
	mov	x0, x19
	mov	x1, x20
	bl	_lua_tointeger
	b	LBB0_3
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x2, sp, #8
	mov	x0, x19
	mov	x1, x20
	bl	_luaL_checklstring
	cbz	w27, LBB0_4
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x2, [sp, #8]
	mov	w1, #1
	mov	x3, x21
	bl	_fwrite
	ldr	x8, [sp, #8]
	cmp	x0, x8
	cset	w27, eq
	b	LBB0_4
LBB0_10:
	tbz	w27, #0, LBB0_12
LBB0_11:
	mov	w0, #1
	b	LBB0_13
LBB0_12:
	mov	x0, x19
	mov	w1, #0
	mov	x2, #0
	bl	_luaL_fileresult
LBB0_13:
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_LUA_TNUMBER,8,3                ; @LUA_TNUMBER
	.comm	_LUA_INTEGER_FMT,8,3            ; @LUA_INTEGER_FMT
	.comm	_LUA_NUMBER_FMT,8,3             ; @LUA_NUMBER_FMT
	.no_dead_strip	_g_write
.subsections_via_symbols
