#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 *, ...);
void outgraph(int orignode1[700], int orignode2[700], int connected[700][700],
              int m, int n) {
  int i, j;
  printf("\nConnected component: ");
  printf("%d columns of right hand side nodes are\n       ", n);
  for (j = 0; j < n; j++)
    printf("%d ", orignode2[j]);
  printf("\nincidence matrix with %d rows:\n", m);
  for (i = 0; i < m; i++) {
    printf("%5d:", orignode1[i]);
    for (j = 0; j < n; j++)
      printf("%2d", connected[i][j]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<outgraph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1184 <outgraph+0x74>
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1151 <outgraph+0x41>
mov    -0x1c(%rbp),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1225 <outgraph+0x115>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1209 <outgraph+0xf9>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   $0xaf0,%rcx,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11c8 <outgraph+0xb8>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119c <outgraph+0x8c>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outgraph>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%ebp
mov    %ecx,%r12d
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,0x10(%rsp)
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%r15d
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
jle    1197 <outgraph+0x77>
lea    0xed8(%rip),%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbp,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1180 <outgraph+0x60>
lea    0xead(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r12d,%r12d
jle    1219 <outgraph+0xf9>
mov    %r12d,%r13d
lea    0xeba(%rip),%rbp
xor    %r14d,%r14d
jmp    11da <outgraph+0xba>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0xaf0,%rbx
cmp    %r13,%r14
je     1219 <outgraph+0xf9>
mov    0x10(%rsp),%rax
mov    (%rax,%r14,4),%esi
lea    0xe82(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11c0 <outgraph+0xa0>
xor    %r12d,%r12d
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r12,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r15
jne    1200 <outgraph+0xe0>
jmp    11c0 <outgraph+0xa0>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0AConnected component: \00"
@.str.1 = [48 x i8] c"%d columns of right hand side nodes are\0A \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [33 x i8] c"\0Aincidence matrix with %d rows:\0A\00"
@.str.4 = [5 x i8] c"%5d:\00"
@.str.5 = [4 x i8] c"%2d\00"
@.str.6 = [2 x i8] c"\0A\00"
define void @outgraph(i32* %0, i32* %1, [700 x i32]* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [700 x i32]*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store [700 x i32]* %2, [700 x i32]** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* %10
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %14)
store i32 0, i32* %12
br label %16
16: ; preds = %27, %5
%17 = load i32, i32* %12
%18 = load i32, i32* %10
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %30
20: ; preds = %16
%21 = load i32*, i32** %7
%22 = load i32, i32* %12
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %21, i64 %23
%25 = load i32, i32* %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %25)
br label %27
27: ; preds = %20
%28 = load i32, i32* %12
%29 = add nsw i32 %28, 1
store i32 %29, i32* %12
br label %16
30: ; preds = %16
%31 = load i32, i32* %9
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %31)
store i32 0, i32* %11
br label %33
33: ; preds = %63, %30
%34 = load i32, i32* %11
%35 = load i32, i32* %9
%36 = icmp slt i32 %34, %35
br i1 %36, label %37, label %66
37: ; preds = %33
%38 = load i32*, i32** %6
%39 = load i32, i32* %11
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds i32, i32* %38, i64 %40
%42 = load i32, i32* %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %42)
store i32 0, i32* %12
br label %44
44: ; preds = %58, %37
%45 = load i32, i32* %12
%46 = load i32, i32* %10
%47 = icmp slt i32 %45, %46
br i1 %47, label %48, label %61
48: ; preds = %44
%49 = load [700 x i32]*, [700 x i32]** %8
%50 = load i32, i32* %11
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [700 x i32], [700 x i32]* %49, i64 %51
%53 = load i32, i32* %12
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [700 x i32], [700 x i32]* %52, i64 0, i64 %54
%56 = load i32, i32* %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %56)
br label %58
58: ; preds = %48
%59 = load i32, i32* %12
%60 = add nsw i32 %59, 1
store i32 %60, i32* %12
br label %44
61: ; preds = %44
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
br label %63
63: ; preds = %61
%64 = load i32, i32* %11
%65 = add nsw i32 %64, 1
store i32 %65, i32* %11
br label %33
66: ; preds = %33
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0AConnected component: \00"
@.str.1 = [48 x i8] c"%d columns of right hand side nodes are\0A \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [33 x i8] c"\0Aincidence matrix with %d rows:\0A\00"
@.str.4 = [5 x i8] c"%5d:\00"
@.str.5 = [4 x i8] c"%2d\00"
define void @outgraph(i32* nocapture %0, i32* nocapture %1, [700 x i32]* nocapture %2, i32 %3, i32 %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%8 = icmp sgt i32 %4, 0
br i1 %8, label %9, label %18
9: ; preds = %5
%10 = zext i32 %4 to i64
br label %11
11: ; preds = %9, %11
%12 = phi i64 [ 0, %9 ], [ %16, %11 ]
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = load i32, i32* %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %14)
%16 = add nuw nsw i64 %12, 1
%17 = icmp eq i64 %16, %10
br i1 %17, label %18, label %11
18: ; preds = %11, %5
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%20 = icmp sgt i32 %3, 0
br i1 %20, label %21, label %40
21: ; preds = %18
%22 = zext i32 %3 to i64
%23 = zext i32 %4 to i64
br label %24
24: ; preds = %21, %36
%25 = phi i64 [ 0, %21 ], [ %38, %36 ]
%26 = getelementptr inbounds i32, i32* %0, i64 %25
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %27)
br i1 %8, label %29, label %36
29: ; preds = %24, %29
%30 = phi i64 [ %34, %29 ], [ 0, %24 ]
%31 = getelementptr inbounds [700 x i32], [700 x i32]* %2, i64 %25, i64 %30
%32 = load i32, i32* %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 %32)
%34 = add nuw nsw i64 %30, 1
%35 = icmp eq i64 %34, %23
br i1 %35, label %36, label %29
36: ; preds = %29, %24
%37 = tail call i32 @putchar(i32 10)
%38 = add nuw nsw i64 %25, 1
%39 = icmp eq i64 %38, %22
br i1 %39, label %40, label %24
40: ; preds = %36, %18
ret void
}