#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 rand();
void PrintRandoms(int lower, int upper, int count) {
  int i, j, k;
  int mat[9][9], num = 0;
  for (j = 0; j < 9; j++) {
    for (k = 0; k < 9; k++) {
      num = (rand() % (upper - lower + 1)) + lower;
      if (num == mat[j][k]) {
        mat[j][k] = num;
      }
    }
  }
  for (j = 0; j < 9; j++) {
    for (k = 0; k < 9; k++) {
      printf("%d\t", mat[j][k]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<PrintRandoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x164(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    11e6 <PrintRandoms+0xc6>
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jge    11d3 <PrintRandoms+0xb3>
mov    $0x0,%al
call   1040 <rand@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
cltd
idiv   %ecx
add    -0x4(%rbp),%edx
mov    %edx,-0x164(%rbp)
mov    -0x164(%rbp),%eax
movslq -0x14(%rbp),%rdx
lea    -0x160(%rbp),%rcx
imul   $0x24,%rdx,%rdx
add    %rdx,%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
jne    11c0 <PrintRandoms+0xa0>
mov    -0x164(%rbp),%edx
movslq -0x14(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
jmp    11c5 <PrintRandoms+0xa5>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1156 <PrintRandoms+0x36>
jmp    11d8 <PrintRandoms+0xb8>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1145 <PrintRandoms+0x25>
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jge    1259 <PrintRandoms+0x139>
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jge    123d <PrintRandoms+0x11d>
movslq -0x14(%rbp),%rcx
lea    -0x160(%rbp),%rax
imul   $0x24,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11fe <PrintRandoms+0xde>
lea    0xdc0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ed <PrintRandoms+0xcd>
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintRandoms>:
push   %r14
push   %rbx
sub    $0x148,%rsp
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
xor    %eax,%eax
call   1050 <rand@plt>
mov    $0x20,%ebx
lea    0xc83(%rip),%r14
nopl   (%rax)
mov    -0x20(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x1c(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x18(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x14(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x10(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0xc(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x8(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    -0x4(%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rsp,%rbx,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x24,%rbx
cmp    $0x164,%rbx
jne    1380 <PrintRandoms+0x250>
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\09\00"
define void @PrintRandoms(i32 %0, i32 %1, i32 %2) {
%4 = alloca [9 x [9 x i32]]
%5 = bitcast [9 x [9 x i32]]* %4 to i8*
%6 = tail call i32 (...) @rand()
%7 = tail call i32 (...) @rand()
%8 = tail call i32 (...) @rand()
%9 = tail call i32 (...) @rand()
%10 = tail call i32 (...) @rand()
%11 = tail call i32 (...) @rand()
%12 = tail call i32 (...) @rand()
%13 = tail call i32 (...) @rand()
%14 = tail call i32 (...) @rand()
%15 = tail call i32 (...) @rand()
%16 = tail call i32 (...) @rand()
%17 = tail call i32 (...) @rand()
%18 = tail call i32 (...) @rand()
%19 = tail call i32 (...) @rand()
%20 = tail call i32 (...) @rand()
%21 = tail call i32 (...) @rand()
%22 = tail call i32 (...) @rand()
%23 = tail call i32 (...) @rand()
%24 = tail call i32 (...) @rand()
%25 = tail call i32 (...) @rand()
%26 = tail call i32 (...) @rand()
%27 = tail call i32 (...) @rand()
%28 = tail call i32 (...) @rand()
%29 = tail call i32 (...) @rand()
%30 = tail call i32 (...) @rand()
%31 = tail call i32 (...) @rand()
%32 = tail call i32 (...) @rand()
%33 = tail call i32 (...) @rand()
%34 = tail call i32 (...) @rand()
%35 = tail call i32 (...) @rand()
%36 = tail call i32 (...) @rand()
%37 = tail call i32 (...) @rand()
%38 = tail call i32 (...) @rand()
%39 = tail call i32 (...) @rand()
%40 = tail call i32 (...) @rand()
%41 = tail call i32 (...) @rand()
%42 = tail call i32 (...) @rand()
%43 = tail call i32 (...) @rand()
%44 = tail call i32 (...) @rand()
%45 = tail call i32 (...) @rand()
%46 = tail call i32 (...) @rand()
%47 = tail call i32 (...) @rand()
%48 = tail call i32 (...) @rand()
%49 = tail call i32 (...) @rand()
%50 = tail call i32 (...) @rand()
%51 = tail call i32 (...) @rand()
%52 = tail call i32 (...) @rand()
%53 = tail call i32 (...) @rand()
%54 = tail call i32 (...) @rand()
%55 = tail call i32 (...) @rand()
%56 = tail call i32 (...) @rand()
%57 = tail call i32 (...) @rand()
%58 = tail call i32 (...) @rand()
%59 = tail call i32 (...) @rand()
%60 = tail call i32 (...) @rand()
%61 = tail call i32 (...) @rand()
%62 = tail call i32 (...) @rand()
%63 = tail call i32 (...) @rand()
%64 = tail call i32 (...) @rand()
%65 = tail call i32 (...) @rand()
%66 = tail call i32 (...) @rand()
%67 = tail call i32 (...) @rand()
%68 = tail call i32 (...) @rand()
%69 = tail call i32 (...) @rand()
%70 = tail call i32 (...) @rand()
%71 = tail call i32 (...) @rand()
%72 = tail call i32 (...) @rand()
%73 = tail call i32 (...) @rand()
%74 = tail call i32 (...) @rand()
%75 = tail call i32 (...) @rand()
%76 = tail call i32 (...) @rand()
%77 = tail call i32 (...) @rand()
%78 = tail call i32 (...) @rand()
%79 = tail call i32 (...) @rand()
%80 = tail call i32 (...) @rand()
%81 = tail call i32 (...) @rand()
%82 = tail call i32 (...) @rand()
%83 = tail call i32 (...) @rand()
%84 = tail call i32 (...) @rand()
%85 = tail call i32 (...) @rand()
%86 = tail call i32 (...) @rand()
br label %87
87: ; preds = %3, %87
%88 = phi i64 [ 0, %3 ], [ %117, %87 ]
%89 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 0
%90 = load i32, i32* %89
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %90)
%92 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 1
%93 = load i32, i32* %92
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %93)
%95 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 2
%96 = load i32, i32* %95
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %96)
%98 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 3
%99 = load i32, i32* %98
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %99)
%101 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 4
%102 = load i32, i32* %101
%103 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %102)
%104 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 5
%105 = load i32, i32* %104
%106 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %105)
%107 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 6
%108 = load i32, i32* %107
%109 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %108)
%110 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 7
%111 = load i32, i32* %110
%112 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %111)
%113 = getelementptr inbounds [9 x [9 x i32]], [9 x [9 x i32]]* %4, i64 0, i64 %88, i64 8
%114 = load i32, i32* %113
%115 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %114)
%116 = tail call i32 @putchar(i32 10)
%117 = add nuw nsw i64 %88, 1
%118 = icmp eq i64 %117, 9
br i1 %118, label %119, label %87
119: ; preds = %87
ret void
}