int _get_zero_arr_size_double(const double *orig_x, unsigned int orig_offset) {
  const double *_gres_x = orig_x;
  unsigned int _gres = 0;
  if (_gres_x != 0) {
    _gres = orig_offset;
    _gres_x += orig_offset - 1;
    while (*_gres_x != 0) {
      _gres_x++;
      _gres++;
    }
  }
  return _gres;
}


x86 assembly (clang, -O0):
<_get_zero_arr_size_double>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1181 <_get_zero_arr_size_double+0x81>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1162 <_get_zero_arr_size_double+0x62>
jp     1162 <_get_zero_arr_size_double+0x62>
jmp    117c <_get_zero_arr_size_double+0x7c>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <_get_zero_arr_size_double+0x42>
jmp    1181 <_get_zero_arr_size_double+0x81>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_zero_arr_size_double>:
test   %rdi,%rdi
je     1144 <_get_zero_arr_size_double+0x44>
mov    %esi,%eax
lea    -0x1(%rax),%ecx
movsd  (%rdi,%rcx,8),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    111b <_get_zero_arr_size_double+0x1b>
jnp    1143 <_get_zero_arr_size_double+0x43>
lea    (%rdi,%rcx,8),%rcx
add    $0x8,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%eax
movsd  (%rcx),%xmm1
add    $0x8,%rcx
ucomisd %xmm0,%xmm1
jne    1130 <_get_zero_arr_size_double+0x30>
jp     1130 <_get_zero_arr_size_double+0x30>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @_get_zero_arr_size_double(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%7 = load double*, double** %3
store double* %7, double** %5
store i32 0, i32* %6
%8 = load double*, double** %5
%9 = icmp ne double* %8, null
br i1 %9, label %10, label %27
10: ; preds = %2
%11 = load i32, i32* %4
store i32 %11, i32* %6
%12 = load i32, i32* %4
%13 = sub i32 %12, 1
%14 = load double*, double** %5
%15 = zext i32 %13 to i64
%16 = getelementptr inbounds double, double* %14, i64 %15
store double* %16, double** %5
br label %17
17: ; preds = %21, %10
%18 = load double*, double** %5
%19 = load double, double* %18
%20 = fcmp une double %19, 0.000000e+00
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load double*, double** %5
%23 = getelementptr inbounds double, double* %22, i32 1
store double* %23, double** %5
%24 = load i32, i32* %6
%25 = add i32 %24, 1
store i32 %25, i32* %6
br label %17
26: ; preds = %17
br label %27
27: ; preds = %26, %2
%28 = load i32, i32* %6
ret i32 %28
}

LLVM IR (-O2):
define i32 @_get_zero_arr_size_double(double* %0, i32 %1) {
%3 = icmp eq double* %0, null
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = add i32 %1, -1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds double, double* %0, i64 %6
%8 = load double, double* %7
%9 = fcmp une double %8, 0.000000e+00
br i1 %9, label %10, label %17
10: ; preds = %4, %10
%11 = phi i32 [ %14, %10 ], [ %1, %4 ]
%12 = phi double* [ %13, %10 ], [ %7, %4 ]
%13 = getelementptr inbounds double, double* %12, i64 1
%14 = add i32 %11, 1
%15 = load double, double* %13
%16 = fcmp une double %15, 0.000000e+00
br i1 %16, label %10, label %17
17: ; preds = %10, %4, %2
%18 = phi i32 [ 0, %2 ], [ %1, %4 ], [ %14, %10 ]
ret i32 %18
}