#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 *);
void main() {
  double a, b, c, d;
  printf("Digite 2 numeros reais: ");
  scanf("%lf %lf", &a, &b);
  if (a > b) {
    printf("O primeiro numero eh maior que o segundo.\n");
    c = a * b;
    d = a - b;
    printf("Produto: %.2lf\n"
           "Diferenca: %.2lf\n",
           c, d);
  } else {
    printf("O primeiro numero nao eh maior que o segundo.\n");
    c = b / a;
    d = a + b;
    printf("A: %.2lf, B: %.2lf\n"
           "Divisao: %.2lf\n"
           "Soma: %.2lf\n",
           a, b, c, d);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0x10(%rbp),%rdx
call   1040 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    11a3 <main+0x83>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x8(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xeb5(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11f1 <main+0xd1>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
divsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
movsd  -0x20(%rbp),%xmm3
lea    0xeb2(%rip),%rdi
mov    $0x4,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xed0(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
movsd  0x10(%rsp),%xmm0
ucomisd 0x8(%rsp),%xmm0
jbe    119d <main+0x6d>
lea    0xf32(%rip),%rdi
call   1030 <puts@plt>
movsd  0x10(%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
movapd %xmm1,%xmm0
mulsd  %xmm2,%xmm0
subsd  %xmm2,%xmm1
lea    0xe90(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
add    $0x18,%rsp
ret
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm0
movapd %xmm1,%xmm2
divsd  %xmm0,%xmm2
movapd %xmm1,%xmm3
addsd  %xmm0,%xmm3
lea    0xe76(%rip),%rdi
mov    $0x4,%al
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Digite 2 numeros reais: \00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.2 = [43 x i8] c"O primeiro numero eh maior que o segundo.\0A\00"
@.str.3 = [33 x i8] c"Produto: %.2lf\0ADiferenca: %.2lf\0A\00"
@.str.4 = [47 x i8] c"O primeiro numero nao eh maior que o segundo.\0A\00"
@.str.5 = [47 x i8] c"A: %.2lf, B: %.2lf\0ADivisao: %.2lf\0ASoma: %.2lf\0A\00"
define void @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %21
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%12 = load double, double* %1
%13 = load double, double* %2
%14 = fmul double %12, %13
store double %14, double* %3
%15 = load double, double* %1
%16 = load double, double* %2
%17 = fsub double %15, %16
store double %17, double* %4
%18 = load double, double* %3
%19 = load double, double* %4
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %18, double %19)
br label %34
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%23 = load double, double* %2
%24 = load double, double* %1
%25 = fdiv double %23, %24
store double %25, double* %3
%26 = load double, double* %1
%27 = load double, double* %2
%28 = fadd double %26, %27
store double %28, double* %4
%29 = load double, double* %1
%30 = load double, double* %2
%31 = load double, double* %3
%32 = load double, double* %4
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), double %29, double %30, double %31, double %32)
br label %34
34: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"Digite 2 numeros reais: \00"
@.str.1 = [8 x i8] c"%lf %lf\00"
@.str.3 = [33 x i8] c"Produto: %.2lf\0ADiferenca: %.2lf\0A\00"
@.str.5 = [47 x i8] c"A: %.2lf, B: %.2lf\0ADivisao: %.2lf\0ASoma: %.2lf\0A\00"
@str = [46 x i8] c"O primeiro numero nao eh maior que o segundo.\00"
@str.6 = [42 x i8] c"O primeiro numero eh maior que o segundo.\00"
define void @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 ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double* %1, double* %2)
%7 = load double, double* %1
%8 = load double, double* %2
%9 = fcmp ogt double %7, %8
br i1 %9, label %10, label %17
10: ; preds = %0
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.6, i64 0, i64 0))
%12 = load double, double* %1
%13 = load double, double* %2
%14 = fmul double %12, %13
%15 = fsub double %12, %13
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %14, double %15)
br label %24
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
%19 = load double, double* %2
%20 = load double, double* %1
%21 = fdiv double %19, %20
%22 = fadd double %19, %20
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0), double %20, double %19, double %21, double %22)
br label %24
24: ; preds = %17, %10
ret void
}