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

/* Variables and functions */
int NID_undef;
char *OBJ_nid2ln(int);
int /*<<< orphan*/ test_error(char *, int, char *, char const *, char *,
                              char *);
int check_nid(const char *name, int expected_nid, int nid) {
  if (expected_nid == 0 || expected_nid == nid)
    return 1;
  test_error("/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/ssl_test.c",
             224, "%s type mismatch, %s vs %s\n", name,
             OBJ_nid2ln(expected_nid),
             nid == NID_undef ? "absent" : OBJ_nid2ln(nid));
  return 0;
}


x86 assembly (clang, -O0):
<check_nid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1148 <check_nid+0x28>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1154 <check_nid+0x34>
movl   $0x1,-0x4(%rbp)
jmp    11c1 <check_nid+0xa1>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <OBJ_nid2ln@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%eax
mov    0x2e6e(%rip),%rcx
cmp    (%rcx),%eax
jne    118a <check_nid+0x6a>
lea    0xf47(%rip),%rax
mov    %rax,-0x30(%rbp)
jmp    1196 <check_nid+0x76>
mov    -0x18(%rbp),%edi
call   1030 <OBJ_nid2ln@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r9
lea    0xe57(%rip),%rdi
mov    $0xe0,%esi
lea    0xef7(%rip),%rdx
call   1040 <test_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_nid>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%eax
test   %esi,%esi
je     117e <check_nid+0x5e>
mov    %edx,%ebp
cmp    %edx,%esi
je     117e <check_nid+0x5e>
mov    %rdi,%rbx
mov    %esi,%edi
call   1030 <OBJ_nid2ln@plt>
mov    %rax,%r14
mov    0x2e99(%rip),%rax
cmp    %ebp,(%rax)
jne    1154 <check_nid+0x34>
lea    0xf76(%rip),%r9
jmp    115e <check_nid+0x3e>
mov    %ebp,%edi
call   1030 <OBJ_nid2ln@plt>
mov    %rax,%r9
lea    0xe9b(%rip),%rdi
lea    0xf40(%rip),%rdx
mov    $0xe0,%esi
mov    %rbx,%rcx
mov    %r14,%r8
call   1040 <test_error@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [172 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/ssl_test.c\00"
@.str.1 = [28 x i8] c"%s type mismatch, %s vs %s\0A\00"
@NID_undef = global i32 0
@.str.2 = [7 x i8] c"absent\00"
define i32 @check_nid(i8* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%8 = load i32, i32* %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp eq i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %10, %3
store i32 1, i32* %4
br label %29
15: ; preds = %10
%16 = load i8*, i8** %5
%17 = load i32, i32* %6
%18 = call i8* @OBJ_nid2ln(i32 %17)
%19 = load i32, i32* %7
%20 = load i32, i32* @NID_undef
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %15
br label %26
23: ; preds = %15
%24 = load i32, i32* %7
%25 = call i8* @OBJ_nid2ln(i32 %24)
br label %26
26: ; preds = %23, %22
%27 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %22 ], [ %25, %23 ]
%28 = call i32 @test_error(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i32 224, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* %18, i8* %27)
store i32 0, i32* %4
br label %29
29: ; preds = %26, %14
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
@.str = [172 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/ssl_test.c\00"
@.str.1 = [28 x i8] c"%s type mismatch, %s vs %s\0A\00"
@NID_undef = global i32 0
@.str.2 = [7 x i8] c"absent\00"
define i32 @check_nid(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, 0
%5 = icmp eq i32 %1, %2
%6 = or i1 %4, %5
br i1 %6, label %16, label %7
7: ; preds = %3
%8 = tail call i8* @OBJ_nid2ln(i32 %1)
%9 = load i32, i32* @NID_undef
%10 = icmp eq i32 %9, %2
br i1 %10, label %13, label %11
11: ; preds = %7
%12 = tail call i8* @OBJ_nid2ln(i32 %2)
br label %13
13: ; preds = %7, %11
%14 = phi i8* [ %12, %11 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), %7 ]
%15 = tail call i32 @test_error(i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i32 224, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i8* %0, i8* %8, i8* %14)
br label %16
16: ; preds = %3, %13
%17 = phi i32 [ 0, %13 ], [ 1, %3 ]
ret i32 %17
}