#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, int, int);
int random();
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/);
int main(int argc, char **argv) {
  int i, j;
  int valors[10][10];
  int f[10 * 10];
  int c[10 * 10];
  int compt = 0;
  srandom(time(0));
  for (i = 0; i < 10; i++)
    for (j = 0; j < 10; j++)
      if ((valors[i][j] = random() % 10) == 0) {
        f[compt] = i;
        c[compt++] = j;
      }
  for (i = 0; i < compt; i++)
    printf("%2d\t%2d\n", f[i] + 1, c[i] + 1);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4e0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x4d4(%rbp)
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0xa,-0x14(%rbp)
jge    1218 <main+0xd8>
movl   $0x0,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jge    1205 <main+0xc5>
mov    $0x0,%al
call   1060 <random@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
movslq -0x14(%rbp),%rcx
lea    -0x1b0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
cmp    $0x0,%edx
jne    11f2 <main+0xb2>
mov    -0x14(%rbp),%ecx
movslq -0x4d4(%rbp),%rax
mov    %ecx,-0x340(%rbp,%rax,4)
mov    -0x18(%rbp),%ecx
mov    -0x4d4(%rbp),%eax
mov    %eax,%edx
add    $0x1,%edx
mov    %edx,-0x4d4(%rbp)
cltq
mov    %ecx,-0x4d0(%rbp,%rax,4)
jmp    11f7 <main+0xb7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1189 <main+0x49>
jmp    120a <main+0xca>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1178 <main+0x38>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4d4(%rbp),%eax
jge    1264 <main+0x124>
movslq -0x14(%rbp),%rax
mov    -0x340(%rbp,%rax,4),%esi
add    $0x1,%esi
movslq -0x14(%rbp),%rax
mov    -0x4d0(%rbp,%rax,4),%edx
add    $0x1,%edx
lea    0xdaf(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    121f <main+0xdf>
mov    0x2d75(%rip),%rax
mov    (%rax),%eax
add    $0x4e0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x320,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1030 <srandom@plt>
xor    %ebx,%ebx
xor    %r14d,%r14d
jmp    116a <main+0x2a>
add    $0x1,%r14d
cmp    $0xa,%r14d
je     11a6 <main+0x66>
xor    %ebp,%ebp
jmp    1178 <main+0x38>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0xa,%ebp
je     1160 <main+0x20>
xor    %eax,%eax
call   1060 <random@plt>
imul   $0xcccccccd,%eax,%eax
add    $0x19999998,%eax
ror    %eax
cmp    $0x19999998,%eax
ja     1170 <main+0x30>
movslq %ebx,%rax
mov    %r14d,0x190(%rsp,%rax,4)
lea    0x1(%rax),%ebx
mov    %ebp,(%rsp,%rax,4)
jmp    1170 <main+0x30>
test   %ebx,%ebx
jle    11e1 <main+0xa1>
mov    %ebx,%ebp
xor    %ebx,%ebx
lea    0xe4b(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x190(%rsp,%rbx,4),%esi
add    $0x1,%esi
mov    (%rsp,%rbx,4),%edx
add    $0x1,%edx
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11c0 <main+0x80>
mov    0x2df8(%rip),%rax
mov    (%rax),%eax
add    $0x320,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"%2d\09%2d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i32]
%4 = alloca [100 x i32]
%5 = bitcast [100 x i32]* %3 to i8*
%6 = bitcast [100 x i32]* %4 to i8*
%7 = tail call i32 @time(i32 0)
%8 = tail call i32 @srandom(i32 %7)
br label %9
9: ; preds = %2, %31
%10 = phi i32 [ 0, %2 ], [ %28, %31 ]
%11 = phi i32 [ 0, %2 ], [ %32, %31 ]
br label %16
12: ; preds = %31
%13 = icmp sgt i32 %28, 0
br i1 %13, label %14, label %45
14: ; preds = %12
%15 = zext i32 %28 to i64
br label %34
16: ; preds = %9, %27
%17 = phi i32 [ %10, %9 ], [ %28, %27 ]
%18 = phi i32 [ 0, %9 ], [ %29, %27 ]
%19 = tail call i32 (...) @random()
%20 = srem i32 %19, 10
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %27
22: ; preds = %16
%23 = sext i32 %17 to i64
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %23
store i32 %11, i32* %24
%25 = add nsw i32 %17, 1
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %23
store i32 %18, i32* %26
br label %27
27: ; preds = %16, %22
%28 = phi i32 [ %25, %22 ], [ %17, %16 ]
%29 = add nuw nsw i32 %18, 1
%30 = icmp eq i32 %29, 10
br i1 %30, label %31, label %16
31: ; preds = %27
%32 = add nuw nsw i32 %11, 1
%33 = icmp eq i32 %32, 10
br i1 %33, label %12, label %9
34: ; preds = %14, %34
%35 = phi i64 [ 0, %14 ], [ %43, %34 ]
%36 = getelementptr inbounds [100 x i32], [100 x i32]* %3, i64 0, i64 %35
%37 = load i32, i32* %36
%38 = add nsw i32 %37, 1
%39 = getelementptr inbounds [100 x i32], [100 x i32]* %4, i64 0, i64 %35
%40 = load i32, i32* %39
%41 = add nsw i32 %40, 1
%42 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %41)
%43 = add nuw nsw i64 %35, 1
%44 = icmp eq i64 %43, %15
br i1 %44, label %45, label %34
45: ; preds = %34, %12
%46 = load i32, i32* @EXIT_SUCCESS
ret i32 %46
}