#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 */
typedef int /*<<< orphan*/ b;
typedef int /*<<< orphan*/ a;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
scalar_t__ strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int main() {
  const int n;
  const int m;
  scanf("%d %d\n", &n, &m);
  char a[m][11];
  char b[m][11];
  char c[n][11];
  char answer[n * 3][11];
  int last_position = 0;
  for (int i = 0; i < m; i++) {
    scanf("%10s %10s\n", a[i], b[i]);
  }
  for (int i = 0; i < n; i++)
    scanf("%s", c[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (!strcmp(a[j], c[i])) {
        if (strlen(a[j]) < strlen(b[j]) || strlen(a[j]) == strlen(b[j])) {
          strncpy(answer[last_position], a[j], sizeof(a[j]));
          last_position++;
        } else if (strlen(b[j]) < strlen(a[j])) {
          strncpy(answer[last_position], b[j], sizeof(b[j]));
          last_position++;
        }
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (i != n - 1)
      printf("%s ", answer[i]);
    else
      printf("%s\n", answer[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
xor    %eax,%eax
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1070 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    (%rax,%rax,4),%rcx
lea    0xf(%rax,%rcx,2),%rsi
movabs $0x1ffffffff0,%rcx
and    %rcx,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x70(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
lea    (%rax,%rax,4),%rdx
lea    0xf(%rax,%rdx,2),%rsi
and    %rcx,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x68(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%eax
lea    (%rax,%rax,4),%rdx
lea    0xf(%rax,%rdx,2),%rsi
and    %rcx,%rsi
mov    %rsp,%rdx
sub    %rsi,%rdx
mov    %rdx,-0x60(%rbp)
mov    %rdx,%rsp
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%edx
mov    %edx,%eax
lea    (%rax,%rax,2),%eax
lea    (%rax,%rax,4),%rdx
lea    0xf(%rax,%rdx,2),%rdx
and    %rcx,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x58(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1262 <main+0x112>
mov    -0x68(%rbp),%rdx
mov    -0x70(%rbp),%rsi
movslq -0x40(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
movslq -0x40(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdx
lea    0xdba(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    121c <main+0xcc>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12a0 <main+0x150>
mov    -0x60(%rbp),%rsi
movslq -0x44(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
lea    0xd87(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1269 <main+0x119>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1443 <main+0x2f3>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1430 <main+0x2e0>
mov    -0x60(%rbp),%rsi
mov    -0x70(%rbp),%rdi
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
movslq -0x48(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    141d <main+0x2cd>
mov    -0x70(%rbp),%rdi
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    -0x68(%rbp),%rdi
mov    %rax,-0x78(%rbp)
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x78(%rbp),%rax
cmp    %rcx,%rax
jl     136a <main+0x21a>
mov    -0x70(%rbp),%rdi
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    -0x68(%rbp),%rdi
mov    %rax,-0x80(%rbp)
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
cmp    %rcx,%rax
jne    13a0 <main+0x250>
mov    -0x70(%rbp),%rsi
mov    -0x58(%rbp),%rdi
movslq -0x3c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
mov    $0xb,%edx
call   1030 <strncpy@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1418 <main+0x2c8>
mov    -0x68(%rbp),%rdi
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    -0x70(%rbp),%rdi
mov    %rax,-0x88(%rbp)
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
mov    %rax,%rcx
mov    -0x88(%rbp),%rax
cmp    %rcx,%rax
jge    1413 <main+0x2c3>
mov    -0x68(%rbp),%rsi
mov    -0x58(%rbp),%rdi
movslq -0x3c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rdi
movslq -0x4c(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
mov    $0xb,%edx
call   1030 <strncpy@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1418 <main+0x2c8>
jmp    141d <main+0x2cd>
jmp    1422 <main+0x2d2>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    12ba <main+0x16a>
jmp    1435 <main+0x2e5>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12a7 <main+0x157>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    14b5 <main+0x365>
mov    -0x50(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     1487 <main+0x337>
mov    -0x58(%rbp),%rsi
movslq -0x50(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
lea    0xb98(%rip),%rdi
call   1050 <printf@plt>
jmp    14a2 <main+0x352>
mov    -0x58(%rbp),%rsi
movslq -0x50(%rbp),%rax
imul   $0xb,%rax,%rax
add    %rax,%rsi
lea    0xb7c(%rip),%rdi
call   1050 <printf@plt>
jmp    14a7 <main+0x357>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    144a <main+0x2fa>
movl   $0x0,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
lea    0xe98(%rip),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
mov    %rsp,-0x60(%rbp)
mov    -0x2c(%rbp),%eax
lea    (%rax,%rax,4),%rcx
lea    (%rax,%rcx,2),%rcx
add    $0xf,%rcx
movabs $0x1ffffffff0,%rax
and    %rax,%rcx
mov    %rsp,%rdx
sub    %rcx,%rdx
mov    %rdx,-0x50(%rbp)
mov    %rdx,%rsp
mov    -0x2c(%rbp),%ecx
lea    (%rcx,%rcx,4),%rdx
lea    (%rcx,%rdx,2),%rdx
add    $0xf,%rdx
and    %rax,%rdx
mov    %rsp,%rsi
sub    %rdx,%rsi
mov    %rsi,-0x48(%rbp)
mov    %rsi,%rsp
mov    -0x30(%rbp),%edx
lea    (%rdx,%rdx,4),%rsi
lea    (%rdx,%rsi,2),%rsi
add    $0xf,%rsi
and    %rax,%rsi
mov    %rsp,%rdi
sub    %rsi,%rdi
mov    %rdi,-0x40(%rbp)
mov    %rdi,%rsp
lea    (%rdx,%rdx,2),%esi
lea    (%rsi,%rsi,4),%rdi
lea    (%rsi,%rdi,2),%rsi
add    $0xf,%rsi
and    %rax,%rsi
mov    %rsp,%rax
sub    %rsi,%rax
mov    %rax,-0x38(%rbp)
mov    %rax,%rsp
test   %ecx,%ecx
jle    1248 <main+0xf8>
lea    0xdfb(%rip),%r15
mov    -0x48(%rbp),%r12
mov    -0x50(%rbp),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1070 <scanf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
add    $0xb,%r14
add    $0xb,%r12
cmp    %rax,%rbx
jl     1220 <main+0xd0>
mov    -0x30(%rbp),%edx
test   %edx,%edx
jle    13a1 <main+0x251>
lea    0xdbb(%rip),%r15
mov    -0x40(%rbp),%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
add    $0x1,%rbx
movslq -0x30(%rbp),%rax
add    $0xb,%r14
cmp    %rax,%rbx
jl     1260 <main+0x110>
test   %eax,%eax
jle    13a1 <main+0x251>
xor    %esi,%esi
mov    -0x2c(%rbp),%ecx
xor    %edx,%edx
mov    %rdx,-0x58(%rbp)
jmp    12b7 <main+0x167>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x30(%rbp),%eax
mov    -0x68(%rbp),%rsi
add    $0x1,%rsi
movslq %eax,%rdx
cmp    %rdx,%rsi
jge    134c <main+0x1fc>
test   %ecx,%ecx
jle    12a7 <main+0x157>
lea    (%rsi,%rsi,4),%rax
mov    %rsi,-0x68(%rbp)
lea    (%rsi,%rax,2),%r13
add    -0x40(%rbp),%r13
mov    -0x48(%rbp),%r12
mov    -0x50(%rbp),%rbx
xor    %r15d,%r15d
mov    %r13,-0x70(%rbp)
jmp    12f5 <main+0x1a5>
nopl   0x0(%rax)
add    $0x1,%r15
movslq -0x2c(%rbp),%rcx
add    $0xb,%rbx
add    $0xb,%r12
cmp    %rcx,%r15
jge    12a0 <main+0x150>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1060 <strcmp@plt>
test   %eax,%eax
jne    12e0 <main+0x190>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rax,%r13
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    -0x58(%rbp),%r14
movslq %r14d,%r14
lea    (%r14,%r14,4),%rcx
lea    (%r14,%rcx,2),%rdi
add    -0x38(%rbp),%rdi
cmp    %rax,%r13
mov    -0x70(%rbp),%r13
mov    %rbx,%rsi
cmovg  %r12,%rsi
mov    $0xb,%edx
call   1030 <strncpy@plt>
add    $0x1,%r14d
mov    %r14,-0x58(%rbp)
jmp    12e0 <main+0x190>
test   %eax,%eax
jle    13a1 <main+0x251>
xor    %r12d,%r12d
lea    0xcbf(%rip),%r14
lea    0xcb4(%rip),%r15
jmp    1391 <main+0x241>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    -0x38(%rbp),%rbx
mov    %rbx,%rsi
call   1050 <printf@plt>
add    $0x1,%r12
movslq -0x30(%rbp),%rax
add    $0xb,%rbx
mov    %rbx,-0x38(%rbp)
cmp    %rax,%r12
jge    13a1 <main+0x251>
add    $0xffffffff,%eax
mov    %r14,%rdi
cmp    %rax,%r12
je     1370 <main+0x220>
mov    %r15,%rdi
jmp    1370 <main+0x220>
mov    -0x60(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [11 x i8] c"%10s %10s\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%s \00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 0, i32* %1
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%16 = load i32, i32* %3
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %4
%19 = alloca [11 x i8], i64 %17
store i64 %17, i64* %5
%20 = load i32, i32* %3
%21 = zext i32 %20 to i64
%22 = alloca [11 x i8], i64 %21
store i64 %21, i64* %6
%23 = load i32, i32* %2
%24 = zext i32 %23 to i64
%25 = alloca [11 x i8], i64 %24
store i64 %24, i64* %7
%26 = load i32, i32* %2
%27 = mul nsw i32 %26, 3
%28 = zext i32 %27 to i64
%29 = alloca [11 x i8], i64 %28
store i64 %28, i64* %8
store i32 0, i32* %9
store i32 0, i32* %10
br label %30
30: ; preds = %44, %0
%31 = load i32, i32* %10
%32 = load i32, i32* %3
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %47
34: ; preds = %30
%35 = load i32, i32* %10
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 %36
%38 = getelementptr inbounds [11 x i8], [11 x i8]* %37, i64 0, i64 0
%39 = load i32, i32* %10
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [11 x i8], [11 x i8]* %22, i64 %40
%42 = getelementptr inbounds [11 x i8], [11 x i8]* %41, i64 0, i64 0
%43 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %38, i8* %42)
br label %44
44: ; preds = %34
%45 = load i32, i32* %10
%46 = add nsw i32 %45, 1
store i32 %46, i32* %10
br label %30
47: ; preds = %30
store i32 0, i32* %11
br label %48
48: ; preds = %58, %47
%49 = load i32, i32* %11
%50 = load i32, i32* %2
%51 = icmp slt i32 %49, %50
br i1 %51, label %52, label %61
52: ; preds = %48
%53 = load i32, i32* %11
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [11 x i8], [11 x i8]* %25, i64 %54
%56 = getelementptr inbounds [11 x i8], [11 x i8]* %55, i64 0, i64 0
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %56)
br label %58
58: ; preds = %52
%59 = load i32, i32* %11
%60 = add nsw i32 %59, 1
store i32 %60, i32* %11
br label %48
61: ; preds = %48
store i32 0, i32* %12
br label %62
62: ; preds = %149, %61
%63 = load i32, i32* %12
%64 = load i32, i32* %2
%65 = icmp slt i32 %63, %64
br i1 %65, label %66, label %152
66: ; preds = %62
store i32 0, i32* %13
br label %67
67: ; preds = %145, %66
%68 = load i32, i32* %13
%69 = load i32, i32* %3
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %148
71: ; preds = %67
%72 = load i32, i32* %13
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 %73
%75 = getelementptr inbounds [11 x i8], [11 x i8]* %74, i64 0, i64 0
%76 = load i32, i32* %12
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [11 x i8], [11 x i8]* %25, i64 %77
%79 = getelementptr inbounds [11 x i8], [11 x i8]* %78, i64 0, i64 0
%80 = call i32 @strcmp(i8* %75, i8* %79)
%81 = icmp ne i32 %80, 0
br i1 %81, label %144, label %82
82: ; preds = %71
%83 = load i32, i32* %13
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 %84
%86 = getelementptr inbounds [11 x i8], [11 x i8]* %85, i64 0, i64 0
%87 = call i64 @strlen(i8* %86)
%88 = load i32, i32* %13
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [11 x i8], [11 x i8]* %22, i64 %89
%91 = getelementptr inbounds [11 x i8], [11 x i8]* %90, i64 0, i64 0
%92 = call i64 @strlen(i8* %91)
%93 = icmp slt i64 %87, %92
br i1 %93, label %106, label %94
94: ; preds = %82
%95 = load i32, i32* %13
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 %96
%98 = getelementptr inbounds [11 x i8], [11 x i8]* %97, i64 0, i64 0
%99 = call i64 @strlen(i8* %98)
%100 = load i32, i32* %13
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [11 x i8], [11 x i8]* %22, i64 %101
%103 = getelementptr inbounds [11 x i8], [11 x i8]* %102, i64 0, i64 0
%104 = call i64 @strlen(i8* %103)
%105 = icmp eq i64 %99, %104
br i1 %105, label %106, label %118
106: ; preds = %94, %82
%107 = load i32, i32* %9
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds [11 x i8], [11 x i8]* %29, i64 %108
%110 = getelementptr inbounds [11 x i8], [11 x i8]* %109, i64 0, i64 0
%111 = load i32, i32* %13
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 %112
%114 = getelementptr inbounds [11 x i8], [11 x i8]* %113, i64 0, i64 0
%115 = call i32 @strncpy(i8* %110, i8* %114, i32 11)
%116 = load i32, i32* %9
%117 = add nsw i32 %116, 1
store i32 %117, i32* %9
br label %143
118: ; preds = %94
%119 = load i32, i32* %13
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [11 x i8], [11 x i8]* %22, i64 %120
%122 = getelementptr inbounds [11 x i8], [11 x i8]* %121, i64 0, i64 0
%123 = call i64 @strlen(i8* %122)
%124 = load i32, i32* %13
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [11 x i8], [11 x i8]* %19, i64 %125
%127 = getelementptr inbounds [11 x i8], [11 x i8]* %126, i64 0, i64 0
%128 = call i64 @strlen(i8* %127)
%129 = icmp slt i64 %123, %128
br i1 %129, label %130, label %142
130: ; preds = %118
%131 = load i32, i32* %9
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [11 x i8], [11 x i8]* %29, i64 %132
%134 = getelementptr inbounds [11 x i8], [11 x i8]* %133, i64 0, i64 0
%135 = load i32, i32* %13
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [11 x i8], [11 x i8]* %22, i64 %136
%138 = getelementptr inbounds [11 x i8], [11 x i8]* %137, i64 0, i64 0
%139 = call i32 @strncpy(i8* %134, i8* %138, i32 11)
%140 = load i32, i32* %9
%141 = add nsw i32 %140, 1
store i32 %141, i32* %9
br label %142
142: ; preds = %130, %118
br label %143
143: ; preds = %142, %106
br label %144
144: ; preds = %143, %71
br label %145
145: ; preds = %144
%146 = load i32, i32* %13
%147 = add nsw i32 %146, 1
store i32 %147, i32* %13
br label %67
148: ; preds = %67
br label %149
149: ; preds = %148
%150 = load i32, i32* %12
%151 = add nsw i32 %150, 1
store i32 %151, i32* %12
br label %62
152: ; preds = %62
store i32 0, i32* %14
br label %153
153: ; preds = %175, %152
%154 = load i32, i32* %14
%155 = load i32, i32* %2
%156 = icmp slt i32 %154, %155
br i1 %156, label %157, label %178
157: ; preds = %153
%158 = load i32, i32* %14
%159 = load i32, i32* %2
%160 = sub nsw i32 %159, 1
%161 = icmp ne i32 %158, %160
br i1 %161, label %162, label %168
162: ; preds = %157
%163 = load i32, i32* %14
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds [11 x i8], [11 x i8]* %29, i64 %164
%166 = getelementptr inbounds [11 x i8], [11 x i8]* %165, i64 0, i64 0
%167 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %166)
br label %174
168: ; preds = %157
%169 = load i32, i32* %14
%170 = sext i32 %169 to i64
%171 = getelementptr inbounds [11 x i8], [11 x i8]* %29, i64 %170
%172 = getelementptr inbounds [11 x i8], [11 x i8]* %171, i64 0, i64 0
%173 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %172)
br label %174
174: ; preds = %168, %162
br label %175
175: ; preds = %174
%176 = load i32, i32* %14
%177 = add nsw i32 %176, 1
store i32 %177, i32* %14
br label %153
178: ; preds = %153
store i32 0, i32* %1
%179 = load i8*, i8** %4
%180 = load i32, i32* %1
ret i32 %180
}

LLVM IR (-O2):
@.str = [7 x i8] c"%d %d\0A\00"
@.str.1 = [11 x i8] c"%10s %10s\0A\00"
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [4 x i8] c"%s \00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = call i8* @llvm.stacksave()
%9 = alloca [11 x i8], i64 %7
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
%12 = alloca [11 x i8], i64 %11
%13 = load i32, i32* %1
%14 = zext i32 %13 to i64
%15 = alloca [11 x i8], i64 %14
%16 = mul nsw i32 %13, 3
%17 = zext i32 %16 to i64
%18 = alloca [11 x i8], i64 %17
%19 = icmp sgt i32 %10, 0
br i1 %19, label %25, label %22
20: ; preds = %25
%21 = load i32, i32* %1
br label %22
22: ; preds = %20, %0
%23 = phi i32 [ %21, %20 ], [ %13, %0 ]
%24 = icmp sgt i32 %23, 0
br i1 %24, label %38, label %87
25: ; preds = %0, %25
%26 = phi i64 [ %30, %25 ], [ 0, %0 ]
%27 = getelementptr inbounds [11 x i8], [11 x i8]* %9, i64 %26, i64 0
%28 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 %26, i64 0
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* %28)
%30 = add nuw nsw i64 %26, 1
%31 = load i32, i32* %2
%32 = sext i32 %31 to i64
%33 = icmp slt i64 %30, %32
br i1 %33, label %25, label %20
34: ; preds = %38
%35 = icmp sgt i32 %43, 0
br i1 %35, label %36, label %87
36: ; preds = %34
%37 = load i32, i32* %2
br label %46
38: ; preds = %22, %38
%39 = phi i64 [ %42, %38 ], [ 0, %22 ]
%40 = getelementptr inbounds [11 x i8], [11 x i8]* %15, i64 %39, i64 0
%41 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %40)
%42 = add nuw nsw i64 %39, 1
%43 = load i32, i32* %1
%44 = sext i32 %43 to i64
%45 = icmp slt i64 %42, %44
br i1 %45, label %38, label %34
46: ; preds = %36, %58
%47 = phi i32 [ %43, %36 ], [ %59, %58 ]
%48 = phi i32 [ %37, %36 ], [ %60, %58 ]
%49 = phi i64 [ 0, %36 ], [ %62, %58 ]
%50 = phi i32 [ 0, %36 ], [ %61, %58 ]
%51 = icmp sgt i32 %48, 0
br i1 %51, label %52, label %58
52: ; preds = %46
%53 = getelementptr inbounds [11 x i8], [11 x i8]* %15, i64 %49, i64 0
br label %65
54: ; preds = %58
%55 = icmp sgt i32 %59, 0
br i1 %55, label %88, label %87
56: ; preds = %81
%57 = load i32, i32* %1
br label %58
58: ; preds = %56, %46
%59 = phi i32 [ %47, %46 ], [ %57, %56 ]
%60 = phi i32 [ %48, %46 ], [ %84, %56 ]
%61 = phi i32 [ %50, %46 ], [ %82, %56 ]
%62 = add nuw nsw i64 %49, 1
%63 = sext i32 %59 to i64
%64 = icmp slt i64 %62, %63
br i1 %64, label %46, label %54
65: ; preds = %52, %81
%66 = phi i64 [ 0, %52 ], [ %83, %81 ]
%67 = phi i32 [ %50, %52 ], [ %82, %81 ]
%68 = getelementptr inbounds [11 x i8], [11 x i8]* %9, i64 %66, i64 0
%69 = call i32 @strcmp(i8* %68, i8* %53)
%70 = icmp eq i32 %69, 0
br i1 %70, label %71, label %81
71: ; preds = %65
%72 = call i64 @strlen(i8* %68)
%73 = getelementptr inbounds [11 x i8], [11 x i8]* %12, i64 %66, i64 0
%74 = call i64 @strlen(i8* %73)
%75 = icmp sgt i64 %72, %74
%76 = sext i32 %67 to i64
%77 = getelementptr inbounds [11 x i8], [11 x i8]* %18, i64 %76, i64 0
%78 = select i1 %75, i8* %73, i8* %68
%79 = call i32 @strncpy(i8* %77, i8* %78, i32 11)
%80 = add nsw i32 %67, 1
br label %81
81: ; preds = %71, %65
%82 = phi i32 [ %67, %65 ], [ %80, %71 ]
%83 = add nuw nsw i64 %66, 1
%84 = load i32, i32* %2
%85 = sext i32 %84 to i64
%86 = icmp slt i64 %83, %85
br i1 %86, label %65, label %56
87: ; preds = %88, %22, %34, %54
ret i32 0
88: ; preds = %54, %88
%89 = phi i64 [ %97, %88 ], [ 0, %54 ]
%90 = phi i32 [ %98, %88 ], [ %59, %54 ]
%91 = add nsw i32 %90, -1
%92 = zext i32 %91 to i64
%93 = icmp eq i64 %89, %92
%94 = getelementptr inbounds [11 x i8], [11 x i8]* %18, i64 %89, i64 0
%95 = select i1 %93, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%96 = call i32 @printf(i8* %95, i8* %94)
%97 = add nuw nsw i64 %89, 1
%98 = load i32, i32* %1
%99 = sext i32 %98 to i64
%100 = icmp slt i64 %97, %99
br i1 %100, label %88, label %87
}