#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ datErmsg(int, size_t *, char *);
int /*<<< orphan*/ emsMark();
int /*<<< orphan*/ emsRep(char *, char *, int *const);
int /*<<< orphan*/ emsRlse();
int /*<<< orphan*/ emsSetc(char *, char *const);
void dat_ertxt_(char *const text, int *const status, int text_length) {
  char msg[200 + 1];
  size_t lmsg;
  char *text_c;
  text_c = cnfCreim(text, text_length);
  datErmsg(*status, &lmsg, msg);
  emsMark();
  emsSetc("TEXT", text);
  emsSetc("MSG", msg);
  emsRep("HDS_ERROR", "^TEXT: ^MSG", status);
  emsRlse();
  cnfFree(text_c);
}


x86 assembly (clang, -O0):
<dat_ertxt_>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1090 <cnfCreim@plt>
mov    %rax,-0xf0(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0xe0(%rbp),%rdx
lea    -0xe8(%rbp),%rsi
call   1070 <datErmsg@plt>
mov    $0x0,%al
call   1030 <emsMark@plt>
mov    -0x8(%rbp),%rsi
lea    0xe3c(%rip),%rdi
call   1060 <emsSetc@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe40(%rip),%rdi
call   1060 <emsSetc@plt>
mov    -0x10(%rbp),%rdx
lea    0xe1e(%rip),%rdi
lea    0xe21(%rip),%rsi
call   1080 <emsRep@plt>
mov    $0x0,%al
call   1050 <emsRlse@plt>
mov    -0xf0(%rbp),%rdi
call   1040 <cnfFree@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dat_ertxt_>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xe8,%rsp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    %edx,%esi
call   1090 <cnfCreim@plt>
mov    %rax,%r14
mov    (%r15),%edi
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%r12
mov    %r12,%rdx
call   1070 <datErmsg@plt>
xor    %eax,%eax
call   1030 <emsMark@plt>
lea    0xe4f(%rip),%rdi
mov    %rbx,%rsi
call   1060 <emsSetc@plt>
lea    0xe57(%rip),%rdi
mov    %r12,%rsi
call   1060 <emsSetc@plt>
lea    0xe36(%rip),%rdi
lea    0xe39(%rip),%rsi
mov    %r15,%rdx
call   1080 <emsRep@plt>
xor    %eax,%eax
call   1050 <emsRlse@plt>
mov    %r14,%rdi
call   1040 <cnfFree@plt>
add    $0xe8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"TEXT\00"
@.str.1 = [4 x i8] c"MSG\00"
@.str.2 = [10 x i8] c"HDS_ERROR\00"
@.str.3 = [12 x i8] c"^TEXT: ^MSG\00"
define void @dat_ertxt_(i8* %0, i32* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca [201 x i8]
%8 = alloca i64
%9 = alloca i8*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%10 = load i8*, i8** %4
%11 = load i32, i32* %6
%12 = call i8* @cnfCreim(i8* %10, i32 %11)
store i8* %12, i8** %9
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = getelementptr inbounds [201 x i8], [201 x i8]* %7, i64 0, i64 0
%16 = call i32 @datErmsg(i32 %14, i64* %8, i8* %15)
%17 = call i32 (...) @emsMark()
%18 = load i8*, i8** %4
%19 = call i32 @emsSetc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [201 x i8], [201 x i8]* %7, i64 0, i64 0
%21 = call i32 @emsSetc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %20)
%22 = load i32*, i32** %5
%23 = call i32 @emsRep(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %22)
%24 = call i32 (...) @emsRlse()
%25 = load i8*, i8** %9
%26 = call i32 @cnfFree(i8* %25)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"TEXT\00"
@.str.1 = [4 x i8] c"MSG\00"
@.str.2 = [10 x i8] c"HDS_ERROR\00"
@.str.3 = [12 x i8] c"^TEXT: ^MSG\00"
define void @dat_ertxt_(i8* %0, i32* %1, i32 %2) {
%4 = alloca [201 x i8]
%5 = alloca i64
%6 = getelementptr inbounds [201 x i8], [201 x i8]* %4, i64 0, i64 0
%7 = bitcast i64* %5 to i8*
%8 = tail call i8* @cnfCreim(i8* %0, i32 %2)
%9 = load i32, i32* %1
%10 = call i32 @datErmsg(i32 %9, i64* %5, i8* %6)
%11 = call i32 (...) @emsMark()
%12 = call i32 @emsSetc(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%13 = call i32 @emsSetc(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%14 = call i32 @emsRep(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%15 = call i32 (...) @emsRlse()
%16 = call i32 @cnfFree(i8* %8)
ret void
}