#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
main() {
  int A, B, C, D;
  printf("\n** CALCULAR UMA EQUACAO QUADRATICA ** \n");
  printf("\nQual o valor de A? ");
  scanf("%i", &A);
  printf("Qual o valor de B? ");
  scanf("%i", &B);
  printf("Qual o valor de C? ");
  scanf("%i", &C);
  D = B * B - 4 * A * C;
  printf("\nO valor de Delta e: %i.\n", D);
  printf("\n\n<< Marco_Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x2,%ecx
imul   -0xc(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%esi
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf0e(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe9e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xe97(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x8(%rsp),%esi
imul   %esi,%esi
mov    0xc(%rsp),%eax
imul   0x4(%rsp),%eax
shl    $0x2,%eax
sub    %eax,%esi
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeaf(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [41 x i8] c"\0A** CALCULAR UMA EQUACAO QUADRATICA ** \0A\00"
@.str.1 = [21 x i8] c"\0AQual o valor de A? \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [20 x i8] c"Qual o valor de B? \00"
@.str.4 = [20 x i8] c"Qual o valor de C? \00"
@.str.5 = [26 x i8] c"\0AO valor de Delta e: %i.\0A\00"
@.str.6 = [21 x i8] c"\0A\0A<< Marco_Tulio >>\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %2
%14 = mul nsw i32 %12, %13
%15 = load i32, i32* %1
%16 = mul nsw i32 4, %15
%17 = load i32, i32* %3
%18 = mul nsw i32 %16, %17
%19 = sub nsw i32 %14, %18
store i32 %19, i32* %4
%20 = load i32, i32* %4
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %20)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 (...) @getchar()
%24 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"\0AQual o valor de A? \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [20 x i8] c"Qual o valor de B? \00"
@.str.4 = [20 x i8] c"Qual o valor de C? \00"
@.str.5 = [26 x i8] c"\0AO valor de Delta e: %i.\0A\00"
@str = [40 x i8] c"\0A** CALCULAR UMA EQUACAO QUADRATICA ** \00"
@str.7 = [20 x i8] c"\0A\0A<< Marco_Tulio >>\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 ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %2
%15 = mul nsw i32 %14, %14
%16 = load i32, i32* %1
%17 = mul i32 %16, -4
%18 = load i32, i32* %3
%19 = mul i32 %17, %18
%20 = add i32 %19, %15
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %20)
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.7, i64 0, i64 0))
%23 = call i32 (...) @getchar()
%24 = call i32 (...) @getchar()
ret i32 0
}