int main(int argc, char *argv[]) {
  int i = str_int("9999");
  char str[50], ll[70];
  printf("%d", i);
  printf("\n%d\n", strcmpi("yah0o", "yAH0o0"));
  printf("\n%s\n", int_str(10780094, str));
  strcpy(str, "1000");
  sscanf(str, "%x", &i);
  printf("\nin integer : %d\n", i);
  printf("\nhexadecimal value : %s\n", dec2hex(3456, str));
  dec2bin(45, str);
  printf("\nbinary value :%s\n", str);
  strcpy(str, "fff");
  add_0(str, 5);
  printf("\nadding 0s : %s\n", str);
  constant2object_code("C'EOF'", str);
  printf("\nObject code : %s\n", str);
  strcpy(
      ll,
      "T001000  1410334820390010362810303010154820613C100300102A0C103900102D");
  strcpy(str, "101E");
  calc_length(ll, str);
  printf("\nListing line : %s\n", ll);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe30(%rip),%rdi
mov    $0x0,%al
call   1060 <str_int@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe1b(%rip),%rdi
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1070 <strcmpi@plt>
mov    %eax,%esi
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
mov    $0xa47dbe,%edi
mov    $0x0,%al
call   1050 <int_str@plt>
mov    %eax,%esi
lea    0xdf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    0xde4(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    0xdd9(%rip),%rsi
lea    -0x14(%rbp),%rdx
mov    $0x0,%al
call   1090 <sscanf@plt>
mov    -0x14(%rbp),%esi
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
mov    $0xd80,%edi
mov    $0x0,%al
call   10c0 <dec2hex@plt>
mov    %eax,%esi
lea    0xdb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
mov    $0x2d,%edi
mov    $0x0,%al
call   10b0 <dec2bin@plt>
lea    -0x50(%rbp),%rsi
lea    0xdb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
lea    0xdb1(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   10d0 <add_0@plt>
lea    -0x50(%rbp),%rsi
lea    0xd95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1080 <constant2object_code@plt>
lea    -0x50(%rbp),%rsi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xa0(%rbp),%rdi
lea    0xd87(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x50(%rbp),%rdi
lea    0xdbd(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    -0x50(%rbp),%rsi
mov    $0x0,%al
call   10a0 <calc_length@plt>
lea    -0xa0(%rbp),%rsi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x98,%rsp
lea    0xe4f(%rip),%rdi
xor    %eax,%eax
call   1050 <str_int@plt>
mov    %eax,0xc(%rsp)
lea    0xe42(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe3a(%rip),%rdi
lea    0xe39(%rip),%rsi
xor    %eax,%eax
call   1060 <strcmpi@plt>
lea    0xe20(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%r14
mov    $0xa47dbe,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <int_str@plt>
lea    0xe0e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x30303031,0x10(%rsp)
30
movb   $0x0,0x14(%rsp)
lea    0xdfb(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <sscanf@plt>
mov    0xc(%rsp),%esi
lea    0xde4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xd80,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <dec2hex@plt>
lea    0xdd9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x2d,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   10a0 <dec2bin@plt>
lea    0xdd3(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movl   $0x666666,0x10(%rsp)
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   10c0 <add_0@plt>
lea    0xdbe(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <constant2object_code@plt>
lea    0xdb4(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movabs $0x44323031303039,%rax
mov    %rax,0x8e(%rsp)
movups 0xda4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movups 0xda8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movups 0xdac(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movups 0xdb0(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movl   $0x45313031,0x10(%rsp)
45
movb   $0x0,0x14(%rsp)
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1090 <calc_length@plt>
lea    0xd9d(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"9999\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A%d\0A\00"
@.str.3 = [6 x i8] c"yah0o\00"
@.str.4 = [7 x i8] c"yAH0o0\00"
@.str.5 = [5 x i8] c"\0A%s\0A\00"
@.str.6 = [5 x i8] c"1000\00"
@.str.7 = [3 x i8] c"%x\00"
@.str.8 = [18 x i8] c"\0Ain integer : %d\0A\00"
@.str.9 = [25 x i8] c"\0Ahexadecimal value : %s\0A\00"
@.str.10 = [19 x i8] c"\0Abinary value :%s\0A\00"
@.str.11 = [4 x i8] c"fff\00"
@.str.12 = [17 x i8] c"\0Aadding 0s : %s\0A\00"
@.str.13 = [7 x i8] c"C'EOF'\00"
@.str.14 = [19 x i8] c"\0AObject code : %s\0A\00"
@.str.15 = [70 x i8] c"T001000 1410334820390010362810303010154820613C100300102A0C103900102D\00"
@.str.16 = [5 x i8] c"101E\00"
@.str.17 = [20 x i8] c"\0AListing line : %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [50 x i8]
%8 = alloca [70 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) bitcast (i32 (...)* @str_int to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strcmpi to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%15 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @int_str to i32 (i32, i8*, ...)*)(i32 10780094, i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%18 = call i8* @strcpy(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%20 = call i32 (i8*, i8*, ...) @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %6)
%21 = load i32, i32* %6
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %21)
%23 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%24 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @dec2hex to i32 (i32, i8*, ...)*)(i32 3456, i8* %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%27 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @dec2bin to i32 (i32, i8*, ...)*)(i32 45, i8* %26)
%28 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%31 = call i8* @strcpy(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0))
%32 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%33 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @add_0 to i32 (i8*, i32, ...)*)(i8* %32, i32 5)
%34 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* %34)
%36 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%37 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @constant2object_code to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* %36)
%38 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8* %38)
%40 = getelementptr inbounds [70 x i8], [70 x i8]* %8, i64 0, i64 0
%41 = call i8* @strcpy(i8* %40, i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.15, i64 0, i64 0))
%42 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%43 = call i8* @strcpy(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
%44 = getelementptr inbounds [70 x i8], [70 x i8]* %8, i64 0, i64 0
%45 = getelementptr inbounds [50 x i8], [50 x i8]* %7, i64 0, i64 0
%46 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @calc_length to i32 (i8*, i8*, ...)*)(i8* %44, i8* %45)
%47 = getelementptr inbounds [70 x i8], [70 x i8]* %8, i64 0, i64 0
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %47)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"9999\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [5 x i8] c"\0A%d\0A\00"
@.str.3 = [6 x i8] c"yah0o\00"
@.str.4 = [7 x i8] c"yAH0o0\00"
@.str.5 = [5 x i8] c"\0A%s\0A\00"
@.str.6 = [5 x i8] c"1000\00"
@.str.7 = [3 x i8] c"%x\00"
@.str.8 = [18 x i8] c"\0Ain integer : %d\0A\00"
@.str.9 = [25 x i8] c"\0Ahexadecimal value : %s\0A\00"
@.str.10 = [19 x i8] c"\0Abinary value :%s\0A\00"
@.str.12 = [17 x i8] c"\0Aadding 0s : %s\0A\00"
@.str.13 = [7 x i8] c"C'EOF'\00"
@.str.14 = [19 x i8] c"\0AObject code : %s\0A\00"
@.str.15 = [70 x i8] c"T001000 1410334820390010362810303010154820613C100300102A0C103900102D\00"
@.str.16 = [5 x i8] c"101E\00"
@.str.17 = [20 x i8] c"\0AListing line : %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca [50 x i8]
%5 = alloca [70 x i8]
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 (i8*, ...) bitcast (i32 (...)* @str_int to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %3
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%9 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 0
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%11 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @strcmpi to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %11)
%13 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @int_str to i32 (i32, i8*, ...)*)(i32 10780094, i8* %8)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = call i32 (i8*, i8*, ...) @sscanf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %3
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %16)
%18 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @dec2hex to i32 (i32, i8*, ...)*)(i32 3456, i8* %8)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0), i32 %18)
%20 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @dec2bin to i32 (i32, i8*, ...)*)(i32 45, i8* %8)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i8* %8)
%22 = bitcast [50 x i8]* %4 to i32*
store i32 6710886, i32* %22
%23 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @add_0 to i32 (i8*, i32, ...)*)(i8* %8, i32 5)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.12, i64 0, i64 0), i8* %8)
%25 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @constant2object_code to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* %8)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.14, i64 0, i64 0), i8* %8)
%27 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @calc_length to i32 (i8*, i8*, ...)*)(i8* %9, i8* %8)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0), i8* %9)
ret i32 0
}