#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 transformToDominant(int, int /*<<< orphan*/, double **, double *, int *,
                        int *);
int makeDominant(int m, double M[m][m], double N[m]) {
  int i;
  int visited[m];
  for (i = 0; i < m; ++i)
    visited[i] = 0;
  int rows[m];
  return transformToDominant(m, 0, M, N, visited, rows);
}


x86 assembly (clang, -O0):
<makeDominant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117a <makeDominant+0x6a>
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1151 <makeDominant+0x41>
mov    -0x40(%rbp),%r8
mov    -0x4(%rbp),%eax
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%r9
sub    %rcx,%r9
mov    %r9,%rsp
mov    %rax,-0x38(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %esi,%esi
call   1030 <transformToDominant@plt>
mov    -0x28(%rbp),%rcx
mov    %rcx,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<makeDominant>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%r12d
mov    %edi,%edx
mov    %rsp,%r13
lea    0xf(,%rdx,4),%rbx
and    $0xfffffffffffffff0,%rbx
sub    %rbx,%r13
mov    %r13,%rsp
test   %edi,%edi
jle    1160 <makeDominant+0x40>
shl    $0x2,%rdx
mov    %r13,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %rsp,%r9
sub    %rbx,%r9
mov    %r9,%rsp
mov    %r12d,%edi
xor    %esi,%esi
mov    %r15,%rdx
mov    %r14,%rcx
mov    %r13,%r8
call   1040 <transformToDominant@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @makeDominant(i32 %0, double* %1, double* %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i64
store i32 %0, i32* %4
store double* %1, double** %5
store double* %2, double** %6
%11 = load i32, i32* %4
%12 = zext i32 %11 to i64
%13 = load i32, i32* %4
%14 = zext i32 %13 to i64
%15 = load i32, i32* %4
%16 = zext i32 %15 to i64
%17 = load i32, i32* %4
%18 = zext i32 %17 to i64
%19 = call i8* @llvm.stacksave()
store i8* %19, i8** %8
%20 = alloca i32, i64 %18
store i64 %18, i64* %9
store i32 0, i32* %7
br label %21
21: ; preds = %29, %3
%22 = load i32, i32* %7
%23 = load i32, i32* %4
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %32
25: ; preds = %21
%26 = load i32, i32* %7
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds i32, i32* %20, i64 %27
store i32 0, i32* %28
br label %29
29: ; preds = %25
%30 = load i32, i32* %7
%31 = add nsw i32 %30, 1
store i32 %31, i32* %7
br label %21
32: ; preds = %21
%33 = load i32, i32* %4
%34 = zext i32 %33 to i64
%35 = alloca i32, i64 %34
store i64 %34, i64* %10
%36 = load i32, i32* %4
%37 = load double*, double** %5
%38 = bitcast double* %37 to double**
%39 = load double*, double** %6
%40 = call i32 @transformToDominant(i32 %36, i32 0, double** %38, double* %39, i32* %20, i32* %35)
%41 = load i8*, i8** %8
ret i32 %40
}

LLVM IR (-O2):
define i32 @makeDominant(i32 %0, double* %1, double* %2) {
%4 = zext i32 %0 to i64
%5 = alloca i32, i64 %4
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %10
7: ; preds = %3
%8 = bitcast i32* %5 to i8*
%9 = shl nuw nsw i64 %4, 2
br label %10
10: ; preds = %7, %3
%11 = alloca i32, i64 %4
%12 = bitcast double* %1 to double**
%13 = call i32 @transformToDominant(i32 %0, i32 0, double** %12, double* %2, i32* %5, i32* %11)
ret i32 %13
}