#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);
double *_zero_arr_plus_double_fn(double *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_double_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_double_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_double_fn+0x45>
cmpl   $0x0,-0xc(%rbp)
jne    1171 <_zero_arr_plus_double_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    11c4 <_zero_arr_plus_double_fn+0xa4>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
movsd  (%rax,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11b1 <_zero_arr_plus_double_fn+0x91>
jp     11b1 <_zero_arr_plus_double_fn+0x91>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <_throw_arraybounds_fn@plt>
jmp    11b6 <_zero_arr_plus_double_fn+0x96>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    117a <_zero_arr_plus_double_fn+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_zero_arr_plus_double_fn>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %rcx,%r13
mov    %edx,%ebx
mov    %esi,%r12d
mov    %rdi,%r14
test   %rdi,%rdi
je     1145 <_zero_arr_plus_double_fn+0x25>
test   %r12d,%r12d
jne    1155 <_zero_arr_plus_double_fn+0x35>
jmp    1159 <_zero_arr_plus_double_fn+0x39>
mov    %r13,%rdi
mov    %r15d,%esi
call   1030 <_throw_null_fn@plt>
test   %r12d,%r12d
je     1159 <_zero_arr_plus_double_fn+0x39>
test   %ebx,%ebx
jns    1164 <_zero_arr_plus_double_fn+0x44>
mov    %r13,%rdi
mov    %r15d,%esi
call   1040 <_throw_arraybounds_fn@plt>
add    $0xffffffff,%r12d
mov    %ebx,0x4(%rsp)
cmp    %ebx,%r12d
jae    11a7 <_zero_arr_plus_double_fn+0x87>
mov    %r12d,%ebp
mov    0x4(%rsp),%ebx
jmp    1188 <_zero_arr_plus_double_fn+0x68>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %ebp,%ebx
je     11a7 <_zero_arr_plus_double_fn+0x87>
movsd  (%r14,%rbp,8),%xmm0
ucomisd 0xe6a(%rip),%xmm0
jne    1180 <_zero_arr_plus_double_fn+0x60>
jp     1180 <_zero_arr_plus_double_fn+0x60>
mov    %r13,%rdi
mov    %r15d,%esi
call   1040 <_throw_arraybounds_fn@plt>
jmp    1180 <_zero_arr_plus_double_fn+0x60>
movslq 0x4(%rsp),%rax
lea    (%r14,%rax,8),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define double* @_zero_arr_plus_double_fn(double* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i32 %4, i32* %10
%12 = load double*, double** %6
%13 = icmp eq double* %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 = %47, %28
%32 = load i32, i32* %11
%33 = load i32, i32* %8
%34 = icmp ult i32 %32, %33
br i1 %34, label %35, label %50
35: ; preds = %31
%36 = load double*, double** %6
%37 = load i32, i32* %11
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = fcmp oeq double %40, 0.000000e+00
br i1 %41, label %42, label %46
42: ; preds = %35
%43 = load i8*, i8** %9
%44 = load i32, i32* %10
%45 = call i32 @_throw_arraybounds_fn(i8* %43, i32 %44)
br label %46
46: ; preds = %42, %35
br label %47
47: ; preds = %46
%48 = load i32, i32* %11
%49 = add i32 %48, 1
store i32 %49, i32* %11
br label %31
50: ; preds = %31
%51 = load double*, double** %6
%52 = load i32, i32* %8
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds double, double* %51, i64 %53
ret double* %54
}

LLVM IR (-O2):
define double* @_zero_arr_plus_double_fn(double* %0, i32 %1, i32 %2, i8* %3, i32 %4) {
%6 = icmp eq double* %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 double, double* %0, i64 %21
%23 = load double, double* %22
%24 = fcmp oeq double %23, 0.000000e+00
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 double, double* %0, i64 %32
ret double* %33
}