#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*/ assert(int);
int Abc_TtSuppFindFirst(int Supp) {
  int i;
  assert(Supp > 0);
  for (i = 0; i < 32; i++)
    if (Supp & (1 << i))
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<Abc_TtSuppFindFirst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x20,-0xc(%rbp)
jge    1175 <Abc_TtSuppFindFirst+0x65>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1162 <Abc_TtSuppFindFirst+0x52>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    117c <Abc_TtSuppFindFirst+0x6c>
jmp    1167 <Abc_TtSuppFindFirst+0x57>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <Abc_TtSuppFindFirst+0x23>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Abc_TtSuppFindFirst>:
push   %rbx
mov    %edi,%ebx
xor    %edi,%edi
test   %ebx,%ebx
setg   %dil
call   1030 <assert@plt>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
bt     %eax,%ebx
jb     1163 <Abc_TtSuppFindFirst+0x53>
lea    0x1(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%ebx
jb     1165 <Abc_TtSuppFindFirst+0x55>
lea    0x2(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%ebx
jb     116a <Abc_TtSuppFindFirst+0x5a>
lea    0x3(%rax),%ecx
movzbl %cl,%ecx
bt     %ecx,%ebx
jb     116f <Abc_TtSuppFindFirst+0x5f>
add    $0x4,%eax
cmp    $0x20,%eax
jne    1130 <Abc_TtSuppFindFirst+0x20>
mov    $0xffffffff,%eax
pop    %rbx
ret
add    $0x1,%eax
pop    %rbx
ret
add    $0x2,%eax
pop    %rbx
ret
add    $0x3,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Abc_TtSuppFindFirst(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = icmp sgt i32 %5, 0
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
store i32 0, i32* %4
br label %9
9: ; preds = %21, %1
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 32
br i1 %11, label %12, label %24
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = shl i32 1, %14
%16 = and i32 %13, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %12
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %25
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %9
24: ; preds = %9
store i32 -1, i32* %2
br label %25
25: ; preds = %24, %18
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @Abc_TtSuppFindFirst(i32 %0) {
%2 = icmp sgt i32 %0, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
br label %5
5: ; preds = %25, %1
%6 = phi i32 [ 0, %1 ], [ %26, %25 ]
%7 = shl nuw i32 1, %6
%8 = and i32 %7, %0
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %28
10: ; preds = %5
%11 = or i32 %6, 1
%12 = shl nuw i32 1, %11
%13 = and i32 %12, %0
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %28
15: ; preds = %10
%16 = or i32 %6, 2
%17 = shl nuw i32 1, %16
%18 = and i32 %17, %0
%19 = icmp eq i32 %18, 0
br i1 %19, label %20, label %28
20: ; preds = %15
%21 = or i32 %6, 3
%22 = shl nuw i32 1, %21
%23 = and i32 %22, %0
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %28
25: ; preds = %20
%26 = add nuw nsw i32 %6, 4
%27 = icmp eq i32 %26, 32
br i1 %27, label %28, label %5
28: ; preds = %25, %20, %15, %10, %5
%29 = phi i32 [ %6, %5 ], [ %11, %10 ], [ %16, %15 ], [ %21, %20 ], [ -1, %25 ]
ret i32 %29
}