#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*/ audio_set_volume(int);
int /*<<< orphan*/ delay_m(int);
int /*<<< orphan*/ vs_spi_clk_data();
int /*<<< orphan*/ vs_write_data(unsigned char *, int);
int /*<<< orphan*/ vs_write_reg(int, int);
void audio_sin_test(void) {
  unsigned char sin_start[8] = {0x53, 0xef, 0x6e, 0x44, 0x00, 0x00, 0x00, 0x00};
  unsigned char sin_end[8] = {0x45, 0x78, 0x69, 0x74, 0x00, 0x00, 0x00, 0x00};
  vs_write_reg((0x00), 0x0820);
  audio_set_volume(50);
  vs_spi_clk_data();
  vs_write_data(sin_start, 8);
  delay_m(20000);
  vs_write_data(sin_end, 8);
  delay_m(500);
}


x86 assembly (clang, -O0):
<audio_sin_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0xe9e(%rip),%rax
mov    %rax,-0x10(%rbp)
xor    %edi,%edi
mov    $0x820,%esi
call   1070 <vs_write_reg@plt>
mov    $0x32,%edi
call   1050 <audio_set_volume@plt>
mov    $0x0,%al
call   1060 <vs_spi_clk_data@plt>
lea    -0x8(%rbp),%rdi
mov    $0x8,%esi
call   1030 <vs_write_data@plt>
mov    $0x4e20,%edi
call   1040 <delay_m@plt>
lea    -0x10(%rbp),%rdi
mov    $0x8,%esi
call   1030 <vs_write_data@plt>
mov    $0x1f4,%edi
call   1040 <delay_m@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audio_sin_test>:
sub    $0x18,%rsp
movq   $0x446eef53,0x10(%rsp)
6e 44
movq   $0x74697845,0x8(%rsp)
69 74
xor    %edi,%edi
mov    $0x820,%esi
call   1070 <vs_write_reg@plt>
mov    $0x32,%edi
call   1050 <audio_set_volume@plt>
xor    %eax,%eax
call   1060 <vs_spi_clk_data@plt>
lea    0x10(%rsp),%rdi
mov    $0x8,%esi
call   1030 <vs_write_data@plt>
mov    $0x4e20,%edi
call   1040 <delay_m@plt>
lea    0x8(%rsp),%rdi
mov    $0x8,%esi
call   1030 <vs_write_data@plt>
mov    $0x1f4,%edi
call   1040 <delay_m@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.audio_sin_test.sin_start = [8 x i8] c"S\EFnD\00\00\00\00"
@__const.audio_sin_test.sin_end = [8 x i8] c"Exit\00\00\00\00"
define void @audio_sin_test() {
%1 = alloca [8 x i8]
%2 = alloca [8 x i8]
%3 = bitcast [8 x i8]* %1 to i8*
%4 = bitcast [8 x i8]* %2 to i8*
%5 = call i32 @vs_write_reg(i32 0, i32 2080)
%6 = call i32 @audio_set_volume(i32 50)
%7 = call i32 (...) @vs_spi_clk_data()
%8 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%9 = call i32 @vs_write_data(i8* %8, i32 8)
%10 = call i32 @delay_m(i32 20000)
%11 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%12 = call i32 @vs_write_data(i8* %11, i32 8)
%13 = call i32 @delay_m(i32 500)
ret void
}

LLVM IR (-O2):
define void @audio_sin_test() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
store i64 1148120915, i64* %1
%4 = bitcast i64* %2 to i8*
store i64 1953069125, i64* %2
%5 = tail call i32 @vs_write_reg(i32 0, i32 2080)
%6 = tail call i32 @audio_set_volume(i32 50)
%7 = tail call i32 (...) @vs_spi_clk_data()
%8 = call i32 @vs_write_data(i8* %3, i32 8)
%9 = call i32 @delay_m(i32 20000)
%10 = call i32 @vs_write_data(i8* %4, i32 8)
%11 = call i32 @delay_m(i32 500)
ret void
}