#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*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int nr;
  int r[6];
  puts("\t\t\tLoteria fantastica\n\n");
  puts("\t\tExtragere direct in direct\n\n");
  printf("Apasa balamuc pentru a incepe %c %c", 1, 10);
  getchar();
  srand((unsigned)time(NULL));
  for (nr = 0; nr < 6; nr++) {
    r[nr] = rand() % 49 + 1;
    if (nr == 0)
      printf("Primul numar este %d.\n\n", r[nr]);
    else
      printf("Al %dlea numar este %d.\n\n", nr + 2, r[nr]);
  }
  printf("Numerele extrase in aceasta seara sunt %c\n\t", 31);
  for (nr = 0; nr < 6; nr++)
    printf("%d, ", r[nr]);
  printf("\n\n\n\r");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xe96(%rip),%rdi
call   1030 <puts@plt>
lea    0xea9(%rip),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    1235 <main+0xd5>
mov    $0x0,%al
call   1080 <rand@plt>
mov    $0x31,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
movslq -0x8(%rbp),%rax
mov    %edx,-0x20(%rbp,%rax,4)
cmpl   $0x0,-0x8(%rbp)
jne    1206 <main+0xa6>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1222 <main+0xc2>
mov    -0x8(%rbp),%esi
add    $0x2,%esi
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%edx
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1227 <main+0xc7>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11bd <main+0x5d>
lea    0xe51(%rip),%rdi
mov    $0x1f,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x6,-0x8(%rbp)
jge    127d <main+0x11d>
movslq -0x8(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%esi
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    124f <main+0xef>
lea    0xe3a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
lea    0xead(%rip),%rdi
mov    $0x1,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1,%esi
mov    %esi,0x4(%rsp)
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edx
add    $0x1,%edx
mov    %edx,(%rsp)
lea    0xe57(%rip),%r12
mov    %r12,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r13d
add    $0x1,%r13d
mov    %r12,%rdi
mov    $0x4,%esi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r15d
add    $0x1,%r15d
mov    %r12,%rdi
mov    $0x5,%esi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%ebp
add    $0x1,%ebp
mov    %r12,%rdi
mov    $0x6,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
cltq
imul   $0x5397829d,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x24,%rcx
add    %edx,%ecx
imul   $0x31,%ecx,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r14d
add    $0x1,%r14d
mov    %r12,%rdi
mov    $0x7,%esi
mov    %r14d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd6e(%rip),%rdi
mov    $0x1f,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd87(%rip),%rbx
mov    %rbx,%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    (%rsp),%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xd37(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"\09\09\09Loteria fantastica\0A\0A\00"
@.str.1 = [31 x i8] c"\09\09Extragere direct in direct\0A\0A\00"
@.str.2 = [36 x i8] c"Apasa balamuc pentru a incepe %c %c\00"
@.str.3 = [24 x i8] c"Primul numar este %d.\0A\0A\00"
@.str.4 = [26 x i8] c"Al %dlea numar este %d.\0A\0A\00"
@.str.5 = [44 x i8] c"Numerele extrase in aceasta seara sunt %c\0A\09\00"
@.str.6 = [5 x i8] c"%d, \00"
@.str.7 = [5 x i8] c"\0A\0A\0A\0D\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i32]
store i32 0, i32* %1
%4 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @puts(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 10)
%7 = call i32 (...) @getchar()
%8 = call i64 @time(i32* null)
%9 = trunc i64 %8 to i32
%10 = call i32 @srand(i32 %9)
store i32 0, i32* %2
br label %11
11: ; preds = %38, %0
%12 = load i32, i32* %2
%13 = icmp slt i32 %12, 6
br i1 %13, label %14, label %41
14: ; preds = %11
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 49
%17 = add nsw i32 %16, 1
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %19
store i32 %17, i32* %20
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %29
23: ; preds = %14
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %27)
br label %37
29: ; preds = %14
%30 = load i32, i32* %2
%31 = add nsw i32 %30, 2
%32 = load i32, i32* %2
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %33
%35 = load i32, i32* %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 %31, i32 %35)
br label %37
37: ; preds = %29, %23
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %11
41: ; preds = %11
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), i32 31)
store i32 0, i32* %2
br label %43
43: ; preds = %52, %41
%44 = load i32, i32* %2
%45 = icmp slt i32 %44, 6
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [6 x i32], [6 x i32]* %3, i64 0, i64 %48
%50 = load i32, i32* %49
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %46
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
br label %43
55: ; preds = %43
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"\09\09\09Loteria fantastica\0A\0A\00"
@.str.1 = [31 x i8] c"\09\09Extragere direct in direct\0A\0A\00"
@.str.2 = [36 x i8] c"Apasa balamuc pentru a incepe %c %c\00"
@.str.3 = [24 x i8] c"Primul numar este %d.\0A\0A\00"
@.str.4 = [26 x i8] c"Al %dlea numar este %d.\0A\0A\00"
@.str.5 = [44 x i8] c"Numerele extrase in aceasta seara sunt %c\0A\09\00"
@.str.6 = [5 x i8] c"%d, \00"
@.str.7 = [5 x i8] c"\0A\0A\0A\0D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 10)
%4 = tail call i32 (...) @getchar()
%5 = tail call i64 @time(i32* null)
%6 = trunc i64 %5 to i32
%7 = tail call i32 @srand(i32 %6)
%8 = tail call i32 (...) @rand()
%9 = srem i32 %8, 49
%10 = add nsw i32 %9, 1
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = tail call i32 (...) @rand()
%13 = srem i32 %12, 49
%14 = add nsw i32 %13, 1
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 %14)
%16 = tail call i32 (...) @rand()
%17 = srem i32 %16, 49
%18 = add nsw i32 %17, 1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 4, i32 %18)
%20 = tail call i32 (...) @rand()
%21 = srem i32 %20, 49
%22 = add nsw i32 %21, 1
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 5, i32 %22)
%24 = tail call i32 (...) @rand()
%25 = srem i32 %24, 49
%26 = add nsw i32 %25, 1
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 6, i32 %26)
%28 = tail call i32 (...) @rand()
%29 = srem i32 %28, 49
%30 = add nsw i32 %29, 1
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0), i32 7, i32 %30)
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.5, i64 0, i64 0), i32 31)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %10)
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %14)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %22)
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %26)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
ret i32 0
}