#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ ns_rr;
typedef int /*<<< orphan*/ ns_msg;

/* Variables and functions */
int /*<<< orphan*/ ns_msg_base(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_msg_size(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_rr_class(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_rr_name(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_rr_rdata(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_rr_rdlen(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_rr_ttl(int /*<<< orphan*/ const);
int /*<<< orphan*/ ns_rr_type(int /*<<< orphan*/ const);
int ns_sprintrrf(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                 int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                 int /*<<< orphan*/, int /*<<< orphan*/, char const *,
                 char const *, char *, size_t);
int ns_sprintrr(const ns_msg *handle, const ns_rr *rr, const char *name_ctx,
                const char *origin, char *buf, size_t buflen) {
  int n;
  n = ns_sprintrrf(ns_msg_base(*handle), ns_msg_size(*handle), ns_rr_name(*rr),
                   ns_rr_class(*rr), ns_rr_type(*rr), ns_rr_ttl(*rr),
                   ns_rr_rdata(*rr), ns_rr_rdlen(*rr), name_ctx, origin, buf,
                   buflen);
  return (n);
}


x86 assembly (clang, -O0):
<ns_sprintrr>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %rdi,-0x20(%rbp)
mov    %rsi,-0x28(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1070 <ns_msg_base@plt>
mov    %eax,-0x64(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1030 <ns_msg_size@plt>
mov    %eax,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1080 <ns_rr_name@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1090 <ns_rr_class@plt>
mov    %eax,-0x58(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1060 <ns_rr_type@plt>
mov    %eax,-0x54(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   10b0 <ns_rr_ttl@plt>
mov    %eax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1050 <ns_rr_rdata@plt>
mov    %eax,%r15d
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1040 <ns_rr_rdlen@plt>
mov    -0x64(%rbp),%edi
mov    -0x60(%rbp),%esi
mov    -0x5c(%rbp),%edx
mov    -0x58(%rbp),%ecx
mov    -0x54(%rbp),%r8d
mov    -0x50(%rbp),%r9d
mov    %eax,%r14d
mov    -0x30(%rbp),%rbx
mov    -0x38(%rbp),%r11
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%rax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %rbx,0x10(%rsp)
mov    %r11,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %rax,0x28(%rsp)
call   10a0 <ns_sprintrrf@plt>
mov    %eax,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<ns_sprintrr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x8(%rsp)
mov    %r8,0x10(%rsp)
mov    %rcx,0x18(%rsp)
mov    %rdx,0x20(%rsp)
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    (%rdi),%edi
call   1070 <ns_msg_base@plt>
mov    %eax,0x4(%rsp)
mov    0x0(%rbp),%edi
call   1030 <ns_msg_size@plt>
mov    %eax,(%rsp)
mov    (%rbx),%edi
call   1080 <ns_rr_name@plt>
mov    %eax,%r15d
mov    (%rbx),%edi
call   1090 <ns_rr_class@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
call   1060 <ns_rr_type@plt>
mov    %eax,%r13d
mov    (%rbx),%edi
call   10b0 <ns_rr_ttl@plt>
mov    %eax,%r12d
mov    (%rbx),%edi
call   1050 <ns_rr_rdata@plt>
mov    %eax,%r14d
mov    (%rbx),%edi
call   1040 <ns_rr_rdlen@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%esi
mov    %r15d,%edx
mov    %ebp,%ecx
mov    %r13d,%r8d
mov    %r12d,%r9d
push   0x8(%rsp)
push   0x18(%rsp)
push   0x28(%rsp)
push   0x38(%rsp)
push   %rax
push   %r14
call   10a0 <ns_sprintrrf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ns_sprintrr(i32* %0, i32* %1, i8* %2, i8* %3, i8* %4, i64 %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i8* %2, i8** %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i64 %5, i64* %12
%14 = load i32*, i32** %7
%15 = load i32, i32* %14
%16 = call i32 @ns_msg_base(i32 %15)
%17 = load i32*, i32** %7
%18 = load i32, i32* %17
%19 = call i32 @ns_msg_size(i32 %18)
%20 = load i32*, i32** %8
%21 = load i32, i32* %20
%22 = call i32 @ns_rr_name(i32 %21)
%23 = load i32*, i32** %8
%24 = load i32, i32* %23
%25 = call i32 @ns_rr_class(i32 %24)
%26 = load i32*, i32** %8
%27 = load i32, i32* %26
%28 = call i32 @ns_rr_type(i32 %27)
%29 = load i32*, i32** %8
%30 = load i32, i32* %29
%31 = call i32 @ns_rr_ttl(i32 %30)
%32 = load i32*, i32** %8
%33 = load i32, i32* %32
%34 = call i32 @ns_rr_rdata(i32 %33)
%35 = load i32*, i32** %8
%36 = load i32, i32* %35
%37 = call i32 @ns_rr_rdlen(i32 %36)
%38 = load i8*, i8** %9
%39 = load i8*, i8** %10
%40 = load i8*, i8** %11
%41 = load i64, i64* %12
%42 = call i32 @ns_sprintrrf(i32 %16, i32 %19, i32 %22, i32 %25, i32 %28, i32 %31, i32 %34, i32 %37, i8* %38, i8* %39, i8* %40, i64 %41)
store i32 %42, i32* %13
%43 = load i32, i32* %13
ret i32 %43
}

LLVM IR (-O2):
define i32 @ns_sprintrr(i32* nocapture %0, i32* nocapture %1, i8* %2, i8* %3, i8* %4, i64 %5) {
%7 = load i32, i32* %0
%8 = tail call i32 @ns_msg_base(i32 %7)
%9 = load i32, i32* %0
%10 = tail call i32 @ns_msg_size(i32 %9)
%11 = load i32, i32* %1
%12 = tail call i32 @ns_rr_name(i32 %11)
%13 = load i32, i32* %1
%14 = tail call i32 @ns_rr_class(i32 %13)
%15 = load i32, i32* %1
%16 = tail call i32 @ns_rr_type(i32 %15)
%17 = load i32, i32* %1
%18 = tail call i32 @ns_rr_ttl(i32 %17)
%19 = load i32, i32* %1
%20 = tail call i32 @ns_rr_rdata(i32 %19)
%21 = load i32, i32* %1
%22 = tail call i32 @ns_rr_rdlen(i32 %21)
%23 = tail call i32 @ns_sprintrrf(i32 %8, i32 %10, i32 %12, i32 %14, i32 %16, i32 %18, i32 %20, i32 %22, i8* %2, i8* %3, i8* %4, i64 %5)
ret i32 %23
}