Function at 0x401000
Capabilities:
Allocate thread local storage
Check mutex on windows

Disassembly:
push 0x4c
push 0
push 0x40fd74
call sub.MSVCRT.dll_memset
add esp, 0xc
push 0
call sub.KERNEL32.dll_GetModuleHandleA
mov dword [0x40fd78], eax
push 0
push 0x1000
push 0
call sub.KERNEL32.dll_HeapCreate
mov dword [0x40fd74], eax
call fcn.004077c0
call fcn.00405e70
call fcn.00405dab
call fcn.00405c97
call fcn.0040561c
call fcn.00405510
call fcn.00404bc0
call fcn.004044d9
call fcn.004042db
call fcn.004039b7
call fcn.00403724
call fcn.0040367e
call fcn.004021b5
push str.CareTalkCB
push 1
push 0
call sub.KERNEL32.dll_CreateMutexA
mov dword [0x40fd84], eax
call sub.KERNEL32.dll_GetLastError
mov ebx, eax
cmp ebx, 0xb7
jne 0x4010bc
push str.Du_kan_bara_k
push str.CareTalkCB
call fcn.00404341
jmp 0x40161e
push str.Caretalkserver.prefs
call fcn.00404c27
mov ebx, eax
and ebx, ebx
jne 0x40112f
push str.Caretalkserver.prefs
call fcn.00404ee3
and eax, eax
je 0x40112f
push str.Global
call fcn.00404f38
push str.c:Program_Files__x86_GrundigGrundigNova_
push 0x40a07b
call fcn.00405067
push str.CTcmd
push str.Executable
call fcn.00405067
push str.FALSE
push 0x40a050
call fcn.00405067
push str.TRUE
push str.AutoStart
call fcn.00405067
call fcn.004050de
push str.Caretalkserver.prefs
call fcn.00404c27
push str.Global
call fcn.00404f38
mov eax, dword [0x40ff5c]
push eax
push eax
push 0x40a00e
push 0x40a07b
call fcn.004050e9
push 0x40fd88
call fcn.00407840
mov eax, dword [0x40ff5c]
push eax
push eax
push 0x40a00e
push str.Executable
call fcn.004050e9
push 0x40fd8c
call fcn.00407840
mov eax, dword [0x40ff5c]
push eax
push eax
push 0x40a00e
push 0x40a050
call fcn.004050e9
push 0x40fd90
call fcn.00407840
mov eax, dword [0x40ff5c]
push eax
push eax
push 0x40a00e
push str.AutoStart
call fcn.004050e9
push 0x40fd94
call fcn.00407840
call fcn.004050de
jmp 0x4011d0
push dword [0x40fd90]
mov edx, str.TRUE
pop ecx
call fcn.004078c0
je 0x4011e8
call fcn.0040768e
call fcn.00406997
mov ebx, eax
and ebx, ebx
je 0x4011ff
push str.Caretalkserver_2_aktiv
call fcn.00401814
jmp 0x401213
push str.Kan_ej_initiera_n
push str.Clinicbuddy_Caretalk
call fcn.00404341
jmp 0x40161e
push dword [0x40fd94]
mov edx, str.FALSE
pop ecx
call fcn.004078c0
jne 0x40122b
call fcn.00401666
push 0x10000000
push str.Clinicbuddy_Caretalk
push 0x64
push 0x12c
push 0x96
push 0x64
push 0
call fcn.00402517
and eax, eax
je 0x40161e
mov edx, 0x40a06b
lea ecx, [0x40fd98]
call fcn.00402008
mov ebp, 0x40a33c
push ebp
push 0
call fcn.0040583f
push eax
push 0
call fcn.0040253a
push eax
push 1
call fcn.00403a61
push str.Clinicbuddy_Caretalk
push 1
call fcn.00403b07
cmp dword [0x40fd80], 0
je 0x4012be
mov ebx, dword [0x40fd80]
cmp ebx, 0x1fa4
je 0x4012be
mov eax, 1
jmp 0x4012c0
xor eax, eax
and eax, eax
je 0x4015c1
call fcn.00406bdb
mov dword [0x40fd9c], eax
mov ebx, dword [0x40fd9c]
cmp ebx, 2
jne 0x4015c1
call fcn.00406c4e
mov dword [0x40fda0], eax
push 0x3e8
call fcn.00405540
mov dword [0x40fda4], eax
push 0x3e8
push dword [0x40fda4]
push dword [0x40fda0]
call fcn.00406c54
mov dword [0x40fda8], eax
mov ebx, dword [0x40fda8]
and ebx, ebx
jg 0x4012fa
mov edx, str._a_href_javascript:window.close____Close_Window__a_
lea ecx, [0x40fdac]
call fcn.00402008
mov eax, dword [0x40ff5c]
push eax
push eax
push dword [0x40fda4]
call fcn.00405560
push 0x40fdb0
call fcn.00407840
mov eax, dword [0x40ff5c]
push eax
push eax
push 0xc8
push str.caretalk_
push dword [0x40fdb0]
call fcn.00403ce0
mov ebx, eax
add ebx, 9
push ebx
push dword [0x40fdb0]
call fcn.00403d00
push 0x40fdb4
call fcn.00407840
mov eax, dword [0x40ff5c]
push eax
push eax
push 0x40a04e
push dword [0x40fdb4]
call fcn.00403ce0
mov ebx, eax
dec ebx
push ebx
push dword [0x40fdb4]
call fcn.00403d80
push 0x40fdb4
call fcn.00407840
push dword [0x40fdb4]
call fcn.00403df0
and eax, eax
je 0x401464
mov eax, dword [0x40ff5c]
push eax
push eax
mov edx, str.Patient
call fcn.004078f0
mov edx, dword [0x40fdb4]
call fcn.004078f0
mov edx, dword [0x40ed44]
add dword [esp], edx
call fcn.00401814
pop dword [0x40ff5c]
push dword [0x40ff5c]
push dword [0x40fd88]
push dword [0x40ff5c]
mov edx, str.CURRPAT2_CBuddy
call fcn.004078f0
mov eax, dword [0x40ff5c]
push eax
push eax
push 0x40a04a
push 0x40a04c
mov eax, dword [0x40ff5c]
push eax
push eax
push dword [0x40fdb4]
call fcn.004067e2
mov edx, dword [0x40ed44]
add dword [esp], edx
call fcn.004040c0
pop eax
inc dword [0x40ff5c]
push dword [0x40fd8c]
mov edx, dword [0x40ed44]
add dword [esp + 4], edx
call fcn.00404952
pop dword [0x40ff5c]
push dword [0x40ff5c]
mov edx, str.HTTP_1.1_200_OK
call fcn.004078f0
mov edx, dword [0x40fdbc]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
mov edx, dword [0x40fdb8]
push dword [0x40ff5c]
call fcn.004078f0
mov edx, str.Date:_Wed__07_Aug_1996_11:15:43_GMT
call fcn.004078f0
mov edx, dword [0x40fdbc]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
mov edx, dword [0x40fdb8]
push dword [0x40ff5c]
call fcn.004078f0
mov edx, str.Server:_Atomic_Web_Server_0.2b
call fcn.004078f0
mov edx, dword [0x40fdbc]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
mov edx, dword [0x40fdb8]
push dword [0x40ff5c]
call fcn.004078f0
mov edx, str.Content_Length:
call fcn.004078f0
mov eax, dword [0x40ff5c]
push eax
push eax
push dword [0x40fdac]
call fcn.00403df0
cdq
push edx
push eax
call fcn.00404250
pop eax
mov edx, dword [0x40fdbc]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
mov edx, dword [0x40fdb8]
push dword [0x40ff5c]
call fcn.004078f0
mov edx, str.Content_Type:_text_html
call fcn.004078f0
mov edx, dword [0x40fdbc]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
mov edx, dword [0x40fdb8]
push dword [0x40ff5c]
call fcn.004078f0
mov edx, dword [0x40fdbc]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
mov edx, dword [0x40fdb8]
push dword [0x40ff5c]
call fcn.004078f0
mov edx, dword [0x40fdac]
call fcn.004078f0
push 0x40fdb8
call fcn.00407840
push dword [0x40fdb8]
push dword [0x40fda0]
call fcn.00406cc0
call fcn.00402556
mov dword [0x40fd9c], eax
mov ebx, dword [0x40fd9c]
cmp ebx, 0x332e
jne 0x401605
call fcn.0040255e
push eax
xor ebx, ebx
cmp ebx, dword [esp]
jne 0x4015ed
call fcn.00401666
jmp 0x401604
mov ebx, 1
cmp ebx, dword [esp]
jne 0x401604
push dword [0x40fd84]
call sub.KERNEL32.dll_ReleaseMutex
jmp 0x40161e
pop eax
push 0xa
call fcn.00406e96
mov ebx, dword [0x40fd9c]
cmp ebx, 0x10
jne 0x4012a0
push 0
call fcn.0040163d
call fcn.00407810
push dword [0x40fd74]
call sub.KERNEL32.dll_HeapDestroy
call sub.KERNEL32.dll_ExitProcess