int mat44_ati(int col, int row) {
  do {
    if (!(col >= 0 && col < 4 && row >= 0 && row < 4)) {
      arghf("ASSERT(%s) failed in %s() in %s:%d\n",
            "col >= 0 && col < 4 && row >= 0 && row < 4", __func__,
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/sqaxomonophonen/cross-stub/refs/heads/"
            "master/m.h",
            62);
    }
  } while (0);
  return row + col * 4;
}


x86 assembly (clang, -O0):
<mat44_ati>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     1146 <mat44_ati+0x36>
cmpl   $0x4,-0x4(%rbp)
jge    1146 <mat44_ati+0x36>
cmpl   $0x0,-0x8(%rbp)
jl     1146 <mat44_ati+0x36>
cmpl   $0x4,-0x8(%rbp)
jl     116f <mat44_ati+0x5f>
lea    0xeb3(%rip),%rdi
lea    0xed0(%rip),%rsi
lea    0xef4(%rip),%rdx
lea    0xef7(%rip),%rcx
mov    $0x3e,%r8d
mov    $0x0,%al
call   1030 <arghf@plt>
jmp    1174 <mat44_ati+0x64>
mov    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat44_ati>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebx
mov    %esi,%eax
or     %edi,%eax
cmp    $0x4,%eax
jb     114b <mat44_ati+0x3b>
lea    0xed7(%rip),%rdi
lea    0xef4(%rip),%rsi
lea    0xf18(%rip),%rdx
lea    0xf1b(%rip),%rcx
mov    $0x3e,%r8d
xor    %eax,%eax
call   1030 <arghf@plt>
lea    (%r14,%rbx,4),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [36 x i8] c"ASSERT(%s) failed in %s() in %s:%d\0A\00"
@.str.1 = [43 x i8] c"col >= 0 && col < 4 && row >= 0 && row < 4\00"
@__func__.mat44_ati = [10 x i8] c"mat44_ati\00"
@.str.2 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sqaxomonophonen/cross-stub/refs/heads/master/m.h\00"
define i32 @mat44_ati(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %2
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 4
br i1 %10, label %11, label %17
11: ; preds = %8
%12 = load i32, i32* %4
%13 = icmp sge i32 %12, 0
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i32, i32* %4
%16 = icmp slt i32 %15, 4
br i1 %16, label %19, label %17
17: ; preds = %14, %11, %8, %5
%18 = call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @arghf to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.mat44_ati, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 62)
br label %19
19: ; preds = %17, %14
br label %20
20: ; preds = %19
%21 = load i32, i32* %4
%22 = load i32, i32* %3
%23 = mul nsw i32 %22, 4
%24 = add nsw i32 %21, %23
ret i32 %24
}

LLVM IR (-O2):
@.str = [36 x i8] c"ASSERT(%s) failed in %s() in %s:%d\0A\00"
@.str.1 = [43 x i8] c"col >= 0 && col < 4 && row >= 0 && row < 4\00"
@__func__.mat44_ati = [10 x i8] c"mat44_ati\00"
@.str.2 = [139 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/sqaxomonophonen/cross-stub/refs/heads/master/m.h\00"
define i32 @mat44_ati(i32 %0, i32 %1) {
%3 = or i32 %1, %0
%4 = icmp ult i32 %3, 4
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (i8*, i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @arghf to i32 (i8*, i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @__func__.mat44_ati, i64 0, i64 0), i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str.2, i64 0, i64 0), i32 62)
br label %7
7: ; preds = %5, %2
%8 = shl nsw i32 %0, 2
%9 = add nsw i32 %8, %1
ret i32 %9
}