int _get_zero_arr_size_longdouble(const long double *orig_x,
                                  unsigned int orig_offset) {
  const long 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_longdouble>:
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     1180 <_get_zero_arr_size_longdouble+0x80>
mov    -0xc(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,%ecx
shl    $0x4,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
fldt   (%rax)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1161 <_get_zero_arr_size_longdouble+0x61>
jp     1161 <_get_zero_arr_size_longdouble+0x61>
jmp    117b <_get_zero_arr_size_longdouble+0x7b>
mov    -0x18(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1142 <_get_zero_arr_size_longdouble+0x42>
jmp    1180 <_get_zero_arr_size_longdouble+0x80>
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_get_zero_arr_size_longdouble>:
test   %rdi,%rdi
je     1142 <_get_zero_arr_size_longdouble+0x42>
mov    %esi,%eax
lea    -0x1(%rax),%ecx
shl    $0x4,%rcx
fldt   (%rdi,%rcx,1)
fldz
fxch   %st(1)
fucomip %st(1),%st
jne    111b <_get_zero_arr_size_longdouble+0x1b>
jnp    1146 <_get_zero_arr_size_longdouble+0x46>
add    %rdi,%rcx
add    $0x10,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%eax
fldt   (%rcx)
add    $0x10,%rcx
fucomip %st(1),%st
jne    1130 <_get_zero_arr_size_longdouble+0x30>
jp     1130 <_get_zero_arr_size_longdouble+0x30>
fstp   %st(0)
ret
xor    %eax,%eax
jmp    1148 <_get_zero_arr_size_longdouble+0x48>
fstp   %st(0)
fldz
fstp   %st(0)
ret

LLVM IR (-O0):
define i32 @_get_zero_arr_size_longdouble(x86_fp80* %0, i32 %1) {
%3 = alloca x86_fp80*
%4 = alloca i32
%5 = alloca x86_fp80*
%6 = alloca i32
store x86_fp80* %0, x86_fp80** %3
store i32 %1, i32* %4
%7 = load x86_fp80*, x86_fp80** %3
store x86_fp80* %7, x86_fp80** %5
store i32 0, i32* %6
%8 = load x86_fp80*, x86_fp80** %5
%9 = icmp ne x86_fp80* %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 x86_fp80*, x86_fp80** %5
%15 = zext i32 %13 to i64
%16 = getelementptr inbounds x86_fp80, x86_fp80* %14, i64 %15
store x86_fp80* %16, x86_fp80** %5
br label %17
17: ; preds = %21, %10
%18 = load x86_fp80*, x86_fp80** %5
%19 = load x86_fp80, x86_fp80* %18
%20 = fcmp une x86_fp80 %19, 0xK00000000000000000000
br i1 %20, label %21, label %26
21: ; preds = %17
%22 = load x86_fp80*, x86_fp80** %5
%23 = getelementptr inbounds x86_fp80, x86_fp80* %22, i32 1
store x86_fp80* %23, x86_fp80** %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_longdouble(x86_fp80* %0, i32 %1) {
%3 = icmp eq x86_fp80* %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 x86_fp80, x86_fp80* %0, i64 %6
%8 = load x86_fp80, x86_fp80* %7
%9 = fcmp une x86_fp80 %8, 0xK00000000000000000000
br i1 %9, label %10, label %17
10: ; preds = %4, %10
%11 = phi i32 [ %14, %10 ], [ %1, %4 ]
%12 = phi x86_fp80* [ %13, %10 ], [ %7, %4 ]
%13 = getelementptr inbounds x86_fp80, x86_fp80* %12, i64 1
%14 = add i32 %11, 1
%15 = load x86_fp80, x86_fp80* %13
%16 = fcmp une x86_fp80 %15, 0xK00000000000000000000
br i1 %16, label %10, label %17
17: ; preds = %10, %4, %2
%18 = phi i32 [ 0, %2 ], [ %1, %4 ], [ %14, %10 ]
ret i32 %18
}