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

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *malloc(unsigned long);
int /*<<< orphan*/ printf(char *, ...);
void test4(void) {
  void *x, *y, *z;
  unsigned long lx, ly, lz, overhead, zsize;
  printf("Entering malloc test 4.\n");
  printf("This test is intended for first/best-fit based mallocs.\n");
  printf("This test may not work correctly if run after other tests.\n");
  printf("Testing free list coalescing:\n");
  x = malloc(72);
  if (x == NULL) {
    printf("FAILED: malloc(%u) failed\n", 72);
    return;
  }
  y = malloc(896);
  if (y == NULL) {
    printf("FAILED: malloc(%u) failed\n", 896);
    return;
  }
  if (sizeof(unsigned long) < sizeof(void *)) {
    printf("Buh? I can't fit a void * in an unsigned long\n");
    printf("ENVIRONMENT FAILED...\n");
    return;
  }
  lx = (unsigned long)x;
  ly = (unsigned long)y;
  printf("x is 0x%lx; y is 0x%lx\n", lx, ly);
  if (lx == ly) {
    printf("FAIL: x == y\n");
    return;
  }
  if (lx < ly && lx + 72 > ly) {
    printf("FAIL: y starts within x\n");
    return;
  }
  if (ly < lx && ly + 896 > lx) {
    printf("FAIL: x starts within y\n");
    return;
  }
  if (ly < lx) {
    printf("TEST UNSUITABLE: y is below x\n");
    return;
  }
  overhead = ly - (lx + 72);
  printf("Apparent block overhead: %lu\n", overhead);
  if (overhead > 256) {
    printf("TEST UNSUITABLE: block overhead absurdly large.\n");
    return;
  }
  if (overhead > 32) {
    printf("FAIL: block overhead is too large.\n");
    return;
  }
  printf("Freeing blocks...\n");
  free(x);
  free(y);
  zsize = 72 + 896 + overhead;
  printf("Now allocating %lu bytes... should reuse the space.\n", zsize);
  z = malloc(zsize);
  if (z == NULL) {
    printf("FAIL: Allocation failed...\n");
    return;
  }
  lz = (unsigned long)z;
  printf("z is 0x%lx (x was 0x%lx, y 0x%lx)\n", lz, lx, ly);
  if (lz == lx) {
    printf("Passed.\n");
  } else {
    printf("Failed.\n");
  }
  free(z);
}


x86 assembly (clang, -O0):
<test4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf25(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x48,%edi
call   1050 <malloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    11a1 <test4+0x71>
lea    0xf1d(%rip),%rdi
mov    $0x48,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    $0x380,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11d2 <test4+0xa2>
lea    0xeec(%rip),%rdi
mov    $0x380,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1219 <test4+0xe9>
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jae    124c <test4+0x11c>
mov    -0x20(%rbp),%rax
add    $0x48,%rax
cmp    -0x28(%rbp),%rax
jbe    124c <test4+0x11c>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1281 <test4+0x151>
mov    -0x28(%rbp),%rax
add    $0x380,%rax
cmp    -0x20(%rbp),%rax
jbe    1281 <test4+0x151>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    -0x28(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    12a2 <test4+0x172>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
add    $0x48,%rcx
sub    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rsi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpq   $0x100,-0x38(%rbp)
jbe    12e8 <test4+0x1b8>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
cmpq   $0x20,-0x38(%rbp)
jbe    1306 <test4+0x1d6>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x38(%rbp),%rax
add    $0x3c8,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rsi
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1371 <test4+0x241>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13cb <test4+0x29b>
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%rax
cmp    -0x20(%rbp),%rax
jne    13b4 <test4+0x284>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13c2 <test4+0x292>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test4>:
push   %r15
push   %r14
push   %rbx
lea    0xf5d(%rip),%rdi
call   1040 <puts@plt>
lea    0xf69(%rip),%rdi
call   1040 <puts@plt>
lea    0xf95(%rip),%rdi
call   1040 <puts@plt>
lea    0xfc4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x48,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     11cc <test4+0x8c>
mov    %rax,%rbx
mov    $0x380,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     11da <test4+0x9a>
mov    %rax,%r14
lea    0xe7b(%rip),%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %r14,%rbx
je     11f2 <test4+0xb2>
lea    0x48(%rbx),%rax
cmp    %r14,%rbx
jae    11fe <test4+0xbe>
cmp    %r14,%rax
jbe    11fe <test4+0xbe>
lea    0x1051(%rip),%rdi
jmp    12f3 <test4+0x1b3>
lea    0xe2d(%rip),%rdi
mov    $0x48,%esi
jmp    11e6 <test4+0xa6>
lea    0xe1f(%rip),%rdi
mov    $0x380,%esi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <printf@plt>
lea    0x1037(%rip),%rdi
jmp    12f3 <test4+0x1b3>
cmp    %rbx,%r14
jae    121b <test4+0xdb>
lea    0x380(%r14),%rcx
cmp    %rbx,%rcx
jbe    121b <test4+0xdb>
lea    0xfea(%rip),%rdi
jmp    12f3 <test4+0x1b3>
cmp    %rbx,%r14
jae    122c <test4+0xec>
lea    0xfbb(%rip),%rdi
jmp    12f3 <test4+0x1b3>
mov    %r14,%r15
sub    %rax,%r15
lea    0xdfa(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x101,%r15
jb     1258 <test4+0x118>
lea    0xf5f(%rip),%rdi
jmp    12f3 <test4+0x1b3>
cmp    $0x21,%r15
jb     126a <test4+0x12a>
lea    0xf2a(%rip),%rdi
jmp    12f3 <test4+0x1b3>
lea    0xee1(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
add    $0x3c8,%r15
lea    0xdbd(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
call   1060 <malloc@plt>
test   %rax,%rax
je     12ec <test4+0x1ac>
mov    %rax,%r15
lea    0xdd1(%rip),%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    %rbx,%r15
lea    0xe9d(%rip),%rax
lea    0xe8e(%rip),%rdi
cmove  %rax,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>
lea    0xe81(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"Entering malloc test 4.\0A\00"
@.str.1 = [57 x i8] c"This test is intended for first/best-fit based mallocs.\0A\00"
@.str.2 = [60 x i8] c"This test may not work correctly if run after other tests.\0A\00"
@.str.3 = [31 x i8] c"Testing free list coalescing:\0A\00"
@.str.4 = [27 x i8] c"FAILED: malloc(%u) failed\0A\00"
@.str.5 = [24 x i8] c"x is 0x%lx; y is 0x%lx\0A\00"
@.str.6 = [14 x i8] c"FAIL: x == y\0A\00"
@.str.7 = [25 x i8] c"FAIL: y starts within x\0A\00"
@.str.8 = [25 x i8] c"FAIL: x starts within y\0A\00"
@.str.9 = [31 x i8] c"TEST UNSUITABLE: y is below x\0A\00"
@.str.10 = [30 x i8] c"Apparent block overhead: %lu\0A\00"
@.str.11 = [49 x i8] c"TEST UNSUITABLE: block overhead absurdly large.\0A\00"
@.str.12 = [36 x i8] c"FAIL: block overhead is too large.\0A\00"
@.str.13 = [19 x i8] c"Freeing blocks...\0A\00"
@.str.14 = [53 x i8] c"Now allocating %lu bytes... should reuse the space.\0A\00"
@.str.15 = [28 x i8] c"FAIL: Allocation failed...\0A\00"
@.str.16 = [35 x i8] c"z is 0x%lx (x was 0x%lx, y 0x%lx)\0A\00"
@.str.17 = [9 x i8] c"Passed.\0A\00"
@.str.18 = [9 x i8] c"Failed.\0A\00"
define void @test4() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
%13 = call i8* @malloc(i64 72)
store i8* %13, i8** %1
%14 = load i8*, i8** %1
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 72)
br label %114
18: ; preds = %0
%19 = call i8* @malloc(i64 896)
store i8* %19, i8** %2
%20 = load i8*, i8** %2
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 896)
br label %114
24: ; preds = %18
%25 = load i8*, i8** %1
%26 = ptrtoint i8* %25 to i64
store i64 %26, i64* %4
%27 = load i8*, i8** %2
%28 = ptrtoint i8* %27 to i64
store i64 %28, i64* %5
%29 = load i64, i64* %4
%30 = load i64, i64* %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i64 %29, i64 %30)
%32 = load i64, i64* %4
%33 = load i64, i64* %5
%34 = icmp eq i64 %32, %33
br i1 %34, label %35, label %37
35: ; preds = %24
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %114
37: ; preds = %24
%38 = load i64, i64* %4
%39 = load i64, i64* %5
%40 = icmp ult i64 %38, %39
br i1 %40, label %41, label %48
41: ; preds = %37
%42 = load i64, i64* %4
%43 = add i64 %42, 72
%44 = load i64, i64* %5
%45 = icmp ugt i64 %43, %44
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0))
br label %114
48: ; preds = %41, %37
%49 = load i64, i64* %5
%50 = load i64, i64* %4
%51 = icmp ult i64 %49, %50
br i1 %51, label %52, label %59
52: ; preds = %48
%53 = load i64, i64* %5
%54 = add i64 %53, 896
%55 = load i64, i64* %4
%56 = icmp ugt i64 %54, %55
br i1 %56, label %57, label %59
57: ; preds = %52
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
br label %114
59: ; preds = %52, %48
%60 = load i64, i64* %5
%61 = load i64, i64* %4
%62 = icmp ult i64 %60, %61
br i1 %62, label %63, label %65
63: ; preds = %59
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.9, i64 0, i64 0))
br label %114
65: ; preds = %59
%66 = load i64, i64* %5
%67 = load i64, i64* %4
%68 = add i64 %67, 72
%69 = sub i64 %66, %68
store i64 %69, i64* %7
%70 = load i64, i64* %7
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i64 %70)
%72 = load i64, i64* %7
%73 = icmp ugt i64 %72, 256
br i1 %73, label %74, label %76
74: ; preds = %65
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.11, i64 0, i64 0))
br label %114
76: ; preds = %65
%77 = load i64, i64* %7
%78 = icmp ugt i64 %77, 32
br i1 %78, label %79, label %81
79: ; preds = %76
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0))
br label %114
81: ; preds = %76
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
%83 = load i8*, i8** %1
%84 = call i32 @free(i8* %83)
%85 = load i8*, i8** %2
%86 = call i32 @free(i8* %85)
%87 = load i64, i64* %7
%88 = add i64 968, %87
store i64 %88, i64* %8
%89 = load i64, i64* %8
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.14, i64 0, i64 0), i64 %89)
%91 = load i64, i64* %8
%92 = call i8* @malloc(i64 %91)
store i8* %92, i8** %3
%93 = load i8*, i8** %3
%94 = icmp eq i8* %93, null
br i1 %94, label %95, label %97
95: ; preds = %81
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0))
br label %114
97: ; preds = %81
%98 = load i8*, i8** %3
%99 = ptrtoint i8* %98 to i64
store i64 %99, i64* %6
%100 = load i64, i64* %6
%101 = load i64, i64* %4
%102 = load i64, i64* %5
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.16, i64 0, i64 0), i64 %100, i64 %101, i64 %102)
%104 = load i64, i64* %6
%105 = load i64, i64* %4
%106 = icmp eq i64 %104, %105
br i1 %106, label %107, label %109
107: ; preds = %97
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
br label %111
109: ; preds = %97
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
br label %111
111: ; preds = %109, %107
%112 = load i8*, i8** %3
%113 = call i32 @free(i8* %112)
br label %114
114: ; preds = %111, %95, %79, %74, %63, %57, %46, %35, %22, %16
ret void
}

LLVM IR (-O2):
@.str.4 = [27 x i8] c"FAILED: malloc(%u) failed\0A\00"
@.str.5 = [24 x i8] c"x is 0x%lx; y is 0x%lx\0A\00"
@.str.10 = [30 x i8] c"Apparent block overhead: %lu\0A\00"
@.str.14 = [53 x i8] c"Now allocating %lu bytes... should reuse the space.\0A\00"
@.str.16 = [35 x i8] c"z is 0x%lx (x was 0x%lx, y 0x%lx)\0A\00"
@str = [24 x i8] c"Entering malloc test 4.\00"
@str.19 = [56 x i8] c"This test is intended for first/best-fit based mallocs.\00"
@str.20 = [59 x i8] c"This test may not work correctly if run after other tests.\00"
@str.21 = [30 x i8] c"Testing free list coalescing:\00"
@str.22 = [18 x i8] c"Freeing blocks...\00"
@str.23 = [8 x i8] c"Failed.\00"
@str.24 = [8 x i8] c"Passed.\00"
@str.25 = [27 x i8] c"FAIL: Allocation failed...\00"
@str.26 = [35 x i8] c"FAIL: block overhead is too large.\00"
@str.27 = [48 x i8] c"TEST UNSUITABLE: block overhead absurdly large.\00"
@str.28 = [30 x i8] c"TEST UNSUITABLE: y is below x\00"
@str.29 = [24 x i8] c"FAIL: x starts within y\00"
@str.30 = [24 x i8] c"FAIL: y starts within x\00"
@str.31 = [13 x i8] c"FAIL: x == y\00"
define void @test4() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.19, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.20, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.21, i64 0, i64 0))
%5 = tail call dereferenceable_or_null(72) i8* @malloc(i64 72)
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 72)
br label %65
9: ; preds = %0
%10 = tail call dereferenceable_or_null(896) i8* @malloc(i64 896)
%11 = icmp eq i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 896)
br label %65
14: ; preds = %9
%15 = ptrtoint i8* %5 to i64
%16 = ptrtoint i8* %10 to i64
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.5, i64 0, i64 0), i64 %15, i64 %16)
%18 = icmp eq i8* %5, %10
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.31, i64 0, i64 0))
br label %65
21: ; preds = %14
%22 = icmp ult i8* %5, %10
%23 = add i64 %15, 72
%24 = icmp ugt i64 %23, %16
%25 = and i1 %22, %24
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.30, i64 0, i64 0))
br label %65
28: ; preds = %21
%29 = icmp ult i8* %10, %5
%30 = add i64 %16, 896
%31 = icmp ugt i64 %30, %15
%32 = and i1 %29, %31
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.29, i64 0, i64 0))
br label %65
35: ; preds = %28
br i1 %29, label %36, label %38
36: ; preds = %35
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.28, i64 0, i64 0))
br label %65
38: ; preds = %35
%39 = sub i64 %16, %23
%40 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i64 %39)
%41 = icmp ugt i64 %39, 256
br i1 %41, label %42, label %44
42: ; preds = %38
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.27, i64 0, i64 0))
br label %65
44: ; preds = %38
%45 = icmp ugt i64 %39, 32
br i1 %45, label %46, label %48
46: ; preds = %44
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.26, i64 0, i64 0))
br label %65
48: ; preds = %44
%49 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.22, i64 0, i64 0))
%50 = tail call i32 @free(i8* %5)
%51 = tail call i32 @free(i8* %10)
%52 = add nuw nsw i64 %39, 968
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.14, i64 0, i64 0), i64 %52)
%54 = tail call i8* @malloc(i64 %52)
%55 = icmp eq i8* %54, null
br i1 %55, label %56, label %58
56: ; preds = %48
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str.25, i64 0, i64 0))
br label %65
58: ; preds = %48
%59 = ptrtoint i8* %54 to i64
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.16, i64 0, i64 0), i64 %59, i64 %15, i64 %16)
%61 = icmp eq i8* %54, %5
%62 = select i1 %61, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.24, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.23, i64 0, i64 0)
%63 = tail call i32 @puts(i8* dereferenceable(1) %62)
%64 = tail call i32 @free(i8* %54)
br label %65
65: ; preds = %58, %56, %46, %42, %36, %33, %26, %19, %12, %7
ret void
}