#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 *);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int /*<<< orphan*/ triangulo(int, int, int);
int main(void) {
  int x, y, z, flag = 1;
  printf("0 0 0 sai do programa\n\n");
  while (flag != 0) {
    printf("Digite as 3 medidas do triangulo: ");
    scanf("%d %d %d", &x, &y, &z);
    if ((x == 0) && (y == 0) && (z == 0))
      flag = 0;
    triangulo(x, y, z);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x14(%rbp)
je     11b8 <main+0x88>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1050 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11a5 <main+0x75>
cmpl   $0x0,-0xc(%rbp)
jne    11a5 <main+0x75>
cmpl   $0x0,-0x10(%rbp)
jne    11a5 <main+0x75>
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <triangulo@plt>
jmp    1152 <main+0x22>
mov    -0x4(%rbp),%eax
add    $0x20,%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    0xed7(%rip),%rdi
call   1030 <puts@plt>
lea    0xec2(%rip),%r15
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xc(%rsp),%rbx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
mov    %rbx,%rcx
call   1060 <scanf@plt>
mov    0x14(%rsp),%edi
mov    0x10(%rsp),%esi
mov    %esi,%r14d
or     %edi,%r14d
mov    0xc(%rsp),%ebp
mov    %ebp,%edx
call   1050 <triangulo@plt>
or     %ebp,%r14d
jne    1170 <main+0x30>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"0 0 0 sai do programa\0A\0A\00"
@.str.1 = [35 x i8] c"Digite as 3 medidas do triangulo: \00"
@.str.2 = [9 x i8] c"%d %d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %5
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %22, %0
%8 = load i32, i32* %5
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %22
15: ; preds = %10
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i32, i32* %4
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %22
21: ; preds = %18
store i32 0, i32* %5
br label %22
22: ; preds = %21, %18, %15, %10
%23 = load i32, i32* %2
%24 = load i32, i32* %3
%25 = load i32, i32* %4
%26 = call i32 @triangulo(i32 %23, i32 %24, i32 %25)
br label %7
27: ; preds = %7
%28 = load i32, i32* %1
ret i32 %28
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"Digite as 3 medidas do triangulo: \00"
@.str.2 = [9 x i8] c"%d %d %d\00"
@str = [23 x i8] c"0 0 0 sai do programa\0A\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 ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %0, %8
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%11 = load i32, i32* %1
%12 = load i32, i32* %2
%13 = or i32 %12, %11
%14 = load i32, i32* %3
%15 = or i32 %13, %14
%16 = icmp eq i32 %15, 0
%17 = call i32 @triangulo(i32 %11, i32 %12, i32 %14)
br i1 %16, label %18, label %8
18: ; preds = %8
ret i32 0
}