#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*/ kill_sound_task();
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ print_system_status(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sprintf(char *, char *);
int /*<<< orphan*/ system(char *);
int voip_route() {
  char command[256];
  int result;
  kill_sound_task();
  memset(command, '\0', sizeof(char) * 256);
  sprintf(
      command,
      "/usr/local/alsa/bin/sipvg 1|/usr/local/alsa/bin/aplay -D plughw:0,2&");
  printf("first to exec %s\r\n", command);
  print_system_status(system(command));
  sprintf(command, "/usr/local/alsa/bin/arecord -D plughw:0,2 -r 8 -f "
                   "S16_LE|/usr/local/alsa/bin/sipvg 0&");
  print_system_status(system(command));
}


x86 assembly (clang, -O0):
<voip_route>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    $0x0,%al
call   1060 <kill_sound_task@plt>
lea    -0x110(%rbp),%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
lea    -0x110(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x110(%rbp),%rsi
lea    0xe9f(%rip),%rdi
call   1040 <printf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1080 <print_system_status@plt>
lea    -0x110(%rbp),%rdi
lea    0xe8c(%rip),%rsi
call   1070 <sprintf@plt>
lea    -0x110(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1080 <print_system_status@plt>
mov    -0x4(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<voip_route>:
push   %rbx
sub    $0x100,%rsp
xor    %eax,%eax
call   1060 <kill_sound_task@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x100,%edx
call   1050 <memset@plt>
movabs $0x26322c303a7768,%rax
mov    %rax,0x3d(%rsp)
movups 0xe79(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe7e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe82(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xe86(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1070 <print_system_status@plt>
movabs $0x26302067767069,%rax
mov    %rax,0x4e(%rsp)
movups 0xe75(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xe7a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe7e(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xe82(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xe86(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %eax,%edi
call   1070 <print_system_status@plt>
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"/usr/local/alsa/bin/sipvg 1|/usr/local/alsa/bin/aplay -D plughw:0,2&\00"
@.str.1 = [19 x i8] c"first to exec %s\0D\0A\00"
@.str.2 = [86 x i8] c"/usr/local/alsa/bin/arecord -D plughw:0,2 -r 8 -f S16_LE|/usr/local/alsa/bin/sipvg 0&\00"
define i32 @voip_route() {
%1 = alloca i32
%2 = alloca [256 x i8]
%3 = alloca i32
%4 = call i32 (...) @kill_sound_task()
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%6 = call i32 @memset(i8* %5, i8 signext 0, i32 256)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%12 = call i32 @system(i8* %11)
%13 = call i32 @print_system_status(i32 %12)
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%15 = call i32 @sprintf(i8* %14, i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
%17 = call i32 @system(i8* %16)
%18 = call i32 @print_system_status(i32 %17)
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [69 x i8] c"/usr/local/alsa/bin/sipvg 1|/usr/local/alsa/bin/aplay -D plughw:0,2&\00"
@.str.1 = [19 x i8] c"first to exec %s\0D\0A\00"
@.str.2 = [86 x i8] c"/usr/local/alsa/bin/arecord -D plughw:0,2 -r 8 -f S16_LE|/usr/local/alsa/bin/sipvg 0&\00"
define i32 @voip_route() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @kill_sound_task()
%4 = call i32 @memset(i8* %2, i8 signext 0, i32 256)
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = call i32 @system(i8* %2)
%7 = call i32 @print_system_status(i32 %6)
%8 = call i32 @system(i8* %2)
%9 = call i32 @print_system_status(i32 %8)
ret i32 undef
}