#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 *, double *, double *);
int main() {
  double n1, n2, n3;
  printf("Enter three numbers: ");
  scanf("%lf %lf %lf", &n1, &n2, &n3);
  if (n1 >= n2 && n1 >= n3)
    printf("%.2f is the largest number.", n1);
  if (n2 >= n1 && n2 >= n3)
    printf("%.2f is the largest number.", n2);
  if (n3 >= n1 && n3 >= n2)
    printf("%.2f is the largest number.", n3);
  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    0xed2(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <scanf@plt>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1188 <main+0x68>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     1188 <main+0x68>
movsd  -0x10(%rbp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11bb <main+0x9b>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11bb <main+0x9b>
movsd  -0x18(%rbp),%xmm0
lea    0xe6e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11ee <main+0xce>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     11ee <main+0xce>
movsd  -0x20(%rbp),%xmm0
lea    0xe3b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xedd(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1040 <scanf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
ucomisd %xmm1,%xmm2
movsd  (%rsp),%xmm0
jb     118b <main+0x6b>
ucomisd %xmm0,%xmm2
jb     118b <main+0x6b>
lea    0xeb3(%rip),%rdi
movapd %xmm2,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
movsd  (%rsp),%xmm0
ucomisd %xmm2,%xmm1
jb     11ba <main+0x9a>
ucomisd %xmm0,%xmm1
jb     11ba <main+0x9a>
lea    0xe84(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
movsd  (%rsp),%xmm0
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm1
ucomisd %xmm2,%xmm0
jb     11d4 <main+0xb4>
ucomisd %xmm1,%xmm0
jb     11d4 <main+0xb4>
lea    0xe55(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter three numbers: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [28 x i8] c"%.2f is the largest number.\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 ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %2, double* %3, double* %4)
%7 = load double, double* %2
%8 = load double, double* %3
%9 = fcmp oge double %7, %8
br i1 %9, label %10, label %17
10: ; preds = %0
%11 = load double, double* %2
%12 = load double, double* %4
%13 = fcmp oge double %11, %12
br i1 %13, label %14, label %17
14: ; preds = %10
%15 = load double, double* %2
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %15)
br label %17
17: ; preds = %14, %10, %0
%18 = load double, double* %3
%19 = load double, double* %2
%20 = fcmp oge double %18, %19
br i1 %20, label %21, label %28
21: ; preds = %17
%22 = load double, double* %3
%23 = load double, double* %4
%24 = fcmp oge double %22, %23
br i1 %24, label %25, label %28
25: ; preds = %21
%26 = load double, double* %3
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %26)
br label %28
28: ; preds = %25, %21, %17
%29 = load double, double* %4
%30 = load double, double* %2
%31 = fcmp oge double %29, %30
br i1 %31, label %32, label %39
32: ; preds = %28
%33 = load double, double* %4
%34 = load double, double* %3
%35 = fcmp oge double %33, %34
br i1 %35, label %36, label %39
36: ; preds = %32
%37 = load double, double* %4
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %37)
br label %39
39: ; preds = %36, %32, %28
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Enter three numbers: \00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [28 x i8] c"%.2f is the largest number.\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = bitcast double* %1 to i8*
%5 = bitcast double* %2 to i8*
%6 = bitcast double* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2, double* %3)
%9 = load double, double* %1
%10 = load double, double* %2
%11 = fcmp ult double %9, %10
%12 = load double, double* %3
%13 = fcmp ult double %9, %12
%14 = select i1 %11, i1 true, i1 %13
br i1 %14, label %20, label %15
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %9)
%17 = load double, double* %2
%18 = load double, double* %1
%19 = load double, double* %3
br label %20
20: ; preds = %15, %0
%21 = phi double [ %19, %15 ], [ %12, %0 ]
%22 = phi double [ %18, %15 ], [ %9, %0 ]
%23 = phi double [ %17, %15 ], [ %10, %0 ]
%24 = fcmp ult double %23, %22
%25 = fcmp ult double %23, %21
%26 = select i1 %24, i1 true, i1 %25
br i1 %26, label %32, label %27
27: ; preds = %20
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %23)
%29 = load double, double* %3
%30 = load double, double* %1
%31 = load double, double* %2
br label %32
32: ; preds = %27, %20
%33 = phi double [ %31, %27 ], [ %23, %20 ]
%34 = phi double [ %30, %27 ], [ %22, %20 ]
%35 = phi double [ %29, %27 ], [ %21, %20 ]
%36 = fcmp ult double %35, %34
%37 = fcmp ult double %35, %33
%38 = select i1 %36, i1 true, i1 %37
br i1 %38, label %41, label %39
39: ; preds = %32
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %35)
br label %41
41: ; preds = %39, %32
ret i32 0
}