commands(job) char job[150];
{
  char sys_command[150];
  char option[150];
  char command[150];
  if (sscanf(job, "%s %s", command, option) == 2 &&
      strcmp(option, "print") == 0) {
    sprintf(sys_command, "lpr \"$TIPSYHELPDIR\"/whatis");
    system(sys_command);
  } else {
    sprintf(sys_command, "more \"$TIPSYHELPDIR\"/whatis");
    system(sys_command);
  }
}


x86 assembly (clang, -O0):
<commands>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1f0(%rbp),%rdx
lea    -0x150(%rbp),%rcx
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
cmp    $0x2,%eax
jne    11bc <commands+0x7c>
lea    -0x150(%rbp),%rdi
lea    0xe80(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11bc <commands+0x7c>
lea    -0xb0(%rbp),%rdi
lea    0xe6a(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
jmp    11df <commands+0x9f>
lea    -0xb0(%rbp),%rdi
lea    0xe5d(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commands>:
sub    $0x1d8,%rsp
lea    0xed2(%rip),%rsi
lea    0x140(%rsp),%rdx
lea    0xa0(%rsp),%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x2,%eax
jne    1165 <commands+0x45>
mov    $0x6e697270,%eax
xor    0xa0(%rsp),%eax
movzwl 0xa4(%rsp),%ecx
xor    $0x74,%ecx
or     %eax,%ecx
je     117a <commands+0x5a>
movups 0xec7(%rip),%xmm0
movups %xmm0,0xc(%rsp)
movups 0xeaf(%rip),%xmm0
jmp    118d <commands+0x6d>
movups 0xe96(%rip),%xmm0
movups %xmm0,0xb(%rsp)
movups 0xe7f(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
xor    %eax,%eax
call   1030 <system@plt>
add    $0x1d8,%rsp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [6 x i8] c"print\00"
@.str.2 = [27 x i8] c"lpr \22$TIPSYHELPDIR\22/whatis\00"
@.str.3 = [28 x i8] c"more \22$TIPSYHELPDIR\22/whatis\00"
define i32 @commands(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [150 x i8]
%5 = alloca [150 x i8]
%6 = alloca [150 x i8]
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = getelementptr inbounds [150 x i8], [150 x i8]* %6, i64 0, i64 0
%9 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%10 = call i32 (i8*, i8*, ...) @sscanf(i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %21
12: ; preds = %1
%13 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%14 = call i32 @strcmp(i8* %13, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%19 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %19)
br label %26
21: ; preds = %12, %1
%22 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%24 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%25 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %24)
br label %26
26: ; preds = %21, %16
%27 = load i32, i32* %2
ret i32 %27
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [6 x i8] c"print\00"
@.str.2 = [27 x i8] c"lpr \22$TIPSYHELPDIR\22/whatis\00"
@.str.3 = [28 x i8] c"more \22$TIPSYHELPDIR\22/whatis\00"
define i32 @commands(i8* nocapture %0) {
%2 = alloca [150 x i8]
%3 = alloca [150 x i8]
%4 = alloca [150 x i8]
%5 = getelementptr inbounds [150 x i8], [150 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [150 x i8], [150 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%8 = call i32 (i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %6)
%9 = icmp eq i32 %8, 2
br i1 %9, label %10, label %14
10: ; preds = %1
%11 = call i32 @bcmp(i8* dereferenceable(6) %6, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i64 6)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %10
br label %15
14: ; preds = %10, %1
br label %15
15: ; preds = %14, %13
%16 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %5)
ret i32 undef
}