#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 */
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_input_triangle();
int main() {
  int loopAgain;
  char inputChar;
  do {
    printf("Enter 3 sides to test for a triangle (a b c): ");
    test_input_triangle();
    printf("Would you like to enter three new sides (Y/N)? ");
    inputChar = getchar();
    if (inputChar == 'Y' || inputChar == 'y')
      loopAgain = 1;
    else
      loopAgain = 0;
  } while (loopAgain);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_input_triangle@plt>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x59,%eax
je     1182 <main+0x52>
movsbl -0x9(%rbp),%eax
cmp    $0x79,%eax
jne    118e <main+0x5e>
movl   $0x1,-0x8(%rbp)
jmp    1195 <main+0x65>
movl   $0x0,-0x8(%rbp)
jmp    119a <main+0x6a>
cmpl   $0x0,-0x8(%rbp)
jne    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xec5(%rip),%r14
lea    0xeed(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <test_input_triangle@plt>
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
and    $0xdf,%al
cmp    $0x59,%al
je     1150 <main+0x20>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [47 x i8] c"Enter 3 sides to test for a triangle (a b c): \00"
@.str.1 = [48 x i8] c"Would you like to enter three new sides (Y/N)? \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %19, %0
%5 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @test_input_triangle()
%7 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %3
%9 = load i8, i8* %3
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 89
br i1 %11, label %16, label %12
12: ; preds = %4
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 121
br i1 %15, label %16, label %17
16: ; preds = %12, %4
store i32 1, i32* %2
br label %18
17: ; preds = %12
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
br label %19
19: ; preds = %18
%20 = load i32, i32* %2
%21 = icmp ne i32 %20, 0
br i1 %21, label %4, label %22
22: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [47 x i8] c"Enter 3 sides to test for a triangle (a b c): \00"
@.str.1 = [48 x i8] c"Would you like to enter three new sides (Y/N)? \00"
define i32 @main() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (...) @test_input_triangle()
%4 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call signext i8 (...) @getchar()
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 89
br i1 %7, label %1, label %8
8: ; preds = %1
ret i32 0
}