#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*/ getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int main(void) {
  char acNames[20][30], cTemp[30], cKeyName[30];
  int iNum, i, j, iPos, iLow, iHigh, iMid, iFound;
  printf("\nEnter no of names\n");
  scanf("%d", &iNum);
  getchar();
  printf("\nEnter %d names\n", iNum);
  for (i = 0; i < iNum; i++)
    gets(acNames[i]);
  for (i = 0; i < iNum; i++) {
    for (j = i + 1; j < iNum; j++) {
      if (strcmp(acNames[i], acNames[j]) > 0) {
        strcpy(cTemp, acNames[i]);
        strcpy(acNames[i], acNames[j]);
        strcpy(acNames[j], cTemp);
      }
    }
  }
  printf("\nThe names in sorted form \n");
  for (i = 0; i < iNum; i++)
    printf("%s\n", acNames[i]);
  printf("\n");
  printf("\nEnter the name you want to search\n");
  gets(cKeyName);
  iFound = 0;
  iLow = 0;
  iHigh = iNum - 1;
  while (iLow <= iHigh) {
    iMid = (iLow + iHigh) / 2;
    if (strcmp(cKeyName, acNames[iMid]) == 0) {
      iPos = iMid;
      iFound = 1;
      break;
    } else if (strcmp(cKeyName, acNames[iMid]) < 0)
      iHigh = iMid - 1;
    else
      iLow = iMid + 1;
  }
  if (iFound)
    printf("\nKey name %s found at position %d\n", cKeyName, iPos + 1);
  else
    printf("\nKey element not found\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
lea    -0x2a4(%rbp),%rsi
call   1080 <scanf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x2a4(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2a8(%rbp)
mov    -0x2a8(%rbp),%eax
cmp    -0x2a4(%rbp),%eax
jge    11f8 <main+0x98>
movslq -0x2a8(%rbp),%rax
lea    -0x260(%rbp),%rdi
imul   $0x1e,%rax,%rax
add    %rax,%rdi
call   1070 <gets@plt>
mov    -0x2a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a8(%rbp)
jmp    11b8 <main+0x58>
movl   $0x0,-0x2a8(%rbp)
mov    -0x2a8(%rbp),%eax
cmp    -0x2a4(%rbp),%eax
jge    1311 <main+0x1b1>
mov    -0x2a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ac(%rbp)
mov    -0x2ac(%rbp),%eax
cmp    -0x2a4(%rbp),%eax
jge    12f8 <main+0x198>
movslq -0x2a8(%rbp),%rax
lea    -0x260(%rbp),%rdi
imul   $0x1e,%rax,%rax
add    %rax,%rdi
movslq -0x2ac(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jle    12df <main+0x17f>
lea    -0x280(%rbp),%rdi
movslq -0x2a8(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0x2a8(%rbp),%rax
lea    -0x260(%rbp),%rdi
imul   $0x1e,%rax,%rax
add    %rax,%rdi
movslq -0x2ac(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
movslq -0x2ac(%rbp),%rax
lea    -0x260(%rbp),%rdi
imul   $0x1e,%rax,%rax
add    %rax,%rdi
lea    -0x280(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    12e4 <main+0x184>
mov    -0x2ac(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2ac(%rbp)
jmp    1223 <main+0xc3>
jmp    12fd <main+0x19d>
mov    -0x2a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a8(%rbp)
jmp    1202 <main+0xa2>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2a8(%rbp)
mov    -0x2a8(%rbp),%eax
cmp    -0x2a4(%rbp),%eax
jge    1372 <main+0x212>
movslq -0x2a8(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x2a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2a8(%rbp)
jmp    1329 <main+0x1c9>
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x2a0(%rbp),%rdi
call   1070 <gets@plt>
movl   $0x0,-0x2c0(%rbp)
movl   $0x0,-0x2b4(%rbp)
mov    -0x2a4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2b8(%rbp)
mov    -0x2b4(%rbp),%eax
cmp    -0x2b8(%rbp),%eax
jg     1487 <main+0x327>
mov    -0x2b4(%rbp),%eax
add    -0x2b8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x2bc(%rbp)
lea    -0x2a0(%rbp),%rdi
movslq -0x2bc(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    142f <main+0x2cf>
mov    -0x2bc(%rbp),%eax
mov    %eax,-0x2b0(%rbp)
movl   $0x1,-0x2c0(%rbp)
jmp    1487 <main+0x327>
lea    -0x2a0(%rbp),%rdi
movslq -0x2bc(%rbp),%rax
lea    -0x260(%rbp),%rsi
imul   $0x1e,%rax,%rax
add    %rax,%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jge    146e <main+0x30e>
mov    -0x2bc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x2b8(%rbp)
jmp    147d <main+0x31d>
mov    -0x2bc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    1482 <main+0x322>
jmp    13bd <main+0x25d>
cmpl   $0x0,-0x2c0(%rbp)
je     14b7 <main+0x357>
lea    -0x2a0(%rbp),%rsi
mov    -0x2b0(%rbp),%edx
add    $0x1,%edx
lea    0xbc1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14c5 <main+0x365>
lea    0xbd1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2a8,%rsp
lea    0xe9f(%rip),%rdi
call   1050 <puts@plt>
lea    0xe5c(%rip),%rdi
lea    0x4(%rsp),%rsi
call   10a0 <scanf@plt>
xor    %eax,%eax
call   1080 <getchar@plt>
mov    0x4(%rsp),%esi
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    12b4 <main+0x134>
lea    0x50(%rsp),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1090 <gets@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
add    $0x1e,%rbx
cmp    %rax,%rbp
jl     11e0 <main+0x60>
test   %eax,%eax
jle    12b4 <main+0x134>
lea    0x6e(%rsp),%r15
mov    $0x1,%r13d
xor    %esi,%esi
lea    0x30(%rsp),%r14
jmp    1235 <main+0xb5>
cs nopw 0x0(%rax,%rax,1)
movslq %eax,%rdx
mov    0x8(%rsp),%rsi
add    $0x1e,%r15
add    $0x1,%r13d
cmp    %rdx,%rsi
jge    12b4 <main+0x134>
mov    %rsi,%rcx
add    $0x1,%rsi
movslq %eax,%rdx
cmp    %rdx,%rsi
jge    1228 <main+0xa8>
mov    %rsi,0x8(%rsp)
mov    %rcx,%rax
shl    $0x5,%rax
sub    %rcx,%rax
sub    %rcx,%rax
lea    (%rsp,%rax,1),%rbp
add    $0x50,%rbp
mov    %r13d,%r12d
mov    %r15,%rbx
jmp    1281 <main+0x101>
cs nopw 0x0(%rax,%rax,1)
mov    0x4(%rsp),%eax
add    $0x1e,%rbx
add    $0x1,%r12d
cmp    %r12d,%eax
jle    1220 <main+0xa0>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jle    1270 <main+0xf0>
mov    %r14,%rdi
mov    %rbp,%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcpy@plt>
jmp    1270 <main+0xf0>
lea    0xd8f(%rip),%rdi
call   1050 <puts@plt>
cmpl   $0x0,0x4(%rsp)
jle    12ea <main+0x16a>
lea    0x50(%rsp),%rbx
xor    %ebp,%ebp
xchg   %ax,%ax
mov    %rbx,%rdi
call   1050 <puts@plt>
add    $0x1,%rbp
movslq 0x4(%rsp),%rax
add    $0x1e,%rbx
cmp    %rax,%rbp
jl     12d0 <main+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd6a(%rip),%rdi
call   1050 <puts@plt>
lea    0x10(%rsp),%rdi
call   1090 <gets@plt>
mov    0x4(%rsp),%r15d
test   %r15d,%r15d
jle    138b <main+0x20b>
add    $0xffffffff,%r15d
xor    %r12d,%r12d
lea    0x10(%rsp),%r14
jmp    133b <main+0x1bb>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%ebp
mov    %ebp,%r12d
cmp    %r15d,%r12d
jg     138b <main+0x20b>
lea    (%r15,%r12,1),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
movslq %ebp,%rax
mov    %rax,%rcx
shl    $0x5,%rcx
sub    %rax,%rcx
sub    %rax,%rcx
lea    (%rsp,%rcx,1),%rbx
add    $0x50,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1399 <main+0x219>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
jns    1330 <main+0x1b0>
add    $0xffffffff,%ebp
mov    %ebp,%r15d
cmp    %r15d,%r12d
jle    133b <main+0x1bb>
lea    0xcf6(%rip),%rdi
call   1050 <puts@plt>
jmp    13b1 <main+0x231>
add    $0x1,%ebp
lea    0xc71(%rip),%rdi
lea    0x10(%rsp),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x2a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"\0AEnter no of names\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [17 x i8] c"\0AEnter %d names\0A\00"
@.str.3 = [28 x i8] c"\0AThe names in sorted form \0A\00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [2 x i8] c"\0A\00"
@.str.6 = [36 x i8] c"\0AEnter the name you want to search\0A\00"
@.str.7 = [35 x i8] c"\0AKey name %s found at position %d\0A\00"
@.str.8 = [24 x i8] c"\0AKey element not found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [30 x i8]]
%3 = alloca [30 x i8]
%4 = alloca [30 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%15 = call i32 (...) @getchar()
%16 = load i32, i32* %5
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i32 %16)
store i32 0, i32* %6
br label %18
18: ; preds = %28, %0
%19 = load i32, i32* %6
%20 = load i32, i32* %5
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %31
22: ; preds = %18
%23 = load i32, i32* %6
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %24
%26 = getelementptr inbounds [30 x i8], [30 x i8]* %25, i64 0, i64 0
%27 = call i32 @gets(i8* %26)
br label %28
28: ; preds = %22
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %18
31: ; preds = %18
store i32 0, i32* %6
br label %32
32: ; preds = %81, %31
%33 = load i32, i32* %6
%34 = load i32, i32* %5
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %84
36: ; preds = %32
%37 = load i32, i32* %6
%38 = add nsw i32 %37, 1
store i32 %38, i32* %7
br label %39
39: ; preds = %77, %36
%40 = load i32, i32* %7
%41 = load i32, i32* %5
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %80
43: ; preds = %39
%44 = load i32, i32* %6
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %45
%47 = getelementptr inbounds [30 x i8], [30 x i8]* %46, i64 0, i64 0
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %49
%51 = getelementptr inbounds [30 x i8], [30 x i8]* %50, i64 0, i64 0
%52 = call i64 @strcmp(i8* %47, i8* %51)
%53 = icmp sgt i64 %52, 0
br i1 %53, label %54, label %76
54: ; preds = %43
%55 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%56 = load i32, i32* %6
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %57
%59 = getelementptr inbounds [30 x i8], [30 x i8]* %58, i64 0, i64 0
%60 = call i32 @strcpy(i8* %55, i8* %59)
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %62
%64 = getelementptr inbounds [30 x i8], [30 x i8]* %63, i64 0, i64 0
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %66
%68 = getelementptr inbounds [30 x i8], [30 x i8]* %67, i64 0, i64 0
%69 = call i32 @strcpy(i8* %64, i8* %68)
%70 = load i32, i32* %7
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %71
%73 = getelementptr inbounds [30 x i8], [30 x i8]* %72, i64 0, i64 0
%74 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
%75 = call i32 @strcpy(i8* %73, i8* %74)
br label %76
76: ; preds = %54, %43
br label %77
77: ; preds = %76
%78 = load i32, i32* %7
%79 = add nsw i32 %78, 1
store i32 %79, i32* %7
br label %39
80: ; preds = %39
br label %81
81: ; preds = %80
%82 = load i32, i32* %6
%83 = add nsw i32 %82, 1
store i32 %83, i32* %6
br label %32
84: ; preds = %32
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %6
br label %86
86: ; preds = %96, %84
%87 = load i32, i32* %6
%88 = load i32, i32* %5
%89 = icmp slt i32 %87, %88
br i1 %89, label %90, label %99
90: ; preds = %86
%91 = load i32, i32* %6
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %92
%94 = getelementptr inbounds [30 x i8], [30 x i8]* %93, i64 0, i64 0
%95 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %94)
br label %96
96: ; preds = %90
%97 = load i32, i32* %6
%98 = add nsw i32 %97, 1
store i32 %98, i32* %6
br label %86
99: ; preds = %86
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0))
%102 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%103 = call i32 @gets(i8* %102)
store i32 0, i32* %12
store i32 0, i32* %9
%104 = load i32, i32* %5
%105 = sub nsw i32 %104, 1
store i32 %105, i32* %10
br label %106
106: ; preds = %139, %99
%107 = load i32, i32* %9
%108 = load i32, i32* %10
%109 = icmp sle i32 %107, %108
br i1 %109, label %110, label %140
110: ; preds = %106
%111 = load i32, i32* %9
%112 = load i32, i32* %10
%113 = add nsw i32 %111, %112
%114 = sdiv i32 %113, 2
store i32 %114, i32* %11
%115 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%116 = load i32, i32* %11
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %117
%119 = getelementptr inbounds [30 x i8], [30 x i8]* %118, i64 0, i64 0
%120 = call i64 @strcmp(i8* %115, i8* %119)
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %124
122: ; preds = %110
%123 = load i32, i32* %11
store i32 %123, i32* %8
store i32 1, i32* %12
br label %140
124: ; preds = %110
%125 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%126 = load i32, i32* %11
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [20 x [30 x i8]], [20 x [30 x i8]]* %2, i64 0, i64 %127
%129 = getelementptr inbounds [30 x i8], [30 x i8]* %128, i64 0, i64 0
%130 = call i64 @strcmp(i8* %125, i8* %129)
%131 = icmp slt i64 %130, 0
br i1 %131, label %132, label %135
132: ; preds = %124
%133 = load i32, i32* %11
%134 = sub nsw i32 %133, 1
store i32 %134, i32* %10
br label %138
135: ; preds = %124
%136 = load i32, i32* %11
%137 = add nsw i32 %136, 1
store i32 %137, i32* %9
br label %138
138: ; preds = %135, %132
br label %139
139: ; preds = %138
br label %106
140: ; preds = %122, %106
%141 = load i32, i32* %12
%142 = icmp ne i32 %141, 0
br i1 %142, label %143, label %148
143: ; preds = %140
%144 = getelementptr inbounds [30 x i8], [30 x i8]* %4, i64 0, i64 0
%145 = load i32, i32* %8
%146 = add nsw i32 %145, 1
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.7, i64 0, i64 0), i8* %144, i32 %146)
br label %150
148: ; preds = %140
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
br label %150
150: ; preds = %148, %143
ret i32 0
}

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