#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 *, ...);
int print_func(long row_idx, long col_size, char *data[], void *params) {
  int i;
  for (i = 0; i < col_size; i++) {
    printf("\t%s", data[i]);
  }
  printf("\n");
  if (row_idx == 1) {
    printf("------------------------------------------\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    1165 <print_func+0x55>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    112f <print_func+0x1f>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x1,-0x8(%rbp)
jne    118c <print_func+0x7c>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_func>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r14
test   %rsi,%rsi
jle    1167 <print_func+0x37>
mov    %rdx,%r15
mov    %rsi,%r13
lea    0xeb2(%rip),%r12
xor    %ebx,%ebx
mov    (%r15,%rbx,8),%rsi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1150 <print_func+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x1,%r14
jne    1183 <print_func+0x53>
lea    0xe86(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\09%s\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [44 x i8] c"------------------------------------------\0A\00"
define i32 @print_func(i64 %0, i64 %1, i8** %2, i8* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i32
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8** %2, i8*** %7
store i8* %3, i8** %8
store i32 0, i32* %9
br label %10
10: ; preds = %22, %4
%11 = load i32, i32* %9
%12 = sext i32 %11 to i64
%13 = load i64, i64* %6
%14 = icmp slt i64 %12, %13
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load i8**, i8*** %7
%17 = load i32, i32* %9
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8*, i8** %16, i64 %18
%20 = load i8*, i8** %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %9
%24 = add nsw i32 %23, 1
store i32 %24, i32* %9
br label %10
25: ; preds = %10
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%27 = load i64, i64* %5
%28 = icmp eq i64 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %25
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.2, i64 0, i64 0))
br label %31
31: ; preds = %29, %25
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\09%s\00"
@str = [43 x i8] c"------------------------------------------\00"
define i32 @print_func(i64 %0, i64 %1, i8** nocapture %2, i8* nocapture readnone %3) {
%5 = icmp sgt i64 %1, 0
br i1 %5, label %6, label %13
6: ; preds = %4, %6
%7 = phi i64 [ %11, %6 ], [ 0, %4 ]
%8 = getelementptr inbounds i8*, i8** %2, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %1
br i1 %12, label %13, label %6
13: ; preds = %6, %4
%14 = tail call i32 @putchar(i32 10)
%15 = icmp eq i64 %0, 1
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
ret i32 0
}