#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, char *);
scalar_t__ scanf(char *, char *);
int main(int argc, char **argv) {
  char preorder[26], inorder[26], postorder[26];
  while (scanf("%s", postorder) != EOF && scanf("%s", inorder)) {
    printf("%s\n", postorder);
    printf("%s\n", inorder);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e93(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x71(%rbp)
je     117b <main+0x5b>
lea    -0x50(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1040 <scanf@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    118b <main+0x6b>
jmp    11b0 <main+0x90>
lea    -0x70(%rbp),%rsi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
jmp    1139 <main+0x19>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x40,%rsp
lea    0xecc(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    0x2ea5(%rip),%r13
cmp    0x0(%r13),%rax
je     1197 <main+0x77>
lea    0xeb0(%rip),%r14
lea    0x20(%rsp),%r12
lea    0xea7(%rip),%r15
mov    %rsp,%rbx
nop
mov    %r14,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
test   %rax,%rax
je     1197 <main+0x77>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [26 x i8]
%4 = alloca [26 x i8]
%5 = getelementptr inbounds [26 x i8], [26 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [26 x i8], [26 x i8]* %4, i64 0, i64 0
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %19, label %10
10: ; preds = %2, %13
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%12 = icmp eq i64 %11, 0
br i1 %12, label %19, label %13
13: ; preds = %10
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%15 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %10
19: ; preds = %10, %13, %2
ret i32 0
}