#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef scalar_t__ ns_sect;
typedef int /*<<< orphan*/ ns_rr;
typedef int /*<<< orphan*/ ns_opcode;
typedef int /*<<< orphan*/ ns_msg;
struct TYPE_2__ {
  int pfcode;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
scalar_t__ ENODEV;
int RES_PRF_HEAD1;
TYPE_1__ _res;
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, ...);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/ *);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ ns_f_opcode;
int /*<<< orphan*/ ns_msg_getflag(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ ns_parserr(int /*<<< orphan*/ *, scalar_t__, int,
                      int /*<<< orphan*/ *);
int /*<<< orphan*/ ns_rr_class(int /*<<< orphan*/);
char *ns_rr_name(int /*<<< orphan*/);
int /*<<< orphan*/ ns_rr_type(int /*<<< orphan*/);
scalar_t__ ns_s_qd;
int ns_sprintrr(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                int /*<<< orphan*/ *, int /*<<< orphan*/ *, char *, int);
char *p_class(int /*<<< orphan*/);
char *p_section(scalar_t__, int /*<<< orphan*/);
char *p_type(int /*<<< orphan*/);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
char *strerror(scalar_t__);
void do_section(ns_msg *handle, ns_sect section, int pflag, FILE *file) {
  int n, sflag, rrnum;
  char buf[2048];
  ns_opcode opcode;
  ns_rr rr;
  sflag = (_res.pfcode & pflag);
  if (_res.pfcode && !sflag)
    return;
  opcode = ns_msg_getflag(*handle, ns_f_opcode);
  rrnum = 0;
  for (;;) {
    if (ns_parserr(handle, section, rrnum, &rr)) {
      if (errno != ENODEV)
        fprintf(file, ";; ns_parserr: %s\n", strerror(errno));
      else if (rrnum > 0 && sflag != 0 && (_res.pfcode & RES_PRF_HEAD1))
        putc('\n', file);
      return;
    }
    if (rrnum == 0 && sflag != 0 && (_res.pfcode & RES_PRF_HEAD1))
      fprintf(file, ";; %s SECTION:\n", p_section(section, opcode));
    if (section == ns_s_qd)
      fprintf(file, ";;\t%s, type = %s, class = %s\n", ns_rr_name(rr),
              p_type(ns_rr_type(rr)), p_class(ns_rr_class(rr)));
    else {
      n = ns_sprintrr(handle, &rr, NULL, NULL, buf, sizeof buf);
      if (n < 0) {
        fprintf(file, ";; ns_sprintrr: %s\n", strerror(errno));
        return;
      }
      fputs(buf, file);
      fputc('\n', file);
    }
    rrnum++;
  }
}


x86 assembly (clang, -O0):
<do_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ddf(%rip),%rax
mov    (%rax),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2dd0(%rip),%rax
cmpl   $0x0,(%rax)
je     1228 <do_section+0x48>
cmpl   $0x0,-0x28(%rbp)
jne    1228 <do_section+0x48>
jmp    147e <do_section+0x29e>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2dbb(%rip),%rax
mov    (%rax),%esi
call   10a0 <ns_msg_getflag@plt>
mov    %eax,-0x834(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    -0x838(%rbp),%rcx
call   1030 <ns_parserr@plt>
cmp    $0x0,%rax
je     1302 <do_section+0x122>
mov    0x2d4f(%rip),%rax
mov    (%rax),%rax
mov    0x2d3d(%rip),%rcx
cmp    (%rcx),%rax
je     12bb <do_section+0xdb>
mov    -0x20(%rbp),%rax
mov    %rax,-0x840(%rbp)
mov    0x2d2a(%rip),%rax
mov    (%rax),%rdi
call   1100 <strerror@plt>
mov    -0x840(%rbp),%rdi
mov    %rax,%rdx
lea    0xd51(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    12fd <do_section+0x11d>
cmpl   $0x0,-0x2c(%rbp)
jle    12f8 <do_section+0x118>
cmpl   $0x0,-0x28(%rbp)
je     12f8 <do_section+0x118>
mov    0x2d0a(%rip),%rax
mov    (%rax),%eax
mov    0x2ce9(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     12f8 <do_section+0x118>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1080 <putc@plt>
jmp    12fd <do_section+0x11d>
jmp    147e <do_section+0x29e>
cmpl   $0x0,-0x2c(%rbp)
jne    1363 <do_section+0x183>
cmpl   $0x0,-0x28(%rbp)
je     1363 <do_section+0x183>
mov    0x2cc3(%rip),%rax
mov    (%rax),%eax
mov    0x2ca2(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1363 <do_section+0x183>
mov    -0x20(%rbp),%rax
mov    %rax,-0x848(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x834(%rbp),%esi
call   1060 <p_section@plt>
mov    -0x848(%rbp),%rdi
mov    %rax,%rdx
lea    0xcb7(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x2c6a(%rip),%rcx
cmp    (%rcx),%rax
jne    13ea <do_section+0x20a>
mov    -0x20(%rbp),%rax
mov    %rax,-0x860(%rbp)
mov    -0x838(%rbp),%edi
call   10e0 <ns_rr_name@plt>
mov    %rax,-0x858(%rbp)
mov    -0x838(%rbp),%edi
call   10c0 <ns_rr_type@plt>
mov    %eax,%edi
call   10d0 <p_type@plt>
mov    %rax,-0x850(%rbp)
mov    -0x838(%rbp),%edi
call   10f0 <ns_rr_class@plt>
mov    %eax,%edi
call   1090 <p_class@plt>
mov    -0x860(%rbp),%rdi
mov    -0x858(%rbp),%rdx
mov    -0x850(%rbp),%rcx
mov    %rax,%r8
lea    0xc45(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    1470 <do_section+0x290>
mov    -0x8(%rbp),%rdi
lea    -0x830(%rbp),%r8
lea    -0x838(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x800,%r9d
mov    %rcx,%rdx
call   1040 <ns_sprintrr@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1452 <do_section+0x272>
mov    -0x20(%rbp),%rax
mov    %rax,-0x868(%rbp)
mov    0x2b93(%rip),%rax
mov    (%rax),%rdi
call   1100 <strerror@plt>
mov    -0x868(%rbp),%rdi
mov    %rax,%rdx
lea    0xbfb(%rip),%rsi
mov    $0x0,%al
call   10b0 <fprintf@plt>
jmp    147e <do_section+0x29e>
lea    -0x830(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <fputs@plt>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1070 <fputc@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1249 <do_section+0x69>
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_section>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x838,%rsp
mov    %rcx,0x8(%rsp)
mov    %edx,%r14d
mov    %rsi,%r15
mov    %rdi,0x10(%rsp)
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
and    %eax,%r14d
test   %eax,%eax
je     121a <do_section+0x3a>
test   %r14d,%r14d
je     1417 <do_section+0x237>
mov    0x10(%rsp),%rbx
mov    (%rbx),%edi
mov    0x2dc8(%rip),%rax
mov    (%rax),%esi
call   10a0 <ns_msg_getflag@plt>
mov    %eax,0x1c(%rsp)
lea    0x4(%rsp),%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1030 <ns_parserr@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     12b7 <do_section+0xd7>
mov    0x2d6a(%rip),%rax
mov    (%rax),%rdi
mov    0x2d58(%rip),%rax
cmp    (%rax),%rdi
jne    12a6 <do_section+0xc6>
cmpq   $0x0,0x20(%rsp)
jne    1417 <do_section+0x237>
test   %r14d,%r14d
je     1417 <do_section+0x237>
mov    0x2d47(%rip),%rax
mov    (%rax),%eax
mov    0x2d56(%rip),%rcx
test   %eax,(%rcx)
je     1417 <do_section+0x237>
mov    $0xa,%edi
mov    0x8(%rsp),%rsi
call   1080 <putc@plt>
jmp    1417 <do_section+0x237>
call   1100 <strerror@plt>
lea    0xd4e(%rip),%rsi
jmp    1408 <do_section+0x228>
mov    $0x1,%r13d
mov    0x2d14(%rip),%r12
lea    0x4(%rsp),%rbx
lea    0x30(%rsp),%rbp
mov    %r15,0x28(%rsp)
jmp    1367 <do_section+0x187>
nopl   0x0(%rax,%rax,1)
mov    0x4(%rsp),%edi
call   10e0 <ns_rr_name@plt>
mov    %r12,%r15
mov    %rax,%r12
mov    0x4(%rsp),%edi
call   10c0 <ns_rr_type@plt>
mov    %eax,%edi
call   10d0 <p_type@plt>
mov    %rbx,%rbp
mov    %r14d,%ebx
mov    %rax,%r14
mov    0x4(%rsp),%edi
call   10f0 <ns_rr_class@plt>
mov    %eax,%edi
call   1090 <p_class@plt>
mov    0x8(%rsp),%rdi
lea    0xcff(%rip),%rsi
mov    %r12,%rdx
mov    %r15,%r12
mov    0x28(%rsp),%r15
mov    %r14,%rcx
mov    %ebx,%r14d
mov    %rbp,%rbx
mov    %rax,%r8
xor    %eax,%eax
call   10b0 <fprintf@plt>
mov    0x10(%rsp),%rdi
mov    %r15,%rsi
mov    %r13d,%edx
mov    %rbx,%rcx
call   1030 <ns_parserr@plt>
add    $0x1,%r13d
test   %rax,%rax
lea    0x30(%rsp),%rbp
jne    124f <do_section+0x6f>
cmp    $0x1,%r13d
jne    13a8 <do_section+0x1c8>
test   %r14d,%r14d
je     13a8 <do_section+0x1c8>
mov    0x2c4f(%rip),%rax
mov    (%rax),%eax
mov    0x2c5e(%rip),%rcx
test   %eax,(%rcx)
je     13a8 <do_section+0x1c8>
mov    %r15,%rdi
mov    0x1c(%rsp),%esi
call   1060 <p_section@plt>
mov    0x8(%rsp),%rdi
lea    0xc75(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
cmp    %r15,(%r12)
je     12e0 <do_section+0x100>
mov    0x10(%rsp),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rbp,%r8
mov    $0x800,%r9d
call   1040 <ns_sprintrr@plt>
test   %eax,%eax
js     13f2 <do_section+0x212>
mov    %rbp,%rdi
mov    0x8(%rsp),%rbp
mov    %rbp,%rsi
call   1050 <fputs@plt>
mov    $0xa,%edi
mov    %rbp,%rsi
call   1070 <fputc@plt>
jmp    1342 <do_section+0x162>
mov    0x2bc7(%rip),%rax
mov    (%rax),%rdi
call   1100 <strerror@plt>
lea    0xc39(%rip),%rsi
mov    0x8(%rsp),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10b0 <fprintf@plt>
add    $0x838,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i32 }
@_res = global %struct.TYPE_2__ zeroinitializer
@ns_f_opcode = global i32 0
@errno = global i64 0
@ENODEV = global i64 0
@.str = [19 x i8] c";; ns_parserr: %s\0A\00"
@RES_PRF_HEAD1 = global i32 0
@.str.1 = [16 x i8] c";; %s SECTION:\0A\00"
@ns_s_qd = global i64 0
@.str.2 = [30 x i8] c";;\09%s, type = %s, class = %s\0A\00"
@.str.3 = [20 x i8] c";; ns_sprintrr: %s\0A\00"
define void @do_section(i32* %0, i64 %1, i32 %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca [2048 x i8]
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%15 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%16 = load i32, i32* %7
%17 = and i32 %15, %16
store i32 %17, i32* %10
%18 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %4
%21 = load i32, i32* %10
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %20
br label %112
24: ; preds = %20, %4
%25 = load i32*, i32** %5
%26 = load i32, i32* %25
%27 = load i32, i32* @ns_f_opcode
%28 = call i32 @ns_msg_getflag(i32 %26, i32 %27)
store i32 %28, i32* %13
store i32 0, i32* %11
br label %29
29: ; preds = %109, %24
%30 = load i32*, i32** %5
%31 = load i64, i64* %6
%32 = load i32, i32* %11
%33 = call i64 @ns_parserr(i32* %30, i64 %31, i32 %32, i32* %14)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %60
35: ; preds = %29
%36 = load i64, i64* @errno
%37 = load i64, i64* @ENODEV
%38 = icmp ne i64 %36, %37
br i1 %38, label %39, label %44
39: ; preds = %35
%40 = load i32*, i32** %8
%41 = load i64, i64* @errno
%42 = call i8* @strerror(i64 %41)
%43 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %40, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %42)
br label %59
44: ; preds = %35
%45 = load i32, i32* %11
%46 = icmp sgt i32 %45, 0
br i1 %46, label %47, label %58
47: ; preds = %44
%48 = load i32, i32* %10
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %58
50: ; preds = %47
%51 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%52 = load i32, i32* @RES_PRF_HEAD1
%53 = and i32 %51, %52
%54 = icmp ne i32 %53, 0
br i1 %54, label %55, label %58
55: ; preds = %50
%56 = load i32*, i32** %8
%57 = call i32 @putc(i8 signext 10, i32* %56)
br label %58
58: ; preds = %55, %50, %47, %44
br label %59
59: ; preds = %58, %39
br label %112
60: ; preds = %29
%61 = load i32, i32* %11
%62 = icmp eq i32 %61, 0
br i1 %62, label %63, label %77
63: ; preds = %60
%64 = load i32, i32* %10
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %77
66: ; preds = %63
%67 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i32 0, i32 0)
%68 = load i32, i32* @RES_PRF_HEAD1
%69 = and i32 %67, %68
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %66
%72 = load i32*, i32** %8
%73 = load i64, i64* %6
%74 = load i32, i32* %13
%75 = call i8* @p_section(i64 %73, i32 %74)
%76 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %75)
br label %77
77: ; preds = %71, %66, %63, %60
%78 = load i64, i64* %6
%79 = load i64, i64* @ns_s_qd
%80 = icmp eq i64 %78, %79
br i1 %80, label %81, label %92
81: ; preds = %77
%82 = load i32*, i32** %8
%83 = load i32, i32* %14
%84 = call i8* @ns_rr_name(i32 %83)
%85 = load i32, i32* %14
%86 = call i32 @ns_rr_type(i32 %85)
%87 = call i8* @p_type(i32 %86)
%88 = load i32, i32* %14
%89 = call i32 @ns_rr_class(i32 %88)
%90 = call i8* @p_class(i32 %89)
%91 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %84, i8* %87, i8* %90)
br label %109
92: ; preds = %77
%93 = load i32*, i32** %5
%94 = getelementptr inbounds [2048 x i8], [2048 x i8]* %12, i64 0, i64 0
%95 = call i32 @ns_sprintrr(i32* %93, i32* %14, i32* null, i32* null, i8* %94, i32 2048)
store i32 %95, i32* %9
%96 = load i32, i32* %9
%97 = icmp slt i32 %96, 0
br i1 %97, label %98, label %103
98: ; preds = %92
%99 = load i32*, i32** %8
%100 = load i64, i64* @errno
%101 = call i8* @strerror(i64 %100)
%102 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %99, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %101)
br label %112
103: ; preds = %92
%104 = getelementptr inbounds [2048 x i8], [2048 x i8]* %12, i64 0, i64 0
%105 = load i32*, i32** %8
%106 = call i32 @fputs(i8* %104, i32* %105)
%107 = load i32*, i32** %8
%108 = call i32 @fputc(i8 signext 10, i32* %107)
br label %109
109: ; preds = %103, %81
%110 = load i32, i32* %11
%111 = add nsw i32 %110, 1
store i32 %111, i32* %11
br label %29
112: ; preds = %98, %59, %23
ret void
}

LLVM IR (-O2):
%struct.TYPE_2__ = type { i32 }
@_res = global %struct.TYPE_2__ zeroinitializer
@ns_f_opcode = global i32 0
@errno = global i64 0
@ENODEV = global i64 0
@.str = [19 x i8] c";; ns_parserr: %s\0A\00"
@RES_PRF_HEAD1 = global i32 0
@.str.1 = [16 x i8] c";; %s SECTION:\0A\00"
@ns_s_qd = global i64 0
@.str.2 = [30 x i8] c";;\09%s, type = %s, class = %s\0A\00"
@.str.3 = [20 x i8] c";; ns_sprintrr: %s\0A\00"
define void @do_section(i32* %0, i64 %1, i32 %2, i32* nocapture %3) {
%5 = alloca [2048 x i8]
%6 = alloca i32
%7 = getelementptr inbounds [2048 x i8], [2048 x i8]* %5, i64 0, i64 0
%8 = bitcast i32* %6 to i8*
%9 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%10 = and i32 %9, %2
%11 = icmp eq i32 %9, 0
%12 = icmp ne i32 %10, 0
%13 = or i1 %11, %12
br i1 %13, label %14, label %75
14: ; preds = %4
%15 = load i32, i32* %0
%16 = load i32, i32* @ns_f_opcode
%17 = tail call i32 @ns_msg_getflag(i32 %15, i32 %16)
%18 = call i64 @ns_parserr(i32* %0, i64 %1, i32 0, i32* %6)
%19 = icmp eq i64 %18, 0
br i1 %19, label %36, label %20
20: ; preds = %71, %14
%21 = load i64, i64* @errno
%22 = load i64, i64* @ENODEV
%23 = icmp eq i64 %21, %22
br i1 %23, label %27, label %24
24: ; preds = %20
%25 = call i8* @strerror(i64 %21)
%26 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %25)
br label %75
27: ; preds = %20
%28 = select i1 %19, i1 %12, i1 false
br i1 %28, label %29, label %75
29: ; preds = %27
%30 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%31 = load i32, i32* @RES_PRF_HEAD1
%32 = and i32 %31, %30
%33 = icmp eq i32 %32, 0
br i1 %33, label %75, label %34
34: ; preds = %29
%35 = call i32 @putc(i8 signext 10, i32* %3)
br label %75
36: ; preds = %14, %71
%37 = phi i32 [ %72, %71 ], [ 0, %14 ]
%38 = icmp eq i32 %37, 0
%39 = select i1 %38, i1 %12, i1 false
br i1 %39, label %40, label %48
40: ; preds = %36
%41 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%42 = load i32, i32* @RES_PRF_HEAD1
%43 = and i32 %42, %41
%44 = icmp eq i32 %43, 0
br i1 %44, label %48, label %45
45: ; preds = %40
%46 = call i8* @p_section(i64 %1, i32 %17)
%47 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %46)
br label %48
48: ; preds = %45, %40, %36
%49 = load i64, i64* @ns_s_qd
%50 = icmp eq i64 %49, %1
br i1 %50, label %51, label %61
51: ; preds = %48
%52 = load i32, i32* %6
%53 = call i8* @ns_rr_name(i32 %52)
%54 = load i32, i32* %6
%55 = call i32 @ns_rr_type(i32 %54)
%56 = call i8* @p_type(i32 %55)
%57 = load i32, i32* %6
%58 = call i32 @ns_rr_class(i32 %57)
%59 = call i8* @p_class(i32 %58)
%60 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %53, i8* %56, i8* %59)
br label %71
61: ; preds = %48
%62 = call i32 @ns_sprintrr(i32* %0, i32* %6, i32* null, i32* null, i8* %7, i32 2048)
%63 = icmp slt i32 %62, 0
br i1 %63, label %64, label %68
64: ; preds = %61
%65 = load i64, i64* @errno
%66 = call i8* @strerror(i64 %65)
%67 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %66)
br label %75
68: ; preds = %61
%69 = call i32 @fputs(i8* %7, i32* %3)
%70 = call i32 @fputc(i8 signext 10, i32* %3)
br label %71
71: ; preds = %68, %51
%72 = add nuw nsw i32 %37, 1
%73 = call i64 @ns_parserr(i32* %0, i64 %1, i32 %72, i32* %6)
%74 = icmp eq i64 %73, 0
br i1 %74, label %36, label %20
75: ; preds = %24, %34, %29, %27, %4, %64
ret void
}