#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 */
typedef struct TYPE_8__ TYPE_1__;

/* Type definitions */
struct TYPE_8__ {
  int address_length;
  int number_length;
  int name_length;
  int data_length;
  struct TYPE_8__ *data;
  struct TYPE_8__ *name;
  struct TYPE_8__ *number;
  struct TYPE_8__ *address;
  int /*<<< orphan*/ family;
};
typedef TYPE_1__ Xauth;

/* Variables and functions */
int /*<<< orphan*/ free(TYPE_1__ *);
void *malloc(int);
int /*<<< orphan*/ memcpy(TYPE_1__ *, TYPE_1__ *, int);
int /*<<< orphan*/ memset(TYPE_1__ *, int /*<<< orphan*/, int);
Xauth *copyAuth(Xauth *auth) {
  Xauth *a;
  a = (Xauth *)malloc(sizeof(Xauth));
  if (a == NULL) {
    return NULL;
  }
  memset(a, 0, sizeof(Xauth));
  a->family = auth->family;
  if (auth->address_length != 0) {
    a->address = malloc(auth->address_length);
    if (a->address == NULL) {
      free(a);
      return NULL;
    }
    memcpy(a->address, auth->address, auth->address_length);
    a->address_length = auth->address_length;
  }
  if (auth->number_length != 0) {
    a->number = malloc(auth->number_length);
    if (a->number == NULL) {
      free(a->address);
      free(a);
      return NULL;
    }
    memcpy(a->number, auth->number, auth->number_length);
    a->number_length = auth->number_length;
  }
  if (auth->name_length != 0) {
    a->name = malloc(auth->name_length);
    if (a->name == NULL) {
      free(a->address);
      free(a->number);
      free(a);
      return NULL;
    }
    memcpy(a->name, auth->name, auth->name_length);
    a->name_length = auth->name_length;
  }
  if (auth->data_length != 0) {
    a->data = malloc(auth->data_length);
    if (a->data == NULL) {
      free(a->address);
      free(a->number);
      free(a->name);
      free(a);
      return NULL;
    }
    memcpy(a->data, auth->data, auth->data_length);
    a->data_length = auth->data_length;
  }
  return a;
}


x86 assembly (clang, -O0):
<copyAuth>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    $0x38,%edi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1172 <copyAuth+0x32>
movq   $0x0,-0x8(%rbp)
jmp    13b1 <copyAuth+0x271>
mov    -0x18(%rbp),%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1040 <memset@plt>
mov    -0x10(%rbp),%rax
mov    0x30(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,(%rax)
je     11ff <copyAuth+0xbf>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x28(%rax)
jne    11d8 <copyAuth+0x98>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    13b1 <copyAuth+0x271>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     1280 <copyAuth+0x140>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x20(%rax)
jne    1256 <copyAuth+0x116>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    13b1 <copyAuth+0x271>
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,0x8(%rax)
je     130e <copyAuth+0x1ce>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x18(%rax)
jne    12e4 <copyAuth+0x1a4>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    13b1 <copyAuth+0x271>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
cmpl   $0x0,0xc(%rax)
je     13a9 <copyAuth+0x269>
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x10(%rax)
jne    137f <copyAuth+0x23f>
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    13b1 <copyAuth+0x271>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%edx
call   1050 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    0xc(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyAuth>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%r14
mov    $0x38,%edi
call   1060 <malloc@plt>
test   %rax,%rax
je     1262 <copyAuth+0x122>
mov    %rax,%rbx
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1040 <memset@plt>
mov    0x30(%r14),%eax
mov    %eax,0x30(%rbx)
mov    (%r14),%ebp
test   %ebp,%ebp
je     11a1 <copyAuth+0x61>
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x28(%rbx)
test   %rax,%rax
je     125a <copyAuth+0x11a>
mov    0x28(%r14),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    (%r14),%eax
mov    %eax,(%rbx)
mov    0x4(%r14),%ebp
test   %ebp,%ebp
je     11ce <copyAuth+0x8e>
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x20(%rbx)
test   %rax,%rax
je     122a <copyAuth+0xea>
mov    0x20(%r14),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    0x4(%r14),%eax
mov    %eax,0x4(%rbx)
mov    0x8(%r14),%ebp
test   %ebp,%ebp
je     11fb <copyAuth+0xbb>
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x18(%rbx)
test   %rax,%rax
je     1230 <copyAuth+0xf0>
mov    0x18(%r14),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    0x8(%r14),%eax
mov    %eax,0x8(%rbx)
mov    0xc(%r14),%ebp
test   %ebp,%ebp
je     1264 <copyAuth+0x124>
mov    %ebp,%edi
call   1060 <malloc@plt>
mov    %rax,0x10(%rbx)
test   %rax,%rax
je     123f <copyAuth+0xff>
mov    0x10(%r14),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1050 <memcpy@plt>
mov    0xc(%r14),%eax
mov    %eax,0xc(%rbx)
jmp    1264 <copyAuth+0x124>
mov    0x28(%rbx),%rdi
jmp    1255 <copyAuth+0x115>
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
jmp    1255 <copyAuth+0x115>
mov    0x28(%rbx),%rdi
call   1030 <free@plt>
mov    0x20(%rbx),%rdi
call   1030 <free@plt>
mov    0x18(%rbx),%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_8__ = type { i32, i32, i32, i32, %struct.TYPE_8__*, %struct.TYPE_8__*, %struct.TYPE_8__*, %struct.TYPE_8__*, i32 }
define %struct.TYPE_8__* @copyAuth(%struct.TYPE_8__* %0) {
%2 = alloca %struct.TYPE_8__*
%3 = alloca %struct.TYPE_8__*
%4 = alloca %struct.TYPE_8__*
store %struct.TYPE_8__* %0, %struct.TYPE_8__** %3
%5 = call i8* @malloc(i32 56)
%6 = bitcast i8* %5 to %struct.TYPE_8__*
store %struct.TYPE_8__* %6, %struct.TYPE_8__** %4
%7 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%8 = icmp eq %struct.TYPE_8__* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store %struct.TYPE_8__* null, %struct.TYPE_8__** %2
br label %187
10: ; preds = %1
%11 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%12 = call i32 @memset(%struct.TYPE_8__* %11, i32 0, i32 56)
%13 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%14 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %13, i32 0, i32 8
%15 = load i32, i32* %14
%16 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%17 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %16, i32 0, i32 8
store i32 %15, i32* %17
%18 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%19 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %18, i32 0, i32 0
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %53
22: ; preds = %10
%23 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%24 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %23, i32 0, i32 0
%25 = load i32, i32* %24
%26 = call i8* @malloc(i32 %25)
%27 = bitcast i8* %26 to %struct.TYPE_8__*
%28 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%29 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %28, i32 0, i32 7
store %struct.TYPE_8__* %27, %struct.TYPE_8__** %29
%30 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%31 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %30, i32 0, i32 7
%32 = load %struct.TYPE_8__*, %struct.TYPE_8__** %31
%33 = icmp eq %struct.TYPE_8__* %32, null
br i1 %33, label %34, label %37
34: ; preds = %22
%35 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%36 = call i32 @free(%struct.TYPE_8__* %35)
store %struct.TYPE_8__* null, %struct.TYPE_8__** %2
br label %187
37: ; preds = %22
%38 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%39 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %38, i32 0, i32 7
%40 = load %struct.TYPE_8__*, %struct.TYPE_8__** %39
%41 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%42 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %41, i32 0, i32 7
%43 = load %struct.TYPE_8__*, %struct.TYPE_8__** %42
%44 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%45 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %44, i32 0, i32 0
%46 = load i32, i32* %45
%47 = call i32 @memcpy(%struct.TYPE_8__* %40, %struct.TYPE_8__* %43, i32 %46)
%48 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%49 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %48, i32 0, i32 0
%50 = load i32, i32* %49
%51 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%52 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %51, i32 0, i32 0
store i32 %50, i32* %52
br label %53
53: ; preds = %37, %10
%54 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%55 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %54, i32 0, i32 1
%56 = load i32, i32* %55
%57 = icmp ne i32 %56, 0
br i1 %57, label %58, label %93
58: ; preds = %53
%59 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%60 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %59, i32 0, i32 1
%61 = load i32, i32* %60
%62 = call i8* @malloc(i32 %61)
%63 = bitcast i8* %62 to %struct.TYPE_8__*
%64 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%65 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %64, i32 0, i32 6
store %struct.TYPE_8__* %63, %struct.TYPE_8__** %65
%66 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%67 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %66, i32 0, i32 6
%68 = load %struct.TYPE_8__*, %struct.TYPE_8__** %67
%69 = icmp eq %struct.TYPE_8__* %68, null
br i1 %69, label %70, label %77
70: ; preds = %58
%71 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%72 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %71, i32 0, i32 7
%73 = load %struct.TYPE_8__*, %struct.TYPE_8__** %72
%74 = call i32 @free(%struct.TYPE_8__* %73)
%75 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%76 = call i32 @free(%struct.TYPE_8__* %75)
store %struct.TYPE_8__* null, %struct.TYPE_8__** %2
br label %187
77: ; preds = %58
%78 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%79 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %78, i32 0, i32 6
%80 = load %struct.TYPE_8__*, %struct.TYPE_8__** %79
%81 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%82 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %81, i32 0, i32 6
%83 = load %struct.TYPE_8__*, %struct.TYPE_8__** %82
%84 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%85 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %84, i32 0, i32 1
%86 = load i32, i32* %85
%87 = call i32 @memcpy(%struct.TYPE_8__* %80, %struct.TYPE_8__* %83, i32 %86)
%88 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%89 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %88, i32 0, i32 1
%90 = load i32, i32* %89
%91 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%92 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %91, i32 0, i32 1
store i32 %90, i32* %92
br label %93
93: ; preds = %77, %53
%94 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%95 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %94, i32 0, i32 2
%96 = load i32, i32* %95
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %137
98: ; preds = %93
%99 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%100 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %99, i32 0, i32 2
%101 = load i32, i32* %100
%102 = call i8* @malloc(i32 %101)
%103 = bitcast i8* %102 to %struct.TYPE_8__*
%104 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%105 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %104, i32 0, i32 5
store %struct.TYPE_8__* %103, %struct.TYPE_8__** %105
%106 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%107 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %106, i32 0, i32 5
%108 = load %struct.TYPE_8__*, %struct.TYPE_8__** %107
%109 = icmp eq %struct.TYPE_8__* %108, null
br i1 %109, label %110, label %121
110: ; preds = %98
%111 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%112 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %111, i32 0, i32 7
%113 = load %struct.TYPE_8__*, %struct.TYPE_8__** %112
%114 = call i32 @free(%struct.TYPE_8__* %113)
%115 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%116 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %115, i32 0, i32 6
%117 = load %struct.TYPE_8__*, %struct.TYPE_8__** %116
%118 = call i32 @free(%struct.TYPE_8__* %117)
%119 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%120 = call i32 @free(%struct.TYPE_8__* %119)
store %struct.TYPE_8__* null, %struct.TYPE_8__** %2
br label %187
121: ; preds = %98
%122 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%123 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %122, i32 0, i32 5
%124 = load %struct.TYPE_8__*, %struct.TYPE_8__** %123
%125 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%126 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %125, i32 0, i32 5
%127 = load %struct.TYPE_8__*, %struct.TYPE_8__** %126
%128 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%129 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %128, i32 0, i32 2
%130 = load i32, i32* %129
%131 = call i32 @memcpy(%struct.TYPE_8__* %124, %struct.TYPE_8__* %127, i32 %130)
%132 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%133 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %132, i32 0, i32 2
%134 = load i32, i32* %133
%135 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%136 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %135, i32 0, i32 2
store i32 %134, i32* %136
br label %137
137: ; preds = %121, %93
%138 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%139 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %138, i32 0, i32 3
%140 = load i32, i32* %139
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %185
142: ; preds = %137
%143 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%144 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %143, i32 0, i32 3
%145 = load i32, i32* %144
%146 = call i8* @malloc(i32 %145)
%147 = bitcast i8* %146 to %struct.TYPE_8__*
%148 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%149 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %148, i32 0, i32 4
store %struct.TYPE_8__* %147, %struct.TYPE_8__** %149
%150 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%151 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %150, i32 0, i32 4
%152 = load %struct.TYPE_8__*, %struct.TYPE_8__** %151
%153 = icmp eq %struct.TYPE_8__* %152, null
br i1 %153, label %154, label %169
154: ; preds = %142
%155 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%156 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %155, i32 0, i32 7
%157 = load %struct.TYPE_8__*, %struct.TYPE_8__** %156
%158 = call i32 @free(%struct.TYPE_8__* %157)
%159 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%160 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %159, i32 0, i32 6
%161 = load %struct.TYPE_8__*, %struct.TYPE_8__** %160
%162 = call i32 @free(%struct.TYPE_8__* %161)
%163 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%164 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %163, i32 0, i32 5
%165 = load %struct.TYPE_8__*, %struct.TYPE_8__** %164
%166 = call i32 @free(%struct.TYPE_8__* %165)
%167 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%168 = call i32 @free(%struct.TYPE_8__* %167)
store %struct.TYPE_8__* null, %struct.TYPE_8__** %2
br label %187
169: ; preds = %142
%170 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%171 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %170, i32 0, i32 4
%172 = load %struct.TYPE_8__*, %struct.TYPE_8__** %171
%173 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%174 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %173, i32 0, i32 4
%175 = load %struct.TYPE_8__*, %struct.TYPE_8__** %174
%176 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%177 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %176, i32 0, i32 3
%178 = load i32, i32* %177
%179 = call i32 @memcpy(%struct.TYPE_8__* %172, %struct.TYPE_8__* %175, i32 %178)
%180 = load %struct.TYPE_8__*, %struct.TYPE_8__** %3
%181 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %180, i32 0, i32 3
%182 = load i32, i32* %181
%183 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
%184 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %183, i32 0, i32 3
store i32 %182, i32* %184
br label %185
185: ; preds = %169, %137
%186 = load %struct.TYPE_8__*, %struct.TYPE_8__** %4
store %struct.TYPE_8__* %186, %struct.TYPE_8__** %2
br label %187
187: ; preds = %185, %154, %110, %70, %34, %9
%188 = load %struct.TYPE_8__*, %struct.TYPE_8__** %2
ret %struct.TYPE_8__* %188
}

LLVM IR (-O2):
%struct.TYPE_8__ = type { i32, i32, i32, i32, %struct.TYPE_8__*, %struct.TYPE_8__*, %struct.TYPE_8__*, %struct.TYPE_8__*, i32 }
define %struct.TYPE_8__* @copyAuth(%struct.TYPE_8__* nocapture %0) {
%2 = tail call dereferenceable_or_null(56) i8* @malloc(i32 56)
%3 = bitcast i8* %2 to %struct.TYPE_8__*
%4 = icmp eq i8* %2, null
br i1 %4, label %99, label %5
5: ; preds = %1
%6 = tail call i32 @memset(%struct.TYPE_8__* %3, i32 0, i32 56)
%7 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 8
%8 = load i32, i32* %7
%9 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 8
store i32 %8, i32* %9
%10 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 0
%11 = load i32, i32* %10
%12 = icmp eq i32 %11, 0
br i1 %12, label %27, label %13
13: ; preds = %5
%14 = tail call i8* @malloc(i32 %11)
%15 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 7
%16 = bitcast %struct.TYPE_8__** %15 to i8**
store i8* %14, i8** %16
%17 = icmp eq i8* %14, null
br i1 %17, label %18, label %20
18: ; preds = %13
%19 = tail call i32 @free(%struct.TYPE_8__* %3)
br label %99
20: ; preds = %13
%21 = bitcast i8* %14 to %struct.TYPE_8__*
%22 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 7
%23 = load %struct.TYPE_8__*, %struct.TYPE_8__** %22
%24 = tail call i32 @memcpy(%struct.TYPE_8__* %21, %struct.TYPE_8__* %23, i32 %11)
%25 = load i32, i32* %10
%26 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 0
store i32 %25, i32* %26
br label %27
27: ; preds = %20, %5
%28 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 1
%29 = load i32, i32* %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %48, label %31
31: ; preds = %27
%32 = tail call i8* @malloc(i32 %29)
%33 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 6
%34 = bitcast %struct.TYPE_8__** %33 to i8**
store i8* %32, i8** %34
%35 = icmp eq i8* %32, null
br i1 %35, label %36, label %41
36: ; preds = %31
%37 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 7
%38 = load %struct.TYPE_8__*, %struct.TYPE_8__** %37
%39 = tail call i32 @free(%struct.TYPE_8__* %38)
%40 = tail call i32 @free(%struct.TYPE_8__* %3)
br label %99
41: ; preds = %31
%42 = bitcast i8* %32 to %struct.TYPE_8__*
%43 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 6
%44 = load %struct.TYPE_8__*, %struct.TYPE_8__** %43
%45 = tail call i32 @memcpy(%struct.TYPE_8__* %42, %struct.TYPE_8__* %44, i32 %29)
%46 = load i32, i32* %28
%47 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 1
store i32 %46, i32* %47
br label %48
48: ; preds = %41, %27
%49 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 2
%50 = load i32, i32* %49
%51 = icmp eq i32 %50, 0
br i1 %51, label %72, label %52
52: ; preds = %48
%53 = tail call i8* @malloc(i32 %50)
%54 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 5
%55 = bitcast %struct.TYPE_8__** %54 to i8**
store i8* %53, i8** %55
%56 = icmp eq i8* %53, null
br i1 %56, label %57, label %65
57: ; preds = %52
%58 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 7
%59 = load %struct.TYPE_8__*, %struct.TYPE_8__** %58
%60 = tail call i32 @free(%struct.TYPE_8__* %59)
%61 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 6
%62 = load %struct.TYPE_8__*, %struct.TYPE_8__** %61
%63 = tail call i32 @free(%struct.TYPE_8__* %62)
%64 = tail call i32 @free(%struct.TYPE_8__* %3)
br label %99
65: ; preds = %52
%66 = bitcast i8* %53 to %struct.TYPE_8__*
%67 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 5
%68 = load %struct.TYPE_8__*, %struct.TYPE_8__** %67
%69 = tail call i32 @memcpy(%struct.TYPE_8__* %66, %struct.TYPE_8__* %68, i32 %50)
%70 = load i32, i32* %49
%71 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 2
store i32 %70, i32* %71
br label %72
72: ; preds = %65, %48
%73 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 3
%74 = load i32, i32* %73
%75 = icmp eq i32 %74, 0
br i1 %75, label %99, label %76
76: ; preds = %72
%77 = tail call i8* @malloc(i32 %74)
%78 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 4
%79 = bitcast %struct.TYPE_8__** %78 to i8**
store i8* %77, i8** %79
%80 = icmp eq i8* %77, null
br i1 %80, label %81, label %92
81: ; preds = %76
%82 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 7
%83 = load %struct.TYPE_8__*, %struct.TYPE_8__** %82
%84 = tail call i32 @free(%struct.TYPE_8__* %83)
%85 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 6
%86 = load %struct.TYPE_8__*, %struct.TYPE_8__** %85
%87 = tail call i32 @free(%struct.TYPE_8__* %86)
%88 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 5
%89 = load %struct.TYPE_8__*, %struct.TYPE_8__** %88
%90 = tail call i32 @free(%struct.TYPE_8__* %89)
%91 = tail call i32 @free(%struct.TYPE_8__* %3)
br label %99
92: ; preds = %76
%93 = bitcast i8* %77 to %struct.TYPE_8__*
%94 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %0, i64 0, i32 4
%95 = load %struct.TYPE_8__*, %struct.TYPE_8__** %94
%96 = tail call i32 @memcpy(%struct.TYPE_8__* %93, %struct.TYPE_8__* %95, i32 %74)
%97 = load i32, i32* %73
%98 = getelementptr inbounds %struct.TYPE_8__, %struct.TYPE_8__* %3, i64 0, i32 3
store i32 %97, i32* %98
br label %99
99: ; preds = %72, %92, %1, %81, %57, %36, %18
%100 = phi %struct.TYPE_8__* [ null, %18 ], [ null, %36 ], [ null, %57 ], [ null, %81 ], [ null, %1 ], [ %3, %92 ], [ %3, %72 ]
ret %struct.TYPE_8__* %100
}