int lib$ffc(int *pos, char *size, int *base, int *ret) {
  int retval;
  if ((*size) <= 32) {
    if ((*base) == 0xffffffff) {
      *ret = *size;
      return 0x00158274;
    }
    retval = find_next_zero_bit(base, *size, *pos);
  } else {
    printf("ffc retval for > 32 bit size not yet implemented");
    return 0x00158274;
    retval = find_next_zero_bit(base, *size, *pos);
  }
  if (retval >= (*size))
    return 0x00158274;
  *ret = retval;
  return 1;
}


x86 assembly (clang, -O0):
<lib$ffc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jg     118e <lib$ffc+0x6e>
mov    -0x20(%rbp),%rax
cmpl   $0xffffffff,(%rax)
jne    116e <lib$ffc+0x4e>
mov    -0x18(%rbp),%rax
movsbl (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x158274,-0x4(%rbp)
jmp    11d6 <lib$ffc+0xb6>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1040 <find_next_zero_bit@plt>
mov    %eax,-0x2c(%rbp)
jmp    11a8 <lib$ffc+0x88>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x158274,-0x4(%rbp)
jmp    11d6 <lib$ffc+0xb6>
mov    -0x2c(%rbp),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jl     11c6 <lib$ffc+0xa6>
movl   $0x158274,-0x4(%rbp)
jmp    11d6 <lib$ffc+0xb6>
mov    -0x2c(%rbp),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lib$ffc>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
movsbl (%rsi),%esi
cmp    $0x20,%esi
jg     115d <lib$ffc+0x3d>
mov    %rcx,%r14
cmpl   $0xffffffff,(%rdx)
je     116d <lib$ffc+0x4d>
mov    (%rdi),%eax
mov    %rdx,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <find_next_zero_bit@plt>
mov    %eax,%ecx
movsbl (%rbx),%edx
mov    $0x158274,%eax
cmp    %edx,%ecx
jge    1175 <lib$ffc+0x55>
mov    %ecx,(%r14)
mov    $0x1,%eax
jmp    1175 <lib$ffc+0x55>
lea    0xe9c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1170 <lib$ffc+0x50>
mov    %esi,(%r14)
mov    $0x158274,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [49 x i8] c"ffc retval for > 32 bit size not yet implemented\00"
define i32 @"lib$ffc"(i32* %0, i8* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
%11 = load i8*, i8** %7
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp sle i32 %13, 32
br i1 %14, label %15, label %32
15: ; preds = %4
%16 = load i32*, i32** %8
%17 = load i32, i32* %16
%18 = icmp eq i32 %17, -1
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = load i8*, i8** %7
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i32*, i32** %9
store i32 %22, i32* %23
store i32 1409652, i32* %5
br label %44
24: ; preds = %15
%25 = load i32*, i32** %8
%26 = load i8*, i8** %7
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = load i32*, i32** %6
%30 = load i32, i32* %29
%31 = call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @find_next_zero_bit to i32 (i32*, i32, i32, ...)*)(i32* %25, i32 %28, i32 %30)
store i32 %31, i32* %10
br label %34
32: ; preds = %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
store i32 1409652, i32* %5
br label %44
34: ; preds = %24
%35 = load i32, i32* %10
%36 = load i8*, i8** %7
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = icmp sge i32 %35, %38
br i1 %39, label %40, label %41
40: ; preds = %34
store i32 1409652, i32* %5
br label %44
41: ; preds = %34
%42 = load i32, i32* %10
%43 = load i32*, i32** %9
store i32 %42, i32* %43
store i32 1, i32* %5
br label %44
44: ; preds = %41, %40, %32, %19
%45 = load i32, i32* %5
ret i32 %45
}

LLVM IR (-O2):
@.str = [49 x i8] c"ffc retval for > 32 bit size not yet implemented\00"
define i32 @"lib$ffc"(i32* nocapture %0, i8* nocapture %1, i32* %2, i32* nocapture writeonly %3) {
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
%7 = icmp slt i8 %5, 33
br i1 %7, label %8, label %18
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 %6, i32* %3
br label %21
12: ; preds = %8
%13 = load i32, i32* %0
%14 = tail call i32 (i32*, i32, i32, ...) bitcast (i32 (...)* @find_next_zero_bit to i32 (i32*, i32, i32, ...)*)(i32* %2, i32 %6, i32 %13)
%15 = load i8, i8* %1
%16 = sext i8 %15 to i32
%17 = icmp slt i32 %14, %16
br i1 %17, label %20, label %21
18: ; preds = %4
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
br label %21
20: ; preds = %12
store i32 %14, i32* %3
br label %21
21: ; preds = %12, %20, %18, %11
%22 = phi i32 [ 1409652, %11 ], [ 1, %20 ], [ 1409652, %18 ], [ 1409652, %12 ]
ret i32 %22
}