#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__ double_virtually_same(double, double);
int /*<<< orphan*/ printf(char *, char *);
void output_chart_data(double stage, double elevation, char *measurement_date) {
  if (double_virtually_same(stage, elevation))
    printf("%s^0\n", measurement_date);
  else if (stage < elevation)
    printf("%s^-1\n", measurement_date);
  else
    printf("%s^1\n", measurement_date);
}


x86 assembly (clang, -O0):
<output_chart_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <double_virtually_same@plt>
cmp    $0x0,%rax
je     1164 <output_chart_data+0x44>
mov    -0x18(%rbp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <output_chart_data+0x82>
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    118d <output_chart_data+0x6d>
mov    -0x18(%rbp),%rsi
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
jmp    119d <output_chart_data+0x7d>
mov    -0x18(%rbp),%rsi
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
jmp    11a2 <output_chart_data+0x82>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_chart_data>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1040 <double_virtually_same@plt>
movsd  (%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
lea    0xebc(%rip),%rcx
lea    0xebc(%rip),%rdx
cmova  %rcx,%rdx
test   %rax,%rax
lea    0xea1(%rip),%rdi
cmove  %rdx,%rdi
mov    %rbx,%rsi
add    $0x10,%rsp
pop    %rbx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%s^0\0A\00"
@.str.1 = [7 x i8] c"%s^-1\0A\00"
@.str.2 = [6 x i8] c"%s^1\0A\00"
define void @output_chart_data(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load double, double* %4
%8 = load double, double* %5
%9 = call i64 @double_virtually_same(double %7, double %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %3
%12 = load i8*, i8** %6
%13 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %25
14: ; preds = %3
%15 = load double, double* %4
%16 = load double, double* %5
%17 = fcmp olt double %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i8*, i8** %6
%20 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %19)
br label %24
21: ; preds = %14
%22 = load i8*, i8** %6
%23 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %21, %18
br label %25
25: ; preds = %24, %11
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s^0\0A\00"
@.str.1 = [7 x i8] c"%s^-1\0A\00"
@.str.2 = [6 x i8] c"%s^1\0A\00"
define void @output_chart_data(double %0, double %1, i8* %2) {
%4 = tail call i64 @double_virtually_same(double %0, double %1)
%5 = icmp eq i64 %4, 0
%6 = fcmp olt double %0, %1
%7 = select i1 %6, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0)
%8 = select i1 %5, i8* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
%9 = tail call i32 @printf(i8* %8, i8* %2)
ret void
}