#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 /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(void) {
  int firstSide;
  int secondSide;
  int thirdSide;
  printf("%s", "Enter first side(0 to exit): ");
  scanf("%d", &firstSide);
  while (firstSide != 0) {
    printf("%s", "Enter second sie: ");
    scanf("%d", &secondSide);
    printf("%s", "Enter third sie: ");
    scanf("%d", &thirdSide);
    if (firstSide < 0) {
      puts("You have provided a negative side!!!");
      puts("Please provide a new number!!!");
    } else if (secondSide < 0) {
      puts("You have provided a negative side!!!");
      puts("Please provide a new number!!!");
    } else if (thirdSide < 0) {
      puts("You have provided a negative side!!!");
      puts("Please provide a new number!!!");
    } else {
      puts("The given sides can represent a right triangle");
    }
    printf("\n%s", "Enter first side(0 to exit): ");
    scanf("%d", &firstSide);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf74(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1040 <printf@plt>
lea    0xec5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
je     1265 <main+0x135>
lea    0xf47(%rip),%rdi
lea    0xea7(%rip),%rsi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xf24(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1040 <printf@plt>
lea    0xe75(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jge    11d9 <main+0xa9>
lea    0xe83(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1030 <puts@plt>
jmp    123d <main+0x10d>
cmpl   $0x0,-0xc(%rbp)
jge    1200 <main+0xd0>
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
jmp    1238 <main+0x108>
cmpl   $0x0,-0x10(%rbp)
jge    1227 <main+0xf7>
lea    0xe35(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1030 <puts@plt>
jmp    1233 <main+0x103>
lea    0xe5c(%rip),%rdi
call   1030 <puts@plt>
jmp    1238 <main+0x108>
jmp    123d <main+0x10d>
lea    0xe75(%rip),%rdi
lea    0xdb5(%rip),%rsi
call   1040 <printf@plt>
lea    0xdc7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
jmp    1162 <main+0x32>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xf75(%rip),%rdi
lea    0xeb4(%rip),%rsi
call   1040 <printf@plt>
lea    0xec6(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     122c <main+0xfc>
lea    0xf46(%rip),%r15
lea    0xea3(%rip),%rbx
lea    0x10(%rsp),%rbp
lea    0xf32(%rip),%r14
lea    0xe72(%rip),%r12
lea    0xc(%rsp),%r13
jmp    11d5 <main+0xa5>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
je     122c <main+0xfc>
mov    %r15,%rdi
lea    0xe42(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
call   1050 <scanf@plt>
mov    %r15,%rdi
lea    0xe39(%rip),%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1050 <scanf@plt>
cmpl   $0x0,0xc(%rsp)
js     11a0 <main+0x70>
cmpl   $0x0,0x14(%rsp)
js     11a0 <main+0x70>
cmpl   $0x0,0x10(%rsp)
lea    0xe65(%rip),%rdi
jns    11b3 <main+0x83>
jmp    11a0 <main+0x70>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [30 x i8] c"Enter first side(0 to exit): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"Enter second sie: \00"
@.str.4 = [18 x i8] c"Enter third sie: \00"
@.str.5 = [37 x i8] c"You have provided a negative side!!!\00"
@.str.6 = [31 x i8] c"Please provide a new number!!!\00"
@.str.7 = [47 x i8] c"The given sides can represent a right triangle\00"
@.str.8 = [4 x i8] c"\0A%s\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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %7
7: ; preds = %36, %0
%8 = load i32, i32* %2
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %39
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%13 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%15 = load i32, i32* %2
%16 = icmp slt i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %36
20: ; preds = %10
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%25 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %35
26: ; preds = %20
%27 = load i32, i32* %4
%28 = icmp slt i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %26
%30 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
%31 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
br label %34
32: ; preds = %26
%33 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0))
br label %34
34: ; preds = %32, %29
br label %35
35: ; preds = %34, %23
br label %36
36: ; preds = %35, %17
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %7
39: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [30 x i8] c"Enter first side(0 to exit): \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [19 x i8] c"Enter second sie: \00"
@.str.4 = [18 x i8] c"Enter third sie: \00"
@.str.5 = [37 x i8] c"You have provided a negative side!!!\00"
@.str.6 = [31 x i8] c"Please provide a new number!!!\00"
@.str.7 = [47 x i8] c"The given sides can represent a right triangle\00"
@.str.8 = [4 x i8] c"\0A%s\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 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 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 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %33, label %11
11: ; preds = %0, %26
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %1
%17 = icmp slt i32 %16, 0
%18 = load i32, i32* %2
%19 = icmp slt i32 %18, 0
%20 = select i1 %17, i1 true, i1 %19
%21 = load i32, i32* %3
%22 = icmp slt i32 %21, 0
%23 = select i1 %20, i1 true, i1 %22
br i1 %23, label %24, label %26
24: ; preds = %11
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0))
br label %26
26: ; preds = %11, %24
%27 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0), %24 ], [ getelementptr inbounds ([47 x i8], [47 x i8]* @.str.7, i64 0, i64 0), %11 ]
%28 = call i32 @puts(i8* dereferenceable(1) %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%31 = load i32, i32* %1
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %11
33: ; preds = %26, %0
ret i32 0
}