int bma222_get_calibration(signed char *cal_result) {
  signed char tmp = 0;
  printk("[HSS] [%s] \n", __func__);
  bma222_get_offset_filt_x(&tmp);
  cal_result[0] = tmp;
  bma222_get_offset_filt_y(&tmp);
  cal_result[1] = tmp;
  bma222_get_offset_filt_z(&tmp);
  cal_result[2] = tmp;
  return 0;
}


x86 assembly (clang, -O0):
<bma222_get_calibration>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
lea    0xea9(%rip),%rdi
lea    0xeaf(%rip),%rsi
mov    $0x0,%al
call   1040 <printk@plt>
lea    -0x9(%rbp),%rdi
mov    $0x0,%al
call   1060 <bma222_get_offset_filt_x@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
lea    -0x9(%rbp),%rdi
mov    $0x0,%al
call   1030 <bma222_get_offset_filt_y@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
lea    -0x9(%rbp),%rdi
mov    $0x0,%al
call   1050 <bma222_get_offset_filt_z@plt>
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bma222_get_calibration>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
movb   $0x0,0x7(%rsp)
lea    0xead(%rip),%rdi
lea    0xeb3(%rip),%rsi
xor    %eax,%eax
call   1040 <printk@plt>
lea    0x7(%rsp),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <bma222_get_offset_filt_x@plt>
mov    0x7(%rsp),%al
mov    %al,(%rbx)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <bma222_get_offset_filt_y@plt>
mov    0x7(%rsp),%al
mov    %al,0x1(%rbx)
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <bma222_get_offset_filt_z@plt>
mov    0x7(%rsp),%al
mov    %al,0x2(%rbx)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [13 x i8] c"[HSS] [%s] \0A\00"
@__func__.bma222_get_calibration = [23 x i8] c"bma222_get_calibration\00"
define i32 @bma222_get_calibration(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.bma222_get_calibration, i64 0, i64 0))
%5 = call i32 (i8*, ...) bitcast (i32 (...)* @bma222_get_offset_filt_x to i32 (i8*, ...)*)(i8* %3)
%6 = load i8, i8* %3
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 0
store i8 %6, i8* %8
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @bma222_get_offset_filt_y to i32 (i8*, ...)*)(i8* %3)
%10 = load i8, i8* %3
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i64 1
store i8 %10, i8* %12
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @bma222_get_offset_filt_z to i32 (i8*, ...)*)(i8* %3)
%14 = load i8, i8* %3
%15 = load i8*, i8** %2
%16 = getelementptr inbounds i8, i8* %15, i64 2
store i8 %14, i8* %16
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"[HSS] [%s] \0A\00"
@__func__.bma222_get_calibration = [23 x i8] c"bma222_get_calibration\00"
define i32 @bma222_get_calibration(i8* nocapture writeonly %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @__func__.bma222_get_calibration, i64 0, i64 0))
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @bma222_get_offset_filt_x to i32 (i8*, ...)*)(i8* %2)
%5 = load i8, i8* %2
store i8 %5, i8* %0
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @bma222_get_offset_filt_y to i32 (i8*, ...)*)(i8* %2)
%7 = load i8, i8* %2
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @bma222_get_offset_filt_z to i32 (i8*, ...)*)(i8* %2)
%10 = load i8, i8* %2
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %10, i8* %11
ret i32 0
}