#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*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int system(char *);
int open_record() {
  char command[256];
  int result;
  sprintf(command, "%s",
          "/usr/local/alsa/bin/amixer -c 0 sset \'Analog Right Sub Mic\' cap");
  printf("open_record %s\r\n", command);
  result = system(command);
  printf("open_record result %d\r\n", result);
  return result;
}


x86 assembly (clang, -O0):
<open_record>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
lea    0xeb7(%rip),%rsi
lea    0xeb3(%rip),%rdx
call   1050 <sprintf@plt>
lea    -0x100(%rbp),%rsi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
call   1030 <system@plt>
mov    %eax,-0x104(%rbp)
mov    -0x104(%rbp),%esi
lea    0xecb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x104(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<open_record>:
push   %rbx
sub    $0x100,%rsp
movups 0xf01(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movups 0xee5(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movups 0xec9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xead(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xee2(%rip),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <system@plt>
mov    %eax,%ebx
lea    0xed5(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
add    $0x100,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [64 x i8] c"/usr/local/alsa/bin/amixer -c 0 sset 'Analog Right Sub Mic' cap\00"
@.str.2 = [17 x i8] c"open_record %s\0D\0A\00"
@.str.3 = [24 x i8] c"open_record result %d\0D\0A\00"
define i32 @open_record() {
%1 = alloca [256 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.1, i64 0, i64 0))
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%8 = call i32 @system(i8* %7)
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str.1 = [64 x i8] c"/usr/local/alsa/bin/amixer -c 0 sset 'Analog Right Sub Mic' cap\00"
@.str.2 = [17 x i8] c"open_record %s\0D\0A\00"
@.str.3 = [24 x i8] c"open_record result %d\0D\0A\00"
define i32 @open_record() {
%1 = alloca [256 x i8]
%2 = getelementptr inbounds [256 x i8], [256 x i8]* %1, i64 0, i64 0
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %2)
%4 = call i32 @system(i8* %2)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %4)
ret i32 %4
}