#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 */
double atof(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  double num1 = 0, num2 = 0;
  char str[100] = {'\0'};
  printf("\nEnter number 1 :");
  scanf("%s", str);
  num1 = atof(str);
  printf("\nEnter number 2 :");
  scanf("%s", str);
  num2 = atof(str);
  (num1 >= num2)
      ? ((num1 > num2) ? (printf("\n%g is greater than %g.\n", num1, num2))
                       : (printf("\n%g is equal to %g.\n", num1, num2)))
      : (printf("\n%g is less than %g.\n", num1, num2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe87(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x10(%rbp)
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xe5b(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jb     1236 <main+0xf6>
movsd  -0x10(%rbp),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    120d <main+0xcd>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe2c(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    %eax,-0x84(%rbp)
jmp    122b <main+0xeb>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe22(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
mov    %eax,-0x84(%rbp)
mov    -0x84(%rbp),%eax
jmp    124e <main+0x10e>
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xe0e(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x78,%rsp
xorpd  %xmm0,%xmm0
movapd %xmm0,0x60(%rsp)
movapd %xmm0,0x50(%rsp)
movapd %xmm0,0x40(%rsp)
movapd %xmm0,0x30(%rsp)
movapd %xmm0,0x20(%rsp)
movapd %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe96(%rip),%r14
lea    0x10(%rsp),%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xe74(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
movapd %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
ucomisd %xmm1,%xmm0
lea    0xe57(%rip),%rax
lea    0xe69(%rip),%rcx
cmova  %rax,%rcx
lea    0xe73(%rip),%rdi
cmovae %rcx,%rdi
mov    $0x2,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0AEnter number 1 :\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"\0AEnter number 2 :\00"
@.str.3 = [25 x i8] c"\0A%g is greater than %g.\0A\00"
@.str.4 = [21 x i8] c"\0A%g is equal to %g.\0A\00"
@.str.5 = [22 x i8] c"\0A%g is less than %g.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca [100 x i8]
store i32 0, i32* %1
store double 0.000000e+00, double* %2
store double 0.000000e+00, double* %3
%5 = bitcast [100 x i8]* %4 to i8*
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = call double @atof(i8* %9)
store double %10, double* %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%15 = call double @atof(i8* %14)
store double %15, double* %3
%16 = load double, double* %2
%17 = load double, double* %3
%18 = fcmp oge double %16, %17
br i1 %18, label %19, label %33
19: ; preds = %0
%20 = load double, double* %2
%21 = load double, double* %3
%22 = fcmp ogt double %20, %21
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load double, double* %2
%25 = load double, double* %3
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), double %24, double %25)
br label %31
27: ; preds = %19
%28 = load double, double* %2
%29 = load double, double* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), double %28, double %29)
br label %31
31: ; preds = %27, %23
%32 = phi i32 [ %26, %23 ], [ %30, %27 ]
br label %37
33: ; preds = %0
%34 = load double, double* %2
%35 = load double, double* %3
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), double %34, double %35)
br label %37
37: ; preds = %33, %31
%38 = phi i32 [ %32, %31 ], [ %36, %33 ]
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"\0AEnter number 1 :\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [18 x i8] c"\0AEnter number 2 :\00"
@.str.3 = [25 x i8] c"\0A%g is greater than %g.\0A\00"
@.str.4 = [21 x i8] c"\0A%g is equal to %g.\0A\00"
@.str.5 = [22 x i8] c"\0A%g is less than %g.\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = call double @atof(i8* %2)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%8 = call double @atof(i8* %2)
%9 = fcmp ult double %5, %8
%10 = fcmp ogt double %5, %8
%11 = select i1 %10, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0)
%12 = select i1 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i8* %11
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %12, double %5, double %8)
ret i32 0
}