printhelp(job) char job[150];
{
  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, "lpr \"$TIPSYHELPDIR\"/fmt1/tipsy.ps");
  } else {
    if (strcmp(command, "all") == 0) {
      sprintf(sys_command, "lpr \"$TIPSYHELPDIR\"/fmt1/*.ps");
    } else {
      sprintf(sys_command, "lpr \"$TIPSYHELPDIR\"/fmt1/%s.ps", command);
    }
  }
  system(sys_command);
}


x86 assembly (clang, -O0):
<printhelp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x200,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0xb0(%rbp),%rdx
lea    -0x150(%rbp),%rcx
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1050 <sscanf@plt>
mov    %eax,-0x1f4(%rbp)
cmpl   $0x1,-0x1f4(%rbp)
jne    119c <printhelp+0x5c>
lea    -0x1f0(%rbp),%rdi
lea    0xe76(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    11f3 <printhelp+0xb3>
lea    -0x150(%rbp),%rdi
lea    0xe7e(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11d2 <printhelp+0x92>
lea    -0x1f0(%rbp),%rdi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    11ee <printhelp+0xae>
lea    -0x1f0(%rbp),%rdi
lea    -0x150(%rbp),%rdx
lea    0xe63(%rip),%rsi
mov    $0x0,%al
call   1060 <sprintf@plt>
jmp    11f3 <printhelp+0xb3>
lea    -0x1f0(%rbp),%rdi
mov    $0x0,%al
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x200,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printhelp>:
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    117a <printhelp+0x4a>
movups 0xeb5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movups 0xe99(%rip),%xmm0
movaps %xmm0,(%rsp)
movw   $0x73,0x20(%rsp)
jmp    11b9 <printhelp+0x89>
cmpl   $0x6c6c61,0xa0(%rsp)
jne    11a0 <printhelp+0x70>
movups 0xea8(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movups 0xe8e(%rip),%xmm0
movaps %xmm0,(%rsp)
jmp    11b9 <printhelp+0x89>
lea    0xe9f(%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 = [34 x i8] c"lpr \22$TIPSYHELPDIR\22/fmt1/tipsy.ps\00"
@.str.2 = [4 x i8] c"all\00"
@.str.3 = [30 x i8] c"lpr \22$TIPSYHELPDIR\22/fmt1/*.ps\00"
@.str.4 = [31 x i8] c"lpr \22$TIPSYHELPDIR\22/fmt1/%s.ps\00"
define i32 @printhelp(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [150 x i8]
%5 = alloca [150 x i8]
%6 = alloca [150 x i8]
%7 = alloca i32
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = getelementptr inbounds [150 x i8], [150 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%11 = call i32 (i8*, i8*, ...) @sscanf(i8* %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %9, i8* %10)
store i32 %11, i32* %7
%12 = load i32, i32* %7
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %17
14: ; preds = %1
%15 = getelementptr inbounds [150 x i8], [150 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, i8*, ...) @sprintf(i8* %15, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
br label %29
17: ; preds = %1
%18 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%19 = call i32 @strcmp(i8* %18, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = getelementptr inbounds [150 x i8], [150 x i8]* %6, i64 0, i64 0
%23 = call i32 (i8*, i8*, ...) @sprintf(i8* %22, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0))
br label %28
24: ; preds = %17
%25 = getelementptr inbounds [150 x i8], [150 x i8]* %6, i64 0, i64 0
%26 = getelementptr inbounds [150 x i8], [150 x i8]* %5, i64 0, i64 0
%27 = call i32 (i8*, i8*, ...) @sprintf(i8* %25, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %26)
br label %28
28: ; preds = %24, %21
br label %29
29: ; preds = %28, %14
%30 = getelementptr inbounds [150 x i8], [150 x i8]* %6, i64 0, i64 0
%31 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %30)
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@.str.1 = [34 x i8] c"lpr \22$TIPSYHELPDIR\22/fmt1/tipsy.ps\00"
@.str.3 = [30 x i8] c"lpr \22$TIPSYHELPDIR\22/fmt1/*.ps\00"
@.str.4 = [31 x i8] c"lpr \22$TIPSYHELPDIR\22/fmt1/%s.ps\00"
define i32 @printhelp(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 %18
11: ; preds = %1
%12 = bitcast [150 x i8]* %3 to i32*
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 7105633
br i1 %14, label %15, label %16
15: ; preds = %11
br label %18
16: ; preds = %11
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %6)
br label %18
18: ; preds = %15, %16, %10
%19 = call i32 (i8*, ...) bitcast (i32 (...)* @system to i32 (i8*, ...)*)(i8* %7)
ret i32 undef
}