#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_7__ TYPE_1__;

/* Type definitions */
struct TYPE_7__ {
  struct TYPE_7__ *location;
};
typedef TYPE_1__ ACCESS_DESCRIPTION;

/* Variables and functions */
int /*<<< orphan*/ ACCESS_DESCRIPTION_free(TYPE_1__ *);
TYPE_1__ *ACCESS_DESCRIPTION_new();
int /*<<< orphan*/ GENERAL_NAME_free(TYPE_1__ *);
TYPE_1__ *GENERAL_NAME_new();
int /*<<< orphan*/ test_ptr(char *, int, char *, TYPE_1__ *);
int test_access_description(int testcase) {
  ACCESS_DESCRIPTION *ad = ACCESS_DESCRIPTION_new();
  int ret = 0;
  if (!test_ptr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/"
                "refs/heads/master/Src/OSF/OpenSSL-111/test/ocspapitest.c",
                157, "ad", ad))
    goto err;
  switch (testcase) {
  case 0:
    break;
  case 1:
    if (!test_ptr(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
            "master/Src/OSF/OpenSSL-111/test/ocspapitest.c",
            164, "ad->location", ad->location))
      goto err;
    GENERAL_NAME_free(ad->location);
    ad->location = NULL;
    break;
  case 2:
    GENERAL_NAME_free(ad->location);
    ad->location = GENERAL_NAME_new();
    if (!test_ptr(
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
            "master/Src/OSF/OpenSSL-111/test/ocspapitest.c",
            172, "ad->location", ad->location))
      goto err;
    break;
  }
  ACCESS_DESCRIPTION_free(ad);
  ret = 1;
err:
  return ret;
}


x86 assembly (clang, -O0):
<test_access_description>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1050 <ACCESS_DESCRIPTION_new@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rcx
lea    0xe88(%rip),%rdi
mov    $0x9d,%esi
lea    0xf2b(%rip),%rdx
call   1030 <test_ptr@plt>
cmp    $0x0,%eax
jne    1197 <test_access_description+0x47>
jmp    1279 <test_access_description+0x129>
mov    -0x4(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11cc <test_access_description+0x7c>
jmp    11aa <test_access_description+0x5a>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     11d1 <test_access_description+0x81>
jmp    11bb <test_access_description+0x6b>
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
je     121a <test_access_description+0xca>
jmp    1269 <test_access_description+0x119>
jmp    1269 <test_access_description+0x119>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xe21(%rip),%rdi
mov    $0xa4,%esi
lea    0xec7(%rip),%rdx
call   1030 <test_ptr@plt>
cmp    $0x0,%eax
jne    11fe <test_access_description+0xae>
jmp    1279 <test_access_description+0x129>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <GENERAL_NAME_free@plt>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
jmp    1269 <test_access_description+0x119>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <GENERAL_NAME_free@plt>
mov    $0x0,%al
call   1070 <GENERAL_NAME_new@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
lea    0xdbb(%rip),%rdi
mov    $0xac,%esi
lea    0xe61(%rip),%rdx
call   1030 <test_ptr@plt>
cmp    $0x0,%eax
jne    1264 <test_access_description+0x114>
jmp    1279 <test_access_description+0x129>
jmp    1269 <test_access_description+0x119>
mov    -0x10(%rbp),%rdi
call   1060 <ACCESS_DESCRIPTION_free@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_access_description>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <ACCESS_DESCRIPTION_new@plt>
mov    %rax,%rbx
lea    0xe96(%rip),%rdi
lea    0xf3e(%rip),%rdx
mov    $0x9d,%esi
mov    %rax,%rcx
call   1030 <test_ptr@plt>
test   %eax,%eax
je     11fe <test_access_description+0xae>
cmp    $0x2,%ebp
je     11bc <test_access_description+0x6c>
cmp    $0x1,%ebp
jne    11f0 <test_access_description+0xa0>
mov    (%rbx),%rcx
lea    0xe6a(%rip),%rdi
lea    0xf15(%rip),%rdx
mov    $0xa4,%esi
call   1030 <test_ptr@plt>
test   %eax,%eax
je     11fe <test_access_description+0xae>
mov    (%rbx),%rdi
call   1040 <GENERAL_NAME_free@plt>
movq   $0x0,(%rbx)
jmp    11f0 <test_access_description+0xa0>
mov    (%rbx),%rdi
call   1040 <GENERAL_NAME_free@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1070 <GENERAL_NAME_new@plt>
mov    %rax,(%rbx)
lea    0xe28(%rip),%rdi
lea    0xed3(%rip),%rdx
mov    $0xac,%esi
mov    %rax,%rcx
call   1030 <test_ptr@plt>
test   %eax,%eax
je     11fe <test_access_description+0xae>
mov    %rbx,%rdi
call   1060 <ACCESS_DESCRIPTION_free@plt>
mov    $0x1,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.TYPE_7__ = type { %struct.TYPE_7__* }
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/ocspapitest.c\00"
@.str.1 = [3 x i8] c"ad\00"
@.str.2 = [13 x i8] c"ad->location\00"
define i32 @test_access_description(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.TYPE_7__*
%4 = alloca i32
store i32 %0, i32* %2
%5 = call %struct.TYPE_7__* (...) @ACCESS_DESCRIPTION_new()
store %struct.TYPE_7__* %5, %struct.TYPE_7__** %3
store i32 0, i32* %4
%6 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%7 = call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 157, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.TYPE_7__* %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
br label %45
10: ; preds = %1
%11 = load i32, i32* %2
switch i32 %11, label %42 [
i32 0, label %12
i32 1, label %13
i32 2, label %27
]
12: ; preds = %10
br label %42
13: ; preds = %10
%14 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%15 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %14, i32 0, i32 0
%16 = load %struct.TYPE_7__*, %struct.TYPE_7__** %15
%17 = call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_7__* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %13
br label %45
20: ; preds = %13
%21 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%22 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %21, i32 0, i32 0
%23 = load %struct.TYPE_7__*, %struct.TYPE_7__** %22
%24 = call i32 @GENERAL_NAME_free(%struct.TYPE_7__* %23)
%25 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%26 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %25, i32 0, i32 0
store %struct.TYPE_7__* null, %struct.TYPE_7__** %26
br label %42
27: ; preds = %10
%28 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%29 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %28, i32 0, i32 0
%30 = load %struct.TYPE_7__*, %struct.TYPE_7__** %29
%31 = call i32 @GENERAL_NAME_free(%struct.TYPE_7__* %30)
%32 = call %struct.TYPE_7__* (...) @GENERAL_NAME_new()
%33 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%34 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %33, i32 0, i32 0
store %struct.TYPE_7__* %32, %struct.TYPE_7__** %34
%35 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%36 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %35, i32 0, i32 0
%37 = load %struct.TYPE_7__*, %struct.TYPE_7__** %36
%38 = call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 172, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_7__* %37)
%39 = icmp ne i32 %38, 0
br i1 %39, label %41, label %40
40: ; preds = %27
br label %45
41: ; preds = %27
br label %42
42: ; preds = %10, %41, %20, %12
%43 = load %struct.TYPE_7__*, %struct.TYPE_7__** %3
%44 = call i32 @ACCESS_DESCRIPTION_free(%struct.TYPE_7__* %43)
store i32 1, i32* %4
br label %45
45: ; preds = %42, %40, %19, %9
%46 = load i32, i32* %4
ret i32 %46
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { %struct.TYPE_7__* }
@.str = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/ocspapitest.c\00"
@.str.1 = [3 x i8] c"ad\00"
@.str.2 = [13 x i8] c"ad->location\00"
define i32 @test_access_description(i32 %0) {
%2 = tail call %struct.TYPE_7__* (...) @ACCESS_DESCRIPTION_new()
%3 = tail call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 157, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.TYPE_7__* %2)
%4 = icmp eq i32 %3, 0
br i1 %4, label %23, label %5
5: ; preds = %1
switch i32 %0, label %21 [
i32 2, label %14
i32 1, label %6
]
6: ; preds = %5
%7 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %2, i64 0, i32 0
%8 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%9 = tail call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_7__* %8)
%10 = icmp eq i32 %9, 0
br i1 %10, label %23, label %11
11: ; preds = %6
%12 = load %struct.TYPE_7__*, %struct.TYPE_7__** %7
%13 = tail call i32 @GENERAL_NAME_free(%struct.TYPE_7__* %12)
store %struct.TYPE_7__* null, %struct.TYPE_7__** %7
br label %21
14: ; preds = %5
%15 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %2, i64 0, i32 0
%16 = load %struct.TYPE_7__*, %struct.TYPE_7__** %15
%17 = tail call i32 @GENERAL_NAME_free(%struct.TYPE_7__* %16)
%18 = tail call %struct.TYPE_7__* (...) @GENERAL_NAME_new()
store %struct.TYPE_7__* %18, %struct.TYPE_7__** %15
%19 = tail call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str, i64 0, i64 0), i32 172, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), %struct.TYPE_7__* %18)
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %14, %5, %11
%22 = tail call i32 @ACCESS_DESCRIPTION_free(%struct.TYPE_7__* %2)
br label %23
23: ; preds = %14, %6, %1, %21
%24 = phi i32 [ 1, %21 ], [ 0, %6 ], [ 0, %14 ], [ 0, %1 ]
ret i32 %24
}