void nr4sframe(dest, hdr, bp) struct ax25_addr *dest;
struct nr4hdr *hdr;
struct mbuf *bp;
{
  void nr3output();
  struct mbuf *n4b;
  if ((n4b = htonnr4(hdr)) == (struct mbuf *)0) {
    free_p(bp);
    return;
  } else {
    append(&n4b, bp);
    nr3output(dest, n4b);
  }
}


x86 assembly (clang, -O0):
<nr4sframe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1050 <htonnr4@plt>
cltq
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    117f <nr4sframe+0x3f>
mov    -0x18(%rbp),%rdi
mov    $0x0,%al
call   1040 <free_p@plt>
jmp    119d <nr4sframe+0x5d>
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1030 <append@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1060 <nr3output@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nr4sframe>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
xor    %eax,%eax
call   1050 <htonnr4@plt>
cltq
mov    %rax,(%rsp)
test   %eax,%eax
je     1181 <nr4sframe+0x41>
mov    %rsp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <append@plt>
mov    (%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <nr3output@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <free_p@plt>

LLVM IR (-O0):
%struct.ax25_addr = type opaque
%struct.nr4hdr = type opaque
%struct.mbuf = type opaque
%struct.mbuf.0 = type opaque
define void @nr4sframe(%struct.ax25_addr* %0, %struct.nr4hdr* %1, %struct.mbuf* %2) {
%4 = alloca %struct.ax25_addr*
%5 = alloca %struct.nr4hdr*
%6 = alloca %struct.mbuf*
%7 = alloca %struct.mbuf.0*
store %struct.ax25_addr* %0, %struct.ax25_addr** %4
store %struct.nr4hdr* %1, %struct.nr4hdr** %5
store %struct.mbuf* %2, %struct.mbuf** %6
%8 = load %struct.nr4hdr*, %struct.nr4hdr** %5
%9 = call i32 (%struct.nr4hdr*, ...) bitcast (i32 (...)* @htonnr4 to i32 (%struct.nr4hdr*, ...)*)(%struct.nr4hdr* %8)
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to %struct.mbuf.0*
store %struct.mbuf.0* %11, %struct.mbuf.0** %7
%12 = icmp eq %struct.mbuf.0* %11, null
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load %struct.mbuf*, %struct.mbuf** %6
%15 = call i32 (%struct.mbuf*, ...) bitcast (i32 (...)* @free_p to i32 (%struct.mbuf*, ...)*)(%struct.mbuf* %14)
br label %21
16: ; preds = %3
%17 = load %struct.mbuf*, %struct.mbuf** %6
%18 = call i32 (%struct.mbuf.0**, %struct.mbuf*, ...) bitcast (i32 (...)* @append to i32 (%struct.mbuf.0**, %struct.mbuf*, ...)*)(%struct.mbuf.0** %7, %struct.mbuf* %17)
%19 = load %struct.ax25_addr*, %struct.ax25_addr** %4
%20 = load %struct.mbuf.0*, %struct.mbuf.0** %7
br label %21
21: ; preds = %13, %16
ret void
}

LLVM IR (-O2):
%struct.ax25_addr = type opaque
%struct.nr4hdr = type opaque
%struct.mbuf = type opaque
%struct.mbuf.0 = type opaque
define void @nr4sframe(%struct.ax25_addr* %0, %struct.nr4hdr* %1, %struct.mbuf* %2) {
%4 = alloca %struct.mbuf.0*
%5 = bitcast %struct.mbuf.0** %4 to i8*
%6 = tail call i32 (%struct.nr4hdr*, ...) bitcast (i32 (...)* @htonnr4 to i32 (%struct.nr4hdr*, ...)*)(%struct.nr4hdr* %1)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to %struct.mbuf.0*
store %struct.mbuf.0* %8, %struct.mbuf.0** %4
%9 = icmp eq i32 %6, 0
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = tail call i32 (%struct.mbuf*, ...) bitcast (i32 (...)* @free_p to i32 (%struct.mbuf*, ...)*)(%struct.mbuf* %2)
br label %15
12: ; preds = %3
%13 = call i32 (%struct.mbuf.0**, %struct.mbuf*, ...) bitcast (i32 (...)* @append to i32 (%struct.mbuf.0**, %struct.mbuf*, ...)*)(%struct.mbuf.0** %4, %struct.mbuf* %2)
%14 = load %struct.mbuf.0*, %struct.mbuf.0** %4
br label %15
15: ; preds = %12, %10
ret void
}