#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*/ bar(float);
void foo(float y, unsigned long z) {
  int b;
  float c = y;
  for (b = 0; b < z; b++) {
    bar(c);
    if (c == y)
      c = -y;
    else
      c = y;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1198 <foo+0x88>
movss  -0x18(%rbp),%xmm0
call   1030 <bar@plt>
movss  -0x18(%rbp),%xmm0
ucomiss -0x4(%rbp),%xmm0
jne    117b <foo+0x6b>
jp     117b <foo+0x6b>
movss  -0x4(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    1185 <foo+0x75>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
jmp    118a <foo+0x7a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1132 <foo+0x22>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
push   %rbx
sub    $0x30,%rsp
movaps %xmm0,0x10(%rsp)
test   %rdi,%rdi
je     1188 <foo+0x78>
mov    %rdi,%rbx
movaps 0xed7(%rip),%xmm1
movaps 0x10(%rsp),%xmm0
xorps  %xmm0,%xmm1
movaps %xmm1,0x20(%rsp)
cs nopw 0x0(%rax,%rax,1)
movaps %xmm0,(%rsp)
movaps (%rsp),%xmm0
call   1030 <bar@plt>
movaps 0x10(%rsp),%xmm1
movaps (%rsp),%xmm0
cmpeqss %xmm1,%xmm0
movaps %xmm0,(%rsp)
movaps (%rsp),%xmm0
andps  0x20(%rsp),%xmm0
movaps (%rsp),%xmm2
andnps %xmm1,%xmm2
movaps %xmm2,(%rsp)
movaps (%rsp),%xmm1
orps   %xmm0,%xmm1
movaps %xmm1,(%rsp)
movaps (%rsp),%xmm0
add    $0xffffffffffffffff,%rbx
jne    1140 <foo+0x30>
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @foo(float %0, i64 %1) {
%3 = alloca float
%4 = alloca i64
%5 = alloca i32
%6 = alloca float
store float %0, float* %3
store i64 %1, i64* %4
%7 = load float, float* %3
store float %7, float* %6
store i32 0, i32* %5
br label %8
8: ; preds = %25, %2
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = load i64, i64* %4
%12 = icmp ult i64 %10, %11
br i1 %12, label %13, label %28
13: ; preds = %8
%14 = load float, float* %6
%15 = call i32 @bar(float %14)
%16 = load float, float* %6
%17 = load float, float* %3
%18 = fcmp oeq float %16, %17
br i1 %18, label %19, label %22
19: ; preds = %13
%20 = load float, float* %3
%21 = fneg float %20
store float %21, float* %6
br label %24
22: ; preds = %13
%23 = load float, float* %3
store float %23, float* %6
br label %24
24: ; preds = %22, %19
br label %25
25: ; preds = %24
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %8
28: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @foo(float %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2
%5 = fneg float %0
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = phi float [ %0, %4 ], [ %11, %6 ]
%9 = tail call i32 @bar(float %8)
%10 = fcmp oeq float %8, %0
%11 = select i1 %10, float %5, float %0
%12 = add nuw i64 %7, 1
%13 = icmp eq i64 %12, %1
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}