#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 Sqrt(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main() {
  int a, b, c, r1, r2, t;
  printf("Enter the values of a,b,c");
  scanf("%d %d %d", &a, &b, &c);
  t = Sqrt(b * b - 4 * a * c);
  r1 = (-b + t) / (2 * a);
  r2 = (-b - t) / (2 * a);
  printf("The quadratic roots are %d %d", r1, r2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
mov    -0xc(%rbp),%edi
imul   -0xc(%rbp),%edi
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
imul   -0x10(%rbp),%eax
sub    %eax,%edi
call   1040 <Sqrt@plt>
mov    %eax,-0x1c(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
sub    -0xc(%rbp),%eax
sub    -0x1c(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
cltd
idiv   %ecx
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rcx
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
imul   %edi,%edi
mov    0x10(%rsp),%eax
imul   0x14(%rsp),%eax
shl    $0x2,%eax
sub    %eax,%edi
call   1040 <Sqrt@plt>
mov    %eax,%ecx
mov    0xc(%rsp),%edi
sub    %edi,%eax
mov    0x10(%rsp),%esi
add    %esi,%esi
cltd
idiv   %esi
mov    %eax,%r8d
add    %edi,%ecx
neg    %ecx
mov    %ecx,%eax
cltd
idiv   %esi
lea    0xe88(%rip),%rdi
mov    %r8d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [26 x i8] c"Enter the values of a,b,c\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [30 x i8] c"The quadratic roots are %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%10 = load i32, i32* %3
%11 = load i32, i32* %3
%12 = mul nsw i32 %10, %11
%13 = load i32, i32* %2
%14 = mul nsw i32 4, %13
%15 = load i32, i32* %4
%16 = mul nsw i32 %14, %15
%17 = sub nsw i32 %12, %16
%18 = call i32 @Sqrt(i32 %17)
store i32 %18, i32* %7
%19 = load i32, i32* %3
%20 = sub nsw i32 0, %19
%21 = load i32, i32* %7
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %2
%24 = mul nsw i32 2, %23
%25 = sdiv i32 %22, %24
store i32 %25, i32* %5
%26 = load i32, i32* %3
%27 = sub nsw i32 0, %26
%28 = load i32, i32* %7
%29 = sub nsw i32 %27, %28
%30 = load i32, i32* %2
%31 = mul nsw i32 2, %30
%32 = sdiv i32 %29, %31
store i32 %32, i32* %6
%33 = load i32, i32* %5
%34 = load i32, i32* %6
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %33, i32 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [26 x i8] c"Enter the values of a,b,c\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [30 x i8] c"The quadratic roots are %d %d\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 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 = call i32 @Sqrt(i32 %15)
%17 = load i32, i32* %2
%18 = sub i32 %16, %17
%19 = load i32, i32* %1
%20 = shl nsw i32 %19, 1
%21 = sdiv i32 %18, %20
%22 = add i32 %16, %17
%23 = sub i32 0, %22
%24 = sdiv i32 %23, %20
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %21, i32 %24)
ret i32 0
}