#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 */
scalar_t__ approxf(float, int /*<<< orphan*/);
int roots1rf(float a, float b, float z[1]) {
  if (approxf(a, 0)) {
    if (approxf(b, 0)) {
      z[0] = 0;
      return 1;
    }
    return 0;
  }
  z[0] = -b / a;
  return 1;
}


x86 assembly (clang, -O0):
<roots1rf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
mov    %rdi,-0x18(%rbp)
movss  -0x8(%rbp),%xmm0
xor    %edi,%edi
call   1030 <approxf@plt>
cmp    $0x0,%rax
je     1175 <roots1rf+0x65>
movss  -0xc(%rbp),%xmm0
xor    %edi,%edi
call   1030 <approxf@plt>
cmp    $0x0,%rax
je     1169 <roots1rf+0x59>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    119b <roots1rf+0x8b>
movl   $0x0,-0x4(%rbp)
jmp    119b <roots1rf+0x8b>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
divss  -0x8(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<roots1rf>:
push   %rbp
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
movaps %xmm1,0x10(%rsp)
xor    %ebp,%ebp
movss  %xmm0,0xc(%rsp)
xor    %edi,%edi
call   1030 <approxf@plt>
test   %rax,%rax
je     1148 <roots1rf+0x38>
movaps 0x10(%rsp),%xmm0
xor    %edi,%edi
call   1030 <approxf@plt>
xorps  %xmm0,%xmm0
test   %rax,%rax
jne    115a <roots1rf+0x4a>
jmp    1163 <roots1rf+0x53>
movaps 0x10(%rsp),%xmm0
xorps  0xeac(%rip),%xmm0
divss  0xc(%rsp),%xmm0
movss  %xmm0,(%rbx)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @roots1rf(float %0, float %1, float* %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca float
%7 = alloca float*
store float %0, float* %5
store float %1, float* %6
store float* %2, float** %7
%8 = load float, float* %5
%9 = call i64 @approxf(float %8, i32 0)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %3
%12 = load float, float* %6
%13 = call i64 @approxf(float %12, i32 0)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = load float*, float** %7
%17 = getelementptr inbounds float, float* %16, i64 0
store float 0.000000e+00, float* %17
store i32 1, i32* %4
br label %26
18: ; preds = %11
store i32 0, i32* %4
br label %26
19: ; preds = %3
%20 = load float, float* %6
%21 = fneg float %20
%22 = load float, float* %5
%23 = fdiv float %21, %22
%24 = load float*, float** %7
%25 = getelementptr inbounds float, float* %24, i64 0
store float %23, float* %25
store i32 1, i32* %4
br label %26
26: ; preds = %19, %18, %15
%27 = load i32, i32* %4
ret i32 %27
}

LLVM IR (-O2):
define i32 @roots1rf(float %0, float %1, float* nocapture writeonly %2) {
%4 = tail call i64 @approxf(float %0, i32 0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i64 @approxf(float %1, i32 0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %12
9: ; preds = %3
%10 = fneg float %1
%11 = fdiv float %10, %0
br label %12
12: ; preds = %6, %9
%13 = phi float [ %11, %9 ], [ 0.000000e+00, %6 ]
store float %13, float* %2
br label %14
14: ; preds = %12, %6
%15 = phi i32 [ 0, %6 ], [ 1, %12 ]
ret i32 %15
}