#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 */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int getMinimum(char **, int, int);
int /*<<< orphan*/ printf(char *, int);
int strlen(char *);
void main() {
  char *str[] = {"5115307784486194059621489738352249846",
                 "6590437464919347013936831318719407272"};
  int row = sizeof(str) / sizeof(str[0]);
  int col = strlen(str[0]);
  int res = getMinimum(str, row, col);
  printf("Cost is %d", res);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2cd1(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cce(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1050 <getMinimum@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%esi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0x2cd5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeba(%rip),%rdi
call   1030 <strlen@plt>
mov    %rsp,%rdi
mov    $0x2,%esi
mov    %eax,%edx
call   1050 <getMinimum@plt>
lea    0xeeb(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [38 x i8] c"5115307784486194059621489738352249846\00"
@.str.1 = [38 x i8] c"6590437464919347013936831318719407272\00"
@__const.main.str = [2 x i8*] [i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [11 x i8] c"Cost is %d\00"
define void @main() {
%1 = alloca [2 x i8*]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast [2 x i8*]* %1 to i8*
store i32 2, i32* %2
%6 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%7 = load i8*, i8** %6
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %3
%9 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @getMinimum(i8** %9, i32 %10, i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %13)
ret void
}

LLVM IR (-O2):
@.str = [38 x i8] c"5115307784486194059621489738352249846\00"
@.str.1 = [38 x i8] c"6590437464919347013936831318719407272\00"
@__const.main.str = [2 x i8*] [i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i32 0, i32 0)]
@.str.2 = [11 x i8] c"Cost is %d\00"
define void @main() {
%1 = alloca [2 x i8*]
%2 = bitcast [2 x i8*]* %1 to i8*
%3 = getelementptr inbounds [2 x i8*], [2 x i8*]* %1, i64 0, i64 0
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @getMinimum(i8** %3, i32 2, i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret void
}