#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 *, ...);
scalar_t__ random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i;
  unsigned int r;
  srandom(time(0));
  printf(".set mips64\n");
  printf(".set noreorder\n");
  printf(".set nobopt\n");
  printf(".set noat\n");
  printf("\n");
  printf("\t\t.text\n");
  printf("\t\t.global start\n");
  printf("\t\t.ent start\n");
  printf("start:\n");
  printf("\t\tmfc0 $t0, $12\n");
  printf("\t\tli $t1, 1 << 29\n");
  printf("\t\tor $t0, $t0, $t1\n");
  printf("\t\tmtc0 $t0, $12\n");
  printf("\t\tnop\n");
  printf("\t\tnop\n");
  printf("\t\tnop\n");
  for (i = 0; i < 1024; i++) {
    r = (unsigned int)random();
    r = r & 0x00bfffff;
    r = r | 0x46000000;
    printf("\t\t.word 0x%08x\n", r);
  }
  printf("\t\tmtc0 $at, $26\n");
  printf("\t\tnop\n");
  printf("\t\tnop\n");
  printf("\t\tmtc0 $at, $23\n");
  printf("end:\n");
  printf("\t\tb end\n");
  printf("\t\tnop\n");
  printf(".end start\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xef8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1297 <main+0x157>
mov    $0x0,%al
call   1060 <random@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0xbfffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     $0x46000000,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    124b <main+0x10b>
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe02(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe11(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdf6(%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   %rbx
push   %rax
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1040 <srandom@plt>
lea    0xe98(%rip),%rdi
call   1050 <puts@plt>
lea    0xe98(%rip),%rdi
call   1050 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1050 <puts@plt>
lea    0xe9b(%rip),%rdi
call   1050 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe8f(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1050 <puts@plt>
lea    0xe90(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8b(%rip),%rdi
call   1050 <puts@plt>
lea    0xe8f(%rip),%rdi
call   1050 <puts@plt>
lea    0xe95(%rip),%rdi
call   1050 <puts@plt>
lea    0xe9c(%rip),%rdi
call   1050 <puts@plt>
lea    0xecd(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    $0x400,%ebp
lea    0xdca(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1080 <random@plt>
and    $0xbfffff,%eax
lea    0x46000000(%rax),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0xffffffff,%ebp
jne    1240 <main+0xe0>
lea    0xe4a(%rip),%rdi
call   1050 <puts@plt>
lea    0xe6b(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe37(%rip),%rdi
call   1050 <puts@plt>
lea    0xe3b(%rip),%rdi
call   1050 <puts@plt>
lea    0xe34(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xe2e(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c".set mips64\0A\00"
@.str.1 = [16 x i8] c".set noreorder\0A\00"
@.str.2 = [13 x i8] c".set nobopt\0A\00"
@.str.3 = [11 x i8] c".set noat\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [9 x i8] c"\09\09.text\0A\00"
@.str.6 = [17 x i8] c"\09\09.global start\0A\00"
@.str.7 = [14 x i8] c"\09\09.ent start\0A\00"
@.str.8 = [8 x i8] c"start:\0A\00"
@.str.9 = [17 x i8] c"\09\09mfc0 $t0, $12\0A\00"
@.str.10 = [19 x i8] c"\09\09li $t1, 1 << 29\0A\00"
@.str.11 = [20 x i8] c"\09\09or $t0, $t0, $t1\0A\00"
@.str.12 = [17 x i8] c"\09\09mtc0 $t0, $12\0A\00"
@.str.13 = [7 x i8] c"\09\09nop\0A\00"
@.str.14 = [16 x i8] c"\09\09.word 0x%08x\0A\00"
@.str.15 = [17 x i8] c"\09\09mtc0 $at, $26\0A\00"
@.str.16 = [17 x i8] c"\09\09mtc0 $at, $23\0A\00"
@.str.17 = [6 x i8] c"end:\0A\00"
@.str.18 = [9 x i8] c"\09\09b end\0A\00"
@.str.19 = [12 x i8] c".end start\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @time(i32 0)
%9 = call i32 @srandom(i32 %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.9, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.11, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %6
br label %26
26: ; preds = %38, %2
%27 = load i32, i32* %6
%28 = icmp slt i32 %27, 1024
br i1 %28, label %29, label %41
29: ; preds = %26
%30 = call i64 (...) @random()
%31 = trunc i64 %30 to i32
store i32 %31, i32* %7
%32 = load i32, i32* %7
%33 = and i32 %32, 12582911
store i32 %33, i32* %7
%34 = load i32, i32* %7
%35 = or i32 %34, 1174405120
store i32 %35, i32* %7
%36 = load i32, i32* %7
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %29
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %26
41: ; preds = %26
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.15, i64 0, i64 0))
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.16, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.17, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.19, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.14 = [16 x i8] c"\09\09.word 0x%08x\0A\00"
@str = [12 x i8] c".set mips64\00"
@str.20 = [15 x i8] c".set noreorder\00"
@str.21 = [12 x i8] c".set nobopt\00"
@str.22 = [10 x i8] c".set noat\00"
@str.23 = [8 x i8] c"\09\09.text\00"
@str.24 = [16 x i8] c"\09\09.global start\00"
@str.25 = [13 x i8] c"\09\09.ent start\00"
@str.26 = [7 x i8] c"start:\00"
@str.27 = [16 x i8] c"\09\09mfc0 $t0, $12\00"
@str.28 = [18 x i8] c"\09\09li $t1, 1 << 29\00"
@str.29 = [19 x i8] c"\09\09or $t0, $t0, $t1\00"
@str.30 = [16 x i8] c"\09\09mtc0 $t0, $12\00"
@str.34 = [16 x i8] c"\09\09mtc0 $at, $26\00"
@str.37 = [16 x i8] c"\09\09mtc0 $at, $23\00"
@str.38 = [5 x i8] c"end:\00"
@str.39 = [8 x i8] c"\09\09b end\00"
@str.40 = [6 x i8] c"\09\09nop\00"
@str.41 = [11 x i8] c".end start\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @time(i32 0)
%4 = tail call i32 @srandom(i32 %3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.20, i64 0, i64 0))
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.21, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.22, i64 0, i64 0))
%9 = tail call i32 @putchar(i32 10)
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.23, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.24, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.25, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.26, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.27, i64 0, i64 0))
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.28, i64 0, i64 0))
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.29, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.30, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.40, i64 0, i64 0))
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.40, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.40, i64 0, i64 0))
br label %21
21: ; preds = %2, %21
%22 = phi i32 [ 0, %2 ], [ %28, %21 ]
%23 = tail call i64 (...) @random()
%24 = trunc i64 %23 to i32
%25 = and i32 %24, 12582911
%26 = or i32 %25, 1174405120
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 %26)
%28 = add nuw nsw i32 %22, 1
%29 = icmp eq i32 %28, 1024
br i1 %29, label %30, label %21
30: ; preds = %21
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.34, i64 0, i64 0))
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.40, i64 0, i64 0))
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.40, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.37, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.38, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.39, i64 0, i64 0))
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.40, i64 0, i64 0))
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.41, i64 0, i64 0))
ret i32 0
}