#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*/ uint8_t;
typedef int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long UINT8_MAX;
int /*<<< orphan*/ assert(int);
scalar_t__ decode_chunk(int /*<<< orphan*/ *, int);
scalar_t__ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int fscanf(int /*<<< orphan*/ *, char *, char **);
int /*<<< orphan*/ isxdigit(char);
int /*<<< orphan*/ stderr;
unsigned long strtoul(char *, char **, int);
int decode(FILE *input) {
  int result = 1;
  char *word = NULL;
  char *end;
  uint8_t buf[258];
  uint8_t *p = buf;
  unsigned long n;
  assert(sizeof(buf) > 0);
  while (fscanf(input, "%ms", &word) == 1) {
    if (word[0] != '\0' && !isxdigit(word[0]) && word[1] == '\0') {
      if (p != buf && decode_chunk(buf, p - buf) != 0)
        do {
          fprintf(stderr, "Failed to "
                          "decode chunk"
                          "\n");
          goto cleanup;
        } while (0);
      p = buf;
      n = word[0];
    } else {
      if (p == buf)
        do {
          fprintf(stderr, "Expecting chunk type indicator"
                          "\n");
          goto cleanup;
        } while (0);
      errno = 0;
      n = strtoul(word, &end, 16);
      if (*end != '\0' || errno != 0 || n > UINT8_MAX)
        do {
          fprintf(stderr,
                  "Invalid byte \"%s\""
                  "\n",
                  word);
          goto cleanup;
        } while (0);
      if (p >= buf + sizeof(buf))
        do {
          fprintf(stderr, "Descriptor too long"
                          "\n");
          goto cleanup;
        } while (0);
    }
    *p++ = n;
    free(word);
    word = NULL;
  };
  if (p != buf && decode_chunk(buf, p - buf) != 0)
    do {
      fprintf(stderr, "Failed to "
                      "decode chunk"
                      "\n");
      goto cleanup;
    } while (0);
  result = 0;
cleanup:
  free(word);
  return result;
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x430(%rbp),%rax
mov    %rax,-0x438(%rbp)
mov    $0x1,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe4f(%rip),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
jne    13b6 <decode+0x246>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1280 <decode+0x110>
mov    -0x18(%rbp),%rax
movsbl (%rax),%edi
call   1090 <isxdigit@plt>
cmp    $0x0,%eax
jne    1280 <decode+0x110>
mov    -0x18(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x0,%eax
jne    1280 <decode+0x110>
mov    -0x438(%rbp),%rax
lea    -0x430(%rbp),%rcx
cmp    %rcx,%rax
je     125e <decode+0xee>
lea    -0x430(%rbp),%rdi
mov    -0x438(%rbp),%rax
lea    -0x430(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%esi
call   1040 <decode_chunk@plt>
cmp    $0x0,%rax
je     125e <decode+0xee>
jmp    1242 <decode+0xd2>
mov    0x2d97(%rip),%rax
mov    (%rax),%edi
lea    0xdb2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1422 <decode+0x2b2>
lea    -0x430(%rbp),%rax
mov    %rax,-0x438(%rbp)
mov    -0x18(%rbp),%rax
movsbq (%rax),%rax
mov    %rax,-0x440(%rbp)
jmp    1380 <decode+0x210>
mov    -0x438(%rbp),%rax
lea    -0x430(%rbp),%rcx
cmp    %rcx,%rax
jne    12b8 <decode+0x148>
jmp    129c <decode+0x12c>
mov    0x2d3d(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1422 <decode+0x2b2>
mov    0x2d19(%rip),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x10,%edx
call   1080 <strtoul@plt>
mov    %rax,-0x440(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1317 <decode+0x1a7>
mov    0x2ce2(%rip),%rax
cmpq   $0x0,(%rax)
jne    1317 <decode+0x1a7>
mov    -0x440(%rbp),%rax
mov    0x2cc2(%rip),%rcx
cmp    (%rcx),%rax
jbe    133c <decode+0x1cc>
jmp    131c <decode+0x1ac>
mov    0x2cbd(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1422 <decode+0x2b2>
mov    -0x438(%rbp),%rax
lea    -0x430(%rbp),%rcx
add    $0x1020,%rcx
cmp    %rcx,%rax
jb     137b <decode+0x20b>
jmp    135f <decode+0x1ef>
mov    0x2c7a(%rip),%rax
mov    (%rax),%edi
lea    0xce0(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1422 <decode+0x2b2>
jmp    1380 <decode+0x210>
mov    -0x440(%rbp),%rax
mov    %eax,%ecx
mov    -0x438(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x438(%rbp)
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x18(%rbp)
jmp    11a6 <decode+0x36>
mov    -0x438(%rbp),%rax
lea    -0x430(%rbp),%rcx
cmp    %rcx,%rax
je     141b <decode+0x2ab>
lea    -0x430(%rbp),%rdi
mov    -0x438(%rbp),%rax
lea    -0x430(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %eax,%esi
call   1040 <decode_chunk@plt>
cmp    $0x0,%rax
je     141b <decode+0x2ab>
jmp    13ff <decode+0x28f>
mov    0x2bda(%rip),%rax
mov    (%rax),%edi
lea    0xbf5(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
jmp    1422 <decode+0x2b2>
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %rdi,%rbx
movq   $0x0,(%rsp)
mov    $0x1,%edi
call   1060 <assert@plt>
lea    0xe63(%rip),%rsi
mov    %rsp,%rdx
mov    %rbx,%rdi
call   1050 <fscanf@plt>
xor    %ebp,%ebp
cmp    $0x1,%eax
jne    132e <decode+0x1be>
lea    0x10(%rsp),%r14
mov    0x2e19(%rip),%r15
lea    0xe3a(%rip),%r12
mov    %rsp,%r13
mov    %r14,%rbp
nopl   0x0(%rax)
mov    (%rsp),%rax
movzbl (%rax),%eax
test   %al,%al
je     1200 <decode+0x90>
movsbl %al,%edi
call   1090 <isxdigit@plt>
test   %eax,%eax
jne    1200 <decode+0x90>
mov    (%rsp),%rdi
cmpb   $0x0,0x1(%rdi)
je     128d <decode+0x11d>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %r14,%rbp
je     12b2 <decode+0x142>
movq   $0x0,(%r15)
mov    (%rsp),%rdi
lea    0x8(%rsp),%rsi
mov    $0x10,%edx
call   1080 <strtoul@plt>
mov    0x8(%rsp),%rcx
cmpb   $0x0,(%rcx)
jne    12f5 <decode+0x185>
cmpq   $0x0,(%r15)
jne    12f5 <decode+0x185>
mov    0x2d8e(%rip),%rcx
cmp    (%rcx),%rax
ja     12f5 <decode+0x185>
lea    0x1030(%rsp),%rcx
cmp    %rcx,%rbp
jae    1312 <decode+0x1a2>
mov    (%rsp),%rdi
mov    %eax,0x0(%rbp)
add    $0x4,%rbp
call   1030 <free@plt>
movq   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <fscanf@plt>
cmp    $0x1,%eax
je     11d0 <decode+0x60>
jmp    12c4 <decode+0x154>
sub    %r14,%rbp
je     12a9 <decode+0x139>
shr    $0x2,%rbp
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <decode_chunk@plt>
test   %rax,%rax
jne    12e3 <decode+0x173>
mov    (%rsp),%rdi
movsbq (%rdi),%rax
mov    %r14,%rbp
jmp    1260 <decode+0xf0>
mov    0x2d27(%rip),%rax
mov    (%rax),%edi
lea    0xd5a(%rip),%rsi
jmp    1322 <decode+0x1b2>
lea    0x10(%rsp),%rdi
sub    %rdi,%rbp
je     134b <decode+0x1db>
shr    $0x2,%rbp
mov    %ebp,%esi
call   1040 <decode_chunk@plt>
test   %rax,%rax
mov    $0x0,%ebp
je     132e <decode+0x1be>
mov    0x2cf6(%rip),%rax
mov    (%rax),%edi
lea    0xd11(%rip),%rsi
jmp    1322 <decode+0x1b2>
mov    0x2ce4(%rip),%rax
mov    (%rax),%edi
mov    (%rsp),%rdx
lea    0xd33(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    1329 <decode+0x1b9>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
lea    0xd2d(%rip),%rsi
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    $0x1,%ebp
mov    (%rsp),%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %ebp,%ebp
jmp    132e <decode+0x1be>

LLVM IR (-O0):
@.str = [4 x i8] c"%ms\00"
@stderr = global i32 0
@.str.1 = [24 x i8] c"Failed to decode chunk\0A\00"
@.str.2 = [32 x i8] c"Expecting chunk type indicator\0A\00"
@errno = global i64 0
@UINT8_MAX = global i64 0
@.str.3 = [19 x i8] c"Invalid byte \22%s\22\0A\00"
@.str.4 = [21 x i8] c"Descriptor too long\0A\00"
define i32 @decode(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [258 x i32]
%7 = alloca i32*
%8 = alloca i64
store i32* %0, i32** %2
store i32 1, i32* %3
store i8* null, i8** %4
%9 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
store i32* %9, i32** %7
%10 = call i32 @assert(i32 1)
br label %11
11: ; preds = %99, %1
%12 = load i32*, i32** %2
%13 = call i32 @fscanf(i32* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %4)
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %106
15: ; preds = %11
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %59
21: ; preds = %15
%22 = load i8*, i8** %4
%23 = getelementptr inbounds i8, i8* %22, i64 0
%24 = load i8, i8* %23
%25 = call i32 @isxdigit(i8 signext %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %59, label %27
27: ; preds = %21
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %59
33: ; preds = %27
%34 = load i32*, i32** %7
%35 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%36 = icmp ne i32* %34, %35
br i1 %36, label %37, label %53
37: ; preds = %33
%38 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%39 = load i32*, i32** %7
%40 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%41 = ptrtoint i32* %39 to i64
%42 = ptrtoint i32* %40 to i64
%43 = sub i64 %41, %42
%44 = sdiv exact i64 %43, 4
%45 = trunc i64 %44 to i32
%46 = call i64 @decode_chunk(i32* %38, i32 %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %53
48: ; preds = %37
br label %49
49: ; preds = %48
%50 = load i32, i32* @stderr
%51 = call i32 (i32, i8*, ...) @fprintf(i32 %50, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %127
52: ; No predecessors!
br label %53
53: ; preds = %52, %37, %33
%54 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
store i32* %54, i32** %7
%55 = load i8*, i8** %4
%56 = getelementptr inbounds i8, i8* %55, i64 0
%57 = load i8, i8* %56
%58 = sext i8 %57 to i64
store i64 %58, i64* %8
br label %99
59: ; preds = %27, %21, %15
%60 = load i32*, i32** %7
%61 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%62 = icmp eq i32* %60, %61
br i1 %62, label %63, label %68
63: ; preds = %59
br label %64
64: ; preds = %63
%65 = load i32, i32* @stderr
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %65, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %127
67: ; No predecessors!
br label %68
68: ; preds = %67, %59
store i64 0, i64* @errno
%69 = load i8*, i8** %4
%70 = call i64 @strtoul(i8* %69, i8** %5, i32 16)
store i64 %70, i64* %8
%71 = load i8*, i8** %5
%72 = load i8, i8* %71
%73 = sext i8 %72 to i32
%74 = icmp ne i32 %73, 0
br i1 %74, label %82, label %75
75: ; preds = %68
%76 = load i64, i64* @errno
%77 = icmp ne i64 %76, 0
br i1 %77, label %82, label %78
78: ; preds = %75
%79 = load i64, i64* %8
%80 = load i64, i64* @UINT8_MAX
%81 = icmp ugt i64 %79, %80
br i1 %81, label %82, label %88
82: ; preds = %78, %75, %68
br label %83
83: ; preds = %82
%84 = load i32, i32* @stderr
%85 = load i8*, i8** %4
%86 = call i32 (i32, i8*, ...) @fprintf(i32 %84, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %85)
br label %127
87: ; No predecessors!
br label %88
88: ; preds = %87, %78
%89 = load i32*, i32** %7
%90 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%91 = getelementptr inbounds i32, i32* %90, i64 1032
%92 = icmp uge i32* %89, %91
br i1 %92, label %93, label %98
93: ; preds = %88
br label %94
94: ; preds = %93
%95 = load i32, i32* @stderr
%96 = call i32 (i32, i8*, ...) @fprintf(i32 %95, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %127
97: ; No predecessors!
br label %98
98: ; preds = %97, %88
br label %99
99: ; preds = %98, %53
%100 = load i64, i64* %8
%101 = trunc i64 %100 to i32
%102 = load i32*, i32** %7
%103 = getelementptr inbounds i32, i32* %102, i32 1
store i32* %103, i32** %7
store i32 %101, i32* %102
%104 = load i8*, i8** %4
%105 = call i32 @free(i8* %104)
store i8* null, i8** %4
br label %11
106: ; preds = %11
%107 = load i32*, i32** %7
%108 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%109 = icmp ne i32* %107, %108
br i1 %109, label %110, label %126
110: ; preds = %106
%111 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%112 = load i32*, i32** %7
%113 = getelementptr inbounds [258 x i32], [258 x i32]* %6, i64 0, i64 0
%114 = ptrtoint i32* %112 to i64
%115 = ptrtoint i32* %113 to i64
%116 = sub i64 %114, %115
%117 = sdiv exact i64 %116, 4
%118 = trunc i64 %117 to i32
%119 = call i64 @decode_chunk(i32* %111, i32 %118)
%120 = icmp ne i64 %119, 0
br i1 %120, label %121, label %126
121: ; preds = %110
br label %122
122: ; preds = %121
%123 = load i32, i32* @stderr
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %127
125: ; No predecessors!
br label %126
126: ; preds = %125, %110, %106
store i32 0, i32* %3
br label %127
127: ; preds = %126, %122, %94, %83, %64, %49
%128 = load i8*, i8** %4
%129 = call i32 @free(i8* %128)
%130 = load i32, i32* %3
ret i32 %130
}

LLVM IR (-O2):
@.str = [4 x i8] c"%ms\00"
@stderr = global i32 0
@.str.1 = [24 x i8] c"Failed to decode chunk\0A\00"
@.str.2 = [32 x i8] c"Expecting chunk type indicator\0A\00"
@errno = global i64 0
@UINT8_MAX = global i64 0
@.str.3 = [19 x i8] c"Invalid byte \22%s\22\0A\00"
@.str.4 = [21 x i8] c"Descriptor too long\0A\00"
define i32 @decode(i32* nocapture %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca [258 x i32]
%5 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%6 = bitcast i8** %3 to i8*
%7 = bitcast [258 x i32]* %4 to i8*
%8 = getelementptr inbounds [258 x i32], [258 x i32]* %4, i64 0, i64 0
%9 = tail call i32 @assert(i32 1)
%10 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2)
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %96
12: ; preds = %1
%13 = ptrtoint [258 x i32]* %4 to i64
%14 = getelementptr inbounds [258 x i32], [258 x i32]* %4, i64 0, i64 1032
br label %15
15: ; preds = %12, %74
%16 = phi i32* [ %8, %12 ], [ %79, %74 ]
%17 = load i8*, i8** %2
%18 = load i8, i8* %17
%19 = icmp eq i8 %18, 0
br i1 %19, label %46, label %20
20: ; preds = %15
%21 = call i32 @isxdigit(i8 signext %18)
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %46
23: ; preds = %20
%24 = load i8*, i8** %2
%25 = getelementptr inbounds i8, i8* %24, i64 1
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %46
28: ; preds = %23
%29 = icmp eq i32* %16, %8
br i1 %29, label %42, label %30
30: ; preds = %28
%31 = ptrtoint i32* %16 to i64
%32 = sub i64 %31, %13
%33 = lshr exact i64 %32, 2
%34 = trunc i64 %33 to i32
%35 = call i64 @decode_chunk(i32* %8, i32 %34)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %30
%38 = load i8*, i8** %2
br label %42
39: ; preds = %30
%40 = load i32, i32* @stderr
%41 = call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %96
42: ; preds = %37, %28
%43 = phi i8* [ %38, %37 ], [ %24, %28 ]
%44 = load i8, i8* %43
%45 = sext i8 %44 to i64
br label %74
46: ; preds = %23, %20, %15
%47 = icmp eq i32* %16, %8
br i1 %47, label %48, label %51
48: ; preds = %46
%49 = load i32, i32* @stderr
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %96
51: ; preds = %46
store i64 0, i64* @errno
%52 = load i8*, i8** %2
%53 = call i64 @strtoul(i8* %52, i8** %3, i32 16)
%54 = load i8*, i8** %3
%55 = load i8, i8* %54
%56 = icmp ne i8 %55, 0
%57 = load i64, i64* @errno
%58 = icmp ne i64 %57, 0
%59 = select i1 %56, i1 true, i1 %58
%60 = load i64, i64* @UINT8_MAX
%61 = icmp ugt i64 %53, %60
%62 = select i1 %59, i1 true, i1 %61
br i1 %62, label %63, label %67
63: ; preds = %51
%64 = load i32, i32* @stderr
%65 = load i8*, i8** %2
%66 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %65)
br label %96
67: ; preds = %51
%68 = icmp ult i32* %16, %14
br i1 %68, label %69, label %71
69: ; preds = %67
%70 = load i8*, i8** %2
br label %74
71: ; preds = %67
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
br label %96
74: ; preds = %69, %42
%75 = phi i8* [ %70, %69 ], [ %43, %42 ]
%76 = phi i32* [ %16, %69 ], [ %8, %42 ]
%77 = phi i64 [ %53, %69 ], [ %45, %42 ]
%78 = trunc i64 %77 to i32
%79 = getelementptr inbounds i32, i32* %76, i64 1
store i32 %78, i32* %76
%80 = call i32 @free(i8* %75)
store i8* null, i8** %2
%81 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8** %2)
%82 = icmp eq i32 %81, 1
br i1 %82, label %15, label %83
83: ; preds = %74
%84 = icmp eq i32* %79, %8
br i1 %84, label %96, label %85
85: ; preds = %83
%86 = ptrtoint i32* %79 to i64
%87 = ptrtoint [258 x i32]* %4 to i64
%88 = sub i64 %86, %87
%89 = lshr exact i64 %88, 2
%90 = trunc i64 %89 to i32
%91 = call i64 @decode_chunk(i32* %8, i32 %90)
%92 = icmp eq i64 %91, 0
br i1 %92, label %96, label %93
93: ; preds = %85
%94 = load i32, i32* @stderr
%95 = call i32 (i32, i8*, ...) @fprintf(i32 %94, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %96
96: ; preds = %1, %83, %85, %93, %71, %63, %48, %39
%97 = phi i32 [ 1, %48 ], [ 1, %63 ], [ 1, %71 ], [ 1, %39 ], [ 1, %93 ], [ 0, %85 ], [ 0, %83 ], [ 0, %1 ]
%98 = load i8*, i8** %2
%99 = call i32 @free(i8* %98)
ret i32 %97
}