#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 *, unsigned int);
scalar_t__ rand();
int /*<<< orphan*/ srand(int);
int main() {
  srand(1);
  int i;
  for (i = 1; i <= 343; i++) {
    rand();
  }
  for (i = 344; i <= 350; i++) {
    printf("%d\n", ((unsigned int)rand()));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
call   1040 <srand@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x157,-0x8(%rbp)
jg     1172 <main+0x42>
mov    $0x0,%al
call   1050 <rand@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1150 <main+0x20>
movl   $0x158,-0x8(%rbp)
cmpl   $0x15e,-0x8(%rbp)
jg     11a9 <main+0x79>
mov    $0x0,%al
call   1050 <rand@plt>
mov    %eax,%esi
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1179 <main+0x49>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%edi
call   1040 <srand@plt>
mov    $0x157,%ebx
xor    %eax,%eax
call   1050 <rand@plt>
add    $0xffffffff,%ebx
jne    1140 <main+0x10>
xor    %eax,%eax
call   1050 <rand@plt>
lea    0xea6(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @srand(i32 1)
store i32 1, i32* %2
br label %4
4: ; preds = %9, %0
%5 = load i32, i32* %2
%6 = icmp sle i32 %5, 343
br i1 %6, label %7, label %12
7: ; preds = %4
%8 = call i64 (...) @rand()
br label %9
9: ; preds = %7
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %4
12: ; preds = %4
store i32 344, i32* %2
br label %13
13: ; preds = %20, %12
%14 = load i32, i32* %2
%15 = icmp sle i32 %14, 350
br i1 %15, label %16, label %23
16: ; preds = %13
%17 = call i64 (...) @rand()
%18 = trunc i64 %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %20
20: ; preds = %16
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %13
23: ; preds = %13
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @srand(i32 1)
br label %2
2: ; preds = %0, %2
%3 = phi i32 [ 1, %0 ], [ %5, %2 ]
%4 = tail call i64 (...) @rand()
%5 = add nuw nsw i32 %3, 1
%6 = icmp eq i32 %5, 344
br i1 %6, label %7, label %2
7: ; preds = %2
%8 = tail call i64 (...) @rand()
%9 = trunc i64 %8 to i32
%10 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = tail call i64 (...) @rand()
%12 = trunc i64 %11 to i32
%13 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = tail call i64 (...) @rand()
%15 = trunc i64 %14 to i32
%16 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = tail call i64 (...) @rand()
%18 = trunc i64 %17 to i32
%19 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %18)
%20 = tail call i64 (...) @rand()
%21 = trunc i64 %20 to i32
%22 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %21)
%23 = tail call i64 (...) @rand()
%24 = trunc i64 %23 to i32
%25 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %24)
%26 = tail call i64 (...) @rand()
%27 = trunc i64 %26 to i32
%28 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %27)
ret i32 0
}