#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*/ do_nothing();
int /*<<< orphan*/ printf(char *, double, char);
double recip(int);
void test5(int denom) {
  double r1;
  int t1, t2;
  r1 = recip(denom);
  t1 = r1 == 0.1;
  do_nothing();
  t2 = r1 == 0.1;
  printf("test5 t1: r1 %f %c= 0.1\n", r1, t1 ? '=' : '!');
  printf("test5 t2: r1 %f %c= 0.1\n", r1, t2 ? '=' : '!');
}


x86 assembly (clang, -O0):
<test5>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <recip@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeab(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1040 <do_nothing@plt>
movsd  -0x10(%rbp),%xmm0
movsd  0xe83(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edx
mov    $0x21,%eax
mov    $0x3d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xe58(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%edx
mov    $0x21,%eax
mov    $0x3d,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xe4a(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test5>:
push   %rbx
sub    $0x10,%rsp
call   1050 <recip@plt>
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <do_nothing@plt>
movsd  0x8(%rsp),%xmm0
ucomisd 0xeab(%rip),%xmm0
mov    $0x21,%eax
mov    $0x3d,%ebx
cmovne %eax,%ebx
cmovp  %eax,%ebx
lea    0xe9c(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    %ebx,%esi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"test5 t1: r1 %f %c= 0.1\0A\00"
@.str.1 = [25 x i8] c"test5 t2: r1 %f %c= 0.1\0A\00"
define void @test5(i32 %0) {
%2 = alloca i32
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = call double @recip(i32 %6)
store double %7, double* %3
%8 = load double, double* %3
%9 = fcmp oeq double %8, 1.000000e-01
%10 = zext i1 %9 to i32
store i32 %10, i32* %4
%11 = call i32 (...) @do_nothing()
%12 = load double, double* %3
%13 = fcmp oeq double %12, 1.000000e-01
%14 = zext i1 %13 to i32
store i32 %14, i32* %5
%15 = load double, double* %3
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 61, i32 33
%20 = trunc i32 %19 to i8
%21 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %15, i8 signext %20)
%22 = load double, double* %3
%23 = load i32, i32* %5
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i64
%26 = select i1 %24, i32 61, i32 33
%27 = trunc i32 %26 to i8
%28 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %22, i8 signext %27)
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"test5 t1: r1 %f %c= 0.1\0A\00"
@.str.1 = [25 x i8] c"test5 t2: r1 %f %c= 0.1\0A\00"
define void @test5(i32 %0) {
%2 = tail call double @recip(i32 %0)
%3 = fcmp oeq double %2, 1.000000e-01
%4 = tail call i32 (...) @do_nothing()
%5 = select i1 %3, i8 61, i8 33
%6 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), double %2, i8 signext %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), double %2, i8 signext %5)
ret void
}