#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 EXIT_SUCCESS;
int getchar();
int myisupper(int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  int c;
  while ((c = getchar()) != 'x') {
    if (c == '\n')
      continue;
    if (myisupper(c) == 1)
      printf("true\n");
    else
      printf("false\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x78,%eax
je     1194 <main+0x64>
cmpl   $0xa,-0x8(%rbp)
jne    1161 <main+0x31>
jmp    113f <main+0xf>
mov    -0x8(%rbp),%edi
call   1030 <myisupper@plt>
cmp    $0x1,%eax
jne    1183 <main+0x53>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
jmp    118f <main+0x5f>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
mov    0x2e45(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xecb(%rip),%r14
lea    0xebe(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1150 <main+0x20>
cmp    $0x78,%eax
je     1179 <main+0x49>
mov    %eax,%edi
call   1040 <myisupper@plt>
cmp    $0x1,%eax
mov    %rbx,%rdi
cmove  %r14,%rdi
call   1030 <puts@plt>
jmp    1150 <main+0x20>
mov    0x2e60(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"true\0A\00"
@.str.1 = [7 x i8] c"false\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %18, %9, %0
%4 = call i32 (...) @getchar()
store i32 %4, i32* %2
%5 = icmp ne i32 %4, 120
br i1 %5, label %6, label %19
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 10
br i1 %8, label %9, label %10
9: ; preds = %6
br label %3
10: ; preds = %6
%11 = load i32, i32* %2
%12 = call i32 @myisupper(i32 %11)
%13 = icmp eq i32 %12, 1
br i1 %13, label %14, label %16
14: ; preds = %10
%15 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %18
16: ; preds = %10
%17 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %18
18: ; preds = %16, %14
br label %3
19: ; preds = %3
%20 = load i32, i32* @EXIT_SUCCESS
ret i32 %20
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [6 x i8] c"false\00"
@str.2 = [5 x i8] c"true\00"
define i32 @main() {
br label %1
1: ; preds = %8, %0
%2 = tail call i32 (...) @getchar()
switch i32 %2, label %3 [
i32 120, label %9
i32 10, label %8
]
3: ; preds = %1
%4 = tail call i32 @myisupper(i32 %2)
%5 = icmp eq i32 %4, 1
%6 = select i1 %5, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.2, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
br label %8
8: ; preds = %3, %1
br label %1
9: ; preds = %1
%10 = load i32, i32* @EXIT_SUCCESS
ret i32 %10
}