#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*/ printBothOpen(char *, char *, char *, double);
void printRatesRest(int n, double *r, char **names) {
  int i, j, c;
  for (i = 0, c = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      printBothOpen("rate %s <-> %s: %f\n", names[i], names[j], r[c]);
      c++;
    }
  }
}


x86 assembly (clang, -O0):
<printRatesRest>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ad <printRatesRest+0x9d>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    119a <printRatesRest+0x8a>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xe82(%rip),%rdi
call   1030 <printBothOpen@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1146 <printRatesRest+0x36>
jmp    119f <printRatesRest+0x8f>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1131 <printRatesRest+0x21>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printRatesRest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,0x10(%rsp)
test   %edi,%edi
jle    11cd <printRatesRest+0xbd>
mov    %rdx,%r15
mov    %edi,%eax
lea    0x8(%rdx),%rdi
lea    -0x1(%rax),%r14
xor    %ecx,%ecx
lea    0xebf(%rip),%r13
xor    %ebp,%ebp
mov    %rax,0x8(%rsp)
jmp    115d <printRatesRest+0x4d>
nopw   0x0(%rax,%rax,1)
add    $0x8,%rdi
add    $0xffffffffffffffff,%r14
cmp    %rax,%rcx
je     11cd <printRatesRest+0xbd>
mov    %rcx,%rbx
add    $0x1,%rcx
cmp    %rax,%rcx
jae    1150 <printRatesRest+0x40>
mov    %rcx,0x18(%rsp)
mov    %ebp,0x4(%rsp)
movslq %ebp,%rax
mov    0x10(%rsp),%rcx
lea    (%rcx,%rax,8),%rax
mov    %rax,0x20(%rsp)
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rsi
mov    (%rdi,%r12,8),%rdx
mov    0x20(%rsp),%rax
movsd  (%rax,%r12,8),%xmm0
mov    %rdi,%rbp
mov    %r13,%rdi
call   1030 <printBothOpen@plt>
mov    %rbp,%rdi
add    $0x1,%r12
cmp    %r12,%r14
jne    1190 <printRatesRest+0x80>
mov    0x4(%rsp),%ebp
add    %r12d,%ebp
mov    0x8(%rsp),%rax
mov    0x18(%rsp),%rcx
jmp    1150 <printRatesRest+0x40>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"rate %s <-> %s: %f\0A\00"
define void @printRatesRest(i32 %0, double* %1, i8** %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %4
store double* %1, double** %5
store i8** %2, i8*** %6
store i32 0, i32* %7
store i32 0, i32* %9
br label %10
10: ; preds = %44, %3
%11 = load i32, i32* %7
%12 = load i32, i32* %4
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %47
14: ; preds = %10
%15 = load i32, i32* %7
%16 = add nsw i32 %15, 1
store i32 %16, i32* %8
br label %17
17: ; preds = %40, %14
%18 = load i32, i32* %8
%19 = load i32, i32* %4
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %43
21: ; preds = %17
%22 = load i8**, i8*** %6
%23 = load i32, i32* %7
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i8*, i8** %22, i64 %24
%26 = load i8*, i8** %25
%27 = load i8**, i8*** %6
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = load double*, double** %5
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds double, double* %32, i64 %34
%36 = load double, double* %35
%37 = call i32 @printBothOpen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %26, i8* %31, double %36)
%38 = load i32, i32* %9
%39 = add nsw i32 %38, 1
store i32 %39, i32* %9
br label %40
40: ; preds = %21
%41 = load i32, i32* %8
%42 = add nsw i32 %41, 1
store i32 %42, i32* %8
br label %17
43: ; preds = %17
br label %44
44: ; preds = %43
%45 = load i32, i32* %7
%46 = add nsw i32 %45, 1
store i32 %46, i32* %7
br label %10
47: ; preds = %10
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"rate %s <-> %s: %f\0A\00"
define void @printRatesRest(i32 %0, double* nocapture %1, i8** nocapture %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %35
5: ; preds = %3
%6 = zext i32 %0 to i64
%7 = zext i32 %0 to i64
br label %14
8: ; preds = %23
%9 = trunc i64 %32 to i32
br label %10
10: ; preds = %8, %14
%11 = phi i32 [ %17, %14 ], [ %9, %8 ]
%12 = add nuw nsw i64 %16, 1
%13 = icmp eq i64 %18, %7
br i1 %13, label %35, label %14
14: ; preds = %5, %10
%15 = phi i64 [ 0, %5 ], [ %18, %10 ]
%16 = phi i64 [ 1, %5 ], [ %12, %10 ]
%17 = phi i32 [ 0, %5 ], [ %11, %10 ]
%18 = add nuw nsw i64 %15, 1
%19 = icmp ult i64 %18, %6
br i1 %19, label %20, label %10
20: ; preds = %14
%21 = getelementptr inbounds i8*, i8** %2, i64 %15
%22 = sext i32 %17 to i64
br label %23
23: ; preds = %20, %23
%24 = phi i64 [ %16, %20 ], [ %33, %23 ]
%25 = phi i64 [ %22, %20 ], [ %32, %23 ]
%26 = load i8*, i8** %21
%27 = getelementptr inbounds i8*, i8** %2, i64 %24
%28 = load i8*, i8** %27
%29 = getelementptr inbounds double, double* %1, i64 %25
%30 = load double, double* %29
%31 = tail call i32 @printBothOpen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* %26, i8* %28, double %30)
%32 = add nsw i64 %25, 1
%33 = add nuw nsw i64 %24, 1
%34 = icmp eq i64 %33, %7
br i1 %34, label %8, label %23
35: ; preds = %10, %3
ret void
}