#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 */

/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
int /*<<< orphan*/ set_pmu_active_default();
int /*<<< orphan*/ set_pmu_adc_period(int);
int /*<<< orphan*/ set_pmu_sar_override(int);
int /*<<< orphan*/ set_pmu_sleep_default();
void set_pmu_motion_img_default(void) {
  mbus_remote_register_write(0x8, 0x05,
                             ((0 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                              (0 << 9) | (0 << 8) | (0 << 7) | (45)));
  delay(200);
  mbus_remote_register_write(0x8, 0x05,
                             ((0 << 13) | (0 << 12) | (1 << 11) | (0 << 10) |
                              (0 << 9) | (0 << 8) | (0 << 7) | (45)));
  delay(200);
  set_pmu_sar_override(45);
  delay(200);
  set_pmu_sleep_default();
  set_pmu_active_default();
  mbus_remote_register_write(0x8, 0x00, 0x19);
  delay(200);
  delay(200);
  mbus_remote_register_write(0x8, 0x00, 0x18);
  delay(200);
  delay(200);
  set_pmu_adc_period(0x200);
}


x86 assembly (clang, -O0):
<set_pmu_motion_img_default>:
push   %rbp
mov    %rsp,%rbp
mov    $0x8,%edi
mov    $0x5,%esi
mov    $0x82d,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
mov    $0x5,%esi
mov    $0x82d,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x2d,%edi
call   1030 <set_pmu_sar_override@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x0,%al
call   1070 <set_pmu_sleep_default@plt>
mov    $0x0,%al
call   1080 <set_pmu_active_default@plt>
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x19,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x200,%edi
call   1050 <set_pmu_adc_period@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_pmu_motion_img_default>:
push   %rax
mov    $0x8,%edi
mov    $0x5,%esi
mov    $0x82d,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
mov    $0x5,%esi
mov    $0x82d,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x2d,%edi
call   1030 <set_pmu_sar_override@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
xor    %eax,%eax
call   1070 <set_pmu_sleep_default@plt>
xor    %eax,%eax
call   1080 <set_pmu_active_default@plt>
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x19,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x8,%edi
xor    %esi,%esi
mov    $0x18,%edx
call   1060 <mbus_remote_register_write@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0xc8,%edi
call   1040 <delay@plt>
mov    $0x200,%edi
pop    %rax
jmp    1050 <set_pmu_adc_period@plt>

LLVM IR (-O0):
define void @set_pmu_motion_img_default() {
%1 = call i32 @mbus_remote_register_write(i32 8, i32 5, i32 2093)
%2 = call i32 @delay(i32 200)
%3 = call i32 @mbus_remote_register_write(i32 8, i32 5, i32 2093)
%4 = call i32 @delay(i32 200)
%5 = call i32 @set_pmu_sar_override(i32 45)
%6 = call i32 @delay(i32 200)
%7 = call i32 (...) @set_pmu_sleep_default()
%8 = call i32 (...) @set_pmu_active_default()
%9 = call i32 @mbus_remote_register_write(i32 8, i32 0, i32 25)
%10 = call i32 @delay(i32 200)
%11 = call i32 @delay(i32 200)
%12 = call i32 @mbus_remote_register_write(i32 8, i32 0, i32 24)
%13 = call i32 @delay(i32 200)
%14 = call i32 @delay(i32 200)
%15 = call i32 @set_pmu_adc_period(i32 512)
ret void
}

LLVM IR (-O2):
define void @set_pmu_motion_img_default() {
%1 = tail call i32 @mbus_remote_register_write(i32 8, i32 5, i32 2093)
%2 = tail call i32 @delay(i32 200)
%3 = tail call i32 @mbus_remote_register_write(i32 8, i32 5, i32 2093)
%4 = tail call i32 @delay(i32 200)
%5 = tail call i32 @set_pmu_sar_override(i32 45)
%6 = tail call i32 @delay(i32 200)
%7 = tail call i32 (...) @set_pmu_sleep_default()
%8 = tail call i32 (...) @set_pmu_active_default()
%9 = tail call i32 @mbus_remote_register_write(i32 8, i32 0, i32 25)
%10 = tail call i32 @delay(i32 200)
%11 = tail call i32 @delay(i32 200)
%12 = tail call i32 @mbus_remote_register_write(i32 8, i32 0, i32 24)
%13 = tail call i32 @delay(i32 200)
%14 = tail call i32 @delay(i32 200)
%15 = tail call i32 @set_pmu_adc_period(i32 512)
ret void
}