#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 *cnfCreat(int);
char *cnfCreim(char *const, int);
int /*<<< orphan*/ cnfExprt(char *, char *const, int);
int /*<<< orphan*/ cnfFree(char *);
int /*<<< orphan*/ emsMload(char *, char *, char *, int *const, int *const);
void ems_mload_(char *const msg, char *const text, char *const opstr,
                int *const oplen, int *const status, int msg_length,
                int text_length, int opstr_length) {
  char *str;
  char *ctext;
  char *cmsg;

  cmsg = cnfCreim(msg, msg_length);
  ctext = cnfCreim(text, text_length);
  str = cnfCreat(opstr_length);
  emsMload(cmsg, ctext, str, oplen, status);
  cnfExprt(str, opstr, opstr_length);
  cnfFree(cmsg);
  cnfFree(ctext);
  cnfFree(str);
}


x86 assembly (clang, -O0):
<ems_mload_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1070 <cnfCreim@plt>
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x10(%rbp),%esi
call   1070 <cnfCreim@plt>
mov    %rax,-0x40(%rbp)
mov    0x18(%rbp),%edi
call   1050 <cnfCreat@plt>
mov    %rax,-0x38(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1060 <emsMload@plt>
mov    -0x38(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    0x18(%rbp),%edx
call   1040 <cnfExprt@plt>
mov    -0x48(%rbp),%rdi
call   1030 <cnfFree@plt>
mov    -0x40(%rbp),%rdi
call   1030 <cnfFree@plt>
mov    -0x38(%rbp),%rdi
call   1030 <cnfFree@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ems_mload_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,(%rsp)
mov    %rsi,%rbx
mov    0x48(%rsp),%r13d
mov    0x40(%rsp),%ebp
mov    %r9d,%esi
call   1070 <cnfCreim@plt>
mov    %rax,%r14
mov    %rbx,%rdi
mov    %ebp,%esi
call   1070 <cnfCreim@plt>
mov    %rax,%rbx
mov    %r13d,%edi
call   1050 <cnfCreat@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r12,%rcx
mov    %r15,%r8
call   1060 <emsMload@plt>
mov    %rbp,%rdi
mov    (%rsp),%rsi
mov    %r13d,%edx
call   1040 <cnfExprt@plt>
mov    %r14,%rdi
call   1030 <cnfFree@plt>
mov    %rbx,%rdi
call   1030 <cnfFree@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <cnfFree@plt>

LLVM IR (-O0):
define void @ems_mload_(i8* %0, i8* %1, i8* %2, i32* %3, i32* %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32* %3, i32** %12
store i32* %4, i32** %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%20 = load i8*, i8** %9
%21 = load i32, i32* %14
%22 = call i8* @cnfCreim(i8* %20, i32 %21)
store i8* %22, i8** %19
%23 = load i8*, i8** %10
%24 = load i32, i32* %15
%25 = call i8* @cnfCreim(i8* %23, i32 %24)
store i8* %25, i8** %18
%26 = load i32, i32* %16
%27 = call i8* @cnfCreat(i32 %26)
store i8* %27, i8** %17
%28 = load i8*, i8** %19
%29 = load i8*, i8** %18
%30 = load i8*, i8** %17
%31 = load i32*, i32** %12
%32 = load i32*, i32** %13
%33 = call i32 @emsMload(i8* %28, i8* %29, i8* %30, i32* %31, i32* %32)
%34 = load i8*, i8** %17
%35 = load i8*, i8** %11
%36 = load i32, i32* %16
%37 = call i32 @cnfExprt(i8* %34, i8* %35, i32 %36)
%38 = load i8*, i8** %19
%39 = call i32 @cnfFree(i8* %38)
%40 = load i8*, i8** %18
%41 = call i32 @cnfFree(i8* %40)
%42 = load i8*, i8** %17
%43 = call i32 @cnfFree(i8* %42)
ret void
}

LLVM IR (-O2):
define void @ems_mload_(i8* %0, i8* %1, i8* %2, i32* %3, i32* %4, i32 %5, i32 %6, i32 %7) {
%9 = tail call i8* @cnfCreim(i8* %0, i32 %5)
%10 = tail call i8* @cnfCreim(i8* %1, i32 %6)
%11 = tail call i8* @cnfCreat(i32 %7)
%12 = tail call i32 @emsMload(i8* %9, i8* %10, i8* %11, i32* %3, i32* %4)
%13 = tail call i32 @cnfExprt(i8* %11, i8* %2, i32 %7)
%14 = tail call i32 @cnfFree(i8* %9)
%15 = tail call i32 @cnfFree(i8* %10)
%16 = tail call i32 @cnfFree(i8* %11)
ret void
}