void BatchSetText(unsigned short int control_id, unsigned char *strings) {
  SendChar(((control_id) >> 8) & 0xFF);
  SendChar((control_id)&0xFF);
  SendChar(((GetStringLen(strings)) >> 8) & 0xFF);
  SendChar((GetStringLen(strings)) & 0xFF);
  SendStrings(strings);
}


x86 assembly (clang, -O0):
<BatchSetText>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
movzwl -0x2(%rbp),%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <SendChar@plt>
movzwl -0x2(%rbp),%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <GetStringLen@plt>
mov    %eax,%edi
sar    $0x8,%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <GetStringLen@plt>
mov    %eax,%edi
and    $0xff,%edi
mov    $0x0,%al
call   1030 <SendChar@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <SendStrings@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BatchSetText>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
shr    $0x8,%edi
xor    %eax,%eax
call   1030 <SendChar@plt>
movzbl %bpl,%edi
xor    %eax,%eax
call   1030 <SendChar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <GetStringLen@plt>
movzbl %ah,%edi
xor    %eax,%eax
call   1030 <SendChar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <GetStringLen@plt>
movzbl %al,%edi
xor    %eax,%eax
call   1030 <SendChar@plt>
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <SendStrings@plt>

LLVM IR (-O0):
define void @BatchSetText(i16 zeroext %0, i8* %1) {
%3 = alloca i16
%4 = alloca i8*
store i16 %0, i16* %3
store i8* %1, i8** %4
%5 = load i16, i16* %3
%6 = zext i16 %5 to i32
%7 = ashr i32 %6, 8
%8 = and i32 %7, 255
%9 = call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %8)
%10 = load i16, i16* %3
%11 = zext i16 %10 to i32
%12 = and i32 %11, 255
%13 = call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %12)
%14 = load i8*, i8** %4
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @GetStringLen to i32 (i8*, ...)*)(i8* %14)
%16 = ashr i32 %15, 8
%17 = and i32 %16, 255
%18 = call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %17)
%19 = load i8*, i8** %4
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @GetStringLen to i32 (i8*, ...)*)(i8* %19)
%21 = and i32 %20, 255
%22 = call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %21)
%23 = load i8*, i8** %4
%24 = call i32 (i8*, ...) bitcast (i32 (...)* @SendStrings to i32 (i8*, ...)*)(i8* %23)
ret void
}

LLVM IR (-O2):
define void @BatchSetText(i16 zeroext %0, i8* %1) {
%3 = zext i16 %0 to i32
%4 = lshr i32 %3, 8
%5 = tail call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %4)
%6 = and i32 %3, 255
%7 = tail call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %6)
%8 = tail call i32 (i8*, ...) bitcast (i32 (...)* @GetStringLen to i32 (i8*, ...)*)(i8* %1)
%9 = lshr i32 %8, 8
%10 = and i32 %9, 255
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %10)
%12 = tail call i32 (i8*, ...) bitcast (i32 (...)* @GetStringLen to i32 (i8*, ...)*)(i8* %1)
%13 = and i32 %12, 255
%14 = tail call i32 (i32, ...) bitcast (i32 (...)* @SendChar to i32 (i32, ...)*)(i32 %13)
%15 = tail call i32 (i8*, ...) bitcast (i32 (...)* @SendStrings to i32 (i8*, ...)*)(i8* %1)
ret void
}