#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*/ free(char *);
scalar_t__ malloc(int);
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;
  ns_opcode opcode;
  ns_rr rr;
  sflag = (int)(_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 {
      char *buf;
      buf = (char *)malloc(2024);
      if (buf) {
        n = ns_sprintrr(handle, &rr, NULL, NULL, buf, sizeof buf);
        if (n < 0) {
          fprintf(file, ";; ns_sprintrr: %s\n", strerror(errno));
          free(buf);
          return;
        }
        fputs(buf, file);
        fputc('\n', file);
        free(buf);
      }
    }
    rrnum++;
  }
}


x86 assembly (clang, -O0):
<do_section>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2dc2(%rip),%rax
mov    (%rax),%eax
and    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    0x2db3(%rip),%rax
cmpl   $0x0,(%rax)
je     1245 <do_section+0x45>
cmpl   $0x0,-0x28(%rbp)
jne    1245 <do_section+0x45>
jmp    148c <do_section+0x28c>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    0x2d9e(%rip),%rax
mov    (%rax),%esi
call   10b0 <ns_msg_getflag@plt>
mov    %eax,-0x30(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x2c(%rbp),%edx
lea    -0x34(%rbp),%rcx
call   1040 <ns_parserr@plt>
cmp    $0x0,%rax
je     1313 <do_section+0x113>
mov    0x2d38(%rip),%rax
mov    (%rax),%rax
mov    0x2d26(%rip),%rcx
cmp    (%rcx),%rax
je     12cc <do_section+0xcc>
mov    -0x20(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    0x2d16(%rip),%rax
mov    (%rax),%rdi
call   1120 <strerror@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rdx
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
jmp    130e <do_section+0x10e>
cmpl   $0x0,-0x2c(%rbp)
jle    1309 <do_section+0x109>
cmpl   $0x0,-0x28(%rbp)
je     1309 <do_section+0x109>
mov    0x2cf9(%rip),%rax
mov    (%rax),%eax
mov    0x2cd8(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     1309 <do_section+0x109>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1090 <putc@plt>
jmp    130e <do_section+0x10e>
jmp    148c <do_section+0x28c>
cmpl   $0x0,-0x2c(%rbp)
jne    136b <do_section+0x16b>
cmpl   $0x0,-0x28(%rbp)
je     136b <do_section+0x16b>
mov    0x2cb2(%rip),%rax
mov    (%rax),%eax
mov    0x2c91(%rip),%rcx
and    (%rcx),%eax
cmp    $0x0,%eax
je     136b <do_section+0x16b>
mov    -0x20(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%esi
call   1070 <p_section@plt>
mov    -0x50(%rbp),%rdi
mov    %rax,%rdx
lea    0xcaf(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x2c62(%rip),%rcx
cmp    (%rcx),%rax
jne    13d7 <do_section+0x1d7>
mov    -0x20(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x34(%rbp),%edi
call   1100 <ns_rr_name@plt>
mov    %rax,-0x60(%rbp)
mov    -0x34(%rbp),%edi
call   10d0 <ns_rr_type@plt>
mov    %eax,%edi
call   10f0 <p_type@plt>
mov    %rax,-0x58(%rbp)
mov    -0x34(%rbp),%edi
call   1110 <ns_rr_class@plt>
mov    %eax,%edi
call   10a0 <p_class@plt>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rdx
mov    -0x58(%rbp),%rcx
mov    %rax,%r8
lea    0xc58(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
jmp    147e <do_section+0x27e>
mov    $0x7e8,%edi
call   10e0 <malloc@plt>
mov    %rax,-0x40(%rbp)
cmpq   $0x0,-0x40(%rbp)
je     1479 <do_section+0x279>
mov    -0x8(%rbp),%rdi
mov    -0x40(%rbp),%r8
lea    -0x34(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
mov    $0x8,%r9d
mov    %rcx,%rdx
call   1050 <ns_sprintrr@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jge    1455 <do_section+0x255>
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    0x2b96(%rip),%rax
mov    (%rax),%rdi
call   1120 <strerror@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,%rdx
lea    0xc01(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    148c <do_section+0x28c>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <fputs@plt>
mov    -0x20(%rbp),%rsi
mov    $0xa,%edi
call   1080 <fputc@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    147e <do_section+0x27e>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1263 <do_section+0x63>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_section>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rcx,0x10(%rsp)
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%r14
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
and    %eax,%ebp
test   %eax,%eax
je     1232 <do_section+0x32>
test   %ebp,%ebp
je     12c5 <do_section+0xc5>
mov    (%r14),%edi
mov    0x2db4(%rip),%rax
mov    (%rax),%esi
call   10b0 <ns_msg_getflag@plt>
mov    %eax,0x1c(%rsp)
lea    0xc(%rsp),%rcx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %edx,%edx
call   1040 <ns_parserr@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     12d4 <do_section+0xd4>
mov    0x2d56(%rip),%rax
mov    (%rax),%rdi
mov    0x2d44(%rip),%rax
cmp    (%rax),%rdi
jne    12aa <do_section+0xaa>
cmpq   $0x0,0x20(%rsp)
jne    12c5 <do_section+0xc5>
test   %ebp,%ebp
je     12c5 <do_section+0xc5>
mov    0x2d3c(%rip),%rax
mov    (%rax),%eax
mov    0x2d4b(%rip),%rcx
test   %eax,(%rcx)
je     12c5 <do_section+0xc5>
mov    $0xa,%edi
mov    0x10(%rsp),%rsi
call   1090 <putc@plt>
jmp    12c5 <do_section+0xc5>
call   1120 <strerror@plt>
lea    0xd4a(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%r13d
jmp    1351 <do_section+0x151>
nopl   0x0(%rax)
mov    0xc(%rsp),%edi
call   1100 <ns_rr_name@plt>
mov    %ebp,%r12d
mov    %rax,%rbp
mov    0xc(%rsp),%edi
call   10d0 <ns_rr_type@plt>
mov    %eax,%edi
call   10f0 <p_type@plt>
mov    %rax,%rbx
mov    0xc(%rsp),%edi
call   1110 <ns_rr_class@plt>
mov    %eax,%edi
call   10a0 <p_class@plt>
mov    0x10(%rsp),%rdi
lea    0xd05(%rip),%rsi
mov    %rbp,%rdx
mov    %r12d,%ebp
mov    %rbx,%rcx
mov    %rax,%r8
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r13d,%edx
lea    0xc(%rsp),%rcx
call   1040 <ns_parserr@plt>
add    $0x1,%r13d
test   %rax,%rax
jne    1263 <do_section+0x63>
cmp    $0x1,%r13d
jne    1391 <do_section+0x191>
test   %ebp,%ebp
je     1391 <do_section+0x191>
mov    0x2c66(%rip),%rax
mov    (%rax),%eax
mov    0x2c75(%rip),%rcx
test   %eax,(%rcx)
je     1391 <do_section+0x191>
mov    %r15,%rdi
mov    0x1c(%rsp),%esi
call   1070 <p_section@plt>
mov    0x10(%rsp),%rdi
lea    0xc8c(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    0x2c40(%rip),%rax
cmp    %r15,(%rax)
je     12e0 <do_section+0xe0>
mov    $0x7e8,%edi
call   10e0 <malloc@plt>
test   %rax,%rax
je     1331 <do_section+0x131>
mov    %rax,%r12
mov    %r14,%rdi
lea    0xc(%rsp),%rsi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %rax,%r8
mov    $0x8,%r9d
call   1050 <ns_sprintrr@plt>
test   %eax,%eax
js     13fb <do_section+0x1fb>
mov    %r12,%rdi
mov    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <fputs@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1080 <fputc@plt>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    1331 <do_section+0x131>
mov    0x2bbe(%rip),%rax
mov    (%rax),%rdi
call   1120 <strerror@plt>
lea    0xc30(%rip),%rsi
mov    0x10(%rsp),%rdi
mov    %rax,%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    %r12,%rdi
call   1030 <free@plt>
jmp    12c5 <do_section+0xc5>

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 i32
%13 = alloca i32
%14 = alloca i8*
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 %122
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* %12
store i32 0, i32* %11
br label %29
29: ; preds = %119, %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* %13)
%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 %122
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* %12
%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* %13
%84 = call i8* @ns_rr_name(i32 %83)
%85 = load i32, i32* %13
%86 = call i32 @ns_rr_type(i32 %85)
%87 = call i8* @p_type(i32 %86)
%88 = load i32, i32* %13
%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 %119
92: ; preds = %77
%93 = call i64 @malloc(i32 2024)
%94 = inttoptr i64 %93 to i8*
store i8* %94, i8** %14
%95 = load i8*, i8** %14
%96 = icmp ne i8* %95, null
br i1 %96, label %97, label %118
97: ; preds = %92
%98 = load i32*, i32** %5
%99 = load i8*, i8** %14
%100 = call i32 @ns_sprintrr(i32* %98, i32* %13, i32* null, i32* null, i8* %99, i32 8)
store i32 %100, i32* %9
%101 = load i32, i32* %9
%102 = icmp slt i32 %101, 0
br i1 %102, label %103, label %110
103: ; preds = %97
%104 = load i32*, i32** %8
%105 = load i64, i64* @errno
%106 = call i8* @strerror(i64 %105)
%107 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %104, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %106)
%108 = load i8*, i8** %14
%109 = call i32 @free(i8* %108)
br label %122
110: ; preds = %97
%111 = load i8*, i8** %14
%112 = load i32*, i32** %8
%113 = call i32 @fputs(i8* %111, i32* %112)
%114 = load i32*, i32** %8
%115 = call i32 @fputc(i8 signext 10, i32* %114)
%116 = load i8*, i8** %14
%117 = call i32 @free(i8* %116)
br label %118
118: ; preds = %110, %92
br label %119
119: ; preds = %118, %81
%120 = load i32, i32* %11
%121 = add nsw i32 %120, 1
store i32 %121, i32* %11
br label %29
122: ; preds = %103, %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 i32
%6 = bitcast i32* %5 to i8*
%7 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%8 = and i32 %7, %2
%9 = icmp eq i32 %7, 0
%10 = icmp ne i32 %8, 0
%11 = or i1 %9, %10
br i1 %11, label %12, label %80
12: ; preds = %4
%13 = load i32, i32* %0
%14 = load i32, i32* @ns_f_opcode
%15 = tail call i32 @ns_msg_getflag(i32 %13, i32 %14)
%16 = call i64 @ns_parserr(i32* %0, i64 %1, i32 0, i32* %5)
%17 = icmp eq i64 %16, 0
br i1 %17, label %34, label %18
18: ; preds = %76, %12
%19 = load i64, i64* @errno
%20 = load i64, i64* @ENODEV
%21 = icmp eq i64 %19, %20
br i1 %21, label %25, label %22
22: ; preds = %18
%23 = call i8* @strerror(i64 %19)
%24 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %23)
br label %80
25: ; preds = %18
%26 = select i1 %17, i1 %10, i1 false
br i1 %26, label %27, label %80
27: ; preds = %25
%28 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%29 = load i32, i32* @RES_PRF_HEAD1
%30 = and i32 %29, %28
%31 = icmp eq i32 %30, 0
br i1 %31, label %80, label %32
32: ; preds = %27
%33 = call i32 @putc(i8 signext 10, i32* %3)
br label %80
34: ; preds = %12, %76
%35 = phi i32 [ %77, %76 ], [ 0, %12 ]
%36 = icmp eq i32 %35, 0
%37 = select i1 %36, i1 %10, i1 false
br i1 %37, label %38, label %46
38: ; preds = %34
%39 = load i32, i32* getelementptr inbounds (%struct.TYPE_2__, %struct.TYPE_2__* @_res, i64 0, i32 0)
%40 = load i32, i32* @RES_PRF_HEAD1
%41 = and i32 %40, %39
%42 = icmp eq i32 %41, 0
br i1 %42, label %46, label %43
43: ; preds = %38
%44 = call i8* @p_section(i64 %1, i32 %15)
%45 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* %44)
br label %46
46: ; preds = %43, %38, %34
%47 = load i64, i64* @ns_s_qd
%48 = icmp eq i64 %47, %1
br i1 %48, label %49, label %59
49: ; preds = %46
%50 = load i32, i32* %5
%51 = call i8* @ns_rr_name(i32 %50)
%52 = load i32, i32* %5
%53 = call i32 @ns_rr_type(i32 %52)
%54 = call i8* @p_type(i32 %53)
%55 = load i32, i32* %5
%56 = call i32 @ns_rr_class(i32 %55)
%57 = call i8* @p_class(i32 %56)
%58 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i8* %51, i8* %54, i8* %57)
br label %76
59: ; preds = %46
%60 = call i64 @malloc(i32 2024)
%61 = inttoptr i64 %60 to i8*
%62 = icmp eq i64 %60, 0
br i1 %62, label %76, label %63
63: ; preds = %59
%64 = call i32 @ns_sprintrr(i32* %0, i32* %5, i32* null, i32* null, i8* %61, i32 8)
%65 = icmp slt i32 %64, 0
br i1 %65, label %66, label %72
66: ; preds = %63
%67 = inttoptr i64 %60 to i8*
%68 = load i64, i64* @errno
%69 = call i8* @strerror(i64 %68)
%70 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %3, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i8* %69)
%71 = call i32 @free(i8* %67)
br label %80
72: ; preds = %63
%73 = call i32 @fputs(i8* %61, i32* %3)
%74 = call i32 @fputc(i8 signext 10, i32* %3)
%75 = call i32 @free(i8* %61)
br label %76
76: ; preds = %72, %59, %49
%77 = add nuw nsw i32 %35, 1
%78 = call i64 @ns_parserr(i32* %0, i64 %1, i32 %77, i32* %5)
%79 = icmp eq i64 %78, 0
br i1 %79, label %34, label %18
80: ; preds = %66, %22, %32, %27, %25, %4
ret void
}