int update_blc_ratio(struct msm_sensor_ctrl_t *a_ctrl) {
  int K, temp;
  write_sccb16(0x3d84, 0xdf, a_ctrl);
  write_sccb16(0x3d81, 0x01, a_ctrl);
  msleep(5);
  K = read_sccb16(0x3d0b, a_ctrl);
  if (K != 0) {
    if ((K >= 0x15) && (K <= 0x40)) {
      pr_err("%s  auto load mode ", __func__);
      temp = read_sccb16(0x4008, a_ctrl);
      temp &= 0xfb;
      write_sccb16(0x4008, temp, a_ctrl);
      temp = read_sccb16(0x4000, a_ctrl);
      temp &= 0xf7;
      write_sccb16(0x4000, temp, a_ctrl);
      return 2;
    }
  }
  K = read_sccb16(0x3d0a, a_ctrl);
  if ((K >= 0x10) && (K <= 0x40)) {
    pr_err("%s  manual load mode ", __func__);
    write_sccb16(0x4006, K, a_ctrl);
    temp = read_sccb16(0x4008, a_ctrl);
    temp &= 0xfb;
    write_sccb16(0x4008, temp, a_ctrl);
    temp = read_sccb16(0x4000, a_ctrl);
    temp |= 0x08;
    write_sccb16(0x4000, temp, a_ctrl);
    return 1;
  } else {
    pr_err("%s  set to default ", __func__);
    write_sccb16(0x4006, 0x20, a_ctrl);
    temp = read_sccb16(0x4008, a_ctrl);
    temp &= 0xfb;
    write_sccb16(0x4008, temp, a_ctrl);
    temp = read_sccb16(0x4000, a_ctrl);
    temp |= 0x08;
    write_sccb16(0x4000, temp, a_ctrl);
    return 0;
  }
}


x86 assembly (clang, -O0):
<update_blc_ratio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    $0x3d84,%edi
mov    $0xdf,%esi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    -0x10(%rbp),%rdx
mov    $0x3d81,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    $0x5,%edi
mov    $0x0,%al
call   1040 <msleep@plt>
mov    -0x10(%rbp),%rsi
mov    $0x3d0b,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     123b <update_blc_ratio+0xfb>
cmpl   $0x15,-0x14(%rbp)
jl     1236 <update_blc_ratio+0xf6>
cmpl   $0x40,-0x14(%rbp)
jg     1236 <update_blc_ratio+0xf6>
lea    0xe46(%rip),%rdi
lea    0xe53(%rip),%rsi
mov    $0x0,%al
call   1050 <pr_err@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4008,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xfb,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4008,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4000,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xf7,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4000,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
movl   $0x2,-0x4(%rbp)
jmp    1387 <update_blc_ratio+0x247>
jmp    123b <update_blc_ratio+0xfb>
mov    -0x10(%rbp),%rsi
mov    $0x3d0a,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jl     12f6 <update_blc_ratio+0x1b6>
cmpl   $0x40,-0x14(%rbp)
jg     12f6 <update_blc_ratio+0x1b6>
lea    0xdbc(%rip),%rdi
lea    0xda4(%rip),%rsi
mov    $0x0,%al
call   1050 <pr_err@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4006,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4008,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xfb,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4008,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4000,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4000,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
movl   $0x1,-0x4(%rbp)
jmp    1387 <update_blc_ratio+0x247>
lea    0xd3e(%rip),%rdi
lea    0xd10(%rip),%rsi
mov    $0x0,%al
call   1050 <pr_err@plt>
mov    -0x10(%rbp),%rdx
mov    $0x4006,%edi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4008,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xfb,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4008,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
mov    -0x10(%rbp),%rsi
mov    $0x4000,%edi
mov    $0x0,%al
call   1030 <read_sccb16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x4000,%edi
mov    $0x0,%al
call   1060 <write_sccb16@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<update_blc_ratio>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0x3d84,%edi
mov    $0xdf,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x3d81,%edi
mov    $0x1,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x5,%edi
xor    %eax,%eax
call   1040 <msleep@plt>
mov    $0x3d0b,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
add    $0xffffffeb,%eax
cmp    $0x2b,%eax
ja     11eb <update_blc_ratio+0xab>
lea    0xe67(%rip),%rdi
lea    0xe74(%rip),%rsi
xor    %eax,%eax
call   1050 <pr_err@plt>
mov    $0x4008,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
and    $0xfb,%eax
mov    $0x4008,%edi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x4000,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
and    $0xf7,%eax
mov    $0x2,%r14d
jmp    12cc <update_blc_ratio+0x18c>
xor    %r14d,%r14d
mov    $0x3d0a,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
mov    %eax,%ebp
lea    -0x10(%rbp),%eax
cmp    $0x30,%eax
ja     126c <update_blc_ratio+0x12c>
lea    0xe17(%rip),%rdi
lea    0xdff(%rip),%rsi
xor    %eax,%eax
call   1050 <pr_err@plt>
mov    $0x4006,%edi
mov    %ebp,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x4008,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
and    $0xfb,%eax
mov    $0x4008,%edi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x4000,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
or     $0x8,%eax
mov    $0x1,%r14d
jmp    12cc <update_blc_ratio+0x18c>
lea    0xdc8(%rip),%rdi
lea    0xd9a(%rip),%rsi
xor    %eax,%eax
call   1050 <pr_err@plt>
mov    $0x4006,%edi
mov    $0x20,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x4008,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
and    $0xfb,%eax
mov    $0x4008,%edi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    $0x4000,%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <read_sccb16@plt>
or     $0x8,%eax
mov    $0x4000,%edi
mov    %eax,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1060 <write_sccb16@plt>
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.msm_sensor_ctrl_t = type opaque
@.str = [20 x i8] c"%s auto load mode \00"
@__func__.update_blc_ratio = [17 x i8] c"update_blc_ratio\00"
@.str.1 = [22 x i8] c"%s manual load mode \00"
@.str.2 = [20 x i8] c"%s set to default \00"
define i32 @update_blc_ratio(%struct.msm_sensor_ctrl_t* %0) {
%2 = alloca i32
%3 = alloca %struct.msm_sensor_ctrl_t*
%4 = alloca i32
%5 = alloca i32
store %struct.msm_sensor_ctrl_t* %0, %struct.msm_sensor_ctrl_t** %3
%6 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%7 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15748, i32 223, %struct.msm_sensor_ctrl_t* %6)
%8 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%9 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15745, i32 1, %struct.msm_sensor_ctrl_t* %8)
%10 = call i32 (i32, ...) bitcast (i32 (...)* @msleep to i32 (i32, ...)*)(i32 5)
%11 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%12 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15627, %struct.msm_sensor_ctrl_t* %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp ne i32 %13, 0
br i1 %14, label %15, label %38
15: ; preds = %1
%16 = load i32, i32* %4
%17 = icmp sge i32 %16, 21
br i1 %17, label %18, label %37
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp sle i32 %19, 64
br i1 %20, label %21, label %37
21: ; preds = %18
%22 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.update_blc_ratio, i64 0, i64 0))
%23 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%24 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, %struct.msm_sensor_ctrl_t* %23)
store i32 %24, i32* %5
%25 = load i32, i32* %5
%26 = and i32 %25, 251
store i32 %26, i32* %5
%27 = load i32, i32* %5
%28 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%29 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, i32 %27, %struct.msm_sensor_ctrl_t* %28)
%30 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%31 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, %struct.msm_sensor_ctrl_t* %30)
store i32 %31, i32* %5
%32 = load i32, i32* %5
%33 = and i32 %32, 247
store i32 %33, i32* %5
%34 = load i32, i32* %5
%35 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%36 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, i32 %34, %struct.msm_sensor_ctrl_t* %35)
store i32 2, i32* %2
br label %83
37: ; preds = %18, %15
br label %38
38: ; preds = %37, %1
%39 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%40 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15626, %struct.msm_sensor_ctrl_t* %39)
store i32 %40, i32* %4
%41 = load i32, i32* %4
%42 = icmp sge i32 %41, 16
br i1 %42, label %43, label %65
43: ; preds = %38
%44 = load i32, i32* %4
%45 = icmp sle i32 %44, 64
br i1 %45, label %46, label %65
46: ; preds = %43
%47 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.update_blc_ratio, i64 0, i64 0))
%48 = load i32, i32* %4
%49 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%50 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16390, i32 %48, %struct.msm_sensor_ctrl_t* %49)
%51 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%52 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, %struct.msm_sensor_ctrl_t* %51)
store i32 %52, i32* %5
%53 = load i32, i32* %5
%54 = and i32 %53, 251
store i32 %54, i32* %5
%55 = load i32, i32* %5
%56 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%57 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, i32 %55, %struct.msm_sensor_ctrl_t* %56)
%58 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%59 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, %struct.msm_sensor_ctrl_t* %58)
store i32 %59, i32* %5
%60 = load i32, i32* %5
%61 = or i32 %60, 8
store i32 %61, i32* %5
%62 = load i32, i32* %5
%63 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%64 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, i32 %62, %struct.msm_sensor_ctrl_t* %63)
store i32 1, i32* %2
br label %83
65: ; preds = %43, %38
%66 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.update_blc_ratio, i64 0, i64 0))
%67 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%68 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16390, i32 32, %struct.msm_sensor_ctrl_t* %67)
%69 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%70 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, %struct.msm_sensor_ctrl_t* %69)
store i32 %70, i32* %5
%71 = load i32, i32* %5
%72 = and i32 %71, 251
store i32 %72, i32* %5
%73 = load i32, i32* %5
%74 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%75 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, i32 %73, %struct.msm_sensor_ctrl_t* %74)
%76 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%77 = call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, %struct.msm_sensor_ctrl_t* %76)
store i32 %77, i32* %5
%78 = load i32, i32* %5
%79 = or i32 %78, 8
store i32 %79, i32* %5
%80 = load i32, i32* %5
%81 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %3
%82 = call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, i32 %80, %struct.msm_sensor_ctrl_t* %81)
store i32 0, i32* %2
br label %83
83: ; preds = %65, %46, %21
%84 = load i32, i32* %2
ret i32 %84
}

LLVM IR (-O2):
%struct.msm_sensor_ctrl_t = type opaque
@.str = [20 x i8] c"%s auto load mode \00"
@__func__.update_blc_ratio = [17 x i8] c"update_blc_ratio\00"
@.str.1 = [22 x i8] c"%s manual load mode \00"
@.str.2 = [20 x i8] c"%s set to default \00"
define i32 @update_blc_ratio(%struct.msm_sensor_ctrl_t* %0) {
%2 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15748, i32 223, %struct.msm_sensor_ctrl_t* %0)
%3 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15745, i32 1, %struct.msm_sensor_ctrl_t* %0)
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @msleep to i32 (i32, ...)*)(i32 5)
%5 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15627, %struct.msm_sensor_ctrl_t* %0)
%6 = add i32 %5, -21
%7 = icmp ult i32 %6, 44
br i1 %7, label %8, label %15
8: ; preds = %1
%9 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.update_blc_ratio, i64 0, i64 0))
%10 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, %struct.msm_sensor_ctrl_t* %0)
%11 = and i32 %10, 251
%12 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, i32 %11, %struct.msm_sensor_ctrl_t* %0)
%13 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, %struct.msm_sensor_ctrl_t* %0)
%14 = and i32 %13, 247
br label %35
15: ; preds = %1
%16 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 15626, %struct.msm_sensor_ctrl_t* %0)
%17 = add i32 %16, -16
%18 = icmp ult i32 %17, 49
br i1 %18, label %19, label %27
19: ; preds = %15
%20 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.update_blc_ratio, i64 0, i64 0))
%21 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16390, i32 %16, %struct.msm_sensor_ctrl_t* %0)
%22 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, %struct.msm_sensor_ctrl_t* %0)
%23 = and i32 %22, 251
%24 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, i32 %23, %struct.msm_sensor_ctrl_t* %0)
%25 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, %struct.msm_sensor_ctrl_t* %0)
%26 = or i32 %25, 8
br label %35
27: ; preds = %15
%28 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @pr_err to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__func__.update_blc_ratio, i64 0, i64 0))
%29 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16390, i32 32, %struct.msm_sensor_ctrl_t* %0)
%30 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, %struct.msm_sensor_ctrl_t* %0)
%31 = and i32 %30, 251
%32 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16392, i32 %31, %struct.msm_sensor_ctrl_t* %0)
%33 = tail call i32 (i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @read_sccb16 to i32 (i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, %struct.msm_sensor_ctrl_t* %0)
%34 = or i32 %33, 8
br label %35
35: ; preds = %27, %19, %8
%36 = phi i32 [ %34, %27 ], [ %26, %19 ], [ %14, %8 ]
%37 = phi i32 [ 0, %27 ], [ 1, %19 ], [ 2, %8 ]
%38 = tail call i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...) bitcast (i32 (...)* @write_sccb16 to i32 (i32, i32, %struct.msm_sensor_ctrl_t*, ...)*)(i32 16384, i32 %36, %struct.msm_sensor_ctrl_t* %0)
ret i32 %37
}