#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__ pow(float, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main(void) {
  float a, b, c, hipo, cat1, cat2;
  printf("Informe 'A', 'B' e 'C': ");
  scanf("%f %f %f", &a, &b, &c);
  if (a > b && a > c) {
    hipo = a;
    cat1 = b;
    cat2 = c;
  } else if (b > a && b > c) {
    hipo = b;
    cat1 = a;
    cat2 = c;
  } else if (c > a && c > b) {
    hipo = c;
    cat1 = a;
    cat2 = b;
  }
  if (pow(hipo, 2) == pow(cat1, 2) + pow(cat2, 2))
    printf("É um triângulo retângulo\n");
  else
    printf("Não é um triângulo retângulo\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11a4 <main+0x74>
movss  -0x8(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11a4 <main+0x74>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    122b <main+0xfb>
movss  -0xc(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11e5 <main+0xb5>
movss  -0xc(%rbp),%xmm0
ucomiss -0x10(%rbp),%xmm0
jbe    11e5 <main+0xb5>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1226 <main+0xf6>
movss  -0x10(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    1221 <main+0xf1>
movss  -0x10(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1221 <main+0xf1>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1226 <main+0xf6>
jmp    122b <main+0xfb>
movss  -0x14(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %rax,-0x28(%rbp)
movss  -0x18(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    %rax,-0x30(%rbp)
movss  -0x1c(%rbp),%xmm0
mov    $0x2,%edi
call   1050 <pow@plt>
mov    -0x30(%rbp),%rcx
mov    %rax,%rdx
mov    -0x28(%rbp),%rax
add    %rdx,%rcx
cmp    %rcx,%rax
jne    1288 <main+0x158>
lea    0xda4(%rip),%rdi
call   1030 <printf@plt>
jmp    1294 <main+0x164>
lea    0xdb0(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeb2(%rip),%rdi
call   1040 <printf@plt>
lea    0xebf(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
movss  0x14(%rsp),%xmm0
movss  0x10(%rsp),%xmm2
ucomiss %xmm2,%xmm0
movss  0xc(%rsp),%xmm1
jbe    1198 <main+0x58>
ucomiss %xmm1,%xmm0
jbe    1198 <main+0x58>
movss  %xmm2,0x8(%rsp)
movss  %xmm1,0x4(%rsp)
jmp    11bf <main+0x7f>
movaps %xmm0,%xmm3
ucomiss %xmm0,%xmm2
movss  %xmm0,0x8(%rsp)
jbe    11b6 <main+0x76>
ucomiss %xmm1,%xmm2
jbe    11b6 <main+0x76>
movaps %xmm2,%xmm0
movss  %xmm1,0x4(%rsp)
jmp    11bf <main+0x7f>
movaps %xmm1,%xmm0
movss  %xmm2,0x4(%rsp)
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %rax,%r14
movss  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %rax,%rbx
movss  0x4(%rsp),%xmm0
mov    $0x2,%edi
call   1060 <pow@plt>
add    %rbx,%rax
cmp    %rax,%r14
lea    0xe47(%rip),%rax
lea    0xe1f(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [25 x i8] c"Informe 'A', 'B' e 'C': \00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [29 x i8] c"\C3\89 um tri\C3\A2ngulo ret\C3\A2ngulo\0A\00"
@.str.3 = [34 x i8] c"N\C3\A3o \C3\A9 um tri\C3\A2ngulo ret\C3\A2ngulo\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 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), float* %2, float* %3, float* %4)
%10 = load float, float* %2
%11 = load float, float* %3
%12 = fcmp ogt float %10, %11
br i1 %12, label %13, label %21
13: ; preds = %0
%14 = load float, float* %2
%15 = load float, float* %4
%16 = fcmp ogt float %14, %15
br i1 %16, label %17, label %21
17: ; preds = %13
%18 = load float, float* %2
store float %18, float* %5
%19 = load float, float* %3
store float %19, float* %6
%20 = load float, float* %4
store float %20, float* %7
br label %47
21: ; preds = %13, %0
%22 = load float, float* %3
%23 = load float, float* %2
%24 = fcmp ogt float %22, %23
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load float, float* %3
%27 = load float, float* %4
%28 = fcmp ogt float %26, %27
br i1 %28, label %29, label %33
29: ; preds = %25
%30 = load float, float* %3
store float %30, float* %5
%31 = load float, float* %2
store float %31, float* %6
%32 = load float, float* %4
store float %32, float* %7
br label %46
33: ; preds = %25, %21
%34 = load float, float* %4
%35 = load float, float* %2
%36 = fcmp ogt float %34, %35
br i1 %36, label %37, label %45
37: ; preds = %33
%38 = load float, float* %4
%39 = load float, float* %3
%40 = fcmp ogt float %38, %39
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = load float, float* %4
store float %42, float* %5
%43 = load float, float* %2
store float %43, float* %6
%44 = load float, float* %3
store float %44, float* %7
br label %45
45: ; preds = %41, %37, %33
br label %46
46: ; preds = %45, %29
br label %47
47: ; preds = %46, %17
%48 = load float, float* %5
%49 = call i64 @pow(float %48, i32 2)
%50 = load float, float* %6
%51 = call i64 @pow(float %50, i32 2)
%52 = load float, float* %7
%53 = call i64 @pow(float %52, i32 2)
%54 = add nsw i64 %51, %53
%55 = icmp eq i64 %49, %54
br i1 %55, label %56, label %58
56: ; preds = %47
%57 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
br label %60
58: ; preds = %47
%59 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %60
60: ; preds = %58, %56
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"Informe 'A', 'B' e 'C': \00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@str = [33 x i8] c"N\C3\A3o \C3\A9 um tri\C3\A2ngulo ret\C3\A2ngulo\00"
@str.4 = [28 x i8] c"\C3\89 um tri\C3\A2ngulo ret\C3\A2ngulo\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 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), float* %1, float* %2, float* %3)
%9 = load float, float* %1
%10 = load float, float* %2
%11 = fcmp ogt float %9, %10
%12 = load float, float* %3
%13 = fcmp ogt float %9, %12
%14 = select i1 %11, i1 %13, i1 false
br i1 %14, label %21, label %15
15: ; preds = %0
%16 = fcmp ogt float %10, %9
%17 = fcmp ogt float %10, %12
%18 = select i1 %16, i1 %17, i1 false
br i1 %18, label %21, label %19
19: ; preds = %15
%20 = fcmp ogt float %12, %9
br label %21
21: ; preds = %19, %15, %0
%22 = phi float [ %12, %19 ], [ %9, %0 ], [ %10, %15 ]
%23 = phi float [ %9, %19 ], [ %10, %0 ], [ %9, %15 ]
%24 = phi float [ %10, %19 ], [ %12, %0 ], [ %12, %15 ]
%25 = call i64 @pow(float %22, i32 2)
%26 = call i64 @pow(float %23, i32 2)
%27 = call i64 @pow(float %24, i32 2)
%28 = add nsw i64 %27, %26
%29 = icmp eq i64 %25, %28
%30 = select i1 %29, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @str.4, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0)
%31 = call i32 @puts(i8* dereferenceable(1) %30)
ret i32 0
}