#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*/ fprintf(int /*<<< orphan*/, char *, ...);
size_t st_aligned_alignment(char *);
int /*<<< orphan*/ st_aligned_free(char *);
char *st_aligned_malloc_impl(size_t, int);
size_t st_aligned_size(char *);
int /*<<< orphan*/ stderr;
int unit_test_st_aligned_malloc() {
  char *ptr = NULL;
  size_t size = 123;
  size_t alignment;
  int i;
  int ncase;
  fprintf(stderr, " Testing st_aligned_malloc...\n");
  ncase = 1;
  fprintf(stderr, "    Case %d...", ncase++);
  for (i = 4; i <= 12; i++) {
    alignment = 1 << i;
    ptr = st_aligned_malloc_impl(size, alignment);
    if (st_aligned_alignment(ptr) != alignment) {
      fprintf(stderr, "Failed\n");
      goto FAILED;
    }
    if (st_aligned_size(ptr) != size) {
      fprintf(stderr, "Failed\n");
      goto FAILED;
    }
    if (((size_t)ptr & (alignment - 1)) != 0) {
      fprintf(stderr, "Failed\n");
      goto FAILED;
    }
    do {
      if ((ptr) != NULL) {
        st_aligned_free(ptr);
        (ptr) = NULL;
      }
    } while (0);
    fprintf(stderr, "Passed\n");
  }
  fprintf(stderr, "    Case %d...", ncase++);
  for (i = 4; i <= 12; i++) {
    ptr = st_aligned_malloc_impl(size, (1 << i) - i);
    if (ptr != NULL) {
      fprintf(stderr, "Failed\n");
      goto FAILED;
    }
    do {
      if ((ptr) != NULL) {
        st_aligned_free(ptr);
        (ptr) = NULL;
      }
    } while (0);
    fprintf(stderr, "Passed\n");
  }
  return 0;
FAILED:
  do {
    if ((ptr) != NULL) {
      st_aligned_free(ptr);
      (ptr) = NULL;
    }
  } while (0);
  return -1;
}


x86 assembly (clang, -O0):
<unit_test_st_aligned_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x10(%rbp)
movq   $0x7b,-0x18(%rbp)
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x1,-0x28(%rbp)
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x4,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jg     12ba <unit_test_st_aligned_malloc+0x16a>
mov    -0x24(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rax
mov    %eax,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <st_aligned_alignment@plt>
cmp    -0x20(%rbp),%rax
je     120b <unit_test_st_aligned_malloc+0xbb>
mov    0x2dea(%rip),%rax
mov    (%rax),%edi
lea    0xe2f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1385 <unit_test_st_aligned_malloc+0x235>
mov    -0x10(%rbp),%rdi
call   1050 <st_aligned_size@plt>
cmp    -0x18(%rbp),%rax
je     123a <unit_test_st_aligned_malloc+0xea>
mov    0x2dbb(%rip),%rax
mov    (%rax),%edi
lea    0xe00(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1385 <unit_test_st_aligned_malloc+0x235>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    $0x1,%rcx
and    %rcx,%rax
cmp    $0x0,%rax
je     126f <unit_test_st_aligned_malloc+0x11f>
mov    0x2d86(%rip),%rax
mov    (%rax),%edi
lea    0xdcb(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1385 <unit_test_st_aligned_malloc+0x235>
jmp    1274 <unit_test_st_aligned_malloc+0x124>
cmpq   $0x0,-0x10(%rbp)
je     1290 <unit_test_st_aligned_malloc+0x140>
mov    -0x10(%rbp),%rdi
call   1030 <st_aligned_free@plt>
movq   $0x0,-0x10(%rbp)
jmp    1295 <unit_test_st_aligned_malloc+0x145>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
lea    0xd91(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11af <unit_test_st_aligned_malloc+0x5f>
mov    0x2d1f(%rip),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%edx
mov    %edx,%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
lea    0xd4a(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
movl   $0x4,-0x24(%rbp)
cmpl   $0xc,-0x24(%rbp)
jg     1379 <unit_test_st_aligned_malloc+0x229>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%ecx
mov    $0x1,%esi
shl    %cl,%esi
sub    -0x24(%rbp),%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     132e <unit_test_st_aligned_malloc+0x1de>
mov    0x2cc7(%rip),%rax
mov    (%rax),%edi
lea    0xd0c(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    1385 <unit_test_st_aligned_malloc+0x235>
jmp    1333 <unit_test_st_aligned_malloc+0x1e3>
cmpq   $0x0,-0x10(%rbp)
je     134f <unit_test_st_aligned_malloc+0x1ff>
mov    -0x10(%rbp),%rdi
call   1030 <st_aligned_free@plt>
movq   $0x0,-0x10(%rbp)
jmp    1354 <unit_test_st_aligned_malloc+0x204>
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
lea    0xcd2(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12e3 <unit_test_st_aligned_malloc+0x193>
movl   $0x0,-0x4(%rbp)
jmp    13b2 <unit_test_st_aligned_malloc+0x262>
jmp    138a <unit_test_st_aligned_malloc+0x23a>
cmpq   $0x0,-0x10(%rbp)
je     13a6 <unit_test_st_aligned_malloc+0x256>
mov    -0x10(%rbp),%rdi
call   1030 <st_aligned_free@plt>
movq   $0x0,-0x10(%rbp)
jmp    13ab <unit_test_st_aligned_malloc+0x25b>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<unit_test_st_aligned_malloc>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    0x2e81(%rip),%r12
mov    (%r12),%edi
lea    0xe96(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r12),%edi
lea    0xea3(%rip),%rsi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x4,%ebp
lea    0xea2(%rip),%r14
jmp    11b6 <unit_test_st_aligned_malloc+0x66>
cs nopw 0x0(%rax,%rax,1)
mov    (%r12),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
add    $0x1,%ebp
cmp    $0xd,%ebp
je     1221 <unit_test_st_aligned_malloc+0xd1>
mov    $0x1,%ebx
mov    %ebp,%ecx
shl    %cl,%ebx
mov    $0x7b,%edi
mov    %ebx,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1040 <st_aligned_alignment@plt>
cmp    %rbx,%rax
jne    1201 <unit_test_st_aligned_malloc+0xb1>
mov    %r15,%rdi
call   1050 <st_aligned_size@plt>
cmp    $0x7b,%rax
jne    1201 <unit_test_st_aligned_malloc+0xb1>
lea    -0x1(%rbx),%rax
test   %r15,%rax
jne    1201 <unit_test_st_aligned_malloc+0xb1>
test   %r15,%r15
je     11a0 <unit_test_st_aligned_malloc+0x50>
mov    %r15,%rdi
call   1030 <st_aligned_free@plt>
jmp    11a0 <unit_test_st_aligned_malloc+0x50>
mov    (%r12),%edi
lea    0xe22(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
test   %r15,%r15
jne    13bf <unit_test_st_aligned_malloc+0x26f>
jmp    13c7 <unit_test_st_aligned_malloc+0x277>
mov    (%r12),%edi
lea    0xdf3(%rip),%rsi
mov    $0x2,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0xc,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xdd8(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0x1b,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xdab(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0x3a,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xd7e(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0x79,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xd51(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0xf8,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xd24(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0x1f7,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xcfb(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0x3f6,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xcd2(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0x7f5,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
jne    13ad <unit_test_st_aligned_malloc+0x25d>
mov    (%r12),%edi
lea    0xca9(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    $0x7b,%edi
mov    $0xff4,%esi
call   1070 <st_aligned_malloc_impl@plt>
mov    %rax,%r15
test   %rax,%rax
je     13d7 <unit_test_st_aligned_malloc+0x287>
mov    (%r12),%edi
lea    0xc76(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r15,%rdi
call   1030 <st_aligned_free@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    (%r12),%edi
lea    0xc54(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
jmp    13cc <unit_test_st_aligned_malloc+0x27c>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [31 x i8] c" Testing st_aligned_malloc...\0A\00"
@.str.1 = [15 x i8] c" Case %d...\00"
@.str.2 = [8 x i8] c"Failed\0A\00"
@.str.3 = [8 x i8] c"Passed\0A\00"
define i32 @unit_test_st_aligned_malloc() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i8* null, i8** %2
store i64 123, i64* %3
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
%9 = load i32, i32* @stderr
%10 = load i32, i32* %6
%11 = add nsw i32 %10, 1
store i32 %11, i32* %6
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 4, i32* %5
br label %13
13: ; preds = %60, %0
%14 = load i32, i32* %5
%15 = icmp sle i32 %14, 12
br i1 %15, label %16, label %63
16: ; preds = %13
%17 = load i32, i32* %5
%18 = shl i32 1, %17
%19 = sext i32 %18 to i64
store i64 %19, i64* %4
%20 = load i64, i64* %3
%21 = load i64, i64* %4
%22 = trunc i64 %21 to i32
%23 = call i8* @st_aligned_malloc_impl(i64 %20, i32 %22)
store i8* %23, i8** %2
%24 = load i8*, i8** %2
%25 = call i64 @st_aligned_alignment(i8* %24)
%26 = load i64, i64* %4
%27 = icmp ne i64 %25, %26
br i1 %27, label %28, label %31
28: ; preds = %16
%29 = load i32, i32* @stderr
%30 = call i32 (i32, i8*, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %98
31: ; preds = %16
%32 = load i8*, i8** %2
%33 = call i64 @st_aligned_size(i8* %32)
%34 = load i64, i64* %3
%35 = icmp ne i64 %33, %34
br i1 %35, label %36, label %39
36: ; preds = %31
%37 = load i32, i32* @stderr
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %98
39: ; preds = %31
%40 = load i8*, i8** %2
%41 = ptrtoint i8* %40 to i64
%42 = load i64, i64* %4
%43 = sub i64 %42, 1
%44 = and i64 %41, %43
%45 = icmp ne i64 %44, 0
br i1 %45, label %46, label %49
46: ; preds = %39
%47 = load i32, i32* @stderr
%48 = call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %98
49: ; preds = %39
br label %50
50: ; preds = %49
%51 = load i8*, i8** %2
%52 = icmp ne i8* %51, null
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = load i8*, i8** %2
%55 = call i32 @st_aligned_free(i8* %54)
store i8* null, i8** %2
br label %56
56: ; preds = %53, %50
br label %57
57: ; preds = %56
%58 = load i32, i32* @stderr
%59 = call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %60
60: ; preds = %57
%61 = load i32, i32* %5
%62 = add nsw i32 %61, 1
store i32 %62, i32* %5
br label %13
63: ; preds = %13
%64 = load i32, i32* @stderr
%65 = load i32, i32* %6
%66 = add nsw i32 %65, 1
store i32 %66, i32* %6
%67 = call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %65)
store i32 4, i32* %5
br label %68
68: ; preds = %94, %63
%69 = load i32, i32* %5
%70 = icmp sle i32 %69, 12
br i1 %70, label %71, label %97
71: ; preds = %68
%72 = load i64, i64* %3
%73 = load i32, i32* %5
%74 = shl i32 1, %73
%75 = load i32, i32* %5
%76 = sub nsw i32 %74, %75
%77 = call i8* @st_aligned_malloc_impl(i64 %72, i32 %76)
store i8* %77, i8** %2
%78 = load i8*, i8** %2
%79 = icmp ne i8* %78, null
br i1 %79, label %80, label %83
80: ; preds = %71
%81 = load i32, i32* @stderr
%82 = call i32 (i32, i8*, ...) @fprintf(i32 %81, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %98
83: ; preds = %71
br label %84
84: ; preds = %83
%85 = load i8*, i8** %2
%86 = icmp ne i8* %85, null
br i1 %86, label %87, label %90
87: ; preds = %84
%88 = load i8*, i8** %2
%89 = call i32 @st_aligned_free(i8* %88)
store i8* null, i8** %2
br label %90
90: ; preds = %87, %84
br label %91
91: ; preds = %90
%92 = load i32, i32* @stderr
%93 = call i32 (i32, i8*, ...) @fprintf(i32 %92, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %94
94: ; preds = %91
%95 = load i32, i32* %5
%96 = add nsw i32 %95, 1
store i32 %96, i32* %5
br label %68
97: ; preds = %68
store i32 0, i32* %1
br label %107
98: ; preds = %80, %46, %36, %28
br label %99
99: ; preds = %98
%100 = load i8*, i8** %2
%101 = icmp ne i8* %100, null
br i1 %101, label %102, label %105
102: ; preds = %99
%103 = load i8*, i8** %2
%104 = call i32 @st_aligned_free(i8* %103)
store i8* null, i8** %2
br label %105
105: ; preds = %102, %99
br label %106
106: ; preds = %105
store i32 -1, i32* %1
br label %107
107: ; preds = %106, %97
%108 = load i32, i32* %1
ret i32 %108
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [31 x i8] c" Testing st_aligned_malloc...\0A\00"
@.str.1 = [15 x i8] c" Case %d...\00"
@.str.2 = [8 x i8] c"Failed\0A\00"
@.str.3 = [8 x i8] c"Passed\0A\00"
define i32 @unit_test_st_aligned_malloc() {
%1 = load i32, i32* @stderr
%2 = tail call i32 (i32, i8*, ...) @fprintf(i32 %1, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 1)
br label %5
5: ; preds = %0, %24
%6 = phi i32 [ 4, %0 ], [ %27, %24 ]
%7 = shl nuw nsw i32 1, %6
%8 = zext i32 %7 to i64
%9 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 %7)
%10 = tail call i64 @st_aligned_alignment(i8* %9)
%11 = icmp eq i64 %10, %8
br i1 %11, label %12, label %81
12: ; preds = %5
%13 = tail call i64 @st_aligned_size(i8* %9)
%14 = icmp eq i64 %13, 123
br i1 %14, label %15, label %81
15: ; preds = %12
%16 = ptrtoint i8* %9 to i64
%17 = add nsw i64 %8, -1
%18 = and i64 %17, %16
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %81
20: ; preds = %15
%21 = icmp eq i8* %9, null
br i1 %21, label %24, label %22
22: ; preds = %20
%23 = tail call i32 @st_aligned_free(i8* %9)
br label %24
24: ; preds = %22, %20
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%27 = add nuw nsw i32 %6, 1
%28 = icmp eq i32 %27, 13
br i1 %28, label %29, label %5
29: ; preds = %24
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 2)
%32 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 12)
%33 = icmp eq i8* %32, null
br i1 %33, label %38, label %34
34: ; preds = %73, %68, %63, %58, %53, %48, %43, %38, %29
%35 = phi i8* [ %32, %29 ], [ %41, %38 ], [ %46, %43 ], [ %51, %48 ], [ %56, %53 ], [ %61, %58 ], [ %66, %63 ], [ %71, %68 ], [ %76, %73 ]
%36 = load i32, i32* @stderr
%37 = tail call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
br label %85
38: ; preds = %29
%39 = load i32, i32* @stderr
%40 = tail call i32 (i32, i8*, ...) @fprintf(i32 %39, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%41 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 27)
%42 = icmp eq i8* %41, null
br i1 %42, label %43, label %34
43: ; preds = %38
%44 = load i32, i32* @stderr
%45 = tail call i32 (i32, i8*, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%46 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 58)
%47 = icmp eq i8* %46, null
br i1 %47, label %48, label %34
48: ; preds = %43
%49 = load i32, i32* @stderr
%50 = tail call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%51 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 121)
%52 = icmp eq i8* %51, null
br i1 %52, label %53, label %34
53: ; preds = %48
%54 = load i32, i32* @stderr
%55 = tail call i32 (i32, i8*, ...) @fprintf(i32 %54, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%56 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 248)
%57 = icmp eq i8* %56, null
br i1 %57, label %58, label %34
58: ; preds = %53
%59 = load i32, i32* @stderr
%60 = tail call i32 (i32, i8*, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%61 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 503)
%62 = icmp eq i8* %61, null
br i1 %62, label %63, label %34
63: ; preds = %58
%64 = load i32, i32* @stderr
%65 = tail call i32 (i32, i8*, ...) @fprintf(i32 %64, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%66 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 1014)
%67 = icmp eq i8* %66, null
br i1 %67, label %68, label %34
68: ; preds = %63
%69 = load i32, i32* @stderr
%70 = tail call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%71 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 2037)
%72 = icmp eq i8* %71, null
br i1 %72, label %73, label %34
73: ; preds = %68
%74 = load i32, i32* @stderr
%75 = tail call i32 (i32, i8*, ...) @fprintf(i32 %74, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%76 = tail call i8* @st_aligned_malloc_impl(i64 123, i32 4084)
%77 = icmp eq i8* %76, null
br i1 %77, label %78, label %34
78: ; preds = %73
%79 = load i32, i32* @stderr
%80 = tail call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %88
81: ; preds = %15, %12, %5
%82 = load i32, i32* @stderr
%83 = tail call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%84 = icmp eq i8* %9, null
br i1 %84, label %88, label %85
85: ; preds = %34, %81
%86 = phi i8* [ %35, %34 ], [ %9, %81 ]
%87 = tail call i32 @st_aligned_free(i8* %86)
br label %88
88: ; preds = %78, %81, %85
%89 = phi i32 [ -1, %85 ], [ -1, %81 ], [ 0, %78 ]
ret i32 %89
}