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.

FUN_0001296a
PUSH EBP
MOV EBP,ESP
PUSH ESI
PUSH EDI
SUB ESP,0xc
MOV EAX,dword ptr [EBP + Stack[0x8]]
PUSH EAX
MOV EAX,dword ptr [EBP + Stack[0x4]]
PUSH EAX
CALL FUN_00011d1b
ADD ESP,0x8
TEST AX,AX
JZ LAB_00012996
MOV dword ptr [EBP + local_10],0x0
JMP LAB_00012a6c
LAB_00012996
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EDX,dword ptr [EAX + 0x84]
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EAX,dword ptr [EAX + 0x88]
ADD EAX,EDX
MOV dword ptr [EBP + local_18],EAX
MOV EAX,dword ptr [EBP + Stack[0x8]]
CALL strlen undefined strlen()
ADD EAX,0x6
MOV dword ptr [EBP + local_14],EAX
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EDX,dword ptr [EAX + 0x88]
ADD EDX,dword ptr [EBP + local_14]
MOV EAX,dword ptr [EBP + Stack[0x4]]
CMP EDX,dword ptr [EAX + 0x8c]
JBE LAB_000129de
MOV dword ptr [EBP + local_10],0x0
JMP LAB_00012a6c
LAB_000129de
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV byte ptr [EAX],0xd
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV byte ptr [EAX],0xa
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0x98],EAX
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV byte ptr [EAX],0x5b
LAB_00012a05 
MOV EAX,dword ptr [EBP + Stack[0x8]]
CMP byte ptr [EAX],0x0
JZ LAB_00012a1f
MOV EAX,dword ptr [EBP + Stack[0x8]]
INC dword ptr [EBP + Stack[0x8]]
MOV EDX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV AL,byte ptr [EAX]
MOV byte ptr [EDX],AL
JMP LAB_00012a05
LAB_00012a1f
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV byte ptr [EAX],0x5d
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV byte ptr [EAX],0xd
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
MOV byte ptr [EAX],0xa
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0xa8],EAX
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0x90],EAX
MOV EAX,dword ptr [EBP + local_14]
MOV EDX,dword ptr [EBP + Stack[0x4]]
ADD dword ptr [EDX + 0x88],EAX
MOV EAX,dword ptr [EBP + Stack[0x4]]
OR byte ptr [EAX + 0x1],0x80
MOV dword ptr [EBP + local_10],0x1
LAB_00012a6c
MOV EAX,dword ptr [EBP + local_10]
LEA ESP=>local_c,[EBP + -0x8]
POP EDI
POP ESI
POP EBP
RET

FUN_000128a2
PUSH EBP
MOV EBP,ESP
PUSH ESI
PUSH EDI
SUB ESP,0x10
MOV EAX,dword ptr [EBP + Stack[0x8]]
PUSH EAX
MOV EAX,dword ptr [EBP + Stack[0x4]]
PUSH EAX
CALL FUN_00011d1b
ADD ESP,0x8
TEST AX,AX
JNZ LAB_000128ce
MOV dword ptr [EBP + local_10],0x0
JMP LAB_00012960
LAB_000128ce
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EAX,dword ptr [EAX + 0x98]
MOV dword ptr [EBP + local_1c],EAX
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EDX,dword ptr [EAX + 0x84]
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EAX,dword ptr [EAX + 0x88]
ADD EAX,EDX
MOV dword ptr [EBP + local_18],EAX
MOV dword ptr [EBP + local_14],0x1
LAB_000128f8
MOV EAX,dword ptr [EBP + local_1c]
ADD EAX,dword ptr [EBP + local_14]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x5b
JZ LAB_00012915
MOV EAX,dword ptr [EBP + local_1c]
ADD EAX,dword ptr [EBP + local_14]
CMP EAX,dword ptr [EBP + local_18]
JC LAB_00012917
LAB_00012915
JMP LAB_0001291f
LAB_00012917
MOV EAX,dword ptr [EBP + local_14]
INC dword ptr [EBP + local_14]
JMP LAB_000128f8
LAB_0001291f
PUSH 0x4
PUSH 0x49b
MOV ECX,s_profile.c_00170129 = "profile.c"
MOV EBX,dword ptr [EBP + local_1c]
ADD EBX,dword ptr [EBP + local_14]
MOV EAX,dword ptr [EBP + local_18]
SUB EAX,EBX
MOV EBX,EAX
MOV EDX,dword ptr [EBP + local_1c]
ADD EDX,dword ptr [EBP + local_14]
MOV EAX,dword ptr [EBP + local_1c]
CALL FUN_000a0e0d
MOV EAX,dword ptr [EBP + local_14]
MOV EDX,dword ptr [EBP + Stack[0x4]]
SUB dword ptr [EDX + 0x88],EAX
MOV EAX,dword ptr [EBP + Stack[0x4]]
OR byte ptr [EAX + 0x1],0x80
MOV dword ptr [EBP + local_10],0x1
LAB_00012960
MOV EAX,dword ptr [EBP + local_10]
LEA ESP=>local_c,[EBP + -0x8]
POP EDI
POP ESI
POP EBP
RET

FUN_00011d1b
PUSH EBP
MOV EBP,ESP
PUSH ESI
PUSH EDI
SUB ESP,0x18
MOV dword ptr [EBP + local_14],0x0
MOV EAX,dword ptr [EBP + Stack[0x4]]
MOV EAX,dword ptr [EAX + 0x84]
MOV dword ptr [EBP + local_24],EAX
MOV dword ptr [EBP + local_18],0x0
LAB_00011d40
MOV EAX,dword ptr [EBP + local_24]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x5b
JNZ LAB_00011e02
MOV EAX,dword ptr [EBP + local_24]
MOV dword ptr [EBP + local_20],EAX
MOV EAX,dword ptr [EBP + local_24]
INC dword ptr [EBP + local_24]
MOV EAX,dword ptr [EBP + Stack[0x8]]
MOV dword ptr [EBP + local_1c],EAX
LAB_00011d65
MOV EAX,dword ptr [EBP + local_24]
MOV DL,byte ptr [EAX]
MOV EAX,dword ptr [EBP + local_1c]
CMP DL,byte ptr [EAX]
JNZ LAB_00011d7f
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x4]]
CMP EAX,dword ptr [EDX + 0x88]
JC LAB_00011d81
LAB_00011d7f
JMP LAB_00011d95
LAB_00011d81
MOV EAX,dword ptr [EBP + local_1c]
INC dword ptr [EBP + local_1c]
MOV EAX,dword ptr [EBP + local_24]
INC dword ptr [EBP + local_24]
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
JMP LAB_00011d65
LAB_00011d95
MOV EAX,dword ptr [EBP + local_24]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0x5d
JNZ LAB_00011dac
MOV EAX,dword ptr [EBP + local_1c]
CMP byte ptr [EAX],0x0
JZ LAB_00011dae
LAB_00011dac
JMP LAB_00011e02
LAB_00011dae
MOV dword ptr [EBP + local_14],0x1
LAB_00011db5
MOV EAX,dword ptr [EBP + local_24]
MOV AL,byte ptr [EAX]
AND EAX,0xff
CMP EAX,0xa
JZ LAB_00011dcc
MOV EAX,dword ptr [EBP + local_24]
INC dword ptr [EBP + local_24]
JMP LAB_00011db5
LAB_00011dcc
MOV EAX,dword ptr [EBP + local_24]
INC dword ptr [EBP + local_24]
MOV EAX,dword ptr [EBP + local_24]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0xa8],EAX
MOV EAX,dword ptr [EBP + local_24]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0x90],EAX
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0x94],EAX
MOV EAX,dword ptr [EBP + local_20]
MOV EDX,dword ptr [EBP + Stack[0x4]]
MOV dword ptr [EDX + 0x98],EAX
LAB_00011e02
MOV EAX,dword ptr [EBP + local_24]
INC dword ptr [EBP + local_24]
MOV EAX,dword ptr [EBP + local_18]
INC dword ptr [EBP + local_18]
CMP dword ptr [EBP + local_14],0x0
JNZ LAB_00011e26
MOV EAX,dword ptr [EBP + local_18]
MOV EDX,dword ptr [EBP + Stack[0x4]]
CMP EAX,dword ptr [EDX + 0x88]
JC LAB_00011d40
LAB_00011e26
MOV EAX,dword ptr [EBP + local_14]
MOV dword ptr [EBP + local_10],EAX
MOV EAX,dword ptr [EBP + local_10]
LEA ESP=>local_c,[EBP + -0x8]
POP EDI
POP ESI
POP EBP
RET