#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*/ minMax(double *, double *, double, double);
int /*<<< orphan*/ minimum(double *, double *);
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  double x = 7, y = 3;
  double *p = &x;
  printf("%f\n", *&*&*p);
  minimum(&x, &y);
  printf("x y == %f %f\n", x, y);
  double smaller, larger;
  x = 10, y = -10;
  minMax(&smaller, &larger, x, y);
  printf("smaller is %f, larger is %f\n", smaller, larger);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  0xed8(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xec3(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xec1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <minimum@plt>
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    0xe92(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movsd  0xe6b(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  0xe56(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
lea    -0x20(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <minMax@plt>
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
lea    0xe57(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movabs $0x401c000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0x4008000000000000,%rax
mov    %rax,0x8(%rsp)
lea    0xec9(%rip),%rdi
movsd  0xe9f(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <minimum@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xe8e(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
movabs $0x4024000000000000,%rax
mov    %rax,0x10(%rsp)
movabs $0xc024000000000000,%rax
mov    %rax,0x8(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
movsd  0xe47(%rip),%xmm0
movsd  0xe47(%rip),%xmm1
call   1050 <minMax@plt>
movsd  0x20(%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
lea    0xe45(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [14 x i8] c"x y == %f %f\0A\00"
@.str.2 = [29 x i8] c"smaller is %f, larger is %f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double*
%4 = alloca double
%5 = alloca double
store double 7.000000e+00, double* %1
store double 3.000000e+00, double* %2
store double* %1, double** %3
%6 = load double*, double** %3
%7 = load double, double* %6
%8 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
%9 = call i32 @minimum(double* %1, double* %2)
%10 = load double, double* %1
%11 = load double, double* %2
%12 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %10, double %11)
store double 1.000000e+01, double* %1
store double -1.000000e+01, double* %2
%13 = load double, double* %1
%14 = load double, double* %2
%15 = call i32 @minMax(double* %4, double* %5, double %13, double %14)
%16 = load double, double* %4
%17 = load double, double* %5
%18 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double %16, double %17)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@.str.1 = [14 x i8] c"x y == %f %f\0A\00"
@.str.2 = [29 x i8] c"smaller is %f, larger is %f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = bitcast double* %1 to i8*
store double 7.000000e+00, double* %1
%6 = bitcast double* %2 to i8*
store double 3.000000e+00, double* %2
%7 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double 7.000000e+00)
%8 = call i32 @minimum(double* %1, double* %2)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), double %9, double %10)
%12 = bitcast double* %3 to i8*
%13 = bitcast double* %4 to i8*
store double 1.000000e+01, double* %1
store double -1.000000e+01, double* %2
%14 = call i32 @minMax(double* %3, double* %4, double 1.000000e+01, double -1.000000e+01)
%15 = load double, double* %3
%16 = load double, double* %4
%17 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), double %15, double %16)
ret i32 0
}