#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*/ pm_message(char *, char const *const);
int /*<<< orphan*/ pm_strfree(char const *const);
int /*<<< orphan*/ pm_system2(void (*)(int, void *), void *const,
                              void (*)(int, void *), void *const,
                              char const *const, int *);
char *pm_termStatusDesc(int);
void pm_system(void stdinFeeder(int, void *), void *const feederParm,
               void stdoutAccepter(int, void *), void *const accepterParm,
               const char *const shellCommand) {
  int termStatus;
  pm_system2(stdinFeeder, feederParm, stdoutAccepter, accepterParm,
             shellCommand, &termStatus);
  if (termStatus != 0) {
    const char *const msg = pm_termStatusDesc(termStatus);
    pm_message("%s", msg);
    pm_strfree(msg);
  }
}


x86 assembly (clang, -O0):
<pm_system>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
lea    -0x2c(%rbp),%r9
call   1060 <pm_system2@plt>
cmpl   $0x0,-0x2c(%rbp)
je     11a8 <pm_system+0x68>
mov    -0x2c(%rbp),%edi
call   1030 <pm_termStatusDesc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe66(%rip),%rdi
call   1040 <pm_message@plt>
mov    -0x38(%rbp),%rdi
call   1050 <pm_strfree@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pm_system>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%r9
call   1060 <pm_system2@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
je     1176 <pm_system+0x36>
call   1030 <pm_termStatusDesc@plt>
mov    %rax,%rbx
lea    0xe9a(%rip),%rdi
mov    %rax,%rsi
call   1040 <pm_message@plt>
mov    %rbx,%rdi
call   1050 <pm_strfree@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @pm_system(void (i32, i8*)* %0, i8* %1, void (i32, i8*)* %2, i8* %3, i8* %4) {
%6 = alloca void (i32, i8*)*
%7 = alloca i8*
%8 = alloca void (i32, i8*)*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
store void (i32, i8*)* %0, void (i32, i8*)** %6
store i8* %1, i8** %7
store void (i32, i8*)* %2, void (i32, i8*)** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%13 = load void (i32, i8*)*, void (i32, i8*)** %6
%14 = load i8*, i8** %7
%15 = load void (i32, i8*)*, void (i32, i8*)** %8
%16 = load i8*, i8** %9
%17 = load i8*, i8** %10
%18 = call i32 @pm_system2(void (i32, i8*)* %13, i8* %14, void (i32, i8*)* %15, i8* %16, i8* %17, i32* %11)
%19 = load i32, i32* %11
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %28
21: ; preds = %5
%22 = load i32, i32* %11
%23 = call i8* @pm_termStatusDesc(i32 %22)
store i8* %23, i8** %12
%24 = load i8*, i8** %12
%25 = call i32 @pm_message(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i8*, i8** %12
%27 = call i32 @pm_strfree(i8* %26)
br label %28
28: ; preds = %21, %5
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @pm_system(void (i32, i8*)* %0, i8* %1, void (i32, i8*)* %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = bitcast i32* %6 to i8*
%8 = call i32 @pm_system2(void (i32, i8*)* %0, i8* %1, void (i32, i8*)* %2, i8* %3, i8* %4, i32* %6)
%9 = load i32, i32* %6
%10 = icmp eq i32 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %5
%12 = call i8* @pm_termStatusDesc(i32 %9)
%13 = call i32 @pm_message(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 @pm_strfree(i8* %12)
br label %15
15: ; preds = %11, %5
ret void
}