#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*/ free(char *);
int /*<<< orphan*/ printf(char *, char *);
char *unicode_to_zawgyi(char *);
char *zawgyi_to_unicode(char *);
int /*<<< orphan*/ zuconverter_close();
int /*<<< orphan*/ zuconverter_open();
int main(int argc, const char *argv[]) {
  zuconverter_open();
  char *outCStr = zawgyi_to_unicode(
      "သီဟိုဠ္မွ ဥာဏ္ႀကီးရွင္သည္ အာယုဝၯနေဆးညႊန္းစာကို ဇလြန္ေဈးေဘးဗာဒံပင္ထက္ အဓိ႒ာန္လ်က္ ဂဃနဏဖတ္ခဲ့သည္။");
  printf("ZG => UNI: %s\n", outCStr);
  outCStr = unicode_to_zawgyi(outCStr);
  printf("UNI => ZG: %s\n", outCStr);
  free(outCStr);
  zuconverter_close();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <zuconverter_open@plt>
lea    0xe7c(%rip),%rdi
call   1080 <zawgyi_to_unicode@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xf7c(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1070 <unicode_to_zawgyi@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xf6e(%rip),%rdi
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <zuconverter_close@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1050 <zuconverter_open@plt>
lea    0xe91(%rip),%rdi
call   1080 <zawgyi_to_unicode@plt>
mov    %rax,%rbx
lea    0xf96(%rip),%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1070 <unicode_to_zawgyi@plt>
mov    %rax,%rbx
lea    0xf8b(%rip),%rdi
mov    %rax,%rsi
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <zuconverter_close@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [276 x i8] c"\E1\80\9E\E1\80\AE\E1\80\9F\E1\80\AD\E1\80\AF\E1\80\A0\E1\80\B9\E1\80\99\E1\80\BD \E1\80\A5\E1\80\AC\E1\80\8F\E1\80\B9\E1\82\80\E1\80\80\E1\80\AE\E1\80\B8\E1\80\9B\E1\80\BD\E1\80\84\E1\80\B9\E1\80\9E\E1\80\8A\E1\80\B9 \E1\80\A1\E1\80\AC\E1\80\9A\E1\80\AF\E1\80\9D\E1\81\AF\E1\80\94\E1\80\B1\E1\80\86\E1\80\B8\E1\80\8A\E1\82\8A\E1\80\94\E1\80\B9\E1\80\B8\E1\80\85\E1\80\AC\E1\80\80\E1\80\AD\E1\80\AF \E1\80\87\E1\80\9C\E1\80\BC\E1\80\94\E1\80\B9\E1\80\B1\E1\80\88\E1\80\B8\E1\80\B1\E1\80\98\E1\80\B8\E1\80\97\E1\80\AC\E1\80\92\E1\80\B6\E1\80\95\E1\80\84\E1\80\B9\E1\80\91\E1\80\80\E1\80\B9 \E1\80\A1\E1\80\93\E1\80\AD\E1\82\92\E1\80\AC\E1\80\94\E1\80\B9\E1\80\9C\E1\80\BA\E1\80\80\E1\80\B9 \E1\80\82\E1\80\83\E1\80\94\E1\80\8F\E1\80\96\E1\80\90\E1\80\B9\E1\80\81\E1\80\B2\E1\80\B7\E1\80\9E\E1\80\8A\E1\80\B9\E1\81\8B\00"
@.str.1 = [15 x i8] c"ZG => UNI: %s\0A\00"
@.str.2 = [15 x i8] c"UNI => ZG: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @zuconverter_open()
%8 = call i8* @zawgyi_to_unicode(i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
store i8* %8, i8** %6
%9 = load i8*, i8** %6
%10 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %6
%12 = call i8* @unicode_to_zawgyi(i8* %11)
store i8* %12, i8** %6
%13 = load i8*, i8** %6
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %13)
%15 = load i8*, i8** %6
%16 = call i32 @free(i8* %15)
%17 = call i32 (...) @zuconverter_close()
ret i32 0
}

LLVM IR (-O2):
@.str = [276 x i8] c"\E1\80\9E\E1\80\AE\E1\80\9F\E1\80\AD\E1\80\AF\E1\80\A0\E1\80\B9\E1\80\99\E1\80\BD \E1\80\A5\E1\80\AC\E1\80\8F\E1\80\B9\E1\82\80\E1\80\80\E1\80\AE\E1\80\B8\E1\80\9B\E1\80\BD\E1\80\84\E1\80\B9\E1\80\9E\E1\80\8A\E1\80\B9 \E1\80\A1\E1\80\AC\E1\80\9A\E1\80\AF\E1\80\9D\E1\81\AF\E1\80\94\E1\80\B1\E1\80\86\E1\80\B8\E1\80\8A\E1\82\8A\E1\80\94\E1\80\B9\E1\80\B8\E1\80\85\E1\80\AC\E1\80\80\E1\80\AD\E1\80\AF \E1\80\87\E1\80\9C\E1\80\BC\E1\80\94\E1\80\B9\E1\80\B1\E1\80\88\E1\80\B8\E1\80\B1\E1\80\98\E1\80\B8\E1\80\97\E1\80\AC\E1\80\92\E1\80\B6\E1\80\95\E1\80\84\E1\80\B9\E1\80\91\E1\80\80\E1\80\B9 \E1\80\A1\E1\80\93\E1\80\AD\E1\82\92\E1\80\AC\E1\80\94\E1\80\B9\E1\80\9C\E1\80\BA\E1\80\80\E1\80\B9 \E1\80\82\E1\80\83\E1\80\94\E1\80\8F\E1\80\96\E1\80\90\E1\80\B9\E1\80\81\E1\80\B2\E1\80\B7\E1\80\9E\E1\80\8A\E1\80\B9\E1\81\8B\00"
@.str.1 = [15 x i8] c"ZG => UNI: %s\0A\00"
@.str.2 = [15 x i8] c"UNI => ZG: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @zuconverter_open()
%4 = tail call i8* @zawgyi_to_unicode(i8* getelementptr inbounds ([276 x i8], [276 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%6 = tail call i8* @unicode_to_zawgyi(i8* %4)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%8 = tail call i32 @free(i8* %6)
%9 = tail call i32 (...) @zuconverter_close()
ret i32 0
}