#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*/ gets(char *);
scalar_t__ isalnum(char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
char tolower(char);
int main() {
  char sent[200];
  int x = 0;
  printf("Enter here, the normal, boring, plain sentence : %c\n", 31);
  gets(sent);
  while (sent[x]) {
    if (isalnum(sent[x]))
      sent[x] = tolower(sent[x]);
    else
      sent[x] = '1';
    x++;
  }
  printf("This is the stripped version : %c\n", 25);
  puts(sent);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xd4(%rbp)
lea    0xe8d(%rip),%rdi
mov    $0x1f,%esi
call   1040 <printf@plt>
lea    -0xd0(%rbp),%rdi
call   1060 <gets@plt>
movslq -0xd4(%rbp),%rax
cmpb   $0x0,-0xd0(%rbp,%rax,1)
je     1208 <main+0xb8>
movslq -0xd4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%edi
ff
call   1050 <isalnum@plt>
cmp    $0x0,%rax
je     11e5 <main+0x95>
movslq -0xd4(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%edi
ff
call   1070 <tolower@plt>
mov    %al,%cl
movslq -0xd4(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
jmp    11f4 <main+0xa4>
movslq -0xd4(%rbp),%rax
movb   $0x31,-0xd0(%rbp,%rax,1)
31
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1189 <main+0x39>
lea    0xe26(%rip),%rdi
mov    $0x19,%esi
call   1040 <printf@plt>
lea    -0xd0(%rbp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xd0,%rsp
lea    0xea1(%rip),%rdi
mov    $0x1f,%esi
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <gets@plt>
mov    (%rsp),%al
jmp    1192 <main+0x42>
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1070 <tolower@plt>
mov    %al,(%rbx)
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11a7 <main+0x57>
movsbl %al,%edi
call   1050 <isalnum@plt>
test   %rax,%rax
jne    1180 <main+0x30>
mov    $0x31,%al
jmp    1188 <main+0x38>
lea    0xe87(%rip),%rdi
mov    $0x19,%esi
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [53 x i8] c"Enter here, the normal, boring, plain sentence : %c\0A\00"
@.str.1 = [35 x i8] c"This is the stripped version : %c\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 31)
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%6 = call i32 @gets(i8* %5)
br label %7
7: ; preds = %33, %0
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = icmp ne i8 %11, 0
br i1 %12, label %13, label %36
13: ; preds = %7
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %15
%17 = load i8, i8* %16
%18 = call i64 @isalnum(i8 signext %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %29
20: ; preds = %13
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = call signext i8 @tolower(i8 signext %24)
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %27
store i8 %25, i8* %28
br label %33
29: ; preds = %13
%30 = load i32, i32* %3
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 %31
store i8 49, i8* %32
br label %33
33: ; preds = %29, %20
%34 = load i32, i32* %3
%35 = add nsw i32 %34, 1
store i32 %35, i32* %3
br label %7
36: ; preds = %7
%37 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 25)
%38 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%39 = call i32 @puts(i8* %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [53 x i8] c"Enter here, the normal, boring, plain sentence : %c\0A\00"
@.str.1 = [35 x i8] c"This is the stripped version : %c\0A\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0), i32 31)
%4 = call i32 @gets(i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %22, label %7
7: ; preds = %0, %16
%8 = phi i64 [ %18, %16 ], [ 0, %0 ]
%9 = phi i8 [ %20, %16 ], [ %5, %0 ]
%10 = phi i8* [ %19, %16 ], [ %2, %0 ]
%11 = call i64 @isalnum(i8 signext %9)
%12 = icmp eq i64 %11, 0
br i1 %12, label %16, label %13
13: ; preds = %7
%14 = load i8, i8* %10
%15 = call signext i8 @tolower(i8 signext %14)
br label %16
16: ; preds = %7, %13
%17 = phi i8 [ %15, %13 ], [ 49, %7 ]
store i8 %17, i8* %10
%18 = add nuw i64 %8, 1
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %7
22: ; preds = %16, %0
%23 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i32 25)
%24 = call i32 @puts(i8* %2)
ret i32 0
}