#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 a, b, c;
  printf("Enter three numbers:\n");
  scanf("%lf %lf %lf", &a, &b, &c);
  if (a >= b && a >= c)
    printf("Largest number is: %lf\n", a);
  else if (b >= a && b >= c)
    printf("Largest number is: %lf\n", b);
  else
    printf("Largest number is: %lf\n", c);
  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     118d <main+0x6d>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     118d <main+0x6d>
movsd  -0x10(%rbp),%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jb     11c5 <main+0xa5>
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jb     11c5 <main+0xa5>
movsd  -0x18(%rbp),%xmm0
lea    0xe69(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
movsd  -0x20(%rbp),%xmm0
lea    0xe51(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    %rsp,%rcx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm2
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
movapd %xmm1,%xmm3
cmpnlesd %xmm0,%xmm3
movapd %xmm3,%xmm4
andpd  %xmm1,%xmm4
andnpd %xmm0,%xmm3
orpd   %xmm4,%xmm3
movapd %xmm2,%xmm4
cmpnlesd %xmm0,%xmm4
movapd %xmm4,%xmm5
andnpd %xmm3,%xmm5
andpd  %xmm1,%xmm4
orpd   %xmm5,%xmm4
cmpnlesd %xmm2,%xmm0
movapd %xmm0,%xmm3
andpd  %xmm4,%xmm3
cmpnlesd %xmm2,%xmm1
andpd  %xmm1,%xmm4
andnpd %xmm2,%xmm1
orpd   %xmm4,%xmm1
andnpd %xmm1,%xmm0
orpd   %xmm3,%xmm0
lea    0xe43(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Enter three numbers:\0A\00"
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [24 x i8] c"Largest number is: %lf\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 ([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 ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %15)
br label %32
17: ; preds = %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 ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %26)
br label %31
28: ; preds = %21, %17
%29 = load double, double* %4
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %29)
br label %31
31: ; preds = %28, %25
br label %32
32: ; preds = %31, %14
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [12 x i8] c"%lf %lf %lf\00"
@.str.2 = [24 x i8] c"Largest number is: %lf\0A\00"
@str = [21 x i8] c"Enter three numbers:\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 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
%15 = fcmp ult double %10, %9
%16 = fcmp ult double %10, %12
%17 = select i1 %15, i1 true, i1 %16
%18 = select i1 %17, double %12, double %10
%19 = select i1 %14, double %18, double %9
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), double %19)
ret i32 0
}