#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *, char);
int /*<<< orphan*/ squeeze(char *, char *);
int main() {
  int ret = 0;
  char s1[20 + 1], s2[20 + 1];
  int i = 0;
  int c = 0;
  s1[i] = '\0';
  s2[i] = '\0';
  printf("Give me the content of s1 please! \nThe maximum length is %d \n", 20);
  while ((i < 20) && ((c = getchar()) != EOF) && (c != '\n')) {
    s1[i++] = c;
  }
  s1[i++] = '\0';
  printf("Give me the content of s2 please! \nThe maximum length is %d \n", 20);
  i = 0;
  while ((i < 20) && ((c = getchar()) != EOF) && (c != '\n')) {
    s2[i++] = c;
  }
  s2[i++] = '\0';
  squeeze(s1, s2);
  for (i = 0; s1[i] != '\0'; i++)
    printf("%c", s1[i]);
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movslq -0x44(%rbp),%rax
movb   $0x0,-0x20(%rbp,%rax,1)
movslq -0x44(%rbp),%rax
movb   $0x0,-0x40(%rbp,%rax,1)
lea    0xe93(%rip),%rdi
mov    $0x14,%esi
call   1040 <printf@plt>
xor    %eax,%eax
cmpl   $0x14,-0x44(%rbp)
mov    %al,-0x49(%rbp)
jge    11b0 <main+0x80>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x48(%rbp)
xor    %eax,%eax
mov    0x2e4d(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x49(%rbp)
je     11b0 <main+0x80>
cmpl   $0xa,-0x48(%rbp)
setne  %al
mov    %al,-0x49(%rbp)
mov    -0x49(%rbp),%al
test   $0x1,%al
jne    11c0 <main+0x90>
jmp    11db <main+0xab>
mov    -0x48(%rbp),%eax
mov    %al,%cl
mov    -0x44(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
cltq
mov    %cl,-0x20(%rbp,%rax,1)
jmp    1177 <main+0x47>
mov    -0x44(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
cltq
movb   $0x0,-0x20(%rbp,%rax,1)
lea    0xe4a(%rip),%rdi
mov    $0x14,%esi
call   1040 <printf@plt>
movl   $0x0,-0x44(%rbp)
xor    %eax,%eax
cmpl   $0x14,-0x44(%rbp)
mov    %al,-0x4a(%rbp)
jge    123e <main+0x10e>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %eax,%ecx
mov    %ecx,-0x48(%rbp)
xor    %eax,%eax
mov    0x2dbf(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x4a(%rbp)
je     123e <main+0x10e>
cmpl   $0xa,-0x48(%rbp)
setne  %al
mov    %al,-0x4a(%rbp)
mov    -0x4a(%rbp),%al
test   $0x1,%al
jne    124e <main+0x11e>
jmp    1269 <main+0x139>
mov    -0x48(%rbp),%eax
mov    %al,%cl
mov    -0x44(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x44(%rbp)
cltq
mov    %cl,-0x40(%rbp,%rax,1)
jmp    1205 <main+0xd5>
mov    -0x44(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x44(%rbp)
cltq
movb   $0x0,-0x40(%rbp,%rax,1)
lea    -0x20(%rbp),%rdi
lea    -0x40(%rbp),%rsi
call   1030 <squeeze@plt>
movl   $0x0,-0x44(%rbp)
movslq -0x44(%rbp),%rax
movsbl -0x20(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     12c4 <main+0x194>
movslq -0x44(%rbp),%rax
lea    0xdd0(%rip),%rdi
movsbl -0x20(%rbp,%rax,1),%esi
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    128f <main+0x15f>
mov    -0x8(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
movb   $0x0,(%rsp)
movb   $0x0,0x20(%rsp)
lea    0xeb9(%rip),%rdi
mov    $0x14,%esi
call   1040 <printf@plt>
mov    0x2e90(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     1183 <main+0x53>
cmp    (%r14),%eax
je     1183 <main+0x53>
mov    %al,(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x14,%rbx
jne    1160 <main+0x30>
mov    $0x14,%ebx
mov    %ebx,%eax
movb   $0x0,(%rsp,%rax,1)
lea    0xeae(%rip),%rdi
mov    $0x14,%esi
call   1040 <printf@plt>
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%eax
je     11c4 <main+0x94>
cmp    (%r14),%eax
je     11c4 <main+0x94>
mov    %al,0x20(%rsp,%rbx,1)
add    $0x1,%rbx
cmp    $0x14,%rbx
jne    11a0 <main+0x70>
mov    $0x14,%ebx
mov    %ebx,%eax
movb   $0x0,0x20(%rsp,%rax,1)
mov    %rsp,%rdi
lea    0x20(%rsp),%rsi
call   1030 <squeeze@plt>
mov    (%rsp),%al
test   %al,%al
je     1206 <main+0xd6>
lea    0x1(%rsp),%rbx
lea    0xe91(%rip),%r14
nopl   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %r14,%rdi
call   1040 <printf@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    11f0 <main+0xc0>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [62 x i8] c"Give me the content of s1 please! \0AThe maximum length is %d \0A\00"
@EOF = global i32 0
@.str.1 = [62 x i8] c"Give me the content of s2 please! \0AThe maximum length is %d \0A\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [21 x i8]
%4 = alloca [21 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %5
store i32 0, i32* %6
%7 = load i32, i32* %5
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 %8
store i8 0, i8* %9
%10 = load i32, i32* %5
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 %11
store i8 0, i8* %12
%13 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8 signext 20)
br label %14
14: ; preds = %26, %0
%15 = load i32, i32* %5
%16 = icmp slt i32 %15, 20
br i1 %16, label %17, label %24
17: ; preds = %14
%18 = call i32 (...) @getchar()
store i32 %18, i32* %6
%19 = load i32, i32* @EOF
%20 = icmp ne i32 %18, %19
br i1 %20, label %21, label %24
21: ; preds = %17
%22 = load i32, i32* %6
%23 = icmp ne i32 %22, 10
br label %24
24: ; preds = %21, %17, %14
%25 = phi i1 [ false, %17 ], [ false, %14 ], [ %23, %21 ]
br i1 %25, label %26, label %33
26: ; preds = %24
%27 = load i32, i32* %6
%28 = trunc i32 %27 to i8
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
%31 = sext i32 %29 to i64
%32 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 %31
store i8 %28, i8* %32
br label %14
33: ; preds = %24
%34 = load i32, i32* %5
%35 = add nsw i32 %34, 1
store i32 %35, i32* %5
%36 = sext i32 %34 to i64
%37 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 %36
store i8 0, i8* %37
%38 = call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8 signext 20)
store i32 0, i32* %5
br label %39
39: ; preds = %51, %33
%40 = load i32, i32* %5
%41 = icmp slt i32 %40, 20
br i1 %41, label %42, label %49
42: ; preds = %39
%43 = call i32 (...) @getchar()
store i32 %43, i32* %6
%44 = load i32, i32* @EOF
%45 = icmp ne i32 %43, %44
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = load i32, i32* %6
%48 = icmp ne i32 %47, 10
br label %49
49: ; preds = %46, %42, %39
%50 = phi i1 [ false, %42 ], [ false, %39 ], [ %48, %46 ]
br i1 %50, label %51, label %58
51: ; preds = %49
%52 = load i32, i32* %6
%53 = trunc i32 %52 to i8
%54 = load i32, i32* %5
%55 = add nsw i32 %54, 1
store i32 %55, i32* %5
%56 = sext i32 %54 to i64
%57 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 %56
store i8 %53, i8* %57
br label %39
58: ; preds = %49
%59 = load i32, i32* %5
%60 = add nsw i32 %59, 1
store i32 %60, i32* %5
%61 = sext i32 %59 to i64
%62 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 %61
store i8 0, i8* %62
%63 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 0
%64 = getelementptr inbounds [21 x i8], [21 x i8]* %4, i64 0, i64 0
%65 = call i32 @squeeze(i8* %63, i8* %64)
store i32 0, i32* %5
br label %66
66: ; preds = %79, %58
%67 = load i32, i32* %5
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 %68
%70 = load i8, i8* %69
%71 = sext i8 %70 to i32
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %82
73: ; preds = %66
%74 = load i32, i32* %5
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [21 x i8], [21 x i8]* %3, i64 0, i64 %75
%77 = load i8, i8* %76
%78 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %77)
br label %79
79: ; preds = %73
%80 = load i32, i32* %5
%81 = add nsw i32 %80, 1
store i32 %81, i32* %5
br label %66
82: ; preds = %66
%83 = load i32, i32* %2
ret i32 %83
}

LLVM IR (-O2):
@.str = [62 x i8] c"Give me the content of s1 please! \0AThe maximum length is %d \0A\00"
@EOF = global i32 0
@.str.1 = [62 x i8] c"Give me the content of s2 please! \0AThe maximum length is %d \0A\00"
@.str.2 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca [21 x i8]
%2 = alloca [21 x i8]
%3 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 0
store i8 0, i8* %3
store i8 0, i8* %4
%5 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0), i8 signext 20)
br label %6
6: ; preds = %0, %13
%7 = phi i64 [ 0, %0 ], [ %15, %13 ]
%8 = tail call i32 (...) @getchar()
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %8, %9
%11 = icmp ne i32 %8, 10
%12 = and i1 %11, %10
br i1 %12, label %13, label %18
13: ; preds = %6
%14 = trunc i32 %8 to i8
%15 = add nuw nsw i64 %7, 1
%16 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %7
store i8 %14, i8* %16
%17 = icmp eq i64 %15, 20
br i1 %17, label %18, label %6
18: ; preds = %13, %6
%19 = phi i64 [ 20, %13 ], [ %7, %6 ]
%20 = and i64 %19, 4294967295
%21 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %20
store i8 0, i8* %21
%22 = tail call i32 @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.1, i64 0, i64 0), i8 signext 20)
br label %23
23: ; preds = %18, %30
%24 = phi i64 [ 0, %18 ], [ %32, %30 ]
%25 = tail call i32 (...) @getchar()
%26 = load i32, i32* @EOF
%27 = icmp ne i32 %25, %26
%28 = icmp ne i32 %25, 10
%29 = and i1 %28, %27
br i1 %29, label %30, label %35
30: ; preds = %23
%31 = trunc i32 %25 to i8
%32 = add nuw nsw i64 %24, 1
%33 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %24
store i8 %31, i8* %33
%34 = icmp eq i64 %32, 20
br i1 %34, label %35, label %23
35: ; preds = %30, %23
%36 = phi i64 [ 20, %30 ], [ %24, %23 ]
%37 = and i64 %36, 4294967295
%38 = getelementptr inbounds [21 x i8], [21 x i8]* %2, i64 0, i64 %37
store i8 0, i8* %38
%39 = call i32 @squeeze(i8* %3, i8* %4)
%40 = load i8, i8* %3
%41 = icmp eq i8 %40, 0
br i1 %41, label %50, label %42
42: ; preds = %35, %42
%43 = phi i64 [ %46, %42 ], [ 0, %35 ]
%44 = phi i8 [ %48, %42 ], [ %40, %35 ]
%45 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8 signext %44)
%46 = add nuw i64 %43, 1
%47 = getelementptr inbounds [21 x i8], [21 x i8]* %1, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 0
br i1 %49, label %50, label %42
50: ; preds = %42, %35
ret i32 0
}