#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ mtdLib_str_getColByDelPos_int(char *, char, int, int *);
int mtdLib_str_getColNumbers(char *, char);
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  char array[] = "10,20,30,a";
  char delimiter = ',';
  int resp = 0;
  printf("# Number of colluns: %d\n",
         mtdLib_str_getColNumbers(array, delimiter));
  mtdLib_str_getColByDelPos_int(array, delimiter, 1, &resp);
  printf("# Resp: %d\n", resp);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeaa(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xea7(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xe9f(%rip),%al
mov    %al,-0x5(%rbp)
movb   $0x2c,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    -0xf(%rbp),%rdi
movsbl -0x10(%rbp),%esi
call   1060 <mtdLib_str_getColNumbers@plt>
mov    %eax,%esi
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
lea    -0xf(%rbp),%rdi
mov    $0x1,%edx
lea    -0x14(%rbp),%rcx
movsbl -0x10(%rbp),%esi
call   1040 <mtdLib_str_getColByDelPos_int@plt>
mov    -0x14(%rbp),%esi
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x30332c30322c3031,%rax
2c 33 30
mov    %rax,0x10(%rsp)
movl   $0x612c30,0x17(%rsp)
movl   $0x0,0xc(%rsp)
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1060 <mtdLib_str_getColNumbers@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    $0x2c,%esi
mov    $0x1,%edx
call   1040 <mtdLib_str_getColByDelPos_int@plt>
mov    0xc(%rsp),%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@__const.main.array = [11 x i8] c"10,20,30,a\00"
@.str = [25 x i8] c"# Number of colluns: %d\0A\00"
@.str.1 = [12 x i8] c"# Resp: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8]
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [11 x i8]* %2 to i8*
store i8 44, i8* %3
store i32 0, i32* %4
%6 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %3
%8 = call i32 @mtdLib_str_getColNumbers(i8* %6, i8 signext %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [11 x i8], [11 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %3
%12 = call i32 @mtdLib_str_getColByDelPos_int(i8* %10, i8 signext %11, i32 1, i32* %4)
%13 = load i32, i32* %4
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.main.array = [11 x i8] c"10,20,30,a\00"
@.str = [25 x i8] c"# Number of colluns: %d\0A\00"
@.str.1 = [12 x i8] c"# Resp: %d\0A\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = alloca i32
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%4 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%5 = call i32 @mtdLib_str_getColNumbers(i8* %3, i8 signext 44)
%6 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @mtdLib_str_getColByDelPos_int(i8* %3, i8 signext 44, i32 1, i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = call i32 @exit(i32 0)
unreachable
}