#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 mygetchar();
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  int i = 0, car;
  int contCaracters[126 - 32 + 1] = {0};
  char cadena[200];
  printf("Introduix el text acabat en PUNT: \n\n");
  while (i < 200 - 1 && (car = mygetchar()) != '.') {
    if ((car >= 'a' && car <= 'z') || (car >= 'A' && car <= 'Z')) {
      if (contCaracters[car - 32] == 0) {
        cadena[i++] = car;
        contCaracters[car - 32] = 1;
      }
    } else
      cadena[i++] = car;
  }
  cadena[i++] = '.';
  cadena[i] = 0;
  printf("\n\nEl text és: \n\n%s\n", cadena);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x280,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0x17c,%edx
call   1050 <memset@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
cmpl   $0xc7,-0x14(%rbp)
mov    %al,-0x271(%rbp)
jge    119c <main+0x6c>
mov    $0x0,%al
call   1030 <mygetchar@plt>
mov    %eax,-0x18(%rbp)
cmp    $0x2e,%eax
setne  %al
mov    %al,-0x271(%rbp)
mov    -0x271(%rbp),%al
test   $0x1,%al
jne    11af <main+0x7f>
jmp    123c <main+0x10c>
cmpl   $0x61,-0x18(%rbp)
jl     11c3 <main+0x93>
cmpl   $0x7a,-0x18(%rbp)
jle    11d7 <main+0xa7>
cmpl   $0x41,-0x18(%rbp)
jl     121e <main+0xee>
cmpl   $0x5a,-0x18(%rbp)
jg     121e <main+0xee>
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
cltq
cmpl   $0x0,-0x1a0(%rbp,%rax,4)
jne    1219 <main+0xe9>
mov    -0x18(%rbp),%eax
mov    %al,%cl
mov    -0x14(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
cltq
mov    %cl,-0x270(%rbp,%rax,1)
mov    -0x18(%rbp),%eax
sub    $0x20,%eax
cltq
movl   $0x1,-0x1a0(%rbp,%rax,4)
jmp    1237 <main+0x107>
mov    -0x18(%rbp),%eax
mov    %al,%cl
mov    -0x14(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
cltq
mov    %cl,-0x270(%rbp,%rax,1)
jmp    1171 <main+0x41>
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
cltq
movb   $0x2e,-0x270(%rbp,%rax,1)
2e
movslq -0x14(%rbp),%rax
movb   $0x0,-0x270(%rbp,%rax,1)
lea    -0x270(%rbp),%rsi
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2d67(%rip),%rax
mov    (%rax),%eax
add    $0x280,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x250,%rsp
lea    0xd0(%rsp),%rdi
mov    $0x17c,%edx
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xeb2(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
jmp    1181 <main+0x41>
nopl   0x0(%rax)
movslq %ebx,%rcx
add    $0x1,%ebx
mov    %al,(%rsp,%rcx,1)
cmp    $0xc7,%ebx
jge    11bf <main+0x7f>
xor    %eax,%eax
call   1040 <mygetchar@plt>
cmp    $0x2e,%eax
je     11bf <main+0x7f>
mov    %eax,%ecx
and    $0xffffffdf,%ecx
add    $0xffffffbf,%ecx
cmp    $0x19,%ecx
ja     1170 <main+0x30>
mov    %eax,%ecx
add    $0xffffffe0,%ecx
cmpl   $0x0,0xd0(%rsp,%rcx,4)
jne    1179 <main+0x39>
movslq %ebx,%rdx
add    $0x1,%ebx
mov    %al,(%rsp,%rdx,1)
movl   $0x1,0xd0(%rsp,%rcx,4)
jmp    1179 <main+0x39>
movslq %ebx,%rax
movw   $0x2e,(%rsp,%rax,1)
lea    0xe31(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e00(%rip),%rax
mov    (%rax),%eax
add    $0x250,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Introduix el text acabat en PUNT: \0A\0A\00"
@.str.1 = [21 x i8] c"\0A\0AEl text \C3\A9s: \0A\0A%s\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca [95 x i32]
%9 = alloca [200 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = bitcast [95 x i32]* %8 to i8*
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %58, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 199
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 (...) @mygetchar()
store i32 %16, i32* %7
%17 = icmp ne i32 %16, 46
br label %18
18: ; preds = %15, %12
%19 = phi i1 [ false, %12 ], [ %17, %15 ]
br i1 %19, label %20, label %59
20: ; preds = %18
%21 = load i32, i32* %7
%22 = icmp sge i32 %21, 97
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %7
%25 = icmp sle i32 %24, 122
br i1 %25, label %32, label %26
26: ; preds = %23, %20
%27 = load i32, i32* %7
%28 = icmp sge i32 %27, 65
br i1 %28, label %29, label %51
29: ; preds = %26
%30 = load i32, i32* %7
%31 = icmp sle i32 %30, 90
br i1 %31, label %32, label %51
32: ; preds = %29, %23
%33 = load i32, i32* %7
%34 = sub nsw i32 %33, 32
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [95 x i32], [95 x i32]* %8, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 0
br i1 %38, label %39, label %50
39: ; preds = %32
%40 = load i32, i32* %7
%41 = trunc i32 %40 to i8
%42 = load i32, i32* %6
%43 = add nsw i32 %42, 1
store i32 %43, i32* %6
%44 = sext i32 %42 to i64
%45 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 %44
store i8 %41, i8* %45
%46 = load i32, i32* %7
%47 = sub nsw i32 %46, 32
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [95 x i32], [95 x i32]* %8, i64 0, i64 %48
store i32 1, i32* %49
br label %50
50: ; preds = %39, %32
br label %58
51: ; preds = %29, %26
%52 = load i32, i32* %7
%53 = trunc i32 %52 to i8
%54 = load i32, i32* %6
%55 = add nsw i32 %54, 1
store i32 %55, i32* %6
%56 = sext i32 %54 to i64
%57 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 %56
store i8 %53, i8* %57
br label %58
58: ; preds = %51, %50
br label %12
59: ; preds = %18
%60 = load i32, i32* %6
%61 = add nsw i32 %60, 1
store i32 %61, i32* %6
%62 = sext i32 %60 to i64
%63 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 %62
store i8 46, i8* %63
%64 = load i32, i32* %6
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 %65
store i8 0, i8* %66
%67 = getelementptr inbounds [200 x i8], [200 x i8]* %9, i64 0, i64 0
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %67)
%69 = load i32, i32* @EXIT_SUCCESS
ret i32 %69
}

LLVM IR (-O2):
@.str.1 = [21 x i8] c"\0A\0AEl text \C3\A9s: \0A\0A%s\0A\00"
@EXIT_SUCCESS = global i32 0
@str = [36 x i8] c"Introduix el text acabat en PUNT: \0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [95 x i32]
%4 = alloca [200 x i8]
%5 = bitcast [95 x i32]* %3 to i8*
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
br label %8
8: ; preds = %2, %32
%9 = phi i32 [ 0, %2 ], [ %33, %32 ]
%10 = tail call i32 (...) @mygetchar()
%11 = icmp eq i32 %10, 46
br i1 %11, label %35, label %12
12: ; preds = %8
%13 = and i32 %10, -33
%14 = add i32 %13, -65
%15 = icmp ult i32 %14, 26
br i1 %15, label %16, label %27
16: ; preds = %12
%17 = add nsw i32 %10, -32
%18 = zext i32 %17 to i64
%19 = getelementptr inbounds [95 x i32], [95 x i32]* %3, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %16
%23 = trunc i32 %10 to i8
%24 = add nsw i32 %9, 1
%25 = sext i32 %9 to i64
%26 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %25
store i8 %23, i8* %26
store i32 1, i32* %19
br label %32
27: ; preds = %12
%28 = trunc i32 %10 to i8
%29 = add nsw i32 %9, 1
%30 = sext i32 %9 to i64
%31 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %30
store i8 %28, i8* %31
br label %32
32: ; preds = %16, %22, %27
%33 = phi i32 [ %24, %22 ], [ %9, %16 ], [ %29, %27 ]
%34 = icmp slt i32 %33, 199
br i1 %34, label %8, label %35
35: ; preds = %32, %8
%36 = phi i32 [ %33, %32 ], [ %9, %8 ]
%37 = add nsw i32 %36, 1
%38 = sext i32 %36 to i64
%39 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %38
store i8 46, i8* %39
%40 = sext i32 %37 to i64
%41 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 %40
store i8 0, i8* %41
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%43 = load i32, i32* @EXIT_SUCCESS
ret i32 %43
}