#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*/ a(int);
int main(void) {
  size_t pi, qi, ri;
  int p[10], q[10], r[10];
  for (pi = 0; pi < 10; pi += 1)
    for (qi = 0; qi < 10; qi += 1)
      for (ri = 0; ri < 10; ri += 1)
        a(p[pi] + q[qi] + r[ri]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
cmpq   $0xa,-0x10(%rbp)
jae    11b8 <main+0xa8>
movq   $0x0,-0x18(%rbp)
cmpq   $0xa,-0x18(%rbp)
jae    11a2 <main+0x92>
movq   $0x0,-0x20(%rbp)
cmpq   $0xa,-0x20(%rbp)
jae    118c <main+0x7c>
mov    -0x10(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%edi
mov    -0x18(%rbp),%rax
add    -0x80(%rbp,%rax,4),%edi
mov    -0x20(%rbp),%rax
add    -0xb0(%rbp,%rax,4),%edi
call   1030 <a@plt>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1150 <main+0x40>
jmp    1191 <main+0x81>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    113d <main+0x2d>
jmp    11a7 <main+0x97>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112a <main+0x1a>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
nopw   0x0(%rax,%rax,1)
mov    $0xa,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
call   1030 <a@plt>
add    $0xffffffffffffffff,%rbx
jne    1130 <main+0x20>
add    $0x1,%r14
cmp    $0xa,%r14
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca [10 x i32]
%6 = alloca [10 x i32]
%7 = alloca [10 x i32]
store i32 0, i32* %1
store i64 0, i64* %2
br label %8
8: ; preds = %40, %0
%9 = load i64, i64* %2
%10 = icmp ult i64 %9, 10
br i1 %10, label %11, label %43
11: ; preds = %8
store i64 0, i64* %3
br label %12
12: ; preds = %36, %11
%13 = load i64, i64* %3
%14 = icmp ult i64 %13, 10
br i1 %14, label %15, label %39
15: ; preds = %12
store i64 0, i64* %4
br label %16
16: ; preds = %32, %15
%17 = load i64, i64* %4
%18 = icmp ult i64 %17, 10
br i1 %18, label %19, label %35
19: ; preds = %16
%20 = load i64, i64* %2
%21 = getelementptr inbounds [10 x i32], [10 x i32]* %5, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = load i64, i64* %3
%24 = getelementptr inbounds [10 x i32], [10 x i32]* %6, i64 0, i64 %23
%25 = load i32, i32* %24
%26 = add nsw i32 %22, %25
%27 = load i64, i64* %4
%28 = getelementptr inbounds [10 x i32], [10 x i32]* %7, i64 0, i64 %27
%29 = load i32, i32* %28
%30 = add nsw i32 %26, %29
%31 = call i32 @a(i32 %30)
br label %32
32: ; preds = %19
%33 = load i64, i64* %4
%34 = add i64 %33, 1
store i64 %34, i64* %4
br label %16
35: ; preds = %16
br label %36
36: ; preds = %35
%37 = load i64, i64* %3
%38 = add i64 %37, 1
store i64 %38, i64* %3
br label %12
39: ; preds = %12
br label %40
40: ; preds = %39
%41 = load i64, i64* %2
%42 = add i64 %41, 1
store i64 %42, i64* %2
br label %8
43: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
br label %1
1: ; preds = %0, %17
%2 = phi i64 [ 0, %0 ], [ %18, %17 ]
br label %3
3: ; preds = %1, %3
%4 = phi i64 [ 0, %1 ], [ %15, %3 ]
%5 = tail call i32 @a(i32 undef)
%6 = tail call i32 @a(i32 undef)
%7 = tail call i32 @a(i32 undef)
%8 = tail call i32 @a(i32 undef)
%9 = tail call i32 @a(i32 undef)
%10 = tail call i32 @a(i32 undef)
%11 = tail call i32 @a(i32 undef)
%12 = tail call i32 @a(i32 undef)
%13 = tail call i32 @a(i32 undef)
%14 = tail call i32 @a(i32 undef)
%15 = add nuw nsw i64 %4, 1
%16 = icmp eq i64 %15, 10
br i1 %16, label %17, label %3
17: ; preds = %3
%18 = add nuw nsw i64 %2, 1
%19 = icmp eq i64 %18, 10
br i1 %19, label %20, label %1
20: ; preds = %17
ret i32 0
}