ai(n) {
  printf("ai n:%ld ", n);
  printf("ai->");
  sgi();
  printf("ai->");
  mi();
  printf("ai->");
  wi();
  printf("ai->");
  if (!tmp(n << 20))
    return 0;
  printf("ai->");
  ki();
  yInstall();
  nsfInstall();
  printf("ai=>main ");
  return 1;
}


x86 assembly (clang, -O0):
<ai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <sgi@plt>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1090 <mi@plt>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <wi@plt>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x8(%rbp),%edi
shl    $0x14,%edi
mov    $0x0,%al
call   1040 <tmp@plt>
cmp    $0x0,%eax
jne    120b <ai+0x8b>
movl   $0x0,-0x4(%rbp)
jmp    1243 <ai+0xc3>
lea    0xdf8(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1080 <ki@plt>
mov    $0x0,%al
call   10a0 <yInstall@plt>
mov    $0x0,%al
call   1070 <nsfInstall@plt>
lea    0xdda(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
lea    0xe73(%rip),%rdi
xor    %r14d,%r14d
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe6a(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <sgi@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1090 <mi@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <wi@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
shl    $0x14,%ebp
mov    %ebp,%edi
xor    %eax,%eax
call   1040 <tmp@plt>
test   %eax,%eax
je     1224 <ai+0xa4>
lea    0xe16(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <ki@plt>
xor    %eax,%eax
call   10a0 <yInstall@plt>
xor    %eax,%eax
call   1070 <nsfInstall@plt>
lea    0xdf8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"ai n:%ld \00"
@.str.1 = [5 x i8] c"ai->\00"
@.str.2 = [10 x i8] c"ai=>main \00"
define i32 @ai(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (...) @sgi()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (...) @mi()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (...) @wi()
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%13 = load i32, i32* %3
%14 = shl i32 %13, 20
%15 = call i32 (i32, ...) bitcast (i32 (...)* @tmp to i32 (i32, ...)*)(i32 %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %1
store i32 0, i32* %2
br label %24
18: ; preds = %1
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 (...) @ki()
%21 = call i32 (...) @yInstall()
%22 = call i32 (...) @nsfInstall()
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %24
24: ; preds = %18, %17
%25 = load i32, i32* %2
ret i32 %25
}

LLVM IR (-O2):
@.str = [10 x i8] c"ai n:%ld \00"
@.str.1 = [5 x i8] c"ai->\00"
@.str.2 = [10 x i8] c"ai=>main \00"
define i32 @ai(i32 %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @sgi()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (...) @mi()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 (...) @wi()
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%10 = shl i32 %0, 20
%11 = tail call i32 (i32, ...) bitcast (i32 (...)* @tmp to i32 (i32, ...)*)(i32 %10)
%12 = icmp eq i32 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%15 = tail call i32 (...) @ki()
%16 = tail call i32 (...) @yInstall()
%17 = tail call i32 (...) @nsfInstall()
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %19
19: ; preds = %1, %13
%20 = phi i32 [ 1, %13 ], [ 0, %1 ]
ret i32 %20
}