#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 uint32_t;
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ stderr;
int numby_I4(int32_t *X, uint32_t nX, int32_t *Z, uint32_t nZ, bool is_safe) {
  int status = 0;
  for (int i = 0; i < nX; i++) {
    int32_t x = X[i];
    if (is_safe) {
      if ((x < 0) || (x >= nZ)) {
        {
          {
            fprintf(stderr, "Line %3d of File %s \n", 22,
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/"
                    "heads/master/OPERATORS/GROUPBY/src/numby.c");
          };
          status = -1;
          goto BYE;
        };
      }
    }
    Z[x]++;
  }
BYE:
  return status;
}


x86 assembly (clang, -O0):
<numby_I4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c3 <numby_I4+0xb3>
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     11a4 <numby_I4+0x94>
cmpl   $0x0,-0x2c(%rbp)
jl     1172 <numby_I4+0x62>
mov    -0x2c(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jl     119f <numby_I4+0x8f>
mov    0x2e67(%rip),%rax
mov    (%rax),%edi
lea    0xe7e(%rip),%rsi
mov    $0x16,%edx
lea    0xe88(%rip),%rcx
call   1030 <fprintf@plt>
movl   $0xffffffff,-0x24(%rbp)
jmp    11c8 <numby_I4+0xb8>
jmp    11a4 <numby_I4+0x94>
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1138 <numby_I4+0x28>
jmp    11c8 <numby_I4+0xb8>
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numby_I4>:
push   %rax
test   %esi,%esi
jle    1166 <numby_I4+0x56>
mov    %esi,%r9d
xor    %esi,%esi
jmp    112d <numby_I4+0x1d>
nopl   0x0(%rax)
addl   $0x1,(%rdx,%rax,4)
add    $0x1,%rsi
cmp    %rsi,%r9
je     1166 <numby_I4+0x56>
movslq (%rdi,%rsi,4),%rax
test   %r8d,%r8d
je     1120 <numby_I4+0x10>
test   %eax,%eax
js     113e <numby_I4+0x2e>
cmp    %ecx,%eax
jl     1120 <numby_I4+0x10>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
lea    0xec1(%rip),%rcx
mov    $0x16,%edx
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/OPERATORS/GROUPBY/src/numby.c\00"
define i32 @numby_I4(i32* %0, i32 %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
br label %14
14: ; preds = %44, %5
%15 = load i32, i32* %12
%16 = load i32, i32* %7
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %47
18: ; preds = %14
%19 = load i32*, i32** %6
%20 = load i32, i32* %12
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
%23 = load i32, i32* %22
store i32 %23, i32* %13
%24 = load i32, i32* %10
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %37
26: ; preds = %18
%27 = load i32, i32* %13
%28 = icmp slt i32 %27, 0
br i1 %28, label %33, label %29
29: ; preds = %26
%30 = load i32, i32* %13
%31 = load i32, i32* %9
%32 = icmp sge i32 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %29, %26
%34 = load i32, i32* @stderr
%35 = call i32 @fprintf(i32 %34, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %11
br label %48
36: ; preds = %29
br label %37
37: ; preds = %36, %18
%38 = load i32*, i32** %8
%39 = load i32, i32* %13
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %38, i64 %40
%42 = load i32, i32* %41
%43 = add nsw i32 %42, 1
store i32 %43, i32* %41
br label %44
44: ; preds = %37
%45 = load i32, i32* %12
%46 = add nsw i32 %45, 1
store i32 %46, i32* %12
br label %14
47: ; preds = %14
br label %48
48: ; preds = %47, %33
%49 = load i32, i32* %11
ret i32 %49
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"Line %3d of File %s \0A\00"
@.str.1 = [154 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/NerdWalletOSS/Q/refs/heads/master/OPERATORS/GROUPBY/src/numby.c\00"
define i32 @numby_I4(i32* nocapture %0, i32 %1, i32* nocapture %2, i32 %3, i32 %4) {
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %28
7: ; preds = %5
%8 = icmp eq i32 %4, 0
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %7, %21
%11 = phi i64 [ 0, %7 ], [ %26, %21 ]
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
br i1 %8, label %21, label %14
14: ; preds = %10
%15 = icmp sgt i32 %13, -1
%16 = icmp slt i32 %13, %3
%17 = and i1 %15, %16
br i1 %17, label %21, label %18
18: ; preds = %14
%19 = load i32, i32* @stderr
%20 = tail call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([154 x i8], [154 x i8]* @.str.1, i64 0, i64 0))
br label %28
21: ; preds = %10, %14
%22 = sext i32 %13 to i64
%23 = getelementptr inbounds i32, i32* %2, i64 %22
%24 = load i32, i32* %23
%25 = add nsw i32 %24, 1
store i32 %25, i32* %23
%26 = add nuw nsw i64 %11, 1
%27 = icmp eq i64 %26, %9
br i1 %27, label %28, label %10
28: ; preds = %21, %5, %18
%29 = phi i32 [ -1, %18 ], [ 0, %5 ], [ 0, %21 ]
ret i32 %29
}