#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*/ CTLOG;

/* Variables and functions */
int /*<<< orphan*/ CTLOG_new_from_base64(int /*<<< orphan*/ **, char const *,
                                         char const *);
int /*<<< orphan*/ test_true(char *, int, char *, int);
int test_ctlog_from_base64(void) {
  CTLOG *ctlogp = NULL;
  const char notb64[] = "\01\02\03\04";
  const char pad[] = "====";
  const char name[] = "name";
  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/ct_test.c",
          505, "!CTLOG_new_from_base64(&ctlogp, notb64, name)",
          (!CTLOG_new_from_base64(&ctlogp, notb64, name)) != 0) ||
      !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/ct_test.c",
          506, "!CTLOG_new_from_base64(&ctlogp, pad, name)",
          (!CTLOG_new_from_base64(&ctlogp, pad, name)) != 0))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test_ctlog_from_base64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x0,-0x10(%rbp)
mov    0xeca(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xec5(%rip),%al
mov    %al,-0x11(%rbp)
mov    0xebd(%rip),%eax
mov    %eax,-0x1a(%rbp)
mov    0xeb8(%rip),%al
mov    %al,-0x16(%rbp)
mov    0xeb0(%rip),%eax
mov    %eax,-0x1f(%rbp)
mov    0xeab(%rip),%al
mov    %al,-0x1b(%rbp)
lea    -0x15(%rbp),%rsi
lea    -0x1f(%rbp),%rdx
lea    -0x10(%rbp),%rdi
call   1040 <CTLOG_new_from_base64@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe79(%rip),%rdi
mov    $0x1f9,%esi
lea    0xf18(%rip),%rdx
call   1030 <test_true@plt>
cmp    $0x0,%eax
je     11fa <test_ctlog_from_base64+0xda>
lea    -0x1a(%rbp),%rsi
lea    -0x1f(%rbp),%rdx
lea    -0x10(%rbp),%rdi
call   1040 <CTLOG_new_from_base64@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xe2f(%rip),%rdi
mov    $0x1fa,%esi
lea    0xefc(%rip),%rdx
call   1030 <test_true@plt>
cmp    $0x0,%eax
jne    1206 <test_ctlog_from_base64+0xe6>
movl   $0x0,-0x4(%rbp)
jmp    120d <test_ctlog_from_base64+0xed>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ctlog_from_base64>:
sub    $0x28,%rsp
movq   $0x0,0x20(%rsp)
movb   $0x0,0x1c(%rsp)
movl   $0x4030201,0x18(%rsp)
04
movb   $0x0,0x14(%rsp)
movl   $0x3d3d3d3d,0x10(%rsp)
3d
movb   $0x0,0xc(%rsp)
movl   $0x656d616e,0x8(%rsp)
65
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <CTLOG_new_from_base64@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    0xe99(%rip),%rdi
lea    0xf3d(%rip),%rdx
mov    $0x1f9,%esi
call   1030 <test_true@plt>
test   %eax,%eax
je     11cc <test_ctlog_from_base64+0xac>
lea    0x20(%rsp),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <CTLOG_new_from_base64@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
lea    0xe62(%rip),%rdi
lea    0xf34(%rip),%rdx
mov    $0x1fa,%esi
call   1030 <test_true@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
add    $0x28,%rsp
ret
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test_ctlog_from_base64.notb64 = [5 x i8] c"\01\02\03\04\00"
@__const.test_ctlog_from_base64.pad = [5 x i8] c"====\00"
@__const.test_ctlog_from_base64.name = [5 x i8] c"name\00"
@.str = [171 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/ct_test.c\00"
@.str.1 = [46 x i8] c"!CTLOG_new_from_base64(&ctlogp, notb64, name)\00"
@.str.2 = [43 x i8] c"!CTLOG_new_from_base64(&ctlogp, pad, name)\00"
define i32 @test_ctlog_from_base64() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = alloca [5 x i8]
store i32* null, i32** %2
%6 = bitcast [5 x i8]* %3 to i8*
%7 = bitcast [5 x i8]* %4 to i8*
%8 = bitcast [5 x i8]* %5 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%11 = call i32 @CTLOG_new_from_base64(i32** %2, i8* %9, i8* %10)
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = icmp ne i32 %14, 0
%16 = zext i1 %15 to i32
%17 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %30
19: ; preds = %0
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%22 = call i32 @CTLOG_new_from_base64(i32** %2, i8* %20, i8* %21)
%23 = icmp ne i32 %22, 0
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 506, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %31, label %30
30: ; preds = %19, %0
store i32 0, i32* %1
br label %32
31: ; preds = %19
store i32 1, i32* %1
br label %32
32: ; preds = %31, %30
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@__const.test_ctlog_from_base64.notb64 = [5 x i8] c"\01\02\03\04\00"
@__const.test_ctlog_from_base64.pad = [5 x i8] c"====\00"
@__const.test_ctlog_from_base64.name = [5 x i8] c"name\00"
@.str = [171 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/ct_test.c\00"
@.str.1 = [46 x i8] c"!CTLOG_new_from_base64(&ctlogp, notb64, name)\00"
@.str.2 = [43 x i8] c"!CTLOG_new_from_base64(&ctlogp, pad, name)\00"
define i32 @test_ctlog_from_base64() {
%1 = alloca i32*
%2 = alloca [5 x i8]
%3 = alloca [5 x i8]
%4 = alloca [5 x i8]
%5 = bitcast i32** %1 to i8*
store i32* null, i32** %1
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %4, i64 0, i64 0
%9 = call i32 @CTLOG_new_from_base64(i32** %1, i8* %6, i8* %8)
%10 = icmp eq i32 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 505, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %21, label %14
14: ; preds = %0
%15 = call i32 @CTLOG_new_from_base64(i32** %1, i8* %7, i8* %8)
%16 = icmp eq i32 %15, 0
%17 = zext i1 %16 to i32
%18 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 506, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i32
br label %21
21: ; preds = %14, %0
%22 = phi i32 [ 0, %0 ], [ %20, %14 ]
ret i32 %22
}