#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__ isLower(char);
scalar_t__ isNum(char);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int toUpper(char);
int /*<<< orphan*/ tocn(char);
int main() {
  char c;
  printf("please input str : \n");
  do {
    scanf("%c", &c);
    if (isLower(c)) {
      printf("%c", toUpper(c));
    } else if (isNum(c)) {
      tocn(c);
    } else {
      printf("%c", c);
    }
  } while (c != '\n');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe91(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1080 <scanf@plt>
movsbl -0x5(%rbp),%edi
call   1060 <isLower@plt>
cmp    $0x0,%rax
je     11be <main+0x5e>
movsbl -0x5(%rbp),%edi
call   1070 <toUpper@plt>
mov    %eax,%esi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11f6 <main+0x96>
movsbl -0x5(%rbp),%edi
call   1030 <isNum@plt>
cmp    $0x0,%rax
je     11df <main+0x7f>
movsbl -0x5(%rbp),%edi
call   1040 <tocn@plt>
jmp    11f1 <main+0x91>
movsbl -0x5(%rbp),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    11f6 <main+0x96>
jmp    11fb <main+0x9b>
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    117d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xe88(%rip),%rdi
call   1050 <puts@plt>
lea    0xe79(%rip),%r14
lea    0x7(%rsp),%rbx
jmp    11a3 <main+0x33>
xchg   %ax,%ax
call   1080 <toUpper@plt>
mov    %eax,%edi
call   1030 <putchar@plt>
cmpb   $0xa,0x7(%rsp)
je     11e0 <main+0x70>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1090 <scanf@plt>
movsbl 0x7(%rsp),%edi
call   1070 <isLower@plt>
movzbl 0x7(%rsp),%ecx
movsbl %cl,%edi
test   %rax,%rax
jne    1190 <main+0x20>
call   1040 <isNum@plt>
movsbl 0x7(%rsp),%edi
test   %rax,%rax
je     1197 <main+0x27>
call   1060 <tocn@plt>
cmpb   $0xa,0x7(%rsp)
jne    11a3 <main+0x33>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [21 x i8] c"please input str : \0A\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %26, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = call i64 @isLower(i8 signext %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %4
%10 = load i8, i8* %2
%11 = call i32 @toUpper(i8 signext %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %11)
br label %25
13: ; preds = %4
%14 = load i8, i8* %2
%15 = call i64 @isNum(i8 signext %14)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i8, i8* %2
%19 = call i32 @tocn(i8 signext %18)
br label %24
20: ; preds = %13
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %20, %17
br label %25
25: ; preds = %24, %9
br label %26
26: ; preds = %25
%27 = load i8, i8* %2
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %28, 10
br i1 %29, label %4, label %30
30: ; preds = %26
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@str = [20 x i8] c"please input str : \00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str, i64 0, i64 0))
br label %3
3: ; preds = %21, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%5 = load i8, i8* %1
%6 = call i64 @isLower(i8 signext %5)
%7 = icmp eq i64 %6, 0
%8 = load i8, i8* %1
br i1 %7, label %12, label %9
9: ; preds = %3
%10 = call i32 @toUpper(i8 signext %8)
%11 = call i32 @putchar(i32 %10)
br label %21
12: ; preds = %3
%13 = call i64 @isNum(i8 signext %8)
%14 = icmp eq i64 %13, 0
%15 = load i8, i8* %1
br i1 %14, label %18, label %16
16: ; preds = %12
%17 = call i32 @tocn(i8 signext %15)
br label %21
18: ; preds = %12
%19 = sext i8 %15 to i32
%20 = call i32 @putchar(i32 %19)
br label %21
21: ; preds = %9, %18, %16
%22 = load i8, i8* %1
%23 = icmp eq i8 %22, 10
br i1 %23, label %24, label %3
24: ; preds = %21
ret i32 0
}