#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*/ free(char *);
int getline(char **, int *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ squeeze(char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char *str1 = NULL, *str2 = NULL;
  int len1 = 0, len2 = 0;
  while (1) {
    printf("enter first string:");
    if (getline(&str1, &len1, stdin) == -1) {
      break;
    }
    printf("enter second string:");
    if (getline(&str2, &len2, stdin) == -1) {
      break;
    }
    squeeze(str1, str2);
    printf("result:%s\n", str1);
  }
  free(str1);
  free(str2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e66(%rip),%rax
mov    (%rax),%edx
lea    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
jne    119f <main+0x5f>
jmp    11f5 <main+0xb5>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e34(%rip),%rax
mov    (%rax),%edx
lea    -0x18(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
jne    11d1 <main+0x91>
jmp    11f5 <main+0xb5>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <squeeze@plt>
mov    -0x10(%rbp),%rsi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    116d <main+0x2d>
mov    -0x10(%rbp),%rdi
call   1040 <free@plt>
mov    -0x18(%rbp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
movq   $0x0,0x8(%rsp)
movq   $0x0,0x18(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x24(%rsp)
lea    0xe89(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e63(%rip),%r12
mov    (%r12),%edx
lea    0x8(%rsp),%rdi
lea    0x14(%rsp),%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
je     1222 <main+0xe2>
lea    0x18(%rsp),%r15
lea    0x24(%rsp),%rbx
lea    0xe4e(%rip),%r13
lea    0x8(%rsp),%rbp
lea    0x14(%rsp),%r14
nopl   0x0(%rax)
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%edx
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
je     1222 <main+0xe2>
mov    0x8(%rsp),%rdi
mov    0x18(%rsp),%rsi
call   1030 <squeeze@plt>
mov    0x8(%rsp),%rsi
lea    0xe2c(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r13,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%r12),%edx
mov    %rbp,%rdi
mov    %r14,%rsi
call   1060 <getline@plt>
cmp    $0xffffffff,%eax
jne    11c0 <main+0x80>
mov    0x8(%rsp),%rdi
call   1040 <free@plt>
mov    0x18(%rsp),%rdi
call   1040 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"enter first string:\00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"enter second string:\00"
@.str.2 = [11 x i8] c"result:%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8* null, i8** %2
store i8* null, i8** %3
store i32 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %0, %18
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @stdin
%9 = call i32 @getline(i8** %2, i32* %4, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %6
br label %24
12: ; preds = %6
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @stdin
%15 = call i32 @getline(i8** %3, i32* %5, i32 %14)
%16 = icmp eq i32 %15, -1
br i1 %16, label %17, label %18
17: ; preds = %12
br label %24
18: ; preds = %12
%19 = load i8*, i8** %2
%20 = load i8*, i8** %3
%21 = call i32 @squeeze(i8* %19, i8* %20)
%22 = load i8*, i8** %2
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %22)
br label %6
24: ; preds = %17, %11
%25 = load i8*, i8** %2
%26 = call i32 @free(i8* %25)
%27 = load i8*, i8** %3
%28 = call i32 @free(i8* %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"enter first string:\00"
@stdin = global i32 0
@.str.1 = [21 x i8] c"enter second string:\00"
@.str.2 = [11 x i8] c"result:%s\0A\00"
define i32 @main() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i8** %1 to i8*
store i8* null, i8** %1
%6 = bitcast i8** %2 to i8*
store i8* null, i8** %2
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @stdin
%11 = call i32 @getline(i8** %1, i32* %3, i32 %10)
%12 = icmp eq i32 %11, -1
br i1 %12, label %28, label %13
13: ; preds = %0, %18
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%15 = load i32, i32* @stdin
%16 = call i32 @getline(i8** %2, i32* %4, i32 %15)
%17 = icmp eq i32 %16, -1
br i1 %17, label %28, label %18
18: ; preds = %13
%19 = load i8*, i8** %1
%20 = load i8*, i8** %2
%21 = call i32 @squeeze(i8* %19, i8* %20)
%22 = load i8*, i8** %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8* %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* @stdin
%26 = call i32 @getline(i8** %1, i32* %3, i32 %25)
%27 = icmp eq i32 %26, -1
br i1 %27, label %28, label %13
28: ; preds = %18, %13, %0
%29 = load i8*, i8** %1
%30 = call i32 @free(i8* %29)
%31 = load i8*, i8** %2
%32 = call i32 @free(i8* %31)
ret i32 0
}