#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*/ puts(char *);
int main(void) {
  char c;
  char s1[1000];
  char s2[1000];
  int x = 0;
  int y = 0;
  int max;
  puts("You must say something on 2 rows");
  puts("Any letter that is repeated will be deleted :-S");
  puts("When you wanna stop, press '~'");
  puts("Start\n\n");
  while ((c = getchar()) != '~') {
    s1[x++] = c;
    if (c == '\n') {
    tambalau:
      do {
        c = getchar();
        s2[y++] = c;
      } while ((c != '\n') && (c != '~'));
      printf("Am iesit!!!!!!!");
      s1[x] = '\0';
      s2[y] = '\0';
      getchar();
      break;
    }
  }
  printf("**I made it**\n");
  getchar();
  max = (x > y) ? x - 1 : y - 1;
  printf("**max is %d**\n", max);
  printf("Y este %d\n\n", y);
  getchar();
  for (;;) {
    if (y == 0) {
      printf("You gotta say some more !\n");
      goto tambalau;
      break;
    } else {
      for (x = 0; x < max; x++)
        for (y = 0; y < max; y++) {
          if (s1[x] != s2[y]) {
            printf("%c", s1[x]);
            break;
          } else
            continue;
        }
    }
  }
  while (getchar() != '\n')
    continue;
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x800,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x7e4(%rbp)
movl   $0x0,-0x7e8(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
call   1030 <puts@plt>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeef(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
cmp    $0x7e,%eax
je     1267 <main+0x137>
mov    -0x5(%rbp),%cl
mov    -0x7e4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x7e4(%rbp)
cltq
mov    %cl,-0x3f0(%rbp,%rax,1)
movsbl -0x5(%rbp),%eax
cmp    $0xa,%eax
jne    1262 <main+0x132>
jmp    11cb <main+0x9b>
jmp    11d0 <main+0xa0>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%cl
mov    -0x7e8(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x7e8(%rbp)
cltq
mov    %cl,-0x7e0(%rbp,%rax,1)
movsbl -0x5(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x7ed(%rbp)
je     121c <main+0xec>
movsbl -0x5(%rbp),%eax
cmp    $0x7e,%eax
setne  %al
mov    %al,-0x7ed(%rbp)
mov    -0x7ed(%rbp),%al
test   $0x1,%al
jne    11d0 <main+0xa0>
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movslq -0x7e4(%rbp),%rax
movb   $0x0,-0x3f0(%rbp,%rax,1)
movslq -0x7e8(%rbp),%rax
movb   $0x0,-0x7e0(%rbp,%rax,1)
mov    $0x0,%al
call   1050 <getchar@plt>
jmp    1267 <main+0x137>
jmp    1186 <main+0x56>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    -0x7e4(%rbp),%eax
cmp    -0x7e8(%rbp),%eax
jle    12a2 <main+0x172>
mov    -0x7e4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7f4(%rbp)
jmp    12b1 <main+0x181>
mov    -0x7e8(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x7f4(%rbp)
mov    -0x7f4(%rbp),%eax
mov    %eax,-0x7ec(%rbp)
mov    -0x7ec(%rbp),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x7e8(%rbp),%esi
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
cmpl   $0x0,-0x7e8(%rbp)
jne    130c <main+0x1dc>
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11cb <main+0x9b>
movl   $0x0,-0x7e4(%rbp)
mov    -0x7e4(%rbp),%eax
cmp    -0x7ec(%rbp),%eax
jge    13be <main+0x28e>
movl   $0x0,-0x7e8(%rbp)
mov    -0x7e8(%rbp),%eax
cmp    -0x7ec(%rbp),%eax
jge    13a5 <main+0x275>
movslq -0x7e4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%eax
ff
movslq -0x7e8(%rbp),%rcx
movsbl -0x7e0(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     138c <main+0x25c>
movslq -0x7e4(%rbp),%rax
movsbl -0x3f0(%rbp,%rax,1),%esi
ff
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13a5 <main+0x275>
jmp    1391 <main+0x261>
mov    -0x7e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e8(%rbp)
jmp    1332 <main+0x202>
jmp    13aa <main+0x27a>
mov    -0x7e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x7e4(%rbp)
jmp    1316 <main+0x1e6>
jmp    13c3 <main+0x293>
jmp    12ec <main+0x1bc>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x7e0,%rsp
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xee3(%rip),%rdi
call   1040 <puts@plt>
lea    0xef6(%rip),%rdi
call   1040 <puts@plt>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    $0x7e,%al
je     11ad <main+0x6d>
mov    %al,0x3f0(%rsp,%r14,1)
add    $0x1,%r14
cmp    $0xa,%al
jne    1190 <main+0x50>
jmp    11b1 <main+0x71>
xor    %ebx,%ebx
jmp    11fc <main+0xbc>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x7e,%al
je     11d6 <main+0x96>
cmp    $0xa,%al
jne    11c0 <main+0x80>
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
movslq %r14d,%rax
movb   $0x0,0x3f0(%rsp,%rax,1)
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
lea    0xea0(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
cmp    %ebx,%r14d
mov    %ebx,%r15d
cmovg  %r14d,%r15d
lea    -0x1(%r15),%r12d
lea    0xe64(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe62(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
test   %ebx,%ebx
je     12a4 <main+0x164>
mov    %r12d,%ebp
jmp    1257 <main+0x117>
xchg   %ax,%ax
mov    %r12d,%r14d
test   %ebx,%ebx
je     12a4 <main+0x164>
mov    $0x0,%r14d
cmp    $0x2,%r15d
jl     1253 <main+0x113>
xor    %r14d,%r14d
jmp    127e <main+0x13e>
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%r14
cmp    %rbp,%r14
je     1250 <main+0x110>
movsbl 0x3f0(%rsp,%r14,1),%edi
xor    %ebx,%ebx
nopl   0x0(%rax)
cmp    (%rsp,%rbx,1),%dil
jne    1270 <main+0x130>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1290 <main+0x150>
mov    %r12d,%ebx
jmp    1275 <main+0x135>
lea    0xe06(%rip),%rdi
call   1040 <puts@plt>
jmp    11b1 <main+0x71>

LLVM IR (-O0):
@.str = [33 x i8] c"You must say something on 2 rows\00"
@.str.1 = [48 x i8] c"Any letter that is repeated will be deleted :-S\00"
@.str.2 = [31 x i8] c"When you wanna stop, press '~'\00"
@.str.3 = [8 x i8] c"Start\0A\0A\00"
@.str.4 = [16 x i8] c"Am iesit!!!!!!!\00"
@.str.5 = [15 x i8] c"**I made it**\0A\00"
@.str.6 = [15 x i8] c"**max is %d**\0A\00"
@.str.7 = [12 x i8] c"Y este %d\0A\0A\00"
@.str.8 = [27 x i8] c"You gotta say some more !\0A\00"
@.str.9 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [1000 x i8]
%4 = alloca [1000 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %6
%8 = call i32 @puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %12
12: ; preds = %53, %0
%13 = call signext i8 (...) @getchar()
store i8 %13, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 126
br i1 %15, label %16, label %54
16: ; preds = %12
%17 = load i8, i8* %2
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %20
store i8 %17, i8* %21
%22 = load i8, i8* %2
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 10
br i1 %24, label %25, label %53
25: ; preds = %16
br label %26
26: ; preds = %76, %25
br label %27
27: ; preds = %42, %26
%28 = call signext i8 (...) @getchar()
store i8 %28, i8* %2
%29 = load i8, i8* %2
%30 = load i32, i32* %6
%31 = add nsw i32 %30, 1
store i32 %31, i32* %6
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %32
store i8 %29, i8* %33
br label %34
34: ; preds = %27
%35 = load i8, i8* %2
%36 = sext i8 %35 to i32
%37 = icmp ne i32 %36, 10
br i1 %37, label %38, label %42
38: ; preds = %34
%39 = load i8, i8* %2
%40 = sext i8 %39 to i32
%41 = icmp ne i32 %40, 126
br label %42
42: ; preds = %38, %34
%43 = phi i1 [ false, %34 ], [ %41, %38 ]
br i1 %43, label %27, label %44
44: ; preds = %42
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%46 = load i32, i32* %5
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %47
store i8 0, i8* %48
%49 = load i32, i32* %6
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %50
store i8 0, i8* %51
%52 = call signext i8 (...) @getchar()
br label %54
53: ; preds = %16
br label %12
54: ; preds = %44, %12
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%56 = call signext i8 (...) @getchar()
%57 = load i32, i32* %5
%58 = load i32, i32* %6
%59 = icmp sgt i32 %57, %58
br i1 %59, label %60, label %63
60: ; preds = %54
%61 = load i32, i32* %5
%62 = sub nsw i32 %61, 1
br label %66
63: ; preds = %54
%64 = load i32, i32* %6
%65 = sub nsw i32 %64, 1
br label %66
66: ; preds = %63, %60
%67 = phi i32 [ %62, %60 ], [ %65, %63 ]
store i32 %67, i32* %7
%68 = load i32, i32* %7
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %68)
%70 = load i32, i32* %6
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %70)
%72 = call signext i8 (...) @getchar()
br label %73
73: ; preds = %116, %66
%74 = load i32, i32* %6
%75 = icmp eq i32 %74, 0
br i1 %75, label %76, label %78
76: ; preds = %73
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
br label %26
78: ; preds = %73
store i32 0, i32* %5
br label %79
79: ; preds = %112, %78
%80 = load i32, i32* %5
%81 = load i32, i32* %7
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %115
83: ; preds = %79
store i32 0, i32* %6
br label %84
84: ; preds = %108, %83
%85 = load i32, i32* %6
%86 = load i32, i32* %7
%87 = icmp slt i32 %85, %86
br i1 %87, label %88, label %111
88: ; preds = %84
%89 = load i32, i32* %5
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %90
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
%94 = load i32, i32* %6
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds [1000 x i8], [1000 x i8]* %4, i64 0, i64 %95
%97 = load i8, i8* %96
%98 = sext i8 %97 to i32
%99 = icmp ne i32 %93, %98
br i1 %99, label %100, label %107
100: ; preds = %88
%101 = load i32, i32* %5
%102 = sext i32 %101 to i64
%103 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 %102
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %105)
br label %111
107: ; preds = %88
br label %108
108: ; preds = %107
%109 = load i32, i32* %6
%110 = add nsw i32 %109, 1
store i32 %110, i32* %6
br label %84
111: ; preds = %100, %84
br label %112
112: ; preds = %111
%113 = load i32, i32* %5
%114 = add nsw i32 %113, 1
store i32 %114, i32* %5
br label %79
115: ; preds = %79
br label %116
116: ; preds = %115
br label %73
}

LLVM IR (-O2):
@.str = [33 x i8] c"You must say something on 2 rows\00"
@.str.1 = [48 x i8] c"Any letter that is repeated will be deleted :-S\00"
@.str.2 = [31 x i8] c"When you wanna stop, press '~'\00"
@.str.3 = [8 x i8] c"Start\0A\0A\00"
@.str.4 = [16 x i8] c"Am iesit!!!!!!!\00"
@.str.6 = [15 x i8] c"**max is %d**\0A\00"
@.str.7 = [12 x i8] c"Y este %d\0A\0A\00"
@str = [14 x i8] c"**I made it**\00"
@str.10 = [26 x i8] c"You gotta say some more !\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = alloca [1000 x i8]
%3 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %9
9: ; preds = %13, %0
%10 = phi i64 [ %14, %13 ], [ 0, %0 ]
%11 = tail call signext i8 (...) @getchar()
%12 = icmp eq i8 %11, 126
br i1 %12, label %34, label %13
13: ; preds = %9
%14 = add nuw i64 %10, 1
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %10
store i8 %11, i8* %15
%16 = icmp eq i8 %11, 10
br i1 %16, label %17, label %9
17: ; preds = %13
%18 = trunc i64 %14 to i32
br label %19
19: ; preds = %17, %58
%20 = phi i32 [ %59, %58 ], [ %18, %17 ]
br label %21
21: ; preds = %21, %19
%22 = phi i64 [ %24, %21 ], [ 0, %19 ]
%23 = tail call signext i8 (...) @getchar()
%24 = add nuw i64 %22, 1
%25 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %22
store i8 %23, i8* %25
switch i8 %23, label %21 [
i8 126, label %26
i8 10, label %26
]
26: ; preds = %21, %21
%27 = trunc i64 %24 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0))
%29 = sext i32 %20 to i64
%30 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %29
store i8 0, i8* %30
%31 = and i64 %24, 4294967295
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %31
store i8 0, i8* %32
%33 = tail call signext i8 (...) @getchar()
br label %36
34: ; preds = %9
%35 = trunc i64 %10 to i32
br label %36
36: ; preds = %34, %26
%37 = phi i32 [ %20, %26 ], [ %35, %34 ]
%38 = phi i32 [ %27, %26 ], [ 0, %34 ]
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%40 = tail call signext i8 (...) @getchar()
%41 = icmp sgt i32 %37, %38
%42 = select i1 %41, i32 %37, i32 %38
%43 = add nsw i32 %42, -1
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i32 %43)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %38)
%46 = tail call signext i8 (...) @getchar()
%47 = icmp eq i32 %38, 0
br i1 %47, label %58, label %48
48: ; preds = %36
%49 = icmp sgt i32 %42, 1
%50 = add i32 %42, -1
%51 = zext i32 %43 to i64
br label %56
52: ; preds = %77, %56
%53 = phi i32 [ 0, %56 ], [ %43, %77 ]
%54 = phi i32 [ %57, %56 ], [ %78, %77 ]
%55 = icmp eq i32 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %48, %52
%57 = phi i32 [ %38, %48 ], [ %54, %52 ]
br i1 %49, label %61, label %52
58: ; preds = %52, %36
%59 = phi i32 [ %37, %36 ], [ %53, %52 ]
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.10, i64 0, i64 0))
br label %19
61: ; preds = %56, %77
%62 = phi i64 [ %79, %77 ], [ 0, %56 ]
%63 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 %62
%64 = load i8, i8* %63
br label %65
65: ; preds = %61, %74
%66 = phi i64 [ 0, %61 ], [ %75, %74 ]
%67 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = icmp eq i8 %64, %68
br i1 %69, label %74, label %70
70: ; preds = %65
%71 = trunc i64 %66 to i32
%72 = sext i8 %64 to i32
%73 = tail call i32 @putchar(i32 %72)
br label %77
74: ; preds = %65
%75 = add nuw nsw i64 %66, 1
%76 = icmp eq i64 %75, %51
br i1 %76, label %77, label %65
77: ; preds = %74, %70
%78 = phi i32 [ %71, %70 ], [ %50, %74 ]
%79 = add nuw nsw i64 %62, 1
%80 = icmp eq i64 %79, %51
br i1 %80, label %52, label %61
}