int main(void) {
  char *str, ***a;
  str = malloc(50);
  int n, i, j, c = 0;
  printf("Enter the number of pair : ");
  scanf("%d", &n);
  a = malloc(sizeof(char *) * n);
  for (i = 0; i < n; i++) {
    a[i] = malloc(sizeof(char *) * 2);
    for (j = 0; j < 2; j++)
      a[i][j] = malloc(sizeof(char) * 50);
  }
  printf("Enter the strings : ");
  for (i = 0; i < n; i++) {
    for (j = 0; j < 2; j++)
      scanf(" %s", a[i][j]);
  }
  printf("The Array is : \n");
  for (i = 0; i < n; i++) {
    printf("<");
    for (j = 0; j < 2; j++)
      printf("%-10s ", a[i][j]);
    printf(">\n");
  }
  printf("Enter the string : ");
  scanf("%s", str);
  printf("Grandchildren of %s :  ", str);
  for (i = 0; i < n; i++)
    if (strcmp(a[i][1], str) == 0)
      for (j = 0; j < n; j++)
        if (strcmp(a[j][1], a[i][0]) == 0) {
          printf("%s ", a[j][0]);
          c++;
        }
  printf("\nNumber of grandchildren  :  %d\n", c);
  free(a);
  free(str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x32,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe93(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1070 <scanf@plt>
movslq -0x1c(%rbp),%rdi
shl    $0x3,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1224 <main+0xd4>
mov    $0x10,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1211 <main+0xc1>
mov    $0x32,%edi
call   1060 <malloc@plt>
mov    %rax,%rdx
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d8 <main+0x88>
jmp    1216 <main+0xc6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11ac <main+0x5c>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1299 <main+0x149>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1286 <main+0x136>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    124c <main+0xfc>
jmp    128b <main+0x13b>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1239 <main+0xe9>
lea    0xd98(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1325 <main+0x1d5>
lea    0xd88(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x2,-0x24(%rbp)
jge    1309 <main+0x1b9>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12cf <main+0x17f>
lea    0xd42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12ae <main+0x15e>
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1070 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    141d <main+0x2cd>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    140a <main+0x2ba>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1405 <main+0x2b5>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%eax
jne    13f2 <main+0x2a2>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    (%rax),%rsi
lea    0xc9f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    13f7 <main+0x2a7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1393 <main+0x243>
jmp    140a <main+0x2ba>
jmp    140f <main+0x2bf>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    135e <main+0x20e>
mov    -0x28(%rbp),%esi
lea    0xc5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    $0x32,%edi
call   1080 <malloc@plt>
mov    %rax,0x10(%rsp)
lea    0xe6c(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe7a(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
movslq 0xc(%rsp),%rbx
lea    0x0(,%rbx,8),%rdi
call   1080 <malloc@plt>
mov    %rax,%r12
test   %rbx,%rbx
jle    1206 <main+0x96>
mov    %ebx,%r14d
xor    %ebx,%ebx
nopl   (%rax)
mov    $0x10,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %rax,(%r12,%rbx,8)
mov    $0x32,%edi
call   1080 <malloc@plt>
mov    %rax,0x0(%rbp)
mov    $0x32,%edi
call   1080 <malloc@plt>
mov    %rax,0x8(%rbp)
add    $0x1,%rbx
cmp    %rbx,%r14
jne    11d0 <main+0x60>
lea    0xe12(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    125e <main+0xee>
lea    0xe12(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%r12,%rbx,8),%rbp
mov    0x0(%rbp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
mov    0x8(%rbp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1090 <scanf@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1230 <main+0xc0>
lea    0xe2b(%rip),%rdi
call   1050 <puts@plt>
cmpl   $0x0,0xc(%rsp)
jle    12d0 <main+0x160>
lea    0xdc0(%rip),%r14
lea    0xe21(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3c,%edi
call   1040 <putchar@plt>
mov    (%r12,%rbx,8),%rbp
mov    0x0(%rbp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rbp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1050 <puts@plt>
add    $0x1,%rbx
movslq 0xc(%rsp),%rax
cmp    %rax,%rbx
jl     1290 <main+0x120>
mov    %r12,0x18(%rsp)
lea    0xd63(%rip),%rdi
xor    %r13d,%r13d
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xd48(%rip),%rdi
mov    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <scanf@plt>
lea    0xd50(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0xc(%rsp),%ebx
test   %ebx,%ebx
jle    139e <main+0x22e>
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    1331 <main+0x1c1>
mov    0x20(%rsp),%rbp
add    $0x1,%rbp
movslq %ebx,%rax
cmp    %rax,%rbp
jge    139e <main+0x22e>
mov    0x18(%rsp),%rax
mov    (%rax,%rbp,8),%r14
mov    0x8(%r14),%rdi
mov    0x10(%rsp),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
mov    %rbp,0x20(%rsp)
jne    1320 <main+0x1b0>
test   %ebx,%ebx
jle    1320 <main+0x1b0>
xor    %r15d,%r15d
mov    0x18(%rsp),%rbp
jmp    136c <main+0x1fc>
nop
add    $0x1,%r15
movslq %ebx,%rax
cmp    %rax,%r15
jge    1320 <main+0x1b0>
mov    0x0(%rbp,%r15,8),%r12
mov    0x8(%r12),%rdi
mov    (%r14),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
jne    1360 <main+0x1f0>
mov    (%r12),%rsi
lea    0xcde(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%r13d
mov    0xc(%rsp),%ebx
jmp    1360 <main+0x1f0>
lea    0xcca(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x18(%rsp),%rdi
call   1030 <free@plt>
mov    0x10(%rsp),%rdi
call   1030 <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 = [28 x i8] c"Enter the number of pair : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [21 x i8] c"Enter the strings : \00"
@.str.3 = [4 x i8] c" %s\00"
@.str.4 = [17 x i8] c"The Array is : \0A\00"
@.str.5 = [2 x i8] c"<\00"
@.str.6 = [7 x i8] c"%-10s \00"
@.str.7 = [3 x i8] c">\0A\00"
@.str.8 = [20 x i8] c"Enter the string : \00"
@.str.9 = [3 x i8] c"%s\00"
@.str.10 = [24 x i8] c"Grandchildren of %s : \00"
@.str.11 = [4 x i8] c"%s \00"
@.str.12 = [33 x i8] c"\0ANumber of grandchildren : %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8***
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i8* @malloc(i64 50)
store i8* %8, i8** %2
store i32 0, i32* %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = mul i64 8, %12
%14 = call i8* @malloc(i64 %13)
%15 = bitcast i8* %14 to i8***
store i8*** %15, i8**** %3
store i32 0, i32* %5
br label %16
16: ; preds = %44, %0
%17 = load i32, i32* %5
%18 = load i32, i32* %4
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %47
20: ; preds = %16
%21 = call i8* @malloc(i64 16)
%22 = bitcast i8* %21 to i8**
%23 = load i8***, i8**** %3
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8**, i8*** %23, i64 %25
store i8** %22, i8*** %26
store i32 0, i32* %6
br label %27
27: ; preds = %40, %20
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 2
br i1 %29, label %30, label %43
30: ; preds = %27
%31 = call i8* @malloc(i64 50)
%32 = load i8***, i8**** %3
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8**, i8*** %32, i64 %34
%36 = load i8**, i8*** %35
%37 = load i32, i32* %6
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8*, i8** %36, i64 %38
store i8* %31, i8** %39
br label %40
40: ; preds = %30
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %27
43: ; preds = %27
br label %44
44: ; preds = %43
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %16
47: ; preds = %16
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %5
br label %49
49: ; preds = %72, %47
%50 = load i32, i32* %5
%51 = load i32, i32* %4
%52 = icmp slt i32 %50, %51
br i1 %52, label %53, label %75
53: ; preds = %49
store i32 0, i32* %6
br label %54
54: ; preds = %68, %53
%55 = load i32, i32* %6
%56 = icmp slt i32 %55, 2
br i1 %56, label %57, label %71
57: ; preds = %54
%58 = load i8***, i8**** %3
%59 = load i32, i32* %5
%60 = sext i32 %59 to i64
%61 = getelementptr inbounds i8**, i8*** %58, i64 %60
%62 = load i8**, i8*** %61
%63 = load i32, i32* %6
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds i8*, i8** %62, i64 %64
%66 = load i8*, i8** %65
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %66)
br label %68
68: ; preds = %57
%69 = load i32, i32* %6
%70 = add nsw i32 %69, 1
store i32 %70, i32* %6
br label %54
71: ; preds = %54
br label %72
72: ; preds = %71
%73 = load i32, i32* %5
%74 = add nsw i32 %73, 1
store i32 %74, i32* %5
br label %49
75: ; preds = %49
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %5
br label %77
77: ; preds = %102, %75
%78 = load i32, i32* %5
%79 = load i32, i32* %4
%80 = icmp slt i32 %78, %79
br i1 %80, label %81, label %105
81: ; preds = %77
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %6
br label %83
83: ; preds = %97, %81
%84 = load i32, i32* %6
%85 = icmp slt i32 %84, 2
br i1 %85, label %86, label %100
86: ; preds = %83
%87 = load i8***, i8**** %3
%88 = load i32, i32* %5
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8**, i8*** %87, i64 %89
%91 = load i8**, i8*** %90
%92 = load i32, i32* %6
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds i8*, i8** %91, i64 %93
%95 = load i8*, i8** %94
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %95)
br label %97
97: ; preds = %86
%98 = load i32, i32* %6
%99 = add nsw i32 %98, 1
store i32 %99, i32* %6
br label %83
100: ; preds = %83
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
br label %102
102: ; preds = %100
%103 = load i32, i32* %5
%104 = add nsw i32 %103, 1
store i32 %104, i32* %5
br label %77
105: ; preds = %77
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0))
%107 = load i8*, i8** %2
%108 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i8* %107)
%109 = load i8*, i8** %2
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0), i8* %109)
store i32 0, i32* %5
br label %111
111: ; preds = %165, %105
%112 = load i32, i32* %5
%113 = load i32, i32* %4
%114 = icmp slt i32 %112, %113
br i1 %114, label %115, label %168
115: ; preds = %111
%116 = load i8***, i8**** %3
%117 = load i32, i32* %5
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds i8**, i8*** %116, i64 %118
%120 = load i8**, i8*** %119
%121 = getelementptr inbounds i8*, i8** %120, i64 1
%122 = load i8*, i8** %121
%123 = load i8*, i8** %2
%124 = call i32 @strcmp(i8* %122, i8* %123)
%125 = icmp eq i32 %124, 0
br i1 %125, label %126, label %164
126: ; preds = %115
store i32 0, i32* %6
br label %127
127: ; preds = %160, %126
%128 = load i32, i32* %6
%129 = load i32, i32* %4
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %163
131: ; preds = %127
%132 = load i8***, i8**** %3
%133 = load i32, i32* %6
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds i8**, i8*** %132, i64 %134
%136 = load i8**, i8*** %135
%137 = getelementptr inbounds i8*, i8** %136, i64 1
%138 = load i8*, i8** %137
%139 = load i8***, i8**** %3
%140 = load i32, i32* %5
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds i8**, i8*** %139, i64 %141
%143 = load i8**, i8*** %142
%144 = getelementptr inbounds i8*, i8** %143, i64 0
%145 = load i8*, i8** %144
%146 = call i32 @strcmp(i8* %138, i8* %145)
%147 = icmp eq i32 %146, 0
br i1 %147, label %148, label %159
148: ; preds = %131
%149 = load i8***, i8**** %3
%150 = load i32, i32* %6
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds i8**, i8*** %149, i64 %151
%153 = load i8**, i8*** %152
%154 = getelementptr inbounds i8*, i8** %153, i64 0
%155 = load i8*, i8** %154
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i8* %155)
%157 = load i32, i32* %7
%158 = add nsw i32 %157, 1
store i32 %158, i32* %7
br label %159
159: ; preds = %148, %131
br label %160
160: ; preds = %159
%161 = load i32, i32* %6
%162 = add nsw i32 %161, 1
store i32 %162, i32* %6
br label %127
163: ; preds = %127
br label %164
164: ; preds = %163, %115
br label %165
165: ; preds = %164
%166 = load i32, i32* %5
%167 = add nsw i32 %166, 1
store i32 %167, i32* %5
br label %111
168: ; preds = %111
%169 = load i32, i32* %7
%170 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0), i32 %169)
%171 = load i8***, i8**** %3
%172 = bitcast i8*** %171 to i8*
%173 = load i8*, i8** %2
ret i32 0
}

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