void help(job) char *job;
{
  char arg[150];
  char command[150];
  char sys_command[150];
  int number;
  number = (sscanf(job, "%s %s", arg, command));
  if (number == 1) {
    sprintf(sys_command, "man -M \"$TIPSYHELPDIR\" tipsy");
  } else {
    sprintf(sys_command, "man -M \"$TIPSYHELPDIR\" %s", command);
  }
  system(sys_command);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xa0(%rbp),%rdx
lea    -0x140(%rbp),%rcx
lea    0xea8(%rip),%rsi
mov    $0x0,%al
call   1040 <sscanf@plt>
mov    %eax,-0x1e4(%rbp)
cmpl   $0x1,-0x1e4(%rbp)
jne    118c <help+0x5c>
lea    -0x1e0(%rbp),%rdi
lea    0xe86(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    11a8 <help+0x78>
lea    -0x1e0(%rbp),%rdi
lea    -0x140(%rbp),%rdx
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
lea    -0x1e0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
add    $0x1f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<help>:
sub    $0x1d8,%rsp
lea    0xec2(%rip),%rsi
lea    0x140(%rsp),%rdx
lea    0xa0(%rsp),%rcx
xor    %eax,%eax
call   1040 <sscanf@plt>
cmp    $0x1,%eax
jne    1173 <help+0x43>
movups 0xeb2(%rip),%xmm0
movups %xmm0,0xd(%rsp)
movups 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
jmp    118c <help+0x5c>
lea    0xea9(%rip),%rsi
mov    %rsp,%rdi
lea    0xa0(%rsp),%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
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 = [29 x i8] c"man -M \22$TIPSYHELPDIR\22 tipsy\00"
@.str.2 = [26 x i8] c"man -M \22$TIPSYHELPDIR\22 %s\00"
define void @help(i8* %0) {
%2 = alloca i8*
%3 = alloca [150 x i8]
%4 = alloca [150 x i8]
%5 = alloca [150 x i8]
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [150 x i8], [150 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [150 x i8], [150 x i8]* %4, 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)
store i32 %10, i32* %6
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %16
13: ; preds = %1
%14 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%15 = call i32 (i8*, i8*, ...) @sprintf(i8* %14, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %20
16: ; preds = %1
%17 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%18 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%19 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %16, %13
%21 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%22 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %21)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [29 x i8] c"man -M \22$TIPSYHELPDIR\22 tipsy\00"
@.str.2 = [26 x i8] c"man -M \22$TIPSYHELPDIR\22 %s\00"
define void @help(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* %5, i8* %6)
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %1
br label %13
11: ; preds = %1
%12 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %13
13: ; preds = %11, %10
%14 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %7)
ret void
}