#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
scalar_t__ rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  puts("Random groups ...");
  unsigned int iseed = (unsigned int)time(NULL);
  srand(iseed);
  int noStudents = 14;
  int groupSize = 2;
  int randomList[80];
  int loopCount = 0;
  int loopCountInner = 0;
  int thisRandomNumber;
  while (loopCount < noStudents) {
    thisRandomNumber = ((unsigned)rand() % noStudents) + 1;
    for (loopCountInner = 0; loopCountInner < loopCount; loopCountInner++) {
      if (randomList[loopCountInner] == thisRandomNumber) {
        break;
      }
    }
    if (loopCountInner == loopCount) {
      randomList[loopCount] = thisRandomNumber;
      loopCount++;
    }
  }
  for (loopCount = 0; loopCount < noStudents;
       loopCount = loopCount + groupSize) {
    for (loopCountInner = 0; (loopCountInner < groupSize) &&
                             ((loopCount + loopCountInner) < noStudents);
         loopCountInner++) {
      printf("\t%i", randomList[loopCount + loopCountInner]);
    }
    printf("\n");
  }
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <srand@plt>
movl   $0xe,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x0,-0x154(%rbp)
movl   $0x0,-0x158(%rbp)
mov    -0x154(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1256 <main+0x106>
mov    $0x0,%al
call   1070 <rand@plt>
xor    %edx,%edx
divl   -0xc(%rbp)
add    $0x1,%edx
mov    %edx,-0x15c(%rbp)
movl   $0x0,-0x158(%rbp)
mov    -0x158(%rbp),%eax
cmp    -0x154(%rbp),%eax
jge    121c <main+0xcc>
movslq -0x158(%rbp),%rax
mov    -0x150(%rbp,%rax,4),%eax
cmp    -0x15c(%rbp),%eax
jne    1203 <main+0xb3>
jmp    121c <main+0xcc>
jmp    1208 <main+0xb8>
mov    -0x158(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x158(%rbp)
jmp    11d2 <main+0x82>
mov    -0x158(%rbp),%eax
cmp    -0x154(%rbp),%eax
jne    1251 <main+0x101>
mov    -0x15c(%rbp),%ecx
movslq -0x154(%rbp),%rax
mov    %ecx,-0x150(%rbp,%rax,4)
mov    -0x154(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x154(%rbp)
jmp    11a4 <main+0x54>
movl   $0x0,-0x154(%rbp)
mov    -0x154(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1314 <main+0x1c4>
movl   $0x0,-0x158(%rbp)
mov    -0x158(%rbp),%ecx
xor    %eax,%eax
cmp    -0x10(%rbp),%ecx
mov    %al,-0x15d(%rbp)
jge    12a8 <main+0x158>
mov    -0x154(%rbp),%eax
add    -0x158(%rbp),%eax
cmp    -0xc(%rbp),%eax
setl   %al
mov    %al,-0x15d(%rbp)
mov    -0x15d(%rbp),%al
test   $0x1,%al
jne    12bb <main+0x16b>
jmp    12f2 <main+0x1a2>
mov    -0x154(%rbp),%eax
add    -0x158(%rbp),%eax
cltq
mov    -0x150(%rbp,%rax,4),%esi
lea    0xd3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x158(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x158(%rbp)
jmp    1279 <main+0x129>
lea    0xd1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x154(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x154(%rbp)
jmp    1260 <main+0x110>
mov    0x2cc5(%rip),%rax
mov    (%rax),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x148,%rsp
lea    0xe90(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
mov    $0x92492493,%ebx
xor    %ebp,%ebp
jmp    119e <main+0x3e>
nopl   0x0(%rax)
movslq %ebp,%rcx
mov    %eax,(%rsp,%rcx,4)
add    $0x1,%ebp
cmp    $0xe,%ebp
jge    11e6 <main+0x86>
xor    %eax,%eax
call   1080 <rand@plt>
mov    %eax,%ecx
shr    %ecx
imul   %rbx,%rcx
shr    $0x22,%rcx
mov    %ecx,%edx
shl    $0x4,%edx
mov    %ecx,%esi
sub    %edx,%esi
add    %ecx,%esi
add    %esi,%eax
add    $0x1,%eax
mov    $0x0,%ecx
test   %ebp,%ebp
jle    11e0 <main+0x80>
mov    %ebp,%edx
xor    %ecx,%ecx
xchg   %ax,%ax
cmp    %eax,(%rsp,%rcx,4)
je     11e0 <main+0x80>
add    $0x1,%rcx
cmp    %rcx,%rdx
jne    11d0 <main+0x70>
jmp    1190 <main+0x30>
cmp    %ebp,%ecx
je     1190 <main+0x30>
jmp    1199 <main+0x39>
mov    (%rsp),%esi
lea    0xe22(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x20(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x24(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x28(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2c(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x30(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x34(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2ce3(%rip),%rax
mov    (%rax),%eax
add    $0x148,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Random groups ...\00"
@.str.1 = [4 x i8] c"\09%i\00"
@.str.2 = [2 x i8] c"\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [80 x i32]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%10 = call i64 @time(i32* null)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @srand(i32 %12)
store i32 14, i32* %3
store i32 2, i32* %4
store i32 0, i32* %6
store i32 0, i32* %7
br label %14
14: ; preds = %51, %0
%15 = load i32, i32* %6
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %52
18: ; preds = %14
%19 = call i64 (...) @rand()
%20 = trunc i64 %19 to i32
%21 = load i32, i32* %3
%22 = urem i32 %20, %21
%23 = add i32 %22, 1
store i32 %23, i32* %8
store i32 0, i32* %7
br label %24
24: ; preds = %37, %18
%25 = load i32, i32* %7
%26 = load i32, i32* %6
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %40
28: ; preds = %24
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [80 x i32], [80 x i32]* %5, i64 0, i64 %30
%32 = load i32, i32* %31
%33 = load i32, i32* %8
%34 = icmp eq i32 %32, %33
br i1 %34, label %35, label %36
35: ; preds = %28
br label %40
36: ; preds = %28
br label %37
37: ; preds = %36
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 1
store i32 %39, i32* %7
br label %24
40: ; preds = %35, %24
%41 = load i32, i32* %7
%42 = load i32, i32* %6
%43 = icmp eq i32 %41, %42
br i1 %43, label %44, label %51
44: ; preds = %40
%45 = load i32, i32* %8
%46 = load i32, i32* %6
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [80 x i32], [80 x i32]* %5, i64 0, i64 %47
store i32 %45, i32* %48
%49 = load i32, i32* %6
%50 = add nsw i32 %49, 1
store i32 %50, i32* %6
br label %51
51: ; preds = %44, %40
br label %14
52: ; preds = %14
store i32 0, i32* %6
br label %53
53: ; preds = %83, %52
%54 = load i32, i32* %6
%55 = load i32, i32* %3
%56 = icmp slt i32 %54, %55
br i1 %56, label %57, label %87
57: ; preds = %53
store i32 0, i32* %7
br label %58
58: ; preds = %78, %57
%59 = load i32, i32* %7
%60 = load i32, i32* %4
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %68
62: ; preds = %58
%63 = load i32, i32* %6
%64 = load i32, i32* %7
%65 = add nsw i32 %63, %64
%66 = load i32, i32* %3
%67 = icmp slt i32 %65, %66
br label %68
68: ; preds = %62, %58
%69 = phi i1 [ false, %58 ], [ %67, %62 ]
br i1 %69, label %70, label %81
70: ; preds = %68
%71 = load i32, i32* %6
%72 = load i32, i32* %7
%73 = add nsw i32 %71, %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds [80 x i32], [80 x i32]* %5, i64 0, i64 %74
%76 = load i32, i32* %75
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %76)
br label %78
78: ; preds = %70
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
store i32 %80, i32* %7
br label %58
81: ; preds = %68
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %83
83: ; preds = %81
%84 = load i32, i32* %6
%85 = load i32, i32* %4
%86 = add nsw i32 %84, %85
store i32 %86, i32* %6
br label %53
87: ; preds = %53
%88 = load i32, i32* @EXIT_SUCCESS
ret i32 %88
}

LLVM IR (-O2):
@.str = [18 x i8] c"Random groups ...\00"
@.str.1 = [4 x i8] c"\09%i\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [80 x i32]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%3 = tail call i64 @time(i32* null)
%4 = trunc i64 %3 to i32
%5 = tail call i32 @srand(i32 %4)
%6 = bitcast [80 x i32]* %1 to i8*
br label %7
7: ; preds = %0, %33
%8 = phi i32 [ 0, %0 ], [ %34, %33 ]
%9 = tail call i64 (...) @rand()
%10 = trunc i64 %9 to i32
%11 = urem i32 %10, 14
%12 = add nuw nsw i32 %11, 1
%13 = icmp sgt i32 %8, 0
br i1 %13, label %14, label %26
14: ; preds = %7
%15 = zext i32 %8 to i64
br label %16
16: ; preds = %14, %21
%17 = phi i64 [ 0, %14 ], [ %22, %21 ]
%18 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 %17
%19 = load i32, i32* %18
%20 = icmp eq i32 %19, %12
br i1 %20, label %24, label %21
21: ; preds = %16
%22 = add nuw nsw i64 %17, 1
%23 = icmp eq i64 %22, %15
br i1 %23, label %29, label %16
24: ; preds = %16
%25 = trunc i64 %17 to i32
br label %26
26: ; preds = %24, %7
%27 = phi i32 [ 0, %7 ], [ %25, %24 ]
%28 = icmp eq i32 %27, %8
br i1 %28, label %29, label %33
29: ; preds = %21, %26
%30 = sext i32 %8 to i64
%31 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 %30
store i32 %12, i32* %31
%32 = add nsw i32 %8, 1
br label %33
33: ; preds = %29, %26
%34 = phi i32 [ %32, %29 ], [ %8, %26 ]
%35 = icmp slt i32 %34, 14
br i1 %35, label %7, label %36
36: ; preds = %33
%37 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 0
%38 = load i32, i32* %37
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %38)
%40 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 1
%41 = load i32, i32* %40
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %41)
%43 = tail call i32 @putchar(i32 10)
%44 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 2
%45 = load i32, i32* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %45)
%47 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 3
%48 = load i32, i32* %47
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %48)
%50 = tail call i32 @putchar(i32 10)
%51 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 4
%52 = load i32, i32* %51
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 5
%55 = load i32, i32* %54
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %55)
%57 = tail call i32 @putchar(i32 10)
%58 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 6
%59 = load i32, i32* %58
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %59)
%61 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 7
%62 = load i32, i32* %61
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %62)
%64 = tail call i32 @putchar(i32 10)
%65 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 8
%66 = load i32, i32* %65
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 9
%69 = load i32, i32* %68
%70 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %69)
%71 = tail call i32 @putchar(i32 10)
%72 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 10
%73 = load i32, i32* %72
%74 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %73)
%75 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 11
%76 = load i32, i32* %75
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %76)
%78 = tail call i32 @putchar(i32 10)
%79 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 12
%80 = load i32, i32* %79
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %80)
%82 = getelementptr inbounds [80 x i32], [80 x i32]* %1, i64 0, i64 13
%83 = load i32, i32* %82
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %83)
%85 = tail call i32 @putchar(i32 10)
%86 = load i32, i32* @EXIT_SUCCESS
ret i32 %86
}