#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*/ maps;

/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ ensure_no_bad_insns_in_range(unsigned long, unsigned long);
int /*<<< orphan*/ err(int, char *);
int /*<<< orphan*/ errx(int, char *, char *);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
int read(int, char *, int);
int sscanf(char *, char *, unsigned long *, unsigned long *, char *);
char *strchr(char *, char);
void ensure_no_bad_insns(void) {
  int maps_fd = open("/proc/self/maps", O_RDONLY);
  char maps[100000];
  int maps_len = 0;
  while (1) {
    int len = read(maps_fd, maps + maps_len, sizeof(maps) - 1 - maps_len);
    if (len < 0)
      err(1, "unable to read from maps");
    if (len == 0)
      break;
    maps_len += len;
  }
  maps[maps_len] = '\0';
  char *line = maps;
  unsigned long exec_start = 0, exec_end = 0;
  while (1) {
    char *next_line = strchr(line, '\n');
    if (next_line) {
      *next_line = '\0';
      next_line++;
    }
    unsigned long start, end;
    char flags[100];
    if (sscanf(line, "%lx-%lx %s", &start, &end, flags) != 3)
      errx(1, "cannot parse line '%s'", line);
    printf("got mapping: %s\n", line);
    assert(end > start);
    assert(flags[2] == '-' || flags[2] == 'x');
    assert(flags[1] == '-' || flags[2] == '-');
    if (flags[2] == 'x' && start == exec_end) {
      exec_end = end;
    } else if (flags[2] == 'x') {
      ensure_no_bad_insns_in_range(exec_start, exec_end);
      exec_start = start;
      exec_end = end;
    }
    line = next_line;
    if (line == NULL || line[0] == '\0')
      break;
  }
  ensure_no_bad_insns_in_range(exec_start, exec_end);
  close(maps_fd);
}


x86 assembly (clang, -O0):
<ensure_no_bad_insns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x18760,%rsp
mov    0x2e36(%rip),%rax
mov    (%rax),%esi
lea    0xe45(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,-0x4(%rbp)
movl   $0x0,-0x186b4(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x186b0(%rbp),%rsi
movslq -0x186b4(%rbp),%rax
add    %rax,%rsi
movslq -0x186b4(%rbp),%rcx
mov    $0x1869f,%eax
sub    %rcx,%rax
mov    %eax,%edx
call   1070 <read@plt>
mov    %eax,-0x186b8(%rbp)
cmpl   $0x0,-0x186b8(%rbp)
jge    121b <ensure_no_bad_insns+0x7b>
mov    $0x1,%edi
lea    0xdfa(%rip),%rsi
call   1090 <err@plt>
cmpl   $0x0,-0x186b8(%rbp)
jne    122d <ensure_no_bad_insns+0x8d>
jmp    1244 <ensure_no_bad_insns+0xa4>
mov    -0x186b8(%rbp),%eax
add    -0x186b4(%rbp),%eax
mov    %eax,-0x186b4(%rbp)
jmp    11cd <ensure_no_bad_insns+0x2d>
movslq -0x186b4(%rbp),%rax
movb   $0x0,-0x186b0(%rbp,%rax,1)
lea    -0x186b0(%rbp),%rax
mov    %rax,-0x186c0(%rbp)
movq   $0x0,-0x186c8(%rbp)
movq   $0x0,-0x186d0(%rbp)
mov    -0x186c0(%rbp),%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
mov    %rax,-0x186d8(%rbp)
cmpq   $0x0,-0x186d8(%rbp)
je     12b9 <ensure_no_bad_insns+0x119>
mov    -0x186d8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x186d8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x186d8(%rbp)
mov    -0x186c0(%rbp),%rdi
lea    -0x18750(%rbp),%r8
lea    0xd5b(%rip),%rsi
lea    -0x186e0(%rbp),%rdx
lea    -0x186e8(%rbp),%rcx
call   10a0 <sscanf@plt>
cmp    $0x3,%eax
je     1302 <ensure_no_bad_insns+0x162>
mov    -0x186c0(%rbp),%rdx
mov    $0x1,%edi
lea    0xd37(%rip),%rsi
call   1030 <errx@plt>
mov    -0x186c0(%rbp),%rsi
lea    0xd3b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x186e8(%rbp),%rax
cmp    -0x186e0(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
movsbl -0x1874e(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x18751(%rbp)
je     135b <ensure_no_bad_insns+0x1bb>
movsbl -0x1874e(%rbp),%eax
cmp    $0x78,%eax
sete   %al
mov    %al,-0x18751(%rbp)
mov    -0x18751(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
movsbl -0x1874f(%rbp),%ecx
mov    $0x1,%al
cmp    $0x2d,%ecx
mov    %al,-0x18752(%rbp)
je     1396 <ensure_no_bad_insns+0x1f6>
movsbl -0x1874e(%rbp),%eax
cmp    $0x2d,%eax
sete   %al
mov    %al,-0x18752(%rbp)
mov    -0x18752(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
movsbl -0x1874e(%rbp),%eax
cmp    $0x78,%eax
jne    13dd <ensure_no_bad_insns+0x23d>
mov    -0x186e0(%rbp),%rax
cmp    -0x186d0(%rbp),%rax
jne    13dd <ensure_no_bad_insns+0x23d>
mov    -0x186e8(%rbp),%rax
mov    %rax,-0x186d0(%rbp)
jmp    1421 <ensure_no_bad_insns+0x281>
movsbl -0x1874e(%rbp),%eax
cmp    $0x78,%eax
jne    141c <ensure_no_bad_insns+0x27c>
mov    -0x186c8(%rbp),%rdi
mov    -0x186d0(%rbp),%rsi
call   10b0 <ensure_no_bad_insns_in_range@plt>
mov    -0x186e0(%rbp),%rax
mov    %rax,-0x186c8(%rbp)
mov    -0x186e8(%rbp),%rax
mov    %rax,-0x186d0(%rbp)
jmp    1421 <ensure_no_bad_insns+0x281>
mov    -0x186d8(%rbp),%rax
mov    %rax,-0x186c0(%rbp)
cmpq   $0x0,-0x186c0(%rbp)
je     1450 <ensure_no_bad_insns+0x2b0>
mov    -0x186c0(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1455 <ensure_no_bad_insns+0x2b5>
jmp    145a <ensure_no_bad_insns+0x2ba>
jmp    1277 <ensure_no_bad_insns+0xd7>
mov    -0x186c8(%rbp),%rdi
mov    -0x186d0(%rbp),%rsi
call   10b0 <ensure_no_bad_insns_in_range@plt>
mov    -0x4(%rbp),%edi
call   1060 <close@plt>
add    $0x18760,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ensure_no_bad_insns>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18728,%rsp
mov    0x2e30(%rip),%rax
mov    (%rax),%esi
lea    0xe3f(%rip),%rdi
call   10c0 <open@plt>
mov    %eax,%r15d
xor    %ebx,%ebx
lea    0xe3e(%rip),%r14
jmp    11e6 <ensure_no_bad_insns+0x46>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    %ebp,%ebx
test   %ebp,%ebp
je     1218 <ensure_no_bad_insns+0x78>
movslq %ebx,%rax
lea    (%rsp,%rax,1),%rsi
add    $0x80,%rsi
mov    $0x1869f,%edx
sub    %eax,%edx
mov    %r15d,%edi
call   1070 <read@plt>
mov    %eax,%ebp
test   %eax,%eax
jns    11e0 <ensure_no_bad_insns+0x40>
mov    $0x1,%edi
mov    %r14,%rsi
call   1090 <err@plt>
jmp    11e0 <ensure_no_bad_insns+0x40>
lea    0x80(%rsp),%rbp
movslq %ebx,%rax
movb   $0x0,0x80(%rsp,%rax,1)
xor    %r14d,%r14d
lea    0xe16(%rip),%rbx
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0xa,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     1260 <ensure_no_bad_insns+0xc0>
mov    %rax,%r13
movb   $0x0,(%rax)
add    $0x1,%r13
jmp    1263 <ensure_no_bad_insns+0xc3>
xchg   %ax,%ax
xor    %r13d,%r13d
mov    %rbp,%rdi
lea    0xdbc(%rip),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
lea    0x10(%rsp),%r8
call   10a0 <sscanf@plt>
cmp    $0x3,%eax
je     1298 <ensure_no_bad_insns+0xf8>
mov    $0x1,%edi
lea    0xda4(%rip),%rsi
mov    %rbp,%rdx
call   1030 <errx@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <printf@plt>
mov    (%rsp),%rax
xor    %edi,%edi
cmp    0x8(%rsp),%rax
seta   %dil
call   1080 <assert@plt>
movzbl 0x12(%rsp),%eax
cmp    $0x2d,%al
sete   %cl
cmp    $0x78,%al
sete   %al
or     %cl,%al
movzbl %al,%edi
call   1080 <assert@plt>
cmpb   $0x2d,0x11(%rsp)
sete   %al
cmpb   $0x2d,0x12(%rsp)
sete   %cl
or     %al,%cl
movzbl %cl,%edi
call   1080 <assert@plt>
movzbl 0x12(%rsp),%eax
cmp    $0x78,%al
jne    12fa <ensure_no_bad_insns+0x15a>
cmp    %r12,0x8(%rsp)
je     130e <ensure_no_bad_insns+0x16e>
cmp    $0x78,%al
jne    1312 <ensure_no_bad_insns+0x172>
mov    %r14,%rdi
mov    %r12,%rsi
call   10b0 <ensure_no_bad_insns_in_range@plt>
mov    0x8(%rsp),%r14
mov    (%rsp),%r12
test   %r13,%r13
je     1326 <ensure_no_bad_insns+0x186>
cmpb   $0x0,0x0(%r13)
je     1326 <ensure_no_bad_insns+0x186>
mov    %r13,%rbp
jmp    1240 <ensure_no_bad_insns+0xa0>
mov    %r14,%rdi
mov    %r12,%rsi
call   10b0 <ensure_no_bad_insns_in_range@plt>
mov    %r15d,%edi
call   1060 <close@plt>
add    $0x18728,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"/proc/self/maps\00"
@O_RDONLY = global i32 0
@.str.1 = [25 x i8] c"unable to read from maps\00"
@.str.2 = [11 x i8] c"%lx-%lx %s\00"
@.str.3 = [23 x i8] c"cannot parse line '%s'\00"
@.str.4 = [17 x i8] c"got mapping: %s\0A\00"
define void @ensure_no_bad_insns() {
%1 = alloca i32
%2 = alloca [100000 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
%11 = alloca [100 x i8]
%12 = load i32, i32* @O_RDONLY
%13 = call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %12)
store i32 %13, i32* %1
store i32 0, i32* %3
br label %14
14: ; preds = %0, %33
%15 = load i32, i32* %1
%16 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = sub i64 99999, %21
%23 = trunc i64 %22 to i32
%24 = call i32 @read(i32 %15, i8* %19, i32 %23)
store i32 %24, i32* %4
%25 = load i32, i32* %4
%26 = icmp slt i32 %25, 0
br i1 %26, label %27, label %29
27: ; preds = %14
%28 = call i32 @err(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %29
29: ; preds = %27, %14
%30 = load i32, i32* %4
%31 = icmp eq i32 %30, 0
br i1 %31, label %32, label %33
32: ; preds = %29
br label %37
33: ; preds = %29
%34 = load i32, i32* %4
%35 = load i32, i32* %3
%36 = add nsw i32 %35, %34
store i32 %36, i32* %3
br label %14
37: ; preds = %32
%38 = load i32, i32* %3
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 %39
store i8 0, i8* %40
%41 = getelementptr inbounds [100000 x i8], [100000 x i8]* %2, i64 0, i64 0
store i8* %41, i8** %5
store i64 0, i64* %6
store i64 0, i64* %7
br label %42
42: ; preds = %37, %126
%43 = load i8*, i8** %5
%44 = call i8* @strchr(i8* %43, i8 signext 10)
store i8* %44, i8** %8
%45 = load i8*, i8** %8
%46 = icmp ne i8* %45, null
br i1 %46, label %47, label %51
47: ; preds = %42
%48 = load i8*, i8** %8
store i8 0, i8* %48
%49 = load i8*, i8** %8
%50 = getelementptr inbounds i8, i8* %49, i32 1
store i8* %50, i8** %8
br label %51
51: ; preds = %47, %42
%52 = load i8*, i8** %5
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%54 = call i32 @sscanf(i8* %52, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64* %9, i64* %10, i8* %53)
%55 = icmp ne i32 %54, 3
br i1 %55, label %56, label %59
56: ; preds = %51
%57 = load i8*, i8** %5
%58 = call i32 @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %57)
br label %59
59: ; preds = %56, %51
%60 = load i8*, i8** %5
%61 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %60)
%62 = load i64, i64* %10
%63 = load i64, i64* %9
%64 = icmp ugt i64 %62, %63
%65 = zext i1 %64 to i32
%66 = call i32 @assert(i32 %65)
%67 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 2
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 45
br i1 %70, label %76, label %71
71: ; preds = %59
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 2
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp eq i32 %74, 120
br label %76
76: ; preds = %71, %59
%77 = phi i1 [ true, %59 ], [ %75, %71 ]
%78 = zext i1 %77 to i32
%79 = call i32 @assert(i32 %78)
%80 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 1
%81 = load i8, i8* %80
%82 = sext i8 %81 to i32
%83 = icmp eq i32 %82, 45
br i1 %83, label %89, label %84
84: ; preds = %76
%85 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 2
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 45
br label %89
89: ; preds = %84, %76
%90 = phi i1 [ true, %76 ], [ %88, %84 ]
%91 = zext i1 %90 to i32
%92 = call i32 @assert(i32 %91)
%93 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 2
%94 = load i8, i8* %93
%95 = sext i8 %94 to i32
%96 = icmp eq i32 %95, 120
br i1 %96, label %97, label %103
97: ; preds = %89
%98 = load i64, i64* %9
%99 = load i64, i64* %7
%100 = icmp eq i64 %98, %99
br i1 %100, label %101, label %103
101: ; preds = %97
%102 = load i64, i64* %10
store i64 %102, i64* %7
br label %115
103: ; preds = %97, %89
%104 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 2
%105 = load i8, i8* %104
%106 = sext i8 %105 to i32
%107 = icmp eq i32 %106, 120
br i1 %107, label %108, label %114
108: ; preds = %103
%109 = load i64, i64* %6
%110 = load i64, i64* %7
%111 = call i32 @ensure_no_bad_insns_in_range(i64 %109, i64 %110)
%112 = load i64, i64* %9
store i64 %112, i64* %6
%113 = load i64, i64* %10
store i64 %113, i64* %7
br label %114
114: ; preds = %108, %103
br label %115
115: ; preds = %114, %101
%116 = load i8*, i8** %8
store i8* %116, i8** %5
%117 = load i8*, i8** %5
%118 = icmp eq i8* %117, null
br i1 %118, label %125, label %119
119: ; preds = %115
%120 = load i8*, i8** %5
%121 = getelementptr inbounds i8, i8* %120, i64 0
%122 = load i8, i8* %121
%123 = sext i8 %122 to i32
%124 = icmp eq i32 %123, 0
br i1 %124, label %125, label %126
125: ; preds = %119, %115
br label %127
126: ; preds = %119
br label %42
127: ; preds = %125
%128 = load i64, i64* %6
%129 = load i64, i64* %7
%130 = call i32 @ensure_no_bad_insns_in_range(i64 %128, i64 %129)
%131 = load i32, i32* %1
%132 = call i32 @close(i32 %131)
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"/proc/self/maps\00"
@O_RDONLY = global i32 0
@.str.1 = [25 x i8] c"unable to read from maps\00"
@.str.2 = [11 x i8] c"%lx-%lx %s\00"
@.str.3 = [23 x i8] c"cannot parse line '%s'\00"
@.str.4 = [17 x i8] c"got mapping: %s\0A\00"
define void @ensure_no_bad_insns() {
%1 = alloca [100000 x i8]
%2 = alloca i64
%3 = alloca i64
%4 = alloca [100 x i8]
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @open(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 0
br label %8
8: ; preds = %17, %0
%9 = phi i32 [ 0, %0 ], [ %19, %17 ]
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 %10
%12 = sub i32 99999, %9
%13 = call i32 @read(i32 %6, i8* %11, i32 %12)
%14 = icmp slt i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %8
%16 = tail call i32 @err(i32 1, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %8
%18 = icmp eq i32 %13, 0
%19 = add nsw i32 %13, %9
br i1 %18, label %20, label %8
20: ; preds = %17
%21 = sext i32 %19 to i64
%22 = getelementptr inbounds [100000 x i8], [100000 x i8]* %1, i64 0, i64 %21
store i8 0, i8* %22
%23 = bitcast i64* %2 to i8*
%24 = bitcast i64* %3 to i8*
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 2
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 1
br label %28
28: ; preds = %81, %20
%29 = phi i8* [ %7, %20 ], [ %37, %81 ]
%30 = phi i64 [ 0, %20 ], [ %75, %81 ]
%31 = phi i64 [ 0, %20 ], [ %76, %81 ]
%32 = call i8* @strchr(i8* dereferenceable(1) %29, i8 signext 10)
%33 = icmp eq i8* %32, null
br i1 %33, label %36, label %34
34: ; preds = %28
store i8 0, i8* %32
%35 = getelementptr inbounds i8, i8* %32, i64 1
br label %36
36: ; preds = %34, %28
%37 = phi i8* [ %35, %34 ], [ null, %28 ]
%38 = call i32 @sscanf(i8* %29, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i64* %2, i64* %3, i8* %25)
%39 = icmp eq i32 %38, 3
br i1 %39, label %42, label %40
40: ; preds = %36
%41 = call i32 @errx(i32 1, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i8* %29)
br label %42
42: ; preds = %40, %36
%43 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* %29)
%44 = load i64, i64* %3
%45 = load i64, i64* %2
%46 = icmp ugt i64 %44, %45
%47 = zext i1 %46 to i32
%48 = call i32 @assert(i32 %47)
%49 = load i8, i8* %26
%50 = icmp eq i8 %49, 45
%51 = icmp eq i8 %49, 120
%52 = or i1 %50, %51
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = load i8, i8* %27
%56 = icmp eq i8 %55, 45
%57 = load i8, i8* %26
%58 = icmp eq i8 %57, 45
%59 = select i1 %56, i1 true, i1 %58
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = load i8, i8* %26
%63 = icmp eq i8 %62, 120
%64 = load i64, i64* %2
%65 = icmp eq i64 %64, %31
%66 = select i1 %63, i1 %65, i1 false
br i1 %66, label %67, label %69
67: ; preds = %42
%68 = load i64, i64* %3
br label %74
69: ; preds = %42
br i1 %63, label %70, label %74
70: ; preds = %69
%71 = call i32 @ensure_no_bad_insns_in_range(i64 %30, i64 %31)
%72 = load i64, i64* %2
%73 = load i64, i64* %3
br label %74
74: ; preds = %69, %70, %67
%75 = phi i64 [ %30, %67 ], [ %72, %70 ], [ %30, %69 ]
%76 = phi i64 [ %68, %67 ], [ %73, %70 ], [ %31, %69 ]
%77 = icmp eq i8* %37, null
br i1 %77, label %82, label %78
78: ; preds = %74
%79 = load i8, i8* %37
%80 = icmp eq i8 %79, 0
br i1 %80, label %82, label %81
81: ; preds = %78
br label %28
82: ; preds = %78, %74
%83 = call i32 @ensure_no_bad_insns_in_range(i64 %75, i64 %76)
%84 = call i32 @close(i32 %6)
ret void
}