#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 */
scalar_t__ calc_discrim(int, int, int);
int /*<<< orphan*/ calc_roots(int, int, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int main(void) {
  int a, b, c;
  printf("Enter values for a, b, and c\n");
  printf("(a, b, c)");
  scanf("%i, %i, %i", &a, &b, &c);
  if (calc_discrim(a, b, c) < 0) {
    printf("The roots are imaginary!\n");
  } else {
    calc_roots(a, b, c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
lea    0xebc(%rip),%rdi
call   1030 <printf@plt>
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <calc_discrim@plt>
cmp    $0x0,%rax
jge    11a8 <main+0x68>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
jmp    11b6 <main+0x76>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <calc_roots@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeba(%rip),%rdi
call   1030 <puts@plt>
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
lea    0xe97(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1070 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1050 <calc_discrim@plt>
test   %rax,%rax
js     11b0 <main+0x60>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    0xc(%rsp),%edx
call   1060 <calc_roots@plt>
jmp    11bc <main+0x6c>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Enter values for a, b, and c\0A\00"
@.str.1 = [10 x i8] c"(a, b, c)\00"
@.str.2 = [11 x i8] c"%i, %i, %i\00"
@.str.3 = [26 x i8] c"The roots are imaginary!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i64 @calc_discrim(i32 %8, i32 %9, i32 %10)
%12 = icmp slt i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %0
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0))
br label %20
15: ; preds = %0
%16 = load i32, i32* %2
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @calc_roots(i32 %16, i32 %17, i32 %18)
br label %20
20: ; preds = %15, %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"(a, b, c)\00"
@.str.2 = [11 x i8] c"%i, %i, %i\00"
@str = [29 x i8] c"Enter values for a, b, and c\00"
@str.4 = [25 x i8] c"The roots are imaginary!\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 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i64 @calc_discrim(i32 %10, i32 %11, i32 %12)
%14 = icmp slt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %0
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.4, i64 0, i64 0))
br label %22
17: ; preds = %0
%18 = load i32, i32* %1
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @calc_roots(i32 %18, i32 %19, i32 %20)
br label %22
22: ; preds = %17, %15
ret i32 0
}