#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*/ json_util_printSubstring(char *, int, int);
scalar_t__ json_util_stringCompare(char *, int, int, char *, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int strlen(char *);
void test_json_util_stringComare() {
  puts("Test json_util_stringCompare");
  puts("======================================================================="
       "=========");
  char *s1 = "123abcdefg";
  char *s2 = "abcdef123g";
  int i = 1;
  int s1_startIndex;
  int s1_endIndex;
  int s2_startIndex;
  int s2_endIndex;
  s1_startIndex = 0;
  s1_endIndex = 2;
  s2_startIndex = 6;
  s2_endIndex = 8;
  printf("%d. s1[%d..%d] = ", i++, s1_startIndex, s1_endIndex);
  json_util_printSubstring(s1, s1_startIndex, s1_endIndex);
  printf("\n   s2[%d..%d] = ", s2_startIndex, s2_endIndex);
  json_util_printSubstring(s2, s2_startIndex, s2_endIndex);
  printf("\n   it's%s match\n\n",
         json_util_stringCompare(s1, s1_startIndex, s1_endIndex, s2,
                                 s2_startIndex, s2_endIndex) == 0
             ? ""
             : " not");
  s1_startIndex = 3;
  s1_endIndex = 8;
  s2_startIndex = 0;
  s2_endIndex = 5;
  printf("%d. s1[%d..%d] = ", i++, s1_startIndex, s1_endIndex);
  json_util_printSubstring(s1, s1_startIndex, s1_endIndex);
  printf("\n   s2[%d..%d] = ", s2_startIndex, s2_endIndex);
  json_util_printSubstring(s2, s2_startIndex, s2_endIndex);
  printf("\n   it's%s match\n\n",
         json_util_stringCompare(s1, s1_startIndex, s1_endIndex, s2,
                                 s2_startIndex, s2_endIndex) == 0
             ? ""
             : " not");
  s1_startIndex = 0;
  s1_endIndex = 8;
  s2_startIndex = 0;
  s2_endIndex = 5;
  printf("%d. s1[%d..%d] = ", i++, s1_startIndex, s1_endIndex);
  json_util_printSubstring(s1, s1_startIndex, s1_endIndex);
  printf("\n   s2[%d..%d] = ", s2_startIndex, s2_endIndex);
  json_util_printSubstring(s2, s2_startIndex, s2_endIndex);
  printf("\n   it's%s match\n\n",
         json_util_stringCompare(s1, s1_startIndex, s1_endIndex, s2,
                                 s2_startIndex, s2_endIndex) == 0
             ? ""
             : " not");
  s1_startIndex = 0;
  s1_endIndex = strlen(s1) - 1;
  s2_startIndex = 0;
  s2_endIndex = strlen(s2) - 1;
  printf("%d. s1[%d..%d] = ", i++, s1_startIndex, s1_endIndex);
  json_util_printSubstring(s1, s1_startIndex, s1_endIndex);
  printf("\n   s2[%d..%d] = ", s2_startIndex, s2_endIndex);
  json_util_printSubstring(s2, s2_startIndex, s2_endIndex);
  printf("\n   it's%s match\n\n",
         json_util_stringCompare(s1, s1_startIndex, s1_endIndex, s2,
                                 s2_startIndex, s2_endIndex) == 0
             ? ""
             : " not");
  s1_startIndex = 3;
  s1_endIndex = strlen(s1) - 1;
  s2_startIndex = 3;
  s2_endIndex = strlen(s2) - 1;
  printf("%d. s1[%d..%d] = ", i++, s1_startIndex, s1_endIndex);
  json_util_printSubstring(s1, s1_startIndex, s1_endIndex);
  printf("\n   s2[%d..%d] = ", s2_startIndex, s2_endIndex);
  json_util_printSubstring(s2, s2_startIndex, s2_endIndex);
  printf("\n   it's%s match\n\n",
         json_util_stringCompare(s1, s1_startIndex, s1_endIndex, s2,
                                 s2_startIndex, s2_endIndex) == 0
             ? ""
             : " not");
  s1_startIndex = 0;
  s1_endIndex = 3;
  s2_startIndex = 6;
  s2_endIndex = 9;
  printf("%d. s1[%d..%d] = ", i++, s1_startIndex, s1_endIndex);
  json_util_printSubstring(s1, s1_startIndex, s1_endIndex);
  printf("\n   s2[%d..%d] = ", s2_startIndex, s2_endIndex);
  json_util_printSubstring(s2, s2_startIndex, s2_endIndex);
  printf("\n   it's%s match\n\n",
         json_util_stringCompare(s1, s1_startIndex, s1_endIndex, s2,
                                 s2_startIndex, s2_endIndex) == 0
             ? ""
             : " not");
  puts("======================================================================="
       "=========\n");
}


x86 assembly (clang, -O0):
<test_json_util_stringComare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
lea    0xeb2(%rip),%rdi
call   1040 <puts@plt>
lea    0xef7(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    0xef7(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
movl   $0x6,-0x20(%rbp)
movl   $0x8,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <json_util_stringCompare@plt>
mov    %rax,%rcx
lea    0xe9c(%rip),%rsi
lea    0xe94(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x3,-0x18(%rbp)
movl   $0x8,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x5,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe03(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <json_util_stringCompare@plt>
mov    %rax,%rcx
lea    0xded(%rip),%rsi
lea    0xde5(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xdc4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x8,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x5,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xd54(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <json_util_stringCompare@plt>
mov    %rax,%rcx
lea    0xd3e(%rip),%rsi
lea    0xd36(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xca6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xc95(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <json_util_stringCompare@plt>
mov    %rax,%rcx
lea    0xc7f(%rip),%rsi
lea    0xc77(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xc56(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x3,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x3,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1060 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xbe7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <json_util_stringCompare@plt>
mov    %rax,%rcx
lea    0xbc0(%rip),%rsi
lea    0xbb8(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xb97(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
movl   $0x0,-0x18(%rbp)
movl   $0x3,-0x1c(%rbp)
movl   $0x6,-0x20(%rbp)
movl   $0x9,-0x24(%rbp)
mov    -0x14(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xb38(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xb27(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1050 <json_util_printSubstring@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x20(%rbp),%r8d
mov    -0x24(%rbp),%r9d
call   1030 <json_util_stringCompare@plt>
mov    %rax,%rcx
lea    0xb11(%rip),%rsi
lea    0xb09(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xae8(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xaf2(%rip),%rdi
call   1040 <puts@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_json_util_stringComare>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe9e(%rip),%rdi
call   1040 <puts@plt>
lea    0xeaf(%rip),%rdi
call   1040 <puts@plt>
lea    0xf0a(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xed7(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x2,%edx
call   1050 <json_util_printSubstring@plt>
lea    0xee9(%rip),%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xeb1(%rip),%r13
mov    %r13,%rdi
mov    $0x6,%esi
mov    $0x8,%edx
call   1050 <json_util_printSubstring@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x2,%edx
mov    %r13,%rcx
mov    $0x6,%r8d
mov    $0x8,%r9d
call   1030 <json_util_stringCompare@plt>
test   %rax,%rax
lea    0xeb8(%rip),%rax
lea    0xeb2(%rip),%r12
mov    %r12,%rsi
cmove  %rax,%rsi
mov    %rax,%rbp
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x8,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    $0x8,%edx
call   1050 <json_util_printSubstring@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <json_util_printSubstring@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    $0x8,%edx
mov    %r13,%rcx
xor    %r8d,%r8d
mov    $0x5,%r9d
call   1030 <json_util_stringCompare@plt>
test   %rax,%rax
mov    %r12,%rsi
cmove  %rbp,%rsi
mov    %rbp,%r15
lea    0xe0a(%rip),%rdi
mov    %rdi,%rbp
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdd5(%rip),%rdi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x8,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1050 <json_util_printSubstring@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    $0x5,%edx
call   1050 <json_util_printSubstring@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
mov    %r13,%rcx
xor    %r8d,%r8d
mov    $0x5,%r9d
call   1030 <json_util_stringCompare@plt>
test   %rax,%rax
mov    %r12,%rsi
cmove  %r15,%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    -0x1(%rax),%r15d
mov    %r13,%rdi
call   1060 <strlen@plt>
lea    -0x1(%rax),%ebp
lea    0xd46(%rip),%rdi
mov    $0x4,%esi
xor    %edx,%edx
mov    %r15d,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
call   1050 <json_util_printSubstring@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
xor    %esi,%esi
mov    %ebp,%edx
call   1050 <json_util_printSubstring@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
mov    %r13,%rcx
xor    %r8d,%r8d
mov    %ebp,%r9d
call   1030 <json_util_stringCompare@plt>
test   %rax,%rax
mov    %r12,%rsi
lea    0xd21(%rip),%rax
cmove  %rax,%rsi
lea    0xd04(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1060 <strlen@plt>
lea    -0x1(%rax),%ebp
mov    %r13,%rdi
call   1060 <strlen@plt>
lea    -0x1(%rax),%ebx
lea    0xcbc(%rip),%r15
mov    %r15,%rdi
mov    $0x5,%esi
mov    $0x3,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebp,%edx
call   1050 <json_util_printSubstring@plt>
lea    0xca2(%rip),%rdi
mov    $0x3,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
mov    $0x3,%esi
mov    %ebx,%edx
call   1050 <json_util_printSubstring@plt>
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebp,%edx
mov    %r13,%rcx
mov    $0x3,%r8d
mov    %ebx,%r9d
call   1030 <json_util_stringCompare@plt>
test   %rax,%rax
mov    %r12,%rsi
lea    0xc81(%rip),%rbx
cmove  %rbx,%rsi
lea    0xc64(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r15,%rdi
mov    $0x6,%esi
xor    %edx,%edx
mov    $0x3,%ecx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3,%edx
call   1050 <json_util_printSubstring@plt>
lea    0xc1c(%rip),%rdi
mov    $0x6,%esi
mov    $0x9,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r13,%rdi
mov    $0x6,%esi
mov    $0x9,%edx
call   1050 <json_util_printSubstring@plt>
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x3,%edx
mov    %r13,%rcx
mov    $0x6,%r8d
mov    $0x9,%r9d
call   1030 <json_util_stringCompare@plt>
test   %rax,%rax
cmove  %rbx,%r12
mov    %rbp,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xbea(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"Test json_util_stringCompare\00"
@.str.1 = [81 x i8] c"================================================================================\00"
@.str.2 = [11 x i8] c"123abcdefg\00"
@.str.3 = [11 x i8] c"abcdef123g\00"
@.str.4 = [18 x i8] c"%d. s1[%d..%d] = \00"
@.str.5 = [18 x i8] c"\0A s2[%d..%d] = \00"
@.str.6 = [19 x i8] c"\0A it's%s match\0A\0A\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [5 x i8] c" not\00"
@.str.9 = [82 x i8] c"================================================================================\0A\00"
define void @test_json_util_stringComare() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = call i32 @puts(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i8** %1
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i8** %2
store i32 1, i32* %3
store i32 0, i32* %4
store i32 2, i32* %5
store i32 6, i32* %6
store i32 8, i32* %7
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %12, i32 %13)
%15 = load i8*, i8** %1
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i32 @json_util_printSubstring(i8* %15, i32 %16, i32 %17)
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i8*, i8** %2
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = call i32 @json_util_printSubstring(i8* %22, i32 %23, i32 %24)
%26 = load i8*, i8** %1
%27 = load i32, i32* %4
%28 = load i32, i32* %5
%29 = load i8*, i8** %2
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = call i64 @json_util_stringCompare(i8* %26, i32 %27, i32 %28, i8* %29, i32 %30, i32 %31)
%33 = icmp eq i64 %32, 0
%34 = zext i1 %33 to i64
%35 = select i1 %33, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %35)
store i32 3, i32* %4
store i32 8, i32* %5
store i32 0, i32* %6
store i32 5, i32* %7
%37 = load i32, i32* %3
%38 = add nsw i32 %37, 1
store i32 %38, i32* %3
%39 = load i32, i32* %4
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %37, i32 %39, i32 %40)
%42 = load i8*, i8** %1
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = call i32 @json_util_printSubstring(i8* %42, i32 %43, i32 %44)
%46 = load i32, i32* %6
%47 = load i32, i32* %7
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %46, i32 %47)
%49 = load i8*, i8** %2
%50 = load i32, i32* %6
%51 = load i32, i32* %7
%52 = call i32 @json_util_printSubstring(i8* %49, i32 %50, i32 %51)
%53 = load i8*, i8** %1
%54 = load i32, i32* %4
%55 = load i32, i32* %5
%56 = load i8*, i8** %2
%57 = load i32, i32* %6
%58 = load i32, i32* %7
%59 = call i64 @json_util_stringCompare(i8* %53, i32 %54, i32 %55, i8* %56, i32 %57, i32 %58)
%60 = icmp eq i64 %59, 0
%61 = zext i1 %60 to i64
%62 = select i1 %60, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %62)
store i32 0, i32* %4
store i32 8, i32* %5
store i32 0, i32* %6
store i32 5, i32* %7
%64 = load i32, i32* %3
%65 = add nsw i32 %64, 1
store i32 %65, i32* %3
%66 = load i32, i32* %4
%67 = load i32, i32* %5
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %64, i32 %66, i32 %67)
%69 = load i8*, i8** %1
%70 = load i32, i32* %4
%71 = load i32, i32* %5
%72 = call i32 @json_util_printSubstring(i8* %69, i32 %70, i32 %71)
%73 = load i32, i32* %6
%74 = load i32, i32* %7
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %73, i32 %74)
%76 = load i8*, i8** %2
%77 = load i32, i32* %6
%78 = load i32, i32* %7
%79 = call i32 @json_util_printSubstring(i8* %76, i32 %77, i32 %78)
%80 = load i8*, i8** %1
%81 = load i32, i32* %4
%82 = load i32, i32* %5
%83 = load i8*, i8** %2
%84 = load i32, i32* %6
%85 = load i32, i32* %7
%86 = call i64 @json_util_stringCompare(i8* %80, i32 %81, i32 %82, i8* %83, i32 %84, i32 %85)
%87 = icmp eq i64 %86, 0
%88 = zext i1 %87 to i64
%89 = select i1 %87, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %89)
store i32 0, i32* %4
%91 = load i8*, i8** %1
%92 = call i32 @strlen(i8* %91)
%93 = sub nsw i32 %92, 1
store i32 %93, i32* %5
store i32 0, i32* %6
%94 = load i8*, i8** %2
%95 = call i32 @strlen(i8* %94)
%96 = sub nsw i32 %95, 1
store i32 %96, i32* %7
%97 = load i32, i32* %3
%98 = add nsw i32 %97, 1
store i32 %98, i32* %3
%99 = load i32, i32* %4
%100 = load i32, i32* %5
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %97, i32 %99, i32 %100)
%102 = load i8*, i8** %1
%103 = load i32, i32* %4
%104 = load i32, i32* %5
%105 = call i32 @json_util_printSubstring(i8* %102, i32 %103, i32 %104)
%106 = load i32, i32* %6
%107 = load i32, i32* %7
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %106, i32 %107)
%109 = load i8*, i8** %2
%110 = load i32, i32* %6
%111 = load i32, i32* %7
%112 = call i32 @json_util_printSubstring(i8* %109, i32 %110, i32 %111)
%113 = load i8*, i8** %1
%114 = load i32, i32* %4
%115 = load i32, i32* %5
%116 = load i8*, i8** %2
%117 = load i32, i32* %6
%118 = load i32, i32* %7
%119 = call i64 @json_util_stringCompare(i8* %113, i32 %114, i32 %115, i8* %116, i32 %117, i32 %118)
%120 = icmp eq i64 %119, 0
%121 = zext i1 %120 to i64
%122 = select i1 %120, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %122)
store i32 3, i32* %4
%124 = load i8*, i8** %1
%125 = call i32 @strlen(i8* %124)
%126 = sub nsw i32 %125, 1
store i32 %126, i32* %5
store i32 3, i32* %6
%127 = load i8*, i8** %2
%128 = call i32 @strlen(i8* %127)
%129 = sub nsw i32 %128, 1
store i32 %129, i32* %7
%130 = load i32, i32* %3
%131 = add nsw i32 %130, 1
store i32 %131, i32* %3
%132 = load i32, i32* %4
%133 = load i32, i32* %5
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %130, i32 %132, i32 %133)
%135 = load i8*, i8** %1
%136 = load i32, i32* %4
%137 = load i32, i32* %5
%138 = call i32 @json_util_printSubstring(i8* %135, i32 %136, i32 %137)
%139 = load i32, i32* %6
%140 = load i32, i32* %7
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %139, i32 %140)
%142 = load i8*, i8** %2
%143 = load i32, i32* %6
%144 = load i32, i32* %7
%145 = call i32 @json_util_printSubstring(i8* %142, i32 %143, i32 %144)
%146 = load i8*, i8** %1
%147 = load i32, i32* %4
%148 = load i32, i32* %5
%149 = load i8*, i8** %2
%150 = load i32, i32* %6
%151 = load i32, i32* %7
%152 = call i64 @json_util_stringCompare(i8* %146, i32 %147, i32 %148, i8* %149, i32 %150, i32 %151)
%153 = icmp eq i64 %152, 0
%154 = zext i1 %153 to i64
%155 = select i1 %153, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %155)
store i32 0, i32* %4
store i32 3, i32* %5
store i32 6, i32* %6
store i32 9, i32* %7
%157 = load i32, i32* %3
%158 = add nsw i32 %157, 1
store i32 %158, i32* %3
%159 = load i32, i32* %4
%160 = load i32, i32* %5
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 %157, i32 %159, i32 %160)
%162 = load i8*, i8** %1
%163 = load i32, i32* %4
%164 = load i32, i32* %5
%165 = call i32 @json_util_printSubstring(i8* %162, i32 %163, i32 %164)
%166 = load i32, i32* %6
%167 = load i32, i32* %7
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %166, i32 %167)
%169 = load i8*, i8** %2
%170 = load i32, i32* %6
%171 = load i32, i32* %7
%172 = call i32 @json_util_printSubstring(i8* %169, i32 %170, i32 %171)
%173 = load i8*, i8** %1
%174 = load i32, i32* %4
%175 = load i32, i32* %5
%176 = load i8*, i8** %2
%177 = load i32, i32* %6
%178 = load i32, i32* %7
%179 = call i64 @json_util_stringCompare(i8* %173, i32 %174, i32 %175, i8* %176, i32 %177, i32 %178)
%180 = icmp eq i64 %179, 0
%181 = zext i1 %180 to i64
%182 = select i1 %180, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%183 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %182)
%184 = call i32 @puts(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"Test json_util_stringCompare\00"
@.str.1 = [81 x i8] c"================================================================================\00"
@.str.2 = [11 x i8] c"123abcdefg\00"
@.str.3 = [11 x i8] c"abcdef123g\00"
@.str.4 = [18 x i8] c"%d. s1[%d..%d] = \00"
@.str.5 = [18 x i8] c"\0A s2[%d..%d] = \00"
@.str.6 = [19 x i8] c"\0A it's%s match\0A\0A\00"
@.str.7 = [1 x i8] zeroinitializer
@.str.8 = [5 x i8] c" not\00"
@.str.9 = [82 x i8] c"================================================================================\0A\00"
define void @test_json_util_stringComare() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 1, i32 0, i32 2)
%4 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 6, i32 8)
%6 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 8)
%7 = tail call i64 @json_util_stringCompare(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 8)
%8 = icmp eq i64 %7, 0
%9 = select i1 %8, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %9)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 2, i32 3, i32 8)
%12 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 8)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 5)
%14 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 5)
%15 = tail call i64 @json_util_stringCompare(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 5)
%16 = icmp eq i64 %15, 0
%17 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %17)
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 3, i32 0, i32 8)
%20 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 8)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 5)
%22 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 5)
%23 = tail call i64 @json_util_stringCompare(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 5)
%24 = icmp eq i64 %23, 0
%25 = select i1 %24, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %25)
%27 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%28 = add nsw i32 %27, -1
%29 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%30 = add nsw i32 %29, -1
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 4, i32 0, i32 %28)
%32 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %28)
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 %30)
%34 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %30)
%35 = tail call i64 @json_util_stringCompare(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %28, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %30)
%36 = icmp eq i64 %35, 0
%37 = select i1 %36, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %37)
%39 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
%40 = add nsw i32 %39, -1
%41 = tail call i32 @strlen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%42 = add nsw i32 %41, -1
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 5, i32 3, i32 %40)
%44 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %40)
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 3, i32 %42)
%46 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %42)
%47 = tail call i64 @json_util_stringCompare(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 3, i32 %40, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 3, i32 %42)
%48 = icmp eq i64 %47, 0
%49 = select i1 %48, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %49)
%51 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32 6, i32 0, i32 3)
%52 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 3)
%53 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 6, i32 9)
%54 = tail call i32 @json_util_printSubstring(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 9)
%55 = tail call i64 @json_util_stringCompare(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 3, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 6, i32 9)
%56 = icmp eq i64 %55, 0
%57 = select i1 %56, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0)
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.6, i64 0, i64 0), i8* %57)
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([82 x i8], [82 x i8]* @.str.9, i64 0, i64 0))
ret void
}