#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 */
int /*<<< orphan*/ iDoRemoteFunc(unsigned char *, unsigned int, int);
char *malloc(int);
int /*<<< orphan*/ psGetParaBuf(int);
unsigned int sprintf(char *, char *, int, int);
int /*<<< orphan*/ strcpy(char *, int /*<<< orphan*/);
void vRcTSFID_RUDLL_GetErrorMSG(int errorno, char msgptr[80]) {
  unsigned int uiDataLen;
  char *psFunCall = malloc(100);
  uiDataLen = sprintf(psFunCall, "%u(%u,s000)", 4108, errorno);
  iDoRemoteFunc((unsigned char *)psFunCall, uiDataLen, 1);
  strcpy(msgptr, psGetParaBuf(3));
}


x86 assembly (clang, -O0):
<vRcTSFID_RUDLL_GetErrorMSG>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%ecx
lea    0xe85(%rip),%rsi
mov    $0x100c,%edx
call   1070 <sprintf@plt>
mov    %eax,-0x14(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    $0x1,%edx
call   1060 <iDoRemoteFunc@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x3,%edi
call   1040 <psGetParaBuf@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%esi
call   1030 <strcpy@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vRcTSFID_RUDLL_GetErrorMSG>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
mov    $0x64,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
lea    0xe93(%rip),%rsi
mov    %rax,%rdi
mov    $0x100c,%edx
mov    %ebp,%ecx
call   1070 <sprintf@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x1,%edx
call   1060 <iDoRemoteFunc@plt>
mov    $0x3,%edi
call   1040 <psGetParaBuf@plt>
mov    %r14,%rdi
mov    %eax,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%u(%u,s000)\00"
define void @vRcTSFID_RUDLL_GetErrorMSG(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%7 = call i8* @malloc(i32 100)
store i8* %7, i8** %6
%8 = load i8*, i8** %6
%9 = load i32, i32* %3
%10 = call i32 @sprintf(i8* %8, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4108, i32 %9)
store i32 %10, i32* %5
%11 = load i8*, i8** %6
%12 = load i32, i32* %5
%13 = call i32 @iDoRemoteFunc(i8* %11, i32 %12, i32 1)
%14 = load i8*, i8** %4
%15 = call i32 @psGetParaBuf(i32 3)
%16 = call i32 @strcpy(i8* %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%u(%u,s000)\00"
define void @vRcTSFID_RUDLL_GetErrorMSG(i32 %0, i8* %1) {
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i32 100)
%4 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 4108, i32 %0)
%5 = tail call i32 @iDoRemoteFunc(i8* %3, i32 %4, i32 1)
%6 = tail call i32 @psGetParaBuf(i32 3)
%7 = tail call i32 @strcpy(i8* %1, i32 %6)
ret void
}