cmofi(xhlp, xdef, xp) char *xhlp, *xdef, **xp;
{
  int x;
  char *s;
  if (*xhlp == '\0')
    xhlp = "Output file";
  *xp = "";
  if ((x = cmfld(xhlp, xdef, &s)) < 0)
    return (x);
  if (chkwld(s)) {
    printf("\n?Wildcards not allowed - %s\n", s);
    return (-2);
  }
  if (zchko(s) < 0) {
    printf("\n?Write permission denied - %s\n", s);
    return (-2);
  } else {
    *xp = s;
    return (x);
  }
}


x86 assembly (clang, -O0):
<cmofi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116f <cmofi+0x2f>
lea    0xe95(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%rax
lea    0xecf(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x30(%rbp),%rdx
mov    $0x0,%al
call   1060 <cmfld@plt>
mov    %eax,-0x24(%rbp)
cmp    $0x0,%eax
jge    11a7 <cmofi+0x67>
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    121c <cmofi+0xdc>
mov    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1030 <chkwld@plt>
cmp    $0x0,%eax
je     11d9 <cmofi+0x99>
mov    -0x30(%rbp),%rsi
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    121c <cmofi+0xdc>
mov    -0x30(%rbp),%rdi
mov    $0x0,%al
call   1040 <zchko@plt>
cmp    $0x0,%eax
jge    120b <cmofi+0xcb>
mov    -0x30(%rbp),%rsi
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0xfffffffe,-0x4(%rbp)
jmp    121c <cmofi+0xdc>
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x24(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmofi>:
push   %rbp
push   %rbx
push   %rax
mov    %rdx,%rbx
cmpb   $0x0,(%rdi)
lea    0xeb0(%rip),%rax
cmove  %rax,%rdi
lea    0xeee(%rip),%rax
mov    %rax,(%rdx)
mov    %rsp,%rdx
xor    %eax,%eax
call   1060 <cmfld@plt>
mov    %eax,%ebp
test   %eax,%eax
js     11ab <cmofi+0x6b>
mov    (%rsp),%rdi
xor    %eax,%eax
call   1030 <chkwld@plt>
mov    (%rsp),%rsi
test   %eax,%eax
je     1196 <cmofi+0x56>
lea    0xe84(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xfffffffe,%ebp
jmp    11ab <cmofi+0x6b>
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <zchko@plt>
mov    (%rsp),%rsi
test   %eax,%eax
js     11b4 <cmofi+0x74>
mov    %rsi,(%rbx)
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe6f(%rip),%rdi
jmp    1188 <cmofi+0x48>

LLVM IR (-O0):
@.str = [12 x i8] c"Output file\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [30 x i8] c"\0A?Wildcards not allowed - %s\0A\00"
@.str.3 = [32 x i8] c"\0A?Write permission denied - %s\0A\00"
define i32 @cmofi(i8* %0, i8* %1, i8** %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8** %2, i8*** %7
%10 = load i8*, i8** %5
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %3
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %5
br label %15
15: ; preds = %14, %3
%16 = load i8**, i8*** %7
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %16
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = call i32 (i8*, i8*, i8**, ...) bitcast (i32 (...)* @cmfld to i32 (i8*, i8*, i8**, ...)*)(i8* %17, i8* %18, i8** %9)
store i32 %19, i32* %8
%20 = icmp slt i32 %19, 0
br i1 %20, label %21, label %23
21: ; preds = %15
%22 = load i32, i32* %8
store i32 %22, i32* %4
br label %41
23: ; preds = %15
%24 = load i8*, i8** %9
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @chkwld to i32 (i8*, ...)*)(i8* %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %23
%28 = load i8*, i8** %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %28)
store i32 -2, i32* %4
br label %41
30: ; preds = %23
%31 = load i8*, i8** %9
%32 = call i32 (i8*, ...) bitcast (i32 (...)* @zchko to i32 (i8*, ...)*)(i8* %31)
%33 = icmp slt i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i8*, i8** %9
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %35)
store i32 -2, i32* %4
br label %41
37: ; preds = %30
%38 = load i8*, i8** %9
%39 = load i8**, i8*** %7
store i8* %38, i8** %39
%40 = load i32, i32* %8
store i32 %40, i32* %4
br label %41
41: ; preds = %37, %34, %27, %21
%42 = load i32, i32* %4
ret i32 %42
}

LLVM IR (-O2):
@.str = [12 x i8] c"Output file\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [30 x i8] c"\0A?Wildcards not allowed - %s\0A\00"
@.str.3 = [32 x i8] c"\0A?Write permission denied - %s\0A\00"
define i32 @cmofi(i8* %0, i8* %1, i8** nocapture writeonly %2) {
%4 = alloca i8*
%5 = bitcast i8** %4 to i8*
%6 = load i8, i8* %0
%7 = icmp eq i8 %6, 0
%8 = select i1 %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8** %2
%9 = call i32 (i8*, i8*, i8**, ...) bitcast (i32 (...)* @cmfld to i32 (i8*, i8*, i8**, ...)*)(i8* %8, i8* %1, i8** %4)
%10 = icmp slt i32 %9, 0
br i1 %10, label %25, label %11
11: ; preds = %3
%12 = load i8*, i8** %4
%13 = call i32 (i8*, ...) bitcast (i32 (...)* @chkwld to i32 (i8*, ...)*)(i8* %12)
%14 = icmp eq i32 %13, 0
%15 = load i8*, i8** %4
br i1 %14, label %18, label %16
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %15)
br label %25
18: ; preds = %11
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @zchko to i32 (i8*, ...)*)(i8* %15)
%20 = icmp slt i32 %19, 0
%21 = load i8*, i8** %4
br i1 %20, label %22, label %24
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0), i8* %21)
br label %25
24: ; preds = %18
store i8* %21, i8** %2
br label %25
25: ; preds = %3, %24, %22, %16
%26 = phi i32 [ -2, %16 ], [ -2, %22 ], [ %9, %24 ], [ %9, %3 ]
ret i32 %26
}