#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 + 0;
  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
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1156 <softfloat_normSubnormalF128SigM+0x36>
jmp    118a <softfloat_normSubnormalF128SigM+0x6a>
mov    -0x1c(%rbp),%eax
add    $0x20,%eax
mov    %eax,-0x1c(%rbp)
mov    $0x80,%eax
cmp    -0x1c(%rbp),%eax
jg     1179 <softfloat_normSubnormalF128SigM+0x59>
movl   $0x1,-0x4(%rbp)
jmp    11c6 <softfloat_normSubnormalF128SigM+0xa6>
mov    -0x18(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    113b <softfloat_normSubnormalF128SigM+0x1b>
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     11bb <softfloat_normSubnormalF128SigM+0x9b>
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    (%rdi),%rdi
mov    $0xfffffff1,%r14d
test   %rdi,%rdi
jne    1162 <softfloat_normSubnormalF128SigM+0x42>
mov    0x8(%rbx),%rdi
mov    $0x11,%r14d
test   %rdi,%rdi
jne    1162 <softfloat_normSubnormalF128SigM+0x42>
mov    0x10(%rbx),%rdi
mov    $0x31,%r14d
test   %rdi,%rdi
jne    1162 <softfloat_normSubnormalF128SigM+0x42>
mov    0x18(%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 0
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 = load i64, i64* %0
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %16
4: ; preds = %1
%5 = getelementptr inbounds i64, i64* %0, i64 1
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = getelementptr inbounds i64, i64* %0, i64 3
%14 = load i64, i64* %13
%15 = icmp eq i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %4, %8, %12, %1
%17 = phi i32 [ -15, %1 ], [ 17, %4 ], [ 49, %8 ], [ 81, %12 ]
%18 = phi i64 [ %2, %1 ], [ %6, %4 ], [ %10, %8 ], [ %14, %12 ]
%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 = %12, %24
%27 = phi i32 [ %25, %24 ], [ 1, %12 ]
ret i32 %27
}