#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*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int n, i, p1, p2;
  char name[20][100], lucky[100], name1[100], name2[100];
  printf("How many players? ");
  scanf("%d", &n);
  printf("Enter the names : \n");
  for (i = 0; i <= n; i++)
    gets(name[i]);
  for (i = 0; i < n; i++)
    strcpy(name[i], name[i + 1]);
  printf("\nTournament generated : \n\n");
  if (n % 2) {
    srand(time(NULL));
    p1 = rand() % n;
    strcpy(lucky, name[p1]);
    for (i = p1; i < n - 1; i++)
      strcpy(name[i], name[i + 1]);
    n--;
    printf("%s goes to the next round...\n", lucky);
  }
  while (n) {
    srand(time(NULL));
    p1 = rand() % n;
    strcpy(name1, name[p1]);
    for (i = p1; i < n - 1; i++)
      strcpy(name[i], name[i + 1]);
    n--;
    srand(time(NULL));
    p2 = rand() % n;
    strcpy(name2, name[p2]);
    for (i = p2; i < n - 1; i++)
      strcpy(name[i], name[i + 1]);
    n--;
    printf("%s vs %s\n", name1, name2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x940,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1080 <scanf@plt>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11e6 <main+0x76>
movslq -0xc(%rbp),%rax
lea    -0x7f0(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1070 <gets@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11b5 <main+0x45>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1234 <main+0xc4>
movslq -0xc(%rbp),%rax
lea    -0x7f0(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ed <main+0x7d>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1302 <main+0x192>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x860(%rbp),%rdi
movslq -0x10(%rbp),%rax
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12e4 <main+0x174>
movslq -0xc(%rbp),%rax
lea    -0x7f0(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1298 <main+0x128>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    -0x860(%rbp),%rsi
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1307 <main+0x197>
cmpl   $0x0,-0x8(%rbp)
je     1460 <main+0x2f0>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x10(%rbp)
lea    -0x8d0(%rbp),%rdi
movslq -0x10(%rbp),%rax
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    139f <main+0x22f>
movslq -0xc(%rbp),%rax
lea    -0x7f0(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1353 <main+0x1e3>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1090 <rand@plt>
cltd
idivl  -0x8(%rbp)
mov    %edx,-0x14(%rbp)
lea    -0x940(%rbp),%rdi
movslq -0x14(%rbp),%rax
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1436 <main+0x2c6>
movslq -0xc(%rbp),%rax
lea    -0x7f0(%rbp),%rdi
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cltq
lea    -0x7f0(%rbp),%rsi
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    13ea <main+0x27a>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
lea    -0x8d0(%rbp),%rsi
lea    -0x940(%rbp),%rdx
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1307 <main+0x197>
xor    %eax,%eax
add    $0x940,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x938,%rsp
lea    0xe68(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe6d(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1090 <scanf@plt>
lea    0xe87(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x0,0xc(%rsp)
js     122d <main+0xad>
mov    $0xffffffffffffffff,%rbp
lea    0x160(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1080 <gets@plt>
movslq 0xc(%rsp),%rax
add    $0x1,%rbp
add    $0x64,%rbx
cmp    %rax,%rbp
jl     11e0 <main+0x60>
test   %eax,%eax
jle    122d <main+0xad>
lea    0x160(%rsp),%rdi
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
lea    0x64(%rdi),%rbx
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movslq 0xc(%rsp),%rax
mov    %rbx,%rdi
cmp    %rax,%rbp
jl     1210 <main+0x90>
lea    0xe1d(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%eax
test   $0x1,%al
je     12cf <main+0x14f>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   10a0 <rand@plt>
cltd
idivl  0xc(%rsp)
movslq %edx,%rbx
imul   $0x64,%rbx,%rax
lea    (%rsp,%rax,1),%r15
add    $0x160,%r15
lea    0x10(%rsp),%rdi
mov    %r15,%rsi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%ebx
jge    12b4 <main+0x134>
nopl   0x0(%rax)
add    $0x1,%rbx
lea    0x64(%r15),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
movslq 0xc(%rsp),%rax
add    $0xffffffffffffffff,%rax
mov    %r14,%r15
cmp    %rax,%rbx
jl     1290 <main+0x110>
mov    %eax,0xc(%rsp)
lea    0xd57(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     13f9 <main+0x279>
lea    0xf0(%rsp),%r14
lea    0x80(%rsp),%r12
lea    0xd46(%rip),%r15
jmp    130f <main+0x18f>
mov    %eax,0xc(%rsp)
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
je     13f9 <main+0x279>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   10a0 <rand@plt>
cltd
idivl  0xc(%rsp)
movslq %edx,%rbp
imul   $0x64,%rbp,%rax
lea    (%rsp,%rax,1),%rbx
add    $0x160,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%ebp
jge    1384 <main+0x204>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
lea    0x64(%rbx),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
movslq 0xc(%rsp),%rax
add    $0xffffffffffffffff,%rax
mov    %r13,%rbx
cmp    %rax,%rbp
jl     1360 <main+0x1e0>
mov    %eax,0xc(%rsp)
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   10a0 <rand@plt>
cltd
idivl  0xc(%rsp)
movslq %edx,%rbp
imul   $0x64,%rbp,%rax
lea    (%rsp,%rax,1),%rbx
add    $0x160,%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    %eax,%ebp
jge    12f0 <main+0x170>
xchg   %ax,%ax
add    $0x1,%rbp
lea    0x64(%rbx),%r13
mov    %rbx,%rdi
mov    %r13,%rsi
call   1030 <strcpy@plt>
movslq 0xc(%rsp),%rax
add    $0xffffffffffffffff,%rax
mov    %r13,%rbx
cmp    %rax,%rbp
jl     13d0 <main+0x250>
jmp    12f0 <main+0x170>
xor    %eax,%eax
add    $0x938,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [19 x i8] c"How many players? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [30 x i8] c"%s goes to the next round...\0A\00"
@.str.5 = [10 x i8] c"%s vs %s\0A\00"
@str = [19 x i8] c"Enter the names : \00"
@str.6 = [26 x i8] c"\0ATournament generated : \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [20 x [100 x i8]]
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = bitcast i32* %1 to i8*
%7 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 0, i64 0
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 0
br i1 %15, label %35, label %18
16: ; preds = %18
%17 = icmp sgt i32 %23, 0
br i1 %17, label %26, label %35
18: ; preds = %0, %18
%19 = phi i64 [ %22, %18 ], [ 0, %0 ]
%20 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %19, i64 0
%21 = call i32 @gets(i8* %20)
%22 = add nuw nsw i64 %19, 1
%23 = load i32, i32* %1
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %19, %24
br i1 %25, label %18, label %16
26: ; preds = %16, %26
%27 = phi i64 [ %29, %26 ], [ 0, %16 ]
%28 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %27, i64 0
%29 = add nuw nsw i64 %27, 1
%30 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %29, i64 0
%31 = call i32 @strcpy(i8* %28, i8* %30)
%32 = load i32, i32* %1
%33 = sext i32 %32 to i64
%34 = icmp slt i64 %29, %33
br i1 %34, label %26, label %35
35: ; preds = %26, %0, %16
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.6, i64 0, i64 0))
%37 = load i32, i32* %1
%38 = and i32 %37, 1
%39 = icmp eq i32 %38, 0
br i1 %39, label %66, label %40
40: ; preds = %35
%41 = call i32 @time(i32* null)
%42 = call i32 @srand(i32 %41)
%43 = call i32 (...) @rand()
%44 = load i32, i32* %1
%45 = srem i32 %43, %44
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %46, i64 0
%48 = call i32 @strcpy(i8* %8, i8* %47)
%49 = load i32, i32* %1
%50 = add nsw i32 %49, -1
%51 = icmp slt i32 %45, %50
br i1 %51, label %52, label %62
52: ; preds = %40, %52
%53 = phi i64 [ %55, %52 ], [ %46, %40 ]
%54 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %53, i64 0
%55 = add nsw i64 %53, 1
%56 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %55, i64 0
%57 = call i32 @strcpy(i8* %54, i8* %56)
%58 = load i32, i32* %1
%59 = add nsw i32 %58, -1
%60 = sext i32 %59 to i64
%61 = icmp slt i64 %55, %60
br i1 %61, label %52, label %62
62: ; preds = %52, %40
%63 = phi i32 [ %50, %40 ], [ %59, %52 ]
store i32 %63, i32* %1
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0), i8* %8)
%65 = load i32, i32* %1
br label %66
66: ; preds = %62, %35
%67 = phi i32 [ %65, %62 ], [ %37, %35 ]
%68 = icmp eq i32 %67, 0
br i1 %68, label %119, label %69
69: ; preds = %66, %114
%70 = call i32 @time(i32* null)
%71 = call i32 @srand(i32 %70)
%72 = call i32 (...) @rand()
%73 = load i32, i32* %1
%74 = srem i32 %72, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %75, i64 0
%77 = call i32 @strcpy(i8* %9, i8* %76)
%78 = load i32, i32* %1
%79 = add nsw i32 %78, -1
%80 = icmp slt i32 %74, %79
br i1 %80, label %81, label %91
81: ; preds = %69, %81
%82 = phi i64 [ %84, %81 ], [ %75, %69 ]
%83 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %82, i64 0
%84 = add nsw i64 %82, 1
%85 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %84, i64 0
%86 = call i32 @strcpy(i8* %83, i8* %85)
%87 = load i32, i32* %1
%88 = add nsw i32 %87, -1
%89 = sext i32 %88 to i64
%90 = icmp slt i64 %84, %89
br i1 %90, label %81, label %91
91: ; preds = %81, %69
%92 = phi i32 [ %79, %69 ], [ %88, %81 ]
store i32 %92, i32* %1
%93 = call i32 @time(i32* null)
%94 = call i32 @srand(i32 %93)
%95 = call i32 (...) @rand()
%96 = load i32, i32* %1
%97 = srem i32 %95, %96
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %98, i64 0
%100 = call i32 @strcpy(i8* %10, i8* %99)
%101 = load i32, i32* %1
%102 = add nsw i32 %101, -1
%103 = icmp slt i32 %97, %102
br i1 %103, label %104, label %114
104: ; preds = %91, %104
%105 = phi i64 [ %107, %104 ], [ %98, %91 ]
%106 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %105, i64 0
%107 = add nsw i64 %105, 1
%108 = getelementptr inbounds [20 x [100 x i8]], [20 x [100 x i8]]* %2, i64 0, i64 %107, i64 0
%109 = call i32 @strcpy(i8* %106, i8* %108)
%110 = load i32, i32* %1
%111 = add nsw i32 %110, -1
%112 = sext i32 %111 to i64
%113 = icmp slt i64 %107, %112
br i1 %113, label %104, label %114
114: ; preds = %104, %91
%115 = phi i32 [ %102, %91 ], [ %111, %104 ]
store i32 %115, i32* %1
%116 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8* %9, i8* %10)
%117 = load i32, i32* %1
%118 = icmp eq i32 %117, 0
br i1 %118, label %119, label %69
119: ; preds = %114, %66
ret i32 0
}