#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 */
unsigned long OS_AsmMult(unsigned long, unsigned long, unsigned long *);
int /*<<< orphan*/ OS_Assert();
int /*<<< orphan*/ UartPrintfCritical(char *, char *, int);
float __divsf3(float a_fp, float b_fp) {
  unsigned long a, b, c;
  unsigned long as, af, bs, bf, cs, cf;
  unsigned long a1, b1;
  unsigned long hi, lo;
  long ae, be, ce, d;
  a = (*(unsigned long *)&(a_fp));
  b = (*(unsigned long *)&(b_fp));
  as = a >> 31;
  ae = (a >> 23) & 0xff;
  af = 0x00800000 | (a & 0x007fffff);
  bs = b >> 31;
  be = (b >> 23) & 0xff;
  bf = 0x00800000 | (b & 0x007fffff);
  cs = as ^ bs;
  ce = ae - (be - 0x80) + 6 - 8;
  a1 = af << 4;
  b1 = bf >> 8;
  cf = a1 / b1;
  cf <<= 12;
  lo = OS_AsmMult(cf, bf, &hi);
  lo = (hi << 8) | (lo >> 24);
  d = af - lo;
  if ((-0xffff < d && d < 0xffff) == 0) {
    OS_Assert();
    UartPrintfCritical(
        "\r\nAssert %s:%d\r\n",
        "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
        "2022-01-22/02-19-57/repos/karvonz/Mandelbrot/refs/heads/master/"
        "soc_plasma/vhdl/plasma_core/kernel/math.c",
        194);
  };
  d <<= 16;
  b1 = bf >> 8;
  d = d / (long)b1;
  cf += d;
  if (cf == 0)
    return (*(float *)&(cf));
  while (cf & 0xff000000) {
    ++ce;
    cf >>= 1;
  }
  if (ce < 0)
    ce = 0;
  c = (cs << 31) | (ce << 23) | (cf & 0x007fffff);
  if (ce < 1)
    c = 0;
  return (*(float *)&(c));
}


x86 assembly (clang, -O0):
<__divsf3>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x1f,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
shr    $0x17,%rax
and    $0xff,%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rax
and    $0x7fffff,%rax
or     $0x800000,%rax
mov    %rax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x1f,%rax
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x17,%rax
and    $0xff,%rax
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rax
and    $0x7fffff,%rax
or     $0x800000,%rax
mov    %rax,-0x48(%rbp)
mov    -0x30(%rbp),%rax
xor    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rcx
sub    $0x80,%rcx
sub    %rcx,%rax
add    $0x6,%rax
sub    $0x8,%rax
mov    %rax,-0x90(%rbp)
mov    -0x38(%rbp),%rax
shl    $0x4,%rax
mov    %rax,-0x60(%rbp)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x68(%rbp)
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
shl    $0xc,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x48(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1050 <OS_AsmMult@plt>
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rax
shl    $0x8,%rax
mov    -0x78(%rbp),%rcx
shr    $0x18,%rcx
or     %rcx,%rax
mov    %rax,-0x78(%rbp)
mov    -0x38(%rbp),%rax
sub    -0x78(%rbp),%rax
mov    %rax,-0x98(%rbp)
xor    %eax,%eax
mov    $0xffffffffffff0001,%rcx
cmp    -0x98(%rbp),%rcx
mov    %al,-0x99(%rbp)
jge    128b <__divsf3+0x15b>
cmpq   $0xffff,-0x98(%rbp)
setl   %al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
cmp    $0x0,%eax
jne    12be <__divsf3+0x18e>
mov    $0x0,%al
call   1040 <OS_Assert@plt>
lea    0xd53(%rip),%rdi
lea    0xd5d(%rip),%rsi
mov    $0xc2,%edx
call   1030 <UartPrintfCritical@plt>
mov    -0x98(%rbp),%rax
shl    $0x10,%rax
mov    %rax,-0x98(%rbp)
mov    -0x48(%rbp),%rax
shr    $0x8,%rax
mov    %rax,-0x68(%rbp)
mov    -0x98(%rbp),%rax
cqto
idivq  -0x68(%rbp)
mov    %rax,-0x98(%rbp)
mov    -0x98(%rbp),%rax
add    -0x58(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    1319 <__divsf3+0x1e9>
movss  -0x58(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    13ba <__divsf3+0x28a>
jmp    131e <__divsf3+0x1ee>
movabs $0xff000000,%rax
and    -0x58(%rbp),%rax
cmp    $0x0,%rax
je     1359 <__divsf3+0x229>
mov    -0x90(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x90(%rbp)
mov    -0x58(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x58(%rbp)
jmp    131e <__divsf3+0x1ee>
cmpq   $0x0,-0x90(%rbp)
jge    1372 <__divsf3+0x242>
movq   $0x0,-0x90(%rbp)
mov    -0x50(%rbp),%rax
shl    $0x1f,%rax
mov    -0x90(%rbp),%rcx
shl    $0x17,%rcx
or     %rcx,%rax
mov    -0x58(%rbp),%rcx
and    $0x7fffff,%rcx
or     %rcx,%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x1,-0x90(%rbp)
01
jge    13b0 <__divsf3+0x280>
movq   $0x0,-0x28(%rbp)
movss  -0x28(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__divsf3>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
movd   %xmm0,0x10(%rsp)
movss  %xmm1,0x8(%rsp)
mov    0x10(%rsp),%r12
mov    0x8(%rsp),%r15
mov    %r12d,%ebx
and    $0x7fffff,%ebx
or     $0x800000,%rbx
mov    %r15d,%esi
and    $0x7fffff,%esi
or     $0x800000,%rsi
mov    %rsi,%r13
shr    $0x8,%r13
mov    %ebx,%eax
shl    $0x4,%eax
xor    %edx,%edx
div    %r13d
mov    %eax,%r14d
shl    $0xc,%r14
lea    0x18(%rsp),%rdx
mov    %r14,%rdi
call   1050 <OS_AsmMult@plt>
mov    0x18(%rsp),%rcx
shl    $0x8,%rcx
shr    $0x18,%rax
or     %rcx,%rax
sub    %rax,%rbx
lea    -0xffff(%rbx),%rax
cmp    $0xfffffffffffe0002,%rax
ja     11d9 <__divsf3+0xa9>
xor    %eax,%eax
call   1040 <OS_Assert@plt>
lea    0xe38(%rip),%rdi
lea    0xe42(%rip),%rsi
mov    $0xc2,%edx
call   1030 <UartPrintfCritical@plt>
shl    $0x10,%rbx
mov    %rbx,%rax
shr    $0x20,%rax
je     11f5 <__divsf3+0xc5>
mov    %rbx,%rax
cqto
idiv   %r13
add    %r14,%rax
jne    1201 <__divsf3+0xd1>
jmp    1253 <__divsf3+0x123>
mov    %ebx,%eax
xor    %edx,%edx
div    %r13d
add    %r14,%rax
je     1253 <__divsf3+0x123>
mov    %r12d,%ecx
shr    $0x17,%ecx
mov    %r15d,%esi
shr    $0x17,%esi
movzbl %cl,%edx
movzbl %sil,%ecx
sub    %rcx,%rdx
add    $0x7e,%rdx
test   $0xff000000,%eax
je     1241 <__divsf3+0x111>
movabs $0x1fe000000,%rsi
mov    %rax,%rcx
nop
add    $0x1,%rdx
shr    %rcx
test   %rsi,%rax
mov    %rcx,%rax
jne    1230 <__divsf3+0x100>
jmp    1244 <__divsf3+0x114>
mov    %rax,%rcx
mov    %edx,%esi
shl    $0x17,%esi
xor    %eax,%eax
test   %rdx,%rdx
cmovg  %esi,%eax
jg     1259 <__divsf3+0x129>
pxor   %xmm0,%xmm0
jmp    1274 <__divsf3+0x144>
xor    %r12d,%r15d
and    $0x80000000,%r15d
and    $0x7fffff,%ecx
or     %ecx,%r15d
or     %eax,%r15d
movd   %r15d,%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [17 x i8] c"\0D\0AAssert %s:%d\0D\0A\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/karvonz/Mandelbrot/refs/heads/master/soc_plasma/vhdl/plasma_core/kernel/math.c\00"
define float @__divsf3(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
%21 = alloca i64
%22 = alloca i64
store float %0, float* %4
store float %1, float* %5
%23 = bitcast float* %4 to i64*
%24 = load i64, i64* %23
store i64 %24, i64* %6
%25 = bitcast float* %5 to i64*
%26 = load i64, i64* %25
store i64 %26, i64* %7
%27 = load i64, i64* %6
%28 = lshr i64 %27, 31
store i64 %28, i64* %9
%29 = load i64, i64* %6
%30 = lshr i64 %29, 23
%31 = and i64 %30, 255
store i64 %31, i64* %19
%32 = load i64, i64* %6
%33 = and i64 %32, 8388607
%34 = or i64 8388608, %33
store i64 %34, i64* %10
%35 = load i64, i64* %7
%36 = lshr i64 %35, 31
store i64 %36, i64* %11
%37 = load i64, i64* %7
%38 = lshr i64 %37, 23
%39 = and i64 %38, 255
store i64 %39, i64* %20
%40 = load i64, i64* %7
%41 = and i64 %40, 8388607
%42 = or i64 8388608, %41
store i64 %42, i64* %12
%43 = load i64, i64* %9
%44 = load i64, i64* %11
%45 = xor i64 %43, %44
store i64 %45, i64* %13
%46 = load i64, i64* %19
%47 = load i64, i64* %20
%48 = sub nsw i64 %47, 128
%49 = sub nsw i64 %46, %48
%50 = add nsw i64 %49, 6
%51 = sub nsw i64 %50, 8
store i64 %51, i64* %21
%52 = load i64, i64* %10
%53 = shl i64 %52, 4
store i64 %53, i64* %15
%54 = load i64, i64* %12
%55 = lshr i64 %54, 8
store i64 %55, i64* %16
%56 = load i64, i64* %15
%57 = load i64, i64* %16
%58 = udiv i64 %56, %57
store i64 %58, i64* %14
%59 = load i64, i64* %14
%60 = shl i64 %59, 12
store i64 %60, i64* %14
%61 = load i64, i64* %14
%62 = load i64, i64* %12
%63 = call i64 @OS_AsmMult(i64 %61, i64 %62, i64* %17)
store i64 %63, i64* %18
%64 = load i64, i64* %17
%65 = shl i64 %64, 8
%66 = load i64, i64* %18
%67 = lshr i64 %66, 24
%68 = or i64 %65, %67
store i64 %68, i64* %18
%69 = load i64, i64* %10
%70 = load i64, i64* %18
%71 = sub i64 %69, %70
store i64 %71, i64* %22
%72 = load i64, i64* %22
%73 = icmp slt i64 -65535, %72
br i1 %73, label %74, label %77
74: ; preds = %2
%75 = load i64, i64* %22
%76 = icmp slt i64 %75, 65535
br label %77
77: ; preds = %74, %2
%78 = phi i1 [ false, %2 ], [ %76, %74 ]
%79 = zext i1 %78 to i32
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %77
%82 = call i32 (...) @OS_Assert()
%83 = call i32 @UartPrintfCritical(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 194)
br label %84
84: ; preds = %81, %77
%85 = load i64, i64* %22
%86 = shl i64 %85, 16
store i64 %86, i64* %22
%87 = load i64, i64* %12
%88 = lshr i64 %87, 8
store i64 %88, i64* %16
%89 = load i64, i64* %22
%90 = load i64, i64* %16
%91 = sdiv i64 %89, %90
store i64 %91, i64* %22
%92 = load i64, i64* %22
%93 = load i64, i64* %14
%94 = add i64 %93, %92
store i64 %94, i64* %14
%95 = load i64, i64* %14
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %100
97: ; preds = %84
%98 = bitcast i64* %14 to float*
%99 = load float, float* %98
store float %99, float* %3
br label %129
100: ; preds = %84
br label %101
101: ; preds = %105, %100
%102 = load i64, i64* %14
%103 = and i64 %102, 4278190080
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %110
105: ; preds = %101
%106 = load i64, i64* %21
%107 = add nsw i64 %106, 1
store i64 %107, i64* %21
%108 = load i64, i64* %14
%109 = lshr i64 %108, 1
store i64 %109, i64* %14
br label %101
110: ; preds = %101
%111 = load i64, i64* %21
%112 = icmp slt i64 %111, 0
br i1 %112, label %113, label %114
113: ; preds = %110
store i64 0, i64* %21
br label %114
114: ; preds = %113, %110
%115 = load i64, i64* %13
%116 = shl i64 %115, 31
%117 = load i64, i64* %21
%118 = shl i64 %117, 23
%119 = or i64 %116, %118
%120 = load i64, i64* %14
%121 = and i64 %120, 8388607
%122 = or i64 %119, %121
store i64 %122, i64* %8
%123 = load i64, i64* %21
%124 = icmp slt i64 %123, 1
br i1 %124, label %125, label %126
125: ; preds = %114
store i64 0, i64* %8
br label %126
126: ; preds = %125, %114
%127 = bitcast i64* %8 to float*
%128 = load float, float* %127
store float %128, float* %3
br label %129
129: ; preds = %126, %97
%130 = load float, float* %3
ret float %130
}

LLVM IR (-O2):
@.str = [17 x i8] c"\0D\0AAssert %s:%d\0D\0A\00"
@.str.1 = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/karvonz/Mandelbrot/refs/heads/master/soc_plasma/vhdl/plasma_core/kernel/math.c\00"
define float @__divsf3(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca i64
store float %0, float* %3
store float %1, float* %4
%6 = bitcast i64* %5 to i8*
%7 = bitcast float* %3 to i64*
%8 = load i64, i64* %7
%9 = bitcast float* %4 to i64*
%10 = load i64, i64* %9
%11 = lshr i64 %8, 23
%12 = and i64 %11, 255
%13 = and i64 %8, 8388607
%14 = or i64 %13, 8388608
%15 = lshr i64 %10, 23
%16 = and i64 %15, 255
%17 = and i64 %10, 8388607
%18 = or i64 %17, 8388608
%19 = xor i64 %10, %8
%20 = and i64 %19, 2147483648
%21 = add nuw nsw i64 %12, 126
%22 = sub nsw i64 %21, %16
%23 = shl nuw nsw i64 %14, 4
%24 = lshr i64 %18, 8
%25 = udiv i64 %23, %24
%26 = shl nuw nsw i64 %25, 12
%27 = call i64 @OS_AsmMult(i64 %26, i64 %18, i64* %5)
%28 = load i64, i64* %5
%29 = shl i64 %28, 8
%30 = lshr i64 %27, 24
%31 = or i64 %29, %30
%32 = sub i64 %14, %31
%33 = add i64 %32, -65535
%34 = icmp ult i64 %33, -131069
br i1 %34, label %35, label %38
35: ; preds = %2
%36 = call i32 (...) @OS_Assert()
%37 = call i32 @UartPrintfCritical(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str.1, i64 0, i64 0), i32 194)
br label %38
38: ; preds = %35, %2
%39 = shl i64 %32, 16
%40 = sdiv i64 %39, %24
%41 = add nsw i64 %40, %26
%42 = icmp eq i64 %41, 0
br i1 %42, label %65, label %43
43: ; preds = %38
%44 = and i64 %41, 4278190080
%45 = icmp eq i64 %44, 0
br i1 %45, label %53, label %46
46: ; preds = %43, %46
%47 = phi i64 [ %49, %46 ], [ %22, %43 ]
%48 = phi i64 [ %50, %46 ], [ %41, %43 ]
%49 = add nsw i64 %47, 1
%50 = lshr i64 %48, 1
%51 = and i64 %48, 8556380160
%52 = icmp eq i64 %51, 0
br i1 %52, label %53, label %46
53: ; preds = %46, %43
%54 = phi i64 [ %41, %43 ], [ %50, %46 ]
%55 = phi i64 [ %22, %43 ], [ %49, %46 ]
%56 = icmp sgt i64 %55, 0
%57 = shl i64 %55, 23
%58 = select i1 %56, i64 %57, i64 0
%59 = and i64 %54, 8388607
%60 = or i64 %59, %20
%61 = or i64 %60, %58
%62 = trunc i64 %61 to i32
%63 = bitcast i32 %62 to float
%64 = select i1 %56, float %63, float 0.000000e+00
br label %65
65: ; preds = %38, %53
%66 = phi float [ %64, %53 ], [ 0.000000e+00, %38 ]
ret float %66
}