#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 EXIT_SUCCESS;
int /*<<< orphan*/ checkInput(double *, double *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ swapIfGreater(double *, double *);
int main() {
  double firstNum, secondNum, a = 5.5, b = 2.0;
  printf("Enter a and b: ");
  checkInput(&firstNum, &secondNum);
  printf("Before change: a = %.1lf and b = %.1lf\n", firstNum, secondNum);
  swapIfGreater(&firstNum, &secondNum);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xeac(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <checkInput@plt>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe9b(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <swapIfGreater@plt>
mov    0x2e40(%rip),%rax
mov    (%rax),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xec2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rbx
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <checkInput@plt>
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
lea    0xea3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <swapIfGreater@plt>
mov    0x2e5a(%rip),%rax
mov    (%rax),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a and b: \00"
@.str.1 = [40 x i8] c"Before change: a = %.1lf and b = %.1lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
store i32 0, i32* %1
store double 5.500000e+00, double* %4
store double 2.000000e+00, double* %5
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @checkInput(double* %2, double* %3)
%8 = load double, double* %2
%9 = load double, double* %3
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %8, double %9)
%11 = call i32 @swapIfGreater(double* %2, double* %3)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a and b: \00"
@.str.1 = [40 x i8] c"Before change: a = %.1lf and b = %.1lf\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @checkInput(double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), double %7, double %8)
%10 = call i32 @swapIfGreater(double* %1, double* %2)
%11 = load i32, i32* @EXIT_SUCCESS
ret i32 %11
}