// File: /workspace/github_c_makefile_star2_O1/mikecat[P]x86_interpreter/pe_libs.c
// Function: pe_lib_exec
uint32_t pe_lib_exec(uint32_t regs[], const char* lib_name, const char* func_name, uint16_t func_ord) {
	if (func_name == NULL) {
		fprintf(stderr, "function #%"PRIu16" in library %s called. (ord value unsupported)\n",
			func_ord, lib_name);
		return PE_LIB_EXEC_FAILED;
	}
	if (strcmp_ncs(lib_name, "msvcrt.dll") == 0) {
		return exec_msvcrt(regs, func_name);
	} else if (strcmp_ncs(lib_name, "kernel32.dll") == 0) {
		return exec_kernel32(regs, func_name);
	} else if (strcmp_ncs(lib_name, "libintl3.dll") == 0) {
		return exec_libintl3(regs, func_name);
	} else {
		fprintf(stderr, "function %s() in unknown library %s called.\n", func_name, lib_name);
		return PE_LIB_EXEC_FAILED;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
testq %rdx, %rdx
je 0xc8e2
movq %rdx, %r15
movq %rdi, %r14
leaq 0x2294(%rip), %rsi      # 0xe4f3
movq %rbx, %rdi
callq 0xc15e
testl %eax, %eax
je 0xc30a
leaq 0x22e5(%rip), %rsi      # 0xe55b
movq %rbx, %rdi
callq 0xc15e
testl %eax, %eax
je 0xc6f0
leaq 0x22db(%rip), %rsi      # 0xe568
movq %rbx, %rdi
callq 0xc15e
testl %eax, %eax
jne 0xc923
leaq 0x2a44(%rip), %rsi      # 0xece8
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc843
leaq 0x2a44(%rip), %rsi      # 0xecff
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc843
leaq 0x2a40(%rip), %rsi      # 0xed12
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
jne 0xc97d
movl 0x10(%r14), %edi
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
xorl %eax, %eax
callq 0x735a
testl %eax, %eax
je 0xc94c
movl 0x8(%rsp), %eax
jmp 0xc94c
leaq 0x2291(%rip), %rsi      # 0xe5a2
movq %r15, %rdi
callq 0x10c0
xorl %ebx, %ebx
testl %eax, %eax
je 0xc99d
leaq 0x2287(%rip), %rsi      # 0xe5b1
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc862
leaq 0x227e(%rip), %rsi      # 0xe5bf
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc905
leaq 0x2272(%rip), %rsi      # 0xe5ca
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc91a
leaq 0x2262(%rip), %rsi      # 0xe5d1
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc943
leaq 0x22d2(%rip), %rsi      # 0xe658
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc951
leaq 0x226c(%rip), %rsi      # 0xe609
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc99d
leaq 0x225c(%rip), %rsi      # 0xe610
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc974
leaq 0x224c(%rip), %rsi      # 0xe617
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc974
leaq 0x223f(%rip), %rsi      # 0xe621
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcab9
leaq 0x2212(%rip), %rsi      # 0xe60b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc910
leaq 0x2247(%rip), %rsi      # 0xe657
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcad7
leaq 0x2262(%rip), %rsi      # 0xe689
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcaf5
leaq 0x227f(%rip), %rsi      # 0xe6bd
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcb13
leaq 0x229e(%rip), %rsi      # 0xe6f3
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcb31
leaq 0x2318(%rip), %rsi      # 0xe784
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcb65
leaq 0x2300(%rip), %rsi      # 0xe783
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcb83
leaq 0x22e8(%rip), %rsi      # 0xe782
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcba1
leaq 0x2309(%rip), %rsi      # 0xe7ba
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcbbf
leaq 0x22f9(%rip), %rsi      # 0xe7c1
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcbcd
leaq 0x2316(%rip), %rsi      # 0xe7f5
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcbeb
leaq 0x170a(%rip), %rsi      # 0xdc00
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc09
leaq 0x2349(%rip), %rsi      # 0xe856
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc974
leaq 0x233a(%rip), %rsi      # 0xe85e
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc27
leaq 0x232c(%rip), %rsi      # 0xe867
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc33
leaq 0x2349(%rip), %rsi      # 0xe89b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc51
leaq 0x2366(%rip), %rsi      # 0xe8cf
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc6f
leaq 0x237f(%rip), %rsi      # 0xe8ff
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc8d
leaq 0x239e(%rip), %rsi      # 0xe935
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xccab
leaq 0x1a34(%rip), %rsi      # 0xdfe2
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xccc9
leaq 0x23d2(%rip), %rsi      # 0xe997
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcce7
leaq 0x23f1(%rip), %rsi      # 0xe9cd
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcd05
leaq 0x240c(%rip), %rsi      # 0xe9ff
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcd23
leaq 0x2429(%rip), %rsi      # 0xea33
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcd41
leaq 0x2444(%rip), %rsi      # 0xea65
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcd5f
leaq 0x2461(%rip), %rsi      # 0xea99
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcc27
leaq 0x2459(%rip), %rsi      # 0xeaa8
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcd7d
leaq 0x2478(%rip), %rsi      # 0xeade
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcd9b
leaq 0x2493(%rip), %rsi      # 0xeb10
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcdb9
leaq 0x24b6(%rip), %rsi      # 0xeb4a
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc99d
leaq 0x24a6(%rip), %rsi      # 0xeb51
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xcdd7
leaq 0x1545(%rip), %rsi      # 0xdc07
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
jne 0xcdf5
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x920f
testl %eax, %eax
jne 0xc99d
callq 0x1bab
jmp 0xc998
leaq 0x24f2(%rip), %rsi      # 0xebe9
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc851
leaq 0x24f7(%rip), %rsi      # 0xec05
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc843
leaq 0x24f1(%rip), %rsi      # 0xec16
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc910
leaq 0x24e6(%rip), %rsi      # 0xec22
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc851
leaq 0x24dc(%rip), %rsi      # 0xec2f
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc968
leaq 0x24d8(%rip), %rsi      # 0xec42
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc843
leaq 0x24ce(%rip), %rsi      # 0xec4f
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc9b6
leaq 0x24cf(%rip), %rsi      # 0xec67
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc9aa
leaq 0x24cc(%rip), %rsi      # 0xec7b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc9aa
leaq 0x24c8(%rip), %rsi      # 0xec8e
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
je 0xc843
leaq 0x24c2(%rip), %rsi      # 0xec9b
movq %r15, %rdi
callq 0x10c0
testl %eax, %eax
jne 0xcb4f
movl 0x10(%r14), %edi
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdx
movl $0x1, %esi
xorl %eax, %eax
callq 0x735a
testl %eax, %eax
je 0xc83e
movl 0x8(%rsp), %edi
movl $0x8, %esi
callq 0x7134
testl %eax, %eax
je 0xc83e
movl 0x8(%rsp), %edi
xorl %esi, %esi
movl $0x4, %edx
callq 0x71e8
movl 0x8(%rsp), %edi
addl $0x4, %edi
xorl %esi, %esi
movl $0x4, %edx
callq 0x71e8
movl $0x1, %ebx
movl %ebx, (%r14)
jmp 0xc858
movl $0x0, (%r14)
xorl %ebx, %ebx
jmp 0xc99d
movl $0x0, (%r14)
movl $0x4, %ebx
jmp 0xc99d
movl 0x10(%r14), %edi
xorl %ebx, %ebx
leaq 0x8(%rsp), %rdx
leaq 0x4(%rsp), %rcx
leaq 0x14(%rsp), %r8
movl $0x3, %esi
xorl %eax, %eax
callq 0x735a
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0xc8da
movl 0x8(%rsp), %edi
movl 0x1152a(%rip), %esi     # 0x1ddc0
movl $0x4, %edx
callq 0x71e8
testl %eax, %eax
je 0xc8da
movl 0x4(%rsp), %edi
movl 0x11516(%rip), %esi     # 0x1ddc4
movl $0x4, %edx
callq 0x71e8
testl %eax, %eax
je 0xc8da
movl 0x14(%rsp), %edi
movl 0x114f6(%rip), %esi     # 0x1ddbc
addl $0x8, %esi
movl $0x4, %edx
callq 0x71e8
xorl %ebp, %ebp
cmpl $0x1, %eax
sbbl %ebp, %ebp
movl %ebp, (%r14)
jmp 0xc99d
movq 0x670f(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
movzwl %cx, %edx
leaq 0x1c29(%rip), %rsi      # 0xe51f
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10d0
jmp 0xc998
movl 0x114b1(%rip), %eax     # 0x1ddbc
addl $0x10, %eax
jmp 0xc94c
movl $0xfffffffe, %ebx       # imm = 0xFFFFFFFE
jmp 0xc99d
movl $0x1, (%r14)
jmp 0xc99d
movq 0x66ce(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x1c41(%rip), %rsi      # 0xe575
movq %r15, %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x10d0
jmp 0xc998
movl 0x11473(%rip), %eax     # 0x1ddbc
addl $0x8, %eax
movl %eax, (%r14)
jmp 0xc99d
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8c1c
testl %eax, %eax
jne 0xc99d
callq 0x1e9f
jmp 0xc998
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
jmp 0xc858
movl $0x0, (%r14)
jmp 0xc99d
movq 0x6674(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x2394(%rip), %rsi      # 0xed22
movq %r15, %rdx
xorl %eax, %eax
callq 0x10d0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, (%r14)
jmp 0xc84a
movl 0x10(%r14), %edi
leaq 0x4(%rsp), %rdx
movl $0x1, %esi
xorl %eax, %eax
callq 0x735a
testl %eax, %eax
je 0xc858
movl 0x4(%rsp), %edi
movl $0x8, %esi
callq 0x7134
testl %eax, %eax
je 0xc858
xorl %edi, %edi
callq 0x10f0
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x1170
movl 0x14(%rax), %ecx
leal 0x76b(%rcx), %esi
leal 0x76e(%rcx), %edx
testl %esi, %esi
cmovnsl %esi, %edx
sarl $0x2, %edx
movslq %esi, %rsi
imulq $-0x51eb851f, %rsi, %rdi # imm = 0xAE147AE1
movq %rdi, %r8
shrq $0x3f, %r8
shrq $0x20, %rdi
sarl $0x5, %edi
addl %r8d, %edi
imulq $0x51eb851f, %rsi, %rsi # imm = 0x51EB851F
movq %rsi, %r8
shrq $0x3f, %r8
shrq $0x20, %rsi
sarl $0x7, %esi
addl %r8d, %esi
imull $0x16d, %ecx, %ecx      # imm = 0x16D
addl %edx, %ecx
addl %edi, %ecx
addl %esi, %ecx
addl $0x1a8cb, %ecx          # imm = 0x1A8CB
movslq %ecx, %rcx
movslq 0x1c(%rax), %rdx
addq %rcx, %rdx
imulq $0x15180, %rdx, %rcx    # imm = 0x15180
movslq 0x8(%rax), %rdx
imulq $0x3c, %rdx, %rdx
movslq 0x4(%rax), %rsi
addq %rdx, %rsi
imulq $0x3c, %rsi, %rdx
movslq (%rax), %rax
addq %rdx, %rax
addq %rcx, %rax
imulq $0x989680, %rax, %rbx   # imm = 0x989680
movl 0x4(%rsp), %edi
movl %ebx, %esi
movl $0x4, %edx
callq 0x71e8
movl 0x4(%rsp), %edi
addl $0x4, %edi
shrq $0x20, %rbx
movl %ebx, %esi
movl $0x4, %edx
callq 0x71e8
jmp 0xc858
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8f31
testl %eax, %eax
jne 0xc99d
callq 0x1e83
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8b5c
testl %eax, %eax
jne 0xc99d
callq 0x1e67
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9ab3
testl %eax, %eax
jne 0xc99d
callq 0x1e4b
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x99a5
testl %eax, %eax
jne 0xc99d
callq 0x1e2f
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9bb8
testl %eax, %eax
jne 0xc99d
callq 0x1e13
jmp 0xc998
movq 0x64a2(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x2153(%rip), %rsi      # 0xecb3
jmp 0xc98e
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8942
testl %eax, %eax
jne 0xc99d
callq 0x1df7
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x793f
testl %eax, %eax
jne 0xc99d
callq 0x1ddb
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8a85
testl %eax, %eax
jne 0xc99d
callq 0x1dbf
jmp 0xc998
movl 0x111f7(%rip), %eax     # 0x1ddbc
addl $0x14, %eax
jmp 0xc94c
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x760a
testl %eax, %eax
jne 0xc99d
callq 0x1da3
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9897
testl %eax, %eax
jne 0xc99d
callq 0x1d87
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x946e
testl %eax, %eax
jne 0xc99d
callq 0x1d6b
jmp 0xc998
movl $0xffffffff, (%r14)     # imm = 0xFFFFFFFF
jmp 0xc99d
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9708
testl %eax, %eax
jne 0xc99d
callq 0x1d4f
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9662
testl %eax, %eax
jne 0xc99d
callq 0x1d33
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x93c6
testl %eax, %eax
jne 0xc99d
callq 0x1d17
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x978e
testl %eax, %eax
jne 0xc99d
callq 0x1cfb
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9b24
testl %eax, %eax
jne 0xc99d
callq 0x1cdf
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x94a6
testl %eax, %eax
jne 0xc99d
callq 0x1cc3
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x89ec
testl %eax, %eax
jne 0xc99d
callq 0x1ca7
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8cb4
testl %eax, %eax
jne 0xc99d
callq 0x1c8b
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x750d
testl %eax, %eax
jne 0xc99d
callq 0x1c6f
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x76c8
testl %eax, %eax
jne 0xc99d
callq 0x1c53
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8e1d
testl %eax, %eax
jne 0xc99d
callq 0x1c37
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x8fe5
testl %eax, %eax
jne 0xc99d
callq 0x1c1b
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x908c
testl %eax, %eax
jne 0xc99d
callq 0x1bff
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9c5e
testl %eax, %eax
jne 0xc99d
callq 0x1be3
jmp 0xc998
movl 0x10(%r14), %esi
movq %r14, %rdi
callq 0x9fac
testl %eax, %eax
jne 0xc99d
callq 0x1bc7
jmp 0xc998
movq 0x61fc(%rip), %rax      # 0x12ff8
movq (%rax), %rdi
leaq 0x1db0(%rip), %rsi      # 0xebb6
jmp 0xc98e