void bpf_optimize(rootp) struct block **rootp;
{
  struct block *root;
  root = *rootp;
  opt_init(root);
  opt_loop(root, 0);
  opt_loop(root, 1);
  intern_blocks(root);
  opt_root(rootp);
  opt_cleanup();
}


x86 assembly (clang, -O0):
<bpf_optimize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1070 <opt_init@plt>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x0,%al
call   1050 <opt_loop@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <opt_loop@plt>
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1030 <intern_blocks@plt>
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <opt_root@plt>
mov    $0x0,%al
call   1060 <opt_cleanup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_optimize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rdi),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1070 <opt_init@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1050 <opt_loop@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <opt_loop@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <intern_blocks@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <opt_root@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <opt_cleanup@plt>

LLVM IR (-O0):
%struct.block = type opaque
%struct.block.0 = type opaque
define void @bpf_optimize(%struct.block** %0) {
%2 = alloca %struct.block**
%3 = alloca %struct.block.0*
store %struct.block** %0, %struct.block*** %2
%4 = load %struct.block**, %struct.block*** %2
%5 = load %struct.block*, %struct.block** %4
%6 = bitcast %struct.block* %5 to %struct.block.0*
store %struct.block.0* %6, %struct.block.0** %3
%7 = load %struct.block.0*, %struct.block.0** %3
%8 = call i32 (%struct.block.0*, ...) bitcast (i32 (...)* @opt_init to i32 (%struct.block.0*, ...)*)(%struct.block.0* %7)
%9 = load %struct.block.0*, %struct.block.0** %3
%10 = call i32 (%struct.block.0*, i32, ...) bitcast (i32 (...)* @opt_loop to i32 (%struct.block.0*, i32, ...)*)(%struct.block.0* %9, i32 0)
%11 = load %struct.block.0*, %struct.block.0** %3
%12 = call i32 (%struct.block.0*, i32, ...) bitcast (i32 (...)* @opt_loop to i32 (%struct.block.0*, i32, ...)*)(%struct.block.0* %11, i32 1)
%13 = load %struct.block.0*, %struct.block.0** %3
%14 = call i32 (%struct.block.0*, ...) bitcast (i32 (...)* @intern_blocks to i32 (%struct.block.0*, ...)*)(%struct.block.0* %13)
%15 = load %struct.block**, %struct.block*** %2
%16 = call i32 (%struct.block**, ...) bitcast (i32 (...)* @opt_root to i32 (%struct.block**, ...)*)(%struct.block** %15)
%17 = call i32 (...) @opt_cleanup()
ret void
}

LLVM IR (-O2):
%struct.block = type opaque
%struct.block.0 = type opaque
define void @bpf_optimize(%struct.block** %0) {
%2 = bitcast %struct.block** %0 to %struct.block.0**
%3 = load %struct.block.0*, %struct.block.0** %2
%4 = tail call i32 (%struct.block.0*, ...) bitcast (i32 (...)* @opt_init to i32 (%struct.block.0*, ...)*)(%struct.block.0* %3)
%5 = tail call i32 (%struct.block.0*, i32, ...) bitcast (i32 (...)* @opt_loop to i32 (%struct.block.0*, i32, ...)*)(%struct.block.0* %3, i32 0)
%6 = tail call i32 (%struct.block.0*, i32, ...) bitcast (i32 (...)* @opt_loop to i32 (%struct.block.0*, i32, ...)*)(%struct.block.0* %3, i32 1)
%7 = tail call i32 (%struct.block.0*, ...) bitcast (i32 (...)* @intern_blocks to i32 (%struct.block.0*, ...)*)(%struct.block.0* %3)
%8 = tail call i32 (%struct.block**, ...) bitcast (i32 (...)* @opt_root to i32 (%struct.block**, ...)*)(%struct.block** %0)
%9 = tail call i32 (...) @opt_cleanup()
ret void
}