#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 */
typedef int /*<<< orphan*/ X509_EXTENSION;
typedef int /*<<< orphan*/ X509;

/* Variables and functions */
int /*<<< orphan*/ *OCSP_url_svcloc_new(int /*<<< orphan*/, char const **);
int /*<<< orphan*/ X509_EXTENSION_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ X509_get_issuer_name(int /*<<< orphan*/ *);
scalar_t__ get_cert(int /*<<< orphan*/ **);
int /*<<< orphan*/ test_ptr(char *, int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_true(char *, int, char *, int);
int test_ocsp_url_svcloc_new(void) {
  static const char *urls[] = {"www.openssl.org", "www.openssl.net", NULL};
  X509 *issuer = NULL;
  X509_EXTENSION *ext = NULL;
  int ret = 0;
  if (!test_true(
          "/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",
          194, "get_cert(&issuer)", (get_cert(&issuer)) != 0))
    goto err;
  ext = OCSP_url_svcloc_new(X509_get_issuer_name(issuer), urls);
  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",
                201, "ext", ext))
    goto err;
  X509_EXTENSION_free(ext);
  ret = 1;
err:
  X509_free(issuer);
  return ret;
}


x86 assembly (clang, -O0):
<test_ocsp_url_svcloc_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x8(%rbp),%rdi
call   1080 <get_cert@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe75(%rip),%rdi
mov    $0xc2,%esi
lea    0xf18(%rip),%rdx
call   1030 <test_true@plt>
cmp    $0x0,%eax
jne    11ca <test_ocsp_url_svcloc_new+0x5a>
jmp    121f <test_ocsp_url_svcloc_new+0xaf>
mov    -0x8(%rbp),%rdi
call   1040 <X509_get_issuer_name@plt>
mov    %eax,%edi
lea    0x2e84(%rip),%rsi
call   1060 <OCSP_url_svcloc_new@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0xe30(%rip),%rdi
mov    $0xc9,%esi
lea    0xee5(%rip),%rdx
call   1050 <test_ptr@plt>
cmp    $0x0,%eax
jne    120f <test_ocsp_url_svcloc_new+0x9f>
jmp    121f <test_ocsp_url_svcloc_new+0xaf>
mov    -0x10(%rbp),%rdi
call   1090 <X509_EXTENSION_free@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <X509_free@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ocsp_url_svcloc_new>:
push   %rbp
push   %rbx
push   %rax
movq   $0x0,(%rsp)
mov    %rsp,%rdi
call   1080 <get_cert@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xe8e(%rip),%rdi
lea    0xf36(%rip),%rdx
mov    $0xc2,%esi
call   1030 <test_true@plt>
xor    %ebp,%ebp
test   %eax,%eax
je     11ef <test_ocsp_url_svcloc_new+0x7f>
mov    (%rsp),%rdi
call   1040 <X509_get_issuer_name@plt>
lea    0x2ea7(%rip),%rsi
mov    %eax,%edi
call   1060 <OCSP_url_svcloc_new@plt>
mov    %rax,%rbx
lea    0xe56(%rip),%rdi
lea    0xf10(%rip),%rdx
mov    $0xc9,%esi
mov    %rax,%rcx
call   1050 <test_ptr@plt>
test   %eax,%eax
je     11ef <test_ocsp_url_svcloc_new+0x7f>
mov    %rbx,%rdi
call   1090 <X509_EXTENSION_free@plt>
mov    $0x1,%ebp
mov    (%rsp),%rdi
call   1070 <X509_free@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@test_ocsp_url_svcloc_new.urls = internal global [3 x i8*] [i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [16 x i8] c"www.openssl.org\00"
@.str.1 = [16 x i8] c"www.openssl.net\00"
@.str.2 = [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.3 = [18 x i8] c"get_cert(&issuer)\00"
@.str.4 = [4 x i8] c"ext\00"
define i32 @test_ocsp_url_svcloc_new() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
store i32* null, i32** %1
store i32* null, i32** %2
store i32 0, i32* %3
%4 = call i64 @get_cert(i32** %1)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i32
%7 = call i32 @test_true(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.2, i64 0, i64 0), i32 194, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %6)
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %0
br label %21
10: ; preds = %0
%11 = load i32*, i32** %1
%12 = call i32 @X509_get_issuer_name(i32* %11)
%13 = call i32* @OCSP_url_svcloc_new(i32 %12, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @test_ocsp_url_svcloc_new.urls, i64 0, i64 0))
store i32* %13, i32** %2
%14 = load i32*, i32** %2
%15 = call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.2, i64 0, i64 0), i32 201, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %10
br label %21
18: ; preds = %10
%19 = load i32*, i32** %2
%20 = call i32 @X509_EXTENSION_free(i32* %19)
store i32 1, i32* %3
br label %21
21: ; preds = %18, %17, %9
%22 = load i32*, i32** %1
%23 = call i32 @X509_free(i32* %22)
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@test_ocsp_url_svcloc_new.urls = internal global [3 x i8*] [i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i32 0, i32 0), i8* null]
@.str = [16 x i8] c"www.openssl.org\00"
@.str.1 = [16 x i8] c"www.openssl.net\00"
@.str.2 = [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.3 = [18 x i8] c"get_cert(&issuer)\00"
@.str.4 = [4 x i8] c"ext\00"
define i32 @test_ocsp_url_svcloc_new() {
%1 = alloca i32*
%2 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%3 = call i64 @get_cert(i32** %1)
%4 = icmp ne i64 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @test_true(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.2, i64 0, i64 0), i32 194, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %0
%9 = load i32*, i32** %1
%10 = call i32 @X509_get_issuer_name(i32* %9)
%11 = call i32* @OCSP_url_svcloc_new(i32 %10, i8** getelementptr inbounds ([3 x i8*], [3 x i8*]* @test_ocsp_url_svcloc_new.urls, i64 0, i64 0))
%12 = call i32 @test_ptr(i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.2, i64 0, i64 0), i32 201, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = call i32 @X509_EXTENSION_free(i32* %11)
br label %16
16: ; preds = %8, %0, %14
%17 = phi i32 [ 1, %14 ], [ 0, %8 ], [ 0, %0 ]
%18 = load i32*, i32** %1
%19 = call i32 @X509_free(i32* %18)
ret i32 %17
}