#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 *qbuf;
typedef int *abuf;

/* Variables and functions */
int HFIXEDSZ;
int QFIXEDSZ;
scalar_t__ ares_expand_name(unsigned char const *, unsigned char const *, int,
                            char **, int *);
int /*<<< orphan*/ free(char *);
scalar_t__ strcasecmp(char *, char *);
int same_questions(const unsigned char *qbuf, int qlen,
                   const unsigned char *abuf, int alen) {
  struct {
    const unsigned char *p;
    int qdcount;
    char *name;
    int namelen;
    int type;
    int dnsclass;
  } q, a;
  int i, j;
  if (qlen < HFIXEDSZ || alen < HFIXEDSZ)
    return 0;
  q.qdcount = ((((qbuf) + 4)[0] << 8) | ((qbuf) + 4)[1]);
  a.qdcount = ((((abuf) + 4)[0] << 8) | ((abuf) + 4)[1]);
  if (q.qdcount != a.qdcount)
    return 0;
  q.p = qbuf + HFIXEDSZ;
  for (i = 0; i < q.qdcount; i++) {
    if (ares_expand_name(q.p, qbuf, qlen, &q.name, &q.namelen) != 0)
      return 0;
    q.p += q.namelen;
    if (q.p + QFIXEDSZ > qbuf + qlen) {
      free(q.name);
      return 0;
    }
    q.type = (((q.p)[0] << 8) | (q.p)[1]);
    q.dnsclass = ((((q.p) + 2)[0] << 8) | ((q.p) + 2)[1]);
    q.p += QFIXEDSZ;
    a.p = abuf + HFIXEDSZ;
    for (j = 0; j < a.qdcount; j++) {
      if (ares_expand_name(a.p, abuf, alen, &a.name, &a.namelen) != 0) {
        free(q.name);
        return 0;
      }
      a.p += a.namelen;
      if (a.p + QFIXEDSZ > abuf + alen) {
        free(q.name);
        free(a.name);
        return 0;
      }
      a.type = (((a.p)[0] << 8) | (a.p)[1]);
      a.dnsclass = ((((a.p) + 2)[0] << 8) | ((a.p) + 2)[1]);
      a.p += QFIXEDSZ;
      if (strcasecmp(q.name, a.name) == 0 && q.type == a.type &&
          q.dnsclass == a.dnsclass) {
        free(a.name);
        break;
      }
      free(a.name);
    }
    free(q.name);
    if (j == a.qdcount)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<same_questions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e95(%rip),%rcx
cmp    (%rcx),%eax
jl     116d <same_questions+0x3d>
mov    -0x24(%rbp),%eax
mov    0x2e83(%rip),%rcx
cmp    (%rcx),%eax
jge    1179 <same_questions+0x49>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
mov    -0x10(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
movzbl 0x4(%rax),%eax
shl    $0x8,%eax
mov    -0x20(%rbp),%rcx
movzbl 0x5(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x70(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x70(%rbp),%eax
je     11c1 <same_questions+0x91>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
mov    -0x10(%rbp),%rax
mov    0x2e1c(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
movl   $0x0,-0x7c(%rbp)
mov    -0x7c(%rbp),%eax
cmp    -0x48(%rbp),%eax
jge    1439 <same_questions+0x309>
mov    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x50(%rbp),%rcx
add    $0x10,%rcx
lea    -0x50(%rbp),%r8
add    $0x18,%r8
call   1050 <ares_expand_name@plt>
cmp    $0x0,%rax
je     121f <same_questions+0xef>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
mov    -0x38(%rbp),%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    0x2d9d(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    -0x10(%rbp),%rcx
movslq -0x14(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jbe    126a <same_questions+0x13a>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
mov    -0x50(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x50(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x34(%rbp)
mov    -0x50(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
mov    -0x50(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x30(%rbp)
mov    0x2d38(%rip),%rax
mov    (%rax),%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x20(%rbp),%rax
mov    0x2d2d(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
movl   $0x0,-0x80(%rbp)
mov    -0x80(%rbp),%eax
cmp    -0x70(%rbp),%eax
jge    1405 <same_questions+0x2d5>
mov    -0x78(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
lea    -0x78(%rbp),%rcx
add    $0x10,%rcx
lea    -0x78(%rbp),%r8
add    $0x18,%r8
call   1050 <ares_expand_name@plt>
cmp    $0x0,%rax
je     1317 <same_questions+0x1e7>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
mov    -0x60(%rbp),%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    0x2ca5(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
jbe    136b <same_questions+0x23b>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
mov    -0x78(%rbp),%rax
movzbl (%rax),%eax
shl    $0x8,%eax
mov    -0x78(%rbp),%rcx
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x78(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%eax
mov    -0x78(%rbp),%rcx
movzbl 0x3(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x58(%rbp)
mov    0x2c37(%rip),%rax
mov    (%rax),%ecx
mov    -0x78(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   1040 <strcasecmp@plt>
cmp    $0x0,%rax
jne    13ee <same_questions+0x2be>
mov    -0x34(%rbp),%eax
cmp    -0x5c(%rbp),%eax
jne    13ee <same_questions+0x2be>
mov    -0x30(%rbp),%eax
cmp    -0x58(%rbp),%eax
jne    13ee <same_questions+0x2be>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
jmp    1405 <same_questions+0x2d5>
mov    -0x68(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    12cc <same_questions+0x19c>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x80(%rbp),%eax
cmp    -0x70(%rbp),%eax
jne    1426 <same_questions+0x2f6>
movl   $0x0,-0x4(%rbp)
jmp    1440 <same_questions+0x310>
jmp    142b <same_questions+0x2fb>
mov    -0x7c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7c(%rbp)
jmp    11dd <same_questions+0xad>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<same_questions>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
mov    0x2ea0(%rip),%r13
mov    0x0(%r13),%eax
xor    %ebx,%ebx
cmp    %esi,%eax
jg     13d5 <same_questions+0x2a5>
mov    %ecx,%ebp
cmp    %ecx,%eax
jg     13d5 <same_questions+0x2a5>
mov    %rdx,%r14
mov    %rdi,%r12
movzwl 0x4(%rdi),%ecx
shl    $0x10,%ecx
bswap  %ecx
mov    %ecx,0x18(%rsp)
movzwl 0x4(%rdx),%edx
shl    $0x10,%edx
bswap  %edx
mov    %edx,0x50(%rsp)
cmp    %edx,%ecx
jne    13d5 <same_questions+0x2a5>
movslq %eax,%rdi
add    %r12,%rdi
mov    %rdi,0x10(%rsp)
test   %ecx,%ecx
je     13b3 <same_questions+0x283>
mov    %esi,%r15d
lea    0x20(%rsp),%rcx
lea    0x28(%rsp),%r8
mov    %r12,%rsi
mov    %r15d,%edx
call   1050 <ares_expand_name@plt>
test   %rax,%rax
jne    13d5 <same_questions+0x2a5>
movslq %r15d,%rdx
add    %r12,%rdx
movslq %ebp,%rax
add    %r14,%rax
mov    %rax,0x80(%rsp)
movl   $0x0,0xc(%rsp)
mov    0x2df9(%rip),%rax
mov    %ebp,0x4(%rsp)
mov    %r14,0x38(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r12,0x70(%rsp)
mov    %rdx,0x78(%rsp)
movslq 0x28(%rsp),%rcx
add    0x10(%rsp),%rcx
mov    %rcx,0x10(%rsp)
movslq (%rax),%rax
add    %rcx,%rax
cmp    %rdx,%rax
ja     13ba <same_questions+0x28a>
movzwl (%rcx),%edx
shl    $0x10,%edx
bswap  %edx
mov    %edx,0x2c(%rsp)
movzwl 0x2(%rcx),%ecx
shl    $0x10,%ecx
bswap  %ecx
mov    %ecx,0x30(%rsp)
mov    %rax,0x10(%rsp)
movslq 0x0(%r13),%rdi
add    %r14,%rdi
mov    %rdi,0x48(%rsp)
cmpl   $0x0,0x50(%rsp)
mov    $0x0,%ebx
jle    135c <same_questions+0x22c>
mov    %r14,%rsi
mov    %ebp,%edx
lea    0x58(%rsp),%rbx
mov    %rbx,%rcx
lea    0x60(%rsp),%r8
call   1050 <ares_expand_name@plt>
test   %rax,%rax
jne    13ba <same_questions+0x28a>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq 0x60(%rsp),%rcx
add    0x48(%rsp),%rcx
mov    %rcx,0x48(%rsp)
mov    0x2d42(%rip),%rax
movslq (%rax),%rax
add    %rcx,%rax
cmp    0x80(%rsp),%rax
ja     13c1 <same_questions+0x291>
movzwl (%rcx),%r14d
shl    $0x10,%r14d
bswap  %r14d
mov    %r14d,0x64(%rsp)
movzwl 0x2(%rcx),%ebx
shl    $0x10,%ebx
bswap  %ebx
mov    %ebx,0x68(%rsp)
mov    %rax,0x48(%rsp)
mov    0x20(%rsp),%rdi
mov    0x58(%rsp),%r13
mov    %r13,%rsi
call   1040 <strcasecmp@plt>
mov    %rax,%r15
mov    0x2c(%rsp),%ebp
mov    0x30(%rsp),%eax
mov    %eax,0x44(%rsp)
mov    %r13,%rdi
call   1030 <free@plt>
test   %r15,%r15
jne    1305 <same_questions+0x1d5>
cmp    %r14d,%ebp
jne    1305 <same_questions+0x1d5>
cmp    %ebx,0x44(%rsp)
je     133f <same_questions+0x20f>
lea    0x1(%r12),%ebx
cmp    0x50(%rsp),%ebx
jge    1342 <same_questions+0x212>
mov    0x48(%rsp),%rdi
mov    0x38(%rsp),%rsi
mov    0x4(%rsp),%edx
lea    0x58(%rsp),%rbx
mov    %rbx,%rcx
lea    0x60(%rsp),%r8
call   1050 <ares_expand_name@plt>
add    $0x1,%r12d
test   %rax,%rax
je     1280 <same_questions+0x150>
jmp    13ba <same_questions+0x28a>
mov    %r12d,%ebx
mov    0x4(%rsp),%ebp
mov    0x38(%rsp),%r14
mov    0x8(%rsp),%r15d
mov    0x70(%rsp),%r12
mov    0x2c8c(%rip),%r13
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
cmp    0x50(%rsp),%ebx
je     13d3 <same_questions+0x2a3>
mov    0xc(%rsp),%eax
add    $0x1,%eax
cmp    0x18(%rsp),%eax
jge    13b3 <same_questions+0x283>
mov    %eax,0xc(%rsp)
mov    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    %r15d,%edx
lea    0x20(%rsp),%rcx
lea    0x28(%rsp),%r8
call   1050 <ares_expand_name@plt>
test   %rax,%rax
mov    $0x0,%ebx
mov    0x78(%rsp),%rdx
mov    0x2c2d(%rip),%rax
je     11f7 <same_questions+0xc7>
jmp    13d5 <same_questions+0x2a5>
mov    $0x1,%ebx
jmp    13d5 <same_questions+0x2a5>
lea    0x20(%rsp),%rbx
jmp    13cb <same_questions+0x29b>
mov    0x20(%rsp),%rdi
call   1030 <free@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.anon = type { i8*, i32, i8*, i32, i32, i32 }
@HFIXEDSZ = global i32 0
@QFIXEDSZ = global i32 0
define i32 @same_questions(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca %struct.anon
%11 = alloca %struct.anon
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
%14 = load i32, i32* %7
%15 = load i32, i32* @HFIXEDSZ
%16 = icmp slt i32 %14, %15
br i1 %16, label %21, label %17
17: ; preds = %4
%18 = load i32, i32* %9
%19 = load i32, i32* @HFIXEDSZ
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %22
21: ; preds = %17, %4
store i32 0, i32* %5
br label %255
22: ; preds = %17
%23 = load i8*, i8** %6
%24 = getelementptr inbounds i8, i8* %23, i64 4
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = load i8, i8* %25
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 8
%29 = load i8*, i8** %6
%30 = getelementptr inbounds i8, i8* %29, i64 4
%31 = getelementptr inbounds i8, i8* %30, i64 1
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = or i32 %28, %33
%35 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 1
store i32 %34, i32* %35
%36 = load i8*, i8** %8
%37 = getelementptr inbounds i8, i8* %36, i64 4
%38 = getelementptr inbounds i8, i8* %37, i64 0
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = shl i32 %40, 8
%42 = load i8*, i8** %8
%43 = getelementptr inbounds i8, i8* %42, i64 4
%44 = getelementptr inbounds i8, i8* %43, i64 1
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = or i32 %41, %46
%48 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 1
store i32 %47, i32* %48
%49 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 1
%50 = load i32, i32* %49
%51 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 1
%52 = load i32, i32* %51
%53 = icmp ne i32 %50, %52
br i1 %53, label %54, label %55
54: ; preds = %22
store i32 0, i32* %5
br label %255
55: ; preds = %22
%56 = load i8*, i8** %6
%57 = load i32, i32* @HFIXEDSZ
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i8, i8* %56, i64 %58
%60 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
store i8* %59, i8** %60
store i32 0, i32* %12
br label %61
61: ; preds = %251, %55
%62 = load i32, i32* %12
%63 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 1
%64 = load i32, i32* %63
%65 = icmp slt i32 %62, %64
br i1 %65, label %66, label %254
66: ; preds = %61
%67 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%68 = load i8*, i8** %67
%69 = load i8*, i8** %6
%70 = load i32, i32* %7
%71 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
%72 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 3
%73 = call i64 @ares_expand_name(i8* %68, i8* %69, i32 %70, i8** %71, i32* %72)
%74 = icmp ne i64 %73, 0
br i1 %74, label %75, label %76
75: ; preds = %66
store i32 0, i32* %5
br label %255
76: ; preds = %66
%77 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 3
%78 = load i32, i32* %77
%79 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%80 = load i8*, i8** %79
%81 = sext i32 %78 to i64
%82 = getelementptr inbounds i8, i8* %80, i64 %81
store i8* %82, i8** %79
%83 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%84 = load i8*, i8** %83
%85 = load i32, i32* @QFIXEDSZ
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %84, i64 %86
%88 = load i8*, i8** %6
%89 = load i32, i32* %7
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds i8, i8* %88, i64 %90
%92 = icmp ugt i8* %87, %91
br i1 %92, label %93, label %97
93: ; preds = %76
%94 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
%95 = load i8*, i8** %94
%96 = call i32 @free(i8* %95)
store i32 0, i32* %5
br label %255
97: ; preds = %76
%98 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%99 = load i8*, i8** %98
%100 = getelementptr inbounds i8, i8* %99, i64 0
%101 = load i8, i8* %100
%102 = zext i8 %101 to i32
%103 = shl i32 %102, 8
%104 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%105 = load i8*, i8** %104
%106 = getelementptr inbounds i8, i8* %105, i64 1
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = or i32 %103, %108
%110 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 4
store i32 %109, i32* %110
%111 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%112 = load i8*, i8** %111
%113 = getelementptr inbounds i8, i8* %112, i64 2
%114 = getelementptr inbounds i8, i8* %113, i64 0
%115 = load i8, i8* %114
%116 = zext i8 %115 to i32
%117 = shl i32 %116, 8
%118 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%119 = load i8*, i8** %118
%120 = getelementptr inbounds i8, i8* %119, i64 2
%121 = getelementptr inbounds i8, i8* %120, i64 1
%122 = load i8, i8* %121
%123 = zext i8 %122 to i32
%124 = or i32 %117, %123
%125 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 5
store i32 %124, i32* %125
%126 = load i32, i32* @QFIXEDSZ
%127 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 0
%128 = load i8*, i8** %127
%129 = sext i32 %126 to i64
%130 = getelementptr inbounds i8, i8* %128, i64 %129
store i8* %130, i8** %127
%131 = load i8*, i8** %8
%132 = load i32, i32* @HFIXEDSZ
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds i8, i8* %131, i64 %133
%135 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
store i8* %134, i8** %135
store i32 0, i32* %13
br label %136
136: ; preds = %238, %97
%137 = load i32, i32* %13
%138 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 1
%139 = load i32, i32* %138
%140 = icmp slt i32 %137, %139
br i1 %140, label %141, label %241
141: ; preds = %136
%142 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%143 = load i8*, i8** %142
%144 = load i8*, i8** %8
%145 = load i32, i32* %9
%146 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
%147 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 3
%148 = call i64 @ares_expand_name(i8* %143, i8* %144, i32 %145, i8** %146, i32* %147)
%149 = icmp ne i64 %148, 0
br i1 %149, label %150, label %154
150: ; preds = %141
%151 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
%152 = load i8*, i8** %151
%153 = call i32 @free(i8* %152)
store i32 0, i32* %5
br label %255
154: ; preds = %141
%155 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 3
%156 = load i32, i32* %155
%157 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%158 = load i8*, i8** %157
%159 = sext i32 %156 to i64
%160 = getelementptr inbounds i8, i8* %158, i64 %159
store i8* %160, i8** %157
%161 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%162 = load i8*, i8** %161
%163 = load i32, i32* @QFIXEDSZ
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds i8, i8* %162, i64 %164
%166 = load i8*, i8** %8
%167 = load i32, i32* %9
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds i8, i8* %166, i64 %168
%170 = icmp ugt i8* %165, %169
br i1 %170, label %171, label %178
171: ; preds = %154
%172 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
%173 = load i8*, i8** %172
%174 = call i32 @free(i8* %173)
%175 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
%176 = load i8*, i8** %175
%177 = call i32 @free(i8* %176)
store i32 0, i32* %5
br label %255
178: ; preds = %154
%179 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%180 = load i8*, i8** %179
%181 = getelementptr inbounds i8, i8* %180, i64 0
%182 = load i8, i8* %181
%183 = zext i8 %182 to i32
%184 = shl i32 %183, 8
%185 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%186 = load i8*, i8** %185
%187 = getelementptr inbounds i8, i8* %186, i64 1
%188 = load i8, i8* %187
%189 = zext i8 %188 to i32
%190 = or i32 %184, %189
%191 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 4
store i32 %190, i32* %191
%192 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%193 = load i8*, i8** %192
%194 = getelementptr inbounds i8, i8* %193, i64 2
%195 = getelementptr inbounds i8, i8* %194, i64 0
%196 = load i8, i8* %195
%197 = zext i8 %196 to i32
%198 = shl i32 %197, 8
%199 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%200 = load i8*, i8** %199
%201 = getelementptr inbounds i8, i8* %200, i64 2
%202 = getelementptr inbounds i8, i8* %201, i64 1
%203 = load i8, i8* %202
%204 = zext i8 %203 to i32
%205 = or i32 %198, %204
%206 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 5
store i32 %205, i32* %206
%207 = load i32, i32* @QFIXEDSZ
%208 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 0
%209 = load i8*, i8** %208
%210 = sext i32 %207 to i64
%211 = getelementptr inbounds i8, i8* %209, i64 %210
store i8* %211, i8** %208
%212 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
%213 = load i8*, i8** %212
%214 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
%215 = load i8*, i8** %214
%216 = call i64 @strcasecmp(i8* %213, i8* %215)
%217 = icmp eq i64 %216, 0
br i1 %217, label %218, label %234
218: ; preds = %178
%219 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 4
%220 = load i32, i32* %219
%221 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 4
%222 = load i32, i32* %221
%223 = icmp eq i32 %220, %222
br i1 %223, label %224, label %234
224: ; preds = %218
%225 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 5
%226 = load i32, i32* %225
%227 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 5
%228 = load i32, i32* %227
%229 = icmp eq i32 %226, %228
br i1 %229, label %230, label %234
230: ; preds = %224
%231 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
%232 = load i8*, i8** %231
%233 = call i32 @free(i8* %232)
br label %241
234: ; preds = %224, %218, %178
%235 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 2
%236 = load i8*, i8** %235
%237 = call i32 @free(i8* %236)
br label %238
238: ; preds = %234
%239 = load i32, i32* %13
%240 = add nsw i32 %239, 1
store i32 %240, i32* %13
br label %136
241: ; preds = %230, %136
%242 = getelementptr inbounds %struct.anon, %struct.anon* %10, i32 0, i32 2
%243 = load i8*, i8** %242
%244 = call i32 @free(i8* %243)
%245 = load i32, i32* %13
%246 = getelementptr inbounds %struct.anon, %struct.anon* %11, i32 0, i32 1
%247 = load i32, i32* %246
%248 = icmp eq i32 %245, %247
br i1 %248, label %249, label %250
249: ; preds = %241
store i32 0, i32* %5
br label %255
250: ; preds = %241
br label %251
251: ; preds = %250
%252 = load i32, i32* %12
%253 = add nsw i32 %252, 1
store i32 %253, i32* %12
br label %61
254: ; preds = %61
store i32 1, i32* %5
br label %255
255: ; preds = %254, %249, %171, %150, %93, %75, %54, %21
%256 = load i32, i32* %5
ret i32 %256
}

LLVM IR (-O2):
%struct.anon = type { i8*, i32, i8*, i32, i32, i32 }
@HFIXEDSZ = global i32 0
@QFIXEDSZ = global i32 0
define i32 @same_questions(i8* %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca %struct.anon
%6 = alloca %struct.anon
%7 = bitcast %struct.anon* %5 to i8*
%8 = bitcast %struct.anon* %6 to i8*
%9 = load i32, i32* @HFIXEDSZ
%10 = icmp sgt i32 %9, %1
%11 = icmp sgt i32 %9, %3
%12 = or i1 %10, %11
br i1 %12, label %154, label %13
13: ; preds = %4
%14 = getelementptr inbounds i8, i8* %0, i64 4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 8
%18 = getelementptr inbounds i8, i8* %0, i64 5
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
%22 = getelementptr inbounds %struct.anon, %struct.anon* %5, i64 0, i32 1
store i32 %21, i32* %22
%23 = getelementptr inbounds i8, i8* %2, i64 4
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = shl nuw nsw i32 %25, 8
%27 = getelementptr inbounds i8, i8* %2, i64 5
%28 = load i8, i8* %27
%29 = zext i8 %28 to i32
%30 = or i32 %26, %29
%31 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 1
store i32 %30, i32* %31
%32 = icmp eq i32 %21, %30
br i1 %32, label %33, label %154
33: ; preds = %13
%34 = sext i32 %9 to i64
%35 = getelementptr inbounds i8, i8* %0, i64 %34
%36 = getelementptr inbounds %struct.anon, %struct.anon* %5, i64 0, i32 0
store i8* %35, i8** %36
%37 = icmp eq i32 %21, 0
br i1 %37, label %154, label %38
38: ; preds = %33
%39 = getelementptr inbounds %struct.anon, %struct.anon* %5, i64 0, i32 2
%40 = getelementptr inbounds %struct.anon, %struct.anon* %5, i64 0, i32 3
%41 = sext i32 %1 to i64
%42 = getelementptr inbounds i8, i8* %0, i64 %41
%43 = getelementptr inbounds %struct.anon, %struct.anon* %5, i64 0, i32 4
%44 = getelementptr inbounds %struct.anon, %struct.anon* %5, i64 0, i32 5
%45 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 0
%46 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 2
%47 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 3
%48 = sext i32 %3 to i64
%49 = getelementptr inbounds i8, i8* %2, i64 %48
%50 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 4
%51 = getelementptr inbounds %struct.anon, %struct.anon* %6, i64 0, i32 5
%52 = call i64 @ares_expand_name(i8* %35, i8* %0, i32 %1, i8** %39, i32* %40)
%53 = icmp eq i64 %52, 0
br i1 %53, label %61, label %154
54: ; preds = %143
%55 = load i32, i32* %22
%56 = icmp slt i32 %149, %55
br i1 %56, label %57, label %154
57: ; preds = %54
%58 = load i8*, i8** %36
%59 = call i64 @ares_expand_name(i8* %58, i8* %0, i32 %1, i8** %39, i32* %40)
%60 = icmp eq i64 %59, 0
br i1 %60, label %61, label %154
61: ; preds = %38, %57
%62 = phi i32 [ %149, %57 ], [ 0, %38 ]
%63 = load i32, i32* %40
%64 = load i8*, i8** %36
%65 = sext i32 %63 to i64
%66 = getelementptr inbounds i8, i8* %64, i64 %65
store i8* %66, i8** %36
%67 = load i32, i32* @QFIXEDSZ
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i8, i8* %66, i64 %68
%70 = icmp ugt i8* %69, %42
br i1 %70, label %150, label %71
71: ; preds = %61
%72 = load i8, i8* %66
%73 = zext i8 %72 to i32
%74 = shl nuw nsw i32 %73, 8
%75 = getelementptr inbounds i8, i8* %66, i64 1
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = or i32 %74, %77
store i32 %78, i32* %43
%79 = getelementptr inbounds i8, i8* %66, i64 2
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = shl nuw nsw i32 %81, 8
%83 = getelementptr inbounds i8, i8* %66, i64 3
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = or i32 %82, %85
store i32 %86, i32* %44
store i8* %69, i8** %36
%87 = load i32, i32* @HFIXEDSZ
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds i8, i8* %2, i64 %88
store i8* %89, i8** %45
%90 = load i32, i32* %31
%91 = icmp sgt i32 %90, 0
br i1 %91, label %92, label %143
92: ; preds = %71
%93 = call i64 @ares_expand_name(i8* %89, i8* %2, i32 %3, i8** %46, i32* %47)
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %150
95: ; preds = %92, %139
%96 = phi i32 [ %136, %139 ], [ 0, %92 ]
%97 = load i32, i32* %47
%98 = load i8*, i8** %45
%99 = sext i32 %97 to i64
%100 = getelementptr inbounds i8, i8* %98, i64 %99
store i8* %100, i8** %45
%101 = load i32, i32* @QFIXEDSZ
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds i8, i8* %100, i64 %102
%104 = icmp ugt i8* %103, %49
br i1 %104, label %105, label %108
105: ; preds = %95
%106 = load i8*, i8** %39
%107 = call i32 @free(i8* %106)
br label %150
108: ; preds = %95
%109 = load i8, i8* %100
%110 = zext i8 %109 to i32
%111 = shl nuw nsw i32 %110, 8
%112 = getelementptr inbounds i8, i8* %100, i64 1
%113 = load i8, i8* %112
%114 = zext i8 %113 to i32
%115 = or i32 %111, %114
store i32 %115, i32* %50
%116 = getelementptr inbounds i8, i8* %100, i64 2
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = shl nuw nsw i32 %118, 8
%120 = getelementptr inbounds i8, i8* %100, i64 3
%121 = load i8, i8* %120
%122 = zext i8 %121 to i32
%123 = or i32 %119, %122
store i32 %123, i32* %51
store i8* %103, i8** %45
%124 = load i8*, i8** %39
%125 = load i8*, i8** %46
%126 = call i64 @strcasecmp(i8* %124, i8* %125)
%127 = icmp eq i64 %126, 0
%128 = load i32, i32* %43
%129 = icmp eq i32 %128, %115
%130 = select i1 %127, i1 %129, i1 false
%131 = load i32, i32* %44
%132 = icmp eq i32 %131, %123
%133 = select i1 %130, i1 %132, i1 false
%134 = call i32 @free(i8* %125)
br i1 %133, label %143, label %135
135: ; preds = %108
%136 = add nuw nsw i32 %96, 1
%137 = load i32, i32* %31
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %143
139: ; preds = %135
%140 = load i8*, i8** %45
%141 = call i64 @ares_expand_name(i8* %140, i8* %2, i32 %3, i8** %46, i32* %47)
%142 = icmp eq i64 %141, 0
br i1 %142, label %95, label %150
143: ; preds = %135, %108, %71
%144 = phi i32 [ 0, %71 ], [ %136, %135 ], [ %96, %108 ]
%145 = load i8*, i8** %39
%146 = call i32 @free(i8* %145)
%147 = load i32, i32* %31
%148 = icmp eq i32 %144, %147
%149 = add nuw nsw i32 %62, 1
br i1 %148, label %154, label %54
150: ; preds = %61, %92, %139, %105
%151 = phi i8** [ %46, %105 ], [ %39, %139 ], [ %39, %92 ], [ %39, %61 ]
%152 = load i8*, i8** %151
%153 = call i32 @free(i8* %152)
br label %154
154: ; preds = %54, %143, %57, %38, %150, %33, %13, %4
%155 = phi i32 [ 0, %4 ], [ 0, %13 ], [ 1, %33 ], [ 0, %150 ], [ 0, %38 ], [ 0, %57 ], [ 0, %143 ], [ 1, %54 ]
ret i32 %155
}