#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*/ getch();
int /*<<< orphan*/ max(double, double);
int /*<<< orphan*/ min(double, double);
int /*<<< orphan*/ printf(char *, double, double, int /*<<< orphan*/);
main() {
  double a, b;
  a = 2.3;
  b = -1.4;
  printf("\n Maximum of %lf and %lf is %lf\n", a, b, max(a, b));
  printf("\n Minimum of %lf and %lf is %lf\n", a, b, min(a, b));
  getch();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xea3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1050 <max@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    %eax,%esi
lea    0xe78(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1040 <min@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    %eax,%esi
lea    0xe5e(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1060 <getch@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movsd  0xeb7(%rip),%xmm0
movsd  0xeb7(%rip),%xmm1
call   1050 <max@plt>
lea    0xeb3(%rip),%rdi
movsd  0xe9b(%rip),%xmm0
movsd  0xe9b(%rip),%xmm1
mov    %eax,%esi
call   1030 <printf@plt>
movsd  0xe84(%rip),%xmm0
movsd  0xe84(%rip),%xmm1
call   1040 <min@plt>
lea    0xea1(%rip),%rdi
movsd  0xe68(%rip),%xmm0
movsd  0xe68(%rip),%xmm1
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1060 <getch@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"\0A Maximum of %lf and %lf is %lf\0A\00"
@.str.1 = [33 x i8] c"\0A Minimum of %lf and %lf is %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
store double 2.300000e+00, double* %1
store double -1.400000e+00, double* %2
%3 = load double, double* %1
%4 = load double, double* %2
%5 = load double, double* %1
%6 = load double, double* %2
%7 = call i32 @max(double %5, double %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double %3, double %4, i32 %7)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = load double, double* %1
%12 = load double, double* %2
%13 = call i32 @min(double %11, double %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double %9, double %10, i32 %13)
%15 = call i32 (...) @getch()
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0A Maximum of %lf and %lf is %lf\0A\00"
@.str.1 = [33 x i8] c"\0A Minimum of %lf and %lf is %lf\0A\00"
define i32 @main() {
%1 = tail call i32 @max(double 2.300000e+00, double -1.400000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), double 2.300000e+00, double -1.400000e+00, i32 %1)
%3 = tail call i32 @min(double 2.300000e+00, double -1.400000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), double 2.300000e+00, double -1.400000e+00, i32 %3)
%5 = tail call i32 (...) @getch()
ret i32 0
}