#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*/ altsqueeze(char *, char *);
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int i;
  char input1[100], input2[100], c;
  printf("Type a word, press return type another word.\n");
  for (i = 0; (c = getchar()) != '\n' && i < 100; i++)
    input1[i] = c;
  input1[i] = '\0';
  for (i = 0; (c = getchar()) != '\n' && i < 100; i++)
    input2[i] = c;
  input2[i] = '\0';
  altsqueeze(input1, input2);
  printf("first word: %s \nsecond word: %s\n", input1, input2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xe1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xe2(%rbp)
je     1185 <main+0x55>
cmpl   $0x64,-0x8(%rbp)
setl   %al
mov    %al,-0xe2(%rbp)
mov    -0xe2(%rbp),%al
test   $0x1,%al
jne    1198 <main+0x68>
jmp    11b4 <main+0x84>
mov    -0xe1(%rbp),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1157 <main+0x27>
movslq -0x8(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0xe1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0xe3(%rbp)
je     11f2 <main+0xc2>
cmpl   $0x64,-0x8(%rbp)
setl   %al
mov    %al,-0xe3(%rbp)
mov    -0xe3(%rbp),%al
test   $0x1,%al
jne    1205 <main+0xd5>
jmp    1224 <main+0xf4>
mov    -0xe1(%rbp),%cl
movslq -0x8(%rbp),%rax
mov    %cl,-0xe0(%rbp,%rax,1)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11c4 <main+0x94>
movslq -0x8(%rbp),%rax
movb   $0x0,-0xe0(%rbp,%rax,1)
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1050 <altsqueeze@plt>
lea    -0x70(%rbp),%rsi
lea    -0xe0(%rbp),%rdx
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0xd8,%rsp
lea    0xed0(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
je     118c <main+0x4c>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %al,0x70(%rsp,%rbx,1)
lea    0x1(%rbx),%r14
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
je     118c <main+0x4c>
cmp    $0x63,%rbx
mov    %r14,%rbx
jb     1170 <main+0x30>
movb   $0x0,0x70(%rsp,%r14,1)
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
je     11cb <main+0x8b>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %al,(%rsp,%rbx,1)
lea    0x1(%rbx),%r14
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0xa,%al
je     11cb <main+0x8b>
cmp    $0x63,%rbx
mov    %r14,%rbx
jb     11b0 <main+0x70>
movb   $0x0,(%rsp,%r14,1)
lea    0x70(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <altsqueeze@plt>
lea    0xe16(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [46 x i8] c"Type a word, press return type another word.\0A\00"
@.str.1 = [33 x i8] c"first word: %s \0Asecond word: %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca i8
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %7
7: ; preds = %21, %0
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %5
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 100
br label %14
14: ; preds = %11, %7
%15 = phi i1 [ false, %7 ], [ %13, %11 ]
br i1 %15, label %16, label %24
16: ; preds = %14
%17 = load i8, i8* %5
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %19
store i8 %17, i8* %20
br label %21
21: ; preds = %16
%22 = load i32, i32* %2
%23 = add nsw i32 %22, 1
store i32 %23, i32* %2
br label %7
24: ; preds = %14
%25 = load i32, i32* %2
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %26
store i8 0, i8* %27
store i32 0, i32* %2
br label %28
28: ; preds = %42, %24
%29 = call signext i8 (...) @getchar()
store i8 %29, i8* %5
%30 = sext i8 %29 to i32
%31 = icmp ne i32 %30, 10
br i1 %31, label %32, label %35
32: ; preds = %28
%33 = load i32, i32* %2
%34 = icmp slt i32 %33, 100
br label %35
35: ; preds = %32, %28
%36 = phi i1 [ false, %28 ], [ %34, %32 ]
br i1 %36, label %37, label %45
37: ; preds = %35
%38 = load i8, i8* %5
%39 = load i32, i32* %2
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %40
store i8 %38, i8* %41
br label %42
42: ; preds = %37
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %28
45: ; preds = %35
%46 = load i32, i32* %2
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 %47
store i8 0, i8* %48
%49 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%50 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%51 = call i32 @altsqueeze(i8* %49, i8* %50)
%52 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %52, i8* %53)
%55 = load i32, i32* %1
ret i32 %55
}

LLVM IR (-O2):
@.str.1 = [33 x i8] c"first word: %s \0Asecond word: %s\0A\00"
@str = [45 x i8] c"Type a word, press return type another word.\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%6 = tail call signext i8 (...) @getchar()
%7 = icmp eq i8 %6, 10
br i1 %7, label %17, label %8
8: ; preds = %0, %8
%9 = phi i64 [ %12, %8 ], [ 0, %0 ]
%10 = phi i8 [ %13, %8 ], [ %6, %0 ]
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %9
store i8 %10, i8* %11
%12 = add nuw nsw i64 %9, 1
%13 = tail call signext i8 (...) @getchar()
%14 = icmp ne i8 %13, 10
%15 = icmp ult i64 %9, 99
%16 = select i1 %14, i1 %15, i1 false
br i1 %16, label %8, label %17
17: ; preds = %8, %0
%18 = phi i64 [ 0, %0 ], [ %12, %8 ]
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %18
store i8 0, i8* %19
%20 = tail call signext i8 (...) @getchar()
%21 = icmp eq i8 %20, 10
br i1 %21, label %31, label %22
22: ; preds = %17, %22
%23 = phi i64 [ %26, %22 ], [ 0, %17 ]
%24 = phi i8 [ %27, %22 ], [ %20, %17 ]
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %23
store i8 %24, i8* %25
%26 = add nuw nsw i64 %23, 1
%27 = tail call signext i8 (...) @getchar()
%28 = icmp ne i8 %27, 10
%29 = icmp ult i64 %23, 99
%30 = select i1 %28, i1 %29, i1 false
br i1 %30, label %22, label %31
31: ; preds = %22, %17
%32 = phi i64 [ 0, %17 ], [ %26, %22 ]
%33 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %32
store i8 0, i8* %33
%34 = call i32 @altsqueeze(i8* %3, i8* %4)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4)
ret i32 0
}