void execute(cmd) char *cmd;
{
  int ret_cde = system(cmd);
  if (ret_cde != 0) {
    char execute_buf[1000];
    strcpy(execute_buf, "\n  Didn't get 0 return from system call:\n    ");
    strcat(execute_buf, cmd);
    strcat(execute_buf, "\n  Code returned: ");
    CreNumInBuf(execute_buf, ret_cde);
    strcat(execute_buf, "\n");
    DisplayCurrWinText(execute_buf);
    Popup_Err(0, "Bad system call return code   ");
  }
}


x86 assembly (clang, -O0):
<execute>:
push   %rbp
mov    %rsp,%rbp
sub    $0x400,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1050 <system@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     11ff <execute+0x9f>
lea    -0x400(%rbp),%rdi
lea    0xe6b(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x400(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1080 <strcat@plt>
lea    -0x400(%rbp),%rdi
lea    0xe76(%rip),%rsi
call   1080 <strcat@plt>
lea    -0x400(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1060 <CreNumInBuf@plt>
lea    -0x400(%rbp),%rdi
lea    0xe65(%rip),%rsi
call   1080 <strcat@plt>
lea    -0x400(%rbp),%rdi
mov    $0x0,%al
call   1070 <DisplayCurrWinText@plt>
xor    %edi,%edi
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1040 <Popup_Err@plt>
add    $0x400,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execute>:
push   %rbp
push   %r14
push   %rbx
sub    $0x3f0,%rsp
mov    %rdi,%rbx
xor    %eax,%eax
call   1050 <system@plt>
test   %eax,%eax
je     11ff <execute+0x9f>
mov    %eax,%ebp
movups 0xe98(%rip),%xmm0
movups %xmm0,0x1e(%rsp)
movups 0xe7e(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe62(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rsi
call   1080 <strcat@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
movups 0xe6f(%rip),%xmm0
movups %xmm0,(%rsp,%rax,1)
movl   $0x203a64,0xf(%rsp,%rax,1)
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <CreNumInBuf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
movw   $0xa,(%rsp,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1070 <DisplayCurrWinText@plt>
lea    0xe4b(%rip),%rsi
xor    %edi,%edi
xor    %eax,%eax
call   1030 <Popup_Err@plt>
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [46 x i8] c"\0A Didn't get 0 return from system call:\0A \00"
@.str.1 = [19 x i8] c"\0A Code returned: \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [31 x i8] c"Bad system call return code \00"
define void @execute(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [1000 x i8]
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %25
9: ; preds = %1
%10 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%11 = call i8* @strcpy(i8* %10, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%13 = load i8*, i8** %2
%14 = call i8* @strcat(i8* %12, i8* %13)
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%16 = call i8* @strcat(i8* %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%17 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%18 = load i32, i32* %3
%19 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @CreNumInBuf to i32 (i8*, i32, ...)*)(i8* %17, i32 %18)
%20 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%21 = call i8* @strcat(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* %22)
%24 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @Popup_Err to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %9, %1
ret void
}

LLVM IR (-O2):
@.str = [46 x i8] c"\0A Didn't get 0 return from system call:\0A \00"
@.str.1 = [19 x i8] c"\0A Code returned: \00"
@.str.3 = [31 x i8] c"Bad system call return code \00"
define void @execute(i8* %0) {
%2 = alloca [1000 x i8]
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %16, label %5
5: ; preds = %1
%6 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%7 = call i8* @strcat(i8* %6, i8* dereferenceable(1) %0)
%8 = call i64 @strlen(i8* %6)
%9 = getelementptr [1000 x i8], [1000 x i8]* %2, i64 0, i64 %8
%10 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @CreNumInBuf to i32 (i8*, i32, ...)*)(i8* %6, i32 %3)
%11 = call i64 @strlen(i8* %6)
%12 = getelementptr [1000 x i8], [1000 x i8]* %2, i64 0, i64 %11
%13 = bitcast i8* %12 to i16*
store i16 10, i16* %13
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @DisplayCurrWinText to i32 (i8*, ...)*)(i8* %6)
%15 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @Popup_Err to i32 (i32, i8*, ...)*)(i32 0, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %5, %1
ret void
}