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

/* Variables and functions */
int softfloat_countLeadingZeros32(scalar_t__);
int /*<<< orphan*/ softfloat_shiftLeftM(int, scalar_t__ *, int, scalar_t__ *);
int softfloat_normSubnormalF128SigM(uint32_t *sigPtr) {
  const uint32_t *ptr;
  int_fast16_t shiftDist;
  uint32_t wordSig;
  ptr = sigPtr + ((4) - 1);
  shiftDist = 0;
  for (;;) {
    wordSig = *ptr;
    if (wordSig)
      break;
    shiftDist += 32;
    if (128 <= shiftDist)
      return 1;
    ptr -= 1;
  }
  shiftDist += softfloat_countLeadingZeros32(wordSig) - 15;
  if (shiftDist)
    softfloat_shiftLeftM(4, sigPtr, shiftDist, sigPtr);
  return 1 - shiftDist;
}


x86 assembly (clang, -O0):
<softfloat_normSubnormalF128SigM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     115a <softfloat_normSubnormalF128SigM+0x3a>
jmp    118e <softfloat_normSubnormalF128SigM+0x6e>
mov    -0x1c(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x80,%eax
cmp    -0x1c(%rbp),%eax
jg     117d <softfloat_normSubnormalF128SigM+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    11ca <softfloat_normSubnormalF128SigM+0xaa>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffff8,%rax
mov    %rax,-0x18(%rbp)
jmp    113f <softfloat_normSubnormalF128SigM+0x1f>
mov    -0x28(%rbp),%rdi
call   1040 <softfloat_countLeadingZeros32@plt>
sub    $0xf,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11bf <softfloat_normSubnormalF128SigM+0x9f>
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    $0x4,%edi
call   1030 <softfloat_shiftLeftM@plt>
mov    $0x1,%eax
sub    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_normSubnormalF128SigM>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    0x18(%rdi),%rdi
mov    $0xfffffff1,%r14d
test   %rdi,%rdi
jne    1162 <softfloat_normSubnormalF128SigM+0x42>
mov    0x10(%rbx),%rdi
mov    $0x11,%r14d
test   %rdi,%rdi
jne    1162 <softfloat_normSubnormalF128SigM+0x42>
mov    0x8(%rbx),%rdi
mov    $0x31,%r14d
test   %rdi,%rdi
jne    1162 <softfloat_normSubnormalF128SigM+0x42>
mov    (%rbx),%rdi
mov    $0x51,%r14d
test   %rdi,%rdi
je     118c <softfloat_normSubnormalF128SigM+0x6c>
call   1040 <softfloat_countLeadingZeros32@plt>
mov    %eax,%ebp
add    %r14d,%ebp
je     1180 <softfloat_normSubnormalF128SigM+0x60>
mov    $0x4,%edi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %rbx,%rcx
call   1030 <softfloat_shiftLeftM@plt>
mov    $0x1,%eax
sub    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0x1,%eax
jmp    1187 <softfloat_normSubnormalF128SigM+0x67>

LLVM IR (-O0):
define i32 @softfloat_normSubnormalF128SigM(i64* %0) {
%2 = alloca i32
%3 = alloca i64*
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i64
store i64* %0, i64** %3
%7 = load i64*, i64** %3
%8 = getelementptr inbounds i64, i64* %7, i64 3
store i64* %8, i64** %4
store i32 0, i32* %5
br label %9
9: ; preds = %21, %1
%10 = load i64*, i64** %4
%11 = load i64, i64* %10
store i64 %11, i64* %6
%12 = load i64, i64* %6
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %15
14: ; preds = %9
br label %24
15: ; preds = %9
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 32
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp sle i32 128, %18
br i1 %19, label %20, label %21
20: ; preds = %15
store i32 1, i32* %2
br label %40
21: ; preds = %15
%22 = load i64*, i64** %4
%23 = getelementptr inbounds i64, i64* %22, i64 -1
store i64* %23, i64** %4
br label %9
24: ; preds = %14
%25 = load i64, i64* %6
%26 = call i32 @softfloat_countLeadingZeros32(i64 %25)
%27 = sub nsw i32 %26, 15
%28 = load i32, i32* %5
%29 = add nsw i32 %28, %27
store i32 %29, i32* %5
%30 = load i32, i32* %5
%31 = icmp ne i32 %30, 0
br i1 %31, label %32, label %37
32: ; preds = %24
%33 = load i64*, i64** %3
%34 = load i32, i32* %5
%35 = load i64*, i64** %3
%36 = call i32 @softfloat_shiftLeftM(i32 4, i64* %33, i32 %34, i64* %35)
br label %37
37: ; preds = %32, %24
%38 = load i32, i32* %5
%39 = sub nsw i32 1, %38
store i32 %39, i32* %2
br label %40
40: ; preds = %37, %20
%41 = load i32, i32* %2
ret i32 %41
}

LLVM IR (-O2):
define i32 @softfloat_normSubnormalF128SigM(i64* %0) {
%2 = getelementptr inbounds i64, i64* %0, i64 3
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %16
5: ; preds = %1
%6 = getelementptr inbounds i64, i64* %0, i64 2
%7 = load i64, i64* %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = getelementptr inbounds i64, i64* %0, i64 1
%11 = load i64, i64* %10
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %9
%14 = load i64, i64* %0
%15 = icmp eq i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %5, %9, %13, %1
%17 = phi i32 [ -15, %1 ], [ 17, %5 ], [ 49, %9 ], [ 81, %13 ]
%18 = phi i64 [ %3, %1 ], [ %7, %5 ], [ %11, %9 ], [ %14, %13 ]
%19 = tail call i32 @softfloat_countLeadingZeros32(i64 %18)
%20 = add i32 %17, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %16
%23 = tail call i32 @softfloat_shiftLeftM(i32 4, i64* %0, i32 %20, i64* %0)
br label %24
24: ; preds = %22, %16
%25 = sub nsw i32 1, %20
br label %26
26: ; preds = %13, %24
%27 = phi i32 [ %25, %24 ], [ 1, %13 ]
ret i32 %27
}