#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 */
struct msm_sensor_ctrl_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ write_sccb16(int, int, struct msm_sensor_ctrl_t *);
void clear_otp_buffer(struct msm_sensor_ctrl_t *s_ctrl) {
  int i;
  for (i = 0; i < 16; i++) {
    write_sccb16(0x3d00 + i, 0x00, s_ctrl);
  }
}


x86 assembly (clang, -O0):
<clear_otp_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jge    114f <clear_otp_buffer+0x3f>
mov    -0xc(%rbp),%edi
add    $0x3d00,%edi
mov    -0x8(%rbp),%rdx
xor    %esi,%esi
call   1030 <write_sccb16@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <clear_otp_buffer+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clear_otp_buffer>:
push   %rbx
mov    %rdi,%rbx
mov    $0x3d00,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d01,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d02,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d03,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d04,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d05,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d06,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d07,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d08,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d09,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d0a,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d0b,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d0c,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d0d,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d0e,%edi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <write_sccb16@plt>
mov    $0x3d0f,%edi
xor    %esi,%esi
mov    %rbx,%rdx
pop    %rbx
jmp    1030 <write_sccb16@plt>

LLVM IR (-O0):
%struct.msm_sensor_ctrl_t = type { i32 }
define void @clear_otp_buffer(%struct.msm_sensor_ctrl_t* %0) {
%2 = alloca %struct.msm_sensor_ctrl_t*
%3 = alloca i32
store %struct.msm_sensor_ctrl_t* %0, %struct.msm_sensor_ctrl_t** %2
store i32 0, i32* %3
br label %4
4: ; preds = %12, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 16
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = add nsw i32 15616, %8
%10 = load %struct.msm_sensor_ctrl_t*, %struct.msm_sensor_ctrl_t** %2
%11 = call i32 @write_sccb16(i32 %9, i32 0, %struct.msm_sensor_ctrl_t* %10)
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, 1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
ret void
}

LLVM IR (-O2):
%struct.msm_sensor_ctrl_t = type { i32 }
define void @clear_otp_buffer(%struct.msm_sensor_ctrl_t* %0) {
%2 = tail call i32 @write_sccb16(i32 15616, i32 0, %struct.msm_sensor_ctrl_t* %0)
%3 = tail call i32 @write_sccb16(i32 15617, i32 0, %struct.msm_sensor_ctrl_t* %0)
%4 = tail call i32 @write_sccb16(i32 15618, i32 0, %struct.msm_sensor_ctrl_t* %0)
%5 = tail call i32 @write_sccb16(i32 15619, i32 0, %struct.msm_sensor_ctrl_t* %0)
%6 = tail call i32 @write_sccb16(i32 15620, i32 0, %struct.msm_sensor_ctrl_t* %0)
%7 = tail call i32 @write_sccb16(i32 15621, i32 0, %struct.msm_sensor_ctrl_t* %0)
%8 = tail call i32 @write_sccb16(i32 15622, i32 0, %struct.msm_sensor_ctrl_t* %0)
%9 = tail call i32 @write_sccb16(i32 15623, i32 0, %struct.msm_sensor_ctrl_t* %0)
%10 = tail call i32 @write_sccb16(i32 15624, i32 0, %struct.msm_sensor_ctrl_t* %0)
%11 = tail call i32 @write_sccb16(i32 15625, i32 0, %struct.msm_sensor_ctrl_t* %0)
%12 = tail call i32 @write_sccb16(i32 15626, i32 0, %struct.msm_sensor_ctrl_t* %0)
%13 = tail call i32 @write_sccb16(i32 15627, i32 0, %struct.msm_sensor_ctrl_t* %0)
%14 = tail call i32 @write_sccb16(i32 15628, i32 0, %struct.msm_sensor_ctrl_t* %0)
%15 = tail call i32 @write_sccb16(i32 15629, i32 0, %struct.msm_sensor_ctrl_t* %0)
%16 = tail call i32 @write_sccb16(i32 15630, i32 0, %struct.msm_sensor_ctrl_t* %0)
%17 = tail call i32 @write_sccb16(i32 15631, i32 0, %struct.msm_sensor_ctrl_t* %0)
ret void
}