I will provide you disassembly from a computer game that runs in MS-DOS. The game was written in C with a Watcom compiler. Some library function calls are already identified. Explain the functions I give to you and suggest names and C-language function signatures for them, including which parameters map to which registers or stack values. Also suggest names for global values when you have enough context to do so. As I provide more information, please revise your explanations and suggestions as necessary.

FUN_00011f93
PUSH EBP
MOV EBP,ESP
PUSH ESI
PUSH EDI
SUB ESP,0x30
MOV EAX,dword ptr [EBP + Stack[0x4]]
CMP dword ptr [EAX + 0xa4],0x0
JZ LAB_00011fb8
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EAX,dword ptr [EAX + 0xa4]
MOV dword ptr [EBP + local_1c],EAX
JMP LAB_00011fc4
LAB_00011fb8
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EAX,dword ptr [EAX + 0xa0]
MOV dword ptr [EBP + local_1c],EAX
LAB_00011fc4
CMP dword ptr [EBP + local_1c],0x0
JNZ LAB_00011fd6
MOV dword ptr [EBP + local_10],0x0
JMP LAB_000120e1
LAB_00011fd6
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x20
JNZ LAB_00011fed
MOV EAX,dword ptr [EBP + local_1c]
INC dword ptr [EBP + local_1c]
JMP LAB_00011fd6
LAB_00011fed
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0xd
JNZ LAB_00012008
MOV dword ptr [EBP + local_10],0x0
JMP LAB_000120e1
LAB_00012008
MOV dword ptr [EBP + local_14],0x0
LAB_0001200f
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0xd
JZ LAB_0001202d
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x2c
JNZ LAB_0001202f
LAB_0001202d
JMP LAB_0001203e
LAB_0001202f
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x20
JNZ LAB_00012040
LAB_0001203e
JMP LAB_00012054
LAB_00012040
MOV EAX,dword ptr [EBP + local_1c]
INC dword ptr [EBP + local_1c]
MOV EDX,dword ptr [EBP + local_14]
INC dword ptr [EBP + local_14]
MOV AL,byte ptr [EAX]
MOV byte ptr [EDX + EBP*0x1 + -0x38],AL
JMP LAB_0001200f
LAB_00012054
MOV EAX,dword ptr [EBP + local_14]
MOV byte ptr [EAX + EBP*0x1 + -0x38],0x0
CMP dword ptr [EBP + local_14],0x0
JNZ LAB_0001206e
MOV dword ptr [EBP + local_10],0x0
JMP LAB_000120e1
LAB_0001206e
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x20
JNZ LAB_00012085
MOV EAX,dword ptr [EBP + local_1c]
INC dword ptr [EBP + local_1c]
JMP LAB_0001206e
LAB_00012085
MOV EAX,dword ptr [EBP + local_1c]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x2c
JNZ LAB_000120a5
INC dword ptr [EBP + local_1c]
MOV EAX,dword ptr [EBP + local_1c]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0xa4],EAX
JMP LAB_000120b1
LAB_000120a5
MOV EAX,dword ptr [EBP + local_1c]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0xa4],EAX
LAB_000120b1
MOVSX EAX,byte ptr [EBP + local_3b]
CMP EAX,0x78
JNZ LAB_000120c7
LEA EAX=>local_3a,[EBP + -0x36]
CALL FUN_00012d3b
MOV dword ptr [EBP + local_18],EAX
JMP LAB_000120d2
LAB_000120c7
LEA EAX=>local_3c,[EBP + -0x38]
CALL atoi
MOV dword ptr [EBP + local_18],EAX
LAB_000120d2
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x8]]
MOV dword ptr [EDX],EAX
MOV dword ptr [EBP + local_10],0x1
LAB_000120e1
MOV EAX,dword ptr [EBP + local_10]
LEA ESP=>local_c,[EBP + -0x8]
POP EDI
POP ESI
POP EBP
RET

FUN_00012d3b
PUSH EBP
MOV EBP,ESP
PUSH EBX
PUSH ECX
PUSH EDX
PUSH ESI
PUSH EDI
SUB ESP,0x18
MOV dword ptr [EBP + local_30],EAX
MOV dword ptr [EBP + local_2c],0x0
MOV EAX,dword ptr [EBP + local_30]
CALL strlen
MOV dword ptr [EBP + local_28],EAX
MOV dword ptr [EBP + local_20],0x0
LAB_00012d65
MOV EDX,dword ptr [EBP + local_28]
SHL EDX,0x2
MOV EAX,dword ptr [EBP + local_20]
INC dword ptr [EBP + local_20]
ADD EAX,dword ptr [EBP + local_30]
MOVSX EAX,byte ptr [EAX]
CALL FUN_00012da5
IMUL EAX,dword ptr [EDX + PTR_s_0123456789ABCDEF_00178848] = address to string "0123456789ABCDEF"
ADD dword ptr [EBP + local_2c],EAX
MOV EAX,dword ptr [EBP + local_28]
DEC dword ptr [EBP + local_28]
CMP dword ptr [EBP + local_28],0x0
JA LAB_00012d65
MOV EAX,dword ptr [EBP + local_2c]
MOV dword ptr [EBP + local_1c],EAX
MOV EAX,dword ptr [EBP + local_1c]
LEA ESP=>local_18,[EBP + -0x14]
POP EDI
POP ESI
POP EDX
POP ECX
POP EBX
POP EBP
RET

FUN_00012da5
PUSH EBP
MOV EBP,ESP
PUSH EBX
PUSH ECX
PUSH EDX
PUSH ESI
PUSH EDI
SUB ESP,0xc
MOV byte ptr [EBP + local_1c],AL
MOV dword ptr [EBP + local_24],0x0
LAB_00012dbd
CMP dword ptr [EBP + local_24],0x10
JC LAB_00012dcd
JMP LAB_00012df0
LAB_00012dc5
MOV EAX,dword ptr [EBP + local_24]
INC dword ptr [EBP + local_24]
JMP LAB_00012dbd
LAB_00012dcd
MOV EAX,[PTR_s_0123456789ABCDEF_00178848] = address to string "0123456789ABCDEF"
ADD EAX,dword ptr [EBP + local_24]
XOR EDX,EDX
MOV DL,byte ptr [EAX]=>s_0123456789ABCDEF_00170118 = "0123456789ABCDEF"
MOVSX EAX,byte ptr [EBP + local_1c]
CALL toupper
CMP EDX,EAX
JNZ LAB_00012dee
MOV EAX,dword ptr [EBP + local_24]
MOV dword ptr [EBP + local_20],EAX
JMP LAB_00012df7
LAB_00012dee
JMP LAB_00012dc5
LAB_00012df0
MOV dword ptr [EBP + local_20],0xffffffff
LAB_00012df7
MOV EAX,dword ptr [EBP + local_20]
LEA ESP=>local_18,[EBP + -0x14]
POP EDI
POP ESI
POP EDX
POP ECX
POP EBX
POP EBP
RET