#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 */
struct __UTAC__EXCEPTION {
  int dummy;
};
struct __UTAC__CFLOW_FUNC {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(void *);
void __utac__exception__cf_handler_free(void *exception) {
  struct __UTAC__EXCEPTION *excep;
  struct __UTAC__CFLOW_FUNC *cf;
  struct __UTAC__CFLOW_FUNC *tmp;
  unsigned long __cil_tmp5;
  unsigned long __cil_tmp6;
  struct __UTAC__CFLOW_FUNC *__cil_tmp7;
  unsigned long __cil_tmp8;
  unsigned long __cil_tmp9;
  unsigned long __cil_tmp10;
  unsigned long __cil_tmp11;
  void *__cil_tmp12;
  unsigned long __cil_tmp13;
  unsigned long __cil_tmp14;
  struct __UTAC__CFLOW_FUNC **mem_15;
  struct __UTAC__CFLOW_FUNC **mem_16;
  struct __UTAC__CFLOW_FUNC **mem_17;
  {
    excep = (struct __UTAC__EXCEPTION *)exception;
    __cil_tmp5 = (unsigned long)excep;
    __cil_tmp6 = __cil_tmp5 + 24;
    mem_15 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp6;
    cf = *mem_15;
    {
      while (1) {
      while_1_continue:;
        {
          __cil_tmp7 = (struct __UTAC__CFLOW_FUNC *)0;
          __cil_tmp8 = (unsigned long)__cil_tmp7;
          __cil_tmp9 = (unsigned long)cf;
          if (__cil_tmp9 != __cil_tmp8) {
          } else {
            goto while_1_break;
          }
        }
        {
          tmp = cf;
          __cil_tmp10 = (unsigned long)cf;
          __cil_tmp11 = __cil_tmp10 + 16;
          mem_16 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp11;
          cf = *mem_16;
          __cil_tmp12 = (void *)tmp;
          free(__cil_tmp12);
        }
      }
    while_1_break:;
    }
    __cil_tmp13 = (unsigned long)excep;
    __cil_tmp14 = __cil_tmp13 + 24;
    mem_17 = (struct __UTAC__CFLOW_FUNC **)__cil_tmp14;
    *mem_17 = (struct __UTAC__CFLOW_FUNC *)0;
    return;
  }
}


x86 assembly (clang, -O0):
<__utac__exception__cf_handler_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
jmp    1153 <__utac__exception__cf_handler_free+0x43>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
cmp    -0x40(%rbp),%rax
je     117e <__utac__exception__cf_handler_free+0x6e>
jmp    1183 <__utac__exception__cf_handler_free+0x73>
jmp    11c8 <__utac__exception__cf_handler_free+0xb8>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x80(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rdi
call   1030 <free@plt>
jmp    114e <__utac__exception__cf_handler_free+0x3e>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x88(%rbp),%rax
movq   $0x0,(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__utac__exception__cf_handler_free>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x18(%rdi),%rdi
test   %rdi,%rdi
je     1131 <__utac__exception__cf_handler_free+0x21>
mov    0x10(%rdi),%rbx
call   1030 <free@plt>
mov    %rbx,%rdi
test   %rbx,%rbx
jne    1120 <__utac__exception__cf_handler_free+0x10>
movq   $0x0,0x18(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.__UTAC__EXCEPTION = type { i32 }
%struct.__UTAC__CFLOW_FUNC = type { i32 }
define void @__utac__exception__cf_handler_free(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.__UTAC__EXCEPTION*
%4 = alloca %struct.__UTAC__CFLOW_FUNC*
%5 = alloca %struct.__UTAC__CFLOW_FUNC*
%6 = alloca i64
%7 = alloca i64
%8 = alloca %struct.__UTAC__CFLOW_FUNC*
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i64
%16 = alloca %struct.__UTAC__CFLOW_FUNC**
%17 = alloca %struct.__UTAC__CFLOW_FUNC**
%18 = alloca %struct.__UTAC__CFLOW_FUNC**
store i8* %0, i8** %2
%19 = load i8*, i8** %2
%20 = bitcast i8* %19 to %struct.__UTAC__EXCEPTION*
store %struct.__UTAC__EXCEPTION* %20, %struct.__UTAC__EXCEPTION** %3
%21 = load %struct.__UTAC__EXCEPTION*, %struct.__UTAC__EXCEPTION** %3
%22 = ptrtoint %struct.__UTAC__EXCEPTION* %21 to i64
store i64 %22, i64* %6
%23 = load i64, i64* %6
%24 = add i64 %23, 24
store i64 %24, i64* %7
%25 = load i64, i64* %7
%26 = inttoptr i64 %25 to %struct.__UTAC__CFLOW_FUNC**
store %struct.__UTAC__CFLOW_FUNC** %26, %struct.__UTAC__CFLOW_FUNC*** %16
%27 = load %struct.__UTAC__CFLOW_FUNC**, %struct.__UTAC__CFLOW_FUNC*** %16
%28 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %27
store %struct.__UTAC__CFLOW_FUNC* %28, %struct.__UTAC__CFLOW_FUNC** %4
br label %29
29: ; preds = %1, %40
br label %30
30: ; preds = %29
store %struct.__UTAC__CFLOW_FUNC* null, %struct.__UTAC__CFLOW_FUNC** %8
%31 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %8
%32 = ptrtoint %struct.__UTAC__CFLOW_FUNC* %31 to i64
store i64 %32, i64* %9
%33 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %4
%34 = ptrtoint %struct.__UTAC__CFLOW_FUNC* %33 to i64
store i64 %34, i64* %10
%35 = load i64, i64* %10
%36 = load i64, i64* %9
%37 = icmp ne i64 %35, %36
br i1 %37, label %38, label %39
38: ; preds = %30
br label %40
39: ; preds = %30
br label %54
40: ; preds = %38
%41 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %4
store %struct.__UTAC__CFLOW_FUNC* %41, %struct.__UTAC__CFLOW_FUNC** %5
%42 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %4
%43 = ptrtoint %struct.__UTAC__CFLOW_FUNC* %42 to i64
store i64 %43, i64* %11
%44 = load i64, i64* %11
%45 = add i64 %44, 16
store i64 %45, i64* %12
%46 = load i64, i64* %12
%47 = inttoptr i64 %46 to %struct.__UTAC__CFLOW_FUNC**
store %struct.__UTAC__CFLOW_FUNC** %47, %struct.__UTAC__CFLOW_FUNC*** %17
%48 = load %struct.__UTAC__CFLOW_FUNC**, %struct.__UTAC__CFLOW_FUNC*** %17
%49 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %48
store %struct.__UTAC__CFLOW_FUNC* %49, %struct.__UTAC__CFLOW_FUNC** %4
%50 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %5
%51 = bitcast %struct.__UTAC__CFLOW_FUNC* %50 to i8*
store i8* %51, i8** %13
%52 = load i8*, i8** %13
%53 = call i32 @free(i8* %52)
br label %29
54: ; preds = %39
%55 = load %struct.__UTAC__EXCEPTION*, %struct.__UTAC__EXCEPTION** %3
%56 = ptrtoint %struct.__UTAC__EXCEPTION* %55 to i64
store i64 %56, i64* %14
%57 = load i64, i64* %14
%58 = add i64 %57, 24
store i64 %58, i64* %15
%59 = load i64, i64* %15
%60 = inttoptr i64 %59 to %struct.__UTAC__CFLOW_FUNC**
store %struct.__UTAC__CFLOW_FUNC** %60, %struct.__UTAC__CFLOW_FUNC*** %18
%61 = load %struct.__UTAC__CFLOW_FUNC**, %struct.__UTAC__CFLOW_FUNC*** %18
store %struct.__UTAC__CFLOW_FUNC* null, %struct.__UTAC__CFLOW_FUNC** %61
ret void
}

LLVM IR (-O2):
%struct.__UTAC__CFLOW_FUNC = type { i32 }
define void @__utac__exception__cf_handler_free(i8* %0) {
%2 = ptrtoint i8* %0 to i64
%3 = add i64 %2, 24
%4 = inttoptr i64 %3 to %struct.__UTAC__CFLOW_FUNC**
%5 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %4
%6 = icmp eq %struct.__UTAC__CFLOW_FUNC* %5, null
br i1 %6, label %16, label %7
7: ; preds = %1, %7
%8 = phi %struct.__UTAC__CFLOW_FUNC* [ %12, %7 ], [ %5, %1 ]
%9 = ptrtoint %struct.__UTAC__CFLOW_FUNC* %8 to i64
%10 = add i64 %9, 16
%11 = inttoptr i64 %10 to %struct.__UTAC__CFLOW_FUNC**
%12 = load %struct.__UTAC__CFLOW_FUNC*, %struct.__UTAC__CFLOW_FUNC** %11
%13 = bitcast %struct.__UTAC__CFLOW_FUNC* %8 to i8*
%14 = tail call i32 @free(i8* %13)
%15 = icmp eq %struct.__UTAC__CFLOW_FUNC* %12, null
br i1 %15, label %16, label %7
16: ; preds = %7, %1
store %struct.__UTAC__CFLOW_FUNC* null, %struct.__UTAC__CFLOW_FUNC** %4
ret void
}