#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 m_len(int);
scalar_t__ mls(int, int);
char *v_kget(int var, int row) {
  if (var <= 0)
    return "";
  int len = m_len(var);
  if (row >= len)
    return "";
  char *s = (*(char **)mls((var), (row)));
  if (s == NULL)
    return "";
  return s;
}


x86 assembly (clang, -O0):
<v_kget>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jg     1148 <v_kget+0x28>
lea    0xec1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <v_kget+0x84>
mov    -0xc(%rbp),%edi
call   1030 <m_len@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     116f <v_kget+0x4f>
lea    0xe9a(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <v_kget+0x84>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1040 <mls@plt>
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    119c <v_kget+0x7c>
lea    0xe6d(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    11a4 <v_kget+0x84>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<v_kget>:
push   %rbp
push   %r14
push   %rbx
lea    0xed5(%rip),%rbx
test   %edi,%edi
jle    1159 <v_kget+0x39>
mov    %esi,%r14d
mov    %edi,%ebp
call   1030 <m_len@plt>
cmp    %r14d,%eax
jle    1159 <v_kget+0x39>
mov    %ebp,%edi
mov    %r14d,%esi
call   1040 <mls@plt>
mov    (%rax),%rax
test   %rax,%rax
lea    0xeab(%rip),%rbx
cmovne %rax,%rbx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @v_kget(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%8 = load i32, i32* %4
%9 = icmp sle i32 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %29
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @m_len(i32 %12)
store i32 %13, i32* %6
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = icmp sge i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %11
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %29
18: ; preds = %11
%19 = load i32, i32* %4
%20 = load i32, i32* %5
%21 = call i64 @mls(i32 %19, i32 %20)
%22 = inttoptr i64 %21 to i8**
%23 = load i8*, i8** %22
store i8* %23, i8** %7
%24 = load i8*, i8** %7
%25 = icmp eq i8* %24, null
br i1 %25, label %26, label %27
26: ; preds = %18
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8** %3
br label %29
27: ; preds = %18
%28 = load i8*, i8** %7
store i8* %28, i8** %3
br label %29
29: ; preds = %27, %26, %17, %10
%30 = load i8*, i8** %3
ret i8* %30
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @v_kget(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %13, label %4
4: ; preds = %2
%5 = tail call i32 @m_len(i32 %0)
%6 = icmp sgt i32 %5, %1
br i1 %6, label %7, label %13
7: ; preds = %4
%8 = tail call i64 @mls(i32 %0, i32 %1)
%9 = inttoptr i64 %8 to i8**
%10 = load i8*, i8** %9
%11 = icmp eq i8* %10, null
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %10
br label %13
13: ; preds = %7, %4, %2
%14 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %2 ], [ %12, %7 ], [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), %4 ]
ret i8* %14
}