#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*/ flushall();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void enter_nums1(int *valid, int *flag_freq, int *user_array) {
  register int i, j;
  printf("\n\t\tYou selected Option 1 - Select Numbers\n");
  printf("\nYou must select %d numbers per game. ", 6);
  printf("Please enter your numbers now:\n");
  for (i = 0; i < 6; i++) {
    scanf("%d", &*(user_array + i));
    flushall();
    if (*(user_array + i) < 1 || *(user_array + i) > 42) {
      printf("\n***ERROR: This number is NOT IN RANGE, please select a number "
             "between 1 and %d!\n",
             42);
      *(user_array + i) = i--;
      *(valid) = 0;
    } else {
      *(valid) = 1;
    }
  }
  for (i = 0; i < 6; i++) {
    for (j = i + 1; j < (6); j++) {
      if (*(user_array + j) == *(user_array + i)) {
        printf("\n***ERROR: The number you entered above in position no.%d "
               "contained a duplicate number. Please try again.\n",
               (j + 1));
        *(valid) = 0;
        break;
      } else {
        *(valid) = 1;
      }
    }
  }
  *flag_freq = 1;
}


x86 assembly (clang, -O0):
<enter_nums1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    121f <enter_nums1+0xef>
mov    -0x18(%rbp),%rsi
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xed8(%rip),%rdi
call   1050 <scanf@plt>
mov    $0x0,%al
call   1040 <flushall@plt>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x1,(%rax,%rcx,4)
jl     11ca <enter_nums1+0x9a>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
cmpl   $0x2a,(%rax,%rcx,4)
jle    1202 <enter_nums1+0xd2>
lea    0xea4(%rip),%rdi
mov    $0x2a,%esi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%edx
mov    %edx,%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    120c <enter_nums1+0xdc>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
jmp    1211 <enter_nums1+0xe1>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117a <enter_nums1+0x4a>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x6,-0x1c(%rbp)
jge    12b2 <enter_nums1+0x182>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x6,-0x20(%rbp)
jge    129f <enter_nums1+0x16f>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    1282 <enter_nums1+0x152>
mov    -0x20(%rbp),%esi
add    $0x1,%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
jmp    129f <enter_nums1+0x16f>
mov    -0x8(%rbp),%rax
movl   $0x1,(%rax)
jmp    1291 <enter_nums1+0x161>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1239 <enter_nums1+0x109>
jmp    12a4 <enter_nums1+0x174>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1226 <enter_nums1+0xf6>
mov    -0x10(%rbp),%rax
movl   $0x1,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<enter_nums1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,(%rsp)
mov    %rdi,%r15
lea    0xf8b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf96(%rip),%rdi
call   1030 <puts@plt>
lea    0xea0(%rip),%r12
xor    %ebp,%ebp
jmp    119d <enter_nums1+0x5d>
nopl   0x0(%rax,%rax,1)
mov    %r13d,(%r15)
lea    0x1(%rbp),%eax
cmp    $0x5,%ebp
mov    %eax,%ebp
jge    11e6 <enter_nums1+0xa6>
movslq %ebp,%r14
lea    (%rbx,%r14,4),%rsi
mov    %r12,%rdi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1050 <flushall@plt>
mov    (%rbx,%r14,4),%eax
add    $0xffffffd5,%eax
mov    $0x1,%r13d
cmp    $0xffffffd5,%eax
ja     1190 <enter_nums1+0x50>
xor    %r13d,%r13d
lea    0xe5b(%rip),%rdi
mov    $0x2a,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14d,-0x4(%rbx,%r14,4)
lea    -0x1(%r14),%ebp
jmp    1190 <enter_nums1+0x50>
mov    0x4(%rbx),%eax
mov    $0x2,%esi
cmp    (%rbx),%eax
je     1229 <enter_nums1+0xe9>
movl   $0x1,(%r15)
mov    0x8(%rbx),%eax
mov    $0x3,%esi
cmp    (%rbx),%eax
je     1229 <enter_nums1+0xe9>
mov    0xc(%rbx),%eax
mov    $0x4,%esi
cmp    (%rbx),%eax
je     1229 <enter_nums1+0xe9>
mov    0x10(%rbx),%eax
mov    $0x5,%esi
cmp    (%rbx),%eax
je     1229 <enter_nums1+0xe9>
mov    0x14(%rbx),%eax
mov    $0x6,%esi
cmp    (%rbx),%eax
jne    123e <enter_nums1+0xfe>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,(%r15)
mov    0x8(%rbx),%eax
mov    $0x3,%esi
cmp    0x4(%rbx),%eax
je     1279 <enter_nums1+0x139>
movl   $0x1,(%r15)
mov    0xc(%rbx),%eax
mov    $0x4,%esi
cmp    0x4(%rbx),%eax
je     1279 <enter_nums1+0x139>
mov    0x10(%rbx),%eax
mov    $0x5,%esi
cmp    0x4(%rbx),%eax
je     1279 <enter_nums1+0x139>
mov    0x14(%rbx),%eax
mov    $0x6,%esi
cmp    0x4(%rbx),%eax
jne    128e <enter_nums1+0x14e>
lea    0xdfc(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,(%r15)
mov    0xc(%rbx),%eax
mov    $0x4,%esi
cmp    0x8(%rbx),%eax
je     12bc <enter_nums1+0x17c>
movl   $0x1,(%r15)
mov    0x10(%rbx),%eax
mov    $0x5,%esi
cmp    0x8(%rbx),%eax
je     12bc <enter_nums1+0x17c>
mov    0x14(%rbx),%eax
mov    $0x6,%esi
cmp    0x8(%rbx),%eax
jne    12d1 <enter_nums1+0x191>
lea    0xdb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,(%r15)
mov    0x10(%rbx),%eax
mov    $0x5,%esi
cmp    0xc(%rbx),%eax
je     12f2 <enter_nums1+0x1b2>
movl   $0x1,(%r15)
mov    0x14(%rbx),%eax
mov    $0x6,%esi
cmp    0xc(%rbx),%eax
jne    1307 <enter_nums1+0x1c7>
lea    0xd83(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movl   $0x0,(%r15)
mov    0x14(%rbx),%eax
mov    $0x1,%ebp
cmp    0x10(%rbx),%eax
jne    1329 <enter_nums1+0x1e9>
lea    0xd61(%rip),%rdi
xor    %ebp,%ebp
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,(%r15)
mov    (%rsp),%rax
movl   $0x1,(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [43 x i8] c"\0A\09\09You selected Option 1 - Select Numbers\0A\00"
@.str.1 = [39 x i8] c"\0AYou must select %d numbers per game. \00"
@.str.2 = [32 x i8] c"Please enter your numbers now:\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [82 x i8] c"\0A***ERROR: This number is NOT IN RANGE, please select a number between 1 and %d!\0A\00"
@.str.5 = [107 x i8] c"\0A***ERROR: The number you entered above in position no.%d contained a duplicate number. Please try again.\0A\00"
define void @enter_nums1(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %7
br label %12
12: ; preds = %47, %3
%13 = load i32, i32* %7
%14 = icmp slt i32 %13, 6
br i1 %14, label %15, label %50
15: ; preds = %12
%16 = load i32*, i32** %6
%17 = load i32, i32* %7
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %19)
%21 = call i32 (...) @flushall()
%22 = load i32*, i32** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %22, i64 %24
%26 = load i32, i32* %25
%27 = icmp slt i32 %26, 1
br i1 %27, label %35, label %28
28: ; preds = %15
%29 = load i32*, i32** %6
%30 = load i32, i32* %7
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %29, i64 %31
%33 = load i32, i32* %32
%34 = icmp sgt i32 %33, 42
br i1 %34, label %35, label %44
35: ; preds = %28, %15
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0), i32 42)
%37 = load i32, i32* %7
%38 = add nsw i32 %37, -1
store i32 %38, i32* %7
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i32, i32* %39, i64 %41
store i32 %37, i32* %42
%43 = load i32*, i32** %4
store i32 0, i32* %43
br label %46
44: ; preds = %28
%45 = load i32*, i32** %4
store i32 1, i32* %45
br label %46
46: ; preds = %44, %35
br label %47
47: ; preds = %46
%48 = load i32, i32* %7
%49 = add nsw i32 %48, 1
store i32 %49, i32* %7
br label %12
50: ; preds = %12
store i32 0, i32* %7
br label %51
51: ; preds = %84, %50
%52 = load i32, i32* %7
%53 = icmp slt i32 %52, 6
br i1 %53, label %54, label %87
54: ; preds = %51
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %8
br label %57
57: ; preds = %80, %54
%58 = load i32, i32* %8
%59 = icmp slt i32 %58, 6
br i1 %59, label %60, label %83
60: ; preds = %57
%61 = load i32*, i32** %6
%62 = load i32, i32* %8
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %61, i64 %63
%65 = load i32, i32* %64
%66 = load i32*, i32** %6
%67 = load i32, i32* %7
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds i32, i32* %66, i64 %68
%70 = load i32, i32* %69
%71 = icmp eq i32 %65, %70
br i1 %71, label %72, label %77
72: ; preds = %60
%73 = load i32, i32* %8
%74 = add nsw i32 %73, 1
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([107 x i8], [107 x i8]* @.str.5, i64 0, i64 0), i32 %74)
%76 = load i32*, i32** %4
store i32 0, i32* %76
br label %83
77: ; preds = %60
%78 = load i32*, i32** %4
store i32 1, i32* %78
br label %79
79: ; preds = %77
br label %80
80: ; preds = %79
%81 = load i32, i32* %8
%82 = add nsw i32 %81, 1
store i32 %82, i32* %8
br label %57
83: ; preds = %72, %57
br label %84
84: ; preds = %83
%85 = load i32, i32* %7
%86 = add nsw i32 %85, 1
store i32 %86, i32* %7
br label %51
87: ; preds = %51
%88 = load i32*, i32** %5
store i32 1, i32* %88
ret void
}

LLVM IR (-O2):
@.str.1 = [39 x i8] c"\0AYou must select %d numbers per game. \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [82 x i8] c"\0A***ERROR: This number is NOT IN RANGE, please select a number between 1 and %d!\0A\00"
@.str.5 = [107 x i8] c"\0A***ERROR: The number you entered above in position no.%d contained a duplicate number. Please try again.\0A\00"
@str = [42 x i8] c"\0A\09\09You selected Option 1 - Select Numbers\00"
@str.6 = [31 x i8] c"Please enter your numbers now:\00"
define void @enter_nums1(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* %2) {
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0), i32 6)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.6, i64 0, i64 0))
br label %7
7: ; preds = %3, %21
%8 = phi i32 [ 0, %3 ], [ %24, %21 ]
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i32, i32* %2, i64 %9
%11 = tail call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %10)
%12 = tail call i32 (...) @flushall()
%13 = load i32, i32* %10
%14 = add i32 %13, -43
%15 = icmp ult i32 %14, -42
br i1 %15, label %16, label %21
16: ; preds = %7
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0), i32 42)
%18 = add nsw i32 %8, -1
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %2, i64 %19
store i32 %8, i32* %20
br label %21
21: ; preds = %7, %16
%22 = phi i32 [ 0, %16 ], [ 1, %7 ]
%23 = phi i32 [ %18, %16 ], [ %8, %7 ]
store i32 %22, i32* %0
%24 = add nsw i32 %23, 1
%25 = icmp slt i32 %23, 5
br i1 %25, label %7, label %26
26: ; preds = %21
%27 = getelementptr inbounds i32, i32* %2, i64 1
%28 = load i32, i32* %27
%29 = load i32, i32* %2
%30 = icmp eq i32 %28, %29
br i1 %30, label %31, label %34
31: ; preds = %49, %44, %39, %34, %26
%32 = phi i32 [ 2, %26 ], [ 3, %34 ], [ 4, %39 ], [ 5, %44 ], [ 6, %49 ]
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str.5, i64 0, i64 0), i32 %32)
store i32 0, i32* %0
br label %54
34: ; preds = %26
store i32 1, i32* %0
%35 = getelementptr inbounds i32, i32* %2, i64 2
%36 = load i32, i32* %35
%37 = load i32, i32* %2
%38 = icmp eq i32 %36, %37
br i1 %38, label %31, label %39
39: ; preds = %34
%40 = getelementptr inbounds i32, i32* %2, i64 3
%41 = load i32, i32* %40
%42 = load i32, i32* %2
%43 = icmp eq i32 %41, %42
br i1 %43, label %31, label %44
44: ; preds = %39
%45 = getelementptr inbounds i32, i32* %2, i64 4
%46 = load i32, i32* %45
%47 = load i32, i32* %2
%48 = icmp eq i32 %46, %47
br i1 %48, label %31, label %49
49: ; preds = %44
%50 = getelementptr inbounds i32, i32* %2, i64 5
%51 = load i32, i32* %50
%52 = load i32, i32* %2
%53 = icmp eq i32 %51, %52
br i1 %53, label %31, label %54
54: ; preds = %49, %31
%55 = getelementptr inbounds i32, i32* %2, i64 1
%56 = getelementptr inbounds i32, i32* %2, i64 2
%57 = load i32, i32* %56
%58 = load i32, i32* %55
%59 = icmp eq i32 %57, %58
br i1 %59, label %75, label %60
60: ; preds = %54
store i32 1, i32* %0
%61 = getelementptr inbounds i32, i32* %2, i64 3
%62 = load i32, i32* %61
%63 = load i32, i32* %55
%64 = icmp eq i32 %62, %63
br i1 %64, label %75, label %65
65: ; preds = %60
%66 = getelementptr inbounds i32, i32* %2, i64 4
%67 = load i32, i32* %66
%68 = load i32, i32* %55
%69 = icmp eq i32 %67, %68
br i1 %69, label %75, label %70
70: ; preds = %65
%71 = getelementptr inbounds i32, i32* %2, i64 5
%72 = load i32, i32* %71
%73 = load i32, i32* %55
%74 = icmp eq i32 %72, %73
br i1 %74, label %75, label %78
75: ; preds = %70, %65, %60, %54
%76 = phi i32 [ 3, %54 ], [ 4, %60 ], [ 5, %65 ], [ 6, %70 ]
%77 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str.5, i64 0, i64 0), i32 %76)
store i32 0, i32* %0
br label %78
78: ; preds = %70, %75
%79 = getelementptr inbounds i32, i32* %2, i64 2
%80 = getelementptr inbounds i32, i32* %2, i64 3
%81 = load i32, i32* %80
%82 = load i32, i32* %79
%83 = icmp eq i32 %81, %82
br i1 %83, label %94, label %84
84: ; preds = %78
store i32 1, i32* %0
%85 = getelementptr inbounds i32, i32* %2, i64 4
%86 = load i32, i32* %85
%87 = load i32, i32* %79
%88 = icmp eq i32 %86, %87
br i1 %88, label %94, label %89
89: ; preds = %84
%90 = getelementptr inbounds i32, i32* %2, i64 5
%91 = load i32, i32* %90
%92 = load i32, i32* %79
%93 = icmp eq i32 %91, %92
br i1 %93, label %94, label %97
94: ; preds = %89, %84, %78
%95 = phi i32 [ 4, %78 ], [ 5, %84 ], [ 6, %89 ]
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str.5, i64 0, i64 0), i32 %95)
store i32 0, i32* %0
br label %97
97: ; preds = %89, %94
%98 = getelementptr inbounds i32, i32* %2, i64 3
%99 = getelementptr inbounds i32, i32* %2, i64 4
%100 = load i32, i32* %99
%101 = load i32, i32* %98
%102 = icmp eq i32 %100, %101
br i1 %102, label %108, label %103
103: ; preds = %97
store i32 1, i32* %0
%104 = getelementptr inbounds i32, i32* %2, i64 5
%105 = load i32, i32* %104
%106 = load i32, i32* %98
%107 = icmp eq i32 %105, %106
br i1 %107, label %108, label %111
108: ; preds = %103, %97
%109 = phi i32 [ 5, %97 ], [ 6, %103 ]
%110 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str.5, i64 0, i64 0), i32 %109)
store i32 0, i32* %0
br label %111
111: ; preds = %103, %108
%112 = getelementptr inbounds i32, i32* %2, i64 4
%113 = getelementptr inbounds i32, i32* %2, i64 5
%114 = load i32, i32* %113
%115 = load i32, i32* %112
%116 = icmp eq i32 %114, %115
br i1 %116, label %117, label %119
117: ; preds = %111
%118 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([107 x i8], [107 x i8]* @.str.5, i64 0, i64 0), i32 6)
br label %119
119: ; preds = %111, %117
%120 = phi i32 [ 0, %117 ], [ 1, %111 ]
store i32 %120, i32* %0
store i32 1, i32* %1
ret void
}