#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, double *);
int main() {
  double firstNum, secondNum;
  printf("Please enter first number: ");
  scanf("%lf", &firstNum);
  printf("Please enter second number: ");
  scanf("%lf", &secondNum);
  if (firstNum > secondNum) {
    double oldValue = firstNum;
    firstNum = secondNum;
    secondNum = oldValue;
  }
  printf("%.1f %.1f\n", firstNum, secondNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed8(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1199 <main+0x79>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe93(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee2(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movsd  0x8(%rsp),%xmm2
movsd  (%rsp),%xmm0
ucomisd %xmm0,%xmm2
jbe    1182 <main+0x62>
movsd  %xmm0,0x8(%rsp)
movsd  %xmm2,(%rsp)
movapd %xmm2,%xmm1
jmp    118a <main+0x6a>
movapd %xmm0,%xmm1
movapd %xmm2,%xmm0
lea    0xeac(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Please enter first number: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [29 x i8] c"Please enter second number: \00"
@.str.3 = [11 x i8] c"%.1f %.1f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%9 = load double, double* %2
%10 = load double, double* %3
%11 = fcmp ogt double %9, %10
br i1 %11, label %12, label %16
12: ; preds = %0
%13 = load double, double* %2
store double %13, double* %4
%14 = load double, double* %3
store double %14, double* %2
%15 = load double, double* %4
store double %15, double* %3
br label %16
16: ; preds = %12, %0
%17 = load double, double* %2
%18 = load double, double* %3
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %17, double %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Please enter first number: \00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [29 x i8] c"Please enter second number: \00"
@.str.3 = [11 x i8] c"%.1f %.1f\0A\00"
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 ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fcmp ogt double %9, %10
br i1 %11, label %12, label %13
12: ; preds = %0
store double %10, double* %1
store double %9, double* %2
br label %13
13: ; preds = %12, %0
%14 = phi double [ %9, %12 ], [ %10, %0 ]
%15 = phi double [ %10, %12 ], [ %9, %0 ]
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %15, double %14)
ret i32 0
}