void *_check_known_sudirript_null(char *ptr, unsigned bound, unsigned elt_sz,
                                  unsigned index) {
  if (!ptr)
    (_throw_null_fn("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/pippijn/cyclone/refs/"
                    "heads/master/old/bin/cyc-lib/vc_cyc_include.h",
                    127));
  if (index >= bound)
    (_throw_arraybounds_fn(
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/pippijn/cyclone/refs/heads/master/old/bin/"
        "cyc-lib/vc_cyc_include.h",
        128));
  return ptr + elt_sz * index;
}


x86 assembly (clang, -O0):
<_check_known_sudirript_null>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <_check_known_sudirript_null+0x33>
lea    0xeb9(%rip),%rdi
mov    $0x7f,%esi
mov    $0x0,%al
call   1030 <_throw_null_fn@plt>
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jb     1172 <_check_known_sudirript_null+0x52>
lea    0xe9a(%rip),%rdi
mov    $0x80,%esi
mov    $0x0,%al
call   1040 <_throw_arraybounds_fn@plt>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
mov    %ecx,%ecx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_check_known_sudirript_null>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%rbx
test   %rdi,%rdi
je     1164 <_check_known_sudirript_null+0x44>
cmp    %ebp,%r14d
jb     114f <_check_known_sudirript_null+0x2f>
lea    0xebd(%rip),%rdi
mov    $0x80,%esi
xor    %eax,%eax
call   1040 <_throw_arraybounds_fn@plt>
imul   %r15d,%r14d
add    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe95(%rip),%rdi
mov    $0x7f,%esi
xor    %eax,%eax
call   1030 <_throw_null_fn@plt>
cmp    %ebp,%r14d
jae    113c <_check_known_sudirript_null+0x1c>
jmp    114f <_check_known_sudirript_null+0x2f>

LLVM IR (-O0):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pippijn/cyclone/refs/heads/master/old/bin/cyc-lib/vc_cyc_include.h\00"
define i8* @_check_known_sudirript_null(i8* %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %4
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_null_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 127)
br label %13
13: ; preds = %11, %4
%14 = load i32, i32* %8
%15 = load i32, i32* %6
%16 = icmp uge i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_arraybounds_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 128)
br label %19
19: ; preds = %17, %13
%20 = load i8*, i8** %5
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = mul i32 %21, %22
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds i8, i8* %20, i64 %24
ret i8* %25
}

LLVM IR (-O2):
@.str = [157 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/pippijn/cyclone/refs/heads/master/old/bin/cyc-lib/vc_cyc_include.h\00"
define i8* @_check_known_sudirript_null(i8* readnone %0, i32 %1, i32 %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_null_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 127)
br label %8
8: ; preds = %6, %4
%9 = icmp ult i32 %3, %1
br i1 %9, label %12, label %10
10: ; preds = %8
%11 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @_throw_arraybounds_fn to i32 (i8*, i32, ...)*)(i8* getelementptr inbounds ([157 x i8], [157 x i8]* @.str, i64 0, i64 0), i32 128)
br label %12
12: ; preds = %10, %8
%13 = mul i32 %3, %2
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %0, i64 %14
ret i8* %15
}