#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 RegisterAs(char const *);
int /*<<< orphan*/ _assert(int, char *, int, char *);
int /*<<< orphan*/ nsblk_log_call(char, int, char const *);
int /*<<< orphan*/ nsblk_log_call_r(char, int, char const *, int);
void nsblk_reg(const char *name, int id) {
  int rc;
  nsblk_log_call('R', id, name);
  rc = RegisterAs(name);
  _assert((rc == 0),
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/"
          "test/test_nsblk.c",
          150, "rc == 0");
  nsblk_log_call_r('R', id, name, rc);
}


x86 assembly (clang, -O0):
<nsblk_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    $0x52,%edi
call   1040 <nsblk_log_call@plt>
mov    -0x8(%rbp),%rdi
call   1050 <RegisterAs@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe81(%rip),%rsi
mov    $0x96,%edx
lea    0xf07(%rip),%rcx
call   1060 <_assert@plt>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
mov    $0x52,%edi
call   1030 <nsblk_log_call_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsblk_reg>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %rdi,%rbx
mov    $0x52,%edi
mov    %rbx,%rdx
call   1040 <nsblk_log_call@plt>
mov    %rbx,%rdi
call   1050 <RegisterAs@plt>
mov    %eax,%ebp
xor    %edi,%edi
test   %eax,%eax
sete   %dil
lea    0xe90(%rip),%rsi
lea    0xf1b(%rip),%rcx
mov    $0x96,%edx
call   1060 <_assert@plt>
mov    $0x52,%edi
mov    %r14d,%esi
mov    %rbx,%rdx
mov    %ebp,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <nsblk_log_call_r@plt>

LLVM IR (-O0):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/test/test_nsblk.c\00"
@.str.1 = [8 x i8] c"rc == 0\00"
define void @nsblk_reg(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @nsblk_log_call(i8 signext 82, i32 %6, i8* %7)
%9 = load i8*, i8** %3
%10 = call i32 @RegisterAs(i8* %9)
store i32 %10, i32* %5
%11 = load i32, i32* %5
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @_assert(i32 %13, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* %4
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = call i32 @nsblk_log_call_r(i8 signext 82, i32 %15, i8* %16, i32 %17)
ret void
}

LLVM IR (-O2):
@.str = [146 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/mthiffau/HeatheRTOS/refs/heads/master/test/test_nsblk.c\00"
@.str.1 = [8 x i8] c"rc == 0\00"
define void @nsblk_reg(i8* %0, i32 %1) {
%3 = tail call i32 @nsblk_log_call(i8 signext 82, i32 %1, i8* %0)
%4 = tail call i32 @RegisterAs(i8* %0)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
%7 = tail call i32 @_assert(i32 %6, i8* getelementptr inbounds ([146 x i8], [146 x i8]* @.str, i64 0, i64 0), i32 150, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @nsblk_log_call_r(i8 signext 82, i32 %1, i8* %0, i32 %4)
ret void
}