// File: /workspace/github_c_makefile_star2_O2/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_std_input_zaInputOpenState_refillzebufferzx
static void mw_std_input_zaInputOpenState_refillzebufferzx (struct std_input_zaInputOpenState* in_zaInputOpenState_1, struct std_input_zaInput *out_zaInput_2) {
	ARR* r3 = in_zaInputOpenState_1->mzabuffer;
	ARR* v4;
	void* v5 = mw_std_buffer_zaBuffer_base(r3, &v4);
	ARR* v6;
	INT v7 = mw_std_buffer_zaBuffer_sizze(v4, &v6);
	in_zaInputOpenState_1->mzabuffer = v6;
	struct std_file_zaFile* r8 = in_zaInputOpenState_1->mzafile;
	struct std_file_zaFile* v9;
	struct std_result_Result_2 v10 = mw_std_file_zaFile_readzebyteszx(r8, v5, v7, &v9);
	in_zaInputOpenState_1->mzafile = v9;
	struct std_maybe_Maybe_1 v11 = mw_std_result_Result_2_okzy(v10);
	struct std_maybe_Maybe_1 branch_Maybe_12;
	switch ((v11).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v13 = mtp_std_maybe_Maybe_1_Some(v11);
			incref(v13);
			INT v14 = WRAP_I63(0LL);
			INT v15 = v14;
			bool v16 = int_lt(v15, value_int(v13));
			struct std_maybe_Maybe_1 branch_Maybe_17;
			if (v16) {
				struct std_maybe_Maybe_1 v18 = mtw_std_maybe_Maybe_1_Some(v13);
				branch_Maybe_17 = v18;
			} else {
				decref(v13);
				struct std_maybe_Maybe_1 v19 = { .tag=std_maybe_Maybe_1_None };
				branch_Maybe_17 = v19;
			}
			branch_Maybe_12 = branch_Maybe_17;
		} break;
		case std_maybe_Maybe_1_None: {
			struct std_maybe_Maybe_1 v20 = { .tag=std_maybe_Maybe_1_None };
			branch_Maybe_12 = v20;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	struct std_input_zaInput branch_zaInput_21;
	switch ((branch_Maybe_12).tag) {
		case std_maybe_Maybe_1_Some: {
			VAL v22 = mtp_std_maybe_Maybe_1_Some(branch_Maybe_12);
			INT v23 = in_zaInputOpenState_1->mlength;
			decref(MKINT(v23));
			in_zaInputOpenState_1->mlength = value_int(v22);
			INT v24 = WRAP_I63(0LL);
			INT v25 = in_zaInputOpenState_1->moffset;
			decref(MKINT(v25));
			in_zaInputOpenState_1->moffset = v24;
			struct std_input_zaInput v26;
			mtw_std_input_zaInput_Open(in_zaInputOpenState_1, &v26);
			branch_zaInput_21 = v26;
		} break;
		case std_maybe_Maybe_1_None: {
			struct std_file_zaFile* v27;
			mw_std_input_zaInputOpenState_endzx(in_zaInputOpenState_1, &v27);
			struct std_input_zaInput v28;
			mtw_std_input_zaInput_Done(v27, &v28);
			branch_zaInput_21 = v28;
		} break;
		default: {
			do_panic(str_make("unexpected fallthrough in match\n", 32));
		}
	}
	*out_zaInput_2 = branch_zaInput_21;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, -0x40(%rbp)
movq %rdi, %rbx
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
movq 0x18(%rdi), %rdi
leaq -0x58(%rbp), %r15
movq %r15, %rsi
callq 0x10d9d
movq %rax, %r12
movq (%r15), %rdi
leaq -0x50(%rbp), %r15
movq %r15, %rsi
callq 0x10e41
movq (%r15), %rcx
movq %rcx, 0x18(%rbx)
movq %rbx, -0x30(%rbp)
movq 0x10(%rbx), %rcx
movq %rcx, -0x38(%rbp)
movq (%rcx), %r15
movq %rax, %rdi
callq 0xdc43
movl %r15d, %edi
movq %r12, %rsi
movq %rax, %rdx
callq 0x50a0
movslq %eax, %rdi
callq 0xd86d
movq %rax, %r12
movq %rax, %rbx
andq %r14, %rbx
setne %al
testb $0x3, %r12b
sete %r14b
andb %al, %r14b
cmpb $0x1, %r14b
jne 0x72a59
incl (%rbx)
movslq %r15d, %r15
leaq 0x959c6(%rip), %r13     # 0x108429
pushq $0x1
popq %rdi
movq %r12, %rsi
callq 0xdfd4
testb %al, %al
je 0x72ba1
movq %r12, %rdi
movq %r13, %rsi
callq 0xfce4
movq %rdx, %rdi
movq -0x38(%rbp), %r14
movq %r15, (%r14)
callq 0x8985
movq %rax, %rdi
movq %rdx, %rsi
callq 0xfce4
movq %rdx, %rdi
movq -0x30(%rbp), %rbx
movq %r14, 0x10(%rbx)
callq 0x8985
movq %rax, %rdi
movq %rdx, %rsi
callq 0x8d0c
movq %rdx, %rdi
callq 0xd491
movq %rax, %r13
movq %rdx, %r12
testb $0x1, %r12b
movabsq $0xfffffffffffc, %r14   # imm = 0xFFFFFFFFFFFC
je 0x72aea
movq %r13, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x72aea
incl (%rax)
movq %r13, %rdi
movq %r12, %rsi
callq 0xff62
pushq $0x1
popq %rdi
movq %r13, %rsi
callq 0x89cc
testb %al, %al
je 0x72c54
movq %r13, %rdi
movq %r12, %rsi
callq 0x8d0c
movq %rdx, %rdi
callq 0xd491
movq %rax, %r12
movq %rdx, %r13
movq (%rbx), %rdi
movq %rdi, %rax
andq %r14, %rax
sete %cl
testb $0x3, %dil
setne %dl
orb %cl, %dl
leaq 0x958ec(%rip), %r15     # 0x108429
jne 0x72b4b
decl (%rax)
jne 0x72b4b
movq %r15, %rsi
callq 0xce94
movq %r12, %rdi
movq %r13, %rsi
callq 0xff62
movq %r12, (%rbx)
movq 0x8(%rbx), %rdi
andq %rdi, %r14
sete %al
testb $0x3, %dil
setne %cl
orb %al, %cl
jne 0x72b7b
decl (%r14)
jne 0x72b7b
movq %r15, %rsi
callq 0xce94
movq $0x1, 0x8(%rbx)
pushq $0x1
popq %rdi
pushq $0x8
popq %rsi
callq 0x50c0
testq %rax, %rax
je 0x72ccb
movq %rbx, (%rax)
xorl %ecx, %ecx
jmp 0x72ca6
testb %r14b, %r14b
je 0x72bb5
decl (%rbx)
jne 0x72bb5
movq %r12, %rdi
movq %r13, %rsi
callq 0xce94
callq 0x728d6
leaq 0x954f7(%rip), %rsi     # 0x1080b8
movq %rax, %rdi
callq 0xfc90
movq %rdx, %rdi
movq -0x38(%rbp), %r14
movq %r15, (%r14)
callq 0x89da
movq %rax, %r15
movq %rax, %rdi
movq %rdx, %rsi
callq 0x72788
pushq $0x1
popq %rdi
pushq $0x10
popq %rsi
callq 0x50c0
testq %rax, %rax
je 0x72cc2
movl $0x1, (%rax)
movq %r15, 0x8(%rax)
btsq $0x32, %rax
leaq 0x96fb9(%rip), %rsi     # 0x109bc9
movq %rax, %rdi
callq 0xfc90
movq %rdx, %rdi
movq -0x30(%rbp), %rbx
movq %r14, 0x10(%rbx)
callq 0x89da
testb $0x1, %dl
movabsq $0xfffffffffffc, %rdi   # imm = 0xFFFFFFFFFFFC
je 0x72c7d
andq %rax, %rdi
sete %cl
testb $0x3, %al
setne %sil
orb %cl, %sil
jne 0x72c7d
decl (%rdi)
jne 0x72c7d
movq %rax, %rdi
movq %rdx, %rsi
jmp 0x72c78
testb $0x1, %r12b
je 0x72c7d
movq %r13, %rax
andq %r14, %rax
sete %cl
testb $0x3, %r13b
setne %dl
orb %cl, %dl
jne 0x72c7d
decl (%rax)
jne 0x72c7d
movq %r13, %rdi
movq %r12, %rsi
callq 0xce94
leaq -0x48(%rbp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x72cea
movq (%r15), %rdi
leaq -0x68(%rbp), %r14
movq %r14, %rsi
callq 0x72d82
movl (%r14), %ecx
movl 0x4(%r14), %edx
movq 0x8(%r14), %rax
movq -0x40(%rbp), %rsi
movl %ecx, (%rsi)
movl %edx, 0x4(%rsi)
movq %rax, 0x8(%rsi)
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x69611(%rip), %rsi     # 0xdc2da
jmp 0x72cd2
leaq 0x6963a(%rip), %rsi     # 0xdc30c
pushq $0x2
popq %rdi
pushq $0x31
popq %rdx
callq 0x5060
callq 0x52ae
pushq $0x1
popq %rdi
callq 0x5130