#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*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int system(char *);
int main() {
  int ret;
  while (1) {
    (void)printf("*** Prima della system() ***\n");
    (void)fflush(stdout);
    ret = system("/usr/bin/aplay /usr/share/sounds/alsa/Front_Center.wav");
    (void)printf("*** Dopo la system() *** ret = %d ***\n", ret);
    (void)fflush(stdout);
  }
  exit(EXIT_SUCCESS);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xebc(%rip),%rdi
call   1030 <system@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xf0f(%rip),%r14
mov    0x2e8a(%rip),%rbx
lea    0xea3(%rip),%r15
lea    0xed3(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <puts@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
mov    %r15,%rdi
call   1040 <system@plt>
mov    %r12,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%edi
call   1060 <fflush@plt>
jmp    1170 <main+0x30>

LLVM IR (-O0):
@.str = [30 x i8] c"*** Prima della system() ***\0A\00"
@stdout = global i32 0
@.str.1 = [55 x i8] c"/usr/bin/aplay /usr/share/sounds/alsa/Front_Center.wav\00"
@.str.2 = [39 x i8] c"*** Dopo la system() *** ret = %d ***\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* @stdout
%6 = call i32 @fflush(i32 %5)
%7 = call i32 @system(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
store i32 %7, i32* %2
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
br label %3
}

LLVM IR (-O2):
@stdout = global i32 0
@.str.1 = [55 x i8] c"/usr/bin/aplay /usr/share/sounds/alsa/Front_Center.wav\00"
@.str.2 = [39 x i8] c"*** Dopo la system() *** ret = %d ***\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [29 x i8] c"*** Prima della system() ***\00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%3 = load i32, i32* @stdout
%4 = tail call i32 @fflush(i32 %3)
%5 = tail call i32 @system(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
br label %1
}