#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 *, int *, int *, int *);
main() {
  int a, b, c, r;
  printf("Enter the coefficients of a,b,c:");
  scanf("%d%d%d", &a, &b, &c);
  r = b * b - 4 * a * c;
  if (r > 0)
    printf("The roots are real and unequal");
  else if (r < 0)
    printf("The roots are imaginary");
  else
    printf("The roots are real and equal");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x2,%ecx
imul   -0x10(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1184 <main+0x64>
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0x90>
cmpl   $0x0,-0x14(%rbp)
jge    119f <main+0x7f>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
jmp    11ab <main+0x8b>
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
jmp    11b0 <main+0x90>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xeea(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%ecx
imul   0xc(%rsp),%ecx
imul   %eax,%eax
shl    $0x2,%ecx
sub    %ecx,%eax
test   %eax,%eax
lea    0xede(%rip),%rax
lea    0xeef(%rip),%rcx
cmovs  %rax,%rcx
lea    0xead(%rip),%rdi
cmovle %rcx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Enter the coefficients of a,b,c:\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [31 x i8] c"The roots are real and unequal\00"
@.str.3 = [24 x i8] c"The roots are imaginary\00"
@.str.4 = [29 x i8] c"The roots are real and equal\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
%11 = load i32, i32* %2
%12 = mul nsw i32 4, %11
%13 = load i32, i32* %4
%14 = mul nsw i32 %12, %13
%15 = sub nsw i32 %10, %14
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = icmp sgt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
br label %28
20: ; preds = %0
%21 = load i32, i32* %5
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %27
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %27
27: ; preds = %25, %23
br label %28
28: ; preds = %27, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Enter the coefficients of a,b,c:\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [31 x i8] c"The roots are real and unequal\00"
@.str.3 = [24 x i8] c"The roots are imaginary\00"
@.str.4 = [29 x i8] c"The roots are real and equal\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%9 = load i32, i32* %2
%10 = mul nsw i32 %9, %9
%11 = load i32, i32* %1
%12 = mul i32 %11, -4
%13 = load i32, i32* %3
%14 = mul i32 %12, %13
%15 = add i32 %14, %10
%16 = icmp sgt i32 %15, 0
%17 = icmp slt i32 %15, 0
%18 = select i1 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0)
%19 = select i1 %16, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i8* %18
%20 = call i32 @printf(i8* dereferenceable(1) %19)
ret i32 0
}