#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 M, N, L1, L2, H;
  printf("\n ** CALCULO DOS LADOS E DA HIPOTENUSA ** \n");
  printf("\nDigite o valor de M: ");
  scanf("%i", &M);
  printf("Digite o valor de N (M>N): ");
  scanf("%i", &N);
  L1 = M * M - N * N;
  L2 = 2 * M * N;
  H = M * M + N * N;
  printf("\nO valor do lado 1 e: %i.\n", L1);
  printf("O valor do lado 2 e: %i.\n", L2);
  printf("O valor da hipotenusa e: %i.\n", H);
  printf("\n\n<< Marco_Tulio >>\n");
  getchar(), getchar();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec6(%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    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xf3f(%rip),%rdi
call   1030 <puts@plt>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb3(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
call   1060 <scanf@plt>
mov    0x4(%rsp),%ebx
mov    %ebx,%eax
imul   %ebx,%eax
mov    (%rsp),%ebp
imul   %ebp,%ebx
imul   %ebp,%ebp
mov    %eax,%esi
sub    %ebp,%esi
add    %ebx,%ebx
add    %eax,%ebp
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xea2(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"\0A ** CALCULO DOS LADOS E DA HIPOTENUSA ** \0A\00"
@.str.1 = [23 x i8] c"\0ADigite o valor de M: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [28 x i8] c"Digite o valor de N (M>N): \00"
@.str.4 = [27 x i8] c"\0AO valor do lado 1 e: %i.\0A\00"
@.str.5 = [26 x i8] c"O valor do lado 2 e: %i.\0A\00"
@.str.6 = [30 x i8] c"O valor da hipotenusa e: %i.\0A\00"
@.str.7 = [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 = alloca i32
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %1
%12 = load i32, i32* %1
%13 = mul nsw i32 %11, %12
%14 = load i32, i32* %2
%15 = load i32, i32* %2
%16 = mul nsw i32 %14, %15
%17 = sub nsw i32 %13, %16
store i32 %17, i32* %3
%18 = load i32, i32* %1
%19 = mul nsw i32 2, %18
%20 = load i32, i32* %2
%21 = mul nsw i32 %19, %20
store i32 %21, i32* %4
%22 = load i32, i32* %1
%23 = load i32, i32* %1
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %2
%26 = load i32, i32* %2
%27 = mul nsw i32 %25, %26
%28 = add nsw i32 %24, %27
store i32 %28, i32* %5
%29 = load i32, i32* %3
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %29)
%31 = load i32, i32* %4
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %5
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
%36 = call i32 (...) @getchar()
%37 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"\0ADigite o valor de M: \00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [28 x i8] c"Digite o valor de N (M>N): \00"
@.str.4 = [27 x i8] c"\0AO valor do lado 1 e: %i.\0A\00"
@.str.5 = [26 x i8] c"O valor do lado 2 e: %i.\0A\00"
@.str.6 = [30 x i8] c"O valor da hipotenusa e: %i.\0A\00"
@str = [43 x i8] c"\0A ** CALCULO DOS LADOS E DA HIPOTENUSA ** \00"
@str.8 = [20 x i8] c"\0A\0A<< Marco_Tulio >>\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 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* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 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 = load i32, i32* %1
%11 = mul nsw i32 %10, %10
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, %12
%14 = sub nsw i32 %11, %13
%15 = shl nsw i32 %10, 1
%16 = mul nsw i32 %15, %12
%17 = add nuw nsw i32 %13, %11
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0), i32 %14)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %16)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.8, i64 0, i64 0))
%22 = call i32 (...) @getchar()
%23 = call i32 (...) @getchar()
ret i32 0
}