#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char const *);
int /*<<< orphan*/ system(char *);
int main(int argc, const char *argv[]) {
  system("amixer sset 'PCM' 80%");
  system("aplay /home/pi/Music/Beeps/accept.wav ");
  system("amixer  sset 'PCM'  90% ");
  system("aplay /home/pi/Music/HumanVoices/you_have_a_new_text_message.wav");
  system("amixer set Mast 30%");
  FILE *f = fopen("textMessage.txt", "w");
  int i = 0;
  for (i = 1; i < argc; i++)
    fprintf(f, "%s\n", argv[i]);
  fclose(f);
  system("flite -voice slt  -f \"textMessage.txt\"");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xea3(%rip),%rdi
call   1040 <system@plt>
lea    0xead(%rip),%rdi
call   1040 <system@plt>
lea    0xec8(%rip),%rdi
call   1040 <system@plt>
lea    0xed5(%rip),%rdi
call   1040 <system@plt>
lea    0xf0a(%rip),%rdi
call   1040 <system@plt>
lea    0xf12(%rip),%rdi
lea    0xf1b(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11ed <main+0xad>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xee3(%rip),%rsi
call   1050 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11b7 <main+0x77>
mov    -0x18(%rbp),%rdi
call   1030 <fclose@plt>
lea    0xec4(%rip),%rdi
call   1040 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r15
mov    %edi,%r14d
lea    0xeab(%rip),%rdi
call   1040 <system@plt>
lea    0xeb5(%rip),%rdi
call   1040 <system@plt>
lea    0xed0(%rip),%rdi
call   1040 <system@plt>
lea    0xedd(%rip),%rdi
call   1040 <system@plt>
lea    0xf12(%rip),%rdi
call   1040 <system@plt>
lea    0xf1a(%rip),%rdi
lea    0xf23(%rip),%rsi
call   1060 <fopen@plt>
mov    %rax,%r12
cmp    $0x2,%r14d
jl     11d8 <main+0x98>
mov    %r14d,%ebx
mov    $0x1,%ebp
lea    0xf08(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r15,%rbp,8),%rdx
mov    %r12,%rdi
mov    %r14,%rsi
call   1050 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    11c0 <main+0x80>
mov    %r12,%rdi
call   1030 <fclose@plt>
lea    0xeda(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"amixer sset 'PCM' 80%\00"
@.str.1 = [39 x i8] c"aplay /home/pi/Music/Beeps/accept.wav \00"
@.str.2 = [25 x i8] c"amixer sset 'PCM' 90% \00"
@.str.3 = [65 x i8] c"aplay /home/pi/Music/HumanVoices/you_have_a_new_text_message.wav\00"
@.str.4 = [20 x i8] c"amixer set Mast 30%\00"
@.str.5 = [16 x i8] c"textMessage.txt\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [39 x i8] c"flite -voice slt -f \22textMessage.txt\22\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
store i32* %13, i32** %6
store i32 0, i32* %7
store i32 1, i32* %7
br label %14
14: ; preds = %26, %2
%15 = load i32, i32* %7
%16 = load i32, i32* %4
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %29
18: ; preds = %14
%19 = load i32*, i32** %6
%20 = load i8**, i8*** %5
%21 = load i32, i32* %7
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8*, i8** %20, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 @fprintf(i32* %19, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %24)
br label %26
26: ; preds = %18
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
store i32 %28, i32* %7
br label %14
29: ; preds = %14
%30 = load i32*, i32** %6
%31 = call i32 @fclose(i32* %30)
%32 = call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0))
%33 = load i32, i32* %3
ret i32 %33
}

LLVM IR (-O2):
@.str = [22 x i8] c"amixer sset 'PCM' 80%\00"
@.str.1 = [39 x i8] c"aplay /home/pi/Music/Beeps/accept.wav \00"
@.str.2 = [25 x i8] c"amixer sset 'PCM' 90% \00"
@.str.3 = [65 x i8] c"aplay /home/pi/Music/HumanVoices/you_have_a_new_text_message.wav\00"
@.str.4 = [20 x i8] c"amixer set Mast 30%\00"
@.str.5 = [16 x i8] c"textMessage.txt\00"
@.str.6 = [2 x i8] c"w\00"
@.str.7 = [4 x i8] c"%s\0A\00"
@.str.8 = [39 x i8] c"flite -voice slt -f \22textMessage.txt\22\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @system(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 @system(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @system(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @system(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32* @fopen(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %19
10: ; preds = %2
%11 = zext i32 %0 to i64
br label %12
12: ; preds = %10, %12
%13 = phi i64 [ 1, %10 ], [ %17, %12 ]
%14 = getelementptr inbounds i8*, i8** %1, i64 %13
%15 = load i8*, i8** %14
%16 = tail call i32 @fprintf(i32* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i8* %15)
%17 = add nuw nsw i64 %13, 1
%18 = icmp eq i64 %17, %11
br i1 %18, label %19, label %12
19: ; preds = %12, %2
%20 = tail call i32 @fclose(i32* %8)
%21 = tail call i32 @system(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}