#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 */
float check_discount(float, float, int);
int /*<<< orphan*/ printf(char *, float, float);
int main(int argc, char const *argv[]) {
  int quantity = 25;
  float criteria_A = 0.25;
  float fixed_A = 7.50;
  float criteria_B = 0.50;
  float fixed_B = 2.50;
  float A = check_discount(fixed_A, criteria_A, quantity);
  float B = check_discount(fixed_B, criteria_B, quantity);
  if (A == B) {
    printf("Both equals, A is %.3f and B is %.3f\n", A, B);
  }
  if (A < B) {
    printf("A is the best option, A is %.3f and B is %.3f\n", A, B);
  }
  if (A > B) {
    printf("B is the best option, A is %.3f and B is %.3f\n", A, B);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x19,-0x14(%rbp)
movss  0xec7(%rip),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  0xeb6(%rip),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  0xea5(%rip),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  0xe94(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mov    -0x14(%rbp),%edi
call   1040 <check_discount@plt>
movss  %xmm0,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
movss  -0x20(%rbp),%xmm1
mov    -0x14(%rbp),%edi
call   1040 <check_discount@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x28(%rbp),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jne    11ca <main+0xaa>
jp     11ca <main+0xaa>
movss  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
lea    0xe4b(%rip),%rdi
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11f3 <main+0xd3>
movss  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
movss  -0x28(%rbp),%xmm0
ucomiss -0x2c(%rbp),%xmm0
jbe    1218 <main+0xf8>
movss  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm1
lea    0xe52(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movss  0xed7(%rip),%xmm0
movss  0xed3(%rip),%xmm1
mov    $0x19,%edi
call   1040 <check_discount@plt>
movss  %xmm0,(%rsp)
movss  0xec0(%rip),%xmm0
movss  0xebc(%rip),%xmm1
mov    $0x19,%edi
call   1040 <check_discount@plt>
movaps %xmm0,%xmm1
movss  (%rsp),%xmm0
ucomiss %xmm1,%xmm0
movss  %xmm1,0x4(%rsp)
jne    1191 <main+0x71>
jp     1191 <main+0x71>
lea    0xe9a(%rip),%rdi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
ucomiss %xmm0,%xmm1
jbe    11b8 <main+0x98>
lea    0xe99(%rip),%rdi
movss  (%rsp),%xmm0
movss  0x4(%rsp),%xmm1
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm1
movss  (%rsp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11c9 <main+0xa9>
lea    0xea1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"Both equals, A is %.3f and B is %.3f\0A\00"
@.str.1 = [47 x i8] c"A is the best option, A is %.3f and B is %.3f\0A\00"
@.str.2 = [47 x i8] c"B is the best option, A is %.3f and B is %.3f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 25, i32* %6
store float 2.500000e-01, float* %7
store float 7.500000e+00, float* %8
store float 5.000000e-01, float* %9
store float 2.500000e+00, float* %10
%13 = load float, float* %8
%14 = load float, float* %7
%15 = load i32, i32* %6
%16 = call float @check_discount(float %13, float %14, i32 %15)
store float %16, float* %11
%17 = load float, float* %10
%18 = load float, float* %9
%19 = load i32, i32* %6
%20 = call float @check_discount(float %17, float %18, i32 %19)
store float %20, float* %12
%21 = load float, float* %11
%22 = load float, float* %12
%23 = fcmp oeq float %21, %22
br i1 %23, label %24, label %28
24: ; preds = %2
%25 = load float, float* %11
%26 = load float, float* %12
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), float %25, float %26)
br label %28
28: ; preds = %24, %2
%29 = load float, float* %11
%30 = load float, float* %12
%31 = fcmp olt float %29, %30
br i1 %31, label %32, label %36
32: ; preds = %28
%33 = load float, float* %11
%34 = load float, float* %12
%35 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), float %33, float %34)
br label %36
36: ; preds = %32, %28
%37 = load float, float* %11
%38 = load float, float* %12
%39 = fcmp ogt float %37, %38
br i1 %39, label %40, label %44
40: ; preds = %36
%41 = load float, float* %11
%42 = load float, float* %12
%43 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), float %41, float %42)
br label %44
44: ; preds = %40, %36
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"Both equals, A is %.3f and B is %.3f\0A\00"
@.str.1 = [47 x i8] c"A is the best option, A is %.3f and B is %.3f\0A\00"
@.str.2 = [47 x i8] c"B is the best option, A is %.3f and B is %.3f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call float @check_discount(float 7.500000e+00, float 2.500000e-01, i32 25)
%4 = tail call float @check_discount(float 2.500000e+00, float 5.000000e-01, i32 25)
%5 = fcmp oeq float %3, %4
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), float %3, float %4)
br label %8
8: ; preds = %6, %2
%9 = fcmp olt float %3, %4
br i1 %9, label %10, label %12
10: ; preds = %8
%11 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.1, i64 0, i64 0), float %3, float %4)
br label %12
12: ; preds = %10, %8
%13 = fcmp ogt float %3, %4
br i1 %13, label %14, label %16
14: ; preds = %12
%15 = tail call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), float %3, float %4)
br label %16
16: ; preds = %14, %12
ret i32 0
}