#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*/ ERR_BEGIN;
typedef int /*<<< orphan*/ END;
typedef int /*<<< orphan*/ BEGIN;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, ...);
int /*<<< orphan*/ stderr;
scalar_t__ strncmp(char const *, char const *, int);
int /*<<< orphan*/ strncpy(char *, char const *, size_t const);
char *strstr(char const *, char *);
int altera_parse_q13_response(const char *buffer, size_t len,
                              const char **begin, const char **end) {
  *begin = buffer;
  *end = strstr(buffer, "\n");
  if (*end == NULL) {
    return (22);
  }
  while (**begin == '#') {
    const size_t comment_len = *end - buffer;
    char copy[comment_len];
    strncpy(copy, buffer, comment_len - 1);
    copy[comment_len - 1] = '\0';
    *begin = *end + 1;
    *end = strstr(*begin, "\n");
    if (*end == NULL)
      return (22);
    fprintf(stderr, "%s\n", copy);
  }
  static const char BEGIN[] = "return \"";
  static const char ERR_BEGIN[] = "error \"";
  static const char END[] = "\"";
  if (strncmp(*begin, ERR_BEGIN, sizeof(ERR_BEGIN) - 1) == 0) {
    *begin += (sizeof(ERR_BEGIN) - 1);
    const char *err_end = *end - (sizeof(END) - 1);
    if (strncmp(err_end, END, sizeof(END) - 1) == 0)
      *end = err_end;
    return (23);
  }
  if (strncmp(*begin, BEGIN, sizeof(BEGIN) - 1) != 0) {
    fprintf(stderr, "response did not begin with '%s':\n'%s'\n", BEGIN, *begin);
    return (7);
  }
  *begin += (sizeof(BEGIN) - 1);
  *end -= (sizeof(END) - 1);
  assert(*end >= *begin);
  if (strncmp(*end, END, sizeof(END) - 1) != 0) {
    fprintf(stderr, "response did not end with '%s': '%s'\n", END, *end);
    return (7);
  }
  return (0);
}


x86 assembly (clang, -O0):
<altera_parse_q13_response>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rdi
lea    0xeac(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
jne    11a7 <altera_parse_q13_response+0x57>
movl   $0x16,-0x4(%rbp)
jmp    1405 <altera_parse_q13_response+0x2b5>
jmp    11ac <altera_parse_q13_response+0x5c>
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    12ac <altera_parse_q13_response+0x15c>
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x58(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rdx
sub    $0x1,%rdx
call   1030 <strncpy@plt>
mov    -0x58(%rbp),%rax
mov    -0x30(%rbp),%rcx
sub    $0x1,%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xdf1(%rip),%rsi
call   1070 <strstr@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1269 <altera_parse_q13_response+0x119>
movl   $0x16,-0x4(%rbp)
movl   $0x1,-0x44(%rbp)
jmp    128b <altera_parse_q13_response+0x13b>
mov    -0x58(%rbp),%rdx
mov    0x2d6c(%rip),%rax
mov    (%rax),%edi
lea    0xd83(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x0,-0x44(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    -0x44(%rbp),%eax
test   %eax,%eax
je     12a7 <altera_parse_q13_response+0x157>
jmp    12a2 <altera_parse_q13_response+0x152>
jmp    1405 <altera_parse_q13_response+0x2b5>
jmp    11ac <altera_parse_q13_response+0x5c>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xda1(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1321 <altera_parse_q13_response+0x1d1>
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x7,%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rdi
lea    0xd6d(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    1315 <altera_parse_q13_response+0x1c5>
mov    -0x50(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x17,-0x4(%rbp)
jmp    1405 <altera_parse_q13_response+0x2b5>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
lea    0xd23(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     1374 <altera_parse_q13_response+0x224>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
lea    0xcaa(%rip),%rsi
lea    0xcf1(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x7,-0x4(%rbp)
jmp    1405 <altera_parse_q13_response+0x2b5>
mov    -0x20(%rbp),%rax
mov    (%rax),%rcx
add    $0x8,%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
mov    -0x20(%rbp),%rcx
cmp    (%rcx),%rax
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
lea    0xcaa(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
je     13fe <altera_parse_q13_response+0x2ae>
mov    0x2c0c(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
lea    0xc48(%rip),%rsi
lea    0xc78(%rip),%rdx
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x7,-0x4(%rbp)
jmp    1405 <altera_parse_q13_response+0x2b5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<altera_parse_q13_response>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r12
mov    %rdx,%r14
mov    %rdi,(%rdx)
mov    %rdi,-0x38(%rbp)
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,(%r12)
mov    $0x16,%ecx
test   %rax,%rax
je     131b <altera_parse_q13_response+0x1cb>
mov    %r14,-0x30(%rbp)
mov    (%r14),%rdi
cmpb   $0x23,(%rdi)
jne    122d <altera_parse_q13_response+0xdd>
mov    %rax,%r15
mov    -0x30(%rbp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rsp,%r14
mov    -0x38(%rbp),%rsi
sub    %rsi,%r15
lea    0xf(%r15),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r13
sub    %rax,%r13
mov    %r13,%rsp
lea    -0x1(%r15),%rdx
mov    %r13,%rdi
call   1030 <strncpy@plt>
movb   $0x0,-0x1(%r15,%r13,1)
mov    (%r12),%rdi
add    $0x1,%rdi
mov    %rdi,(%rbx)
mov    $0xa,%esi
call   1050 <strchr@plt>
mov    %rax,(%r12)
test   %rax,%rax
je     12b2 <altera_parse_q13_response+0x162>
mov    %r12,%r15
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    0xdee(%rip),%rsi
mov    %r13,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14,%rsp
mov    (%rbx),%rdi
cmpb   $0x23,(%rdi)
jne    122d <altera_parse_q13_response+0xdd>
mov    (%r12),%r15
jmp    11b0 <altera_parse_q13_response+0x60>
lea    0xe27(%rip),%rsi
mov    $0x7,%edx
call   1040 <strncmp@plt>
mov    -0x30(%rbp),%rbx
mov    (%rbx),%rdi
test   %rax,%rax
je     127f <altera_parse_q13_response+0x12f>
lea    0xe01(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     12bc <altera_parse_q13_response+0x16c>
mov    0x2d79(%rip),%rax
mov    (%rax),%edi
mov    (%rbx),%rcx
lea    0xd91(%rip),%rsi
lea    0xdd8(%rip),%rdx
jmp    130f <altera_parse_q13_response+0x1bf>
add    $0x7,%rdi
mov    %rdi,(%rbx)
mov    (%r12),%rbx
add    $0xffffffffffffffff,%rbx
lea    0xdce(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1040 <strncmp@plt>
mov    $0x17,%ecx
test   %rax,%rax
jne    131b <altera_parse_q13_response+0x1cb>
mov    %rbx,(%r12)
jmp    131b <altera_parse_q13_response+0x1cb>
mov    %r14,%rsp
mov    $0x16,%ecx
jmp    131b <altera_parse_q13_response+0x1cb>
addq   $0x8,(%rbx)
mov    (%r12),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,(%r12)
xor    %edi,%edi
cmp    (%rbx),%rax
setae  %dil
call   1060 <assert@plt>
mov    (%r12),%rdi
lea    0xd7e(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     132c <altera_parse_q13_response+0x1dc>
mov    0x2ce5(%rip),%rax
mov    (%rax),%edi
mov    (%r12),%rcx
lea    0xd24(%rip),%rsi
lea    0xd54(%rip),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x7,%ecx
mov    %ecx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ecx,%ecx
jmp    131b <altera_parse_q13_response+0x1cb>

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stderr = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
@altera_parse_q13_response.BEGIN = internal constant [9 x i8] c"return \22\00"
@altera_parse_q13_response.ERR_BEGIN = internal constant [8 x i8] c"error \22\00"
@altera_parse_q13_response.END = internal constant [2 x i8] c"\22\00"
@.str.2 = [40 x i8] c"response did not begin with '%s':\0A'%s'\0A\00"
@.str.3 = [38 x i8] c"response did not end with '%s': '%s'\0A\00"
define i32 @altera_parse_q13_response(i8* %0, i64 %1, i8** %2, i8** %3) {
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
%14 = alloca i8*
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
%15 = load i8*, i8** %6
%16 = load i8**, i8*** %8
store i8* %15, i8** %16
%17 = load i8*, i8** %6
%18 = call i8* @strstr(i8* %17, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = load i8**, i8*** %9
store i8* %18, i8** %19
%20 = load i8**, i8*** %9
%21 = load i8*, i8** %20
%22 = icmp eq i8* %21, null
br i1 %22, label %23, label %24
23: ; preds = %4
store i32 22, i32* %5
br label %120
24: ; preds = %4
br label %25
25: ; preds = %66, %24
%26 = load i8**, i8*** %8
%27 = load i8*, i8** %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 35
br i1 %30, label %31, label %67
31: ; preds = %25
%32 = load i8**, i8*** %9
%33 = load i8*, i8** %32
%34 = load i8*, i8** %6
%35 = ptrtoint i8* %33 to i64
%36 = ptrtoint i8* %34 to i64
%37 = sub i64 %35, %36
store i64 %37, i64* %10
%38 = load i64, i64* %10
%39 = call i8* @llvm.stacksave()
store i8* %39, i8** %11
%40 = alloca i8, i64 %38
store i64 %38, i64* %12
%41 = load i8*, i8** %6
%42 = load i64, i64* %10
%43 = sub i64 %42, 1
%44 = call i32 @strncpy(i8* %40, i8* %41, i64 %43)
%45 = load i64, i64* %10
%46 = sub i64 %45, 1
%47 = getelementptr inbounds i8, i8* %40, i64 %46
store i8 0, i8* %47
%48 = load i8**, i8*** %9
%49 = load i8*, i8** %48
%50 = getelementptr inbounds i8, i8* %49, i64 1
%51 = load i8**, i8*** %8
store i8* %50, i8** %51
%52 = load i8**, i8*** %8
%53 = load i8*, i8** %52
%54 = call i8* @strstr(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%55 = load i8**, i8*** %9
store i8* %54, i8** %55
%56 = load i8**, i8*** %9
%57 = load i8*, i8** %56
%58 = icmp eq i8* %57, null
br i1 %58, label %59, label %60
59: ; preds = %31
store i32 22, i32* %5
store i32 1, i32* %13
br label %63
60: ; preds = %31
%61 = load i32, i32* @stderr
%62 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %61, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %40)
store i32 0, i32* %13
br label %63
63: ; preds = %60, %59
%64 = load i8*, i8** %11
%65 = load i32, i32* %13
switch i32 %65, label %122 [
i32 0, label %66
i32 1, label %120
]
66: ; preds = %63
br label %25
67: ; preds = %25
%68 = load i8**, i8*** %8
%69 = load i8*, i8** %68
%70 = call i64 @strncmp(i8* %69, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @altera_parse_q13_response.ERR_BEGIN, i64 0, i64 0), i32 7)
%71 = icmp eq i64 %70, 0
br i1 %71, label %72, label %86
72: ; preds = %67
%73 = load i8**, i8*** %8
%74 = load i8*, i8** %73
%75 = getelementptr inbounds i8, i8* %74, i64 7
store i8* %75, i8** %73
%76 = load i8**, i8*** %9
%77 = load i8*, i8** %76
%78 = getelementptr inbounds i8, i8* %77, i64 -1
store i8* %78, i8** %14
%79 = load i8*, i8** %14
%80 = call i64 @strncmp(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @altera_parse_q13_response.END, i64 0, i64 0), i32 1)
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %85
82: ; preds = %72
%83 = load i8*, i8** %14
%84 = load i8**, i8*** %9
store i8* %83, i8** %84
br label %85
85: ; preds = %82, %72
store i32 23, i32* %5
br label %120
86: ; preds = %67
%87 = load i8**, i8*** %8
%88 = load i8*, i8** %87
%89 = call i64 @strncmp(i8* %88, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @altera_parse_q13_response.BEGIN, i64 0, i64 0), i32 8)
%90 = icmp ne i64 %89, 0
br i1 %90, label %91, label %96
91: ; preds = %86
%92 = load i32, i32* @stderr
%93 = load i8**, i8*** %8
%94 = load i8*, i8** %93
%95 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @altera_parse_q13_response.BEGIN, i64 0, i64 0), i8* %94)
store i32 7, i32* %5
br label %120
96: ; preds = %86
%97 = load i8**, i8*** %8
%98 = load i8*, i8** %97
%99 = getelementptr inbounds i8, i8* %98, i64 8
store i8* %99, i8** %97
%100 = load i8**, i8*** %9
%101 = load i8*, i8** %100
%102 = getelementptr inbounds i8, i8* %101, i64 -1
store i8* %102, i8** %100
%103 = load i8**, i8*** %9
%104 = load i8*, i8** %103
%105 = load i8**, i8*** %8
%106 = load i8*, i8** %105
%107 = icmp uge i8* %104, %106
%108 = zext i1 %107 to i32
%109 = call i32 @assert(i32 %108)
%110 = load i8**, i8*** %9
%111 = load i8*, i8** %110
%112 = call i64 @strncmp(i8* %111, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @altera_parse_q13_response.END, i64 0, i64 0), i32 1)
%113 = icmp ne i64 %112, 0
br i1 %113, label %114, label %119
114: ; preds = %96
%115 = load i32, i32* @stderr
%116 = load i8**, i8*** %9
%117 = load i8*, i8** %116
%118 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %115, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @altera_parse_q13_response.END, i64 0, i64 0), i8* %117)
store i32 7, i32* %5
br label %120
119: ; preds = %96
store i32 0, i32* %5
br label %120
120: ; preds = %119, %114, %91, %85, %63, %23
%121 = load i32, i32* %5
ret i32 %121
122: ; preds = %63
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
@altera_parse_q13_response.BEGIN = internal constant [9 x i8] c"return \22\00"
@altera_parse_q13_response.ERR_BEGIN = internal constant [8 x i8] c"error \22\00"
@altera_parse_q13_response.END = internal constant [2 x i8] c"\22\00"
@.str.2 = [40 x i8] c"response did not begin with '%s':\0A'%s'\0A\00"
@.str.3 = [38 x i8] c"response did not end with '%s': '%s'\0A\00"
define i32 @altera_parse_q13_response(i8* %0, i64 %1, i8** nocapture %2, i8** nocapture %3) {
store i8* %0, i8** %2
%5 = tail call i8* @strchr(i8* dereferenceable(1) %0, i32 10)
store i8* %5, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %70, label %7
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 35
br i1 %10, label %11, label %35
11: ; preds = %7
%12 = ptrtoint i8* %0 to i64
br label %13
13: ; preds = %33, %11
%14 = phi i8* [ %34, %33 ], [ %5, %11 ]
%15 = ptrtoint i8* %14 to i64
%16 = sub i64 %15, %12
%17 = call i8* @llvm.stacksave()
%18 = alloca i8, i64 %16
%19 = add i64 %16, -1
%20 = call i32 @strncpy(i8* %18, i8* %0, i64 %19)
%21 = getelementptr inbounds i8, i8* %18, i64 %19
store i8 0, i8* %21
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 1
store i8* %23, i8** %2
%24 = call i8* @strchr(i8* %23, i32 10)
store i8* %24, i8** %3
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %27
26: ; preds = %13
br label %70
27: ; preds = %13
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%30 = load i8*, i8** %2
%31 = load i8, i8* %30
%32 = icmp eq i8 %31, 35
br i1 %32, label %33, label %35
33: ; preds = %27
%34 = load i8*, i8** %3
br label %13
35: ; preds = %27, %7
%36 = phi i8* [ %8, %7 ], [ %30, %27 ]
%37 = call i64 @strncmp(i8* %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @altera_parse_q13_response.ERR_BEGIN, i64 0, i64 0), i32 7)
%38 = icmp eq i64 %37, 0
%39 = load i8*, i8** %2
br i1 %38, label %40, label %47
40: ; preds = %35
%41 = getelementptr inbounds i8, i8* %39, i64 7
store i8* %41, i8** %2
%42 = load i8*, i8** %3
%43 = getelementptr inbounds i8, i8* %42, i64 -1
%44 = call i64 @strncmp(i8* %43, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @altera_parse_q13_response.END, i64 0, i64 0), i32 1)
%45 = icmp eq i64 %44, 0
br i1 %45, label %46, label %70
46: ; preds = %40
store i8* %43, i8** %3
br label %70
47: ; preds = %35
%48 = call i64 @strncmp(i8* %39, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @altera_parse_q13_response.BEGIN, i64 0, i64 0), i32 8)
%49 = icmp eq i64 %48, 0
br i1 %49, label %54, label %50
50: ; preds = %47
%51 = load i32, i32* @stderr
%52 = load i8*, i8** %2
%53 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %51, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @altera_parse_q13_response.BEGIN, i64 0, i64 0), i8* %52)
br label %70
54: ; preds = %47
%55 = load i8*, i8** %2
%56 = getelementptr inbounds i8, i8* %55, i64 8
store i8* %56, i8** %2
%57 = load i8*, i8** %3
%58 = getelementptr inbounds i8, i8* %57, i64 -1
store i8* %58, i8** %3
%59 = load i8*, i8** %2
%60 = icmp uge i8* %58, %59
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load i8*, i8** %3
%64 = call i64 @strncmp(i8* %63, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @altera_parse_q13_response.END, i64 0, i64 0), i32 1)
%65 = icmp eq i64 %64, 0
br i1 %65, label %70, label %66
66: ; preds = %54
%67 = load i32, i32* @stderr
%68 = load i8*, i8** %3
%69 = call i32 (i32, i8*, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @altera_parse_q13_response.END, i64 0, i64 0), i8* %68)
br label %70
70: ; preds = %26, %54, %40, %46, %4, %66, %50
%71 = phi i32 [ 7, %50 ], [ 7, %66 ], [ 22, %4 ], [ 23, %46 ], [ 23, %40 ], [ 0, %54 ], [ 22, %26 ]
ret i32 %71
}