#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 /*<<< orphan*/ _throw_arraybounds_fn(char const *, unsigned int);
int /*<<< orphan*/ _throw_null_fn(char const *, unsigned int);
short *_zero_arr_plus_short_fn(short *orig_x, unsigned int orig_sz, int orig_i,
                               const char *filename, unsigned lineno) {
  unsigned int _czs_temp;
  if ((orig_x) == 0)
    _throw_null_fn(filename, lineno);
  if (orig_i < 0 || orig_sz == 0)
    _throw_arraybounds_fn(filename, lineno);
  for (_czs_temp = orig_sz - 1; _czs_temp < orig_i; _czs_temp++)
    if (orig_x[_czs_temp] == 0)
      _throw_arraybounds_fn(filename, lineno);
  return orig_x + orig_i;
}


x86 assembly (clang, -O0):
<_zero_arr_plus_short_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1151 <_zero_arr_plus_short_fn+0x31>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <_throw_null_fn@plt>
cmpl   $0x0,-0x10(%rbp)
jl     1165 <_zero_arr_plus_short_fn+0x45>
cmpl   $0x0,-0xc(%rbp)
jne    1171 <_zero_arr_plus_short_fn+0x51>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_throw_arraybounds_fn@plt>
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x10(%rbp),%eax
jae    11b9 <_zero_arr_plus_short_fn+0x99>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
movswl (%rax,%rcx,2),%eax
cmp    $0x0,%eax
jne    11a6 <_zero_arr_plus_short_fn+0x86>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_throw_arraybounds_fn@plt>
jmp    11ab <_zero_arr_plus_short_fn+0x8b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117a <_zero_arr_plus_short_fn+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_plus_short_fn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%r13
test   %rdi,%rdi
je     1144 <_zero_arr_plus_short_fn+0x24>
test   %ebp,%ebp
jne    1153 <_zero_arr_plus_short_fn+0x33>
jmp    1158 <_zero_arr_plus_short_fn+0x38>
mov    %r12,%rdi
mov    %r15d,%esi
call   1030 <_throw_null_fn@plt>
test   %ebp,%ebp
je     1158 <_zero_arr_plus_short_fn+0x38>
test   %r14d,%r14d
jns    1163 <_zero_arr_plus_short_fn+0x43>
mov    %r12,%rdi
mov    %r15d,%esi
call   1040 <_throw_arraybounds_fn@plt>
add    $0xffffffff,%ebp
cmp    %r14d,%ebp
jae    119e <_zero_arr_plus_short_fn+0x7e>
mov    %ebp,%ebp
mov    %r14d,%ebx
jmp    1188 <_zero_arr_plus_short_fn+0x68>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    %ebp,%ebx
je     119e <_zero_arr_plus_short_fn+0x7e>
cmpw   $0x0,0x0(%r13,%rbp,2)
jne    1180 <_zero_arr_plus_short_fn+0x60>
mov    %r12,%rdi
mov    %r15d,%esi
call   1040 <_throw_arraybounds_fn@plt>
jmp    1180 <_zero_arr_plus_short_fn+0x60>
movslq %r14d,%rax
lea    0x0(,%rax,2),%rax
add    %r13,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i16* @_zero_arr_plus_short_fn(i16* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store i16* %0, i16** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load i16*, i16** %6
%13 = icmp eq i16* %12, null
br i1 %13, label %14, label %18
14: ; preds = %5
%15 = load i8*, i8** %9
%16 = load i32, i32* %10
%17 = call i32 @_throw_null_fn(i8* %15, i32 %16)
br label %18
18: ; preds = %14, %5
%19 = load i32, i32* %8
%20 = icmp slt i32 %19, 0
br i1 %20, label %24, label %21
21: ; preds = %18
%22 = load i32, i32* %7
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %21, %18
%25 = load i8*, i8** %9
%26 = load i32, i32* %10
%27 = call i32 @_throw_arraybounds_fn(i8* %25, i32 %26)
br label %28
28: ; preds = %24, %21
%29 = load i32, i32* %7
%30 = sub i32 %29, 1
store i32 %30, i32* %11
br label %31
31: ; preds = %48, %28
%32 = load i32, i32* %11
%33 = load i32, i32* %8
%34 = icmp ult i32 %32, %33
br i1 %34, label %35, label %51
35: ; preds = %31
%36 = load i16*, i16** %6
%37 = load i32, i32* %11
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i16, i16* %36, i64 %38
%40 = load i16, i16* %39
%41 = sext i16 %40 to i32
%42 = icmp eq i32 %41, 0
br i1 %42, label %43, label %47
43: ; preds = %35
%44 = load i8*, i8** %9
%45 = load i32, i32* %10
%46 = call i32 @_throw_arraybounds_fn(i8* %44, i32 %45)
br label %47
47: ; preds = %43, %35
br label %48
48: ; preds = %47
%49 = load i32, i32* %11
%50 = add i32 %49, 1
store i32 %50, i32* %11
br label %31
51: ; preds = %31
%52 = load i16*, i16** %6
%53 = load i32, i32* %8
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds i16, i16* %52, i64 %54
ret i16* %55
}

LLVM IR (-O2):
define i16* @_zero_arr_plus_short_fn(i16* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp eq i16* %0, null
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @_throw_null_fn(i8* %3, i32 %4)
br label %9
9: ; preds = %7, %5
%10 = icmp slt i32 %2, 0
%11 = icmp eq i32 %1, 0
%12 = or i1 %11, %10
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = tail call i32 @_throw_arraybounds_fn(i8* %3, i32 %4)
br label %15
15: ; preds = %9, %13
%16 = add i32 %1, -1
%17 = icmp ult i32 %16, %2
br i1 %17, label %18, label %31
18: ; preds = %15
%19 = zext i32 %16 to i64
br label %20
20: ; preds = %18, %27
%21 = phi i64 [ %19, %18 ], [ %28, %27 ]
%22 = getelementptr inbounds i16, i16* %0, i64 %21
%23 = load i16, i16* %22
%24 = icmp eq i16 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %20
%26 = tail call i32 @_throw_arraybounds_fn(i8* %3, i32 %4)
br label %27
27: ; preds = %20, %25
%28 = add nuw nsw i64 %21, 1
%29 = trunc i64 %28 to i32
%30 = icmp eq i32 %29, %2
br i1 %30, label %31, label %20
31: ; preds = %27, %15
%32 = sext i32 %2 to i64
%33 = getelementptr inbounds i16, i16* %0, i64 %32
ret i16* %33
}