// File: /workspace/github_c_makefile_star2_O0/mirth-lang[P]mirth/bin/mirth1.c
// Function: mw_std_prim_Nat_log2zeceil
static INT mw_std_prim_Nat_log2zeceil (INT in_Nat_1) {
	INT v3 = WRAP_I63(0LL);
	incref(MKNAT(in_Nat_1));
	INT v4 = WRAP_I63(1LL);
	INT v5 = in_Nat_1;
	INT v6 = v4;
	bool v7 = int_lt(v6, v5);
	INT v8 = v3;
	INT v9 = in_Nat_1;
	bool v10 = v7;
	while (v10) {
		INT v11 = v8;
		INT v12 = v9;
		INT v13 = WRAP_I63(2LL);
		INT v14 = v12;
		INT v15 = v13;
		INT v16;
		INT v17 = int_divmod(v14, v15, &v16);
		INT v18 = v16;
		INT v19 = v17;
		decref(MKNAT(v18));
		INT v20 = WRAP_I63(1LL);
		INT v21 = v11;
		INT v22 = v20;
		INT v23 = int_add(v21, v22);
		INT v24 = v23;
		incref(MKNAT(v19));
		INT v25 = WRAP_I63(1LL);
		INT v26 = v19;
		INT v27 = v25;
		bool v28 = int_lt(v27, v26);
		v10 = v28;
		v9 = v19;
		v8 = v24;
	}
	decref(MKNAT(v9));
	return v8;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x200, %rsp            # imm = 0x200
movq %rdi, -0x10(%rbp)
movq 0x16c03a(%rip), %rax    # 0x36ea50
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq 0x18e6e7(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x202abb
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x18e6c2(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x30(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x38(%rbp), %rax
cmpq $0x0, %rax
je 0x202abb
movq -0x10(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq 0x18e697(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x48(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x202abb
movq -0x10(%rbp), %rax
movq %rax, -0x58(%rbp)
leaq 0x18e672(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x50(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x58(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x202abd
movq 0x16bf94(%rip), %rax    # 0x36ea58
movq %rax, -0x60(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rdi
movq -0x68(%rbp), %rsi
callq 0xae20
andb $0x1, %al
movb %al, -0x71(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movb -0x71(%rbp), %al
andb $0x1, %al
movb %al, -0x81(%rbp)
testb $0x1, -0x81(%rbp)
je 0x202e3b
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x80(%rbp), %rax
movq %rax, -0x98(%rbp)
movq 0x16bf31(%rip), %rax    # 0x36ea60
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xa8(%rbp), %rdi
movq -0xb0(%rbp), %rsi
leaq -0xb8(%rbp), %rdx
callq 0x41390
movq %rax, -0xc0(%rbp)
movq -0xb8(%rbp), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0xd0(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xe0(%rbp)
leaq 0x18e56c(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0xd8(%rbp)
movq -0xd8(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x202ca2
movq -0xc8(%rbp), %rax
movq %rax, -0xf0(%rbp)
leaq 0x18e537(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0xe8(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0xf0(%rbp), %rax
cmpq $0x0, %rax
je 0x202ca2
movq -0xc8(%rbp), %rax
movq %rax, -0x100(%rbp)
leaq 0x18e4fc(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0xf8(%rbp)
movq -0x100(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x202ca2
movq -0xc8(%rbp), %rax
movq %rax, -0x110(%rbp)
leaq 0x18e4cb(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x108(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0x110(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0x202ca0
movq -0xc8(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq 0x18e48e(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x118(%rbp)
movq -0x120(%rbp), %rdi
movq -0x118(%rbp), %rsi
callq 0x127c0
jmp 0x202ca2
jmp 0x202ca4
movq 0x16bdad(%rip), %rax    # 0x36ea58
movq %rax, -0x128(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rax
movq %rax, -0x138(%rbp)
movq -0x130(%rbp), %rdi
movq -0x138(%rbp), %rsi
callq 0x1b780
movq %rax, -0x140(%rbp)
movq -0x140(%rbp), %rax
movq %rax, -0x148(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x158(%rbp)
leaq 0x18e405(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x150(%rbp)
movq -0x150(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x202dcb
movq -0xd0(%rbp), %rax
movq %rax, -0x168(%rbp)
leaq 0x18e3d0(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x160(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x168(%rbp), %rax
cmpq $0x0, %rax
je 0x202dcb
movq -0xd0(%rbp), %rax
movq %rax, -0x178(%rbp)
leaq 0x18e399(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x170(%rbp)
movq -0x178(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x202dcb
movq -0xd0(%rbp), %rax
movq %rax, -0x188(%rbp)
leaq 0x18e368(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x180(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x188(%rbp), %rax
movl (%rax), %ecx
addl $0x1, %ecx
movl %ecx, (%rax)
jmp 0x202dcd
movq 0x16bc84(%rip), %rax    # 0x36ea58
movq %rax, -0x190(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x198(%rbp)
movq -0x190(%rbp), %rax
movq %rax, -0x1a0(%rbp)
movq -0x1a0(%rbp), %rdi
movq -0x198(%rbp), %rsi
callq 0xae20
andb $0x1, %al
movb %al, -0x1a1(%rbp)
movb -0x1a1(%rbp), %al
andb $0x1, %al
movb %al, -0x81(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x202b05
jmp 0x202e3d
movq -0x80(%rbp), %rax
movq %rax, -0x1b8(%rbp)
leaq 0x18e2c1(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x1b0(%rbp)
movq -0x1b0(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x202f41
movq -0x80(%rbp), %rax
movq %rax, -0x1c8(%rbp)
leaq 0x18e28f(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x1c0(%rbp)
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq -0x1c8(%rbp), %rax
cmpq $0x0, %rax
je 0x202f41
movq -0x80(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq 0x18e257(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x1d0(%rbp)
movq -0x1d8(%rbp), %rax
andq $0x3, %rax
cmpq $0x0, %rax
jne 0x202f41
movq -0x80(%rbp), %rax
movq %rax, -0x1e8(%rbp)
leaq 0x18e229(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x1e0(%rbp)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
andq -0x1e8(%rbp), %rcx
movl (%rcx), %eax
addl $-0x1, %eax
movl %eax, (%rcx)
cmpl $0x0, %eax
jne 0x202f3f
movq -0x80(%rbp), %rax
movq %rax, -0x1f8(%rbp)
leaq 0x18e1ef(%rip), %rax    # 0x391110
orq $0x1, %rax
movq %rax, -0x1f0(%rbp)
movq -0x1f8(%rbp), %rdi
movq -0x1f0(%rbp), %rsi
callq 0x127c0
jmp 0x202f41
jmp 0x202f43
movq -0x8(%rbp), %rax
addq $0x200, %rsp            # imm = 0x200
popq %rbp
retq