#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 logMatrix(const char *seq1, const char *seq2, int lenSeq1, int lenSeq2,
               int **scoring) {
  int i, j;
  printf("\t");
  for (int i = 0; i < lenSeq2; i++) {
    printf("%c\t", seq2[i]);
  }
  printf("\n");
  for (i = 0; i < lenSeq1; i++) {
    printf("%c\t", seq1[i]);
    for (j = 0; j < lenSeq2; j++) {
      printf("%d\t", scoring[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<logMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1173 <logMatrix+0x63>
mov    -0x10(%rbp),%rax
movslq -0x2c(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    113f <logMatrix+0x2f>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    120c <logMatrix+0xfc>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    11f0 <logMatrix+0xe0>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x28(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe2b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b5 <logMatrix+0xa5>
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1188 <logMatrix+0x78>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logMatrix>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8,%rbx
mov    %ecx,%ebp
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,0x10(%rsp)
mov    $0x9,%edi
call   1030 <putchar@plt>
mov    %ebp,%r15d
mov    %ebp,0xc(%rsp)
test   %ebp,%ebp
jle    1178 <logMatrix+0x58>
lea    0xea6(%rip),%r13
xor    %ebp,%ebp
nopl   0x0(%rax)
movsbl (%r14,%rbp,1),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1160 <logMatrix+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
jle    11fd <logMatrix+0xdd>
mov    %r12d,%r13d
lea    0xe73(%rip),%rbp
xor    %r14d,%r14d
jmp    11b3 <logMatrix+0x93>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
cmp    %r13,%r14
je     11fd <logMatrix+0xdd>
mov    0x10(%rsp),%rax
movsbl (%rax,%r14,1),%esi
lea    0xe3c(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0xc(%rsp)
jle    11a0 <logMatrix+0x80>
xor    %r12d,%r12d
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r14,8),%rax
mov    (%rax,%r12,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r12
cmp    %r12,%r15
jne    11e0 <logMatrix+0xc0>
jmp    11a0 <logMatrix+0x80>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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