#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*/ getBanglaNumStrRecursive(char *, int, char *,
                                            int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void getBanglaNumStr(char numStr[], char banglaNumStr[]) {
  int lenStr = (int)strlen(numStr);
  if (numStr[0] == '0' && lenStr == 1)
    strcpy(banglaNumStr, numStr);
  else
    getBanglaNumStrRecursive(numStr, lenStr, banglaNumStr, 0);
}


x86 assembly (clang, -O0):
<getBanglaNumStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    1178 <getBanglaNumStr+0x48>
cmpl   $0x1,-0x14(%rbp)
jne    1178 <getBanglaNumStr+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
jmp    118a <getBanglaNumStr+0x5a>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
call   1050 <getBanglaNumStrRecursive@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBanglaNumStr>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strlen@plt>
cmpb   $0x30,(%rbx)
jne    115b <getBanglaNumStr+0x2b>
cmp    $0x1,%eax
jne    115b <getBanglaNumStr+0x2b>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %r14,%rdx
xor    %ecx,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <getBanglaNumStrRecursive@plt>

LLVM IR (-O0):
define void @getBanglaNumStr(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = call i64 @strlen(i8* %6)
%8 = trunc i64 %7 to i32
store i32 %8, i32* %5
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 48
br i1 %13, label %14, label %21
14: ; preds = %2
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i8*, i8** %4
%19 = load i8*, i8** %3
%20 = call i32 @strcpy(i8* %18, i8* %19)
br label %26
21: ; preds = %14, %2
%22 = load i8*, i8** %3
%23 = load i32, i32* %5
%24 = load i8*, i8** %4
%25 = call i32 @getBanglaNumStrRecursive(i8* %22, i32 %23, i8* %24, i32 0)
br label %26
26: ; preds = %21, %17
ret void
}

LLVM IR (-O2):
define void @getBanglaNumStr(i8* %0, i8* %1) {
%3 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%4 = trunc i64 %3 to i32
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 48
%7 = icmp eq i32 %4, 1
%8 = select i1 %6, i1 %7, i1 false
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 @strcpy(i8* %1, i8* %0)
br label %13
11: ; preds = %2
%12 = tail call i32 @getBanglaNumStrRecursive(i8* %0, i32 %4, i8* %1, i32 0)
br label %13
13: ; preds = %11, %9
ret void
}