#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*/ printf(char *, int);
int /*<<< orphan*/ puts(char *);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int x, y, z, numbers[6];
  for (x = 0; x < 6; x++)
    numbers[x] = -1;
  srand((unsigned)time(NULL));
  puts("THE AMAZING LOTTERY");
  for (y = 0; y < 6; y++) {
    printf("%d\n", y);
  label:
    z = rand() % 6;
    for (y = 0; y < 6; y++) {
      if (z == numbers[y])
        goto label;
      else if (numbers[y] != -1)
        continue;
      else {
        numbers[y] = z;
        break;
      }
    }
  }
  printf("Today's numbers are : %c", 36);
  for (x = 0; x < 6; x++)
    printf("%d, ", numbers[x]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    118a <main+0x3a>
movslq -0x8(%rbp),%rax
movl   $0xffffffff,-0x30(%rbp,%rax,4)
ff
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1166 <main+0x16>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1244 <main+0xf4>
mov    -0xc(%rbp),%esi
lea    0xe53(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x6,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x6,-0xc(%rbp)
jge    1231 <main+0xe1>
mov    -0x10(%rbp),%eax
movslq -0xc(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jne    11ff <main+0xaf>
jmp    11c6 <main+0x76>
movslq -0xc(%rbp),%rax
cmpl   $0xffffffff,-0x30(%rbp,%rax,4)
je     1213 <main+0xc3>
jmp    1223 <main+0xd3>
mov    -0x10(%rbp),%ecx
movslq -0xc(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
jmp    1231 <main+0xe1>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <main+0x8f>
jmp    1236 <main+0xe6>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ad <main+0x5d>
lea    0xdcd(%rip),%rdi
mov    $0x24,%esi
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1288 <main+0x138>
movslq -0x8(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%esi
lea    0xdbc(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    125c <main+0x10c>
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    $0x18,%rsp
pcmpeqd %xmm0,%xmm0
movdqa %xmm0,(%rsp)
movq   $0xffffffffffffffff,0x10(%rsp)
ff ff
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%ebp
xor    %esi,%esi
jmp    11ad <main+0x5d>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %esi,%esi
mov    %esi,%ecx
mov    %eax,(%rsp,%rcx,4)
add    $0x1,%esi
mov    (%rsp),%ebp
lea    0xe60(%rip),%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%ebx
mov    0x8(%rsp),%r15d
mov    0xc(%rsp),%r12d
mov    0x10(%rsp),%r14d
mov    0x14(%rsp),%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x2aaaaaab,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
cmp    %ebp,%eax
je     11e0 <main+0x90>
cmp    $0xffffffff,%ebp
je     11a0 <main+0x50>
cmp    %ebx,%eax
je     11e0 <main+0x90>
cmp    $0xffffffff,%ebx
je     1240 <main+0xf0>
cmp    %r15d,%eax
je     11e0 <main+0x90>
cmp    $0xffffffff,%r15d
je     124a <main+0xfa>
cmp    %r12d,%eax
je     11e0 <main+0x90>
cmp    $0xffffffff,%r12d
je     1254 <main+0x104>
cmp    %r14d,%eax
je     11e0 <main+0x90>
cmp    $0xffffffff,%r14d
je     125e <main+0x10e>
cmp    %r13d,%eax
je     11e0 <main+0x90>
jmp    1268 <main+0x118>
xchg   %ax,%ax
mov    $0x1,%esi
jmp    11a2 <main+0x52>
mov    $0x2,%esi
jmp    11a2 <main+0x52>
mov    $0x3,%esi
jmp    11a2 <main+0x52>
mov    $0x4,%esi
jmp    11a2 <main+0x52>
cmp    $0xffffffff,%r13d
jne    1272 <main+0x122>
mov    %eax,0x14(%rsp)
lea    0xd9f(%rip),%rdi
mov    $0x24,%esi
call   1040 <printf@plt>
mov    (%rsp),%esi
lea    0xda4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x10(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
mov    0x14(%rsp),%esi
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"THE AMAZING LOTTERY\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@.str.2 = [25 x i8] c"Today's numbers are : %c\00"
@.str.3 = [5 x i8] c"%d, \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [6 x i32]
store i32 0, i32* %1
store i32 0, i32* %2
br label %6
6: ; preds = %13, %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %11
store i32 -1, i32* %12
br label %13
13: ; preds = %9
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %6
16: ; preds = %6
%17 = call i64 @time(i32* null)
%18 = trunc i64 %17 to i32
%19 = call i32 @srand(i32 %18)
%20 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %21
21: ; preds = %57, %16
%22 = load i32, i32* %3
%23 = icmp slt i32 %22, 6
br i1 %23, label %24, label %60
24: ; preds = %21
%25 = load i32, i32* %3
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %40, %24
%28 = call i32 (...) @rand()
%29 = srem i32 %28, 6
store i32 %29, i32* %4
store i32 0, i32* %3
br label %30
30: ; preds = %53, %27
%31 = load i32, i32* %3
%32 = icmp slt i32 %31, 6
br i1 %32, label %33, label %56
33: ; preds = %30
%34 = load i32, i32* %4
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp eq i32 %34, %38
br i1 %39, label %40, label %41
40: ; preds = %33
br label %27
41: ; preds = %33
%42 = load i32, i32* %3
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %43
%45 = load i32, i32* %44
%46 = icmp ne i32 %45, -1
br i1 %46, label %47, label %48
47: ; preds = %41
br label %53
48: ; preds = %41
%49 = load i32, i32* %4
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %51
store i32 %49, i32* %52
br label %56
53: ; preds = %47
%54 = load i32, i32* %3
%55 = add nsw i32 %54, 1
store i32 %55, i32* %3
br label %30
56: ; preds = %48, %30
br label %57
57: ; preds = %56
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
store i32 %59, i32* %3
br label %21
60: ; preds = %21
%61 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i32 36)
store i32 0, i32* %2
br label %62
62: ; preds = %71, %60
%63 = load i32, i32* %2
%64 = icmp slt i32 %63, 6
br i1 %64, label %65, label %74
65: ; preds = %62
%66 = load i32, i32* %2
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds [6 x i32], [6 x i32]* %5, i64 0, i64 %67
%69 = load i32, i32* %68
%70 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i32 %69)
br label %71
71: ; preds = %65
%72 = load i32, i32* %2
%73 = add nsw i32 %72, 1
store i32 %73, i32* %2
br label %62
74: ; preds = %62
ret i32 0
}

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