int iRcTSFID_RUDLL_GetDeviceNo(char fpflag[3], unsigned char deviceno[12]) {
  unsigned int uiDataLen, uiRet;
  char *psFunCall = malloc(100);
  uiDataLen = sprintf(psFunCall, "%u(b003", 4107);
  memcpy(psFunCall + uiDataLen, fpflag, 3);
  uiDataLen += 3;
  uiDataLen += sprintf(psFunCall + uiDataLen, ",b000)");
  uiRet = iDoRemoteFunc((unsigned char *)psFunCall, uiDataLen, 1);
  free(psFunCall);
  if (uiRet) {
    vWriteLogTxt("iRcTSFID_RUDLL_GetDeviceNo iDoRemoteFunc ret = %d", uiRet);
    return 99;
  }
  if (iGetParaInt(0) == 0) {
    memcpy(deviceno, psGetParaBuf(3), 12);
  }
  return iGetParaInt(0);
}


x86 assembly (clang, -O0):
<iRcTSFID_RUDLL_GetDeviceNo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe67(%rip),%rsi
mov    $0x100b,%edx
mov    $0x0,%al
call   1090 <sprintf@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%rdx
mov    (%rdx),%si
mov    %si,(%rax,%rcx,1)
mov    0x2(%rdx),%dl
mov    %dl,0x2(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%eax
add    %rax,%rdi
lea    0xe2d(%rip),%rsi
mov    $0x0,%al
call   1090 <sprintf@plt>
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1080 <iDoRemoteFunc@plt>
mov    %eax,-0x20(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x0,-0x20(%rbp)
je     122e <iRcTSFID_RUDLL_GetDeviceNo+0xbe>
mov    -0x20(%rbp),%esi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1060 <vWriteLogTxt@plt>
movl   $0x63,-0x4(%rbp)
jmp    1275 <iRcTSFID_RUDLL_GetDeviceNo+0x105>
xor    %edi,%edi
mov    $0x0,%al
call   1040 <iGetParaInt@plt>
cmp    $0x0,%eax
jne    1269 <iRcTSFID_RUDLL_GetDeviceNo+0xf9>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    $0x3,%edi
mov    $0x0,%al
call   1050 <psGetParaBuf@plt>
mov    %eax,%ecx
mov    -0x30(%rbp),%rax
movslq %ecx,%rcx
mov    (%rcx),%rdx
mov    %rdx,(%rax)
mov    0x8(%rcx),%ecx
mov    %ecx,0x8(%rax)
xor    %edi,%edi
mov    $0x0,%al
call   1040 <iGetParaInt@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iRcTSFID_RUDLL_GetDeviceNo>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbp
mov    $0x64,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
lea    0xe72(%rip),%rsi
mov    %rax,%rdi
mov    $0x100b,%edx
xor    %eax,%eax
call   1090 <sprintf@plt>
mov    %eax,%ecx
movzwl 0x0(%rbp),%edx
mov    %dx,(%rbx,%rcx,1)
mov    0x2(%rbp),%dl
mov    %dl,0x2(%rbx,%rcx,1)
lea    0x3(%rax),%ecx
movl   $0x293030,0x3(%rbx,%rcx,1)
movl   $0x3030622c,(%rbx,%rcx,1)
lea    0x9(%rax),%esi
mov    %rbx,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1080 <iDoRemoteFunc@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
test   %ebp,%ebp
je     11fa <iRcTSFID_RUDLL_GetDeviceNo+0x8a>
lea    0xe28(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <vWriteLogTxt@plt>
mov    $0x63,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
xor    %edi,%edi
xor    %eax,%eax
call   1040 <iGetParaInt@plt>
test   %eax,%eax
jne    1222 <iRcTSFID_RUDLL_GetDeviceNo+0xb2>
mov    $0x3,%edi
xor    %eax,%eax
call   1050 <psGetParaBuf@plt>
cltq
mov    (%rax),%rcx
mov    %rcx,(%r14)
mov    0x8(%rax),%eax
mov    %eax,0x8(%r14)
xor    %edi,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <iGetParaInt@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%u(b003\00"
@.str.1 = [7 x i8] c",b000)\00"
@.str.2 = [50 x i8] c"iRcTSFID_RUDLL_GetDeviceNo iDoRemoteFunc ret = %d\00"
define i32 @iRcTSFID_RUDLL_GetDeviceNo(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = call i8* @malloc(i64 100)
store i8* %9, i8** %8
%10 = load i8*, i8** %8
%11 = call i32 (i8*, i8*, ...) @sprintf(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4107)
store i32 %11, i32* %6
%12 = load i8*, i8** %8
%13 = load i32, i32* %6
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8*, i8** %4
%17 = load i32, i32* %6
%18 = add i32 %17, 3
store i32 %18, i32* %6
%19 = load i8*, i8** %8
%20 = load i32, i32* %6
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* %6
%25 = add i32 %24, %23
store i32 %25, i32* %6
%26 = load i8*, i8** %8
%27 = load i32, i32* %6
%28 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @iDoRemoteFunc to i32 (i8*, i32, i32, ...)*)(i8* %26, i32 %27, i32 1)
store i32 %28, i32* %7
%29 = load i8*, i8** %8
%30 = load i32, i32* %7
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %35
32: ; preds = %2
%33 = load i32, i32* %7
%34 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @vWriteLogTxt to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %33)
store i32 99, i32* %3
br label %45
35: ; preds = %2
%36 = call i32 (i32, ...) bitcast (i32 (...)* @iGetParaInt to i32 (i32, ...)*)(i32 0)
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %35
%39 = load i8*, i8** %5
%40 = call i32 (i32, ...) bitcast (i32 (...)* @psGetParaBuf to i32 (i32, ...)*)(i32 3)
%41 = sext i32 %40 to i64
%42 = inttoptr i64 %41 to i8*
br label %43
43: ; preds = %38, %35
%44 = call i32 (i32, ...) bitcast (i32 (...)* @iGetParaInt to i32 (i32, ...)*)(i32 0)
store i32 %44, i32* %3
br label %45
45: ; preds = %43, %32
%46 = load i32, i32* %3
ret i32 %46
}

LLVM IR (-O2):
@.str = [8 x i8] c"%u(b003\00"
@.str.1 = [7 x i8] c",b000)\00"
@.str.2 = [50 x i8] c"iRcTSFID_RUDLL_GetDeviceNo iDoRemoteFunc ret = %d\00"
define i32 @iRcTSFID_RUDLL_GetDeviceNo(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = tail call dereferenceable_or_null(100) i8* @malloc(i64 100)
%4 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 4107)
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %3, i64 %5
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(3) %6, i8* align 1 dereferenceable(3) %0, i64 3, i1 false)
%7 = add i32 %4, 3
%8 = zext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %3, i64 %8
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(7) %9, i8* align 1 dereferenceable(7) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i64 7, i1 false)
%10 = add i32 %4, 9
%11 = tail call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @iDoRemoteFunc to i32 (i8*, i32, i32, ...)*)(i8* %3, i32 %10, i32 1)
tail call void @free(i8* %3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @vWriteLogTxt to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %24
15: ; preds = %2
%16 = tail call i32 (i32, ...) bitcast (i32 (...)* @iGetParaInt to i32 (i32, ...)*)(i32 0)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @psGetParaBuf to i32 (i32, ...)*)(i32 3)
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 dereferenceable(12) %1, i8* align 1 dereferenceable(12) %21, i64 12, i1 false)
br label %22
22: ; preds = %18, %15
%23 = tail call i32 (i32, ...) bitcast (i32 (...)* @iGetParaInt to i32 (i32, ...)*)(i32 0)
br label %24
24: ; preds = %22, %13
%25 = phi i32 [ 99, %13 ], [ %23, %22 ]
ret i32 %25
}